Examples of zip applications in the CI framework. The zip class provided by the CI framework is simple and practical. This article will briefly introduce the use of the zip class of the CI framework. First, import the zip class: Copy the code as follows: $ this-load-(zip). In addition, the zip class provided by the CI framework is simple and practical, this article briefly describes how to use the zip class of the CI framework.
First, import the zip class:
The code is as follows:
$ This-> load-> ('Zip ');
In addition, considering the CI structure, you also need to set the automatic loading class to load the zip file.
AlsoIt can be loaded in a unified manner during configuration..
If you encounter this problem, it may be that the zip class is not loaded automatically.
The calling method is as follows:
The code is as follows:
$ Path = $ _ SERVER ['document _ root']; // path of the folder to be compressed
$ This-> zip-> read_dir ($ path, FALSE); // Start to compress the folder in the specified path and clear the structure.
$ This-> zip-> download('my_backup.zip '); // download the compressed file.
Bytes. First, import the zip class: the code is as follows: $ this-load-('Zip'); in addition,...