예제 #1
0
 private function __construct()
 {
     $config = FN::serverConfig('database', $this->_link);
     if (empty($config) || !in_array($config['drive'], array('mongodb'))) {
         $this->_error = 5;
         //配置错误
         return false;
     }
     $this->_db = FN::server('database', $this->_link);
     $dbname = $this->_db->selectDB($this->_dbname);
     if (empty($this->_prefix)) {
         $this->_gridfs = $dbname->getGridFS();
     } else {
         $this->_gridfs = $dbname->getGridFS($this->_prefix);
     }
     if ($this->_onlyimage && !$this->_mime) {
         $this->_mime = array('image/gif', 'image/png', 'image/jpeg');
     }
 }
예제 #2
0
 private function __construct()
 {
     $config = FN::serverConfig('database', $this->_link);
     if (empty($config) || !in_array($config['drive'], array('mysql', 'mssql'))) {
         $this->_error = 5;
         //配置错误
         return false;
     }
     $this->_db = FN::server('database', $this->_link);
     if (!empty($config['prefix'])) {
         $this->table = $config['prefix'] . $this->table;
     }
     //实现表前缀添加
     if (!in_array($this->_pkey, $this->_field)) {
         $this->_pkey = null;
     }
     if (empty($this->_pkey)) {
         $this->_aint = false;
     }
 }