-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.class.php
More file actions
47 lines (39 loc) · 917 Bytes
/
Config.class.php
File metadata and controls
47 lines (39 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace dc\chronofix;
require('config.php');
// Implements default settings and user setting
// arguments as necessary.
// Structure of parameters used for database connection attempt.
interface iConfig
{
function get_format(); // Get current date/time format.
function set_format($value); // Set current date/time format.
}
class Config implements iConfig
{
protected
$format = NULL;
public function __construct($format = NULL)
{
// If format argument passed, use it for time
// format. Otherwise fall back to default setting.
if($format)
{
$this->set_format($format);
}
else
{
$this->set_format(DEFAULTS::FORMAT);
}
}
// Mutators
public function set_format($value)
{
$this->format = $value;
}
public function get_format()
{
return $this->format;
}
}
?>