Applications are now singletons
authorAlexander Ebert <ebert@woltlab.com>
Mon, 16 Jul 2012 22:20:19 +0000 (00:20 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 16 Jul 2012 22:20:19 +0000 (00:20 +0200)
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/application/AbstractApplication.class.php

index b4ed98392d8bf3d9c4a991af1dedfb98f121e292..256d16b9493bbba1893e366abe0fd85ec3340c3f 100644 (file)
@@ -434,7 +434,7 @@ class WCF {
                        
                        // start application if not within ACP
                        if (!class_exists('wcf\system\WCFACP', false)) {
-                               new $className();
+                               call_user_func(array($className, 'getInstance'));
                        }
                }
                else {
index c7a21eb7e3dcdd3615760bb4e07df4a9759213f3..dcb0e45ef5e9e62902937babff2a3c0656769758 100644 (file)
@@ -1,17 +1,18 @@
 <?php
 namespace wcf\system\application;
+use wcf\system\SingletonFactory;
 
 /**
- * Default implementation for all applications for the community framework.
+ * Default implementation for all applications for community framework.
  * 
  * @author     Alexander Ebert
- * @copyright  2001-2011 WoltLab GmbH
+ * @copyright  2001-2012 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @package    com.woltlab.wcf
  * @subpackage system.application
  * @category   Community Framework
  */
-abstract class AbstractApplication implements IApplication {
+abstract class AbstractApplication extends SingletonFactory implements IApplication {
        /**
         * @see wcf\system\application\IApplication::__callStatic()
         */