diff options
author | Georg Ehrke <developer@georgehrke.com> | 2013-08-29 10:50:55 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2013-08-29 10:50:55 +0200 |
commit | b7758d0f8d52b2f9653cfee549558327c00c8e01 (patch) | |
tree | 309fb713ed25f35f746c59c668521bf9023bc331 /lib/base.php | |
parent | 70b6e2161ec654f7049027bf6dc5072c1eda4d5e (diff) | |
parent | ea6e74ca9546ca95b3a6372c6106cd8ab2ea2ee9 (diff) | |
download | nextcloud-server-b7758d0f8d52b2f9653cfee549558327c00c8e01.tar.gz nextcloud-server-b7758d0f8d52b2f9653cfee549558327c00c8e01.zip |
Merge master into oc_preview
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/lib/base.php b/lib/base.php index 5043c491475..488634f86f3 100644 --- a/lib/base.php +++ b/lib/base.php @@ -257,8 +257,8 @@ class OC { OC_Util::addScript("compatibility"); OC_Util::addScript("jquery.ocdialog"); OC_Util::addScript("oc-dialogs"); - OC_Util::addScript("octemplate"); OC_Util::addScript("js"); + OC_Util::addScript("octemplate"); OC_Util::addScript("eventsource"); OC_Util::addScript("config"); //OC_Util::addScript( "multiselect" ); @@ -492,6 +492,7 @@ class OC { self::registerFilesystemHooks(); self::registerPreviewHooks(); self::registerShareHooks(); + self::registerLogRotate(); //make sure temporary files are cleaned up register_shutdown_function(array('OC_Helper', 'cleanTmp')); @@ -554,6 +555,21 @@ class OC { } /** + * register hooks for the cache + */ + public static function registerLogRotate() { + if (OC_Config::getValue('installed', false) && OC_Config::getValue('log_rotate_size', false)) { + //don't try to do this before we are properly setup + // register cache cleanup jobs + try { //if this is executed before the upgrade to the new backgroundjob system is completed it will throw an exception + \OCP\BackgroundJob::registerJob('OC\Log\Rotate', OC_Config::getValue("datadirectory", OC::$SERVERROOT.'/data').'/owncloud.log'); + } catch (Exception $e) { + + } + } + } + + /** * register hooks for the filesystem */ public static function registerFilesystemHooks() { @@ -678,12 +694,15 @@ class OC { $app = $param['app']; $file = $param['file']; $app_path = OC_App::getAppPath($app); - $file = $app_path . '/' . $file; - unset($app, $app_path); - if (file_exists($file)) { - require_once $file; - return true; + if (OC_App::isEnabled($app) && $app_path !== false) { + $file = $app_path . '/' . $file; + unset($app, $app_path); + if (file_exists($file)) { + require_once $file; + return true; + } } + header('HTTP/1.0 404 Not Found'); return false; } |