Helper qui ne peut pas être chargé
Bonjour à tous.
Je ne sais pas ce qui m'arrive mais j'ai une aide de vue MyUrl qui marche très bien dans quelques pages et ne marche pas dans d'autres.
Voilà ce qui est bizarre :
- J'ai une page1, et une page2.
- Je navigue dans page1 : aucun problème
- Ensuite je vais dans page2 et j'obtiens une erreur.
- Je reviens dans page1 : j'obtiens une erreur.
- Je vide le cache du navigateur
- Je reviens sur page1 : l'erreur disparaît
- Je vais sur page2 : l'erreur réapparaît
- Je reviens sur page1 : l'erreur réapparaît jusqu'à ce que je revides le cahe de mon navigateur
J'utilise Firefox 3.6.3.
Ci-dessous l'erreur :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
object(Zend_Session_Exception)#305 (8) {
["_previous":"Zend_Exception":private] => NULL
["message":protected] => string(326) "Zend_Session::start() - C:\wamp\www\myrep\myapp\library\Zend\Loader.php(Line:146): Error #2 include_once() [<a href='function.include'>function.include</a>]: Failed opening 'Zend\View\Helper\MyUrl.php' for inclusion (include_path='C:\wamp\www\myrep\myapp\application/../library;C:\wamp\www\myrep\myapp\library;.;C:\php5\pear') Array"
["string":"Exception":private] => string(0) ""
["code":protected] => int(0)
["file":protected] => string(46) "C:\wamp\www\myrep\myapp\library\Zend\Session.php"
["line":protected] => int(493)
["trace":"Exception":private] => array(7) {
[0] => array(6) {
["file"] => string(56) "C:\wamp\www\myrep\myapp\library\Zend\Session\Namespace.php"
["line"] => int(143)
["function"] => string(5) "start"
["class"] => string(12) "Zend_Session"
["type"] => string(2) "::"
["args"] => array(1) {
[0] => bool(true)
}
}
[1] => array(6) {
["file"] => string(47) "C:\wamp\www\myrep\myapp\application\Bootstrap.php"
["line"] => int(84)
["function"] => string(11) "__construct"
["class"] => string(22) "Zend_Session_Namespace"
["type"] => string(2) "->"
["args"] => array(2) {
[0] => string(3) "myapp"
[1] => bool(true)
}
}
[2] => array(6) {
["file"] => string(78) "C:\wamp\www\myrep\myapp\library\Zend\Application\Bootstrap\BootstrapAbstract.php"
["line"] => int(665)
["function"] => string(13) "_initSessions"
["class"] => string(9) "Bootstrap"
["type"] => string(2) "->"
["args"] => array(0) {
}
}
[3] => array(6) {
["file"] => string(78) "C:\wamp\www\myrep\myapp\library\Zend\Application\Bootstrap\BootstrapAbstract.php"
["line"] => int(618)
["function"] => string(16) "_executeResource"
["class"] => string(44) "Zend_Application_Bootstrap_BootstrapAbstract"
["type"] => string(2) "->"
["args"] => array(1) {
[0] => string(8) "sessions"
}
}
[4] => array(6) {
["file"] => string(78) "C:\wamp\www\myrep\myapp\library\Zend\Application\Bootstrap\BootstrapAbstract.php"
["line"] => int(582)
["function"] => string(10) "_bootstrap"
["class"] => string(44) "Zend_Application_Bootstrap_BootstrapAbstract"
["type"] => string(2) "->"
["args"] => array(1) {
[0] => NULL
}
}
[5] => array(6) {
["file"] => string(50) "C:\wamp\www\myrep\myapp\library\Zend\Application.php"
["line"] => int(355)
["function"] => string(9) "bootstrap"
["class"] => string(44) "Zend_Application_Bootstrap_BootstrapAbstract"
["type"] => string(2) "->"
["args"] => array(1) {
[0] => NULL
}
}
[6] => array(6) {
["file"] => string(38) "C:\wamp\www\myrep\myapp\public\index.php"
["line"] => int(28)
["function"] => string(9) "bootstrap"
["class"] => string(16) "Zend_Application"
["type"] => string(2) "->"
["args"] => array(0) {
}
}
}
["previous":"Exception":private] => NULL
} |
et ci-dessous le contenu de application_path/views/helpers/MyUrl.php
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
<?php
class Zend_View_Helper_MyUrl extends Zend_View_Helper_Abstract
{
function myUrl(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
{
$router = Zend_Controller_Front::getInstance()->getRouter();
return 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' :
'') . '://' . $_SERVER['HTTP_HOST'] . $router->assemble($urlOptions, $name, $reset, $encode);
}
} |
Est-ce que quelqu'un a déjà rencontré ce genre de problème?
(Les autres View helpers que j'ai créés marchent très bien)
Merci.