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
Related
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.
I am currently using mPDF to handle a couple of things. The problem I'm facing however is that mPDF uses a version of FPDI that is unable to handle files over PDF version 1.4. There is a (paid) commercial addon that makes handling newer PDF files possible though. The problem is:
I installed mPDF through composer.
I am unable to change the FPDI package, since mPDF is a package in and of itself, that uses another package.
My question is: How can I change mPDF to use the commercial (v2) version of FPDI?
Thanks in advance.
~Brendan
There's this pull request, that adds compatibility for FPDI v2. Because of BC breaks it will be merged in mPDF 8.
Until that just use the legacy version of the parser add-on. This can also be installed with composer.
This is regarding Laravel and I am still pretty new to the framework. I recently updated my Laravel to 5.4. And I am running into the following error:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Call to undefined method Illuminate\Foundation\Application::share()
Some investigation landed me on one of my vendor module 'Way' is still call share(), which is no longer supported. I did realize that singleton() is the preferred way, but should I even touch the vendor files? Should composer update the vendor Modules as well (especially Way since it is one of the core module)?
Any tips will be greatly appreciated!
Thanks.
laravel 5.4 share has been removed. You will have to use the singleton instead.
See this
https://github.com/laravel/framework/commit/1a1969b6e6f793c3b2a479362641487ee9cbf736
I was able to fix it for now by adjusting the way generator line in composer.json to:
"way/generators": "dev-master"
The library was updated but it is just not included in the composer update.
Just want to post the answer here in case anyone is running into similar issue.
This library does not have support for Laravel 5.4 .
Author referred other library : laracasts/generators. Both the packages are managed by same author.
Check below link : https://github.com/JeffreyWay/Laravel-4-Generators#laravel-5
I'm using Laravel 5.1 with the package laravelcollective/remote to run an SSH command on a remote server:
\SSH::into('myserver')->run($commands);
But I'm getting the following error message:
Methods with the same name as their class will not be constructors in a future version of PHP; Net_SFTP has a deprecated constructor
I can see that the error is coming from phpseclib package, and on newer versions they have fixed that. (They changed the function name to __construct), but I can't update phpseclib package because I don't include it on my composer.json file, laravelcollective/remote does this.
How can I solve this?
You cannot and should not solve this as it has already been fixed as you correctly stated.
The warnning about the deprecated construtor method is only a warning/info. This does not influence your application. As soon as laravellcollective include the newer version of phpseclib in their composer.json this warning will disappear. Of course you need the check from time to time and update your application with a composer update.
I want to use wepay PHP sdk in laravel 5 using composer but I didn't found any laravel package for it.
Can you please tell me me how can I do this?
The package is available via packagist.org - unfortunately only as a dev-master branch and with suboptimal autoloading configured (I'm trying to fix that, sent both a patch and opened an issue suggesting they tag their version).
Adding that package is basic Composer action. The classes should be automatically available within Laravel wherever you think you want to use it.