I am running Win 11 and here are the versions of the relevant components, I believe
X:MacifMikeBricePHPappsMacif>composer -V
Composer version 2.5.4 2023-02-15 13:10:06
X:MacifMikeBricePHPappsMacif>php -v
PHP 8.3.0 (cli) (built: Nov 21 2023 17:48:00) (NTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.3.0, Copyright (c) Zend Technologies
X:MacifMikeBricePHPappsMacif>git -v
git version 2.43.0.windows.1
I started with the command composer init and searched for the package phpoffice/phpspreadhseet. After attempting to answer the questions, not all of which I understood, the process completed without any error messages.
The directory vendor was created and in this space a sub-directory of phpoffice was created with phpspreasheet, so I assume the basic install was completed.
I entered the following command in an attempt to have the samples installed/downloaded:
composer require phpoffice/phpspreadsheet –prefer-source
This completed without errors:
X:MacifMikeBricePHPappsMacif>composer require phpoffice/phpspreadsheet –prefer-source
./composer.json has been updated
Running composer update phpoffice/phpspreadsheet
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating autoload files
1 package you are using is looking for funding.
Use the composer fund
command to find out more!
No security vulnerability advisories found
Using version ^1.29 for phpoffice/phpspreadsheet
X:MacifMikeBricePHPappsMacif>
However there is still no subdirectory named samples in the phpspreadsheet directory.
What am I missing
Installation of phpspreadsheet with sample scripts
2
Answers
Thank you for your comments. I deleted everything and tried to do the install again with the simple composer command "composer require phpoffice/phpspreadsheet". This resulted in a number of errors:
Install of psr/simple-cache failed Install of psr/http-message failed Install of psr/http-factory failed Install of psr/http-client failed Install of markbaker/complex failed Install of symfony/polyfill-mbstring failed 11/11 [============================] 100% In Filesystem.php line 284:
Could not delete X:Macif/vendor/composer/tmp-603be53df37e5fda9ff875a00dff62a7: This can be due to an antivirus or the Windows Search Indexer locking the file while they are analyzed
I have decided to quit, this is just way too complicated for me. Thanks again for your help.
You’re missing this part in the phpspreadsheet project :
https://github.com/PHPOffice/PhpSpreadsheet/blob/master/.gitattributes
As per the documentation, having it ignored from exports means it won’t be included in the directory if used as a third-party vendor.