0

I have Intervention installed in Laravel 5+, which I use daily. For a new application I have to use Codeigniter 3, and I am trying to install Intervention also into there. This will make everything much easier for me because I am used to this library.

As explained in the installation instruction I did:

php composer.phar require intervention/image

This command will give the following error:

[

RuntimeException]                                                                                                                                 
  Could not load package intervention/image in http://packagist.org: [UnexpectedValueException] Could not parse version constraint 4.x.x: Invalid v  
  ersion string "4.x.x"   

So after doing this I have decided to install it manually

I have placed the files in the third_party directory

In autoload.php:

autoload['packages'] = array(APPPATH.'third_party/Intervention/Image/ImageManager.php');

In my controller I am initializing the class:

$intervention = new ImageManager();

This will result in an error:

Fatal error: Class 'ImageManager' not found in /Applications/MAMP/htdocs/site-gen/application/controllers/admin/Dashboard.php on line 80

Please note also that I have also tried some different approaches but no matter what I do I will get the same error. I have also made a lot of searches with Google but seems that the codeigniter users don't like this library. I can not find anything useful.

If you have this already up and running I will appreciate if you could give me some help.

Thank you

Franco
  • 2,309
  • 1
  • 11
  • 18
  • 1
    Instead of third party package, you can try with usual vendor directory/json file and [composer autoloading](https://github.com/bcit-ci/CodeIgniter/blob/develop/application/config/config.php#L123). – Tpojka Feb 19 '16 at 00:07
  • I don't have any json file in the vendor directory, in this directory I have the autoload.php file installed. I really don't understand why I can not install the package with composer. As you see the manual installation do not work for this package. I am still wrestling with it the all day. Composer autoloading is already set to TRUE in my configuration. – Franco Feb 19 '16 at 00:11
  • Thanks for your reply, I finally could install Intervention with composer. I have this time first made a composer self-update and after this I could be able to install Intervention. – Franco Feb 19 '16 at 00:24
  • Great. Happy coding. – Tpojka Feb 19 '16 at 00:46

0 Answers0