PhpSpreadsheet - Distribution / Packaging

315 views Asked by At

PHPSpreadsheet uses Composer for installation (which was a pain on a windows PC using Netbeans but that's another story).

In the good old days you used to just drop a folder with the PHP files into a project, include them and off you went. Now the package includes folders of documentation, tests, examples, etc.

When installing code on a production machine it makes sense to only install the bare minimum to improve security and performance. Composer doesn't seem to let you do this. Removing un-needed folders like cache, composer, psr etc breaks the code.

Is there some way to clean up in Composer / PHPSPreadsheet so only the bare minimum of files are required. Under PHPExcel it was trivial but the dependency etc seem to go for miles using composer. To me it seems another example of bloatware and clever ideas run amuck.

Why would i want composer or similar runing everytime i make a call to create a spreadsheet on a production machine. I only want phpSpreadsheet. I've googled, checked docs etc but no information leaps out.

1

There are 1 answers

0
jhoskins98 On

Composer does not run unless invoked on the command line. You are confusing the package installation and the code running. Composer is looking at the composer.json and .lock files. I looked at the size of the package - 12 megs on disk. Half is in docs and samples directories which I deleted and my code still ran. The rest is code or artifacts that I would not delete.