MediaWiki master
findClasses.php
Go to the documentation of this file.
1<?php
22// @codeCoverageIgnoreStart
23require_once __DIR__ . '/Maintenance.php';
24// @codeCoverageIgnoreEnd
25
32class FindClasses extends Maintenance {
33
34 public function __construct() {
35 parent::__construct();
36 $this->addDescription( 'Finds the files containing classes via the autoloader.' );
37 }
38
39 public function execute() {
40 $stdin = $this->getStdin();
41
42 while ( !feof( $stdin ) ) {
43 $line = fgets( $stdin );
44 if ( $line === false ) {
45 break;
46 }
47 $class = trim( $line );
48 $filename = AutoLoader::find( $class );
49 if ( $filename ) {
50 $this->output( "$filename\n" );
51 } elseif ( $class ) {
52 $this->output( "#$class\n" );
53 }
54 }
55 }
56}
57
58// @codeCoverageIgnoreStart
59$maintClass = FindClasses::class;
60require_once RUN_MAINTENANCE_IF_MAIN;
61// @codeCoverageIgnoreEnd
Maintenance script for finding 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