clear method if another method has already been run, what is considered good logic here
<p>I am trying to do some experimenting and have been wondering what is a good approach to do this.</p>

<p>My first attempt is to create a <code>public $hasBeenRun</code> variable in my class and make it <code>true/false</code> depending on if a certain method has been run or not.</p>

<p>Now my question is that I am allowing a class method to run via a given URL as well as loading a method that does the same thing. So for example</p>

<pre><code>index.php
$app-&gt;load(); //if empty load default, otherwise load given application

url: http://foo.bar/myProject // loads the myProject application
</code></pre>

<p>Both of these do the same thing, the url triggers a method that does some stuff which then called the load() method on the application specified in the url.</p>

<p>In that example I have come into a few errors. One, because the <code>load()</code> method will run the application chosen within its logic. But if i go to the application URL, then it will load that application on top of the already loaded application.</p>

<p>So with that said, I have attempted the <code>$hasBeenRun</code> but feel that there can be a more elegant way to do this.</p>

<p>I need cancel out the application being loaded from the <code>load()</code> method IF it has been called.</p>

<p>so i pseudo-english it would be something like</p>

<pre><code>public function load (app)
if app is null then load default app
else
load application

public function url
if load has been called
then clear out application

load application
</code></pre>
