Mantis

[Resolved] Variable globale

Posted by Gg 
Gg
[Resolved] Variable globale
April 28, 2009 09:55AM
Bonjour,

Je souhaite déclarer des variables (du type: $nombre = 4) dans Mantis accessible depuis la page www/core/custom_constant_inc.php et aussi depuis www/bug_view_page.php. J'ai pensé les déclarer dans config_inc mais elles ne sont alors pas lisibles depuis custom_constant_inc.

Comment faire ?

Merci.
Re: Variable globale
April 28, 2009 09:59AM
Peut-être qu'en ajoutant ceci avant d'utiliser la variable fonctionnera :
Language: PHP
$variable; ( $variable ) { ...

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Gg
Re: Variable globale
April 28, 2009 11:08AM
Salut, non ça ne marche pas.

Je veux un fichier PHP avec mes variables dans www/.

Inclure ce fichier dans certaines pages du repertoire www/ et www/core.

Je n'y arrive pas en utilisant require_once(args).

Si pouviez m'indiquer les arguments correctes pour inclure une page de www/ dans www/core ça devrait le faire!


Merci.
Gg
Re: Variable globale
April 29, 2009 03:42PM
Solution trouvée:

Dans www/custom_constant_inc:
Language: PHP
span class="br0">("maConstante", 4);


Dans mes pages situées dans www/:
Language: PHP
span class="br0">( $g_absolute_path . &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;custom_constant_inc.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; );
...
puis :
Language: PHP
$maVar = maConstante;


Dans mes pages situées dans www/core:
Language: PHP
$t_www_path = config_get( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;absolute_path&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; ); ( $t_www_path . &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;custom_constant_inc.php&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; );

...
puis $maVar = maConstante;
Sorry, only registered users may post in this forum.

Click here to login



Online Users

Guests: 11
Record Number of Users: 1 on April 02, 2023
Record Number of Guests: 115 on November 09, 2023
Top Users
Hébergeur : Morinie.Fr