Decomposition

New functions

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@2 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2007-07-02 05:51:26 +00:00
parent b4a429709f
commit 667bfec47d
14 changed files with 709 additions and 456 deletions

20
_compile.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
function put_file($match) {
//! exit on error with require, _once
$return = file_get_contents($match[4]);
$return = preg_replace("~\\?>?\n?\$~", '', $return);
if (substr_count($return, "<?php") - substr_count($return, "?>") <= 0 && !$match[5]) {
$return .= "<?php\n";
}
$return = preg_replace('~^<\\?php\\s+~', '', $return, 1, $count);
if (!$count && !$match[1]) {
$return = "?>\n$return";
}
return $return;
}
$file = file_get_contents("index.php");
$file = preg_replace_callback('~(<\\?php\\s*)?(include|require)(_once)? "([^"]*)";(\\s*\\?>)?~', 'put_file', $file);
//! remove spaces and comments
file_put_contents("phpMinAdmin.php", $file);
echo "phpMinAdmin.php created.\n";