Beispiel #1
0
 /**
  * Returns a reference to the global JApplicationCli object, only creating it if it doesn't already exist.
  *
  * This method must be invoked as: $cli = JApplicationCli::getInstance();
  *
  * @param   string  $name  The name (optional) of the JApplicationCli class to instantiate.
  *
  * @return  JApplicationCli
  *
  * @since   11.1
  */
 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, 'JApplicationCli')) {
             self::$instance = new $name();
         } else {
             self::$instance = new JApplicationCli();
         }
     }
     return self::$instance;
 }