Autor Beitrag
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Fr 28.12.07 11:06 
Hallo,

besteht die Möglichkeit, den Basisordner vom include-Befehl zu ändern?
Und zwar muss man ja, wenn der aktuelle Skript im root-Ordner liegt, immer include("modules/.../x.php") aufrufen. Mir wäre es lieber, wenn ich an der Stelle nur noch include("x.php") aufrufen müsste.

Grüße
Heiko
DarkHunter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 477

Win XP
D3 Prof, D2005 PE
BeitragVerfasst: Sa 29.12.07 01:38 
Es gibt in der PHP.ini eine Möglichkeit einen globalen include_path anzugeben. Jedoch betrifft das dann alle Scripte.

Evtl ist es möglich diesen Pfad zur Laufzeit über ini_set("include_path",<hier neuen Pfad angeben>); zu ändern.

Der Pfad muss AFAIK ein absoluter sein Pfad im Dateisystem sein.

_________________
I believe that every human has a finite number of heart-beats. I don't intend to waste any of mine running around doing exercises.
- Neil Armstrong
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Sa 29.12.07 01:53 
Ich bin mir nicht sicher, ob das geht. Eventuell könnte man aber eine eigene Funktion schreiben, die Include mit dem zusammengesetzten Pfad aufruft. Ob der Parser das so versteht, wage ich aber zu bezweifeln.

Und ansonsten... kennt PHP Macros? Wenn ja, wären die auf jeden Fall machbar.

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."