Exemplo n.º 1
0
 function _fs($fsKey = "app", $params = null)
 {
     //$fsd=LogiksFSDriver::findInstance($fsKey);
     //if($fsd) return $fsd;
     if ($params == null || !is_array($params)) {
         $cfg = loadJSONConfig("fs");
         if (!isset($cfg[$fsKey])) {
             trigger_logikserror("FS ERROR, Connection Configuration Could Not Be Found For {$fsKey}");
         } else {
             $params = $cfg[$fsKey];
         }
     }
     if (!isset($params['basedir']) || strlen($params['basedir']) <= 0 || $params['basedir'] == "./") {
         $params['basedir'] = APPROOT;
     }
     if (!isset($params['driver'])) {
         trigger_logikserror("FS ERROR, Connection Configuration Could Not Be Found For {$fsKey}");
     }
     $driver = $params['driver'];
     $driverClass = "{$driver}FSDriver";
     $driverFile = __DIR__ . "/drivers/{$driverClass}.inc";
     if (file_exists($driverFile)) {
         include_once $driverFile;
     } else {
         trigger_logikserror("FS ERROR, Driver {$driver} Could Not Be Found For {$fsKey}");
     }
     $fs = new $driverClass($fsKey, $params);
     if (isset($params['basedir'])) {
         $fs->cd($params['basedir']);
     }
     return $fs;
 }
Exemplo n.º 2
0
 public static function connect($key, $params = array())
 {
     $cfg = loadJSONConfig("db");
     if (!isset($cfg[$key])) {
         trigger_error("Database ERROR, Connection Configuration Could Not Be Found For {$key}");
     } else {
         $params = $cfg[$key];
     }
     $db = new Database($key, $params);
     return $db;
 }
Exemplo n.º 3
0
 public static function connect($key, $params = null)
 {
     if ($params == null || !is_array($params)) {
         $cfg = loadJSONConfig("db");
         if (!isset($cfg[$key])) {
             trigger_logikserror("Database ERROR, Connection Configuration Could Not Be Found For {$key}");
         } else {
             $params = $cfg[$key];
         }
     }
     if (count($params) <= 1 || !isset($params['driver'])) {
         return false;
     }
     $db = new Database($key, $params);
     //Setup Cache
     //Setup Logging
     return $db;
 }
Exemplo n.º 4
0
 function _message($msgKey = "app", $params = null)
 {
     //$msd=LogiksMsgDriver::findInstance($msgKey);
     //if($msd) return $msd;
     if ($params == null || !is_array($params)) {
         $cfg = loadJSONConfig("message");
         if (!isset($cfg[$msgKey])) {
             trigger_logikserror("MSG ERROR, Connection Configuration Could Not Be Found For {$msgKey}");
         } else {
             $params = $cfg[$msgKey];
         }
     }
     $driver = $params['driver'];
     $driverClass = "{$driver}MSGDriver";
     $driverFile = __DIR__ . "/drivers/{$driverClass}.inc";
     if (file_exists($driverFile)) {
         include_once $driverFile;
     } else {
         trigger_logikserror("MSG ERROR, Connection Driver Could Not Be Found For {$msgKey}");
     }
     $msg = new $driverClass($msgKey, $params);
     return $msg;
 }
Exemplo n.º 5
0
 function bootDatabase($configFile, $forceReload = false)
 {
     $cfg = loadJSONConfig($configFile, $forceReload);
     //Setup Cache
     //Setup Logging
 }