RecursiveDirectoryIterator給人意外值ExeceptionRecursiveDirectoryIterator給出例外
$path= WEB."sync_content/offer/";
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($path),
RecursiveIteratorIterator::LEAVES_ONLY
);
foreach ($files as $name => $file) {
$fn=$file->getFilename();
if($fn!='.' && $fn!='..' && !is_dir($fn)) {
$filePath = $file->getRealPath();
$zip->addFile($filePath,$fn);
}
}
和錯誤是:
致命錯誤 未捕獲的異常 'UnexpectedValueException' 有消息「RecursiveDirectoryIterator :: __結構(http://localhost/base/sync_content/offer/):未能打開目錄:未在C:\ xampp \ htdocs \ base \ classes \ campaigns.class.php中實施249
並重,充分路徑直接(硬編碼),並檢查是否有工作或沒有? –
我試過了...但仍然是同一個錯誤... :( – dEL