5use Wikimedia\TestingAccessWrapper;
13 use MediaWikiCoversValidator;
16 $this->assertInternalType(
'bool', Shell::isDisabled() );
24 $this->markTestSkipped(
'This test requires a POSIX environment.' );
26 $this->assertSame( $expected, call_user_func_array( [ Shell::class,
'escape' ],
$args ) );
31 'simple' => [ [
'true' ],
"'true'" ],
32 'with args' => [ [
'convert',
'-font',
'font name' ],
"'convert' '-font' 'font name'" ],
33 'array' => [ [ [
'convert',
'-font',
'font name' ] ],
"'convert' '-font' 'font name'" ],
34 'skip nulls' => [ [
'ls',
null ],
"'ls'" ],
64 ->unsafeParams(
'unsafe' );
68 $wrapper = TestingAccessWrapper::newFromObject(
$command );
69 $this->assertEquals( $expected, $wrapper->command );
70 $this->assertEquals( 0, $wrapper->restrictions & Shell::NO_LOCALSETTINGS );
78 "'$wgPhpCli' 'maintenance/foobar.php' 'bar'\\''\"baz' 'safe' unsafe",
79 'maintenance/foobar.php',
83 "'$wgPhpCli' 'changed.php' '--wiki=somewiki' 'bar'\\''\"baz' 'safe' unsafe",
84 'maintenance/foobar.php',
87 function ( &$script,
array &$parameters ) {
88 $script =
'changed.php';
89 array_unshift( $parameters,
'--wiki=somewiki' );
93 "'/bin/perl' 'maintenance/foobar.php' 'bar'\\''\"baz' 'safe' unsafe",
94 'maintenance/foobar.php',
96 [
'php' =>
'/bin/perl' ],
99 "'$wgPhpCli' 'foobinize' 'maintenance/foobar.php' 'bar'\\''\"baz' 'safe' unsafe",
100 'maintenance/foobar.php',
102 [
'wrapper' =>
'foobinize' ],
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
$wgPhpCli
Executable path of the PHP cli binary.
wfIsWindows()
Check if the operating system is Windows.
\MediaWiki\Shell\Shell Shell
testMakeScriptCommand( $expected, $script, $parameters, $options=[], $hook=null)
\MediaWiki\Shell\Shell::makeScriptCommand provideMakeScriptCommand
testEscape( $args, $expected)
provideEscape
provideMakeScriptCommand()
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not null
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))