MediaWiki master
findClasses.php
Go to the documentation of this file.
1<?php
8
9// @codeCoverageIgnoreStart
10require_once __DIR__ . '/Maintenance.php';
11// @codeCoverageIgnoreEnd
12
20class FindClasses extends Maintenance {
21
22 public function __construct() {
23 parent::__construct();
24 $this->addDescription( 'Finds the files containing classes via the autoloader.' );
25 }
26
27 public function execute() {
28 $stdin = $this->getStdin();
29
30 while ( !feof( $stdin ) ) {
31 $line = fgets( $stdin );
32 if ( $line === false ) {
33 break;
34 }
35 $class = trim( $line );
36 $filename = AutoLoader::find( $class );
37 if ( $filename ) {
38 $this->output( "$filename\n" );
39 } elseif ( $class ) {
40 $this->output( "#$class\n" );
41 }
42 }
43 }
44}
45
46// @codeCoverageIgnoreStart
47$maintClass = FindClasses::class;
48require_once RUN_MAINTENANCE_IF_MAIN;
49// @codeCoverageIgnoreEnd
Find the files that contain classes.
__construct()
Default constructor.
execute()
Do the actual work.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
getStdin( $len=null)
Return input from stdin.
addDescription( $text)
Set the description text.
$maintClass