Symfony 2 and ZipArchive - class not found!

It was crazy. I was trying to make my ZipArchive work and I know now, that it was already working just Symfony2 did not knew about it!

Fatal error: Class 'Demo\AcmeBundle\Controller\ZipArchive' not found 





All you need to do is just add this line into your controller or any other place where you are trying to use ZipArchive:
use ZipArchive; 
 That's it!
Just add use ZipArchive; on the top of your file in Symfony 2 and you will be able to use PHP ZipArchive class.

2 comments:

You can ask IT questions in comments!