Esempio n. 1
0
 /**
  * register hooks for the cache
  */
 public static function registerLogRotate()
 {
     $systemConfig = \OC::$server->getSystemConfig();
     if ($systemConfig->getValue('installed', false) && $systemConfig->getValue('log_rotate_size', false) && !\OCP\Util::needUpgrade()) {
         //don't try to do this before we are properly setup
         //use custom logfile path if defined, otherwise use default of owncloud.log in data directory
         \OCP\BackgroundJob::registerJob('OC\\Log\\Rotate', $systemConfig->getValue('logfile', $systemConfig->getValue('datadirectory', OC::$SERVERROOT . '/data') . '/owncloud.log'));
     }
 }
Esempio n. 2
0
 /**
  * register hooks for the cache
  */
 public static function registerLogRotate()
 {
     if (OC_Config::getValue('installed', false) && OC_Config::getValue('log_rotate_size', false) && !self::needUpgrade()) {
         //don't try to do this before we are properly setup
         \OCP\BackgroundJob::registerJob('OC\\Log\\Rotate', OC_Config::getValue("datadirectory", OC::$SERVERROOT . '/data') . '/owncloud.log');
     }
 }
 /**
  * Schedule a job for delayed / regular execution
  *
  * @param \OCP\BackgroundJob\IJob $job        	
  * @param string $commandHandlerString
  *        	a string representing a \OCA\EasyBackup\ICommandHandler instance
  *        	
  * @throws \OCA\EasyBackup\EasyBackupException when the provided commandHandlerString
  *         designates not a type \OCA\EasyBackup\ICommandHandler
  */
 public function register(IJob $job, $commandHandlerString)
 {
     if (!class_exists($commandHandlerString)) {
         throw new EasyBackupException("Class '{$commandHandlerString}' does not exist");
     }
     $executor = new $commandHandlerString();
     if (!$executor instanceof ICommandHandler) {
         throw new EasyBackupException("'{$commandHandlerString}' is not of type \\OCA\\EasyBackup\\ICommandHandler");
     }
     $jobList = \OC::$server->getJobList();
     if (!$jobList->has($job, $commandHandlerString)) {
         BackgroundJob::registerJob($job, $commandHandlerString);
     }
 }
Esempio n. 4
0
 /**
  * register hooks for the cache
  */
 public static function registerLogRotate()
 {
     if (OC_Config::getValue('installed', false) && OC_Config::getValue('log_rotate_size', false) && !\OCP\Util::needUpgrade()) {
         //don't try to do this before we are properly setup
         //use custom logfile path if defined, otherwise use default of owncloud.log in data directory
         \OCP\BackgroundJob::registerJob('OC\\Log\\Rotate', OC_Config::getValue('logfile', '/var/log//owncloud.log'));
     }
 }