Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Settings {
- static public function instance () {
- static $resource = null;
- if(is_null($resource))
- $resource = new Settings();
- return $resource;
- }
- public $location = 'http://unknown/';
- final private function __construct () {}
- }
- // one file
- $settings = Settings::instance();
- $settings->location = 'http://www.e-mark.nl/';
- // other file
- $settings = Settings::instance();
- echo $settings->location; // 'http://www.e-mark.nl/'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement