About 9 results: "php preg_match_all repo:indesigner/tests"
Page 1 of 1
Filter Results
Sources
Languages
Filter Results
Try Search On
index.php in tests https://github.com/indesigner/tests.git | 1361 lines | PHP
  1. column_foreign_keys($P){global$b;$I=array();foreach($b->foreignKeys($P)as$p){foreach($p["source"]as$X)$I[$X][]=$p;}return$I;}function
  2. enum_input($T,$_a,$n,$Y,$Pb=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$n["length"],$yd);$I=($Pb!==null?"<label><input type='$T'$_a value='$Pb'".((is_array($Y)?in_array($Pb,$Y):$Y===0)?" checked":"")."><i>".lang(5)."</i></label>":"");foreach($yd[1]as$r=>$X){$X=stripcslashes(str_replace("''","'",$X));$Pa=(is_int($Y)?$Y==$r+1:(is_array($Y)?in_array($r+1,$Y):$Y===$X));$I.=" <label><input type='$T'$_a value='".($r+1)."'".($Pa?' checked':'').'>'.h($b->editVal($X,$n)).'</label>';}return$I;}function
  3. nbsp($Ac[""])."<td>".$b->editInput($_GET["edit"],$n,$_a,$Y);else{$pc=0;foreach($Ac
  4. as$x=>$X){if($x===""||!$X)break;$pc++;}$ee=($pc?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($n["field"])))."]']; if ($pc > f.selectedIndex) f.selectedIndex = $pc;\"":"");$_a.=$ee;echo(count($Ac)>1?html_select("function[$B]",$Ac,$q===null||in_array($q,$Ac)||isset($Ac[$q])?$q:"","functionChange(this);"):nbsp(reset($Ac))).'<td>';$Uc=$b->editInput($_GET["edit"],$n,$_a,$Y);if($Uc!="")echo$Uc;elseif($n["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$n["length"],$yd);foreach($yd[1]as$r=>$X){$X=stripcslashes(str_replace("''","'",$X));$Pa=(is_int($Y)?($Y>>$r)&1:in_array($X,explode(",",$Y),true));echo" <label><input type='checkbox' name='fields[$B][$r]' value='".(1<<$r)."'".($Pa?' checked':'')."$ee>".h($b->editVal($X,$n)).'</label>';}}elseif(ereg('blob|bytea|raw|file',$n["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$B'$ee>";elseif(($eg=ereg('text|lob',$n["type"]))||ereg("\n",$Y)){if($eg&&$w!="sqlite")$_a.=" cols='50' rows='12'";else{$K=min(12,substr_count($Y,"\n")+1);$_a.=" cols='30' rows='$K'".($K==1?" style='height: 1.2em;'":"");}echo"<textarea$_a>".h($Y).'</textarea>';}else{$Ed=(!ereg('int',$n["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$n["length"],$A)?((ereg("binary",$n["type"])?2:1)*$A[1]+($A[3]?1:0)+($A[2]&&!$n["unsigned"]?1:0)):($U[$n["type"]]?$U[$n["type"]]+($n["unsigned"]?0:1):0));if($i->server_info>=5.6&&ereg('time',$n["type"]))$Ed+=7;echo"<input".(ereg('int',$n["type"])?" type='number'":"")." value='".h($Y)."'".($Ed?" maxlength='$Ed'":"").(ereg('char|binary',$n["type"])&&$Ed>20?" size='40'":"")."$_a>";}}}function
  5. indexes($P,$j=null){$I=array();foreach(get_rows("SHOW INDEX FROM ".table($P),$j)as$J){$I[$J["Key_name"]]["type"]=($J["Key_name"]=="PRIMARY"?"PRIMARY":($J["Index_type"]=="FULLTEXT"?"FULLTEXT":($J["Non_unique"]?"INDEX":"UNIQUE")));$I[$J["Key_name"]]["columns"][]=$J["Column_name"];$I[$J["Key_name"]]["lengths"][]=$J["Sub_part"];}return$I;}function
  6. foreign_keys($P){global$i,$de;static$Ee='`(?:[^`]|``)+`';$I=array();$kb=$i->result("SHOW CREATE TABLE ".table($P),1);if($kb){preg_match_all("~CONSTRAINT ($Ee) FOREIGN KEY \\(((?:$Ee,? ?)+)\\) REFERENCES ($Ee)(?:\\.($Ee))? \\(((?:$Ee,? ?)+)\\)(?: ON DELETE ($de))?(?: ON UPDATE ($de))?~",$kb,$yd,PREG_SET_ORDER);foreach($yd
  7. as$A){preg_match_all("~$Ee~",$A[2],$Ef);preg_match_all("~$Ee~",$A[5],$ag);$I[idf_unescape($A[1])]=array("db"=>idf_unescape($A[4]!=""?$A[3]:$A[4]),"table"=>idf_unescape($A[4]!=""?$A[4]:$A[3]),"source"=>array_map('idf_unescape',$Ef[0]),"target"=>array_map('idf_unescape',$ag[0]),"on_delete"=>($A[6]?$A[6]:"RESTRICT"),"on_update"=>($A[7]?$A[7]:"RESTRICT"),);}}return$I;}function
  8. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  9. routine($B,$T){global$i,$Tb,$Tc,$U;$va=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$zg="((".implode("|",array_merge(array_keys($U),$va)).")\\b(?:\\s*\\(((?:[^'\")]*|$Tb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$Ee="\\s*(".($T=="FUNCTION"?"":$Tc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$zg";$jb=$i->result("SHOW CREATE $T ".idf_escape($B),2);preg_match("~\\(((?:$Ee\\s*,?)*)\\)\\s*".($T=="FUNCTION"?"RETURNS\\s+$zg\\s+":"")."(.*)~is",$jb,$A);$o=array();preg_match_all("~$Ee\\s*,?~is",$A[1],$yd,PREG_SET_ORDER);foreach($yd
  10. <td><input name="',$x,'[length]" value="',h($n["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">';echo"<select name='$x"."[collation]'".(ereg('(char|text|enum|set)$',$n["type"])?"":" class='hidden'").'><option value="">('.lang(88).')'.optionlist($Wa,$n["collation"]).'</select>',($Fg?"<select name='$x"."[unsigned]'".(!$n["type"]||ereg('((^|[^o])int|float|double|decimal)$',$n["type"])?"":" class='hidden'").'><option>'.optionlist($Fg,$n["unsigned"]).'</select>':''),(isset($n['on_update'])?"<select name='$x"."[on_update]'".($n["type"]=="timestamp"?"":" class='hidden'").'>'.optionlist(array(""=>"(".lang(89).")","CURRENT_TIMESTAMP"),$n["on_update"]).'</select>':''),($tc?"<select name='$x"."[on_delete]'".(ereg("`",$n["type"])?"":" class='hidden'")."><option value=''>(".lang(90).")".optionlist(explode("|",$de),$n["on_delete"])."</select> ":" ");}function
  11. process_length($rd){global$Tb;return(preg_match("~^\\s*(?:$Tb)(?:\\s*,\\s*(?:$Tb))*\\s*\$~",$rd)&&preg_match_all("~$Tb~",$rd,$yd)?implode(",",$yd[0]):preg_replace('~[^0-9,+-]~','',$rd));}function
  12. as$B=>$p){echo"<tr title='".h($B)."'>","<th><i>".implode("</i>, <i>",array_map('h',$p["source"]))."</i>","<td><a href='".h($p["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($p["db"]),ME):($p["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($p["ns"]),ME):ME))."table=".urlencode($p["table"])."'>".($p["db"]!=""?"<b>".h($p["db"])."</b>.":"").($p["ns"]!=""?"<b>".h($p["ns"])."</b>.":"").h($p["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$p["target"]))."</i>)","<td>".nbsp($p["on_delete"])."\n","<td>".nbsp($p["on_update"])."\n",($w=="sqlite"?"":'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($B)).'">'.lang(110).'</a>');}echo"</table>\n";}if($w!="sqlite")echo'<p><a href="'.h(ME).'foreign='.urlencode($a).'">'.lang(111)."</a>\n";}if(support("trigger")){echo"<h3 id='triggers'>".lang(112)."</h3>\n";$xg=triggers($a);if($xg){echo"<table cellspacing='0'>\n";foreach($xg
  13. as$x=>$X)echo"<tr valign='top'><td>$X[0]<td>$X[1]<th>".h($x)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($x))."'>".lang(110)."</a>\n";echo"</table>\n";}echo'<p><a href="'.h(ME).'trigger='.urlencode($a).'">'.lang(113)."</a>\n";}}}}elseif(isset($_GET["schema"])){page_header(lang(53),"",array(),DB.($_GET["ns"]?".$_GET[ns]":""));$Vf=array();$Wf=array();$B="adminer_schema";$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$B-".DB]?"$B-".DB:$B)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$yd,PREG_SET_ORDER);foreach($yd
  14. as$B=>$X){$X=process_input($o[$B]);if($X!==null){if($_POST["clone"])$N[idf_escape($B)]=($X!==false?$X:idf_escape($B));elseif($X!==false)$N[]=idf_escape($B)." = $X";}}$G.=($_POST["clone"]?" (".implode(", ",array_keys($N)).")\nSELECT ".implode(", ",$N)."\nFROM ".table($a):" SET\n".implode(",\n",$N));}if($_POST["delete"]||$N){$Ya="UPDATE";if($_POST["delete"]){$Ya="DELETE";$G="FROM $G";}if($_POST["clone"]){$Ya="INSERT";$G="INTO $G";}if($_POST["all"]||($Eg===array()&&$_POST["check"])||$Xc){$H=queries("$Ya $G$Vg");$sa=$i->affected_rows;}else{foreach((array)$_POST["check"]as$X){$H=queries($Ya.limit1($G,"\nWHERE ".($Z?implode(" AND ",$Z)." AND ":"").where_check($X,$o)));if(!$H)break;$sa+=$i->affected_rows;}}}$Fd=lang(226,$sa);if($_POST["clone"]&&$H&&$sa==1){$md=last_id();if($md)$Fd=lang(139," $md");}queries_redirect(remove_from_uri($_POST["all"]&&$_POST["delete"]?"page":""),$Fd,$H);}elseif(!$_POST["import"]){if(!$_POST["val"])$m=lang(227);else{$H=true;$sa=0;foreach($_POST["val"]as$Cg=>$J){$N=array();foreach($J
  15. as$x=>$X){$x=bracket_escape($x,1);$N[]=idf_escape($x)." = ".(ereg('char|text',$o[$x]["type"])||$X!=""?$b->processInput($o[$x],$X):"NULL");}$G=table($a)." SET ".implode(", ",$N);$Ug=" WHERE ".where_check($Cg,$o).($Z?" AND ".implode(" AND ",$Z):"");$H=queries("UPDATE".($Xc?" $G$Ug":limit1($G,$Ug)));if(!$H)break;$sa+=$i->affected_rows;}queries_redirect(remove_from_uri(),lang(226,$sa),$H);}}elseif(is_string($mc=get_file("csv_file",true))){cookie("adminer_import","output=".urlencode($ra["output"])."&format=".urlencode($_POST["separator"]));$H=true;$Xa=array_keys($o);preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~',$mc,$yd);$sa=count($yd[0]);begin();$zf=($_POST["separator"]=="csv"?",":($_POST["separator"]=="tsv"?"\t":";"));foreach($yd[0]as$x=>$X){preg_match_all("~((?>\"[^\"]*\")+|[^$zf]*)$zf~",$X.$zf,$zd);if(!$x&&!array_diff($zd[1],$Xa)){$Xa=$zd[1];$sa--;}else{$N=array();foreach($zd[1]as$r=>$Ua)$N[idf_escape($Xa[$r])]=($Ua==""&&$o[$Xa[$r]]["null"]?"NULL":q(str_replace('""','"',preg_replace('~^"|"$~','',$Ua))));$H=insert_update($a,$N,$Ne);if(!$H)break;}}if($H)queries("COMMIT");queries_redirect(remove_from_uri("page"),lang(228,$sa),$H);queries("ROLLBACK");}else$m=upload_error($mc);}}$Tf=$b->tableName($Q);if(is_ajax())ob_start();page_header(lang(36).": $Tf",$m);$N=null;if(isset($mf["insert"])){$N="";foreach((array)$_GET["where"]as$X){if(count($tc[$X["col"]])==1&&($X["op"]=="="||(!$X["op"]&&!ereg('[_%]',$X["val"]))))$N.="&set".urlencode("[".bracket_escape($X["col"])."]")."=".urlencode($X["val"]);}}$b->selectLinks($Q,$N);if(!$g)echo"<p class='error'>".lang(229).($o?".":": ".error())."\n";else{echo"<form action='' id='form'>\n","<div style='display: none;'>";hidden_fields_get();echo(DB!=""?'<input type="hidden" name="db" value="'.h(DB).'">'.(isset($_GET["ns"])?'<input type="hidden" name="ns" value="'.h($_GET["ns"]).'">':""):"");echo'<input type="hidden" name="select" value="'.h($a).'">',"</div>\n";$b->selectColumnsPrint($L,$g);$b->selectSearchPrint($Z,$g,$v);$b->selectOrderPrint($le,$g,$v);$b->selectLimitPrint($y);$b->selectLengthPrint($fg);$b->selectActionPrint($v);echo"</form>\n";$D=$_GET["page"];if($D=="last"){$wc=$i->result("SELECT COUNT(*) FROM ".table($a).($Z?" WHERE ".implode(" AND ",$Z):""));$D=floor(max(0,$wc-1)/$y);}$G=$b->selectQueryBuild($L,$Z,$Dc,$le,$y,$D);if(!$G)$G="SELECT".limit((+$y&&$Dc&&$Xc&&$w=="sql"?"SQL_CALC_FOUND_ROWS ":"").$yc,($Z?"\nWHERE ".implode(" AND ",$Z):"").$Ec,($y!=""?+$y:null),($D?$y*$D:0),"\n");echo$b->selectQuery($G);$H=$i->query($G);if(!$H)echo"<p class='error'>".error()."\n";else{if($w=="mssql"&&$D)$H->seek($y*$D);$Ob=array();echo"<form action='' method='post' enctype='multipart/form-data'>\n";$K=array();while($J=$H->fetch_assoc()){if($D&&$w=="oracle")unset($J["RNUM"]);$K[]=$J;}if($_GET["page"]!="last")$wc=(+$y&&$Dc&&$Xc?($w=="sql"?$i->result(" SELECT FOUND_ROWS()"):$i->result("SELECT COUNT(*) FROM ($G) x")):count($K));if(!$K)echo"<p class='message'>".lang(86)."\n";else{$Ea=$b->backwardKeys($a,$Tf);echo"<table id='table' cellspacing='0' class='nowrap checkable' onclick='tableClick(event);' ondblclick='tableClick(event, true);' onkeydown='return editingKeydown(event);'>\n","<thead><tr>".(!$Dc&&$L?"":"<td><input type='checkbox' id='all-page' onclick='formCheck(this, /check/);'> <a href='".h($_GET["modify"]?remove_from_uri("modify"):$_SERVER["REQUEST_URI"]."&modify=1")."'>".lang(230)."</a>");$Qd=array();$Ac=array();reset($L);$Ye=1;foreach($K[0]as$x=>$X){if($x!=$Xd){$X=$_GET["columns"][key($L)];$n=$o[$L?($X?$X["col"]:current($L)):$x];$B=($n?$b->fieldName($n,$Ye):"*");if($B!=""){$Ye++;$Qd[$x]=$B;$f=idf_escape($x);$Lc=remove_from_uri('(order|desc)[^=]*|page').'&order%5B0%5D='.urlencode($x);$wb="&desc%5B0%5D=1";echo'<th onmouseover="columnMouse(this);" onmouseout="columnMouse(this, \' hidden\');">','<a href="'.h($Lc.($le[0]==$f||$le[0]==$x||(!$le&&$Xc&&$Dc[0]==$f)?$wb:'')).'">';echo(!$L||$X?apply_sql_function($X["fun"],$B):h(current($L)))."</a>";echo"<span class='column hidden'>","<a href='".h($Lc.$wb)."' title='".lang(42)."' class='text'> ↓</a>";if(!$X["fun"])echo'<a href="#fieldset-search" onclick="selectSearch(\''.h(js_escape($x)).'\'); return false;" title="'.lang(39).'" class="text jsonly"> =</a>';echo"</span>";}$Ac[$x]=$X["fun"];next($L);}}$sd=array();if($_GET["modify"]){foreach($K

TemplateFilters.php in tests https://github.com/indesigner/tests.git | 170 lines | PHP
  1. 		if ($mAttrs) {
  2. 			preg_match_all(

LatteFilter.php in tests https://github.com/indesigner/tests.git | 554 lines | PHP
  1. 		if (!$modifiers) return $var;
  2. 		preg_match_all(







Back to Top