Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-15-2007, 11:18 AM
Junior Member
 
Join Date: Dec 2007
Posts: 8
Lightbulb setControllerDirectory apparently does not set anything

PHP Code:
$frontController Zend_Controller_Front::getInstance();
$frontController->setControllerDirectory('D:\application\controllers');
$frontController->setBaseUrl('http://localhost/');
$frontController->dispatch(); 
returns the following error report:

Code:
Warning:  include_once(IndexController.php) [function.include_once]: failed to open stream: No such file or directory in D:\application\Bootstrap.php on line 5

Warning:  include_once() [function.include_once]: Failed opening 'IndexController.php' for inclusion (include_path='.;D:\libraries') in D:\application\Bootstrap.php on line 5

Warning:  include_once(IndexController.php) [function.include_once]: failed to open stream: No such file or directory in D:\application\Bootstrap.php on line 5

Warning:  include_once() [function.include_once]: Failed opening 'IndexController.php' for inclusion (include_path='.;D:\libraries') in D:\application\Bootstrap.php on line 5
hello world
it apparently does do load my view as it contains the 'hello world' output.
i did not added the controller directory to the include_path, why would i otherwise be setting the controller directory?

i am using zend framework 1.0.3, can anyone shed some light on the problem?

thanks in advance,
a zend forum regular

PARTIALLY SOLVED: created an instance of Zend_Controller_Dispatcher_Standard and called the method setControllerDirectory() on the Zend_Controller_Dispatcher_Standard instance and added it as default dispatcher for the front controller $frontController->setDispatcher($dispatcher);

well the problem that i now have, is that everything is loaded but the lookup effect is still hanging, so meaning i still get the above warning level error report (e.g. include_once(IndexController.php)) while my controller/action has been processed and the view parsed..

Last edited by ignace : 12-15-2007 at 04:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 12-28-2007, 06:59 PM
Junior Member
 
Join Date: Dec 2007
Posts: 9
Send a message via MSN to blurphp Send a message via Yahoo to blurphp
Default

If I understand the Docs right your controller path is the path from your includes path

I have this set in my ootstrapper file
Code:
set_include_path(dirname(__FILE__) . '/library' . PATH_SEPARATOR . get_include_path());
Libary is where the Zend frameowrk is. Here is my directory structure
Code:
/application
    /config  --holds zf config file
    /controllers
    /models
    /Smarty  -- Smarty specific folders
         /cache
         /config
         /templates
         /templates_c
    /views
         /index
         /user
/library
    /Smarty  --  holds all smarty files
    /Zend  --  holds all zf files
.htaccess
index.php  --  bootstrapper file
ANd set the controllers up as I have severel here is an example

Code:
/*
* Setup the controller
*/
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory(array(
'default' => 'application/controllers',
'blog' => 'modules/blog/controllers',
'news' => 'modules/news/controllers',
'chat' => 'modules/chat/controllers',
'forum' => 'modules/forum/controllers',
'calender' => 'modules/calander/controllers',
'cart' => 'modules/cart/controllers',
'games' => 'modules/games/controllers'
));
$front->throwExceptions(true);

/*
* Run the page and display it  GO!!!
*/
$front->dispatch();
I am still new to ZF ut this has been working fine for me and it makes it more portable.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-17-2008, 09:09 PM
Junior Member
 
Join Date: Jan 2008
Posts: 2
Default bootstrap error

hi, it's not working for me tho..

i can't make this to work, can anyone help??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-08-2008, 07:36 AM
Junior Member
 
Join Date: Feb 2008
Location: chicago
Posts: 1
Thumbs up

You should not need to set the include path of the controller. The only including i had to do was change the 'include_path' setting for PHP which I did with this code at the beginning of my bootstrap file:

PHP Code:
// Modify include path to include path to library
ini_set('include_path'ini_get('include_path') . PATH_SEPARATOR '../library');

// Zend Framework Includes
require_once "Zend/Loader.php";

Zend_Loader::loadClass('Zend_Controller_Front'); 

Use Zend_Loader to load all of your classes, the code looks much more friendly.


This is the directory structure I am using:

/application
/config
/controllers
/models
/views
/library
/Zend
/public -- This directory is set up as the Web Root
.htaccess
index.php -- bootstrapper file
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 01:51 PM.