-
Our environment does not use namespaces, composer, or autoloads. Looking for simple instructions on how to use PhpSpreadsheet without the corresponding luggage. All I need to do is import a table. Currently importing excel tables exported as csv files. Works very well, but trying to eliminate a step. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Is the world regressing back to the 20th century? You don't even mention what version of PHP you're running that prevents use of composer, namespacing or autoloading; but these are all very different things. Official statement first:
It is possible to have composer installed locally on your development environment, run it to create its vendor folder, and then just push all of the generated files to the production server, with a single include to the If you can't use any autoloader for any reason, then you'll need to write a script that does all the includes for you (including dependencies). Note that by eliminating that "luggage", you're creating a lot more luggage in terms of having to load every file for every request, which is a big performance and memory overhead, and significant additional disk access. The whole purpose of an autoloader is to load only those files that are necessary for that request, eliminating much of the runtime luggage. The ability to autoload class files when required has been a standard part of PHP since version 5.3.0, nearly 12 years ago (June 2009). As long as you're running a PHP version that works with namespaces (also present in the core language since PHP version 5.3.0), and an autoloader (whether that's the If the reason that you can't use these is because you're running a version of PHP < 5.3.0, then you won't be able to run PHPSpreadsheet anyway. If you do need unofficial support for this, then I'll happily charge my hourly rate: just give me a contact number, and I will fax you a full set of instructions. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Is the world regressing back to the 20th century?
You don't even mention what version of PHP you're running that prevents use of composer, namespacing or autoloading; but these are all very different things.
Official statement first:
It is possible to have composer installed locally on your development environment, run it to create its vendor folder, and then just push all of the generated files to the production server, with a single include to …