-2

I have laravel4 setup in local pc with php version 5.5.6. In Laravel setup i installed the 'codeless/ziparchiveex' module and installed fine but when i put ziparchive coding in my controllers it gives error message "ZipArchiveEx Class Not Found". I see phpinfo file and zip file extension already enable so please help me to solve this issue.

My Coding of controller file is :

$zip = new ZipArchiveEx();
                $zip->open('path-to-zip', ZIPARCHIVE::OVERWRITE);
                $zip->addDir('directory-path');
                $zip->addDirContents("Image path contents");
                $zip->close();
Marwelln
  • 28,492
  • 21
  • 93
  • 117

1 Answers1

0

Assuming you installed the package through composer, did you then registered the package in your app/cofig/app.php under the providers and facades arrays?

Otherwise try to require the class on the top of your controllers:

require('vendor/codeless/src/ZipArchiveEx.php'); //for the path here just use your installation path 

Also if you get a:

PHP Fatal error: Class 'ZipArchiveEx' not found in project/vendor/laravel/framework/src/Illuminate/something/ZipArchiveEx.php on line xyz

This should fix it - Go in terminal, navigate to your project's directory and run:

composer dump-auto
cch
  • 3,336
  • 8
  • 33
  • 61
  • Thanks for the reply. This issue is solved using declare a class in app.php file. Thanks again for the suggestion. – Ramesh Vadaliya Dec 01 '14 at 04:47
  • Hi @RameshVadaliya if this or any answer has solved your question please consider [accepting it](http://meta.stackexchange.com/q/5234/179419) by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this. – cch Mar 24 '15 at 17:24