-- howard chen <[email protected]> wrote
(on Tuesday, 03 February 2009, 11:59 AM +0800):
> Hello,
>
> I have some questions related to the offical ZFW QuickStart Guide
> (http://framework.zend.com/docs/quickstart)
>
> 1. The tutorial encourage the use of "APPLICATION_ENVIRONMENT", but
> where should I define this variable? in index.php or bootstrap.php?
In index.php. Typically, I actually set it in my .htaccess or vhost
using apache's SetEnv directive, and then try to pull it from there.
So, for instance, I might have the following line in my .htaccess:
SetEnv APPLICATION_ENV development
Then, in my index.php:
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV',
isset($_SERVER['APPLICATION_ENV'])
? $_SERVER['APPLICATION_ENV']
: 'production');
> 2. The example app use Zend_Config_Ini to read ini file every request,
> will it be slow in real apps? (since parsing take time)
Not really. parse_ini_file() is actually very fast -- typically faster
than parsing XML, and only slightly slower than include()ing a file with
a native PHP array.
> 3. There is an error in this page:
> http://framework.zend.com/docs/quickstart/create-a-model-and-database-table
>
> Search for the word " application/model/GuestBook.php", it should be
> " application/models/GuestBook.php"
Thanks -- this has been reported previously, and we'll be updating for
the next site refresh.
--
Matthew Weier O'Phinney
Software Architect | [email protected]
Zend Framework | http://framework.zend.com/