2021-04-09 16:39:38 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
* @ingroup Maintenance
|
|
|
|
|
*/
|
|
|
|
|
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreStart
|
2021-04-09 16:39:38 +00:00
|
|
|
require_once __DIR__ . '/Maintenance.php';
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreEnd
|
2021-04-09 16:39:38 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Maintenance script for finding the files that contain classes
|
|
|
|
|
*
|
|
|
|
|
* @ingroup Maintenance
|
|
|
|
|
* @since 1.37
|
|
|
|
|
*/
|
|
|
|
|
class FindClasses extends Maintenance {
|
|
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
|
parent::__construct();
|
|
|
|
|
$this->addDescription( 'Finds the files containing classes via the autoloader.' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function execute() {
|
2024-08-10 14:50:30 +00:00
|
|
|
$stdin = $this->getStdin();
|
2021-04-09 16:39:38 +00:00
|
|
|
|
2024-08-10 14:50:30 +00:00
|
|
|
while ( !feof( $stdin ) ) {
|
|
|
|
|
$line = fgets( $stdin );
|
|
|
|
|
if ( $line === false ) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-04-09 16:39:38 +00:00
|
|
|
$class = trim( $line );
|
|
|
|
|
$filename = AutoLoader::find( $class );
|
|
|
|
|
if ( $filename ) {
|
2024-08-10 14:50:30 +00:00
|
|
|
$this->output( "$filename\n" );
|
2021-04-09 16:39:38 +00:00
|
|
|
} elseif ( $class ) {
|
2024-08-10 14:50:30 +00:00
|
|
|
$this->output( "#$class\n" );
|
2021-04-09 16:39:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreStart
|
2021-04-09 16:39:38 +00:00
|
|
|
$maintClass = FindClasses::class;
|
|
|
|
|
require_once RUN_MAINTENANCE_IF_MAIN;
|
2024-08-27 12:00:25 +00:00
|
|
|
// @codeCoverageIgnoreEnd
|