Пример #1
0
 function parse_match()
 {
     $index = array();
     $num++;
     $txt = NULL;
     preg_match_all("/type(?:\\s|)=(?:\\s|)(?:[\\'\"])([\\-A-Za-z\\/_\\d\\.]+)(?:[\\'\"])/s", $this->match[3], $tmpl, PREG_SET_ORDER);
     if (isset($this->match[3]) && $this->match[3] != "") {
         preg_match("/src(?:\\s|)=(?:\\s|)[\\'\"](.*?)[\\'\"]/s", $this->match[3], $src);
         if (isset($src[1]) && $src[1] != "") {
             $filePath = $src[1];
             $this->link_CFG($filePath);
         }
     }
     if (is_null($this->link_compile_file) && isset($this->match[4]) && $this->match[4] != "" && (sizeof($tmpl) == 0 || $tmpl[1] == "text/javascript")) {
         $this->content = $this->match[4];
         $this->content = StringUtil::removeWhiteLines($this->content);
         //-----------------------------------------------------
         //krumo($this->content);
         //$this->content = StringUtil::removeAllJSComments($this->content);
         //krumo($this->content);
         //-----------------------------------------------------
         if ($this->getServices) {
             preg_match_all('/"([^\'"]*\\.(php)[\'"]?)"/', $txtNoComments, $php);
             if (sizeof($php[0]) > 0) {
                 foreach ($php[1] as $service) {
                     $bool = false;
                     $service = MarkUp::go($service);
                     if (strpos($service, "/") === false) {
                         $service = Import::getImportPath() . $service;
                     }
                     $service = strpos($service, "http://") === false ? $service : GenFun::get_local_url($service);
                     if (!is_null($this->getServices['except'])) {
                         $bool = ArrayUtil::existIn($this->getServices['except'], $service, false);
                     }
                     if (file_exists($service) && !$bool) {
                         $this->services[] = $service;
                     }
                 }
             }
         }
     }
     /*if (isset($this->match[4]) && $this->match[4] != "") {
     			$filePath = $this->match[4];
     			$this->link_CFG($filePath);
     		} else {
     			$this->content = $this->match[5];
     			$this->content = StringUtil::removeWhiteLines($this->content);
     			//-----------------------------------------------------
     			//krumo($this->content);
     			//$this->content = StringUtil::removeAllJSComments($this->content);
     			//krumo($this->content);
     			//-----------------------------------------------------
     			if ($this->getServices) {
     				preg_match_all('/"([^\'"]*\.(php)[\'"]?)"/', $txtNoComments, $php);
     				if (sizeof($php[0]) > 0){
     					foreach ($php[1] as $service) {
     						$bool = false;
     						$service = MarkUp::go($service);
     						if(strpos($service, "/") === false) $service = Import::getImportPath().$service;
     						$service = (strpos($service, "http://") === false) ? $service : GenFun::get_local_url($service);
     						if (!is_null($this->getServices['except'])) $bool = ArrayUtil::existIn($this->getServices['except'], $service, false);
     						if (file_exists($service) && !$bool) $this->services[] = $service;
     					}
     				}
     			}
     		}*/
 }
Пример #2
0
}
//-----------------------------------------------------------------------------
//init var
//-----------------------------------------------------------------------------
$chk = array("bool" => true);
//-----------------------------------------------------------------------------
//$_REQUEST = (isset($_GET["service"])) ?  $_GET :  $_POST;
//-----------------------------------------------------------------------------
indexExist($_REQUEST, array('service', 'functionName'));
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//imports
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
preg_match("/{(.*?)}/", $_REQUEST['service'], $match);
$classPath = sizeof($match) == 0 ? Import::services() . $_REQUEST['service'] : MarkUp::go($_REQUEST['service']);
//----------------------------------------------------------
//if (!file_exists($classPath)) die($classPath." does not exist!!!!");
//----------------------------------------------------------
if (!isset($_REQUEST['service'])) {
    fail_CHK("service is not set!!");
} else {
    if (!FileFolder::file_exists($classPath)) {
        fail_CHK("service (" . $classPath . ") does not exist!!");
    }
}
//----------------------------------------------------------
$class = explode(".", $classPath);
//----------------------------------------------------------
if ($class[1] != "php") {
    fail_CHK("service does not end with '.php'");