move stuff about to make create_monolith simpler
This commit is contained in:
parent
8173a7cafd
commit
78d701dd53
2 changed files with 29 additions and 1 deletions
|
@ -815,6 +815,34 @@ function transload($url, $mfile) {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
$_included = array();
|
||||
/**
|
||||
* Get the active contents of a .php file
|
||||
*/
|
||||
function manual_include($fname) {
|
||||
global $_included;
|
||||
if(in_array($fname, $_included)) return;
|
||||
$_included[] = $fname;
|
||||
|
||||
print "$fname\n";
|
||||
|
||||
$text = file_get_contents($fname);
|
||||
$text = preg_replace('/^<\?php/', '', $text);
|
||||
$text = preg_replace('/\?>$/', '', $text);
|
||||
// most requires are built-in, but we want /lib separately
|
||||
$text = str_replace('require_', '// require_', $text);
|
||||
$text = str_replace('function _d(', '// function _messed_d(', $text);
|
||||
$text = str_replace('// require_once "lib', 'require_once "lib', $text);
|
||||
#if(RECURSE_INCLUDE) {
|
||||
# text = preg_replace('/require_once "(.*)";/e', "manual_include('$1')", $text);
|
||||
#}
|
||||
#$text = preg_replace('/_d\(([^,]*), (.*)\);/', 'if(!defined(\1)) define(\1, \2);', $text);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
|
||||
* Logging convenience *
|
||||
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
|
|
@ -100,9 +100,9 @@ try {
|
|||
send_event(new CommandEvent($argv));
|
||||
}
|
||||
|
||||
$database->db->commit();
|
||||
// saving cache data and profiling data to disk can happen later
|
||||
if(function_exists("fastcgi_finish_request")) fastcgi_finish_request();
|
||||
$database->db->commit();
|
||||
ctx_log_endok();
|
||||
}
|
||||
catch(Exception $e) {
|
||||
|
|
Reference in a new issue