-1
如果我在簡單文件中使用,類zip完美地工作,但在類如下的類中,我有一個錯誤。我忘了什麼?當我調用zip類時發生錯誤
如何解決這個問題?
謝謝。
Fatal error: Uncaught Error: Class 'Zip' not found in /home/www/boutique/includes/Apps/WebService/ChatBot/Sites/Admin/Pages/Home/Actions/ChatBot/ExportZip.php:32
我的課的一部分
namespace Apps\WebService\ChatBot\Sites\Admin\Pages\Home\Actions\Chatbot;
use \OM\Registry;
use OM\OSCOM;
class ExportZip extends \OM\PagesActionsAbstract {
public function execute() {
$OSCOM_ChatBot = Registry::get('ChatBot');
$OSCOM_Language = Registry::get('Language');
$transfer_directory = OSCOM::getConfig('dir_root', 'Shop') . 'includes/Work/google_ai/';
$languages = $OSCOM_Language->getLanguages();
$Zip = new Zip();
$intent_file = 'my_zip_file' . '-' . date('YmdHis') . '.zip';
$Qapps = $OSCOM_ChatBot->db->prepare('select p.products_id,
p.products_image,
pd.products_name,
pd.products_description_summary
from :table_products p,
:table_products_description pd
where p.products_id = pd.products_id
and p.products_archive = 0
and p.products_status = 1
and p.products_view =1
');
$Qapps->bindInt(':products_id', (int)$OSCOM_Language->getId());
$Qapps->execute();
$apps = $Qapps->fetchAll();
$result = $Zip->open($transfer_directory . $intent_file, ZipArchive::CREATE);
我在使用ZIP嘗試和/或$ Zip = new \ Zip();但不起作用。你是另一個想法嗎?該zip庫已安裝。 – Amy
你指的是哪個庫? –
ZIP我安裝就像apt-get php-zip(native) – Amy