Podręcznik:Maintenance.php

From mediawiki.org
This page is a translated version of the page Manual:Maintenance.php and the translation is 94% complete.
Outdated translations are marked like this.
Not to be confused with another file called Maintenance.php, which is in the maintenance folder.

Klasa Maintenance jest abstrakcyjna klasą konserwacji, służącą do szybkiego pisania i wypuszczania skryptów konserwacyjnych z minimalnym wysiłkiem.

Funkcje

addDescription()

  • addDescription( $text);
    • $text: ustaw tekst opisu.

addArg()

  • addArg( $arg, $description, $required = true );
    • $arg: nazwa argumentu
    • $description: krótki opis argumentu
    • $required: czy jest wymagany?

addOption()

  • addOption($name, $description, $required=false, $withArg=false, $shortName=false);
    • $required: czy jest ten parametr wymagany?
    • $withArg: czy jest wymagany argument do tej opcji?
    • $shortName: znak jaki użyć dla krótkiej nazwy

Krótką nazwą może być np. 'm' jeżeli chcesz żeby -mFast było alternatywą dla --mode=Fast.

getArg()

  • getArg( $argId = 0, $default = null );
    • $argId: wartość liczby całkowitej (od zera) argumentu
    • $default: domyślna wartość jeżeli nie istnieje

getOption()

  • getOption( $name, $default = null );
    • $name: nazwa parametru
    • $default: wartość domyślna

outPut()

  • output( $output, $channel = null );

runChild()

  • runChild( $maintClass, $classFile = null );
    • maintClass: nazwa podrzędnej klasy konserwacji
    • $classFile: pełna ścieżka pliku definiującego klasę

Zobacz też