@@ -28,51 +28,51 @@ |
||
| 28 | 28 | |
| 29 | 29 | class MoveUpdaterStepFile implements IRepairStep { |
| 30 | 30 | |
| 31 | - /** @var \OCP\IConfig */ |
|
| 32 | - protected $config; |
|
| 31 | + /** @var \OCP\IConfig */ |
|
| 32 | + protected $config; |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @param \OCP\IConfig $config |
|
| 36 | - */ |
|
| 37 | - public function __construct($config) { |
|
| 38 | - $this->config = $config; |
|
| 39 | - } |
|
| 34 | + /** |
|
| 35 | + * @param \OCP\IConfig $config |
|
| 36 | + */ |
|
| 37 | + public function __construct($config) { |
|
| 38 | + $this->config = $config; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - public function getName() { |
|
| 42 | - return 'Move .step file of updater to backup location'; |
|
| 43 | - } |
|
| 41 | + public function getName() { |
|
| 42 | + return 'Move .step file of updater to backup location'; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - public function run(IOutput $output) { |
|
| 46 | - $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); |
|
| 47 | - $instanceId = $this->config->getSystemValue('instanceid', null); |
|
| 45 | + public function run(IOutput $output) { |
|
| 46 | + $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); |
|
| 47 | + $instanceId = $this->config->getSystemValue('instanceid', null); |
|
| 48 | 48 | |
| 49 | - if (!is_string($instanceId) || empty($instanceId)) { |
|
| 50 | - return; |
|
| 51 | - } |
|
| 49 | + if (!is_string($instanceId) || empty($instanceId)) { |
|
| 50 | + return; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - $updaterFolderPath = $dataDir . '/updater-' . $instanceId; |
|
| 54 | - $stepFile = $updaterFolderPath . '/.step'; |
|
| 55 | - if (file_exists($stepFile)) { |
|
| 56 | - $output->info('.step file exists'); |
|
| 53 | + $updaterFolderPath = $dataDir . '/updater-' . $instanceId; |
|
| 54 | + $stepFile = $updaterFolderPath . '/.step'; |
|
| 55 | + if (file_exists($stepFile)) { |
|
| 56 | + $output->info('.step file exists'); |
|
| 57 | 57 | |
| 58 | - $previousStepFile = $updaterFolderPath . '/.step-previous-update'; |
|
| 58 | + $previousStepFile = $updaterFolderPath . '/.step-previous-update'; |
|
| 59 | 59 | |
| 60 | - // cleanup |
|
| 61 | - if (file_exists($previousStepFile)) { |
|
| 62 | - if (\OC_Helper::rmdirr($previousStepFile)) { |
|
| 63 | - $output->info('.step-previous-update removed'); |
|
| 64 | - } else { |
|
| 65 | - $output->info('.step-previous-update can\'t be removed - abort move of .step file'); |
|
| 66 | - return; |
|
| 67 | - } |
|
| 68 | - } |
|
| 60 | + // cleanup |
|
| 61 | + if (file_exists($previousStepFile)) { |
|
| 62 | + if (\OC_Helper::rmdirr($previousStepFile)) { |
|
| 63 | + $output->info('.step-previous-update removed'); |
|
| 64 | + } else { |
|
| 65 | + $output->info('.step-previous-update can\'t be removed - abort move of .step file'); |
|
| 66 | + return; |
|
| 67 | + } |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - // move step file |
|
| 71 | - if (rename($stepFile, $previousStepFile)) { |
|
| 72 | - $output->info('.step file moved to .step-previous-update'); |
|
| 73 | - } else { |
|
| 74 | - $output->warning('.step file can\'t be moved'); |
|
| 75 | - } |
|
| 76 | - } |
|
| 77 | - } |
|
| 70 | + // move step file |
|
| 71 | + if (rename($stepFile, $previousStepFile)) { |
|
| 72 | + $output->info('.step file moved to .step-previous-update'); |
|
| 73 | + } else { |
|
| 74 | + $output->warning('.step file can\'t be moved'); |
|
| 75 | + } |
|
| 76 | + } |
|
| 77 | + } |
|
| 78 | 78 | } |
@@ -33,53 +33,53 @@ |
||
| 33 | 33 | namespace OC\Files\Storage; |
| 34 | 34 | |
| 35 | 35 | class CommonTest extends \OC\Files\Storage\Common { |
| 36 | - /** |
|
| 37 | - * underlying local storage used for missing functions |
|
| 38 | - * @var \OC\Files\Storage\Local |
|
| 39 | - */ |
|
| 40 | - private $storage; |
|
| 36 | + /** |
|
| 37 | + * underlying local storage used for missing functions |
|
| 38 | + * @var \OC\Files\Storage\Local |
|
| 39 | + */ |
|
| 40 | + private $storage; |
|
| 41 | 41 | |
| 42 | - public function __construct($params) { |
|
| 43 | - $this->storage = new \OC\Files\Storage\Local($params); |
|
| 44 | - } |
|
| 42 | + public function __construct($params) { |
|
| 43 | + $this->storage = new \OC\Files\Storage\Local($params); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - public function getId() { |
|
| 47 | - return 'test::'.$this->storage->getId(); |
|
| 48 | - } |
|
| 49 | - public function mkdir($path) { |
|
| 50 | - return $this->storage->mkdir($path); |
|
| 51 | - } |
|
| 52 | - public function rmdir($path) { |
|
| 53 | - return $this->storage->rmdir($path); |
|
| 54 | - } |
|
| 55 | - public function opendir($path) { |
|
| 56 | - return $this->storage->opendir($path); |
|
| 57 | - } |
|
| 58 | - public function stat($path) { |
|
| 59 | - return $this->storage->stat($path); |
|
| 60 | - } |
|
| 61 | - public function filetype($path) { |
|
| 62 | - return @$this->storage->filetype($path); |
|
| 63 | - } |
|
| 64 | - public function isReadable($path) { |
|
| 65 | - return $this->storage->isReadable($path); |
|
| 66 | - } |
|
| 67 | - public function isUpdatable($path) { |
|
| 68 | - return $this->storage->isUpdatable($path); |
|
| 69 | - } |
|
| 70 | - public function file_exists($path) { |
|
| 71 | - return $this->storage->file_exists($path); |
|
| 72 | - } |
|
| 73 | - public function unlink($path) { |
|
| 74 | - return $this->storage->unlink($path); |
|
| 75 | - } |
|
| 76 | - public function fopen($path, $mode) { |
|
| 77 | - return $this->storage->fopen($path, $mode); |
|
| 78 | - } |
|
| 79 | - public function free_space($path) { |
|
| 80 | - return $this->storage->free_space($path); |
|
| 81 | - } |
|
| 82 | - public function touch($path, $mtime = null) { |
|
| 83 | - return $this->storage->touch($path, $mtime); |
|
| 84 | - } |
|
| 46 | + public function getId() { |
|
| 47 | + return 'test::'.$this->storage->getId(); |
|
| 48 | + } |
|
| 49 | + public function mkdir($path) { |
|
| 50 | + return $this->storage->mkdir($path); |
|
| 51 | + } |
|
| 52 | + public function rmdir($path) { |
|
| 53 | + return $this->storage->rmdir($path); |
|
| 54 | + } |
|
| 55 | + public function opendir($path) { |
|
| 56 | + return $this->storage->opendir($path); |
|
| 57 | + } |
|
| 58 | + public function stat($path) { |
|
| 59 | + return $this->storage->stat($path); |
|
| 60 | + } |
|
| 61 | + public function filetype($path) { |
|
| 62 | + return @$this->storage->filetype($path); |
|
| 63 | + } |
|
| 64 | + public function isReadable($path) { |
|
| 65 | + return $this->storage->isReadable($path); |
|
| 66 | + } |
|
| 67 | + public function isUpdatable($path) { |
|
| 68 | + return $this->storage->isUpdatable($path); |
|
| 69 | + } |
|
| 70 | + public function file_exists($path) { |
|
| 71 | + return $this->storage->file_exists($path); |
|
| 72 | + } |
|
| 73 | + public function unlink($path) { |
|
| 74 | + return $this->storage->unlink($path); |
|
| 75 | + } |
|
| 76 | + public function fopen($path, $mode) { |
|
| 77 | + return $this->storage->fopen($path, $mode); |
|
| 78 | + } |
|
| 79 | + public function free_space($path) { |
|
| 80 | + return $this->storage->free_space($path); |
|
| 81 | + } |
|
| 82 | + public function touch($path, $mtime = null) { |
|
| 83 | + return $this->storage->touch($path, $mtime); |
|
| 84 | + } |
|
| 85 | 85 | } |
@@ -29,20 +29,20 @@ |
||
| 29 | 29 | * local storage backend in temporary folder for testing purpose |
| 30 | 30 | */ |
| 31 | 31 | class Temporary extends Local { |
| 32 | - public function __construct($arguments = null) { |
|
| 33 | - parent::__construct(['datadir' => \OC::$server->getTempManager()->getTemporaryFolder()]); |
|
| 34 | - } |
|
| 32 | + public function __construct($arguments = null) { |
|
| 33 | + parent::__construct(['datadir' => \OC::$server->getTempManager()->getTemporaryFolder()]); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - public function cleanUp() { |
|
| 37 | - \OC_Helper::rmdirr($this->datadir); |
|
| 38 | - } |
|
| 36 | + public function cleanUp() { |
|
| 37 | + \OC_Helper::rmdirr($this->datadir); |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - public function __destruct() { |
|
| 41 | - parent::__destruct(); |
|
| 42 | - $this->cleanUp(); |
|
| 43 | - } |
|
| 40 | + public function __destruct() { |
|
| 41 | + parent::__destruct(); |
|
| 42 | + $this->cleanUp(); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - public function getDataDir() { |
|
| 46 | - return $this->datadir; |
|
| 47 | - } |
|
| 45 | + public function getDataDir() { |
|
| 46 | + return $this->datadir; |
|
| 47 | + } |
|
| 48 | 48 | } |
@@ -28,40 +28,40 @@ |
||
| 28 | 28 | |
| 29 | 29 | class HomeObjectStoreStorage extends ObjectStoreStorage implements \OCP\Files\IHomeStorage { |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * The home user storage requires a user object to create a unique storage id |
|
| 33 | - * @param array $params |
|
| 34 | - */ |
|
| 35 | - public function __construct($params) { |
|
| 36 | - if (! isset($params['user']) || ! $params['user'] instanceof User) { |
|
| 37 | - throw new \Exception('missing user object in parameters'); |
|
| 38 | - } |
|
| 39 | - $this->user = $params['user']; |
|
| 40 | - parent::__construct($params); |
|
| 41 | - } |
|
| 31 | + /** |
|
| 32 | + * The home user storage requires a user object to create a unique storage id |
|
| 33 | + * @param array $params |
|
| 34 | + */ |
|
| 35 | + public function __construct($params) { |
|
| 36 | + if (! isset($params['user']) || ! $params['user'] instanceof User) { |
|
| 37 | + throw new \Exception('missing user object in parameters'); |
|
| 38 | + } |
|
| 39 | + $this->user = $params['user']; |
|
| 40 | + parent::__construct($params); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - public function getId() { |
|
| 44 | - return 'object::user:' . $this->user->getUID(); |
|
| 45 | - } |
|
| 43 | + public function getId() { |
|
| 44 | + return 'object::user:' . $this->user->getUID(); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * get the owner of a path |
|
| 49 | - * |
|
| 50 | - * @param string $path The path to get the owner |
|
| 51 | - * @return false|string uid |
|
| 52 | - */ |
|
| 53 | - public function getOwner($path) { |
|
| 54 | - if (is_object($this->user)) { |
|
| 55 | - return $this->user->getUID(); |
|
| 56 | - } |
|
| 57 | - return false; |
|
| 58 | - } |
|
| 47 | + /** |
|
| 48 | + * get the owner of a path |
|
| 49 | + * |
|
| 50 | + * @param string $path The path to get the owner |
|
| 51 | + * @return false|string uid |
|
| 52 | + */ |
|
| 53 | + public function getOwner($path) { |
|
| 54 | + if (is_object($this->user)) { |
|
| 55 | + return $this->user->getUID(); |
|
| 56 | + } |
|
| 57 | + return false; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * @param string $path, optional |
|
| 62 | - * @return \OC\User\User |
|
| 63 | - */ |
|
| 64 | - public function getUser($path = null) { |
|
| 65 | - return $this->user; |
|
| 66 | - } |
|
| 60 | + /** |
|
| 61 | + * @param string $path, optional |
|
| 62 | + * @return \OC\User\User |
|
| 63 | + */ |
|
| 64 | + public function getUser($path = null) { |
|
| 65 | + return $this->user; |
|
| 66 | + } |
|
| 67 | 67 | } |
@@ -24,17 +24,17 @@ |
||
| 24 | 24 | namespace OC\DB; |
| 25 | 25 | |
| 26 | 26 | class MigrationException extends \Exception { |
| 27 | - private $table; |
|
| 27 | + private $table; |
|
| 28 | 28 | |
| 29 | - public function __construct($table, $message) { |
|
| 30 | - $this->table = $table; |
|
| 31 | - parent::__construct($message); |
|
| 32 | - } |
|
| 29 | + public function __construct($table, $message) { |
|
| 30 | + $this->table = $table; |
|
| 31 | + parent::__construct($message); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @return string |
|
| 36 | - */ |
|
| 37 | - public function getTable() { |
|
| 38 | - return $this->table; |
|
| 39 | - } |
|
| 34 | + /** |
|
| 35 | + * @return string |
|
| 36 | + */ |
|
| 37 | + public function getTable() { |
|
| 38 | + return $this->table; |
|
| 39 | + } |
|
| 40 | 40 | } |
@@ -25,17 +25,17 @@ |
||
| 25 | 25 | use OCP\DB\QueryBuilder\ILiteral; |
| 26 | 26 | |
| 27 | 27 | class Literal implements ILiteral { |
| 28 | - /** @var mixed */ |
|
| 29 | - protected $literal; |
|
| 28 | + /** @var mixed */ |
|
| 29 | + protected $literal; |
|
| 30 | 30 | |
| 31 | - public function __construct($literal) { |
|
| 32 | - $this->literal = $literal; |
|
| 33 | - } |
|
| 31 | + public function __construct($literal) { |
|
| 32 | + $this->literal = $literal; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @return string |
|
| 37 | - */ |
|
| 38 | - public function __toString() { |
|
| 39 | - return (string) $this->literal; |
|
| 40 | - } |
|
| 35 | + /** |
|
| 36 | + * @return string |
|
| 37 | + */ |
|
| 38 | + public function __toString() { |
|
| 39 | + return (string) $this->literal; |
|
| 40 | + } |
|
| 41 | 41 | } |
@@ -25,12 +25,12 @@ |
||
| 25 | 25 | use OCP\IUser; |
| 26 | 26 | |
| 27 | 27 | trait FileAccess { |
| 28 | - protected function setupFS(IUser $user) { |
|
| 29 | - \OC_Util::setupFS($user->getUID()); |
|
| 30 | - } |
|
| 28 | + protected function setupFS(IUser $user) { |
|
| 29 | + \OC_Util::setupFS($user->getUID()); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - protected function getUserFolder(IUser $user) { |
|
| 33 | - $this->setupFS($user); |
|
| 34 | - return \OC::$server->getUserFolder($user->getUID()); |
|
| 35 | - } |
|
| 32 | + protected function getUserFolder(IUser $user) { |
|
| 33 | + $this->setupFS($user); |
|
| 34 | + return \OC::$server->getUserFolder($user->getUID()); |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -27,47 +27,47 @@ |
||
| 27 | 27 | namespace OC\Memcache; |
| 28 | 28 | |
| 29 | 29 | class NullCache extends Cache implements \OCP\IMemcache { |
| 30 | - public function get($key) { |
|
| 31 | - return null; |
|
| 32 | - } |
|
| 30 | + public function get($key) { |
|
| 31 | + return null; |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - public function set($key, $value, $ttl = 0) { |
|
| 35 | - return true; |
|
| 36 | - } |
|
| 34 | + public function set($key, $value, $ttl = 0) { |
|
| 35 | + return true; |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - public function hasKey($key) { |
|
| 39 | - return false; |
|
| 40 | - } |
|
| 38 | + public function hasKey($key) { |
|
| 39 | + return false; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - public function remove($key) { |
|
| 43 | - return true; |
|
| 44 | - } |
|
| 42 | + public function remove($key) { |
|
| 43 | + return true; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - public function add($key, $value, $ttl = 0) { |
|
| 47 | - return true; |
|
| 48 | - } |
|
| 46 | + public function add($key, $value, $ttl = 0) { |
|
| 47 | + return true; |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - public function inc($key, $step = 1) { |
|
| 51 | - return true; |
|
| 52 | - } |
|
| 50 | + public function inc($key, $step = 1) { |
|
| 51 | + return true; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - public function dec($key, $step = 1) { |
|
| 55 | - return true; |
|
| 56 | - } |
|
| 54 | + public function dec($key, $step = 1) { |
|
| 55 | + return true; |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - public function cas($key, $old, $new) { |
|
| 59 | - return true; |
|
| 60 | - } |
|
| 58 | + public function cas($key, $old, $new) { |
|
| 59 | + return true; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | - public function cad($key, $old) { |
|
| 63 | - return true; |
|
| 64 | - } |
|
| 62 | + public function cad($key, $old) { |
|
| 63 | + return true; |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - public function clear($prefix = '') { |
|
| 67 | - return true; |
|
| 68 | - } |
|
| 66 | + public function clear($prefix = '') { |
|
| 67 | + return true; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - public static function isAvailable() { |
|
| 71 | - return true; |
|
| 72 | - } |
|
| 70 | + public static function isAvailable() { |
|
| 71 | + return true; |
|
| 72 | + } |
|
| 73 | 73 | } |
@@ -24,12 +24,12 @@ |
||
| 24 | 24 | namespace OC\BackgroundJob\Legacy; |
| 25 | 25 | |
| 26 | 26 | class QueuedJob extends \OC\BackgroundJob\QueuedJob { |
| 27 | - public function run($argument) { |
|
| 28 | - $class = $argument['klass']; |
|
| 29 | - $method = $argument['method']; |
|
| 30 | - $parameters = $argument['parameters']; |
|
| 31 | - if (is_callable([$class, $method])) { |
|
| 32 | - call_user_func([$class, $method], $parameters); |
|
| 33 | - } |
|
| 34 | - } |
|
| 27 | + public function run($argument) { |
|
| 28 | + $class = $argument['klass']; |
|
| 29 | + $method = $argument['method']; |
|
| 30 | + $parameters = $argument['parameters']; |
|
| 31 | + if (is_callable([$class, $method])) { |
|
| 32 | + call_user_func([$class, $method], $parameters); |
|
| 33 | + } |
|
| 34 | + } |
|
| 35 | 35 | } |