}
// Optional settings that have a default
- $this->initialCapital = $info['initialCapital'] ?? MWNamespace::isCapitalized( NS_FILE );
+ $this->initialCapital = $info['initialCapital'] ??
+ MediaWikiServices::getInstance()->getNamespaceInfo()->isCapitalized( NS_FILE );
$this->url = $info['url'] ?? false; // a subclass may set the URL (e.g. ForeignAPIRepo)
if ( isset( $info['thumbUrl'] ) ) {
$this->thumbUrl = $info['thumbUrl'];
* @return string
*/
public function getNameFromTitle( Title $title ) {
- if ( $this->initialCapital != MWNamespace::isCapitalized( NS_FILE ) ) {
+ if (
+ $this->initialCapital !=
+ MediaWikiServices::getInstance()->getNamespaceInfo()->isCapitalized( NS_FILE )
+ ) {
$name = $title->getUserCaseDBKey();
if ( $this->initialCapital ) {
$name = MediaWikiServices::getInstance()->getContentLanguage()->ucfirst( $name );
return $status;
}
- /**
- * Attempt to stream a file with the given virtual URL/storage path
- *
- * @deprecated since 1.26, use streamFileWithStatus
- * @param string $virtualUrl
- * @param array $headers Additional HTTP headers to send on success
- * @return bool Success
- */
- public function streamFile( $virtualUrl, $headers = [] ) {
- return $this->streamFileWithStatus( $virtualUrl, $headers )->isOK();
- }
-
/**
* Call a callback function for every public regular file in the repository.
* This only acts on the current version of files, not any old versions.