About 1 result: "php preg_match_all repo:dydycloud/ICEcoder"
Page 1 of 1
Filter Results
Sources
Languages
Filter Results
Try Search On
adminer-3.4.0-mysql-en.php in ICEcoder https://github.com/dydycloud/ICEcoder.git | 967 lines | PHP
  1. column_foreign_keys($S){global$b;$J=array();foreach($b->foreignKeys($S)as$m){foreach($m["source"]as$X)$J[$X][]=$m;}return$J;}function
  2. enum_input($V,$ta,$k,$Y,$Ab=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$k["length"],$Rc);$J=($Ab!==null?"<label><input type='$V'$ta value='$Ab'".((is_array($Y)?in_array($Ab,$Y):$Y===0)?" checked":"")."><i>".'empty'."</i></label>":"");foreach($Rc[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$Ga=(is_int($Y)?$Y==$s+1:(is_array($Y)?in_array($s+1,$Y):$Y===$X));$J.=" <label><input type='$V'$ta value='".($s+1)."'".($Ga?' checked':'').'>'.h($b->editVal($X,$k)).'</label>';}return$J;}function
  3. nbsp($q[""])."<td>".$b->editInput($_GET["edit"],$k,$ta,$Y);else{$Xb=0;foreach($q
  4. as$y=>$X){if($y===""||!$X)break;$Xb++;}$td=($Xb?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($k["field"])))."]']; if ($Xb > f.selectedIndex) f.selectedIndex = $Xb;\"":"");$ta.=$td;echo(count($q)>1?html_select("function[$D]",$q,$p===null||in_array($p,$q)||isset($q[$p])?$p:"","functionChange(this);"):nbsp(reset($q))).'<td>';$wc=$b->editInput($_GET["edit"],$k,$ta,$Y);if($wc!="")echo$wc;elseif($k["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$k["length"],$Rc);foreach($Rc[1]as$s=>$X){$X=stripcslashes(str_replace("''","'",$X));$Ga=(is_int($Y)?($Y>>$s)&1:in_array($X,explode(",",$Y),true));echo" <label><input type='checkbox' name='fields[$D][$s]' value='".(1<<$s)."'".($Ga?' checked':'')."$td>".h($b->editVal($X,$k)).'</label>';}}elseif(ereg('blob|bytea|raw|file',$k["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$D'$td>";elseif(ereg('text|lob',$k["type"]))echo"<textarea ".($x!="sqlite"||ereg("\n",$Y)?"cols='50' rows='12'":"cols='30' rows='1' style='height: 1.2em;'")."$ta>".h($Y).'</textarea>';else{$Xc=(!ereg('int',$k["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$k["length"],$B)?((ereg("binary",$k["type"])?2:1)*$B[1]+($B[3]?1:0)+($B[2]&&!$k["unsigned"]?1:0)):($yf[$k["type"]]?$yf[$k["type"]]+($k["unsigned"]?0:1):0));echo"<input value='".h($Y)."'".($Xc?" maxlength='$Xc'":"").(ereg('char|binary',$k["type"])&&$Xc>20?" size='40'":"")."$ta>";}}}function
  5. indexes($S,$g=null){$J=array();foreach(get_rows("SHOW INDEX FROM ".table($S),$g)as$K){$J[$K["Key_name"]]["type"]=($K["Key_name"]=="PRIMARY"?"PRIMARY":($K["Index_type"]=="FULLTEXT"?"FULLTEXT":($K["Non_unique"]?"INDEX":"UNIQUE")));$J[$K["Key_name"]]["columns"][]=$K["Column_name"];$J[$K["Key_name"]]["lengths"][]=$K["Sub_part"];}return$J;}function
  6. foreign_keys($S){global$f,$sd;static$F='`(?:[^`]|``)+`';$J=array();$ab=$f->result("SHOW CREATE TABLE ".table($S),1);if($ab){preg_match_all("~CONSTRAINT ($F) FOREIGN KEY \\(((?:$F,? ?)+)\\) REFERENCES ($F)(?:\\.($F))? \\(((?:$F,? ?)+)\\)(?: ON DELETE ($sd))?(?: ON UPDATE ($sd))?~",$ab,$Rc,PREG_SET_ORDER);foreach($Rc
  7. as$B){preg_match_all("~$F~",$B[2],$Ie);preg_match_all("~$F~",$B[5],$ef);$J[idf_unescape($B[1])]=array("db"=>idf_unescape($B[4]!=""?$B[3]:$B[4]),"table"=>idf_unescape($B[4]!=""?$B[4]:$B[3]),"source"=>array_map('idf_unescape',$Ie[0]),"target"=>array_map('idf_unescape',$ef[0]),"on_delete"=>($B[6]?$B[6]:"RESTRICT"),"on_update"=>($B[7]?$B[7]:"RESTRICT"),);}}return$J;}function
  8. view($D){global$f;return
  9. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  10. routine($D,$V){global$f,$Eb,$vc,$yf;$pa=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$xf="((".implode("|",array_merge(array_keys($yf),$pa)).")\\b(?:\\s*\\(((?:[^'\")]*|$Eb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$F="\\s*(".($V=="FUNCTION"?"":$vc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$xf";$Za=$f->result("SHOW CREATE $V ".idf_escape($D),2);preg_match("~\\(((?:$F\\s*,?)*)\\)\\s*".($V=="FUNCTION"?"RETURNS\\s+$xf\\s+":"")."(.*)~is",$Za,$B);$l=array();preg_match_all("~$F\\s*,?~is",$B[1],$Rc,PREG_SET_ORDER);foreach($Rc
  11. <td><input name="',$y,'[length]" value="',h($k["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">',"<select name='$y"."[collation]'".(ereg('(char|text|enum|set)$',$k["type"])?"":" class='hidden'").'><option value="">('.'collation'.')'.optionlist($d,$k["collation"]).'</select>',($Ef?"<select name='$y"."[unsigned]'".(!$k["type"]||ereg('(int|float|double|decimal)$',$k["type"])?"":" class='hidden'").'><option>'.optionlist($Ef,$k["unsigned"]).'</select>':''),($n?"<select name='$y"."[on_delete]'".(ereg("`",$k["type"])?"":" class='hidden'")."><option value=''>(".'ON DELETE'.")".optionlist(explode("|",$sd),$k["on_delete"])."</select> ":" ");}function
  12. process_length($Lc){global$Eb;return(preg_match("~^\\s*(?:$Eb)(?:\\s*,\\s*(?:$Eb))*\\s*\$~",$Lc)&&preg_match_all("~$Eb~",$Lc,$Rc)?implode(",",$Rc[0]):preg_replace('~[^0-9,+-]~','',$Lc));}function
  13. as$D=>$m){echo"<tr title='".h($D)."'>","<th><i>".implode("</i>, <i>",array_map('h',$m["source"]))."</i>","<td><a href='".h($m["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($m["db"]),ME):($m["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($m["ns"]),ME):ME))."table=".urlencode($m["table"])."'>".($m["db"]!=""?"<b>".h($m["db"])."</b>.":"").($m["ns"]!=""?"<b>".h($m["ns"])."</b>.":"").h($m["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$m["target"]))."</i>)","<td>".nbsp($m["on_delete"])."\n","<td>".nbsp($m["on_update"])."\n";if($x!="sqlite")echo'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($D)).'">'.'Alter'.'</a>';}echo"</table>\n";}if($x!="sqlite")echo'<p><a href="'.h(ME).'foreign='.urlencode($a).'">'.'Add foreign key'."</a>\n";}if(support("trigger")){echo"<h3>".'Triggers'."</h3>\n";$vf=triggers($a);if($vf){echo"<table cellspacing='0'>\n";foreach($vf
  14. as$y=>$X)echo"<tr valign='top'><td>$X[0]<td>$X[1]<th>".h($y)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($y))."'>".'Alter'."</a>\n";echo"</table>\n";}echo'<p><a href="'.h(ME).'trigger='.urlencode($a).'">'.'Add trigger'."</a>\n";}}}}elseif(isset($_GET["schema"])){page_header('Database schema',"",array(),DB.($_GET["ns"]?".$_GET[ns]":""));$Ye=array();$Ze=array();$D="adminer_schema";$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$D-".DB]?"$D-".DB:$D)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$Rc,PREG_SET_ORDER);foreach($Rc
  15. </form>
  16. ';}elseif(isset($_GET["user"])){$fa=$_GET["user"];$ee=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$K){foreach(explode(",",($K["Privilege"]=="Grant option"?"":$K["Context"]))as$Wa)$ee[$Wa][$K["Privilege"]]=$K["Comment"];}$ee["Server Admin"]+=$ee["File access on server"];$ee["Databases"]["Create routine"]=$ee["Procedures"]["Create routine"];unset($ee["Procedures"]["Create routine"]);$ee["Columns"]=array();foreach(array("Select","Insert","Update","References")as$X)$ee["Columns"][$X]=$ee["Tables"][$X];unset($ee["Server Admin"]["Usage"]);foreach($ee["Tables"]as$y=>$X)unset($ee["Databases"][$y]);$id=array();if($_POST){foreach($_POST["objects"]as$y=>$X)$id[$X]=(array)$id[$X]+(array)$_POST["grants"][$y];}$gc=array();$pd="";if(isset($_GET["host"])&&($I=$f->query("SHOW GRANTS FOR ".q($fa)."@".q($_GET["host"])))){while($K=$I->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$K[0],$B)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$B[1],$Rc,PREG_SET_ORDER)){foreach($Rc

Back to Top