7
votes

Définissez de nombreux chemins?

Je sais comment définir un chemin Inclure:

set_include_path('/path');


1 commentaires

La page manuelle PHP de la fonction exacte que vous utilisez montre comment faire cela.


4 Réponses :


9
votes

Séparez-les avec des colons (:).

set_include_path("/some/dir:/other/dir:.");


1 commentaires

Notez que cela ne fonctionnera pas sous Windows. Utilisez la plate-forme Séparateur de chemin indépendante au lieu de colons.



17
votes

Pour ce faire sous une forme croix, utilisez le Path_Sarator constante: < Pré> xxx

FYI: Vous pouvez également définir le chemin d'accès inclus dans php.ini ou dans votre configuration Apache Vhost.

pour votre référence supplémentaire: < Un href = "http://php.net/manual/fr/function.set-include-path.php" rel = "NOREFERRER"> Documentation PHP sur Set_include_Path ()


0 commentaires

1
votes

Cela fonctionne pour moi: -)

ini_set("include_path", ".;C:\wamp\bin\php\php5.3.13\pear;.;C:\wamp\bin\php\php5.3.13\Zend\library");


0 commentaires

7
votes

Réglage Inclure les chemins

Voici un moyen, dans une manière forte> indépendante indépendante forte>, pour définir de nombreux chemins incluent de nombreux chemins d'une gamme de valeurs: P>

$paths = array(
    'path/one/',
    'path/two/',
    'path/three/'
 );

set_include_path(get_include_path() . PATH_SEPARATOR . implode(PATH_SEPARATOR, $paths));


0 commentaires