Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1426733
PHPVariableLoader.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
736 B
Referenced Files
None
Subscribers
None
PHPVariableLoader.php
View Options
<?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
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 13:38 (1 d, 22 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d3/81/ddbee4b8c14b6128703030c1c5af
Default Alt Text
PHPVariableLoader.php (736 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment