And indeed it works. Though too the end of the index.php fooAutoload get called
50 times.
<?php
$GLOBALS['test'] = 0;
function fooAutoload( $className )
{
$GLOBALS['test'] +=1;
if ( !defined( 'EZP_ROUTER_EXECUTION' ) and class_exists( 'ezcUrl' ) )
{
define( 'EZP_ROUTER_EXECUTION', true );
$test = new ezcUrl( );
}
if( $className == 'testy')
{
die( "Testy found ".$GLOBALS['test']."runs" );
}
}
spl_autoload_register( 'fooAutoload' );
?>
Best regards,
Björn Dieding
-----------------------------------------------
Björn Dieding | Executive Director
xrow GmbH
Enterprise Content Management
Am Lindener Berge 22
30449 Hannover
Phone: +49 (511) 473 91 54 01
Mobile: +49 (151) 12169868
Skype: bjoerndieding
Email: [email protected]
Web: http://www.xrow.com
Phone (general office): +49 (511) 473 91 54 00
CEO: Björn Dieding, Sören Meyer
TIN: DE257265797 HRB: Hannover 202464
-----------------------------------------------
Disclaimer: This electronic transmission is strictly confidential and intended
solely for the addressee. If you are not the intended addressee, you must not
disclose, copy or take any action in reliance of this transmission. If you
have received this transmission in error it would be helpful if you could
notify xrow GmbH as soon as possible.
-----Ursprüngliche Nachricht-----
Von: Gaetano Giunta [mailto:[email protected]] Im Auftrag von Gaetano
Giunta
Gesendet: Dienstag, 21. April 2009 23:58
An: Björn Dieding
Cc: [email protected]; Georg Franz
Betreff: Re: [Sdk-public] RFC post autoload hook
Björn Dieding a écrit :
> Hi,
>
> we are in the need of having a hook directly after the autoloads are loaded.
> The reason for that is that we need to do some custom and fast routing of
> requests e.g. for blacklisted ips, bots or just to archive things that
> mod_rewrite can`t do.
>
> I created this very simple patch. I am asking you now, if we can include such
> a behavior in eZ Publish and what your comments are.
>
Maybe a little dirtier, but could you not obtain the same behavior by
just adding your routing code directly from within config.php?
In case you neeed the autoload system to work for you routing code to be
executed, you could have added calls to spl_autoload_register in there...
> I was also thinking about doing something more configurable and nicer with
> signal slot, but I didn`t want to introduce any performance penalty.
> Otherwise I would have done it that way. E.g. Introduce shutdown and startup
> slots in the system.
>
> Best regards,
> Björn Dieding
>
> -----------------------------------------------
> Björn Dieding | Executive Director
> xrow GmbH
> Enterprise Content Management
>
> Am Lindener Berge 22
> 30449 Hannover
>
> Phone: +49 (511) 473 91 54 01
> Mobile: +49 (151) 12169868
> Skype: bjoerndieding
> Email: [email protected]
> Web: http://www.xrow.com
> Phone (general office): +49 (511) 473 91 54 00
>
> CEO: Björn Dieding, Sören Meyer
> TIN: DE257265797 HRB: Hannover 202464
> -----------------------------------------------
>
> Disclaimer: This electronic transmission is strictly confidential and
> intended solely for the addressee. If you are not the intended addressee,
> you must not disclose, copy or take any action in reliance of this
> transmission. If you have received this transmission in error it would be
> helpful if you could notify xrow GmbH as soon as possible.
>
>
--
Sdk-public mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/sdk-public