Example #1
0
 public function __construct($path)
 {
     $arr = DB::fetch_first("SELECT root,name FROM %t WHERE bz=%s", array('connect', self::BZ));
     $this->_root = $arr['root'];
     $this->_rootname = $arr['name'];
     $this->perm = perm_binPerm::getMyPower();
     //self::init($path);
 }
Example #2
0
 public function __construct($path)
 {
     $bzarr = explode(':', $path);
     $ftpid = trim($bzarr[1]);
     if ($config = DB::fetch_first("select * from " . DB::table(self::T) . " where  id='{$ftpid}'")) {
         $this->_root = 'ftp:' . $config['id'] . ':';
         $this->encode = $config['charset'];
         $this->_rootname = $config['cloudname'];
         $ftp = new dzz_ftp($config);
         if ($ftp->error()) {
             $this->error = $ftp->error();
             return $this;
         }
         if ($ftp->connect()) {
             $this->conn = $ftp;
         } else {
             $this->error = 'ftp not connect';
         }
     } else {
         $this->error = 'need authorize';
     }
     $this->perm = perm_binPerm::getMyPower();
     return $this;
 }