Fehlermeldungen

creativeheadz

Erfahrenes Mitglied
Sry das ich so oft hier reinschreibe aber bei dem installieren eines Hostingscripts erscheint ein Fehler nach dem anderen einige habe ich schon selbst gelöst aber einige bekomme ich net gelöst

Hier die Fehler:

Warning: CreateObject(/phpgwapi/inc/class.phpgw.inc.php) [function.CreateObject]: failed to open stream: No such file or directory in C:\apache\xampp\htdocs\phpgroupware\phpgwapi\inc\functions.inc.php on line 43

Warning: CreateObject() [function.include]: Failed opening '/phpgwapi/inc/class.phpgw.inc.php' for inclusion (include_path='.;c:\apache\xampp\php\pear\') in C:\apache\xampp\htdocs\phpgroupware\phpgwapi\inc\functions.inc.php on line 43

Fatal error: Class 'phpgw' not found in C:\apache\xampp\htdocs\phpgroupware\phpgwapi\inc\functions.inc.php(47) : eval()'d code on line 1

Hier der Code von zeile 1 bis 71:

PHP:
<?php

    if (floor(phpversion()) == 3)
    {
		include(PHPGW_API_INC.'/php3_support_functions.inc.php');
    }

	 /****************************************************************************\
	 * Direct functions, which are not part of the API class                      *
	 * because they are require to be availble at the lowest level.               *
	 \****************************************************************************/
	 /*!
	 @function CreateObject
	 @abstract Load a class and include the class file if not done so already.
	 @discussion Author: mdean, milosch (thanks to jengo and ralf)<br>
	 This function is used to create an instance of a class,
	 and if the class file has not been included it will do so. <br>
	 Syntax: CreateObject('app.class', 'constructor_params'); <br>
	 Example1: $phpgw->acl = CreateObject('phpgwapi.acl');
	 @param $classname name of class
	 @param $p1-$p16 class parameters (all optional)
	 */
	function CreateObject($class,
		$p1='_UNDEF_',$p2='_UNDEF_',$p3='_UNDEF_',$p4='_UNDEF_',
		$p5='_UNDEF_',$p6='_UNDEF_',$p7='_UNDEF_',$p8='_UNDEF_',
		$p9='_UNDEF_',$p10='_UNDEF_',$p11='_UNDEF_',$p12='_UNDEF_',
		$p13='_UNDEF_',$p14='_UNDEF_',$p15='_UNDEF_',$p16='_UNDEF_')
	{
		global $phpgw_info, $phpgw;

		if (is_object(@$GLOBALS['phpgw']->log) && $class != 'phpgwapi.error' && $class != 'phpgwapi.errorlog')
		{
			//$GLOBALS['phpgw']->log->write(array('text'=>'D-Debug, dbg: %1','p1'=>'This class was run: '.$class,'file'=>__FILE__,'line'=>__LINE__));
		}

		/* error_reporting(0); */
		list($appname,$classname) = explode(".", $class);

		if (!isset($GLOBALS['phpgw_info']['flags']['included_classes'][$classname]) ||
			!$GLOBALS['phpgw_info']['flags']['included_classes'][$classname])
		{
			$GLOBALS['phpgw_info']['flags']['included_classes'][$classname] = True;
			include("$DOCUMENT_ROOT".'/'.$appname.'/inc/class.'.$classname.'.inc.php');
		}
		if ($p1 == '_UNDEF_' && $p1 != 1)
		{
			eval('$obj = new ' . $classname . ';');
		}
		else
		{
			$input = array($p1,$p2,$p3,$p4,$p5,$p6,$p7,$p8,$p9,$p10,$p11,$p12,$p13,$p14,$p15,$p16);
			$i = 1;
			$code = '$obj = new ' . $classname . '(';
			while (list($x,$test) = each($input))
			{
				if (($test == '_UNDEF_' && $test != 1 ) || $i == 17)
				{
					break;
				}
				else
				{
					$code .= '$p' . $i . ',';
				}
				$i++;
			}
			$code = substr($code,0,-1) . ');';
			eval($code);
		}
		/* error_reporting(E_ERROR | E_WARNING | E_PARSE); */
		return $obj;
	}

creativeheadz
 
Also ein Fehler scheint ja wohl hier zu sein:

PHP:
include("$DOCUMENT_ROOT".'/'.$appname.'/inc/class.'.$classname.'.inc.php');

Wie wärs du probierst erstmal mti is_file ob sie überhaupt existiet und gibst dir mal
per echo o.ä. aus damit du siehst was da überhaupt steht.

Ja und beim eval scheint er die Klasse die in der Fehlermeldung steht nicht zu finden.
Existiert diese denn? (-> http://de.php.net/manual/de/function.class-exists.php)

Noch ein Tip zum COdezusammenbau, ich würde bei jedem if, statt den String von code fortszuseten, hier ein Array nehmen, jedesmal ein Element zusammenfügen und später mit implode(',',$array); zusammensetzen. Kommt aufs gelcieh finde ich aber schöner ;)
 
Zuletzt bearbeitet:
Zurück