Example #1
0
 function __construct($queryString, $insertObj, $obj = NULL)
 {
     $this->queryString = $queryString;
     $this->insertObj = $insertObj;
     SetPublicProp::go($this, $obj);
     $this->start();
 }
Example #2
0
 function __construct($obj)
 {
     SetPublicProp::go($this, $obj);
     $this->path = Compiler::$root . $this->id . "/";
     if ($this->insideCURL) {
         $this->complete();
     } else {
         if (!$this->raw) {
             $this->getCode($value, $this->minify);
             //$this->singleFile_CFG();
             //$this->seperate_CFG();
             if (isset($this->compiler)) {
                 $this->content = $this->compiler->getFiles($this->content, NULL, "link", isset($this->images["path"]) ? $this->images["path"] : NULL);
             }
             if (isset($this->images) && !$this->raw) {
                 $this->getImages_CFG();
             }
         }
         $this->copy_CFG();
     }
     //$this->compiler->getFiles($this->content, "");
     $this->content = $this->markUp_CHK($this->content);
     if (is_array($this->outputContent)) {
         FileFolder::file_put_contents($this->path . $this->outputContent['saveas'], $this->content);
     }
     //GenFun::setCookie("compile_root", true, Compiler::$root);
 }
Example #3
0
 function __construct($tableID, $setArr, $obj = NULL)
 {
     GenFun::hostConnect();
     $this->tableID = $tableID;
     $this->setArr = $setArr;
     SetPublicProp::go($this, $obj);
 }
Example #4
0
 function __construct($queryString, $obj = NULL)
 {
     GenFun::hostConnect();
     $this->queryString = $queryString;
     SetPublicProp::go($this, $obj);
     $this->queryString_CFG();
 }
Example #5
0
 function __construct($obj = NULL)
 {
     SetPublicProp::go($this, $obj);
     if (isset($_FILES) && sizeof($_FILES) > 0) {
         $this->uploadClass = new UploadHandler(false);
     }
 }
Example #6
0
 function __construct($tableID, $setArr, $whereArr = NULL, $obj = NULL)
 {
     $this->tableID = $tableID;
     $this->setArr = $setArr;
     $this->whereArr = $whereArr;
     SetPublicProp::go($this, $obj);
 }
Example #7
0
 public function getFiles()
 {
     $src_content = $this->src_content_markup = Compiler::markUp_CHK($this->src_content, array("ignore" => true));
     $src_content = $src_content;
     $src_content = StringUtil::removeAllHtmlComments($src_content);
     //---------------------------------------------------------
     if (!is_null($this->str_replace_silent)) {
         foreach ($this->str_replace_silent as $key => $value) {
             $this->src_content_silent = $src_content = str_replace($key, $value, $this->src_content);
         }
     }
     //---------------------------------------------------------
     preg_match_all('/(?:[\'\\"]|url\\()([\\-A-Za-z\\/_\\d\\.]+\\.(woff|ttf|mp4|jpg|jpeg|png|gif))/s', $src_content, $files, PREG_SET_ORDER);
     //---------------------------------------------------------
     $this->matches = $files;
     //---------------------------------------------------------
     foreach ($files as $file_key => $filePath) {
         $arr = array("compilerGlobal" => $this->compilerGlobal, "filePath" => $filePath[1], "forceDownload" => $this->forceDownload, "src_dir" => $this->src_dir, "save_dir" => $this->save_dir, "src_content" => is_null($this->src_content_updated) ? $this->src_content : $this->src_content_updated, "src_content_type" => $this->src_content_type, "relativeToSrc" => $this->relativeToSrc, "src_save_dir" => $this->src_save_dir, "base64" => $this->base64, "compilePath" => $this->compilePath);
         //---------------------------------------------------------
         $arr = SetPublicProp::go($arr, $this->fileProp, false);
         //---------------------------------------------------------
         $newFile = new Compile_File($arr);
         $this->src_content_updated = $newFile->src_content_updated;
         $this->images_info[] = $newFile;
     }
     //---------------------------------------------------------
     if (is_null($this->src_content_updated)) {
         $this->src_content_updated = $this->src_content;
     }
 }
Example #8
0
 function __construct($img, $obj = NULL)
 {
     $this->img = $img;
     SetPublicProp::go($this, $obj);
     if (is_null($this->dir)) {
         $this->dir = $_SERVER['DOCUMENT_ROOT'] . "/" . $this->projectPath;
     }
     $this->fullURL = GenFun::get_full_url($this->dir);
 }
Example #9
0
 public static function arrayToParams($obj, $params, $func)
 {
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $obj = GenFun::varChkAll($obj);
     //----------------------------------------------------------
     $params = SetPublicProp::go($params, $obj, false);
     //----------------------------------------------------------
     return call_user_func_array($func, $params);
 }
Example #10
0
 function __construct($obj)
 {
     SetPublicProp::go($this, $obj);
     //$this->output_updated = Compiler::markUp_CHK($this->output, array("ignore" => true));
     if (is_null($this->output) && !is_null($this->srcPath)) {
         $this->output = file_get_contents($this->src_path);
     }
     $this->output_updated = $this->output;
     if (!is_null($this->output)) {
         $this->scrape_CFG();
     }
 }
Example #11
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;
 }
Example #12
0
 function __construct($obj)
 {
     $this->compilers = array();
     //------------------------------------------------------------
     SetPublicProp::go($this, $obj);
     //------------------------------------------------------------
     $this->compilerGlobal = new Compiler_Global();
     //------------------------------------------------------------
     //$this->compilePath = array();
     //------------------------------------------------------------
     $this->compile_id = Compiler::getCompile_id();
     //------------------------------------------------------------
     //if (is_null($this->compilePath)) $this->compilePath = dirname(Import::getImportPath())."/".$this->compile_id."/";
     if (is_null($this->compilePath)) {
         $this->compilePath = GlobalMas::$filesPath_absolute . "compiler/" . FileFolder::getLastDir($_SERVER["SCRIPT_FILENAME"]) . $this->compile_id . "/";
     }
     //-----------------------------------------------------
     if (isset($_GET['pageID']) && isset($_COOKIE['compile_curl'])) {
         GenFun::setCookie("compile_curl", false);
     }
     //-----------------------------------------------------
     $this->compilerGlobal->compilePath = $this->compilePath;
     //-----------------------------------------------------
     $this->refresh();
     if (is_null($this->url)) {
         $this->url = GenFun::get_full_url($_SERVER["SCRIPT_NAME"]);
     }
     //-----------------------------------------------------
     $this->compilerGlobal->url = $this->url;
     //-----------------------------------------------------
     if (isset($_GET['compile']) && $_GET['compile'] == "1" && !isset($_COOKIE['compile_curl'])) {
         Compiler::$disabled = false;
         GenFun::setCookie("compile", true, 1);
         $this->start();
         //die();
     } else {
         if (!isset($_GET['refresh'])) {
             register_shutdown_function("Compiler::callRegisteredShutdown");
         }
     }
 }
Example #13
0
 function __construct($obj)
 {
     SetPublicProp::go($this, $obj);
     $this->file_absolute = !$this->wUber ? Import::getImportPath() . $this->concat . $this->file : Import::$uber_src_path . $this->concat . $this->file;
     $this->file_web = GenFun::get_full_url($this->file_absolute);
 }
Example #14
0
 private function chk($obj, $params, $func)
 {
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $obj = GenFun::varChkAll($obj);
     //----------------------------------------------------------
     $params = SetPublicProp::go($params, $obj, false);
     //----------------------------------------------------------
     return call_user_func_array(array($this, $func), $params);
 }
Example #15
0
 function __construct($queryString, $obj = NULL)
 {
     $this->queryString = $queryString;
     SetPublicProp::go($this, $obj);
     $this->queryString_CFG();
 }
Example #16
0
 public function __construct($obj)
 {
     SetPublicProp::go($this, $obj);
 }
Example #17
0
 public function __construct($obj)
 {
     $this->code = $obj['code'];
     unset($obj["code"]);
     SetPublicProp::go($this, $obj);
 }
Example #18
0
 public function parse_match_post()
 {
     //-----------------------------------------------------
     if (!empty($this->match[1]) || $this->match[1] != "") {
         $this->src_path_markup = $this->match[1];
         $this->src_path = $this->match[2];
         /*if (is_null($this->link_compile_file)) {
         			krumo($this->save_path);
         			$this->save_path_relative = Compiler::cleanURL($this->src_path, "");
         			$this->save_path = $this->compilePath.$this->save_path_relative;
         			krumo($this->save_path);
         		}*/
     }
     //-----------------------------------------------------
     if (is_null($this->save_path)) {
         if (!is_null($this->content)) {
             if (!file_exists($this->src_path) && !CurlUtil::is_url_exist($this->src_path)) {
                 $this->markup_CFG();
                 $this->inline = true;
                 $this->save_path_relative = $this->savePath_CFG() . "inline_" . $this->index . "." . $this->saveas_ext;
                 $this->save_path = $this->compilePath . $this->save_path_relative;
             } else {
                 $path = is_null($this->save_dir) ? Compiler::cleanURL(FileFolder::getFileName($this->src_path, true, true)) : $this->save_dir . FileFolder::getFileName($this->src_path, true);
                 $path = $this->removeModified($path);
                 $this->save_path_relative = $path . "." . $this->saveas_ext;
                 $this->save_path = $this->compilePath . $this->save_path_relative;
                 //krumo(basename($this->save_path));
             }
         }
     }
     //-----------------------------------------------------
     /*if (!is_null($this->replacePath) && !is_null($this->save_path)) {
     			foreach ($this->replacePath as $key => $value) {
     				$this->save_path_relative = str_replace($key, $value, $this->save_path_relative);
     				$this->save_path = str_replace($key, $value, $this->save_path);
     			}
     		}*/
     //-----------------------------------------------------
     /*if (!is_null($this->str_replace_silent)) {
     			foreach ($this->str_replace_silent as $key => $value) {
     				$txt = str_replace($key, $value, $txt);
     			}
     		}*/
     //-----------------------------------------------------
     //if ($this->compileType == "seperate") {
     //}
     //-----------------------------------------------------
     if (!is_null($this->content)) {
         $prop = array("src_content" => $this->content, "compilerGlobal" => $this->compilerGlobal, "forceDownload" => $this->forceDownload, "src_content_type" => $this->codeType, "src_dir" => !is_null($this->src_path) ? dirname($this->src_path) . "/" : $this->src_path, "src_save_dir" => !is_null($this->save_path_relative) ? dirname($this->save_path_relative) . "/" : $this->save_path_relative, "compilePath" => $this->compilePath);
         //krumo($this->content);
         //---------------------------------------------
         $this->images = new Compile_Images($prop);
         //---------------------------------------------
         SetPublicProp::go($this->images, $this->imagesProp);
         //---------------------------------------------
         SetPublicProp::go($this->images, $this->filesObj, false);
         //---------------------------------------------
         $this->images->init();
         $this->content_updated = $this->images->src_content_updated;
         if ($this->removeInline && !is_null($this->output_updated)) {
             $replaceWith = $this->onRemoveMatch_CHK("code");
             $this->output_updated = str_replace($this->match[0], $replaceWith, $this->output_updated);
         }
     }
     //-----------------------------------------------------
 }
Example #19
0
 function __construct($message, $obj = NULL)
 {
     $this->message = $message;
     SetPublicProp::go($this, $obj);
 }
Example #20
0
///////////////////////////////////////////////////////////////////////////////
//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'])) {
    $chk['bool'] = false;
    $chk['message'] = $orig_functionName . " does not exist in " . $_OBJ['service'];
}
//----------------------------------------------------------
$chk = $chk["bool"] ? call_service($object, $_OBJ['functionName'], $_OBJ['params']) : $chk;
//----------------------------------------------------------
if (!isset($_OBJ['returnType'])) {
    $_OBJ['returnType'] = "json";
Example #21
0
///////////////////////////////////////////////////////////////////////////////
//----------------------------------------------------------
$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();
    if (!$loggedIN['bool']) {
        GlobalMas::$loggedIN = NULL;
    }
}
//-----------------------------------------------------------------------------
if (!isset($_REQUEST['params'])) {
    $_REQUEST['params'] = array();
}
//----------------------------------------------------------
if (!method_exists($object, $_REQUEST['functionName'])) {
    $chk['bool'] = false;
Example #22
0
 public function send($emailObj)
 {
     Trace::output($this->traceID, "send", func_get_args());
     //----------------------------------------------------------
     //init var
     //----------------------------------------------------------
     $chk = array("bool" => true, "func" => $this->traceID . ": send_email");
     //----------------------------------------------------------
     if (gettype($emailObj) == "object") {
         $emailObj = (array) $emailObj;
     }
     //----------------------------------------------------------
     $chk = SetPublicProp::go($this, $emailObj);
     //----------------------------------------------------------
     if ($this->emailTo == NULL) {
         $chk['bool'] = false;
         $chk['message'] = "property 'emailTo' must be given a value";
     }
     //----------------------------------------------------------
     $chk = $this->emailFrom != NULL ? ValidateEmail::go($this->emailFrom) : $chk;
     //----------------------------------------------------------
     $chk = $chk["bool"] ? $this->_send() : $chk;
     //----------------------------------------------------------
     $chk['output'] = Trace::$output;
     //----------------------------------------------------------
     return $this->chk = $chk;
 }
Example #23
0
 function __construct($obj = NULL)
 {
     SetPublicProp::go($this, $obj);
     $this->colorRGB = ColorUtil::hex2rgb($this->colorHex, $this->opacity);
     $this->colorRGB = "rgba(" . implode(",", $this->colorRGB) . ")";
 }
Example #24
0
 private function fileTypeProp_CFG()
 {
     //krumo($this->fileTypeProp);
     $ext = $this->ext == "jpg" ? "jpeg" : $this->ext;
     foreach ($this->fileTypeProp as $key => $value) {
         if ($key == $ext) {
             SetPublicProp::go($this, $value);
         }
     }
 }
Example #25
0
 function __construct($obj)
 {
     //-----------------------------------------------------
     SetPublicProp::go($this, $obj);
     //-----------------------------------------------------
     $this->compilePath = $this->compilerGlobal->compilePath . $this->save_path;
     $this->compilerGlobal->compileType = $this->compileType;
     //-----------------------------------------------------
     if ($this->insideCURL) {
         $this->complete();
     } else {
         if (!$this->raw) {
             $prop = array("output" => $this->output, "minify" => $this->minify, "forceDownload" => $this->forceDownload, "compilerGlobal" => $this->compilerGlobal, "imagesProp" => $this->imagesProp, "compilePath" => $this->compilePath, "compileType" => $this->compileType);
             //---------------------------------------------
             $this->css = new Compile_CSS(ArrayUtil::array_replace_recursive($prop, $this->cssProp));
             $this->output_updated = $this->css->output_updated;
             //---------------------------------------------
             $prop['output'] = $this->output_updated;
             $this->js = new Compile_JS(ArrayUtil::array_replace_recursive($prop, $this->jsProp));
             $this->output_updated = $this->js->output_updated;
             //---------------------------------------------
             $prop['output'] = $this->output_updated;
             $this->tmpl = new Compile_TMPL(ArrayUtil::array_replace_recursive($prop, $this->tmplProp));
             $this->output_updated = $this->tmpl->output_updated;
             //-----------------------------------------------------
             $prop = array("src_content" => $this->output_updated, "forceDownload" => $this->forceDownload, "compilerGlobal" => $this->compilerGlobal, "compilePath" => $this->compilePath);
             $this->output_images = new Compile_Images($prop);
             $this->output_images->init($this->imagesProp);
             $this->output_updated = $this->output_images->src_content_updated;
             //---------------------------------------------
             $this->css->output_updated = $this->output_updated;
             $this->css->compile();
             $this->output_updated = $this->css->output_updated;
             //---------------------------------------------
             $this->js->output_updated = $this->output_updated;
             $this->js->compile();
             $this->output_updated = $this->js->output_updated;
             //---------------------------------------------
             $this->tmpl->output_updated = $this->output_updated;
             $this->tmpl->compile();
             $this->output_updated = $this->tmpl->output_updated;
             //---------------------------------------------
         }
         $this->copy_CFG();
     }
     //$this->compiler->getFiles($this->output, "");
     //-----------------------------------------------------
     $this->output_updated = Compiler::markUp_CHK($this->output_updated);
     //-----------------------------------------------------
     //if ($this->compileType == "inject") $this->output_updated = str_replace("<head>","<head>".PHP_EOL.$this->mergedCode.PHP_EOL, $this->output_updated);
     //-----------------------------------------------------
     /*if ($this->compileType != "inject")*/
     $this->output_updated = str_replace("<head>", "<head>" . PHP_EOL . $this->css->extLinks . PHP_EOL, $this->output_updated);
     //-----------------------------------------------------
     $this->output_updated = str_replace("<head>", "<head>" . PHP_EOL . $this->js->extLinks . PHP_EOL, $this->output_updated);
     //-----------------------------------------------------
     $this->clean_output();
     //-----------------------------------------------------
     $this->output_updated = str_replace("<head>", '<head><meta charset="utf-8">', $this->output_updated);
     //-----------------------------------------------------
     if (is_array($this->outputContent)) {
         FileFolder::file_put_contents($this->compilePath . $this->outputContent['saveas'], $this->output_updated);
     }
     //-----------------------------------------------------
     $this->output_images->compile();
     //-----------------------------------------------------
     Archive::zipDir($this->compilePath);
 }