草庐IT

install_zip_gh

全部标签

php - 在php中删除zip内的文件夹

我有一个具有以下结构的ZIP文件(skins.zip):yellow|_resources|_theme|_codes我需要删除skins.zip中名为theme/的文件夹。我尝试了以下代码但没有成功。$zip=newZipArchive;if($zip->open('skins.zip')===TRUE){$zip->deleteName('yellow/theme/');$zip->close();}有人能帮帮我吗? 最佳答案 我只有以下代码,并留下了print_r输出,让您了解发生了什么:$z=newZipArchive;$f

php - 拉维尔 5 : Installing ide helper for Netbeans

我正在尝试实现Laravelidehelper:barryvdh/laravel-ide-helper。尝试下载要点,将它放在我项目的根文件夹中,但它没有用。还尝试使用composer安装它并在config/app.php文件中添加Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class。即使我重新启动netbeans,这两种方法都不起作用。使用Ubuntu和Laravel5.1.20有人知道我做错了什么吗? 最佳答案 用composer安装它是不够的,你还必须用这个命令生成

php - 使用 PHP 从 ZIP 存档中查找和显示图像文件的更简洁的方法

functionshowimage($zip_file,$file_name){if(file_exists($zip_file)){$zip=zip_open($zip_file);while($zip_entry=zip_read($zip)){if(zip_entry_open($zip,$zip_entry,"r")){if(zip_entry_name($zip_entry)==$file_name){$theimg=zip_entry_read($zip_entry,zip_entry_filesize($zip_entry));$theimg=imagecreatefro

php - 如何使用 composer.phar install 解决问题

我正在尝试将composerinstall与symfony2一起使用。但是我一次又一次地遇到这个问题。当我运行时:phpcomposer.phpinstall我收到以下我不知道如何修复的错误:错误#1[Symfony\Component\Debug\Exception\ContextErrorException]Warning:date_default_timezone_get():Itisnotsafetorelyonthesystem'stimezonesettings.Youarerequiredtousethedate.timezonesettingorthedate_defa

php - 使用 PHP 下载后不提取 .zip 文件

我使用这个PHP类以.zip格式下载我的备份文件:publicfunctiondownload($file){$filename=$this->dir.$file;$fp=fopen($filename,"rb");header("Pragma:public");header("Expires:0");header("Cache-Control:must-revalidate,post-check=0,pre-check=0");header("Cache-Control:public");header("Content-Description:FileTransfer");heade

php - 在 composer 中设置 "config.fxp-asset.installer-paths"选项

当我运行composerupdate时,我会在继续更新之前收到以下警告。The"extra.asset-installer-paths"optionisdeprecated,usethe"config.fxp-asset.installer-paths"option我在哪里/如何更改这些设置? 最佳答案 将extra.asset-installer-paths部分替换为:"config":{"fxp-asset":{"installer-paths":{"npm-asset-library":"vendor/npm","bower-

php - 使用 PHP 将文件添加到未压缩的 zip

我在看tutorial用于创建ePub文件。它声明包含ePub书籍的zip文件必须包含一个名为mimetype的文本文件,该文件“必须位于zip文件的第一个,未压缩”。他给出的示例使用命令行工具,我想知道如何在PHP中做同样的事情。我假设只要它是我在代码中添加的第一件事,它就会在zip文件中排在第一位,但是如何将它添加到未压缩的zip文件中。还是我误读了这个?提前致谢。 最佳答案 上面的base64编码文件似乎有点问题(ZipArchive拒绝打开它),但以下工作正常://makethearchivefirstfile_put_co

PHP 从 zip 文件目录中读取文本文件

我有一个包含一组压缩文件的目录。这些文件中的每一个都有foo.txt文件。我如何从每个zip文件中读取这个文本文件?我知道glob用于列出目录中的所有文件 最佳答案 PHP有anextension这使您可以使用ZIP存档。请注意,要访问该文件,您无需解压缩整个存档。ZipArchive::extractTo方法允许您指定要提取的内容。$zip=newZipArchive;$res=$zip->open('test.zip');$zip->extractTo('my/extract/folder/','foo.txt');

php - 输入 : '\' while installing Laravel 4 in a dreamhost account 中的意外字符

过去几个小时我一直在尝试在我的dreamhost帐户上安装Laravel4,但我一直收到此错误:Warning:Unexpectedcharacterininput:'\'(ASCII=92)state=1in/home/user/test/artisanonline46Parseerror:syntaxerror,unexpectedT_STRINGin/home/user/test/artisanonline46当我运行时/usr/local/bin/php-5.4-dmemory_limit=256Mcomposer.pharcreate-projectlaravel/larav

php - Fontawesome 字体在 Assets :install and assetic:dump 后失败

我正在尝试建立一个我在共享主机上工作的网站,一切正常,但FontAwesome图标因为Symfony找不到它们应该在的位置。我按照以下步骤将网站移至生产共享主机:将Assets发布为硬拷贝,因为SH不允许符号链接(symboliclink),所以我运行此命令assets:install通过运行以下命令发布由Assetic处理的Assets:assetic:dump(dev)和assetic:dump--env=prod(prod)但它不起作用,因为我在Firebug中一直遇到此错误:"NetworkError:404NotFound-http://tanane.com/bundles/