 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Evan Coury: Environment-specific configuration in Zend Framework 2
by Chris Cornutt July 19, 2012 @ 11:36:06
Evan Coury has a new post looking at setting up environment specific configurations in a Zend Framework 2 application letting you switch between configs based on an environment variable.
So you're all excited to try out ZF2. You clone the skeleton, install some modules, maybe even follow Rob Allen's excellent ZF2 tutorial, and finally, start building your application. Now, if you're a former ZF1 user or refugee from another framework, you might be troubled at this point by the fact that, at first glance, ZF2 doesn't appear to take into consideration environment-specific configuration values (e.g., development, testing, staging, production). Luckily, this is not the case!
He includes a bit of sample code showing how you can use a simple getenv call to pull in the value from an "APPLICATION_ENV" environment variable and put it into an autoload path.
voice your opinion now!
zendframework2 environment config variable getenv
Ben Scholzen's Blog: Writing powerful and easy config files with PHP-arrays
by Chris Cornutt May 11, 2009 @ 12:05:45
Ben Scholzen has written up a post about how regular PHP arrays can be used as a native configuration option for your applications.
I was asked many times how I organize my config files, and my response was always the same, until some time ago when I switched began refactoring the codebase of my blog. [...] Looking at [the advantages of PHP config files], you may ask now why not everbody is using them. Well the problem mostly is that you cannot create extend-sections (when working with Zend_Config for example).
He compares an example of a method that, using a base config file with some "smarts", you can have it automatically pull in certain files and overwrite settings from the array inside. A sample "other config" file is also included, showing the definition of some PHP settings, resources and database information.
voice your opinion now!
configuration file array zendframework zendconfig smart base config
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
Abhinav Singh's Blog: PHP Extensions - How and Why?
by Chris Cornutt December 12, 2008 @ 11:17:23
Abhinav Singh has posted a guide to PHP extensions - what they are and how to write a simple "hello world" one.
Assuming you have read the previous post, lets discuss on how to build our first PHP extension: every PHP extension is built out of minimum of 2 files, a configuration file (config.m4) which tells us what files to build and what external libraries are needed and source File(s) which will contain the actual functionality.
He builds up an example skeleton for an extension (the config.m4) and explains how the file will be phpized and configured. Next up is the php_sample.h header file where the needed modules are loaded and the sample.c file to define them. Last, but not least, comes the extension code itself that calls the printf function to output the "hello world" message.
voice your opinion now!
extension tutorial header file config phpize helloworld
Developer Tutorials Blog: Why you should be using YAML for config
by Chris Cornutt January 25, 2008 @ 11:22:00
The Developer Tutorials blog has a new post mentioning the use of YAML structure for creating configuration files in your application.
YAML, or YAML Ain't Markup Language, is a "human friendly data serialization standard". It's essentially a very basic format for storing data, and uses far less syntax than standard PHP. [...] It's almost like English; it's as basic as you want. Of course, that's not to say it doesn't support complex structures - this example demonstrates the power of the format.
He also points out the spyc extension that makes working with the files in PHP a breeze.
voice your opinion now!
yaml config markup language configuration file spyc
|
Community Events
Don't see your event here? Let us know!
|