How to Get dependency of a PHP script? -
I am using a PHP library PHPExcel in my script. Now the library is very big around 7 MB and I do not think I am using it all the facilities. I want to lightweight my script by inserting files in PHPExcel which I am not using.
PHPExcel uses an autoloader that contains only the file that your The script actually uses, so the actual "memory" size of the script is kept minimal.
If you are not using any language other than English, then you can delete all the subdirectories in the classes / PHPExcel / locale ... if you want to have other places like francs, you can use fr Exclude all subdirectories except (0.5 MB savings).
However, I will not recommend removing any other thing. Especially without knowing what you need is what you need.
If the disk space is absolutely important, and you are working with only xls (for example) files, then you have all other readers and authors (note that the PDF author uses the HTML author) ; But then you have to clearly recognize that instead of relying on IOFactory's autodetect, which reader or author you are going to use while reading: very clear syntax:
$ objReader = PHPExcel_IOFactory :: createReader ('Excel5'); $ ObjPHPExcel = $ objReader-> Load ("excel file 5.xls"); Instead of
$ objPHPExcel = PHPExcel_IOFactory :: load ("excel5File.xls") should be used;
If you do not need a PDF author, then removing classes / PHPExcel / Shared / PDF (TCPDF) will save 4.5 MB of discs
However, I If you really want to remove the size on the disk, the comments need to be removed from the code, the size is going to be greatly reduced. Quite ... I'm sure there are scripts available in that which will do this.
Edit
Dixon's response to the answer from the Paul script is the code on the disk.
Comments
Post a Comment