From bbf8bb0bb3f33c92933dfd499b571f56edda4a59 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Wed, 12 Sep 2012 22:30:04 +0300 Subject: Log PHP errors to the OC log --- lib/log.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/log.php') diff --git a/lib/log.php b/lib/log.php index 8bb2839be66..9c754cf60ce 100644 --- a/lib/log.php +++ b/lib/log.php @@ -36,4 +36,21 @@ class OC_Log { $log_class=self::$class; $log_class::write($app, $message, $level); } + + //Fatal errors handler + public static function onShutdown(){ + $error = error_get_last(); + if($error) { + //ob_end_clean(); + self::write('PHP', $error['message'] . ' at ' . $error['file'] . '#' . $error['line'], self::FATAL); + } else { + return true; + } + } + + //Recoverable errors handler + public static function onError($number, $message, $file, $line){ + self::write('PHP', $message . ' at ' . $file . '#' . $line, self::WARN); + + } } -- cgit v1.2.3 From 2b6869bcea2b09357a81ddd299969c47e2b79ada Mon Sep 17 00:00:00 2001 From: VicDeo Date: Wed, 26 Sep 2012 14:38:06 +0300 Subject: Uncaught exception logging --- lib/base.php | 5 +++-- lib/log.php | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/log.php') diff --git a/lib/base.php b/lib/base.php index 4ff5a43bd24..b4b56267c56 100644 --- a/lib/base.php +++ b/lib/base.php @@ -317,8 +317,9 @@ class OC{ self::initPaths(); - register_shutdown_function(array('OC_Log', 'onShutdown')); - set_error_handler(array('OC_Log', 'onError' )); + register_shutdown_function(array('OC_Log', 'onShutdown')); + set_error_handler(array('OC_Log', 'onError')); + set_exception_handler(array('OC_Log', 'onException')); // set debug mode if an xdebug session is active if (!defined('DEBUG') || !DEBUG) { diff --git a/lib/log.php b/lib/log.php index 9c754cf60ce..17f781fa91c 100644 --- a/lib/log.php +++ b/lib/log.php @@ -47,6 +47,11 @@ class OC_Log { return true; } } + + // Uncaught exception handler + public static function onException($exception){ + self::write('PHP', $exception->getMessage() . ' at ' . $exception->getFile() . '#' . $exception->getLine(), self::FATAL); + } //Recoverable errors handler public static function onError($number, $message, $file, $line){ -- cgit v1.2.3 From a6e18e0b6d329b4dfe9b71c244c0a45ac073f8b8 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Sun, 28 Oct 2012 19:38:48 -0400 Subject: Check if error_report() is equal to 0, so suppressed errors aren't logged e.g. the htaccesstext.txt fopen failing --- lib/log.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/log.php') diff --git a/lib/log.php b/lib/log.php index 4bba62cf4b2..3fc1e3976a1 100644 --- a/lib/log.php +++ b/lib/log.php @@ -58,6 +58,9 @@ class OC_Log { //Recoverable errors handler public static function onError($number, $message, $file, $line){ + if (error_reporting() === 0) { + return; + } self::write('PHP', $message . ' at ' . $file . '#' . $line, self::WARN); } -- cgit v1.2.3 From f8d1d7787e1112842db81a629dfd84b586fbebda Mon Sep 17 00:00:00 2001 From: Felix Moeller Date: Sun, 4 Nov 2012 10:46:32 +0100 Subject: Checkstyle fixes for SpaceBeforeOpenBrace --- apps/files/ajax/move.php | 2 +- apps/files/ajax/upload.php | 2 +- apps/files/appinfo/update.php | 2 +- cron.php | 4 ++-- lib/backgroundjob.php | 2 +- lib/filecache.php | 2 +- lib/filecache/update.php | 4 ++-- lib/fileproxy/fileoperations.php | 2 +- lib/fileproxy/quota.php | 2 +- lib/filesystem.php | 4 ++-- lib/filesystemview.php | 14 +++++++------- lib/helper.php | 8 ++++---- lib/log.php | 6 +++--- lib/migrate.php | 2 +- lib/migration/content.php | 2 +- lib/router.php | 2 +- lib/setup.php | 2 +- lib/template.php | 4 ++-- tests/bootstrap.php | 10 +++++----- tests/lib/cache.php | 2 +- tests/lib/cache/apc.php | 4 ++-- tests/lib/cache/xcache.php | 2 +- tests/lib/template.php | 8 ++++---- 23 files changed, 46 insertions(+), 46 deletions(-) (limited to 'lib/log.php') diff --git a/apps/files/ajax/move.php b/apps/files/ajax/move.php index 0541bb16062..5612716b7e4 100644 --- a/apps/files/ajax/move.php +++ b/apps/files/ajax/move.php @@ -12,7 +12,7 @@ $file = stripslashes($_GET["file"]); $target = stripslashes(rawurldecode($_GET["target"])); -if(OC_Filesystem::file_exists($target . '/' . $file)){ +if(OC_Filesystem::file_exists($target . '/' . $file)) { OCP\JSON::error(array("data" => array( "message" => "Could not move $file - File with this name already exists" ))); exit; } diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index dc830570403..7a69154677f 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -38,7 +38,7 @@ $totalSize=0; foreach($files['size'] as $size) { $totalSize+=$size; } -if($totalSize>OC_Filesystem::free_space($dir)){ +if($totalSize>OC_Filesystem::free_space($dir)) { OCP\JSON::error(array("data" => array( "message" => "Not enough space available" ))); exit(); } diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index bcbbc6035fa..3c63ad3c7ce 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -5,7 +5,7 @@ $installedVersion=OCP\Config::getAppValue('files', 'installed_version'); if (version_compare($installedVersion, '1.1.6', '<')) { $query = OC_DB::prepare( "SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`" ); $result = $query->execute(); - while( $row = $result->fetchRow()){ + while( $row = $result->fetchRow()) { if ( $row["propertyname"][0] != '{' ) { $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?' ); $query->execute( array( '{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"] )); diff --git a/cron.php b/cron.php index fb76c2de428..cd2e155a494 100644 --- a/cron.php +++ b/cron.php @@ -30,7 +30,7 @@ class my_temporary_cron_class { // We use this function to handle (unexpected) shutdowns function handleUnexpectedShutdown() { // Delete lockfile - if( !my_temporary_cron_class::$keeplock && file_exists( my_temporary_cron_class::$lockfile )){ + if( !my_temporary_cron_class::$keeplock && file_exists( my_temporary_cron_class::$lockfile )) { unlink( my_temporary_cron_class::$lockfile ); } @@ -80,7 +80,7 @@ if( OC::$CLI ) { } // check if backgroundjobs is still running - if( file_exists( my_temporary_cron_class::$lockfile )){ + if( file_exists( my_temporary_cron_class::$lockfile )) { my_temporary_cron_class::$keeplock = true; my_temporary_cron_class::$sent = true; echo "Another instance of cron.php is still running!"; diff --git a/lib/backgroundjob.php b/lib/backgroundjob.php index 6415f5b84aa..f486519bf09 100644 --- a/lib/backgroundjob.php +++ b/lib/backgroundjob.php @@ -44,7 +44,7 @@ class OC_BackgroundJob{ * are "none", "ajax", "webcron", "cron" */ public static function setExecutionType( $type ) { - if( !in_array( $type, array('none', 'ajax', 'webcron', 'cron'))){ + if( !in_array( $type, array('none', 'ajax', 'webcron', 'cron'))) { return false; } return OC_Appconfig::setValue( 'core', 'backgroundjobs_mode', $type ); diff --git a/lib/filecache.php b/lib/filecache.php index d5f90d30233..782e742d244 100644 --- a/lib/filecache.php +++ b/lib/filecache.php @@ -500,7 +500,7 @@ class OC_FileCache{ * trigger an update for the cache by setting the mtimes to 0 * @param string $user (optional) */ - public static function triggerUpdate($user=''){ + public static function triggerUpdate($user='') { if($user) { $query=OC_DB::prepare('UPDATE `*PREFIX*fscache` SET `mtime`=0 WHERE `user`=? AND `mimetype`="httpd/unix-directory"'); $query->execute(array($user)); diff --git a/lib/filecache/update.php b/lib/filecache/update.php index ecfa8927441..ce395bf6eda 100644 --- a/lib/filecache/update.php +++ b/lib/filecache/update.php @@ -85,7 +85,7 @@ class OC_FileCache_Update{ $file=$path.'/'.$filename; $isDir=$view->is_dir($file); if(self::hasUpdated($file, $root, $isDir)) { - if($isDir){ + if($isDir) { self::updateFolder($file, $root); }elseif($root===false) {//filesystem hooks are only valid for the default root OC_Hook::emit('OC_Filesystem', 'post_write', array('path'=>$file)); @@ -174,7 +174,7 @@ class OC_FileCache_Update{ }else{ $size=OC_FileCache::scanFile($path, $root); } - if($path !== '' and $path !== '/'){ + if($path !== '' and $path !== '/') { OC_FileCache::increaseSize(dirname($path), $size-$cachedSize, $root); } } diff --git a/lib/fileproxy/fileoperations.php b/lib/fileproxy/fileoperations.php index 23fb63fcfb1..516629adaec 100644 --- a/lib/fileproxy/fileoperations.php +++ b/lib/fileproxy/fileoperations.php @@ -28,7 +28,7 @@ class OC_FileProxy_FileOperations extends OC_FileProxy{ static $rootView; public function premkdir($path) { - if(!self::$rootView){ + if(!self::$rootView) { self::$rootView = new OC_FilesystemView(''); } return !self::$rootView->file_exists($path); diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php index 54bda5d864e..05b617c8327 100644 --- a/lib/fileproxy/quota.php +++ b/lib/fileproxy/quota.php @@ -93,7 +93,7 @@ class OC_FileProxy_Quota extends OC_FileProxy{ } public function preCopy($path1, $path2) { - if(!self::$rootView){ + if(!self::$rootView) { self::$rootView = new OC_FilesystemView(''); } return (self::$rootView->filesize($path1)<$this->getFreeSpace($path2) or $this->getFreeSpace($path2)==0); diff --git a/lib/filesystem.php b/lib/filesystem.php index 852290e62ac..055ba66aae3 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -403,7 +403,7 @@ class OC_Filesystem{ if(strstr($path, '/../') || strrchr($path, '/') === '/..' ) { return false; } - if(self::isFileBlacklisted($path)){ + if(self::isFileBlacklisted($path)) { return false; } return true; @@ -425,7 +425,7 @@ class OC_Filesystem{ } } - static public function isFileBlacklisted($path){ + static public function isFileBlacklisted($path) { $blacklist = array('.htaccess'); $filename = strtolower(basename($path)); return in_array($filename, $blacklist); diff --git a/lib/filesystemview.php b/lib/filesystemview.php index 9a38601acfa..ecbdb63ec54 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -251,7 +251,7 @@ class OC_FilesystemView { return $this->basicOperation('filemtime', $path); } public function touch($path, $mtime=null) { - if(!is_null($mtime) and !is_numeric($mtime)){ + if(!is_null($mtime) and !is_numeric($mtime)) { $mtime = strtotime($mtime); } return $this->basicOperation('touch', $path, array('write'), $mtime); @@ -266,7 +266,7 @@ class OC_FilesystemView { $path = $this->getRelativePath($absolutePath); $exists = $this->file_exists($path); $run = true; - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { if(!$exists) { OC_Hook::emit( OC_Filesystem::CLASSNAME, @@ -294,7 +294,7 @@ class OC_FilesystemView { $count=OC_Helper::streamCopy($data, $target); fclose($target); fclose($data); - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { if(!$exists) { OC_Hook::emit( OC_Filesystem::CLASSNAME, @@ -337,7 +337,7 @@ class OC_FilesystemView { return false; } $run=true; - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_rename, array( @@ -362,7 +362,7 @@ class OC_FilesystemView { $storage1->unlink($this->getInternalPath($path1.$postFix1)); $result = $count>0; } - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_rename, @@ -389,7 +389,7 @@ class OC_FilesystemView { return false; } $run=true; - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_copy, @@ -433,7 +433,7 @@ class OC_FilesystemView { $target = $this->fopen($path2.$postFix2, 'w'); $result = OC_Helper::streamCopy($source, $target); } - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_copy, diff --git a/lib/helper.php b/lib/helper.php index 27e312eeb2b..ed459dab624 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -475,16 +475,16 @@ class OC_Helper { $dirs = explode(PATH_SEPARATOR, $path); // WARNING : We have to check if open_basedir is enabled : $obd = ini_get('open_basedir'); - if($obd != "none"){ + if($obd != "none") { $obd_values = explode(PATH_SEPARATOR, $obd); - if(count($obd_values) > 0 and $obd_values[0]){ + if(count($obd_values) > 0 and $obd_values[0]) { // open_basedir is in effect ! // We need to check if the program is in one of these dirs : $dirs = $obd_values; } } - foreach($dirs as $dir){ - foreach($exts as $ext){ + foreach($dirs as $dir) { + foreach($exts as $ext) { if($check_fn("$dir/$name".$ext)) return true; } diff --git a/lib/log.php b/lib/log.php index 3fc1e3976a1..b5e8e1b06a1 100644 --- a/lib/log.php +++ b/lib/log.php @@ -41,7 +41,7 @@ class OC_Log { } //Fatal errors handler - public static function onShutdown(){ + public static function onShutdown() { $error = error_get_last(); if($error) { //ob_end_clean(); @@ -52,12 +52,12 @@ class OC_Log { } // Uncaught exception handler - public static function onException($exception){ + public static function onException($exception) { self::write('PHP', $exception->getMessage() . ' at ' . $exception->getFile() . '#' . $exception->getLine(), self::FATAL); } //Recoverable errors handler - public static function onError($number, $message, $file, $line){ + public static function onError($number, $message, $file, $line) { if (error_reporting() === 0) { return; } diff --git a/lib/migrate.php b/lib/migrate.php index 409d77a1a96..e967ae06ecf 100644 --- a/lib/migrate.php +++ b/lib/migrate.php @@ -91,7 +91,7 @@ class OC_Migrate{ if( self::$exporttype == 'user' ) { // Check user exists self::$uid = is_null($uid) ? OC_User::getUser() : $uid; - if(!OC_User::userExists(self::$uid)){ + if(!OC_User::userExists(self::$uid)) { return json_encode( array( 'success' => false) ); } } diff --git a/lib/migration/content.php b/lib/migration/content.php index ca102b03d8f..eec475945a8 100644 --- a/lib/migration/content.php +++ b/lib/migration/content.php @@ -53,7 +53,7 @@ class OC_Migration_Content{ if( !is_null( $this->db ) ) { // Get db path $db = $this->db->getDatabase(); - if(!in_array($db, $this->tmpfiles)){ + if(!in_array($db, $this->tmpfiles)) { $this->tmpfiles[] = $db; } } diff --git a/lib/router.php b/lib/router.php index 7bbc546d757..8cb8fd4f33b 100644 --- a/lib/router.php +++ b/lib/router.php @@ -34,7 +34,7 @@ class OC_Router { public function getRoutingFiles() { if (!isset($this->routing_files)) { $this->routing_files = array(); - foreach(OC_APP::getEnabledApps() as $app){ + foreach(OC_APP::getEnabledApps() as $app) { $file = OC_App::getAppPath($app).'/appinfo/routes.php'; if(file_exists($file)) { $this->routing_files[$app] = $file; diff --git a/lib/setup.php b/lib/setup.php index d0620f814a0..c424ad6fb00 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -70,7 +70,7 @@ class OC_Setup { if(empty($options['dbname'])) { $error[] = "$dbprettyname enter the database name."; } - if(substr_count($options['dbname'], '.') >= 1){ + if(substr_count($options['dbname'], '.') >= 1) { $error[] = "$dbprettyname you may not use dots in the database name"; } if($dbtype != 'oci' && empty($options['dbhost'])) { diff --git a/lib/template.php b/lib/template.php index ed2481afba2..ad25dbcff51 100644 --- a/lib/template.php +++ b/lib/template.php @@ -25,7 +25,7 @@ * Prints an XSS escaped string * @param string $string the string which will be escaped and printed */ -function p($string){ +function p($string) { print(OC_Util::sanitizeHTML($string)); } @@ -33,7 +33,7 @@ function p($string){ * Prints an unescaped string * @param string $string the string which will be printed as it is */ -function print_unescaped($string){ +function print_unescaped($string) { print($string); } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index f8364b71ef7..4080a974be7 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -2,25 +2,25 @@ require_once __DIR__.'/../lib/base.php'; -if(!class_exists('PHPUnit_Framework_TestCase')){ +if(!class_exists('PHPUnit_Framework_TestCase')) { require_once('PHPUnit/Autoload.php'); } //SimpleTest compatibility abstract class UnitTestCase extends PHPUnit_Framework_TestCase{ - function assertEqual($expected, $actual, $string=''){ + function assertEqual($expected, $actual, $string='') { $this->assertEquals($expected, $actual, $string); } - function assertNotEqual($expected, $actual, $string=''){ + function assertNotEqual($expected, $actual, $string='') { $this->assertNotEquals($expected, $actual, $string); } - static function assertTrue($actual, $string=''){ + static function assertTrue($actual, $string='') { parent::assertTrue((bool)$actual, $string); } - static function assertFalse($actual, $string=''){ + static function assertFalse($actual, $string='') { parent::assertFalse((bool)$actual, $string); } } diff --git a/tests/lib/cache.php b/tests/lib/cache.php index 7f3eb3ee6fa..c104460ea4d 100644 --- a/tests/lib/cache.php +++ b/tests/lib/cache.php @@ -13,7 +13,7 @@ abstract class Test_Cache extends UnitTestCase { protected $instance; public function tearDown() { - if($this->instance){ + if($this->instance) { $this->instance->clear(); } } diff --git a/tests/lib/cache/apc.php b/tests/lib/cache/apc.php index f68b97bcbd9..bb5eb483dbf 100644 --- a/tests/lib/cache/apc.php +++ b/tests/lib/cache/apc.php @@ -22,11 +22,11 @@ class Test_Cache_APC extends Test_Cache { public function setUp() { - if(!extension_loaded('apc')){ + if(!extension_loaded('apc')) { $this->markTestSkipped('The apc extension is not available.'); return; } - if(!ini_get('apc.enable_cli') && OC::$CLI){ + if(!ini_get('apc.enable_cli') && OC::$CLI) { $this->markTestSkipped('apc not available in CLI.'); return; } diff --git a/tests/lib/cache/xcache.php b/tests/lib/cache/xcache.php index c081036a31f..43bed2db037 100644 --- a/tests/lib/cache/xcache.php +++ b/tests/lib/cache/xcache.php @@ -22,7 +22,7 @@ class Test_Cache_XCache extends Test_Cache { public function setUp() { - if(!function_exists('xcache_get')){ + if(!function_exists('xcache_get')) { $this->markTestSkipped('The xcache extension is not available.'); return; } diff --git a/tests/lib/template.php b/tests/lib/template.php index dadfdba5e0c..32ae4aca590 100644 --- a/tests/lib/template.php +++ b/tests/lib/template.php @@ -24,7 +24,7 @@ require_once("lib/template.php"); class Test_TemplateFunctions extends UnitTestCase { - public function testP(){ + public function testP() { // FIXME: do we need more testcases? $htmlString = ""; ob_start(); @@ -35,7 +35,7 @@ class Test_TemplateFunctions extends UnitTestCase { $this->assertEqual("<script>alert('xss');</script>", $result); } - public function testPNormalString(){ + public function testPNormalString() { $normalString = "This is a good string!"; ob_start(); p($normalString); @@ -46,7 +46,7 @@ class Test_TemplateFunctions extends UnitTestCase { } - public function testPrintUnescaped(){ + public function testPrintUnescaped() { $htmlString = ""; ob_start(); @@ -57,7 +57,7 @@ class Test_TemplateFunctions extends UnitTestCase { $this->assertEqual($htmlString, $result); } - public function testPrintUnescapedNormalString(){ + public function testPrintUnescapedNormalString() { $normalString = "This is a good string!"; ob_start(); print_unescaped($normalString); -- cgit v1.2.3 From a4b2ea586dea5e02a91a873d16a20144db7292a0 Mon Sep 17 00:00:00 2001 From: Felix Moeller Date: Sun, 4 Nov 2012 22:16:04 +0100 Subject: Style: Remove all the dangling white spaces --- apps/files_sharing/public.php | 2 +- lib/backgroundjob.php | 2 +- lib/base.php | 4 ++-- lib/connector/sabre/quotaplugin.php | 16 ++++++++-------- lib/log.php | 2 +- lib/public/backgroundjob.php | 2 +- lib/public/share.php | 2 +- ocs/providers.php | 16 ++++++++-------- ocs/v1.php | 16 ++++++++-------- settings/ajax/createuser.php | 6 +++--- settings/ajax/getlog.php | 2 +- settings/ajax/userlist.php | 10 +++++----- settings/apps.php | 8 ++++---- settings/languageCodes.php | 2 +- settings/templates/help.php | 2 +- settings/templates/users.php | 2 +- settings/users.php | 2 +- tests/lib/share/share.php | 4 ++-- tests/lib/user/backend.php | 4 ++-- tests/lib/util.php | 6 +++--- tests/preseed-config.php | 6 +++--- 21 files changed, 58 insertions(+), 58 deletions(-) (limited to 'lib/log.php') diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index dca87cd6876..295273d842b 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -22,7 +22,7 @@ if (isset($_GET['token'])) { // Enf of backward compatibility function getID($path) { - // use the share table from the db to find the item source if the file was reshared because shared files + // use the share table from the db to find the item source if the file was reshared because shared files //are not stored in the file cache. if (substr(OC_Filesystem::getMountPoint($path), -7, 6) == "Shared") { $path_parts = explode('/', $path, 5); diff --git a/lib/backgroundjob.php b/lib/backgroundjob.php index f486519bf09..28b5ce3af20 100644 --- a/lib/backgroundjob.php +++ b/lib/backgroundjob.php @@ -40,7 +40,7 @@ class OC_BackgroundJob{ * @param $type execution type * @return boolean * - * This method sets the execution type of the background jobs. Possible types + * This method sets the execution type of the background jobs. Possible types * are "none", "ajax", "webcron", "cron" */ public static function setExecutionType( $type ) { diff --git a/lib/base.php b/lib/base.php index 084cca92e8d..d4eeac82daa 100644 --- a/lib/base.php +++ b/lib/base.php @@ -619,9 +619,9 @@ class OC{ OC_Util::redirectToDefaultPage(); // doesn't return } - // if you reach this point you have changed your password + // if you reach this point you have changed your password // or you are an attacker - // we can not delete tokens here because users may reach + // we can not delete tokens here because users may reach // this point multiple times after a password change OC_Log::write('core', 'Authentication cookie rejected for user '.$_COOKIE['oc_username'], OC_Log::WARN); } diff --git a/lib/connector/sabre/quotaplugin.php b/lib/connector/sabre/quotaplugin.php index 5b8ef941710..a56a65ad863 100644 --- a/lib/connector/sabre/quotaplugin.php +++ b/lib/connector/sabre/quotaplugin.php @@ -2,7 +2,7 @@ /** * This plugin check user quota and deny creating files when they exceeds the quota. - * + * * @copyright Copyright (C) 2012 entreCables S.L. All rights reserved. * @author Sergio Cambra * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License @@ -10,9 +10,9 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { /** - * Reference to main server object - * - * @var Sabre_DAV_Server + * Reference to main server object + * + * @var Sabre_DAV_Server */ private $server; @@ -23,8 +23,8 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { * addPlugin is called. * * This method should set up the requires event subscriptions. - * - * @param Sabre_DAV_Server $server + * + * @param Sabre_DAV_Server $server * @return void */ public function initialize(Sabre_DAV_Server $server) { @@ -37,10 +37,10 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin { /** * This method is called before any HTTP method and forces users to be authenticated - * + * * @param string $method * @throws Sabre_DAV_Exception - * @return bool + * @return bool */ public function checkQuota($uri, $data = null) { $expected = $this->server->httpRequest->getHeader('X-Expected-Entity-Length'); diff --git a/lib/log.php b/lib/log.php index b5e8e1b06a1..e9cededa5c0 100644 --- a/lib/log.php +++ b/lib/log.php @@ -47,7 +47,7 @@ class OC_Log { //ob_end_clean(); self::write('PHP', $error['message'] . ' at ' . $error['file'] . '#' . $error['line'], self::FATAL); } else { - return true; + return true; } } diff --git a/lib/public/backgroundjob.php b/lib/public/backgroundjob.php index 24a17836f7f..601046fe691 100644 --- a/lib/public/backgroundjob.php +++ b/lib/public/backgroundjob.php @@ -62,7 +62,7 @@ class BackgroundJob { * @param $type execution type * @return boolean * - * This method sets the execution type of the background jobs. Possible types + * This method sets the execution type of the background jobs. Possible types * are "none", "ajax", "webcron", "cron" */ public static function setExecutionType( $type ) { diff --git a/lib/public/share.php b/lib/public/share.php index da1c0616390..071304ec249 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -28,7 +28,7 @@ namespace OCP; /** * This class provides the ability for apps to share their content between users. * Apps must create a backend class that implements OCP\Share_Backend and register it with this class. -* +* * It provides the following hooks: * - post_shared */ diff --git a/ocs/providers.php b/ocs/providers.php index 4c68ded914e..bdbfe0c4ee7 100644 --- a/ocs/providers.php +++ b/ocs/providers.php @@ -3,22 +3,22 @@ /** * ownCloud * -* @author Frank Karlitschek -* @copyright 2012 Frank Karlitschek frank@owncloud.org -* +* @author Frank Karlitschek +* @copyright 2012 Frank Karlitschek frank@owncloud.org +* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either +* License as published by the Free Software Foundation; either * version 3 of the License, or any later version. -* +* * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Affero General Public -* License along with this library. If not, see . * +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see . +* */ require_once '../lib/base.php'; diff --git a/ocs/v1.php b/ocs/v1.php index b12ea5ef18d..3593f1822cf 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -3,22 +3,22 @@ /** * ownCloud * -* @author Frank Karlitschek -* @copyright 2012 Frank Karlitschek frank@owncloud.org -* +* @author Frank Karlitschek +* @copyright 2012 Frank Karlitschek frank@owncloud.org +* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE -* License as published by the Free Software Foundation; either +* License as published by the Free Software Foundation; either * version 3 of the License, or any later version. -* +* * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU AFFERO GENERAL PUBLIC LICENSE for more details. -* -* You should have received a copy of the GNU Affero General Public -* License along with this library. If not, see . * +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see . +* */ require_once '../lib/base.php'; diff --git a/settings/ajax/createuser.php b/settings/ajax/createuser.php index c87ff422f61..16b48c8a9ca 100644 --- a/settings/ajax/createuser.php +++ b/settings/ajax/createuser.php @@ -43,9 +43,9 @@ try { } OC_Group::addToGroup( $username, $i ); } - OC_JSON::success(array("data" => - array( - "username" => $username, + OC_JSON::success(array("data" => + array( + "username" => $username, "groups" => implode( ", ", OC_Group::getUserGroups( $username ))))); } catch (Exception $exception) { OC_JSON::error(array("data" => array( "message" => $exception->getMessage()))); diff --git a/settings/ajax/getlog.php b/settings/ajax/getlog.php index 273b02e3822..043124fa175 100644 --- a/settings/ajax/getlog.php +++ b/settings/ajax/getlog.php @@ -12,5 +12,5 @@ $offset=(isset($_GET['offset']))?$_GET['offset']:0; $entries=OC_Log_Owncloud::getEntries($count, $offset); OC_JSON::success(array( - "data" => OC_Util::sanitizeHTML($entries), + "data" => OC_Util::sanitizeHTML($entries), "remain"=>(count(OC_Log_Owncloud::getEntries(1, $offset + $offset)) != 0) ? true : false)); diff --git a/settings/ajax/userlist.php b/settings/ajax/userlist.php index 61b1a388fc3..eaeade60a39 100644 --- a/settings/ajax/userlist.php +++ b/settings/ajax/userlist.php @@ -32,9 +32,9 @@ if (OC_Group::inGroup(OC_User::getUser(), 'admin')) { $batch = OC_User::getUsers('', 10, $offset); foreach ($batch as $user) { $users[] = array( - 'name' => $user, - 'groups' => join(', ', OC_Group::getUserGroups($user)), - 'subadmin' => join(', ', OC_SubAdmin::getSubAdminsGroups($user)), + 'name' => $user, + 'groups' => join(', ', OC_Group::getUserGroups($user)), + 'subadmin' => join(', ', OC_SubAdmin::getSubAdminsGroups($user)), 'quota' => OC_Preferences::getValue($user, 'files', 'quota', 'default')); } } else { @@ -42,8 +42,8 @@ if (OC_Group::inGroup(OC_User::getUser(), 'admin')) { $batch = OC_Group::usersInGroups($groups, '', 10, $offset); foreach ($batch as $user) { $users[] = array( - 'name' => $user, - 'groups' => join(', ', OC_Group::getUserGroups($user)), + 'name' => $user, + 'groups' => join(', ', OC_Group::getUserGroups($user)), 'quota' => OC_Preferences::getValue($user, 'files', 'quota', 'default')); } } diff --git a/settings/apps.php b/settings/apps.php index 8134b44143a..155291333f3 100644 --- a/settings/apps.php +++ b/settings/apps.php @@ -95,11 +95,11 @@ if ( $remoteApps ) { foreach ( $remoteApps AS $key => $remote ) { - if ( + if ( $app['name'] == $remote['name'] - // To set duplicate detection to use OCS ID instead of string name, - // enable this code, remove the line of code above, - // and add [ID] to info.xml of each 3rd party app: + // To set duplicate detection to use OCS ID instead of string name, + // enable this code, remove the line of code above, + // and add [ID] to info.xml of each 3rd party app: // OR $app['ocs_id'] == $remote['ocs_id'] ) { diff --git a/settings/languageCodes.php b/settings/languageCodes.php index 221aa13cf6a..71655800856 100644 --- a/settings/languageCodes.php +++ b/settings/languageCodes.php @@ -3,7 +3,7 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ - + return array( 'bg_BG'=>'български език', 'ca'=>'Català', diff --git a/settings/templates/help.php b/settings/templates/help.php index 56d43853444..9bb46740f5b 100644 --- a/settings/templates/help.php +++ b/settings/templates/help.php @@ -1,4 +1,4 @@ -; - + diff --git a/settings/users.php b/settings/users.php index 395712dbd59..93a259f1cd8 100644 --- a/settings/users.php +++ b/settings/users.php @@ -31,7 +31,7 @@ if($isadmin) { foreach($accessibleusers as $i) { $users[] = array( - "name" => $i, + "name" => $i, "groups" => join( ", ", /*array_intersect(*/OC_Group::getUserGroups($i)/*, OC_SubAdmin::getSubAdminsGroups(OC_User::getUser()))*/), 'quota'=>OC_Preferences::getValue($i, 'files', 'quota', 'default'), 'subadmin'=>implode(', ', OC_SubAdmin::getSubAdminsGroups($i))); diff --git a/tests/lib/share/share.php b/tests/lib/share/share.php index 3cad3a28680..2cb6f7417d2 100644 --- a/tests/lib/share/share.php +++ b/tests/lib/share/share.php @@ -181,7 +181,7 @@ class Test_Share extends UnitTestCase { $this->assertEquals($message, $exception->getMessage()); } - // Owner grants share and update permission + // Owner grants share and update permission OC_User::setUserId($this->user1); $this->assertTrue(OCP\Share::setPermissions('test', 'test.txt', OCP\Share::SHARE_TYPE_USER, $this->user2, OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_UPDATE | OCP\Share::PERMISSION_SHARE)); @@ -375,7 +375,7 @@ class Test_Share extends UnitTestCase { $this->assertTrue(in_array('test.txt', $to_test)); $this->assertTrue(in_array('test1.txt', $to_test)); - // Valid reshare + // Valid reshare $this->assertTrue(OCP\Share::shareItem('test', 'share.txt', OCP\Share::SHARE_TYPE_USER, $this->user4, OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_SHARE)); OC_User::setUserId($this->user4); $this->assertEquals(array('test1.txt'), OCP\Share::getItemsSharedWith('test', Test_Share_Backend::FORMAT_TARGET)); diff --git a/tests/lib/user/backend.php b/tests/lib/user/backend.php index 79653481f90..0b744770ea2 100644 --- a/tests/lib/user/backend.php +++ b/tests/lib/user/backend.php @@ -23,10 +23,10 @@ /** * Abstract class to provide the basis of backend-specific unit test classes. * - * All subclasses MUST assign a backend property in setUp() which implements + * All subclasses MUST assign a backend property in setUp() which implements * user operations (add, remove, etc.). Test methods in this class will then be * run on each separate subclass and backend therein. - * + * * For an example see /tests/lib/user/dummy.php */ diff --git a/tests/lib/util.php b/tests/lib/util.php index a8e5b810265..27635cb8055 100644 --- a/tests/lib/util.php +++ b/tests/lib/util.php @@ -10,7 +10,7 @@ class Test_Util extends UnitTestCase { // Constructor function Test_Util() { - date_default_timezone_set("UTC"); + date_default_timezone_set("UTC"); } function testFormatDate() { @@ -36,10 +36,10 @@ class Test_Util extends UnitTestCase { $goodString = "This is an harmless string."; $result = OC_Util::sanitizeHTML($goodString); $this->assertEquals("This is an harmless string.", $result); - } + } function testGenerate_random_bytes() { $result = strlen(OC_Util::generate_random_bytes(59)); $this->assertEquals(59, $result); - } + } } \ No newline at end of file diff --git a/tests/preseed-config.php b/tests/preseed-config.php index 7eadccbe769..9791e713dac 100644 --- a/tests/preseed-config.php +++ b/tests/preseed-config.php @@ -1,15 +1,15 @@ false, - 'apps_paths' => + 'apps_paths' => array ( - 0 => + 0 => array ( 'path' => OC::$SERVERROOT.'/apps', 'url' => '/apps', 'writable' => false, ), - 1 => + 1 => array ( 'path' => OC::$SERVERROOT.'/apps2', 'url' => '/apps2', -- cgit v1.2.3