title: How to include some variables inside static class?
body: <p>I have a sql.php config file:</p>
  
  <pre><code>$GLOBALS["hostname_con1"] = 'localhost';
  $GLOBALS["database_con1"] = 'mydatabase';
  $GLOBALS["username_con1"] = 'root';
  $GLOBALS["password_con1"] = '';
  </code></pre>
  
  <p>and I have a Config.php file</p>
  
  <pre><code>class Config{   
  
      public static $dbname = ''; // Your database name
      public static $dbuser = ''; // Your database username
      public static $dbpass = ''; // // Your database password
      public static $dbhost = ''; // Your database host, 'localhost' is default.
  ... many other variables...
  
  }
  </code></pre>
  
  <p>This class.config is ONLY filled with static variables.</p>
  
  <p>My Goal is to use the sql.php inside the Config.php to avoid redeclare twice.</p>
  
  <p>I tried: </p>
  
  <p>1) "include": gives an error !</p>
  
  <p>2) public static $dbname = $GLOBALS["hostname_con1"]; error</p>
  
  <p>3) I tried a constructor: but constructor is never called since Config.php is never instantiated.</p>
  
  <p>What is the solution to use sql.php inside Config.php ?</p>