Exemplo n.º 1
0
 function checkRemoteFolder()
 {
     static $items = null;
     if ($items === null) {
         $rawList = qg::Ftp()->rawlist('/module/');
         $items = array();
         foreach ($rawList as $child) {
             $chunks = preg_split("/\\s+/", $child);
             list($item['rights'], $item['number'], $item['user'], $item['group'], $item['size'], $item['month'], $item['day'], $item['time']) = $chunks;
             $item['type'] = $chunks[0][0] === 'd' ? 'directory' : 'file';
             array_splice($chunks, 0, 8);
             $items[implode(" ", $chunks)] = $item;
         }
     }
     return isset($items[$this->name]);
 }
Exemplo n.º 2
0
 static function ftp()
 {
     if (!self::$Ftp) {
         self::$Ftp = new qgFtp(qg_host, qg_user, qg_pass);
     }
     return self::$Ftp;
 }