About 25,646 results: "php preg_match_all"
Page 4 of 50
Filter Results
Sources
Languages
Filter Results
Try Search On











  1. 				if (preg_match('/^\s*' . preg_quote($row['column'], '/') . '\s+in\s+\((.*?)\)\s*$/i', $row['constraint'], $match)) {
  2. 					if (preg_match_all("/(?<!')'((''|[^']+)*)'/", $match[1], $matches, PREG_PATTERN_ORDER)) {
  3. 		
  4. 		preg_match_all('#(?<=,|\()\s+(?:"|\`)(\w+)(?:"|\`)\s+(?:([a-z]+)(?:\(([^)]+)\))?( unsigned)?(?: zerofill)?)(?: character set [^ ]+)?(?: collate [^ ]+)?(?: NULL)?( NOT NULL)?(?: DEFAULT ((?:[^, \']*|\'(?:\'\'|[^\']+)*\')))?( auto_increment)?( COMMENT \'(?:\'\'|[^\']+)*\')?( ON UPDATE CURRENT_TIMESTAMP)?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  5. 			// Primary keys
  6. 			preg_match_all('/PRIMARY KEY\s+\("(.*?)"\),?\n/U', $row['Create Table'], $matches, PREG_SET_ORDER);
  7. 			// Unique keys
  8. 			preg_match_all('/UNIQUE KEY\s+"([^"]+)"\s+\("(.*?)"\),?\n/U', $row['Create Table'], $matches, PREG_SET_ORDER);
  9. 			// Foreign keys
  10. 			preg_match_all('#FOREIGN KEY \("([^"]+)"\) REFERENCES "([^"]+)" \("([^"]+)"\)(?:\sON\sDELETE\s(SET\sNULL|SET\sDEFAULT|CASCADE|NO\sACTION|RESTRICT))?(?:\sON\sUPDATE\s(SET\sNULL|SET\sDEFAULT|CASCADE|NO\sACTION|RESTRICT))?#', $row['Create Table'], $matches, PREG_SET_ORDER);
  11. 				if (preg_match('/^\s*' . preg_quote($column, '/') . '\s+in\s+\((.*?)\)\s*$/i', $row['check_constraint'], $match)) {
  12. 					if (preg_match_all("/(?<!')'((''|[^']+)*)'/", $match[1], $matches, PREG_PATTERN_ORDER)) {
  13. 			// Get column level key definitions
  14. 			preg_match_all('#(?<=,|\()\s*["`\[]?(\w+)["`\]]?\s+(?:[a-z]+)(?:\((?:\d+)\))?(?:(?:\s+NOT\s+NULL)|(?:\s+DEFAULT\s+(?:[^, \']*|\'(?:\'\'|[^\']+)*\'))|(\s+UNIQUE)|(\s+PRIMARY\s+KEY(?:\s+AUTOINCREMENT)?)|(?:\s+CHECK\s*\(\w+\s+IN\s+\(\s*(?:(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\s*,\s*)*\s*(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\)\)))*(\s+REFERENCES\s+["`\[]?(\w+)["`\]]?\s*\(\s*["`\[]?(\w+)["`\]]?\s*\)\s*(?:(?:\s+(?:ON\s+DELETE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT)))|(?:\s+(?:ON\s+UPDATE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT))))*(?:\s+(?:DEFERRABLE|NOT\s+DEFERRABLE))?)?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  15. 			// Get table level unique key definitions
  16. 			preg_match_all('#(?<=,|\()\s*UNIQUE\s*\(\s*((?:\s*["`\[]?\w+["`\]]?\s*,\s*)*["`\[]?\w+["`\]]?)\s*\)\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);

  1. 				if (preg_match('/^\s*' . preg_quote($row['column'], '/') . '\s+in\s+\((.*?)\)\s*$/i', $row['constraint'], $match)) {
  2. 					if (preg_match_all("/(?<!')'((''|[^']+)*)'/", $match[1], $matches, PREG_PATTERN_ORDER)) {
  3. 			// Primary keys
  4. 			preg_match_all('/PRIMARY KEY\s+\("(.*?)"\),?\n/U', $row['Create Table'], $matches, PREG_SET_ORDER);
  5. 				if (preg_match('/^\s*' . preg_quote($column, '/') . '\s+in\s+\((.*?)\)\s*$/i', $row['check_constraint'], $match)) {
  6. 					if (preg_match_all("/(?<!')'((''|[^']+)*)'/", $match[1], $matches, PREG_PATTERN_ORDER)) {
  7. 		
  8. 		preg_match_all('#(?<=,|\()\s*(?:`|"|\[)?(\w+)(?:`|"|\])?\s+([a-z]+)(?:\(\s*(\d+)(?:\s*,\s*(\d+))?\s*\))?(?:(\s+NOT\s+NULL)|(?:\s+NULL)|(?:\s+DEFAULT\s+([^, \']*|\'(?:\'\'|[^\']+)*\'))|(\s+UNIQUE)|(\s+PRIMARY\s+KEY(?:\s+AUTOINCREMENT)?)|(\s+CHECK\s*\(\w+\s+IN\s+\(\s*(?:(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\s*,\s*)*\s*(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\)\)))*(\s+REFERENCES\s+["`\[]?\w+["`\]]?\s*\(\s*["`\[]?\w+["`\]]?\s*\)\s*(?:\s+(?:ON\s+DELETE|ON\s+UPDATE)\s+(?:CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT))*(?:\s+(?:DEFERRABLE|NOT\s+DEFERRABLE))?)?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  9. 			// Get column level key definitions
  10. 			preg_match_all('#(?<=,|\()\s*["`\[]?(\w+)["`\]]?\s+(?:[a-z]+)(?:\((?:\d+)\))?(?:(?:\s+NOT\s+NULL)|(?:\s+DEFAULT\s+(?:[^, \']*|\'(?:\'\'|[^\']+)*\'))|(\s+UNIQUE)|(\s+PRIMARY\s+KEY(?:\s+AUTOINCREMENT)?)|(?:\s+CHECK\s*\(\w+\s+IN\s+\(\s*(?:(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\s*,\s*)*\s*(?:[^, \']+|\'(?:\'\'|[^\']+)*\')\)\)))*(\s+REFERENCES\s+["`\[]?(\w+)["`\]]?\s*\(\s*["`\[]?(\w+)["`\]]?\s*\)\s*(?:(?:\s+(?:ON\s+DELETE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT)))|(?:\s+(?:ON\s+UPDATE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT))))*(?:\s+(?:DEFERRABLE|NOT\s+DEFERRABLE))?)?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  11. 			// Get table level primary key definitions
  12. 			preg_match_all('#(?<=,|\()\s*PRIMARY\s+KEY\s*\(\s*((?:\s*["`\[]?\w+["`\]]?\s*,\s*)*["`\[]?\w+["`\]]?)\s*\)\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  13. 			// Get table level foreign key definitions
  14. 			preg_match_all('#(?<=,|\()\s*FOREIGN\s+KEY\s*(?:["`\[]?(\w+)["`\]]?|\(\s*["`\[]?(\w+)["`\]]?\s*\))\s+REFERENCES\s+["`\[]?(\w+)["`\]]?\s*\(\s*["`\[]?(\w+)["`\]]?\s*\)\s*(?:\s+(?:ON\s+DELETE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT)))?(?:\s+(?:ON\s+UPDATE\s+(CASCADE|NO\s+ACTION|RESTRICT|SET\s+NULL|SET\s+DEFAULT)))?(?:\s+(?:DEFERRABLE|NOT\s+DEFERRABLE))?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);
  15. 			// Get table level unique key definitions
  16. 			preg_match_all('#(?<=,|\()\s*UNIQUE\s*\(\s*((?:\s*["`\[]?\w+["`\]]?\s*,\s*)*["`\[]?\w+["`\]]?)\s*\)\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);





  1. column_foreign_keys($N){global$b;$F=array();foreach($b->foreignKeys($N)as$n){foreach($n["source"]as$W){$F[$W][]=$n;}}return$F;}function
  2. enum_input($S,$za,$l,$X,$Db=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$l["length"],$ad);$F=(isset($Db)?"<label><input type='$S'$za value='$Db'".((is_array($X)?in_array($Db,$X):$X===0)?" checked":"")."><i>".lang(4)."</i></label>":"");foreach($ad[1]as$p=>$W){$W=stripcslashes(str_replace("''","'",$W));$La=(is_int($X)?$X==$p+1:(is_array($X)?in_array($p+1,$X):$X===$W));$F.=" <label><input type='$S'$za value='".($p+1)."'".($La?' checked':'').'>'.h($b->editVal($W,$l)).'</label>';}return$F;}function
  3. switch_lang(){global$ca,$Nc;echo"<form action=''>\n<div id='lang'>";hidden_fields($_GET,array('lang'));echo
  4. lang(7).": ".html_select("lang",$Nc,$ca,"var loc = location.search.replace(/[?&]lang=[^&]*/, ''); location.search = loc + (loc ? '&' : '') + 'lang=' + this.value;")," <input type='submit' value='".lang(8)."' class='hidden'>\n","</div>\n</form>\n";}if(isset($_GET["lang"])){$_COOKIE["adminer_lang"]=$_GET["lang"];$_SESSION["lang"]=$_GET["lang"];}$ca="en";if(isset($Nc[$_COOKIE["adminer_lang"]])){cookie("adminer_lang",$_COOKIE["adminer_lang"]);$ca=$_COOKIE["adminer_lang"];}elseif(isset($Nc[$_SESSION["lang"]])){$ca=$_SESSION["lang"];}else{$pa=array();preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~',str_replace("_","-",strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"])),$ad,PREG_SET_ORDER);foreach($ad
  5. indexes($N,$h=null){$F=array();foreach(get_rows("SHOW INDEX FROM ".table($N),$h)as$G){$F[$G["Key_name"]]["type"]=($G["Key_name"]=="PRIMARY"?"PRIMARY":($G["Index_type"]=="FULLTEXT"?"FULLTEXT":($G["Non_unique"]?"INDEX":"UNIQUE")));$F[$G["Key_name"]]["columns"][]=$G["Column_name"];$F[$G["Key_name"]]["lengths"][]=$G["Sub_part"];}return$F;}function
  6. foreign_keys($N){global$g,$Bd;static$ce='`(?:[^`]|``)+`';$F=array();$db=$g->result("SHOW CREATE TABLE ".table($N),1);if($db){preg_match_all("~CONSTRAINT ($ce) FOREIGN KEY \\(((?:$ce,? ?)+)\\) REFERENCES ($ce)(?:\\.($ce))? \\(((?:$ce,? ?)+)\\)(?: ON DELETE ($Bd))?(?: ON UPDATE ($Bd))?~",$db,$ad,PREG_SET_ORDER);foreach($ad
  7. as$z){preg_match_all("~$ce~",$z[2],$We);preg_match_all("~$ce~",$z[5],$tf);$F[idf_unescape($z[1])]=array("db"=>idf_unescape($z[4]!=""?$z[3]:$z[4]),"table"=>idf_unescape($z[4]!=""?$z[4]:$z[3]),"source"=>array_map('idf_unescape',$We[0]),"target"=>array_map('idf_unescape',$tf[0]),"on_delete"=>$z[6],"on_update"=>$z[7],);}}return$F;}function
  8. view($_){global$g;return
  9. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  10. routine($_,$S){global$g,$Hb,$Cc,$T;$va=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$Kf="((".implode("|",array_merge(array_keys($T),$va)).")(?:\\s*\\(((?:[^'\")]*|$Hb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$ce="\\s*(".($S=="FUNCTION"?"":$Cc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$Kf";$cb=$g->result("SHOW CREATE $S ".idf_escape($_),2);preg_match("~\\(((?:$ce\\s*,?)*)\\)".($S=="FUNCTION"?"\\s*RETURNS\\s+$Kf":"")."\\s*(.*)~is",$cb,$z);$m=array();preg_match_all("~$ce\\s*,?~is",$z[1],$ad,PREG_SET_ORDER);foreach($ad
  11. <td><input name="',$v,'[length]" value="',h($l["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">',"<select name='$v"."[collation]'".(ereg('(char|text|enum|set)$',$l["type"])?"":" class='hidden'").'><option value="">('.lang(86).')'.optionlist($Qa,$l["collation"]).'</select>',($Rf?"<select name='$v"."[unsigned]'".(!$l["type"]||ereg('(int|float|double|decimal)$',$l["type"])?"":" class='hidden'").'><option>'.optionlist($Rf,$l["unsigned"]).'</select>':''),($fc?"<select name='$v"."[on_delete]'".(ereg("`",$l["type"])?"":" class='hidden'")."><option value=''>(".lang(87).")".optionlist(explode("|",$Bd),$l["on_delete"])."</select> ":" ");}function
  12. process_length($w){global$Hb;return(preg_match("~^\\s*(?:$Hb)(?:\\s*,\\s*(?:$Hb))*\\s*\$~",$w)&&preg_match_all("~$Hb~",$w,$ad)?implode(",",$ad[0]):preg_replace('~[^0-9,+-]~','',$w));}function
  13. as$_=>$n){echo"<tr title='".h($_)."'>","<th><i>".implode("</i>, <i>",array_map('h',$n["source"]))."</i>","<td><a href='".h($n["db"]!=""?preg_replace('~db=[^&]*~',"db=".urlencode($n["db"]),ME):($n["ns"]!=""?preg_replace('~ns=[^&]*~',"ns=".urlencode($n["ns"]),ME):ME))."table=".urlencode($n["table"])."'>".($n["db"]!=""?"<b>".h($n["db"])."</b>.":"").($n["ns"]!=""?"<b>".h($n["ns"])."</b>.":"").h($n["table"])."</a>","(<i>".implode("</i>, <i>",array_map('h',$n["target"]))."</i>)","<td>".nbsp($n["on_delete"])."\n","<td>".nbsp($n["on_update"])."\n";if($u!="sqlite"){echo'<td><a href="'.h(ME.'foreign='.urlencode($a).'&name='.urlencode($_)).'">'.lang(108).'</a>';}}echo"</table>\n";}if($u!="sqlite"){echo'<p><a href="'.h(ME).'foreign='.urlencode($a).'">'.lang(109)."</a>\n";}}if(support("trigger")){echo"<h3>".lang(110)."</h3>\n";$If=triggers($a);if($If){echo"<table cellspacing='0'>\n";foreach($If
  14. as$v=>$W){echo"<tr valign='top'><td>$W[0]<td>$W[1]<th>".h($v)."<td><a href='".h(ME.'trigger='.urlencode($a).'&name='.urlencode($v))."'>".lang(108)."</a>\n";}echo"</table>\n";}echo'<p><a href="'.h(ME).'trigger='.urlencode($a).'">'.lang(111)."</a>\n";}}}}elseif(isset($_GET["schema"])){page_header(lang(49),"",array(),DB.($_GET["ns"]?".$_GET[ns]":""));$of=array();$pf=array();$_="adminer_schema";$ea=($_GET["schema"]?$_GET["schema"]:$_COOKIE[($_COOKIE["$_-".DB]?"$_-".DB:$_)]);preg_match_all('~([^:]+):([-0-9.]+)x([-0-9.]+)(_|$)~',$ea,$ad,PREG_SET_ORDER);foreach($ad
  15. </form>
  16. ';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$pe=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$G){foreach(explode(",",($G["Privilege"]=="Grant option"?"":$G["Context"]))as$Za){$pe[$Za][$G["Privilege"]]=$G["Comment"];}}$pe["Server Admin"]+=$pe["File access on server"];$pe["Databases"]["Create routine"]=$pe["Procedures"]["Create routine"];unset($pe["Procedures"]["Create routine"]);$pe["Columns"]=array();foreach(array("Select","Insert","Update","References")as$W){$pe["Columns"][$W]=$pe["Tables"][$W];}unset($pe["Server Admin"]["Usage"]);foreach($pe["Tables"]as$v=>$W){unset($pe["Databases"][$v]);}$td=array();if($_POST){foreach($_POST["objects"]as$v=>$W){$td[$W]=(array)$td[$W]+(array)$_POST["grants"][$v];}}$nc=array();$zd="";if(isset($_GET["host"])&&($E=$g->query("SHOW GRANTS FOR ".q($ha)."@".q($_GET["host"])))){while($G=$E->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$G[0],$z)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$z[1],$ad,PREG_SET_ORDER)){foreach($ad



Back to Top