diff --git a/api/src/Etemplate.php b/api/src/Etemplate.php index 0a955913cc..c365fc4397 100644 --- a/api/src/Etemplate.php +++ b/api/src/Etemplate.php @@ -616,7 +616,7 @@ class Etemplate extends Etemplate\Widget\Template /** * disables all cells with name == $name * - * @param sting $name cell-name + * @param string $name cell-name * @param boolean $disabled =true disable or enable a cell, default true=disable * @return reference to attribute * @deprecated use disableElement($name, $disabled=true) diff --git a/api/src/autoload.php b/api/src/autoload.php index 58a7040ede..c95bd9efa3 100755 --- a/api/src/autoload.php +++ b/api/src/autoload.php @@ -11,15 +11,14 @@ * @author Ralf Becker * @package api * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License - * @version $Id$ */ -// this is only neccessary, if header.inc.php is not included, but api/src/autoload.php directly +// this is only necessary, if header.inc.php is not included, but api/src/autoload.php directly if (!defined('EGW_SERVER_ROOT')) { define('EGW_SERVER_ROOT', dirname(dirname(__DIR__))); define('EGW_INCLUDE_ROOT', EGW_SERVER_ROOT); - define('EGW_API_INC', EGW_SERVER_ROOT.'/phpgwapi/inc'); + if (file_exists(EGW_SERVER_ROOT.'/phpgwapi/inc')) define('EGW_API_INC', EGW_SERVER_ROOT.'/phpgwapi/inc'); error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); } diff --git a/api/src/loader/deprecated_factory.php b/api/src/loader/deprecated_factory.php index 055c83cc61..14d20d7d35 100755 --- a/api/src/loader/deprecated_factory.php +++ b/api/src/loader/deprecated_factory.php @@ -61,33 +61,8 @@ function CreateObject($class) require_once(EGW_INCLUDE_ROOT.'/'.$appname.'/inc/class.'.$classname.'.inc.php'); } $args = func_get_args(); - switch(count($args)) - { - case 1: - $obj = new $classname; - break; - case 2: - $obj = new $classname($args[1]); - break; - case 3: - $obj = new $classname($args[1],$args[2]); - break; - case 4: - $obj = new $classname($args[1],$args[2],$args[3]); - break; - default: - $code = '$obj = new ' . $classname . '('; - foreach(array_keys($args) as $n) - { - if ($n) - { - $code .= ($n > 1 ? ',' : '') . '$args[' . $n . ']'; - } - } - $code .= ');'; - eval($code); - break; - } + array_shift($args); + $obj = new $classname(...$args); if (!is_object($obj)) { echo "

CreateObject('$class'): Cant instanciate class!!!
\n".function_backtrace(1)."

\n";