Example #1
0
 function test()
 {
     $config = new Config();
     $config->limit(1);
     $config->find(true);
     $config->free();
 }
Example #2
0
 /**
  * Constructor. Only run once for singleton object.
  */
 protected function __construct($conn = null)
 {
     if (is_null($conn)) {
         // XXX: there should be an easier way to do this.
         $user = new Config();
         $conn = $user->getDatabaseConnection();
         $user->free();
         unset($user);
     }
     $this->conn = $conn;
 }
Example #3
0
 static function _getSettings()
 {
     $settings = array();
     $config = new Config();
     $config->find();
     while ($config->fetch()) {
         $settings[] = array($config->section, $config->setting, $config->value);
     }
     $config->free();
     return $settings;
 }
Example #4
0
 static function _getSettings()
 {
     $c = self::memcache();
     if (!empty($c)) {
         $settings = $c->get(common_cache_key(self::settingsKey));
         if ($settings !== false) {
             return $settings;
         }
     }
     $settings = array();
     $config = new Config();
     $config->find();
     while ($config->fetch()) {
         $settings[] = array($config->section, $config->setting, $config->value);
     }
     $config->free();
     if (!empty($c)) {
         $c->set(common_cache_key(self::settingsKey), $settings);
     }
     return $settings;
 }