php - For the life of me, I can't figure out how to setup the Zend Framework -


i'm sorry, know there tons of tutorial on , tried , didn't work.

i have wamp installed in c:. it's document root d:/sites/wamp. have been able load regular html, php, wordpress , code igniter there.

with code igniter, quite easy had copy paste library d:/sites/wamp folder , configure database.

with zend framework, i'd similar i'd have copy files wamp folder. possible? i'd avoid using zend tool now. point me in right direction please tutorial or files copy over.

if reason don't want use zend_tool here default basic application structure:

project |-- application |   |-- bootstrap.php |   |-- configs |   |   `-- application.ini |   |-- controllers |   |   |-- errorcontroller.php |   |   `-- indexcontroller.php |   |-- models |   `-- views |       |-- helpers |       `-- scripts |           |-- error |           |   `-- error.phtml |           `-- index |               `-- index.phtml |-- library |   `--zend //zend framework  goes here *** |-- public |   |-- .htaccess |   `-- index.php `-- tests     |-- application     |   `-- bootstrap.php     |-- library     |   `-- bootstrap.php     `-- phpunit.xml 

in zend framework download find library folder , in there find zend folder. copy whole zend folder project/library end project/library/zend/

your default .htaccess , belongs in public folder:

rewriteengine on rewritecond %{request_filename} -s [or] rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [nc,l] rewriterule ^.*$ index.php [nc,l] 

also in public folder index.php , like:

<?php //the next line optional , remove index.php url //$_server["request_uri"] = str_replace('index.php', '', $_server["request_uri"]); // define path application directory defined('application_path')     || define('application_path', realpath(dirname(__file__) . '/../application'));  // define application environment defined('application_env')     || define('application_env', (getenv('application_env') ? getenv('application_env') : 'production'));  // ensure library/ on include_path set_include_path(implode(path_separator, array(     realpath(application_path . '/../library'),     get_include_path(), )));  /** zend_application */ require_once 'zend/application.php';  // create application, bootstrap, , run $application = new zend_application(     application_env,     application_path . '/configs/application.ini' ); $application->bootstrap()             ->run(); 

at project/application/configs/ live application.ini file , in beginning like:

[production] phpsettings.display_startup_errors = 0 phpsettings.display_errors = 0 includepaths.library = application_path "/../library" bootstrap.path = application_path "/bootstrap.php" bootstrap.class = "bootstrap" appnamespace = "application" resources.frontcontroller.controllerdirectory = application_path "/controllers" resources.frontcontroller.params.displayexceptions = 0  [staging : production]  [testing : production] phpsettings.display_startup_errors = 1 phpsettings.display_errors = 1  [development : production] phpsettings.display_startup_errors = 1 phpsettings.display_errors = 1 

the default bootstrap.php looks like:

class bootstrap extends zend_application_bootstrap_bootstrap { } 

the default indexcontroller looks like:

class indexcontroller extends zend_controller_action {      public function init()     {         /* initialize action controller here */     }      public function indexaction()     {         // action body     } } 

and default error controller looks like:

class errorcontroller extends zend_controller_action {      public function erroraction()     {         $errors = $this->_getparam('error_handler');          switch ($errors->type) {             case zend_controller_plugin_errorhandler::exception_no_route:             case zend_controller_plugin_errorhandler::exception_no_controller:             case zend_controller_plugin_errorhandler::exception_no_action:                  // 404 error -- controller or action not found                 $this->getresponse()->sethttpresponsecode(404);                 $this->view->message = 'page not found';                 break;             default:                 // application error                 $this->getresponse()->sethttpresponsecode(500);                 $this->view->message = 'application error';                 break;         }          $this->view->exception = $errors->exception;         $this->view->request   = $errors->request;     } } 

now should able accesyour project @ url http://localhost/project/public request zend framework application route through index.php.

i recommend zend_tool, built reason.

if need more...rtm of right out of docs.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -