[dokuwiki] PHP and global question
- From: Myron Turner <turnermm02@xxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Tue, 30 Oct 2007 11:54:08 -0500
It sounds like a path problem.
When you include the nested file in myclass.php, do you use an absolute
path name or a relative pathname?
From: Morten Lemvigh
I have a wiki-page containing something like:
<php>
require_once "dir/myclass.php";
$mc = new MyClass();
echo $mc->print_stuff();
</php>
And in myclass.php I include another file defining some variables. The
file is properly included, and I can access the variables outside the
class definition in myclass.php, but I cannot access the same
variables from from inside the MyClass definition through the php
global keyword. If I just create a simple php-script with the same
code as above, there's no problem. It's only when it's included in a
wiki-page.
If anyone is able to cast light on this problem, I would be very thankful,
Morten
--
_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
Other related posts:
- » [dokuwiki] PHP and global question
- » [dokuwiki] PHP and global question
- » [dokuwiki] Re: PHP and global question
- » [dokuwiki] Re: PHP and global question
- » [dokuwiki] Re: PHP and global question
- » [dokuwiki] Re: PHP and global question
- » [dokuwiki] Re: PHP and global question
- » [dokuwiki] Re: PHP and global question
I have a wiki-page containing something like: <php> require_once "dir/myclass.php"; $mc = new MyClass(); echo $mc->print_stuff(); </php>And in myclass.php I include another file defining some variables. The file is properly included, and I can access the variables outside the class definition in myclass.php, but I cannot access the same variables from from inside the MyClass definition through the php global keyword. If I just create a simple php-script with the same code as above, there's no problem. It's only when it's included in a wiki-page.
If anyone is able to cast light on this problem, I would be very thankful, Morten