2017-07-15 9 views
-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); 

答えて

0

ますクラスを使用すると、ジップクラスの完全修飾名を使用する必要があり、名前空間にあるので、つまりは、適切な使用のなステートメント

+0

を持っている私は、使用ZIPで試してみました$ Zip = new \ Zip();および/または$ Zip = new \ Zip();しかし、仕事はありません。別のアイデアですか? zipライブラリがインストールされています。 – Amy

+0

あなたはどの図書館を参照していますか? –

+0

ZIP私はそのようにインストールされましたapt-get php-zip(ネイティブ) – Amy

関連する問題