Hi,

If you have the application in a subdirectory (not webroot) then you may need to set a rewrite base (if using Core) or base url (with Incubator).

Usually it's something like:

$router = new Zend_Controller_RewriteRouter;
/*
 * On my platform, I need to set the RewriteBase for ZF 0.20
 * RewriteBase is assumed to be $_SERVER['PHP_SELF'] after
 * removing the trailing "index.php" string
 */
$rewrite_base = substr($_SERVER['PHP_SELF'], 0, -9);
$router->setRewriteBase($rewrite_base);

//... other controller setup in here

$controller->setRouter($router);

The rest is the same as you have...

If you're using the MVC classes in the incubator directory the process is different (let us know).

Regards,
Pádraic
 


Pádraic Brady
http://blog.quantum-star.com
http://www.patternsforphp.com


----- Original Message ----
From: Mauro Casula <[EMAIL PROTECTED]>
To: fw-general@lists.zend.com
Sent: Tuesday, November 14, 2006 1:38:48 PM
Subject: Re: [fw-general] How get Zend_Controller_Dispatcher_Token from index.php


I have upgraded PHP...
Now the application doesnt return errors but only the index action is
showed.

Is this code correct?

    $controller = new Zend_Controller_Front();
    $controller->registerPlugin(new AuthPlugin($db,$session,$post))
               ->setControllerDirectory('../app/controllers');
    $controller->dispatch();









Matthew Weier O wrote:
>
> -- Mauro Casula <[EMAIL PROTECTED]> wrote
> (on Tuesday, 14 November 2006, 03:05 AM -0800):
>> Adding
>>     require_once 'Zend/Registry.php';
>> this error disappear.. but i have this:
>>
>> Fatal error: Call to undefined method
>> Zend_Controller_Front::getinstance()
>> in C:\Progetti\Kettler\SITE\kettler\www\index.php on line 68
>>
>> So i have sobstitute in my index.php:
>>    $controller = Zend_Controller_Front::getInstance();
>> with:
>>   $controller = new Zend_Controller_Front();
>
> getInstance() was removed in the incubator component. Basically, we saw
> no reason to force a singleton instance, and having the singleton
> resulted in a testing nightmare.
>
>> but in this case i get this error:
>>
>> Fatal error: Call to undefined method ReflectionClass::newInstanceArgs()
>> in
>> C:\Programmi\php\Zend\incubator\library\Zend\Controller\Dispatcher.php on
>> line 391
>>
>> I think that i'm too much dependent on Core classes...
>>
>> Anyone know what can be the problem?
>
> Yep. Upgrade your PHP version to at least 5.1.4, which is the minimum
> supported version for framework. The method you indicate above,
> ReflectionClass::newInstanceArgs(), is part of PHP's Reflection API, and
> needs to be present for the current version of the dispatcher to work.
> To my knowledge, it's been in PHP since 5.1.2.
>
>
> --
> Matthew Weier O'Phinney
> PHP Developer            | [EMAIL PROTECTED]
> Zend - The PHP Company   | http://www.zend.com/
>
>

--
View this message in context: http://www.nabble.com/How-get-Zend_Controller_Dispatcher_Token-from-index.php-tf2621448s16154.html#a7337670
Sent from the Zend Framework mailing list archive at Nabble.com.




Everyone is raving about the all-new Yahoo! Mail beta.

Reply via email to