A simpler singleton
<p>All the singleton patterns I have seen use a reference to the object to determine if the object has been instantiated. However, if I am using a singleton to guarantee only one db connection, why not use the db connection resource link to do this?  Here is the code I am using. (PS: it works fine).  I use the comment to be able to search for my classes easily. </p>

<pre><code>/*one*/

class one
  {
  public static $db;
  private function __construct()
    {
    self::$db=new mysqli(DB_HOST, DB_USER, DB_PASS, DB_DATABASE);
    }
  public static function get()
    {
    if(self::$db==NULL)
      {
      new self();
      }
    return self::$db;
    }
  }
</code></pre>
