/** * static method that returns a single instance of this class. * * @static * @param path If the object is being created for the first time, this will be passed to the constructor * of the class as the first parameter. If a class instance already exists, this path will be added to the * list of already existing paths to scan. * @return a ResourceClassLoader object */ function &getLoader($path = null) { static $instance; if ($instance == null) { // create an instance if it does not exist yet... $instance = new ResourceClassLoader(); } // if a path is given and the object already exists, then // we can also automatically add it to the list of searched folders... if ($path != null) { $instance->addSearchFolder($path); } return $instance; }