How to Install PHPSpreadsheet in Joomla

拥有回忆 提交于 2019-12-11 16:02:59

问题


I'm wondering how to best incorporate PHPSpreadsheet into Joomla! applications, on shared hosting.

With PHPExcel, you just uploaded the library.

PHPSpreadsheet is using Composer, which is new to me, but looks straightforward enough. However, I see Joomla! includes it to manage dependencies in the core, but does not publish the composer.json file, and commits the /vendor subfolder.

Any advice on the best way to safely add PHPSpreadsheet so its available to Joomla! extensions, without messing up Joomla! core?


回答1:


You can just add a normal composer.json file in Joomla's root folder. Composer will then create a vendor folder on the main level, and leave the libraries/vendor folder unchanged for the Joomla core.

Any extension that wants to use libraries from the root vendor folder must take care of loading the corresponding vendor/autoload.php by itself.




回答2:


use

JLoader::registerNamespace('PhpOffice', $pathToPhpOffice);



回答3:


Similar lines to the above.... But how do you get PHPSpreadsheet installed on my hosted website, where I have limited access to the back end.

I can FTP to the root of the site.



来源:https://stackoverflow.com/questions/49267571/how-to-install-phpspreadsheet-in-joomla

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!