dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Http::getProxy() method to get proxy configuration"
[lhc/web/wiklou.git]
/
includes
/
externalstore
/
ExternalStore.php
diff --git
a/includes/externalstore/ExternalStore.php
b/includes/externalstore/ExternalStore.php
index
688130e
..
1563baf
100644
(file)
--- a/
includes/externalstore/ExternalStore.php
+++ b/
includes/externalstore/ExternalStore.php
@@
-51,7
+51,7
@@
class ExternalStore {
* @param array $params Associative array of ExternalStoreMedium parameters
* @return ExternalStoreMedium|bool The store class or false on error
*/
* @param array $params Associative array of ExternalStoreMedium parameters
* @return ExternalStoreMedium|bool The store class or false on error
*/
- public static function getStoreObject( $proto, array $params =
array()
) {
+ public static function getStoreObject( $proto, array $params =
[]
) {
global $wgExternalStores;
if ( !$wgExternalStores || !in_array( $proto, $wgExternalStores ) ) {
global $wgExternalStores;
if ( !$wgExternalStores || !in_array( $proto, $wgExternalStores ) ) {
@@
-72,7
+72,7
@@
class ExternalStore {
* @return string|bool The text stored or false on error
* @throws MWException
*/
* @return string|bool The text stored or false on error
* @throws MWException
*/
- public static function fetchFromURL( $url, array $params =
array()
) {
+ public static function fetchFromURL( $url, array $params =
[]
) {
$parts = explode( '://', $url, 2 );
if ( count( $parts ) != 2 ) {
return false; // invalid URL
$parts = explode( '://', $url, 2 );
if ( count( $parts ) != 2 ) {
return false; // invalid URL
@@
-99,14
+99,14
@@
class ExternalStore {
* or false on failure.
*/
public static function batchFetchFromURLs( array $urls ) {
* or false on failure.
*/
public static function batchFetchFromURLs( array $urls ) {
- $batches =
array()
;
+ $batches =
[]
;
foreach ( $urls as $url ) {
$scheme = parse_url( $url, PHP_URL_SCHEME );
if ( $scheme ) {
$batches[$scheme][] = $url;
}
}
foreach ( $urls as $url ) {
$scheme = parse_url( $url, PHP_URL_SCHEME );
if ( $scheme ) {
$batches[$scheme][] = $url;
}
}
- $retval =
array()
;
+ $retval =
[]
;
foreach ( $batches as $proto => $batchedUrls ) {
$store = self::getStoreObject( $proto );
if ( $store === false ) {
foreach ( $batches as $proto => $batchedUrls ) {
$store = self::getStoreObject( $proto );
if ( $store === false ) {
@@
-136,7
+136,7
@@
class ExternalStore {
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
- public static function insert( $url, $data, array $params =
array()
) {
+ public static function insert( $url, $data, array $params =
[]
) {
$parts = explode( '://', $url, 2 );
if ( count( $parts ) != 2 ) {
return false; // invalid URL
$parts = explode( '://', $url, 2 );
if ( count( $parts ) != 2 ) {
return false; // invalid URL
@@
-166,7
+166,7
@@
class ExternalStore {
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
- public static function insertToDefault( $data, array $params =
array()
) {
+ public static function insertToDefault( $data, array $params =
[]
) {
global $wgDefaultExternalStore;
return self::insertWithFallback( (array)$wgDefaultExternalStore, $data, $params );
global $wgDefaultExternalStore;
return self::insertWithFallback( (array)$wgDefaultExternalStore, $data, $params );
@@
-184,7
+184,7
@@
class ExternalStore {
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
- public static function insertWithFallback( array $tryStores, $data, array $params =
array()
) {
+ public static function insertWithFallback( array $tryStores, $data, array $params =
[]
) {
$error = false;
while ( count( $tryStores ) > 0 ) {
$index = mt_rand( 0, count( $tryStores ) - 1 );
$error = false;
while ( count( $tryStores ) > 0 ) {
$index = mt_rand( 0, count( $tryStores ) - 1 );
@@
-197,7
+197,7
@@
class ExternalStore {
}
try {
$url = $store->store( $path, $data ); // Try to save the object
}
try {
$url = $store->store( $path, $data ); // Try to save the object
- } catch (
MW
Exception $error ) {
+ } catch ( Exception $error ) {
$url = false;
}
if ( strlen( $url ) ) {
$url = false;
}
if ( strlen( $url ) ) {
@@
-224,6
+224,6
@@
class ExternalStore {
* @throws MWException
*/
public static function insertToForeignDefault( $data, $wiki ) {
* @throws MWException
*/
public static function insertToForeignDefault( $data, $wiki ) {
- return self::insertToDefault( $data,
array( 'wiki' => $wiki )
);
+ return self::insertToDefault( $data,
[ 'wiki' => $wiki ]
);
}
}
}
}