mikegioia / phalcon-boilerplate

Phalcon Boilerplate is a template for building large-scale PhalconPHP applications. It contains the structure and configuration for managing a big project.
Other
71 stars 19 forks source link

Converted config array into object #4

Closed Abhinav1217 closed 9 years ago

Abhinav1217 commented 9 years ago

Hi, I converted the $localconfig array into object of type Config. It is now working with Phalcon 2.0.3. I used an object of anonymous type which I think was introduced in PHP 5.4 . Thus I think it would now be incompatible with php 5.3 and below. But given modern nature of Phalcon, I think anyone who would want to use this would also keep their php version updated.

I also added an Nginx config sample for anyone who would want to use it.

mikegioia commented 9 years ago

Thanks Abhinav, I'll merge this in either later today or over the weekend.

Abhinav1217 commented 9 years ago

There is no hurry. It is still not perfectly working on Phalcon 2.0 . I am getting a warning.

Strict Standards: Declaration of Base\Model::addBehavior() should be compatible with Phalcon\Mvc\Model::addBehavior(Phalcon\Mvc\Model\BehaviorInterface $behavior) in /var/www/Phalcon-BoilerPlate/app/base/Model.php on line 0

I tried typecasting it but it went haywire. Still working on some other workaround.

mikegioia commented 9 years ago

Yea, I figure as much. I'm going to run a full test through on 2.0.3. I might make a few updates to your branch before merging.

mikegioia commented 9 years ago

This has been merged in to master. I created a separate branch for 1.3.5 and now master is the current 2.0.x version. Thanks again for your help Abhinav, please let me know if you find any other bugs.

Abhinav1217 commented 9 years ago

I have been trying to find a solution to this warning since I made the pull request. This does not disturb working of the boilerplate but I do not prefer to ignore warnings.

Strict Standards: Declaration of Base\Model::addBehavior() should be compatible with Phalcon\Mvc\Model::addBehavior(Phalcon\Mvc\Model\BehaviorInterface $behavior) in /var/www/Phalcon-BoilerPlate/app/base/Model.php on line 0

So far a suggestion on http://stackoverflow.com/questions/3115388/declaration-of-methods-should-be-compatible-with-parent-methods-in-php has helped me to get started but I am going nowhere.

I will try to update in few more days.

mikegioia commented 9 years ago

Hi Abhinav, this should be resolved now. If you pull the latest from #master you should no longer get this warning. I updated the way behaviors work for 2.0.x.