public static function chmodRecursiveSoft(Net_FTP $ftp, $target, $permissions)
 {
     $stats = array('success' => 0, 'failure' => 0);
     // chmod target
     $ret = $ftp->chmod($target, $permissions);
     if (PEAR::isError($ret)) {
         $stats['failure']++;
         //throw new Engine_Package_Exception($ret->getMessage());
     } else {
         $stats['success']++;
     }
     $files = self::ftpLsRecursive($ftp, $target);
     foreach ($files as $file) {
         $ret = $ftp->chmod($file['name'], $permissions);
         if (PEAR::isError($ret)) {
             $stats['failure']++;
             //throw new Engine_Package_Exception($ret->getMessage());
         } else {
             $stats['success']++;
         }
     }
     return $stats;
 }
示例#2
0
文件: index.php 项目: pear/net_ftp
head("\$ftp->put({$baseDir}{$singleTestFile}, {$singleTestFile})");
Var_Dump::display($ftp->put($baseDir . $singleTestFile, $singleTestFile));
head("\$ftp->ls(null, NET_FTP_FILES_ONLY)");
Var_Dump::display($ftp->ls(null, NET_FTP_FILES_ONLY));
head("\$ftp->put({$baseDir}{$singleTestFile}, {$singleTestFile}, true)");
Var_Dump::display($ftp->put($baseDir . $singleTestFile, $singleTestFile, true));
head("\$ftp->ls(null, NET_FTP_FILES_ONLY)");
Var_Dump::display($ftp->ls(null, NET_FTP_FILES_ONLY));
head("\$ftp->mdtm({$singleTestFile}, 'd.m.Y H:i:s')");
Var_Dump::display($ftp->mdtm($singleTestFile, 'd.m.Y'));
head("\$ftp->size({$singleTestFile})");
Var_Dump::display($ftp->size($singleTestFile));
head("\$ftp->get({$singleTestFile}, {$baseDir}{$singleTestFile}, true)");
Var_Dump::display($ftp->get($singleTestFile, $baseDir . $singleTestFile, true));
head("\$ftp->chmod({$singleTestFile}, 700)");
Var_Dump::display($ftp->chmod($singleTestFile, 700));
head("\$ftp->ls(null, NET_FTP_FILES_ONLY)");
Var_Dump::display($ftp->ls(null, NET_FTP_FILES_ONLY));
head("\$ftp->cd('../')");
Var_Dump::display($ftp->cd('../'));
head("\$ftp->chmodRecursive({$baseDir}, 777)");
Var_Dump::display($ftp->chmodRecursive($baseDir, 777));
head("\$ftp->ls(null, NET_FTP_DIRS_ONLY)");
Var_Dump::display($ftp->ls(null, NET_FTP_DIRS_ONLY));
head("\$ftp->putRecursive({$baseDir}{$testUpDir}, {$baseDir}{$testUpDir})");
Var_Dump::display($ftp->putRecursive($baseDir . $testUpDir, $baseDir . $testUpDir));
head("\$ftp->putRecursive({$baseDir}{$testUpDir}, {$baseDir}{$testUpDir})");
Var_Dump::display($ftp->putRecursive($baseDir . $testUpDir, $baseDir . $testUpDir, true));
head("\$ftp->cd({$baseDir}:{$testUpDir})");
Var_Dump::display($ftp->cd($baseDir . $testUpDir));
head("\$ftp->ls(null, NET_FTP_DIRS_FILES)");