当前位置: 首页>>代码示例>>PHP>>正文


PHP ArrayUtil::array_replace_recursive方法代码示例

本文整理汇总了PHP中ArrayUtil::array_replace_recursive方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayUtil::array_replace_recursive方法的具体用法?PHP ArrayUtil::array_replace_recursive怎么用?PHP ArrayUtil::array_replace_recursive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ArrayUtil的用法示例。


在下文中一共展示了ArrayUtil::array_replace_recursive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: go

 public static function go($obj, $arr)
 {
     if (!is_null($obj)) {
         try {
             if (!is_array($obj)) {
                 throw new Exception("obj or arr is not an array");
             }
         } catch (Exception $e) {
             krumo($obj, $arr);
             krumo($e);
             die;
         }
     }
     //-------------------------------------------
     $obj = ArrayUtil::array_replace_recursive($arr, $obj);
     //-------------------------------------------
     if (is_array($obj['file'])) {
         $files = array();
         foreach ($obj['file'] as $value) {
             $newObj = ArrayUtil::array_replace_recursive(array(), $obj);
             $newObj['file'] = $value;
             //-------------------------------------------
             $ref = new Import($newObj);
             //-------------------------------------------
             array_push($files, $ref->init());
         }
     } else {
         $ref = new Import($obj);
         return $ref->init();
     }
 }
开发者ID:awwthentic1234,项目名称:hey,代码行数:31,代码来源:Import.php

示例2: scrape_CFG

 public function scrape_CFG()
 {
     /*preg_match_all('/<!--<seperate((?: {|{)(?:.*?)})(.*?)<!--<\/seperate>-->/s', $content, $matches);
     		//---------------------------------------------------------
     		if (sizeof($matches[0]) > 0) {
     			$this->css_CFG(NULL, $matches[2][0], json_decode($matches[1][0], true));
     			//-----------------------------------------------------
     			$content = str_replace($matches[0][0], "", $content);
     			//-----------------------------------------------------
     		}*/
     $this->tags = array();
     //---------------------------------------------------------
     $output_updated = $this->output_markup = Compiler::markUp_CHK($this->output, array("ignore" => true, "replace" => true));
     //$output_updated = StringUtil::removeAllHtmlComments($output_updated);
     //---------------------------------------------------------
     preg_match_all($this->regex, $output_updated, $matches, PREG_SET_ORDER);
     //---------------------------------------------------------
     $this->matches = $matches;
     //---------------------------------------------------------
     foreach ($matches as $key => $match) {
         $save_dir = $this->save_dir;
         //-----------------------------------------------------
         $prop = array("forceDownload" => $this->forceDownload, "compileType" => $this->compileType, "compilePath" => $this->compilePath, "compilerGlobal" => $this->compilerGlobal, "minify" => $this->minify, "save_dir" => $save_dir, "defaultSavePath" => $this->defaultSavePath, "output" => $this->output_updated, "match" => $match, "imagesProp" => $this->imagesProp, "index" => $key, "onRemoveMatch" => $this->onRemoveMatch, "src_path" => $this->src_path);
         //-----------------------------------------------------
         $newMatch = ClassUtil::classFromString($this->matchClass, array(ArrayUtil::array_replace_recursive($prop, $this->matchProp)));
         $newMatch->init();
         //-----------------------------------------------------
         $this->output_updated = $newMatch->output_updated;
         //-----------------------------------------------------
         if (!is_null($newMatch->link)) {
             if ($this->saveasphp) {
                 $this->mergedCode .= $newMatch->content_updated;
             } else {
                 //$this->extLinks .= $newMatch->link;
             }
         } else {
             //if (is_null($this->compilerGlobal->mergedCode)) $this->compilerGlobal->mergedCode = "";
             if (!is_null($newMatch->content_updated)) {
                 if ($newMatch->tagType != "tmpl") {
                     $this->mergedCode_noTag .= PHP_EOL . $newMatch->content_updated;
                     $this->mergedCode .= "<" . $newMatch->tagType . ">" . PHP_EOL . $newMatch->content_updated . "</" . $newMatch->tagType . ">";
                 } else {
                     $this->mergedCode .= PHP_EOL . $newMatch->content_updated;
                 }
             }
         }
         //-----------------------------------------------------
         $this->tags[] = $newMatch;
     }
     //---------------------------------------------------------
     //$this->output_updated = $output_updated;
 }
开发者ID:awwthentic1234,项目名称:hey,代码行数:52,代码来源:Compile_Code.php

示例3: compile_CFG

 private function compile_CFG($url, $id, $savePath)
 {
     $_GET['compile'] = 1;
     $_GET['refresh'] = 1;
     $_GET['compile_id'] = $id;
     //---------------------------------------------------------
     $prop = array("url" => $url, "compilePath" => $savePath);
     //---------------------------------------------------------
     if (file_exists($path = GenFun::get_local_url($url) . "compileConfig.js")) {
         $this->compileObj = json_decode(file_get_contents($path), true);
     } else {
         if (class_exists("ProjectGlobal")) {
             $this->compileObj = ProjectGlobal::$compileObj;
         }
     }
     return $compiler = new Compiler(ArrayUtil::array_replace_recursive($this->compileObj, $prop));
     //---------------------------------------------------------
 }
开发者ID:awwthentic1234,项目名称:hey,代码行数:18,代码来源:CompileUpload.php

示例4: __construct

 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);
 }
开发者ID:awwthentic1234,项目名称:hey,代码行数:68,代码来源:Compile.php


注:本文中的ArrayUtil::array_replace_recursive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。