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








  1. 		
  2. 		preg_match_all('#(?<=,|\()\s+(?:"|\`)(\w+)(?:"|\`)\s+(?:([a-z]+)(?:\(([^)]+)\))?( unsigned)?(?: zerofill)?)(?: character set [^ ]+)?(?: collate [^ ]+)?(?: NULL)?( NOT NULL)?(?: DEFAULT ((?:[^, \'\n]*|\'(?:\'\'|[^\']+)*\')))?( auto_increment)?( COMMENT \'(?:\'\'|[^\']+)*\')?( ON UPDATE CURRENT_TIMESTAMP)?\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_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. 				} elseif (preg_match('/^\s*"?' . preg_quote($column, '/') . '"?\s*=\s*\'((\'\'|[^\']+)*)\'(\s+OR\s+"?' . preg_quote($column, '/') . '"?\s*=\s*\'((\'\'|[^\']+)*)\')*\s*$/i', $row['check_constraint'], $match)) {
  8. 					if (preg_match_all("/(?<!')'((''|[^']+)*)'/", $row['check_constraint'], $matches, PREG_PATTERN_ORDER)) {
  9. 				if (preg_match('/CHECK[\( "]+' . $row['column'] . '[a-z\) ":]+\s+=\s+/i', $row['constraint'])) {
  10. 					if (preg_match_all("/(?!').'((''|[^']+)*)'/", $row['constraint'], $matches, PREG_PATTERN_ORDER)) {
  11. 		
  12. 		preg_match_all('#(?<=,|\(|\*/|\n)\s*(?:`|"|\[)?(\w+)(?:`|"|\])?\s+([a-z]+)(?:\(\s*(\d+)(?:\s*,\s*(\d+))?\s*\))?(?:(\s+NOT\s+NULL)|(?:\s+NULL)|(?:\s+DEFAULT\s+([^, \'\n]*|\'(?:\'\'|[^\']+)*\'))|(\s+UNIQUE)|(\s+PRIMARY\s+KEY(?:\s+AUTOINCREMENT)?)|(\s+CHECK\s*\("?\w+"?\s+IN\s+\(\s*(?:(?:[^, \'\n]+|\'(?:\'\'|[^\']+)*\')\s*,\s*)*\s*(?:[^, \'\n]+|\'(?:\'\'|[^\']+)*\')\)\)))*(\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))?)?([ \t]*(?:/\*(?:(?!\*/).)*\*/))?\s*(?:,([ \t]*--[^\n]*\n)?|(--[^\n]*\n)?\s*(?:/\*(?:(?!\*/).)*\*/)?\s*(?=\)))#msi', $create_sql, $matches, PREG_SET_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 primary key definitions
  16. 			preg_match_all('#(?<=,|\()\s*(?:CONSTRAINT\s+["`\[]?\w+["`\]]?\s+)?PRIMARY\s+KEY\s*\(\s*((?:\s*["`\[]?\w+["`\]]?\s*,\s*)*["`\[]?\w+["`\]]?)\s*\)\s*(?:,|\s*(?=\)))#mi', $create_sql, $matches, PREG_SET_ORDER);


  1. column_foreign_keys($O){global$b;$H=array();foreach($b->foreignKeys($O)as$n){foreach($n["source"]as$W)$H[$W][]=$n;}return$H;}function
  2. enum_input($S,$ya,$l,$X,$Rb=null){global$b;preg_match_all("~'((?:[^']|'')*)'~",$l["length"],$_d);$H=($Rb!==null?"<label><input type='$S'$ya value='$Rb'".((is_array($X)?in_array($Rb,$X):$X===0)?" checked":"")."><i>".'empty'."</i></label>":"");foreach($_d[1]as$p=>$W){$W=stripcslashes(str_replace("''","'",$W));$Oa=(is_int($X)?$X==$p+1:(is_array($X)?in_array($p+1,$X):$X===$W));$H.=" <label><input type='$S'$ya value='".($p+1)."'".($Oa?' checked':'').'>'.h($b->editVal($W,$l)).'</label>';}return$H;}function
  3. nbsp($Cc[""])."<td>".$b->editInput($_GET["edit"],$l,$ya,$X);else{$rc=0;foreach($Cc
  4. as$v=>$W){if($v===""||!$W)break;$rc++;}$fe=($rc?" onchange=\"var f = this.form['function[".h(js_escape(bracket_escape($l["field"])))."]']; if ($rc > f.selectedIndex) f.selectedIndex = $rc;\"":"");$ya.=$fe;echo(count($Cc)>1?html_select("function[$A]",$Cc,$o===null||in_array($o,$Cc)||isset($Cc[$o])?$o:"","functionChange(this);"):nbsp(reset($Cc))).'<td>';$Yc=$b->editInput($_GET["edit"],$l,$ya,$X);if($Yc!="")echo$Yc;elseif($l["type"]=="set"){preg_match_all("~'((?:[^']|'')*)'~",$l["length"],$_d);foreach($_d[1]as$p=>$W){$W=stripcslashes(str_replace("''","'",$W));$Oa=(is_int($X)?($X>>$p)&1:in_array($W,explode(",",$X),true));echo" <label><input type='checkbox' name='fields[$A][$p]' value='".(1<<$p)."'".($Oa?' checked':'')."$fe>".h($b->editVal($W,$l)).'</label>';}}elseif(ereg('blob|bytea|raw|file',$l["type"])&&ini_bool("file_uploads"))echo"<input type='file' name='fields-$A'$fe>";elseif(($gg=ereg('text|lob',$l["type"]))||ereg("\n",$X)){if($gg&&$u!="sqlite")$ya.=" cols='50' rows='12'";else{$J=min(12,substr_count($X,"\n")+1);$ya.=" cols='30' rows='$J'".($J==1?" style='height: 1.2em;'":"");}echo"<textarea$ya>".h($X).'</textarea>';}else{$Gd=(!ereg('int',$l["type"])&&preg_match('~^(\\d+)(,(\\d+))?$~',$l["length"],$z)?((ereg("binary",$l["type"])?2:1)*$z[1]+($z[3]?1:0)+($z[2]&&!$l["unsigned"]?1:0)):($T[$l["type"]]?$T[$l["type"]]+($l["unsigned"]?0:1):0));if($u=='sql'&&$g->server_info>=5.6&&ereg('time',$l["type"]))$Gd+=7;echo"<input".(ereg('int',$l["type"])?" type='number'":"")." value='".h($X)."'".($Gd?" maxlength='$Gd'":"").(ereg('char|binary',$l["type"])&&$Gd>20?" size='40'":"")."$ya>";}}}function
  5. fields($O){$H=array();foreach(get_rows("PRAGMA table_info(".table($O).")")as$I){$S=strtolower($I["type"]);$vb=$I["dflt_value"];$H[$I["name"]]=array("field"=>$I["name"],"type"=>(eregi("int",$S)?"integer":(eregi("char|clob|text",$S)?"text":(eregi("blob",$S)?"blob":(eregi("real|floa|doub",$S)?"real":"numeric")))),"full_type"=>$S,"default"=>(ereg("'(.*)'",$vb,$z)?str_replace("''","'",$z[1]):($vb=="NULL"?null:$vb)),"null"=>!$I["notnull"],"auto_increment"=>eregi('^integer$',$S)&&$I["pk"],"privileges"=>array("select"=>1,"insert"=>1,"update"=>1),"primary"=>$I["pk"],);}return$H;}function
  6. indexes($O,$h=null){$H=array();$Ne=array();foreach(fields($O)as$l){if($l["primary"])$Ne[]=$l["field"];}if($Ne)$H[""]=array("type"=>"PRIMARY","columns"=>$Ne,"lengths"=>array());$If=get_key_vals("SELECT name, sql FROM sqlite_master WHERE type = 'index' AND tbl_name = ".q($O));foreach(get_rows("PRAGMA index_list(".table($O).")")as$I){$A=$I["name"];if(!ereg("^sqlite_",$A)){$H[$A]["type"]=($I["unique"]?"UNIQUE":"INDEX");$H[$A]["lengths"]=array();foreach(get_rows("PRAGMA index_info(".idf_escape($A).")")as$sf)$H[$A]["columns"][]=$sf["name"];$H[$A]["descs"]=array();if(eregi('^CREATE( UNIQUE)? INDEX '.quotemeta(idf_escape($A).' ON '.idf_escape($O)).' \((.*)\)$',$If[$A],$gf)){preg_match_all('/("[^"]*+")+( DESC)?/',$gf[2],$_d);foreach($_d[2]as$W)$H[$A]["descs"][]=($W?'1':null);}}}return$H;}function
  7. indexes($O,$h=null){$H=array();foreach(get_rows("SHOW INDEX FROM ".table($O),$h)as$I){$H[$I["Key_name"]]["type"]=($I["Key_name"]=="PRIMARY"?"PRIMARY":($I["Index_type"]=="FULLTEXT"?"FULLTEXT":($I["Non_unique"]?"INDEX":"UNIQUE")));$H[$I["Key_name"]]["columns"][]=$I["Column_name"];$H[$I["Key_name"]]["lengths"][]=$I["Sub_part"];$H[$I["Key_name"]]["descs"][]=null;}return$H;}function
  8. foreign_keys($O){global$g,$ee;static$Ee='`(?:[^`]|``)+`';$H=array();$kb=$g->result("SHOW CREATE TABLE ".table($O),1);if($kb){preg_match_all("~CONSTRAINT ($Ee) FOREIGN KEY \\(((?:$Ee,? ?)+)\\) REFERENCES ($Ee)(?:\\.($Ee))? \\(((?:$Ee,? ?)+)\\)(?: ON DELETE ($ee))?(?: ON UPDATE ($ee))?~",$kb,$_d,PREG_SET_ORDER);foreach($_d
  9. as$z){preg_match_all("~$Ee~",$z[2],$Ff);preg_match_all("~$Ee~",$z[5],$cg);$H[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',$Ff[0]),"target"=>array_map('idf_unescape',$cg[0]),"on_delete"=>($z[6]?$z[6]:"RESTRICT"),"on_update"=>($z[7]?$z[7]:"RESTRICT"),);}}return$H;}function
  10. view($A){global$g;return
  11. array("Timing"=>array("BEFORE","AFTER"),"Type"=>array("FOR EACH ROW"),);}function
  12. routine($A,$S){global$g,$Vb,$Xc,$T;$ua=array("bool","boolean","integer","double precision","real","dec","numeric","fixed","national char","national varchar");$Ag="((".implode("|",array_merge(array_keys($T),$ua)).")\\b(?:\\s*\\(((?:[^'\")]*|$Vb)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?)(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?";$Ee="\\s*(".($S=="FUNCTION"?"":$Xc).")?\\s*(?:`((?:[^`]|``)*)`\\s*|\\b(\\S+)\\s+)$Ag";$jb=$g->result("SHOW CREATE $S ".idf_escape($A),2);preg_match("~\\(((?:$Ee\\s*,?)*)\\)\\s*".($S=="FUNCTION"?"RETURNS\\s+$Ag\\s+":"")."(.*)~is",$jb,$z);$m=array();preg_match_all("~$Ee\\s*,?~is",$z[1],$_d,PREG_SET_ORDER);foreach($_d
  13. <td><input name="',$v,'[length]" value="',h($l["length"]),'" size="3" onfocus="editingLengthFocus(this);"><td class="options">';echo"<select name='$v"."[collation]'".(ereg('(char|text|enum|set)$',$l["type"])?"":" class='hidden'").'><option value="">('.'collation'.')'.optionlist($Wa,$l["collation"]).'</select>',($Hg?"<select name='$v"."[unsigned]'".(!$l["type"]||ereg('((^|[^o])int|float|double|decimal)$',$l["type"])?"":" class='hidden'").'><option>'.optionlist($Hg,$l["unsigned"]).'</select>':''),(isset($l['on_update'])?"<select name='$v"."[on_update]'".($l["type"]=="timestamp"?"":" class='hidden'").'>'.optionlist(array(""=>"(".'ON UPDATE'.")","CURRENT_TIMESTAMP"),$l["on_update"]).'</select>':''),($vc?"<select name='$v"."[on_delete]'".(ereg("`",$l["type"])?"":" class='hidden'")."><option value=''>(".'ON DELETE'.")".optionlist(explode("|",$ee),$l["on_delete"])."</select> ":" ");}function
  14. process_length($td){global$Vb;return(preg_match("~^\\s*(?:$Vb)(?:\\s*,\\s*(?:$Vb))*\\s*\$~",$td)&&preg_match_all("~$Vb~",$td,$_d)?implode(",",$_d[0]):preg_replace('~[^0-9,+-]~','',$td));}function
  15. </form>
  16. ';}elseif(isset($_GET["user"])){$ha=$_GET["user"];$Se=array(""=>array("All privileges"=>""));foreach(get_rows("SHOW PRIVILEGES")as$I){foreach(explode(",",($I["Privilege"]=="Grant option"?"":$I["Context"]))as$gb)$Se[$gb][$I["Privilege"]]=$I["Comment"];}$Se["Server Admin"]+=$Se["File access on server"];$Se["Databases"]["Create routine"]=$Se["Procedures"]["Create routine"];unset($Se["Procedures"]["Create routine"]);$Se["Columns"]=array();foreach(array("Select","Insert","Update","References")as$W)$Se["Columns"][$W]=$Se["Tables"][$W];unset($Se["Server Admin"]["Usage"]);foreach($Se["Tables"]as$v=>$W)unset($Se["Databases"][$v]);$Sd=array();if($_POST){foreach($_POST["objects"]as$v=>$W)$Sd[$W]=(array)$Sd[$W]+(array)$_POST["grants"][$v];}$Ec=array();$be="";if(isset($_GET["host"])&&($G=$g->query("SHOW GRANTS FOR ".q($ha)."@".q($_GET["host"])))){while($I=$G->fetch_row()){if(preg_match('~GRANT (.*) ON (.*) TO ~',$I[0],$z)&&preg_match_all('~ *([^(,]*[^ ,(])( *\\([^)]+\\))?~',$z[1],$_d,PREG_SET_ORDER)){foreach($_d










Back to Top