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