示例#1
0
 public static function obj_CFG($class, $valueArr, $throwError = true)
 {
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, "func" => ": setPublicProp");
     $bool = true;
     //----------------------------------------------------------
     if (is_null($valueArr)) {
         $chk['message'] = "valueArr is 'NULL";
         return $class;
     }
     //----------------------------------------------------------
     foreach ($valueArr as $i => $value) {
         if (gettype($class) == "object" and !property_exists($class, $i)) {
             $bool = false;
         } else {
             if (gettype($class) == "array" and empty($class[$i])) {
                 $bool = false;
             }
         }
         //--------------------------------------------------
         $class = SetPublicProp::findObj($class, $i);
         $i = $class['string'];
         $class = $class['class'];
         //--------------------------------------------------
         if (!$bool && $throwError) {
             print_r($class);
             $error = array_merge($chk, array("bool" => 0, "result" => $i . " is not a property object of class above"));
             $error['$valueArr'] = $valueArr;
             print_r($error);
             trigger_error($i . " is not a property in '" . get_class($class) . "'", E_USER_ERROR);
         }
         //--------------------------------------------------
         if ($bool && gettype($class) == "object") {
             //$valueArr[$i] = GenFun::constCHK($valueArr[$i]);
             $class->{$i} = $valueArr[$i];
         } else {
             if (gettype($class) == "array") {
                 //$valueArr[$i] = GenFun::constCHK($valueArr[$i]);
                 $class[$i] = $valueArr[$i];
             }
         }
     }
     //----------------------------------------------------------
     if ($chk['bool']) {
         $chk = $class;
     }
     //----------------------------------------------------------
     return $chk;
 }
示例#2
0
require_once Import::$uber_src_path . $classPath;
//----------------------------------------------------------
if (isset($_OBJ['staticClass'])) {
    if ($_OBJ['staticClass'] == "true") {
        Constants::$conn = GenFun::hostConnect("{DATABASE}");
    }
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//init
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------
$object = !isset($_OBJ['staticClass']) ? newClass($class) : $class;
//----------------------------------------------------------
$object = SetPublicProp::findObj($object, $_OBJ['functionName']);
//----------------------------------------------------------
$orig_functionName = $_OBJ['functionName'];
//----------------------------------------------------------
$_OBJ['functionName'] = $object['string'];
$object = $object['class'];
//----------------------------------------------------------
if (isset($_OBJ['prop'])) {
    SetPublicProp::go($object, $_OBJ['prop']);
}
//----------------------------------------------------------
if (!isset($_OBJ['params'])) {
    $_OBJ['params'] = array();
}
//----------------------------------------------------------
if (!method_exists($object, $_OBJ['functionName'])) {
示例#3
0
$class = end($class);
//----------------------------------------------------------
require_once $classPath;
//----------------------------------------------------------
if (isset($_REQUEST['staticClass']) && $_REQUEST['staticClass'] == "true" && is_null(GlobalMas::$conn)) {
    GenFun::hostConnect();
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//init
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------
$object = !isset($_REQUEST['staticClass']) ? ClassUtil::classFromString($class) : $class;
//----------------------------------------------------------
$object = SetPublicProp::findObj($object, $_REQUEST['functionName']);
//----------------------------------------------------------
$orig_functionName = $_REQUEST['functionName'];
//----------------------------------------------------------
$_REQUEST['functionName'] = $object['string'];
//----------------------------------------------------------
$object = $object['class'];
//----------------------------------------------------------
//if (!file_exists($classPath) && is_null($object)) die($classPath." does not exist!!!!");
//----------------------------------------------------------
if (isset($_REQUEST['prop'])) {
    SetPublicProp::go($object, $_REQUEST['prop']);
}
//----------------------------------------------------------
if (GlobalMas::$loginCHK && isset($_COOKIE[Account_v0::getPrefix() . "user"])) {
    $loggedIN = Account_v0::getUserSession();