53 if ( isset( $conf[
'directory'] ) ) {
60 public function get(
$code, $key ) {
61 if ( !isset( $this->readers[
$code] ) ) {
64 $this->readers[
$code] =
false;
65 if ( file_exists( $fileName ) ) {
67 $this->readers[
$code] = Reader::open( $fileName );
68 }
catch ( Exception
$e ) {
69 wfDebug( __METHOD__ .
": unable to open cdb file for reading\n" );
74 if ( !$this->readers[
$code] ) {
80 }
catch ( Exception
$e ) {
81 wfDebug( __METHOD__ .
": \Cdb\Exception caught, error message was "
82 .
$e->getMessage() .
"\n" );
95 throw new MWException(
"Unable to create the localisation store " .
96 "directory \"{$this->directory}\"" );
101 if ( !empty( $this->readers[
$code] ) ) {
102 $this->readers[
$code]->close();
107 }
catch ( Exception
$e ) {
110 $this->currentLang =
$code;
117 }
catch ( Exception
$e ) {
121 unset( $this->readers[$this->currentLang] );
122 $this->currentLang =
null;
126 if ( is_null( $this->
writer ) ) {
127 throw new MWException( __CLASS__ .
': must call startWrite() before calling set()' );
131 }
catch ( Exception
$e ) {
137 if ( strval(
$code ) ===
'' || strpos(
$code,
'/' ) !==
false ) {
138 throw new MWException( __METHOD__ .
": Invalid language \"$code\"" );
141 return "{$this->directory}/l10n_cache-$code.cdb";
unserialize( $serialized)
$wgCacheDirectory
Directory for caching data in the local filesystem.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfMkdirParents( $dir, $mode=null, $caller=null)
Make directory, and make all parent directories if they don't exist.
LCStore implementation which stores data as a collection of CDB files in the directory given by $wgCa...
bool string $directory
Cache directory.
string $currentLang
Current language code.
startWrite( $code)
Start a write transaction.
finishWrite()
Finish a write transaction.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable & $code
returning false will NOT prevent logging $e
Interface for the persistence layer of LocalisationCache.
The most up to date schema for the tables in the database will always be tables sql in the maintenance directory