Exemplo n.º 1
0
 /**
  * Gets a setting
  *
  * @param $setting_name
  *
  * @return array|bool|null|static[]
  */
 public static function GetSetting($setting_name)
 {
     $database = new DatabaseSettings();
     if (isset($database)) {
         return $database->ObtainSetting($setting_name);
     }
     return null;
 }
Exemplo n.º 2
0
 /**
  * Populates a database
  *
  * @param $fetched_settings
  */
 public function PopulateDatabase($fetched_settings)
 {
     foreach ($fetched_settings as $key => $value) {
         /**
          * Create a new class yo
          */
         $class = new DatabaseSettings();
         /**
          * If we already have this setting skip
          */
         if ($class->ObtainSetting($key) != null) {
             continue;
         }
         /**
          * Insert this setting
          */
         $class->InsertSetting($key, $value);
         /**
          * Log it
          */
         Install::AddLog('Settings', 'Added setting: ' . $key . ' with value ' . $value . ' to the database.');
     }
 }