Commits

Laurent Jouanneau committed 779f315

renamed jApplication to jApp

  • Participants
  • Parent commits 2f85b5e

Comments (0)

Files changed (19)

File build/manifests/jelix-deprecated.mn

 
 cd lib/jelix/core
   jInstallChecker.class.php
+  jApplication.class.php
 
 cd lib/jelix/core-modules/jelix/install/sql
   install_jacl.datas.mysql.sql

File build/manifests/jelix-no-opt.mn

   jIAuthDriver.iface.php
 
 cd lib/jelix/core
-* jApplication.class.php
+* jApp.class.php
   jBundle.class.php
 * jConfig.class.php
   jContext.class.php

File lib/jelix/acl/jAcl.class.php

             if ($db == '')
                 throw new jException('jelix~errors.acl.driver.notfound',$db);
 
-            $driver = jApplication::loadPlugin($db, 'acl', '.acl.php', $gJConfig->acl['driver'].'AclDriver', $gJConfig->acl);
+            $driver = jApp::loadPlugin($db, 'acl', '.acl.php', $gJConfig->acl['driver'].'AclDriver', $gJConfig->acl);
             if (is_null($driver)) {
                 throw new jException('jelix~errors.acl.driver.notfound',$db);
             }

File lib/jelix/acl/jAcl2.class.php

             if ($db == '')
                 throw new jException('jelix~errors.acl.driver.notfound',$db);
 
-            $driver = jApplication::loadPlugin($db, 'acl2', '.acl2.php', $gJConfig->acl2['driver'].'Acl2Driver', $gJConfig->acl2);
+            $driver = jApp::loadPlugin($db, 'acl2', '.acl2.php', $gJConfig->acl2['driver'].'Acl2Driver', $gJConfig->acl2);
             if (is_null($driver)) {
                 throw new jException('jelix~errors.acl.driver.notfound',$db);
             }

File lib/jelix/auth/jAuth.class.php

         if($driver == null){
             $config = self::_getConfig();
             $db = strtolower($config['driver']);
-            $driver = jApplication::loadPlugin($db, 'auth', '.auth.php', $config['driver'].'AuthDriver', $config[$config['driver']]);
+            $driver = jApp::loadPlugin($db, 'auth', '.auth.php', $config['driver'].'AuthDriver', $config[$config['driver']]);
             if(is_null($driver))
                 throw new jException('jelix~auth.error.driver.notfound',$db);
         }

File lib/jelix/core/jApp.class.php

+<?php
+/**
+* @package    jelix
+* @subpackage core
+* @author     Laurent Jouanneau
+* @copyright  2011 Laurent Jouanneau
+* @link       http://jelix.org
+* @licence    http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file
+*/
+
+/**
+* 
+* @package    jelix
+* @subpackage utils
+*/
+class jApp {
+
+    /**
+     * load a plugin from a plugin directory (any type of plugins)
+     * @param string $name the name of the plugin
+     * @param string $type the type of the plugin
+     * @param string $suffix the suffix of the filename
+     * @param string $classname the name of the class to instancy
+     * @param mixed $args  the argument for the constructor of the class. null = no argument.
+     * @return null|object  null if the plugin doesn't exists
+     */
+    public static function loadPlugin($name, $type, $suffix, $classname, $args = null) {
+
+        if (!class_exists($classname,false)) {
+            global $gJConfig;
+            $optname = '_pluginsPathList_'.$type;
+            if (!isset($gJConfig->$optname))
+                return null;
+            $opt = & $gJConfig->$optname;
+#ifnot ENABLE_OPTIMIZED_SOURCE
+            if (!isset($opt[$name])
+                || !file_exists($opt[$name]) ){
+                return null;
+            }
+#endif
+            require_once($opt[$name].$name.$suffix);
+        }
+        if (!is_null($args))
+            return new $classname($args);
+        else
+            return new $classname();
+    }
+}

File lib/jelix/core/jApplication.class.php

-<?php
-/**
-* @package    jelix
-* @subpackage core
-* @author     Laurent Jouanneau
-* @copyright  2011 Laurent Jouanneau
-* @link       http://jelix.org
-* @licence    http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file
-*/
-
-/**
-* 
-* @package    jelix
-* @subpackage utils
-*/
-class jApplication {
-
-    /**
-     * load a plugin from a plugin directory (any type of plugins)
-     * @param string $name the name of the plugin
-     * @param string $type the type of the plugin
-     * @param string $suffix the suffix of the filename
-     * @param string $classname the name of the class to instancy
-     * @param mixed $args  the argument for the constructor of the class. null = no argument.
-     * @return null|object  null if the plugin doesn't exists
-     */
-    public static function loadPlugin($name, $type, $suffix, $classname, $args = null) {
-
-        if (!class_exists($classname,false)) {
-            global $gJConfig;
-            $optname = '_pluginsPathList_'.$type;
-            if (!isset($gJConfig->$optname))
-                return null;
-            $opt = & $gJConfig->$optname;
-#ifnot ENABLE_OPTIMIZED_SOURCE
-            if (!isset($opt[$name])
-                || !file_exists($opt[$name]) ){
-                return null;
-            }
-#endif
-            require_once($opt[$name].$name.$suffix);
-        }
-        if (!is_null($args))
-            return new $classname($args);
-        else
-            return new $classname();
-    }
-}

File lib/jelix/core/jLog.class.php

                     self::$loggers[$loggername] = new jMailLogger();
                 }
                 else {
-                    $l = jApplication::loadPlugin($loggername, 'logger', '.logger.php', $loggername.'Logger');
+                    $l = jApp::loadPlugin($loggername, 'logger', '.logger.php', $loggername.'Logger');
                     if (is_null($l))
                         continue; // yes, silent, because we could be inside an error handler
                     self::$loggers[$loggername] = $l;

File lib/jelix/core/jUrl.class.php

         if($engine === null || $reset){
             global $gJConfig;
             $name = $gJConfig->urlengine['engine'];
-            $engine = jApplication::loadPlugin($name, 'urls', '.urls.php', $name.'UrlEngine');
+            $engine = jApp::loadPlugin($name, 'urls', '.urls.php', $name.'UrlEngine');
             if(is_null($engine))
                 throw new jException('jelix~errors.urls.engine.notfound', $name);
         }

File lib/jelix/core/response/jResponseBasicHtml.class.php

             foreach ($plugins as $name) {
                 if (!$name)
                     continue;
-                $plugin = jApplication::loadPlugin($name, 'htmlresponse', '.htmlresponse.php', $name.'HTMLResponsePlugin', $this);
+                $plugin = jApp::loadPlugin($name, 'htmlresponse', '.htmlresponse.php', $name.'HTMLResponsePlugin', $this);
                 if ($plugin)
                     $this->plugins[$name] = $plugin;
                 // do nothing if the plugin does not exist, we could be already into the error handle

File lib/jelix/dao/jDaoCompiler.class.php

         }
 
         global $gJConfig;
-        $tools = jApplication::loadPlugin($selector->driver, 'db', '.dbtools.php', $selector->driver.'DbTools');
+        $tools = jApp::loadPlugin($selector->driver, 'db', '.dbtools.php', $selector->driver.'DbTools');
         if(is_null($tools))
             throw new jException('jelix~db.error.driver.notfound', $selector->driver);
 

File lib/jelix/db/jDb.class.php

             return $dbh;
         }
         else {
-            $dbh = jApplication::loadPlugin($profile['driver'], 'db', '.dbconnection.php', $profile['driver'].'DbConnection', $profile);
+            $dbh = jApp::loadPlugin($profile['driver'], 'db', '.dbconnection.php', $profile['driver'].'DbConnection', $profile);
             if (is_null($dbh))
                 throw new jException('jelix~db.error.driver.notfound', $profile['driver']);
             return $dbh;

File lib/jelix/db/jDbPDOConnection.class.php

      */
     public function tools () {
         if (!$this->_tools) {
-            $this->_tools = jApplication::loadPlugin($this->dbms, 'db', '.dbtools.php', $this->dbms.'DbTools', $this);
+            $this->_tools = jApp::loadPlugin($this->dbms, 'db', '.dbtools.php', $this->dbms.'DbTools', $this);
             if (is_null($this->_tools))
                 throw new jException('jelix~db.error.driver.notfound', $this->dbms);
         }

File lib/jelix/forms/jFormsBase.class.php

             return $this->builders[$buildertype];
 
         include_once(JELIX_LIB_PATH.'forms/jFormsBuilderBase.class.php');
-        $o = jApplication::loadPlugin($buildertype, 'jforms', '.jformsbuilder.php', $buildertype.'JformsBuilder', $this);
+        $o = jApp::loadPlugin($buildertype, 'jforms', '.jformsbuilder.php', $buildertype.'JformsBuilder', $this);
         if ($o) {
             $this->builders[$buildertype] = $o;
             return $o;

File lib/jelix/init.php

 error_reporting (E_ALL | E_STRICT);
 
 #if ENABLE_OPTIMIZED_SOURCE
-#includephp core/jApplication.class.php
+#includephp core/jApp.class.php
 #ifnot ENABLE_PHP_JELIX
 #includephp core/jICoordPlugin.iface.php
 #includephp core/jISelector.iface.php
 #includephp core/jSession.class.php
 
 #else
-require (JELIX_LIB_CORE_PATH . 'jApplication.class.php');
+require (JELIX_LIB_CORE_PATH . 'jApp.class.php');
 #ifnot ENABLE_PHP_JELIX
 require (JELIX_LIB_CORE_PATH . 'jICoordPlugin.iface.php');
 require (JELIX_LIB_CORE_PATH . 'jISelector.iface.php');

File lib/jelix/kvdb/jKVDb.class.php

                 'jelix~kvstore.error.driver.notset', $profile['name']);
         }
 
-        $connector = jApplication::loadPlugin($profile['driver'], 'kvdb', '.kvdriver.php', $profile['driver'] . 'KVDriver', $profile);
+        $connector = jApp::loadPlugin($profile['driver'], 'kvdb', '.kvdriver.php', $profile['driver'] . 'KVDriver', $profile);
         //if (is_null($connector)) {
         //    throw new jException('jelix~errors.kvdb.driver.notfound',$profile['driver']);
         //}

File lib/jelix/plugins/htmlresponse/debugbar/debugbar.htmlresponse.php

         if ($plugins) {
             $plugins = preg_split('/ *, */', $plugins);
             foreach ($plugins as $name) {
-                $plugin = jApplication::loadPlugin($name, 'debugbar', '.debugbar.php', $name.'DebugbarPlugin', $this);
+                $plugin = jApp::loadPlugin($name, 'debugbar', '.debugbar.php', $name.'DebugbarPlugin', $this);
                 if ($plugin) {
                     $this->plugins[$name] = $plugin;
                 }

File lib/jelix/utils/jCache.class.php

         $params = self::_getProfile($profile);
         $params['profile'] = $profile;
 
-        $drv = jApplication::loadPlugin($params['driver'], 'cache', '.cache.php', $params['driver'].'CacheDriver', $params);
+        $drv = jApp::loadPlugin($params['driver'], 'cache', '.cache.php', $params['driver'].'CacheDriver', $params);
         if (is_null($drv))
             throw new jException('jelix~cache.error.driver.missing',array($profile,$params['driver']));
 

File lib/jelix/utils/jWiki.class.php

                 require_once($f);
                 $this->config= new $config();
             }else{
-                $this->config = jApplication::loadPlugin($config, 'wr_rules', '.rule.php', $config);
+                $this->config = jApp::loadPlugin($config, 'wr_rules', '.rule.php', $config);
                 if (is_null($this->config))
                     throw new Exception('Rules "'.$config.'" not found for jWiki');
             }