https://github.com/basho/yokozuna/blob/develop/include/yokozuna.hrl#L340-L404
198422
function isYzField(f) {
    return f === '_yz_id'   ||
           f === '_yz_ed'   ||
           f === '_yz_fpn'  ||
           f === '_yz_vtag' ||
           f === '_yz_pn'   ||
           f === '_yz_rk'   ||
           f === '_yz_rt'   ||
           f === '_yz_rb'   ||
           f === '_yz_err';
}
387411
function buildSingleModuleSimple (app, mod, conf, args) {
  if (!mod) {
    mod = conf.moduleConf.module;
  }
  conf = getConf(app, mod);
  del.sync(path.join(conf.modulePath, 'dist'));
  var allPromise = taskList.all($, conf.appConf, conf.moduleConf, args);
  var athenaMatePromise = taskList.athena_mate($, conf.appConf, conf.moduleConf, args);
  var sassPromise = taskList.sass($, conf.appConf, conf.moduleConf, args);
  var lessPromise = taskList.less($, conf.appConf, conf.moduleConf, args);
  var transImagesPromise = taskList.trans_images($, conf.appConf, conf.moduleConf, args);
  var stylesPromise = taskList.styles($, conf.appConf, conf.moduleConf, args);
  var scriptsPromise = taskList.scripts($, conf.appConf, conf.moduleConf, args);
  var serveTransPromise = taskList.serve_trans($, conf.appConf, conf.moduleConf, args);
  var tempPromise = taskList.temp($, conf.appConf, conf.moduleConf, args);

  $.util.log($.util.colors.green('开始编译模块' + mod + '！'));
  return allPromise(mod, conf.modulePath, conf.appPath)
    .then(sassPromise.bind(null, mod, conf.modulePath, conf.appPath))
    .then(lessPromise.bind(null, mod, conf.modulePath, conf.appPath))
    .then(athenaMatePromise.bind(null, mod, conf.modulePath, conf.appPath))
    .then(transImagesPromise.bind(null, mod, conf.modulePath, conf.appPath))
    .then(stylesPromise.bind(null, mod, conf.modulePath, conf.appPath))
    .then(scriptsPromise.bind(null, mod, conf.modulePath, conf.appPath))
    .then(serveTransPromise.bind(null, mod, conf.modulePath, conf.appPath))
    .then(tempPromise.bind(null, mod, conf.modulePath, conf.appPath))
    .then(function () {
      $.util.log($.util.colors.green('结束编译模块' + mod + '！'));
      return Promise.resolve(mod);
    }).catch(function (e) {
      if (e) {
        console.log(e.plugin);
        if (e.stack) {
          console.log(e.stack);
        }
      }
    });
}
688615
public static function Ignition ($url, $namespace, $call_type = null) {
		//------------------------------------------------------
		//実行時間計測：開始
		//------------------------------------------------------
		Stopwatch::Start();

		//------------------------------------------------------
		//主処理の実行
		//------------------------------------------------------
		//var_dump対策のため、最上層でアウトプットバッファリングする
		//cliの場合はデフォルトで無効化とする
		Environment::IsCli() ?: OutputBuffer::Start(OutputBuffer::HANDLER_DEFAULT);

		//主処理の実行
		try {
			$ret = static::_Dispatch($url, $namespace, $call_type);
		} catch (CoreException $core_e) { // フレームワークで例外をキャッチできる最終地点
			StaticLog::WriteErrorLog($core_e->getStatusMessage() ."\n". CoreException::ConvertToStringMultiLine($core_e));
			throw $core_e;
		} catch (\Exception $e) {
			StaticLog::WriteErrorLog($e->getMessage() ."\n". CoreException::ConvertToStringMultiLine($e));
			throw $e;
		}

		//実行結果の出力
		Environment::IsCli() ?: OutputBuffer::EndFlush();

		//------------------------------------------------------
		//実行時間計測：終了
		//------------------------------------------------------
		Stopwatch::Stop();
		$diff = Stopwatch::Diff();

		//------------------------------------------------------
		//実行時間計測：ログ出力
		//------------------------------------------------------
		//ログ出力文字列の生成
		$log = sprintf("Execution time=%s, URL=%s", $diff, $url);

		//最大許容実行時間を越えていた場合はアラートを出す
		if ($diff > static::MAX_EXECUTE_TIME) {
			//ログ出力
			StaticLog::WriteErrorLog('SLOW DOWN!!:'. $log);
		}

		//実行時間ログの出力
		StaticLog::WriteLog('timer', $log);

		//------------------------------------------------------
		//処理の終了
		//------------------------------------------------------
		return $ret;
	}
959473
function extendObj(){
    /*
 　　*target被扩展的对象
　 　*length参数的数量
　　 *deep是否深度操作
　　*/
    var options, name, src, copy, copyIsArray, clone,
        target = arguments[0] || {},
        i = 1,
        length = arguments.length,
        deep = false;

    // target为第一个参数，如果第一个参数是Boolean类型的值，则把target赋值给deep
    // deep表示是否进行深层面的复制，当为true时，进行深度复制，否则只进行第一层扩展
    // 然后把第二个参数赋值给target
    if ( typeof target === "boolean" ) {
        deep = target;
        target = arguments[1] || {};

        // 将i赋值为2，跳过前两个参数
        i = 2;
    }

    // target既不是对象也不是函数则把target设置为空对象。
    if ( typeof target !== "object" && !(target.constructor == Function) ) {
        target = {};
    }

    // 如果只有一个参数，则把jQuery对象赋值给target，即扩展到jQuery对象上
    if ( length === i ) {
        target = this;

        // i减1，指向被扩展对象
        --i;
    }

    // 开始遍历需要被扩展到target上的参数
    for ( ; i < length; i++ ) {
        // 处理第i个被扩展的对象，即除去deep和target之外的对象
        if ( (options = arguments[ i ]) != null ) {
            // 遍历第i个对象的所有可遍历的属性
            for ( name in options ) {
                // 根据被扩展对象的键获得目标对象相应值，并赋值给src
                src = target[ name ];
                // 得到被扩展对象的值
                copy = options[ name ];

                if ( src === copy ) {
                    continue;
                }

                // 当用户想要深度操作时，递归合并
                // copy是纯对象或者是数组
                if ( deep && copy && ( (copy.constructor == Object) || (copyIsArray = (copy.constructor == Array)) ) ) {
                    // 如果是数组
                    if ( copyIsArray ) {
                        // 将copyIsArray重新设置为false，为下次遍历做准备。
                        copyIsArray = false;
                        // 判断被扩展的对象中src是不是数组
                        clone = src && (src.constructor == Array) ? src : [];
                    } else {
                        // 判断被扩展的对象中src是不是纯对象
                        clone = src && (src.constructor == Object) ? src : {};
                    }

                    // 递归调用extend方法，继续进行深度遍历
                    target[ name ] = extendObj( deep, clone, copy );
                } else if ( copy !== undefined ) {// 如果不需要深度复制，则直接copy（第i个被扩展对象中被遍历的那个键的值）
                    target[ name ] = copy;
                }
            }
        }
    }

    // 原对象被改变，因此如果不想改变原对象，target可传入{}
    return target;
}
497634
function tpl_key_import_form($attrib)
    {
        $attrib += array('id' => 'rcmKeyImportForm');

        $upload = new html_inputfield(array('type' => 'file', 'name' => '_file',
            'id' => 'rcmimportfile', 'size' => 30));
        $search = new html_inputfield(array('type' => 'text', 'name' => '_search',
            'id' => 'rcmimportsearch', 'size' => 30));

        $upload_button = new html_inputfield(array(
                'type'    => 'button',
                'value'   => $this->rc->gettext('import'),
                'class'   => 'button',
                'onclick' => "return rcmail.command('plugin.enigma-import','',this,event)",
        ));

        $search_button = new html_inputfield(array(
                'type'    => 'button',
                'value'   => $this->rc->gettext('search'),
                'class'   => 'button',
                'onclick' => "return rcmail.command('plugin.enigma-import-search','',this,event)",
        ));

        $upload_form = html::div(null,
            rcube::Q($this->enigma->gettext('keyimporttext'), 'show')
            . html::br() . html::br() . $upload->show()
            . html::br() . html::br() . $upload_button->show()
        );

        $search_form = html::div(null,
            rcube::Q($this->enigma->gettext('keyimportsearchtext'), 'show')
            . html::br() . html::br() . $search->show()
            . html::br() . html::br() . $search_button->show()
        );

        $form = html::tag('fieldset', '', html::tag('legend', null, $this->enigma->gettext('keyimportlabel')) . $upload_form)
            . html::tag('fieldset', '', html::tag('legend', null, $this->enigma->gettext('keyimportsearchlabel')) . $search_form);

        $this->rc->output->add_label('selectimportfile', 'importwait', 'nopubkeyfor', 'nopubkeyforsender',
            'encryptnoattachments','encryptedsendialog','searchpubkeyservers', 'importpubkeys',
            'encryptpubkeysfound',  'search', 'close', 'import', 'keyid', 'keylength', 'keyexpired',
            'keyrevoked', 'keyimportsuccess', 'keyservererror');
        $this->rc->output->add_gui_object('importform', $attrib['id']);
        $this->rc->output->include_script('publickey.js');

        $out = $this->rc->output->form_tag(array(
            'action'  => $this->rc->url(array('action' => $this->rc->action, 'a' => 'import')),
            'method'  => 'post',
            'enctype' => 'multipart/form-data') + $attrib,
            $form
        );

        return $out;
    }
639060
function(){
		var loopcount = 0;

		while(1){
			var Rdeg = ((Math.random() * 384)|0)-64; if(Rdeg<0){Rdeg=0;} if(Rdeg>255){Rdeg=255;}
			var Gdeg = ((Math.random() * 384)|0)-64; if(Gdeg<0){Gdeg=0;} if(Gdeg>255){Gdeg=255;}
			var Bdeg = ((Math.random() * 384)|0)-64; if(Bdeg<0){Bdeg=0;} if(Bdeg>255){Bdeg=255;}

			// HLSの各組成値を求める
			var Cmax = Math.max(Rdeg,Math.max(Gdeg,Bdeg));
			var Cmin = Math.min(Rdeg,Math.min(Gdeg,Bdeg));

			var Hdeg = 0;
			var Ldeg = (Cmax+Cmin)*0.5 / 255;
			var Sdeg = (Cmax===Cmin?0:(Cmax-Cmin)/((Ldeg<=0.5)?(Cmax+Cmin):(2*255-Cmax-Cmin)) );

			if(Cmax===Cmin){ Hdeg = 0;}
			else if(Rdeg>=Gdeg && Rdeg>=Bdeg){ Hdeg = (    60*(Gdeg-Bdeg)/(Cmax-Cmin)+360)%360;}
			else if(Gdeg>=Rdeg && Gdeg>=Bdeg){ Hdeg = (120+60*(Bdeg-Rdeg)/(Cmax-Cmin)+360)%360;}
			else if(Bdeg>=Gdeg && Bdeg>=Rdeg){ Hdeg = (240+60*(Rdeg-Gdeg)/(Cmax-Cmin)+360)%360;}

			// YCbCrのYを求める
			var Ydeg = (0.29891*Rdeg + 0.58661*Gdeg + 0.11448*Bdeg) / 255;

			if( (this.minYdeg<Ydeg && Ydeg<this.maxYdeg) && (Math.abs(this.lastYdeg-Ydeg)>0.15) && (Sdeg<0.02 || 0.40<Sdeg) &&
				 (((360+this.lastHdeg-Hdeg)%360>=45)&&((360+this.lastHdeg-Hdeg)%360<=315)) ){
				this.lastHdeg = Hdeg;
				this.lastYdeg = Ydeg;
				//alert("rgb("+Rdeg+", "+Gdeg+", "+Bdeg+")\nHLS("+(Hdeg|0)+", "+(""+((Ldeg*1000)|0)*0.001).slice(0,5)+", "+(""+((Sdeg*1000|0))*0.001).slice(0,5)+")\nY("+(""+((Ydeg*1000)|0)*0.001).slice(0,5)+")");
				return "rgb("+Rdeg+","+Gdeg+","+Bdeg+")";
			}

			loopcount++;
			if(loopcount>100){ return "rgb("+Rdeg+","+Gdeg+","+Bdeg+")";}
		}
	}
978750
def h2z(text, ignore='', kana=True, ascii=False, digit=False):
    
    def _conv_dakuten(text):
        """
        半角濁点カナを全角に変換
        """
        text = text.replace(u"ｶﾞ", u"ガ").replace(u"ｷﾞ", u"ギ")
        text = text.replace(u"ｸﾞ", u"グ").replace(u"ｹﾞ", u"ゲ")
        text = text.replace(u"ｺﾞ", u"ゴ").replace(u"ｻﾞ", u"ザ")
        text = text.replace(u"ｼﾞ", u"ジ").replace(u"ｽﾞ", u"ズ")
        text = text.replace(u"ｾﾞ", u"ゼ").replace(u"ｿﾞ", u"ゾ")
        text = text.replace(u"ﾀﾞ", u"ダ").replace(u"ﾁﾞ", u"ヂ")
        text = text.replace(u"ﾂﾞ", u"ヅ").replace(u"ﾃﾞ", u"デ")
        text = text.replace(u"ﾄﾞ", u"ド").replace(u"ﾊﾞ", u"バ")
        text = text.replace(u"ﾋﾞ", u"ビ").replace(u"ﾌﾞ", u"ブ")
        text = text.replace(u"ﾍﾞ", u"ベ").replace(u"ﾎﾞ", u"ボ")
        text = text.replace(u"ﾊﾟ", u"パ").replace(u"ﾋﾟ", u"ピ")
        text = text.replace(u"ﾌﾟ", u"プ").replace(u"ﾍﾟ", u"ペ")
        return text.replace(u"ﾎﾟ", u"ポ").replace(u"ｳﾞ", u"ヴ")

    if ascii:
        if digit:
            if kana:
                h2z_map = H2Z_ALL
            else:
                h2z_map = H2Z_AD
        elif kana:
            h2z_map = H2Z_AK
        else:
            h2z_map = H2Z_A
    elif digit:
        if kana:
            h2z_map = H2Z_DK
        else:
            h2z_map = H2Z_D
    else:
        h2z_map = H2Z_K
    if kana:
        text = _conv_dakuten(text)
    if ignore:
        h2z_map = _exclude_ignorechar(ignore, h2z_map.copy())
    return _convert(text, h2z_map)
959628
def search_schema_path(self, index, **options):
        
        if not self.yz_wm_schema:
            raise RiakError("Yokozuna search is unsupported by this Riak node")
        return mkpath(self.yz_wm_schema, "schema", quote_plus(index),
                      **options)
1081263
function(){
		var inp = this.qdata.split("/"), col = 0, row = 0;
		delete this.qdata;
		/* URLにつけるオプション */
		if(this.type!==URL_KANPEN && this.type!==URL_HEYAAPP){
			if(!!inp[0] && !isNaN(inp[0])){ inp.unshift("");}
			this.pflag = inp.shift();
		}
		
		/* サイズを表す文字列 */
		if(this.type===URL_KANPEN){
			if(this.pid==="kakuro"){
				row = +inp.shift() - 1;
				col = +inp.shift() - 1;
			}
			else if(this.pid==="sudoku"){
				row = col = +inp.shift();
			}
			else{
				row = +inp.shift();
				col = +inp.shift();
			}
		}
		else if(this.type===URL_HEYAAPP){
			var size = inp.shift().split("x");
			col = +size[0];
			row = +size[1];
		}
		else{
			col = +inp.shift() || NaN;
			row = +inp.shift() || NaN;
		}
		this.rows = row;
		this.cols = col;

		/* サイズ以降のデータを取得 */
		if(!inp[inp.length-1]){ inp.pop();}
		this.body = inp.join("/");
	}
258342
function(){
		var lines = this.fstr.split("\n");
		var firstline = lines.shift();
		delete this.fstr;
		
		/* ヘッダからパズルの種類・ファイルの種類を判定する */
		if(firstline.match(/^pzprv3/)){
			this.type = FILE_PZPR;
			if(firstline.match(/pzprv3\.(\d+)/)){ this.filever = +RegExp.$1;}
			this.pid = lines.shift();
			this.qdata = lines.join("\n");
		}
		else if(firstline.match(/^\<\?xml/)){ // jshint ignore:line
			this.type = FILE_PBOX_XML;
			lines.unshift(firstline);
			this.qdata = lines.join("\n");
			if(!!DOMParser){
				this.body = (new DOMParser()).parseFromString(this.qdata, 'text/xml');
				this.pid = this.body.querySelector('puzzle').getAttribute('type');
			}
			else{ this.pid = '';}
		}
		else if(firstline.match(/^\d+$/)){
			this.type = FILE_PBOX;
			lines.unshift(firstline);
			this.qdata = lines.join("\n");
		}
		else{
			this.pid = '';
		}
		this.pid = pzpr.variety.toPID(this.pid);
		
		return (!!this.pid);
	}
920916
private function _updateModelFactory ()
    {
        $factory   = LIB.'/'.APP.'/Factory/ModelFactory.php';
        $data      = file_get_contents($factory);

        $use_text  = 'use '.APP.'\Model\%s'.$this->model_name.'%s;'.PHP_EOL;
        $func_text = 'public function build'.$this->model_name.'%s ()'.PHP_EOL.
            '    {'.PHP_EOL.
            '        return new '.$this->model_name.'%s();'.PHP_EOL.
            '    }'.PHP_EOL.PHP_EOL.PHP_EOL.
            '    /* ${%s} */';


        // Modelクラス
        if (! preg_match('/build'.$this->model_name.'Model/', $data)) {
            $text = sprintf($use_text, '', 'Model', 'Model').
                '/* ${UseModel} */';
            $data = str_replace('/* ${UseModel} */', $text, $data);

            $text = sprintf($func_text, 'Model', 'Model', 'Model');
            $data = str_replace('/* ${Model} */', $text, $data);
        }

        // Queryクラス
        if (! preg_match('/build'.$this->model_name.'Query/', $data)) {
            $text = sprintf($use_text, 'Query\\', 'Query').
                '/* ${UseQuery} */';
            $data = str_replace('/* ${UseQuery} */', $text, $data);

            $text = sprintf($func_text, 'Query', 'Query', 'Query');
            $data = str_replace('/* ${Query} */', $text, $data);
        }

        // Columnクラス
        if (! preg_match('/build'.$this->model_name.'Column/', $data)) {
            $text = sprintf($use_text, 'Column\\', 'Column').
                '/* ${UseColumn} */';
            $data = str_replace('/* ${UseColumn} */', $text, $data);

            $text = sprintf($func_text, 'Column', 'Column', 'Column');
            $data = str_replace('/* ${Column} */', $text, $data);
        }


        $data = str_replace('${app}', APP, $data);
        file_put_contents($factory, $data);
    }
1025147
function getRoot(cwd, filename, smap) {
    var relativePath = path.relative(cwd, filename);

    var segments = relativePath.split('node_modules');

    var sourceRoot = smap.getProperty('sourceRoot') || '/source/' + relativePath;

    if (segments.length <= 1) {
        return sourceRoot;
    } else {
        return sourceRoot
            .replace(/^\/source\//, '/source/' + pathToPackage());
    }

    // it works, somehow ¯\_(ツ)_/¯
    function pathToPackage() {
        var upToNodeModules = segments
            .slice(0, -1)
            .concat('/')
            .join('node_modules');

        var packageName = segments[segments.length - 1]
            .split('/', 2)[1]
            + '/';

        return upToNodeModules + packageName;
    }
}
192407
public static function SendDataAsFile ($data, $file_name, $mime_type = null, $options = []) {
		//==============================================
		//オプション展開
		//==============================================
		$filename_from_charset	= $options['from_charset']			?? Encoding::UTF_8;
		$filename_to_charset	= $options['to_charset']			?? Encoding::SJIS;
		$chunk_size				= $options['chunk_size']			?? static::CHUNK_SIZE;
		$content_disposition	= $options['content_disposition']	?? static::CONTENT_DISPOSITION_ATTACHMENT;

		//==============================================
		//データサイズ取得
		//==============================================
		$file_size = strlen($data);

		//==============================================
		//mime type確定
		//==============================================
		if ($mime_type === null) {
			$ext = pathinfo($file_name, \PATHINFO_EXTENSION);
			$mime_type = self::GetMimeTypeMapForExt()[$ext] ?? self::MIME_TYPE_BINARY;
		}

		//==============================================
		//ファイル送信開始
		//==============================================
		//HTTP ResponseHeaderの出力
		foreach (static::GetHttpHeaderContentDispositionAttachment(
			$file_name,
			$file_size,
			$mime_type,
			$content_disposition,
			$filename_to_charset,
			$filename_from_charset
		) as $header) {
			header(str_replace(["\r", "\n"], '', $header));
		}

		//----------------------------------------------
		//実処理の開始
		//----------------------------------------------
		//既存の出力を全て送信
		OutputBuffer::Clean();
		flush();

		//timeout引き延ばし処理：実行開始秒
		$split_time = time();

		//チャンクサイズごとに送信
		for ($i = 0;$i < $file_size;$i++) {
			print $data[$i];
			flush();
					//3秒以上経過ごとにタイムリミットを延長する
			if (time() - $split_time > 3) {
				set_time_limit(time() - $split_time);
			}
		}

		//==============================================
		//処理の終了
		//==============================================
	}
529867
function(){
		var pzl = this, col = pzl.cols, row = pzl.rows, out = [];
		var puzzlenode = (this.type===FILE_PBOX_XML ? this.body.querySelector('puzzle') : null);

		/* サイズを表す文字列 */
		if(pzl.type===FILE_PBOX_XML){
			var sizenode = puzzlenode.querySelector('size');
			if(sizenode){ puzzlenode.removeChild(sizenode);}
			if(pzl.pid==="slither"||pzl.pid==='kakuro'){ row++; col++;}
			puzzlenode.appendChild(this.createXMLNode('size', {row:row, col:col}));
		}
		else if(pzl.type===FILE_PBOX && pzl.pid==="kakuro"){
			out.push(row + 1);
			out.push(col + 1);
		}
		else if(pzl.pid==="sudoku"){
			out.push(col);
		}
		else{
			out.push(row);
			out.push(col);
		}

		/* サイズ以降のデータを設定 */
		if(pzl.type!==FILE_PBOX_XML){
			out.push(pzl.body);
		}

		/* 履歴・メタデータ出力がある形式ならば出力する */
		if((pzl.type===FILE_PZPR) && !!JSON){
			if(!pzl.metadata.empty()){
				var info = {metadata:pzl.metadata.getvaliddata()};
				if(pzl.history){ info.history = pzl.history;}
				out.push("info:" + JSON.stringify(info,null,1));
			}
			else if(pzl.history){
				out.push("history:" + JSON.stringify(pzl.history,null,1));
			}
		}
		else if(pzl.type===FILE_PBOX_XML){
			var propnode = puzzlenode.querySelector('property');
			if(propnode){ puzzlenode.removeChild(propnode);}
			propnode = this.createXMLNode('property');
			var meta = pzl.metadata;
			propnode.appendChild(this.createXMLNode('author',     {value:meta.author}));
			propnode.appendChild(this.createXMLNode('source',     {value:meta.source}));
			propnode.appendChild(this.createXMLNode('difficulty', {value:meta.hard}));
			if(!!meta.comment){
				var commentnode = this.createXMLNode('comment');
				commentnode.appendChild(this.body.createTextNode(meta.comment));
				propnode.appendChild(commentnode);
			}
			puzzlenode.appendChild(propnode);
			
			// 順番を入れ替え
			puzzlenode.appendChild(puzzlenode.querySelector('board'));
			puzzlenode.appendChild(puzzlenode.querySelector('answer'));
		}

		var outputdata;
		if(pzl.type!==FILE_PBOX_XML){
			outputdata = out.join("\n");
		}
		else{
			outputdata = new XMLSerializer().serializeToString(this.body);
			if(!outputdata.match(/^\<\?xml/)){ // jshint ignore:line
				outputdata = '<?xml version="1.0" encoding="UTF-8"?>\n' + outputdata;
			}
		}
		return outputdata;
	}
1167047
function makeDirs(plan, dest, savedir, callback) {

  // フォルダパスのリストを作成
  let all = plan.map(file => {
    let dirname = path.dirname(path.join(savedir, dest, file)); //ファイル名を除外
    return pathcrumb(dirname);
  });

  // 配列をフラットにして重複分を排除
  let uniq = _.uniq(_.flatten(all));

  // フォルダを作成
  let shell = path.join(__dirname, '../sh/makedirs.sh');
  return exec('chmod +x ' + shell, (error, stdout, stderr) => {
    return execFile(shell, uniq, (error, stdout, stderr) => {
      if (error !== null) throw ('[Error: makeDirs makedis.sh:] ' + error);
    }).on('close', callback);
  });
}
686575
@Override
	public String getExecutableSql() {
		if (StringUtils.isEmpty(executableSqlCache)) {
			if (executableSql.length() > 0) {
				executableSqlCache = executableSql.toString();
				if (executableSqlCache.toUpperCase().contains("WHERE")) {
					// where句の直後に来るANDやORの除去
					StringBuffer buff = new StringBuffer();
					Matcher matcher = WHERE_CLAUSE_PATTERN.matcher(executableSqlCache);
					while (matcher.find()) {
						String whereClause = matcher.group(1);
						matcher.appendReplacement(buff, whereClause);
					}
					matcher.appendTail(buff);
					executableSqlCache = buff.toString();
				}
				// 各句の直後に現れる不要なカンマの除去
				StringBuffer buff = new StringBuffer();
				Matcher removeCommaMatcher = REMOVE_FIRST_COMMA_PATTERN.matcher(executableSqlCache);
				while (removeCommaMatcher.find()) {
					String clauseWords = removeCommaMatcher.group(1);
					removeCommaMatcher.appendReplacement(buff, clauseWords);
				}
				removeCommaMatcher.appendTail(buff);
				executableSqlCache = buff.toString();

				// 空行の除去
				executableSqlCache = CLEAR_BLANK_PATTERN.matcher(executableSqlCache).replaceAll("");
			}
		}
		return executableSqlCache;
	}
206189
public static function ReplacePhpConstValue ($value) {
		$match_count	= 0;
		$null_count		= 0;
		$ret = preg_replace_callback(
			"/\{PHP_(CONST|METHOD|FILE|FW2_DI_STATIC):(.+)\}/",
			function ($matches) use (&$null_count) {
				switch ($matches[1]) {
					case 'METHOD':
						$matches[2] = static::ReplacePhpConstValue($matches[2]);
						$chunk = explode('|', $matches[2]);

						$method = explode('::', $chunk[0]);
						if (is_array($method) && !is_callable($chunk[0])) {
							throw CoreException::RaiseSystemError('実行できないメソッド名が設定されています。%s::%s', [$method[0], $method[1]]);
						} else if (!is_array($method) && !function_exists($method[0])) {
							throw CoreException::RaiseSystemError('実行できない関数名が設定されています。%s', [$method[0]]);
						}
						$const_value = call_user_func($method, $chunk[1] ?? null);
						$const_value !== null ?: $null_count++;
						return $const_value;
					case 'CONST':
						$matches[2] = static::ReplacePhpConstValue($matches[2]);
						$chunk = explode('|', $matches[2]);

						try {
							$const_value = ConstUtility::Get($chunk[0], (isset($chunk[1])) ? $chunk[1] : NULL, TRUE);
						} catch (CoreException $ce) {
							throw CoreException::RaiseSystemError('設定ファイルに存在しない定数名が設定されています。const name:%s', [$chunk[0]]);
						}
						$const_value !== null ?: $null_count++;
						return $const_value;
					case 'FILE':
						$matches[2] = static::ReplacePhpConstValue($matches[2]);
						$chunk = explode('|', $matches[2]);

						$file_path = $chunk[0];
						$target_row = $chunk[1] ?? 1;
						$default_value = $chunk[2] ?? '';

						if ($file_path == '') {
							return $default_value;
						}

						$handle = fopen($file_path, "r");
						$value = static::GetTargeRow($handle, $target_row) ?: $default_value;
						fclose($handle);
						return $value;
					case 'FW2_DI_STATIC':
						$chunk = explode('::', $matches[2]);
						$class_path = [DI::GetClassPath($chunk[0]), $chunk[1]];
						$const_value = $class_path();
						$const_value !== null ?: $null_count++;
						return $const_value;
				}
			},
			$value,
			-1,
			$match_count
		);
		return $match_count === $null_count && $ret === '' ? null : $ret;
	}