title: Is it right to set a config PHP class to keep project settings?
body: <p>I want to create a config.php file to keep the various configuration values that usually being changed from project to project, and I want to define a class to keep the config values in this file like the following:</p>
  
  <pre><code>class Config {
      const DB_SERVER    = 'localhost',
            DB_NAME      = 'abc',
            DB_USERNAME  = 'admin',
            DB_PASSWORD  = '12345',
  
            WEBSITE_NAME = 'My New Website',
            IMAGE_DIR    = 'img';
  }
  </code></pre>
  
  <p>and so on, I want to define all values as constants inside the class, and I will call them like the following:</p>
  
  <pre><code>$connection = mysql_connect(Config::DB_SERVER, Config::DB_USERNAME, Config::DB_PASSWORD) or die("Database connection failed..");
  </code></pre>
  
  <p>I want to know: Is this way of setting the project configuration is right? Does this way have any cons? And if it was wrong, then what the best way to do this?</p>