How can I use static class methods with Composer?
I was working with WideImage (upload image vendor) in the last 2 years.
But actually I give a chance to composer with smottt/WideImage vendor.
My actually code for use WideImage in my ImageBehavior is:
App::import('Vendor', 'WideImage', array('file' => 'wideimage' . DS .
'WideImage.php'));
But, when I remove this folder wideimage, and now, use the folder generate
by composer, doesn't work:
App::import('Vendor', 'WideImage', array('file' => 'smottt' . DS .
'wideimage' . DS . 'lib' . DS . 'WideImage' . DS . 'WideImage.php'));
The only solution I found was:
$this->WideImage = new WideImage\WideImage();
But now, I not understand anymore: Before, I instantiated the class and
still used of course the static methods. Now I need to instantiate. Why?
Note: I have to say, because it was the only solution I found, if there is
another solution, please tell me.
Maybe my problem is not the composer, but my knowledge in PHP. Anyway, I
hope someone can help me with this.
No comments:
Post a Comment