Manual:eval.php

From Linux Web Expert

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

eval.php je údržbový skript, který se nachází v adresáři maintenance, který můžete použít k živému hraní s objekty a funkcemi MediaWiki. Nyní je považován za zastaralý a byl nahrazen shell.php , který je robustnější (nezruší se při fatálních chybách) a má více funkcí (automatický tisk návratových hodnot, reflexe, prohlížeč dokumentace, doplňování karet atd.).

$ php maintenance/eval.php
> print wfMessage("Recentchanges")->plain();
Recent changes

Třídy MediaWiki se automaticky načítají:

$ php maintenance/eval.php
> echo Xml::label( 'My label', 'someInput', array( 'class' => 'pink' ) );
<label for="someInput" class="pink">My label</label>

Je také možné některé ladění:

$ php  maintenance/eval.php --d 3
> print wfMessage("Recentchanges")->text();
Unstubbing $wgLang on call of $wgLang::getCode from MessageCache::get
Connecting to localhost minitest...
Profiler::instance called with bogus $wgProfiler setting, falling back to ProfilerStub for safety
IP: 127.0.0.1
Query minitest (1) (slave): SET /* DatabasePostgres::open 127.0.0.1 */ client_encoding='UTF8'
Query minitest (2) (slave): SET /* DatabasePostgres::open 127.0.0.1 */ datestyle = 'ISO, YMD'
Query minitest (3) (slave): SET /* DatabasePostgres::open 127.0.0.1 */ timezone = 'GMT'
Query minitest (4) (slave): SET /* DatabasePostgres::open 127.0.0.1 */ standard_conforming_strings = on
Query minitest (5) (slave): BEGIN
Transaction state changed from IDLE -> TRANS
Query minitest (6) (slave): SELECT /* DatabasePostgres::schemaExists 127.0.0.1 */  1  FROM "pg_catalog"."pg_namespace"  WHERE nspname = 'mediawiki'  LIMIT 1  
Query minitest (7) (slave): SELECT /* DatabasePostgres::getSchemas 127.0.0.1 */ current_schemas(false)
Query minitest (8) (slave): SHOW /* DatabasePostgres::getSearchPath 127.0.0.1 */ search_path
Query minitest (9) (slave): SET /*  127.0.0.1 */ search_path = "mediawiki", "$user", public
Schema "mediawiki" added to the search path
Query minitest (10) (slave): COMMIT
Transaction state changed from TRANS -> IDLE
Connected to localhost minitest.
Query minitest (11) (slave): SELECT /* LCStore_DB::get 127.0.0.1 */  lc_value  FROM "l10n_cache"  WHERE lc_lang = 'en' AND lc_key = 'deps'  LIMIT 1  
Query minitest (12) (slave): SELECT /* LCStore_DB::get 127.0.0.1 */  lc_value  FROM "l10n_cache"  WHERE lc_lang = 'en' AND lc_key = 'list'  LIMIT 1  
Query minitest (13) (slave): SELECT /* LCStore_DB::get 127.0.0.1 */  lc_value  FROM "l10n_cache"  WHERE lc_lang = 'en' AND lc_key = 'preload'  LIMIT 1  
Query minitest (14) (slave): SELECT /* LCStore_DB::get 127.0.0.1 */  lc_value  FROM "l10n_cache"  WHERE lc_lang = 'en' AND lc_key = 'preload'  LIMIT 1  
Connecting to localhost minitest...
Query minitest (15) (slave): SET /* DatabasePostgres::open 127.0.0.1 */ client_encoding='UTF8'
Query minitest (16) (slave): SET /* DatabasePostgres::open 127.0.0.1 */ datestyle = 'ISO, YMD'
Query minitest (17) (slave): SET /* DatabasePostgres::open 127.0.0.1 */ timezone = 'GMT'
Query minitest (18) (slave): SET /* DatabasePostgres::open 127.0.0.1 */ standard_conforming_strings = on
Query minitest (19) (slave): BEGIN
Transaction state changed from IDLE -> TRANS
Query minitest (20) (slave): SELECT /* DatabasePostgres::schemaExists 127.0.0.1 */  1  FROM "pg_catalog"."pg_namespace"  WHERE nspname = 'mediawiki'  LIMIT 1  
Query minitest (21) (slave): SELECT /* DatabasePostgres::getSchemas 127.0.0.1 */ current_schemas(false)
Schema "mediawiki" already in the search path
Query minitest (22) (slave): COMMIT
Transaction state changed from TRANS -> IDLE
Connected to localhost minitest.
Query minitest (23) (slave): SELECT /* SqlBagOStuff::get 127.0.0.1 */  value,exptime  FROM "objectcache"  WHERE keyname = 'minitest:messages:en'  LIMIT 1  
MessageCache::load: Loading en... got from global cache
Recent changes
> 

Související odkazy