我正在创建Epub包,我需要按以下顺序打包
$dest = "ebooks/pack/";
exec("zip -DX0 ".$dest."/book.zip ".$dest."/mimetype ");
exec("zip -DrX9 ".$dest."/book.zip ".$dest."/META-INF ".$dest."/OEBPS");
所以当我打包时,Zip存档结构如下所示
ebooks/pack/mimetype
ebooks/pack/META-INF
ebooks/pack/OEBPS
但我需要将这些文件放在家中,例如当我取消压缩它应该如下所示
mimetype
META-INF
OEBPS
我还试图通过cd ebooks/pack/
导航,这会引发错误
zip warning: name not matched: mimetype
我甚至使用了home/user/public_html/ful
exec("cd home/sam/public_html/domain.com/".$dest."/; zip -DX0 ".$dest."/book.zip mimetype 2&1",$output);
我甚至尝试了chdir
,它显示了我的文件所在的正确路径
echo getcwd() . "\n";
chdir('home/sam/public_html/domain.com/".$dest."/');
echo getcwd() . "\n";