Page MenuHomeWickedGov Phorge

PHPVariableLoader.php
No OneTemporary

Size
737 B
Referenced Files
None
Subscribers
None

PHPVariableLoader.php

<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\Utilities;
/**
* Stuff for handling configuration files in PHP format.
*
* @author Niklas Laxström
* @copyright Copyright © 2010 Niklas Laxström
* @license GPL-2.0-or-later
*/
class PHPVariableLoader {
/**
* Returns a global variable from PHP file by executing the file.
* @param string $_filename Path to the file.
* @param string $_variable Name of the variable.
* @return mixed|null The variable contents or null.
*/
public static function loadVariableFromPHPFile( string $_filename, string $_variable ) {
if ( !file_exists( $_filename ) ) {
return null;
} else {
require $_filename;
return $$_variable ?? null;
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 22:25 (1 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
37/a3/06cbd4a5ce004b435ebd0cb741ad
Default Alt Text
PHPVariableLoader.php (737 B)

Event Timeline