0

I have to install phpoffice/phpspreadsheet without composer since we are on shared hosting and composer does not seem to be installed there.

I tried the following:

  1. add the folder src/phpspreadsheet of the plugin (phpoffice/phpspreadsheet/src/phpspreadsheet) to my projects vendor/phpoffice, so the path for e.g. the spreadsheet.php file in the project is now root/vendor/phpoffice/phpspreadsheet/Spreadsheet.php
  2. add "phpoffice/phpspreadsheet": "*" to the composer.json in the root directory of the project
  3. current point: from what I understand in the yii2 documentation, I need to add the following code to some configuration file, but the guide does not tell me where.

code:

[    
       'aliases' => [   
       '@vendor' => '@vendor/phpoffice/phpspreadsheet',  
    ],  
]

Also, I'm assuming that Yii does not come with a vendor alias by default, so I guess I'd need to do something like Yii::setAlias("@vendor", Yii::$app->basePath."/vendor"); somewhere.

Am I going the right way with this?

  • I feel your pain. Installing something like phpoffice without composer can be difficult. Did you know it drags in a lot of other packages? You will have to install those by hand as well, and also all the packages they depend on. If you're running security critical software, and who doesn't, you have to check out all these packages. – KIKO Software Apr 19 '21 at 23:03
  • late response, but that's a big no from me then :/ – Pseudo Pseudonym May 15 '21 at 10:08

1 Answers1

2

I had same problem. I downloaded Library from github and

  1. changed its namespaces
  2. used autoload.php file
  3. It worked

the File is in this link https://github.com/YoloZoloo/PhpSpreadSheet/tree/master

You can change the folder name to any folder you like. Load [AnyFolder]->table.php from your server and press 「ダウンロード」.

YoloZoloo
  • 41
  • 4