Pseudo Pseudonym
Pseudo Pseudonym

Reputation: 13

Manually installing phpoffice

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?

Upvotes: 0

Views: 4128

Answers (1)

YoloZoloo
YoloZoloo

Reputation: 51

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 「ダウンロード」.

Upvotes: 2

Related Questions