PHP code to be executed only once
<p>I have a php code I want to execute only once, that is it it should get loaded when it is getting installed for the first time, and the second time it should not execute. I tried with <code>for</code> and <code>if</code> condition but it didn't work for me.</p>

<p>This is my code: </p>

<pre><code>$table = self::checkTablesExist();

    if(empty($table)) { 
    self::createTables();

    self::createRootUser(self::$preflight_config);
        if(self::$preflight_config-&gt;sample_data == 1) { 
            self::installSampleData();
        }
    }
</code></pre>
