That won't work assuming my pull to make the application classes abstract
is accepted.  Likewise, the check would have to be for an instance of
JApplicationBase; both CLI and Web are having their getInstance methods
consolidated in this pull.

On Monday, January 7, 2013, Rouven Weßling wrote:

> In libraries/joomla/application/cli.php:
>
> >  	 */
> >  	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;
> > -			}
> > -		}
> > +		JLog::add(sprintf('%s is deprecated, use JApplicationBase::getInstance() instead.', __METHOD__), JLog::WARNING, 'deprecated');
>
> Sorry, forgot all about this during the holidays. Basically I'd remove the
> static methods from the subclasses and use this code in JApplicationBase
> (untested):
>
> if (empty(self::$instance)){
>     if (class_exists($name) && (is_subclass_of($name, 'JApplicationCli')))
>     {
>         self::$instance = new $name;
>     }
>     else
>     {
>         self::$instance = new JApplicationCli;
>     }}
>
>  —
> Reply to this email directly or view it on GitHub<https://github.com/joomla/joomla-platform/pull/1772/files#r2571754>.
>
>


-- 
- Michael

Please pardon any errors, this message was sent from my iPhone.