} else if (starts_with($cls, 'pldbtable')) {
$cls = 'pldbtableentry';
}
- $basepath = dirname(dirname(dirname(__FILE__)));
+ $corebasepath = dirname(dirname(__FILE__));
+ $basepath = dirname($corebasepath);
+ $corebasename = basename($corebasepath);
- array_unshift($pathes, 'core/classes', 'classes');
+ array_unshift($pathes, $corebasename . '/classes', 'classes');
foreach ($pathes as $path) {
if (file_exists("$basepath/$path/$cls.php")) {
if (include_once "$basepath/$path/$cls.php") {
return false;
}
pl_autoload('Env');
+pl_autoload('PlBacktrace');
function pl_core_include($file)
{
$type = isset($errortype[$errno]) ? $errortype[$errno] : $errno;
$error = strpos($type, 'Warning') !== false || strpos($type, 'Error') !==false;
- pl_autoload('PlBacktrace');
if (!isset(PlBacktrace::$bt['PHP Errors'])) {
new PlBacktrace('PHP Errors');
}
* cache duration defaults to the global static_cache_duration. No encoding is
* applied by default.
*/
-function pl_cached_content_headers($content_type, $encoding = null, $cache_duration = -1)
+function pl_cached_content_headers($content_type, $encoding = null, $cache_duration = -1, $filename = null)
{
global $globals;
$cache_duration = ($cache_duration < 0 ? $globals->static_cache_duration : $cache_duration);
header("Expires: " . gmdate('D, d M Y H:i:s', time() + $cache_duration) . " GMT");
header("Pragma: ");
pl_content_headers($content_type, $encoding);
+ if (!is_null($filename)) {
+ header('Content-Disposition: attachment; filename=' . $filename);
+ }
}
/**
pl_cached_content_headers($content_type, $encoding, $globals->dynamic_cache_duration);
}
+function pl_var_dump()
+{
+ echo '<pre>';
+ $array = func_get_args();
+ call_user_func_array('var_dump', $array);
+ echo '</pre>';
+}
+
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>