Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F1042352
settings.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
settings.php
View Options
<?php
/*
* Zed
* (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
* Settings
*/
//The method to call in your objects, to save data.
define
(
"SETTINGS_SAVE_METHOD"
,
"save_to_database"
);
require_once
(
"page.php"
);
/*
* @package Zed
* @subpackage settings
*/
class
Settings
{
/*
* @var string the file path
*/
public
$file
;
/*
* @var Array a collection of SettingsPage items.
*/
public
$pages
;
/*
* Initializes a new instance of Settings class
*/
function
__construct
(
$xmlFile
)
{
//Opens .xml
if
(!
file_exists
(
$xmlFile
))
{
message_die
(
GENERAL_ERROR
,
"$xmlFile not found."
,
"Settings load error"
);
}
$this
->
file
=
$xmlFile
;
$this
->
parse
();
}
/*
* Parses XML file
*/
function
parse
()
{
//Parses it
$xml
=
simplexml_load_file
(
$this
->
file
);
foreach
(
$xml
->
page
as
$page
)
{
//Gets page
$page
=
SettingsPage
::
from_xml
(
$page
);
//Adds to sections array
$this
->
pages
[
$page
->
id
]
=
$page
;
}
}
}
?>
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, May 15, 14:37 (2 d, 16 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
21958
Default Alt Text
settings.php (1 KB)
Attached To
rZEDHG ZedLegacy
Event Timeline
Log In to Comment