- public function generateAutoload( $commandName = 'AutoloadGenerator' ) {
-
- // We need to check whether an extenson.json exists or not, and
- // incase it doesn't, update the autoload.php file.
-
- if ( file_exists( $this->basepath . '/extension.json' ) ) {
- require_once __DIR__ . '/../../includes/json/FormatJson.php';
- $key = 'AutoloadClasses';
- $json = FormatJson::decode( file_get_contents( $this->basepath
- . '/extension.json' ), true );
- unset( $json[$key] );
- // Inverting the key-value pairs so that they become of the
- // format class-name : path when they get converted into json.
- foreach ( $this->classes as $path => $contained ) {
- foreach ( $contained as $fqcn ) {
-
- // Using substr to remove the leading '/'
- $json[$key][$fqcn] = substr( $path, 1 );
- }
- }
- foreach ( $this->overrides as $path => $fqcn ) {
+ protected function generateJsonAutoload( $filename ) {
+ require_once __DIR__ . '/../../includes/json/FormatJson.php';
+ $key = 'AutoloadClasses';
+ $json = FormatJson::decode( file_get_contents( $filename ), true );
+ unset( $json[$key] );
+ // Inverting the key-value pairs so that they become of the
+ // format class-name : path when they get converted into json.
+ foreach ( $this->classes as $path => $contained ) {
+ foreach ( $contained as $fqcn ) {