[fw-general] Re: [fw-mvc] CUSTOM_Controller_Plugin is loaded twice

2010-06-15 Thread Patrick Figel
Where exactly are you executing var_dump("TESTING");?
It's possible that the plugin event methods are executed more than
once. Consider the following actions:
public function fooAction()
{
echo 'fooAction()';
$this->_forward('bar');
}

public function barAction()
{
echo 'barAction()';
}

if you then register this controller plugin:
class Vendor_Controller_Plugin_Test extends Zend_Controller_Plugin_Abstract
{

public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$this->getResponse()->appendBody('preDispatch()');
}

}

you'll get the following output when calling fooAction:

preDispatch()
fooAction()
preDispatch()
barAction()

This will happen whenever you use _forward (could be triggered in
another controller plugin - e.g. to forward non-authenticated users -
too!) and is expected behaviour. I guess the same applies to the
action() view helper.

hope this helps.



2010/6/14 Enkhbilguun Erdenetsogt :
> Hello everyone,
> I just found that CUSTOM_Controller_Plugin is loaded twice. I don't think it
> is normal.
> I'm using ZF 1.10.5 and application.ini registers my Controller Plugins
> like resources.frontController.plugins.Testo = "MY_Controller_Plugin_Testo".
> I just var_dump("TESTING"); in Testo Controller Plugin and the message is
> displayed twice in my browser.
> Do you know how to avoid such duplicated load?
>
>
> ---
> Enkhbilguun Erdenetsogt


Re: [fw-general] Action gets called twice

2010-03-18 Thread Patrick Figel
Hi,

disabling the layout solved the issue.

The second request was actually triggered by ZFDebug
(http://code.google.com/p/zfdebug/) and some js it injects
automatically. Without a layout, it doesn't do that.
I'll try to find out what's causing this later ...

After I disabled ZFDebug, I could enable the layout without having
anymore double request.

Thanks for your help,

2010/3/18 Hector Virgen :
> That's true, but even without rewrite you can still invoke the ZF
> application (by accessing index.php/foo/bar). And I'm not sure if Firebug
> would be a good indicator since your ZF app may not respond with a 404. Have
> you tried disabling the layout to see if you're still getting double
> requests?
>
> --
> Hector
>
>
> On Thu, Mar 18, 2010 at 8:42 AM, Patrick Figel  wrote:
>>
>> Hi,
>>
>> there is no rewrite set up on this server. The URLs look like
>> http://example.com/public/index.php/foo/bar/baz/foobar which works
>> fine (you don't wanna set up rewrite on IIS 6! ;-)).
>>
>> I did check this with Firebug too and it found no missing files, so
>> the problem is somewhere else.
>>
>> thanks,
>>
>>
>> 2010/3/18 Hector Virgen :
>> > Most of the time this is due to a missing stylesheet, javascript, or
>> > image.
>> > I would take a look at your layout (or login page) for a broken/missing
>> > reference.
>> > It could also be a stylesheet that has an invalid background URL. Make
>> > sure
>> > all background image URLs start with "/" e.g. "/images/background.png"
>> > instead of "images/background.png".
>> > I hope this helps.
>> >
>> > --
>> > Hector
>> >
>> >
>> > On Thu, Mar 18, 2010 at 6:29 AM, Patrick Figel 
>> > wrote:
>> >>
>> >> Hi,
>> >>
>> >> I just found out that all actions in our application get called twice.
>> >>
>> >> There's a related issue on stackoverflow:
>> >>
>> >>
>> >> http://stackoverflow.com/questions/721205/Zend-Framework-Action-Gets-Called-Twice
>> >>
>> >> Disabling all controller plugins which could force a redirect,
>> >> removing all _forwards etc., didn't solve the issue.
>> >>
>> >> Like that guy on stackoverflow, I'm using Zend_Controller_Router_Route:
>> >>
>> >>        $route = new Zend_Controller_Router_Route(
>> >>            ':language/:region/:controller/:action/*',
>> >>            array(
>> >>                'language'   => 'de',
>> >>                'region' => 'at',
>> >>                'controller' => 'index',
>> >>                'action'     => 'index'
>> >>            )
>> >>        );
>> >>
>> >> I tried to debug this by writing debug_backtrace's output to the log
>> >> and found this after _one_ request:
>> >>
>> >> #0  LoginController->indexAction() called at
>> >> [*\library\Zend\Controller\Action.php:513]
>> >> #1  Zend_Controller_Action->dispatch(indexAction) called at
>> >> [*\library\Zend\Controller\Dispatcher\Standard.php:289]
>> >> #2
>> >>
>> >>  Zend_Controller_Dispatcher_Standard->dispatch(Zend_Controller_Request_Http
>> >> Object ([] => Array ([0] => _GET,[1] => _POST),[] =>
>> >> */public/index.php/de/at/login/index/,[] => */public/index.php,[] =>
>> >> ,[] => /de/at/login/index/,[] => Array ([language] => de,[region] =>
>> >> at,[controller] => login,[action] => index),[] => ,[] => Array (),[]
>> >> => 1,[] => default,[] => module,[] => login,[] => controller,[] =>
>> >> index,[] => action), Zend_Controller_Response_Http Object ([] => Array
>> >> (),[] => Array (),[] => Array (),[] => Array (),[] => 200,[] => ,[] =>
>> >> ,[headersSentThrowsException] => 1)) called at
>> >> [*\library\Zend\Controller\Front.php:954]
>> >> #3  Zend_Controller_Front->dispatch() called at
>> >> [*\library\Zend\Application\Bootstrap\Bootstrap.php:97]
>> >> #4  Zend_Application_Bootstrap_Bootstrap->run() called at
>> >> [*\library\Zend\Application.php:366]
>> >> #5  Zend_Application->run() called at [*\public\index.php:45]
>> &

[fw-general] Action gets called twice

2010-03-18 Thread Patrick Figel
Hi,

there is no rewrite set up on this server. The URLs look like
http://example.com/public/index.php/foo/bar/baz/foobar which works
fine (you don't wanna set up rewrite on IIS 6! ;-)).

I did check this with Firebug too and it found no missing files, so
the problem is somewhere else.

thanks,


2010/3/18 Hector Virgen :
> Most of the time this is due to a missing stylesheet, javascript, or image.
> I would take a look at your layout (or login page) for a broken/missing
> reference.
> It could also be a stylesheet that has an invalid background URL. Make sure
> all background image URLs start with "/" e.g. "/images/background.png"
> instead of "images/background.png".
> I hope this helps.
>
> --
> Hector
>
>
> On Thu, Mar 18, 2010 at 6:29 AM, Patrick Figel  wrote:
>>
>> Hi,
>>
>> I just found out that all actions in our application get called twice.
>>
>> There's a related issue on stackoverflow:
>>
>> http://stackoverflow.com/questions/721205/Zend-Framework-Action-Gets-Called-Twice
>>
>> Disabling all controller plugins which could force a redirect,
>> removing all _forwards etc., didn't solve the issue.
>>
>> Like that guy on stackoverflow, I'm using Zend_Controller_Router_Route:
>>
>>        $route = new Zend_Controller_Router_Route(
>>            ':language/:region/:controller/:action/*',
>>            array(
>>                'language'   => 'de',
>>                'region' => 'at',
>>                'controller' => 'index',
>>                'action'     => 'index'
>>            )
>>        );
>>
>> I tried to debug this by writing debug_backtrace's output to the log
>> and found this after _one_ request:
>>
>> #0  LoginController->indexAction() called at
>> [*\library\Zend\Controller\Action.php:513]
>> #1  Zend_Controller_Action->dispatch(indexAction) called at
>> [*\library\Zend\Controller\Dispatcher\Standard.php:289]
>> #2
>>  Zend_Controller_Dispatcher_Standard->dispatch(Zend_Controller_Request_Http
>> Object ([] => Array ([0] => _GET,[1] => _POST),[] =>
>> */public/index.php/de/at/login/index/,[] => */public/index.php,[] =>
>> ,[] => /de/at/login/index/,[] => Array ([language] => de,[region] =>
>> at,[controller] => login,[action] => index),[] => ,[] => Array (),[]
>> => 1,[] => default,[] => module,[] => login,[] => controller,[] =>
>> index,[] => action), Zend_Controller_Response_Http Object ([] => Array
>> (),[] => Array (),[] => Array (),[] => Array (),[] => 200,[] => ,[] =>
>> ,[headersSentThrowsException] => 1)) called at
>> [*\library\Zend\Controller\Front.php:954]
>> #3  Zend_Controller_Front->dispatch() called at
>> [*\library\Zend\Application\Bootstrap\Bootstrap.php:97]
>> #4  Zend_Application_Bootstrap_Bootstrap->run() called at
>> [*\library\Zend\Application.php:366]
>> #5  Zend_Application->run() called at [*\public\index.php:45]
>> --
>> #0  LoginController->indexAction() called at
>> [*\library\Zend\Controller\Action.php:513]
>> #1  Zend_Controller_Action->dispatch(indexAction) called at
>> [*\library\Zend\Controller\Dispatcher\Standard.php:289]
>> #2
>>  Zend_Controller_Dispatcher_Standard->dispatch(Zend_Controller_Request_Http
>> Object ([] => Array ([0] => _GET,[1] => _POST),[] =>
>> */public/index.php/de/at/login/index/,[] => */public/index.php,[] =>
>> ,[] => /de/at/login/index/,[] => Array ([language] => de,[region] =>
>> at,[controller] => login,[action] => index),[] => ,[] => Array (),[]
>> => 1,[] => default,[] => module,[] => login,[] => controller,[] =>
>> index,[] => action), Zend_Controller_Response_Http Object ([] => Array
>> (),[] => Array (),[] => Array (),[] => Array (),[] => 200,[] => ,[] =>
>> ,[headersSentThrowsException] => 1)) called at
>> [*\library\Zend\Controller\Front.php:954]
>> #3  Zend_Controller_Front->dispatch() called at
>> [*\library\Zend\Application\Bootstrap\Bootstrap.php:97]
>> #4  Zend_Application_Bootstrap_Bootstrap->run() called at
>> [*\library\Zend\Application.php:366]
>> #5  Zend_Application->run() called at [*\public\index.php:45]
>>
>> I added sleep(5) to the action and logged $_SERVER[''REQUEST_TIME']:
>> array (
>>  ...
>>  'REQUEST_TIME' => 1268918186,
>>  ...
>> )
>>
>> array (
>>  ...
>>  'REQUEST_TIME' => 1268918191,
>>  ...
>> )
>>
>> The app is running on Win2k3/IIS 6 with Zend Server CE 4.0/PHP 5.3
>>
>> Any idea?
>>
>> Thanks,
>
>


[fw-general] Action gets called twice

2010-03-18 Thread Patrick Figel
Hi,

I just found out that all actions in our application get called twice.

There's a related issue on stackoverflow:
http://stackoverflow.com/questions/721205/Zend-Framework-Action-Gets-Called-Twice

Disabling all controller plugins which could force a redirect,
removing all _forwards etc., didn't solve the issue.

Like that guy on stackoverflow, I'm using Zend_Controller_Router_Route:

$route = new Zend_Controller_Router_Route(
':language/:region/:controller/:action/*',
array(
'language'   => 'de',
'region' => 'at',
'controller' => 'index',
'action' => 'index'
)
);

I tried to debug this by writing debug_backtrace's output to the log
and found this after _one_ request:

#0  LoginController->indexAction() called at
[*\library\Zend\Controller\Action.php:513]
#1  Zend_Controller_Action->dispatch(indexAction) called at
[*\library\Zend\Controller\Dispatcher\Standard.php:289]
#2  Zend_Controller_Dispatcher_Standard->dispatch(Zend_Controller_Request_Http
Object ([] => Array ([0] => _GET,[1] => _POST),[] =>
*/public/index.php/de/at/login/index/,[] => */public/index.php,[] =>
,[] => /de/at/login/index/,[] => Array ([language] => de,[region] =>
at,[controller] => login,[action] => index),[] => ,[] => Array (),[]
=> 1,[] => default,[] => module,[] => login,[] => controller,[] =>
index,[] => action), Zend_Controller_Response_Http Object ([] => Array
(),[] => Array (),[] => Array (),[] => Array (),[] => 200,[] => ,[] =>
,[headersSentThrowsException] => 1)) called at
[*\library\Zend\Controller\Front.php:954]
#3  Zend_Controller_Front->dispatch() called at
[*\library\Zend\Application\Bootstrap\Bootstrap.php:97]
#4  Zend_Application_Bootstrap_Bootstrap->run() called at
[*\library\Zend\Application.php:366]
#5  Zend_Application->run() called at [*\public\index.php:45]
--
#0  LoginController->indexAction() called at
[*\library\Zend\Controller\Action.php:513]
#1  Zend_Controller_Action->dispatch(indexAction) called at
[*\library\Zend\Controller\Dispatcher\Standard.php:289]
#2  Zend_Controller_Dispatcher_Standard->dispatch(Zend_Controller_Request_Http
Object ([] => Array ([0] => _GET,[1] => _POST),[] =>
*/public/index.php/de/at/login/index/,[] => */public/index.php,[] =>
,[] => /de/at/login/index/,[] => Array ([language] => de,[region] =>
at,[controller] => login,[action] => index),[] => ,[] => Array (),[]
=> 1,[] => default,[] => module,[] => login,[] => controller,[] =>
index,[] => action), Zend_Controller_Response_Http Object ([] => Array
(),[] => Array (),[] => Array (),[] => Array (),[] => 200,[] => ,[] =>
,[headersSentThrowsException] => 1)) called at
[*\library\Zend\Controller\Front.php:954]
#3  Zend_Controller_Front->dispatch() called at
[*\library\Zend\Application\Bootstrap\Bootstrap.php:97]
#4  Zend_Application_Bootstrap_Bootstrap->run() called at
[*\library\Zend\Application.php:366]
#5  Zend_Application->run() called at [*\public\index.php:45]

I added sleep(5) to the action and logged $_SERVER[''REQUEST_TIME']:
array (
  ...
  'REQUEST_TIME' => 1268918186,
  ...
)

array (
  ...
  'REQUEST_TIME' => 1268918191,
  ...
)

The app is running on Win2k3/IIS 6 with Zend Server CE 4.0/PHP 5.3

Any idea?

Thanks,