allow access of global variables in included files from a class method
<p>I have a curious question, I'm importing an existing application into my project.</p>

<p>I have a class that has a method that requires files with functions in them. These functions make us of global variables.</p>

<p>I noticed that these functions cannot share a global variable between them because they are being called from a class method.</p>

<p>I know that if I first declare the global variables then require the files I can the included functions to make use of them. The issue that I have is that these included files with their own functions has 100's of global variable references. It will be extremely time consuming to fish through all the files and redeclare the global variables.</p>

<p>Is there a more direct approach of doing this?</p>

<p>example would be</p>

<pre><code>//class file
class run
{
    public function install()
    {
        require_once('file.php);
    }
}

//file.php
require('some/other/file.php);
function checks() {
   global $someVar;
   $somVar-&gt;test();
}
</code></pre>

<p>this will obviously throw an error like cannot access test() to non-object something something, unless I declare $someVar within the <code>run::install()</code></p>
