2014-09-26 21:42:19 +00:00
|
|
|
<?php
|
|
|
|
|
2017-06-16 04:28:45 +00:00
|
|
|
// Keep in sync with same script in Flow.
|
|
|
|
|
|
|
|
require_once getenv( 'MW_INSTALL_PATH' ) !== false
|
|
|
|
? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php'
|
|
|
|
: __DIR__ . '/../../../maintenance/Maintenance.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Generates Echo autoload info
|
|
|
|
*/
|
|
|
|
|
|
|
|
class GenerateEchoAutoload extends Maintenance {
|
|
|
|
public function __construct() {
|
2017-06-26 18:03:04 +00:00
|
|
|
parent::__construct();
|
2019-03-27 05:07:48 +00:00
|
|
|
$this->addDescription( 'Generates Echo autoload data' );
|
2014-09-26 21:42:19 +00:00
|
|
|
}
|
|
|
|
|
2017-06-16 04:28:45 +00:00
|
|
|
public function execute() {
|
|
|
|
$base = dirname( __DIR__ );
|
|
|
|
$generator = new AutoloadGenerator( $base );
|
|
|
|
$dirs = [
|
|
|
|
'includes',
|
|
|
|
'tests',
|
|
|
|
'maintenance',
|
|
|
|
];
|
|
|
|
foreach ( $dirs as $dir ) {
|
|
|
|
$generator->readDir( $base . '/' . $dir );
|
|
|
|
}
|
|
|
|
foreach ( glob( $base . '/*.php' ) as $file ) {
|
|
|
|
$generator->readFile( $file );
|
|
|
|
}
|
|
|
|
|
|
|
|
$target = $generator->getTargetFileInfo();
|
2016-08-29 23:05:10 +00:00
|
|
|
|
2017-06-16 04:28:45 +00:00
|
|
|
file_put_contents(
|
|
|
|
$target['filename'],
|
|
|
|
$generator->getAutoload( basename( __DIR__ ) . '/' . basename( __FILE__ ) )
|
|
|
|
);
|
2014-09-26 21:42:19 +00:00
|
|
|
|
2017-06-16 04:28:45 +00:00
|
|
|
echo "Done.\n\n";
|
|
|
|
}
|
2014-09-26 21:42:19 +00:00
|
|
|
}
|
|
|
|
|
2022-06-16 20:36:46 +00:00
|
|
|
$maintClass = GenerateEchoAutoload::class;
|
2017-06-16 04:28:45 +00:00
|
|
|
require_once RUN_MAINTENANCE_IF_MAIN;
|