summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/backgroundjob.php2
-rw-r--r--lib/filecache.php2
-rw-r--r--lib/filecache/update.php4
-rw-r--r--lib/fileproxy/fileoperations.php2
-rw-r--r--lib/fileproxy/quota.php2
-rw-r--r--lib/filesystem.php4
-rw-r--r--lib/filesystemview.php14
-rw-r--r--lib/helper.php8
-rw-r--r--lib/log.php6
-rw-r--r--lib/migrate.php2
-rw-r--r--lib/migration/content.php2
-rw-r--r--lib/router.php2
-rw-r--r--lib/setup.php2
-rw-r--r--lib/template.php4
14 files changed, 28 insertions, 28 deletions
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);
}