Home

Latest happenings from my blog

View All Posts In My Blog »


ZF Autocomplete: Zend Framework command autocompletion

0 Comments

zend framework

Zftool is a nifty feature from Zend Framework, however It’s pretty tiring to remember all commands.

Using bash I’ve got a bunch of custom providers, and for that I have to remember all the commands or review them every time, so It’s missing a killer feature which is the bash command autocompletion.

Installation

  1. Clone it.
  2. Move it to bash completion scripts directory to be able to autocomplete zf providers and zf provider actions
  3. Enable ItI you want to run it immediately in the same opened shell you can do the following command

Note: It will be automatically available in any new shell.

Custom Providers and Caching

In case you are wondering, I’ve got many projects with many custom providers, will it autocomplete them?

The answer is YES, and it fetches the providers per directory basis. Since the fetching and filtering is a pretty heavy process, it caches the autocompleted options in /tmp/ so that it will only be slow the first time, and then it’s going to be blazing fast.

Clear ZF autocomplete cache for providers and actions

To clear the cache, you will need to delete the cache files in tmp, the following command will do the job for you.

Hope that would be helpful for you!


CakePHP Locale and Routing

1 Comment

CakePHP

When I was working on the cakephp localization ( l10n ) and internationalization ( i18n ), I came across a problem so I decided to let the world know about it if anyone had got the same issue.

What we want here is that a user can go to the localized version of the website according to the URL identified, for instance we want the website to load the English locale when we pass a URL like this http://example.tld/eng/Controller/Action

The problem is that while implementing the routes for the language detection, the plugins made a conflict with the rules in the routes file. Language routing is easy but sometimes can be tricky.
Read more…


PHP Variable Variables and Variable Constants

1 Comment

In this small article I’ll illustrate PHP’s variable variables and Variable constants. There is no variable constants in PHP but I’m introducing a methodology to implement the same approach and achieve the same functionality as variable variables.
Read more…