[dokuwiki] PHP and global question

  • From: Morten Lemvigh <lemvigh@xxxxxxxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Tue, 30 Oct 2007 13:15:25 +0100

I'm having a problem with PHP and global in wiki-pages.

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

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: