 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Zend Developer Zone: Chaining language with default route
by Chris Cornutt August 12, 2010 @ 10:47:01
On the Zend Developer Zone there's a new post talking about including language information in your Zend Framework application's default route in a cleaner manner.
There are several ways how to include language id in default route of Zend Framework. However, generally you end up with the solution not quite elegant and likely not totally trouble-free. I have seen people overwriting the default route by new one which mimics module route with additional language id. There is no need to throw the default module route away to do this. To get it right chain the plain language route with default route.
He gives code examples of the routing code to put in your bootstrap that uses the Zend_Controller_Router_Route_Chain and a plugin to handle the language checking and routing handling.
voice your opinion now!
default route zendframework plugin
Emran Hasan' Blog: Changing the default controller naming convention in CodeIgniter
by Chris Cornutt September 21, 2009 @ 09:43:09
Emran Hasan has a quick new post to his blog today looking at how you can change the default controller naming scheme that the CodeIgniter framework uses (to prevent things like naming conflicts and the like).
CodeIgniter is one of my favorite framework and I often use it for developing application quickly. Although it is very flexible in most cases, I find its naming convention to be strict. Many times I have faced this problem when my controller's class name and a model/library's class names are the same '" a Fatal error is inevitable.
His method involves extending the core CI_Router class to change the _validate_request method to change the location and the naming convention (from Users to UsersController) for the default controller settings. Code for the update is included.
voice your opinion now!
codeigniter naming controller default tutorial
Terry Chay's Blog: How much does a date() cost?
by Chris Cornutt May 07, 2009 @ 11:18:28
In a new post to his blog Terry Chay looks at the real cost of a (call to) date() - the PHP function that can parse either the current or an inputted timestamp out into the date format you specify.
One of the fringe benefits of open sources an existing code base is that you have an opportunity to setting error_reporting on E_ALL | E_STRICT or perhaps rather just to 2147483647. When you do that you find small problems with your code base you missed the first time you sloppily wrote it. In my case, I noticed that date() was throwing strict errors.
Due to his resulting request to test the error (after submitting a ticket to fix the server's php.ini settings), he went about trying to test and see what the real impact of working with the date function was by developing his own simple benchmarking script. It runs through five different tests some with a default timezone set and some not. His results found that doing it in the script versus on the server's config didn't make much of a difference so he corrected the issue with a quick ini_set (or a date_default_timezone_set).
voice your opinion now!
date timezone default benchmark iniset datedefaulttimezoneset
Make Me Pulse: Using the Zend Framework URL rewriting
by Chris Cornutt January 15, 2009 @ 07:55:15
New from the Make Me Pulse blog is this quick tutorial about bending the URL rewriting that the Zend Framework does to match whatever your needs might be.
Today for a good website's referencement in Google, it's necessary to have an URL rewriting. [...] If your application is based on ZF, we have a htaccess base file which will redirect all php files to the boostrap (what is the bootstrap ?), and ZF classes will manage all redirection rules. How to implement the URL rewriting with ZF classes ?
He sets up a config file (an ini file) with the routing instructions the framework will need to adhere to and shows how to get the application to include it and match against it for routing rules. His example sets a default route and several regular expression-based routes to remap requests right where they need to go.
voice your opinion now!
zendframework config file ini routing regex default route tutorial
Ibuildings Blog: Off-The-Shelf Server Setup
by Chris Cornutt May 30, 2008 @ 08:43:28
On the Ibuildings blog, Ian Barber has a reminder to PHP developers out there used to their servers "just working" because of the popularity of LAMP. He recommends digging a little deeper to the "behind the scenes" of how the server is configured.
PHP programmers generally know what a good systems architecture should look like, but it is often a reality of development that they will have little input on the system itself until the last minute. In fact, it's far from uncommon for a developer to be faced with an off-the-shelf dedicated LAMP server, and left up to their own devices.
He recommends getting to know things like the package manager for your distribution (apt, yum, yast, etc), stripping down the modules your installation is using, check that all of the packages in use need to be enabled and ensure that the network connection is set up correctly and is what you need for the site.
voice your opinion now!
oftheshelf default installation configuration behindthescenes lamp server
Ian Selby's Blog: Weird PHP Seg Faults & Custom Session Handlers
by Chris Cornutt September 18, 2007 @ 10:27:00
In recent work, Ian Selby came across something odd - a setup where PHP was segfaulting without any real indication of where the error might be:
Starting to get a little frustrated, I took a peek at my error logs (/var/log/httpd/error_log for the unitiated), and discovered a wonderful message [about the segfault]. As any person scratching their head would do, I hit up google.. to no real avail. Just a bunch of php bug reports. So, what happened, and how did I fix it?
After searching through the code and narrowing down where it could be, the culprit looked like a custom session handler he was using. It uses MySQL to store the sesion information and, unfortunately, when Ian had compiled the server he didn't let PHP know about his unique setup.
His default installation was trying to use the default MySQL information (including the socket) to reach the database. Obviously failing, the server simply gave up and segfaulted. Thankfully, all it takes it a recompile with a few extra parameters and you're back in business.
voice your opinion now!
segfault custom session handler mysql default configure segfault custom session handler mysql default configure
|
Community Events
Don't see your event here? Let us know!
|