예제 #1
0
파일: web.php 프로젝트: Rai-Ka/joomla-cms
 /**
  * Returns a reference to the global JApplicationWeb object, only creating it if it doesn't already exist.
  *
  * This method must be invoked as: $web = JApplicationWeb::getInstance();
  *
  * @param   string  $name  The name (optional) of the JApplicationWeb class to instantiate.
  *
  * @return  JApplicationWeb
  *
  * @since   11.3
  */
 public static function getInstance($name = null)
 {
     // Only create the object if it doesn't exist.
     if (empty(self::$instance)) {
         if (class_exists($name) && is_subclass_of($name, 'JApplicationWeb')) {
             self::$instance = new $name();
         } else {
             self::$instance = new JApplicationWeb();
         }
     }
     return self::$instance;
 }