'envCheckUploadsDirectory',
'envCheckLibicu',
'envCheckSuhosinMaxValueLength',
+ 'envCheck64Bit',
];
/**
return true;
}
+ /**
+ * Checks if we're running on 64 bit or not. 32 bit is becoming increasingly
+ * hard to support, so let's at least warn people.
+ *
+ * @return bool
+ */
+ protected function envCheck64Bit() {
+ if ( PHP_INT_SIZE == 4 ) {
+ $this->showMessage( 'config-using-32bit' );
+ }
+
+ return true;
+ }
+
/**
* Convert a hex string representing a Unicode code point to that code point.
* @param string $c
* Reasonable values for $directory include 'extensions' (the default) and 'skins'.
*
* @param string $directory Directory to search in
- * @return array
+ * @return array [ $extName => [ 'screenshots' => [ '...' ] ]
*/
public function findExtensions( $directory = 'extensions' ) {
if ( $this->getVar( 'IP' ) === null ) {
}
// extensions -> extension.json, skins -> skin.json
- $jsonFile = substr( $directory, 0, strlen( $directory ) -1 ) . '.json';
+ $jsonFile = substr( $directory, 0, strlen( $directory ) - 1 ) . '.json';
$dh = opendir( $extDir );
$exts = [];
continue;
}
if ( file_exists( "$extDir/$file/$jsonFile" ) || file_exists( "$extDir/$file/$file.php" ) ) {
- $exts[] = $file;
+ // Extension exists. Now see if there are screenshots
+ $exts[$file] = [];
+ if ( is_dir( "$extDir/$file/screenshots" ) ) {
+ $paths = glob( "$extDir/$file/screenshots/*.png" );
+ foreach ( $paths as $path ) {
+ $exts[$file]['screenshots'][] = str_replace( $extDir, "../$directory", $path );
+ }
+
+ }
}
}
closedir( $dh );
- natcasesort( $exts );
+ uksort( $exts, 'strnatcasecmp' );
return $exts;
}