如果我在简单文件中使用,类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);
答案 0 :(得分:0)
由于您的类位于命名空间中,因此您必须使用Zip类完全限定名称,即具有正确的使用语句