- I'm at Carrefour http://4sq.com/gtSlat #
- Here is something from my Happy Easter collection: Salmonella – Wikipedia, the free encyclopedia http://bit.ly/e0G0Fn #
- Shared: Long label names in Gmail http://bit.ly/ieXs6M #
- I'm at Chester's http://4sq.com/eQ1mhl #
Disable and enable CakePHP plugins on the fly
I am currently working on a rather large project which is based on CakePHP framework.  In order to simplify the task, I’ve broken down the whole application into a number of CakePHP plugins.  Now, however, I want to enable/disable plugins on the fly.  After a brief search around I couldn’t find how to do that.  Asking a question at #cakephp IRC channel did it.  RabidFire instantly replied with the link that gave me an idea.  30 seconds later I had a working solution.
CakePHP plugins extend AppController. Â So all that one needs to do is add the following lines to app/app_controller.php (Using CakePHP 2.0, but it’s trivial to adopt for earlier versions):
public function beforeFilter() { $allowedPlugins = array('crm', 'articles'); if (!empty($this->request->params['plugin']) && !in_array($this->request->params['plugin'], $allowedPlugins)) { throw new ForbiddenException(); } }
Upgrading to PHP 5.2.x on CentOS
Today while setting up yet another project on my hosting server. Â The server runs CentOS 5.6, which means PHP 5.1.6 is used. Â However the new project required PHP 5.2.0+. Â It turned out upgrading PHP is trivial. Â There is even a Howto Guide in CentOS wiki. Â The steps are:
- Add CentOS Testing repository to yum.
- yum update PHP packages.
That’s all folks!
Day in brief
- I'm at The Woodman Pub (Georgiou A') http://4sq.com/h6JxKY #
No more Cyprus ID cards for foreigners. What’s the problem?
For the last few days I keep hearing and reading about this bit of news:
FOREIGN nationals are no longer being issued a Cyprus ID card, a decision implemented islandwide last Friday without explanation or notification from the Interior Ministry.
I do understand that Cyprus ID card is a handy thing to have. Â But I don’t see what’s the big problem about not having it is anyway. Â I’m a Cypriot now and I do have an ID card, but I lived in this country for ten years without having one, and I never knew I had a problem.
First of all, Cyprus is not some weird police state. Â One doesn’t have to prove his or her identity every day to anyone. Â Nobody is policing the street, stopping random passers-by with routine identity checks. Â The proof of identity is needed mostly when working with government and financial offices. Â With online banking and JCC online payments is there really someone who goes to the bank on a daily basis? Except bank employees of course. Â I don’t think so.
Secondly, Cyprus is a country with very weak public transport network. Â So almost everyone, if not everyone, drives a car. Â And if one drives a car, I think it’s safe to assume that driving license is not too far away. Â Cyprus driving license is not the most compactest of things and certainly not the most convenient to carry around. Â But I think it works well given how (not) far most people get from their vehicles.
Thirdly, I think having Cyprus ID cards only for Cypriots makes a lot of sense. Â I’ve seen it more than once when non-citizens pass as citizens just because they have a Cyprus ID card. Â Yes, not everyone turns it around to check for citizenship/nationality.
Fourthly, I’m sure that the majority of complaining people are British expats, who are used to much higher living conditions (including a working government) than most other expats and country guests. Â The problem is not as big as they are trying to make it. Â No offense intended.