aboutsummaryrefslogtreecommitdiff
path: root/w/class/config.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-11-11 17:19:26 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-11-11 17:19:26 +0100
commitd7f3313ff4514e38c9f53439cd1a1287e56e45f7 (patch)
treeabff39ab11cb317f5fcd2db558da1c59bdae9239 /w/class/config.php
parent2f363e8fa26ab849539e64ff7caa21bd164e8979 (diff)
downloadwcms-d7f3313ff4514e38c9f53439cd1a1287e56e45f7.tar.gz
wcms-d7f3313ff4514e38c9f53439cd1a1287e56e45f7.zip
reboot folder
Diffstat (limited to 'w/class/config.php')
-rw-r--r--w/class/config.php213
1 files changed, 0 insertions, 213 deletions
diff --git a/w/class/config.php b/w/class/config.php
deleted file mode 100644
index ead4a40..0000000
--- a/w/class/config.php
+++ /dev/null
@@ -1,213 +0,0 @@
-<?php
-
-
-
-abstract class Config
-{
- protected static $host;
- protected static $dbname;
- protected static $user;
- protected static $password;
- protected static $arttable = 'artstore';
- protected static $domain;
- protected static $admin;
- protected static $editor;
- protected static $invite;
- protected static $read;
- protected static $color4;
- protected static $fontsize = 6;
- protected static $renderpath = './render/';
-
-
-// _______________________________________ F U N _______________________________________
-
-
-
- public static function hydrate(array $donnees)
- {
- foreach ($donnees as $key => $value) {
- $method = 'set' . $key;
-
- if (method_exists(get_called_class(), $method)) {
- self::$method($value);
- }
- }
- }
-
- public static function readconfig()
- {
- if (file_exists(Model::CONFIG_FILE)) {
- $current = file_get_contents(Model::CONFIG_FILE);
- $datas = json_decode($current, true);
- self::hydrate($datas);
- }
- }
-
- public static function createconfig(array $datas)
- {
- self::hydrate($datas);
- }
-
-
- public static function savejson()
- {
- $json = self::tojson();
- file_put_contents(self::CONFIG_FILE, $json);
- }
-
-
- public static function tojson()
- {
- $arr = get_object_vars($this);
- $json = json_encode($arr, JSON_FORCE_OBJECT | JSON_PRETTY_PRINT);
- return $json;
- }
-
-// ________________________________________ G E T _______________________________________
-
- public static function host()
- {
- return self::$host;
- }
-
- public static function dbname()
- {
- return self::$dbname;
- }
-
- public static function user()
- {
- return self::$user;
- }
-
- public static function password()
- {
- return self::$password;
- }
-
- public static function arttable()
- {
- return self::$arttable;
- }
-
- public static function domain()
- {
- return self::$domain;
- }
-
- public static function admin()
- {
- return self::$admin;
- }
-
- public static function editor()
- {
- return self::$editor;
- }
-
- public static function invite()
- {
- return self::$invite;
- }
-
- public static function read()
- {
- return self::$read;
- }
-
- public static function color4()
- {
- return self::$color4;
- }
-
- public static function fontsize()
- {
- return self::$fontsize;
- }
-
- public static function renderpath()
- {
- return self::$renderpath;
- }
-
-
-
-// __________________________________________ S E T ______________________________________
-
- public static function sethost($host)
- {
- self::$host = strip_tags($host);
- }
-
- public static function setdbname($dbname)
- {
- self::$dbname = strip_tags($dbname);
- }
-
- public static function setuser($user)
- {
- self::$user = strip_tags($user);
- }
-
- public static function setpassword($password)
- {
- self::$password = strip_tags($password);
- }
-
- public static function setarttable($arttable)
- {
- self::$arttable = strip_tags($arttable);
- }
-
- public static function setdomain($domain)
- {
- self::$domain = strip_tags($domain);
- }
-
- public static function setadmin($admin)
- {
- self::$admin = strip_tags($admin);
- }
-
- public static function seteditor($editor)
- {
- self::$editor = strip_tags($editor);
- }
-
- public static function setinvite($invite)
- {
- self::$invite = strip_tags($invite);
- }
-
- public static function setread($read)
- {
- self::$read = strip_tags($read);
- }
-
- public static function setcolor4($color4)
- {
- if(strlen($color4) <= 8) {
- self::$color4 = $color4;
- }
- }
-
- public static function setfontsize($fontsize)
- {
- $fontsize = intval($fontsize);
- if($fontsize > 1) {
- self::$fontsize = $fontsize;
- }
- }
-
-
-}
-
-
-
-
-
-
-
-
-
-?> \ No newline at end of file