MediaWiki  master
findClasses.php
Go to the documentation of this file.
1 <?php
22 require_once __DIR__ . '/Maintenance.php';
23 
30 class FindClasses extends Maintenance {
31 
32  public function __construct() {
33  parent::__construct();
34  $this->addDescription( 'Finds the files containing classes via the autoloader.' );
35  }
36 
37  public function execute() {
38  $input = file( 'php://stdin' );
39 
40  foreach ( $input as $line ) {
41  $class = trim( $line );
42  $filename = AutoLoader::find( $class );
43  if ( $filename ) {
44  print "$filename\n";
45  } elseif ( $class ) {
46  print "#$class\n";
47  }
48  }
49  }
50 }
51 
52 $maintClass = FindClasses::class;
53 require_once RUN_MAINTENANCE_IF_MAIN;
AutoLoader\find
static find( $className)
Find the file containing the given class.
Definition: AutoLoader.php:46
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition: Maintenance.php:329
FindClasses\execute
execute()
Do the actual work.
Definition: findClasses.php:37
FindClasses
Maintenance script for finding the files that contain classes.
Definition: findClasses.php:30
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition: Maintenance.php:59
$maintClass
$maintClass
Definition: findClasses.php:52
$line
$line
Definition: mcc.php:119
FindClasses\__construct
__construct()
Default constructor.
Definition: findClasses.php:32