unset( $params['URL'] );
}
// set up defaults and merge them with the given params
- $mparams = array_merge( array(
+ $mparams = array_merge( [
'name' => 'parsoid',
'url' => 'http://localhost:8000/',
'prefix' => 'localhost',
'domain' => 'localhost',
'forwardCookies' => false,
'HTTPProxy' => null,
- ), $params );
+ ], $params );
// Ensure that the url parameter has a trailing slash.
$mparams['url'] = preg_replace(
'#/?$#',
}
public function onRequests( array $reqs, Closure $idGeneratorFunc ) {
- $result = array();
+ $result = [];
foreach ( $reqs as $key => $req ) {
$parts = explode( '/', $req['url'] );
continue;
}
if ( $targetWiki !== 'local' ) {
-
throw new Exception( "Only 'local' target wiki is currently supported" );
}
if ( $reqType !== 'page' && $reqType !== 'transform' ) {
* API. We now translate these to the "real" Parsoid v3 API.
*/
public function onParsoid1Request( array $req, Closure $idGeneratorFunc ) {
-
$parts = explode( '/', $req['url'] );
list(
$targetWiki, // 'local'
}
return $req;
-
}
}