I am working on a website with PHP 7.4.15 and CI 4.1.1.
I need to use phpspreadsheet library so I installed it by composer.
but when I try to use that class , the below error shows.
Class 'PhpOffice\\PhpSpreadsheet\\Spreadsheet' not found
According to CI4 documents, CI4 find Composer Auto Load files.
Do I need to set other things?
Any ideas can be helpful for me.
Related
I am trying to integrate Google Translate library in a legacy application which does not use composer, and I have downloaded the source code folder "google-cloud-php-master".
Can anyone point me how to use the library without composer?
When I try to execute the below code
use Google\Cloud\Translate\TranslateClient;
$translate = new TranslateClient();
I am getting the below error. Any help would be appreciate.
Fatal error: Class 'Google\Cloud\Translate\TranslateClient' not found
I found a PHP caching library that I'd like to use in CodeIgniter, but the docs only have instructions for installing / using with composer: http://www.php-cache.com/en/latest/
I inherited a project on a server that doesn't have Composer. Ideally I would like to use it without Composer. Does anyone have any knowledge of how to load this without it?
well, you could download the package itself and add it to your Codeignitter libraries autoload (if that's possible, sorry, dont know too much of CodeIgnitter). Though if i'd be you i'd go into Composer, it is revolutionary for php apps and you're loosing out so much by not using it... just composer init in main app folder & make sure that your CI is reading the autoloaded classes (i bet you'll find some tutorial for that)
by download I mean download and require in your php files where you're using it!
How to use mPDF with latest version of PHP ( Codeigniter 3.x)?
I am using PHP 7.0.4 and codeigniter 3.x. I include the mPDF in my project but getting following error
Methods with the same name as their class will not be constructors in a future version of PHP; mPDF has a deprecated constructor
I tried by replacing function name with __construct but it is not working.
Do anyone have any idea?
Replace your mpdf by mPDF 5.7 library for PHP7
You can try development version of mPDF which can be obtained on GitHub or via composer with
$ composer require mpdf/mpdf#dev-development
You will have to set your minimum-stability accordingly.
There are some backwards incompatible changes - mainly namespaces and different constructor parameters.
WIP documentation can be read on GitHub at https://github.com/mpdf/mpdf.github.io/blob/development/configuration/configuration-v7-x.md
I need to use XML-RPC on my project. I have found a library phpxmlrpc (http://phpxmlrpc.sourceforge.net/) and I need to add it to vendor. I have copied the files in vendor folder (/vendor/phpxmlrpc/) and I need to see the xmlrpc_client class in my Controller. But I am not able to manage how to edit autoload.php to see the class, after a few attemps I am still getting "Attempted to load class "xmlrpc_client" from the global namespace.
Did you forget a "use" statement?" so I am pretty sure that there is some mess in my structure. I would really appreciate any help.
You must use a composer install tools for integrate 3third party code in your project a lot of possible time.
For XML-RPC you have this bundle : Symfony-rpc-bundle
When you install with composer install your bundle a lot of tricks run in your project symfony. Don't forget to add this bundle in your AppKernel.php file.
With this your code for XML-RPC is more upkeeping and stable.
A bit late with the answer, I fear, but phpxmlrpc can now be installed using Composer as you would do with any other package.
When checking out info about that library, just make sure that you look up the latest version on GitHub and not any more on SourceForge.
I used composer to download a php bitcoin library to play around with. https://github.com/phramz/php-bitcoin-api
This one specifically.
Anyways, everytime I try to use the library with
use Phramz\Bitcoin\Api\Connection\BuzzConnection;
use Phramz\Bitcoin\Api\BitcoindClient;
I get
Interface 'Phramz\Bitcoin\Api\Client' not found in
/root/vendor/phramz/php-bitcoin-api/src/Phramz/Bitcoin/Api/BitcoindClient.php
whenever I try to run any test code. I really want to play around with this library but Im sort of a newbie php programmer and this is frustrating me. Any help would be appreciated!
Make sure you require vendor/autoload.php as described in Composer documentation.
If Composer's vendor directory is not located in the current directory you'll need to use an absolute path or something like:
<?php
require_once(__DIR__."/../../vendor/autoload.php");
I had the kind of issue when I installed a new lib, and i just deployed the new lib to server only as I was new to PHP, it took me hours to figure out that the vendor/composer folder is updated when we install a new lib.
So if your server doesn't support composer install , upload the whole vendor folder to your server is the way.