Skip to content

Instantly share code, notes, and snippets.

@twxxk
Created October 16, 2008 14:44
Show Gist options
  • Save twxxk/17152 to your computer and use it in GitHub Desktop.
Save twxxk/17152 to your computer and use it in GitHub Desktop.
Zend Framework 1.6.2のZend_Toolで作られたファイル
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php [NC,L]
<?php
// ** Check to see if the environment is already setup **
if (isset($bootstrap) && $bootstrap) {
// Enable all errors so we'll know when something goes wrong.
error_reporting(E_ALL | E_STRICT);
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
// Add our {{library}} directory to the include path so that PHP can find the Zend Framework classes.
// you may wish to add other paths here, or keep system paths: set_include_path('../library' . PATH_SEPARATOR . get_include_path()
set_include_path('../library');
// Set up autoload.
// This is a nifty trick that allows ZF to load classes automatically so that you don't have to litter your
// code with 'include' or 'require' statements.
require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();
}
// ** Get the front controller **
// The Zend_Front_Controller class implements the Singleton pattern, which is a design pattern used to ensure
// there is only one instance of Zend_Front_Controller created on each request.
$frontController = Zend_Controller_Front::getInstance();
// Point the front controller to your action controller directory.
$frontController->setControllerDirectory('../application/controllers');
// Set the current environment
// Set a variable in the front controller indicating the current environment --
// commonly one of development, staging, testing, production, but wholly
// dependent on your organization and site's needs.
$frontController->setParam('env', 'development');
<?php
// @see application/bootstrap.php
$bootstrap = true;
require '../application/bootstrap.php';
// $frontController is created in your boostrap file. Now we'll dispatch it, which dispatches your application.
$frontController->dispatch();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment