Bonjour,

Je debute avec Zend et je tente en veins de créer une route. J'aurais besoin de créer un chemin qui pointe vers le controller "GatewayController". J'ai suivi un tutorial et voici ce a quoi ressemble mon fichier bootstrap :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
<?php
 
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
	public function run(){
		parent::run();
	}
 
	// Surcharge de _initAutoLoad
	protected function _initAutoload()
	{
		$moduleLoader = new Zend_Application_Module_Autoloader(array('namespace'=>'', 'basePath'=>APPLICATION_PATH));
 
		$frontController = Zend_Controller_Front::getInstance();
		$router = $frontController->getRouter();
 
		$router->addRoute('gateway', new Zend_Controller_Router_Route_Static('gateway', array(
			'module' => 'frontend',
			'controller' => 'Gateway',
			'action' =>'index'))
		);
 
		$router->addRoute('index', new Zend_Controller_Router_Route_Static('index', array(
			'module' => 'frontend',
			'controller' => 'index',
			'action' =>'index'))
		);
 
		return $moduleLoader;
	}
 
}
voici également mon fichier /public/.htaccess

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
 
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /public/index.php [NC,L]

et également mon fichier de conf d'apache

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
<VirtualHost *:80>
	ServerAdmin webmaster@localhost
 
	DocumentRoot /home/dougui/workspace/Zend/AgendaWeb/
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
 
 
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>
 
	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride None
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>
 
	ErrorLog /var/log/apache2/error.log
 
	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn
 
	CustomLog /var/log/apache2/access.log combined
 
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
 
</VirtualHost>
J'ai essayé plusieurs choses. Tout d'abord j'ai essayé plusieurs combinaisons pour les paramettres de la création de mon objet route (avec ou sans majuscules etc.). Initialement, l'url de l'application etait http://localhost/Zend/AgendaWeb/, j'ai essayé de taper l'url http://localhost/Zend/AgendaWeb/gateway ou http://localhost/Zend/AgendaWeb/public/gateway/.

Par la suite j'ai essayé de modifier le fichier de config de apache pour qu'il pointe vers la racine du projet ou le dossier public pour avoir l'url http://localhost/gateway/ ou http://localhost/public/gateway/. J'ai aussi tenter de mettre un fichier .htaccess à la racine.

J'ai également ajouté ce code dans le fichier de conf d'apache
<Directory /home/dougui/workspace/Zend/AgendaWeb/>
AllowOverride all
</Directory>
pour activer l'urlrewriting mais j'obtiens une erreur 503.

Bref j'ai essayé quelques trucs mais rien ne marche.

Comment puis-je faire? J'utilise ubuntu 10.04, apache 2 et toute les dernières versions. Je précise que j'ai déjà réeussi à faire fonctionner le système avec Ruby On Rails.

Merci.