You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This project simulates PHP autoloading system to use it in Semantic. It is composed of 3 parts:
AnEDE project,ede-php-autoload, that defines autoloading configuration for a project. It is able to parsecomposer.json files to extract autoloading information from it
ASemanticDB backend that can find a tag by name using the autoload information of the currentede-php-autoload project
Aminor mode,ede-php-autoload-mode, that enables the SemanticDB backend for a buffer.
Defining autoloads for a project
Let’s assume we have a project located at/home/me/my-project. It has 3 namespaces:
MyFirstNs, located atsrc/MyFirstNs, and uses the PSR-0 norm
MySecondNs, located atsrc/MySecondNs, and uses the PSR-4 norm
ThirdPartyNs, located atvendor/third-party/src, and uses the PSR-4 norm
Defining this project and its autoload information is done like this:
If you have acomposer.json at the root of your project, its autoload information (and also the one in the composer dependencies) will be merged with the information you put in:class-autoloads.
If yourcomposer.json contains all the autoload information, and you have nothing to add in:class-autoloads, you don’t have to define an EDE project by hand. It will be automatically created when you visit a file in your project.
Enabling the SemanticDB backend in php buffers
(add-hook'php-mode-hook#'ede-php-autoload-mode)
Commands
Name
Description
M-x ede-php-autoload-reload-autoloads
Similar to the reindexation in IDEs. Use it when your composer configuration changed to reload the autoloads.
License
This project is released under the GPL v3 license. SeeGPL for details.