diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-02-18 18:31:33 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-02-18 18:31:33 +0100 |
commit | c6f4f85e27a10459422ab9789c894d13f0cd34c7 (patch) | |
tree | 6b4cf7a304242c5891952b428b3bca950924f309 /lib/private | |
parent | 9fac95c2ab46a734607657bbad6f164aaa61286f (diff) | |
parent | 8991e4505adba2dae8afe7b7941ec744bfe78712 (diff) | |
download | nextcloud-server-c6f4f85e27a10459422ab9789c894d13f0cd34c7.tar.gz nextcloud-server-c6f4f85e27a10459422ab9789c894d13f0cd34c7.zip |
Merge branch 'master' into scrutinizer_documentation_patches
Conflicts:
lib/private/migration/content.php
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/allconfig.php | 4 | ||||
-rw-r--r-- | lib/private/backgroundjob/job.php | 4 | ||||
-rw-r--r-- | lib/private/backgroundjob/joblist.php | 74 | ||||
-rw-r--r-- | lib/private/cache/fileglobal.php | 5 | ||||
-rw-r--r-- | lib/private/config.php | 4 | ||||
-rw-r--r-- | lib/private/db.php | 2 | ||||
-rw-r--r-- | lib/private/db/mdb2schemareader.php | 3 | ||||
-rw-r--r-- | lib/private/db/statementwrapper.php | 14 | ||||
-rw-r--r-- | lib/private/helper.php | 1 | ||||
-rw-r--r-- | lib/private/migrate.php | 105 | ||||
-rw-r--r-- | lib/private/migration/content.php | 40 | ||||
-rw-r--r-- | lib/private/mimetypes.list.php | 7 | ||||
-rw-r--r-- | lib/private/server.php | 16 | ||||
-rw-r--r-- | lib/private/setup.php | 9 | ||||
-rwxr-xr-x | lib/private/util.php | 5 |
15 files changed, 135 insertions, 158 deletions
diff --git a/lib/private/allconfig.php b/lib/private/allconfig.php index a4aa69d43fb..de3ac973637 100644 --- a/lib/private/allconfig.php +++ b/lib/private/allconfig.php @@ -17,7 +17,7 @@ class AllConfig implements \OCP\IConfig { * Sets a new system wide value * * @param string $key the key of the value, under which will be saved - * @param string $value the value that should be stored + * @param mixed $value the value that should be stored * @todo need a use case for this */ // public function setSystemValue($key, $value) { @@ -28,7 +28,7 @@ class AllConfig implements \OCP\IConfig { * Looks up a system wide defined value * * @param string $key the key of the value, under which it was saved - * @param string $default the default value to be returned if the value isn't set + * @param mixed $default the default value to be returned if the value isn't set * @return string the saved value */ public function getSystemValue($key, $default = '') { diff --git a/lib/private/backgroundjob/job.php b/lib/private/backgroundjob/job.php index 92bd0f8fdbd..0cef401bc24 100644 --- a/lib/private/backgroundjob/job.php +++ b/lib/private/backgroundjob/job.php @@ -8,7 +8,9 @@ namespace OC\BackgroundJob; -abstract class Job { +use OCP\BackgroundJob\IJob; + +abstract class Job implements IJob { /** * @var int $id */ diff --git a/lib/private/backgroundjob/joblist.php b/lib/private/backgroundjob/joblist.php index 82287816090..2740d2bd856 100644 --- a/lib/private/backgroundjob/joblist.php +++ b/lib/private/backgroundjob/joblist.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com> + * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. @@ -8,14 +8,28 @@ namespace OC\BackgroundJob; -/** - * Class QueuedJob - * - * create a background job that is to be executed once - * - * @package OC\BackgroundJob - */ -class JobList { +use OCP\BackgroundJob\IJobList; + +class JobList implements IJobList { + /** + * @var \OCP\IDBConnection + */ + private $conn; + + /** + * @var \OCP\IConfig $config + */ + private $config; + + /** + * @param \OCP\IDBConnection $conn + * @param \OCP\IConfig $config + */ + public function __construct($conn, $config) { + $this->conn = $conn; + $this->config = $config; + } + /** * @param Job|string $job * @param mixed $argument @@ -28,7 +42,7 @@ class JobList { $class = $job; } $argument = json_encode($argument); - $query = \OC_DB::prepare('INSERT INTO `*PREFIX*jobs`(`class`, `argument`, `last_run`) VALUES(?, ?, 0)'); + $query = $this->conn->prepare('INSERT INTO `*PREFIX*jobs`(`class`, `argument`, `last_run`) VALUES(?, ?, 0)'); $query->execute(array($class, $argument)); } } @@ -45,10 +59,10 @@ class JobList { } if (!is_null($argument)) { $argument = json_encode($argument); - $query = \OC_DB::prepare('DELETE FROM `*PREFIX*jobs` WHERE `class` = ? AND `argument` = ?'); + $query = $this->conn->prepare('DELETE FROM `*PREFIX*jobs` WHERE `class` = ? AND `argument` = ?'); $query->execute(array($class, $argument)); } else { - $query = \OC_DB::prepare('DELETE FROM `*PREFIX*jobs` WHERE `class` = ?'); + $query = $this->conn->prepare('DELETE FROM `*PREFIX*jobs` WHERE `class` = ?'); $query->execute(array($class)); } } @@ -67,9 +81,9 @@ class JobList { $class = $job; } $argument = json_encode($argument); - $query = \OC_DB::prepare('SELECT `id` FROM `*PREFIX*jobs` WHERE `class` = ? AND `argument` = ?'); - $result = $query->execute(array($class, $argument)); - return (bool)$result->fetchRow(); + $query = $this->conn->prepare('SELECT `id` FROM `*PREFIX*jobs` WHERE `class` = ? AND `argument` = ?'); + $query->execute(array($class, $argument)); + return (bool)$query->fetch(); } /** @@ -78,10 +92,10 @@ class JobList { * @return Job[] */ public function getAll() { - $query = \OC_DB::prepare('SELECT `id`, `class`, `last_run`, `argument` FROM `*PREFIX*jobs`'); - $result = $query->execute(); + $query = $this->conn->prepare('SELECT `id`, `class`, `last_run`, `argument` FROM `*PREFIX*jobs`'); + $query->execute(); $jobs = array(); - while ($row = $result->fetchRow()) { + while ($row = $query->fetch()) { $jobs[] = $this->buildJob($row); } return $jobs; @@ -94,15 +108,15 @@ class JobList { */ public function getNext() { $lastId = $this->getLastJob(); - $query = \OC_DB::prepare('SELECT `id`, `class`, `last_run`, `argument` FROM `*PREFIX*jobs` WHERE `id` > ? ORDER BY `id` ASC', 1); - $result = $query->execute(array($lastId)); - if ($row = $result->fetchRow()) { + $query = $this->conn->prepare('SELECT `id`, `class`, `last_run`, `argument` FROM `*PREFIX*jobs` WHERE `id` > ? ORDER BY `id` ASC', 1); + $query->execute(array($lastId)); + if ($row = $query->fetch()) { return $this->buildJob($row); } else { //begin at the start of the queue - $query = \OC_DB::prepare('SELECT `id`, `class`, `last_run`, `argument` FROM `*PREFIX*jobs` ORDER BY `id` ASC', 1); - $result = $query->execute(); - if ($row = $result->fetchRow()) { + $query = $this->conn->prepare('SELECT `id`, `class`, `last_run`, `argument` FROM `*PREFIX*jobs` ORDER BY `id` ASC', 1); + $query->execute(); + if ($row = $query->fetch()) { return $this->buildJob($row); } else { return null; //empty job list @@ -115,9 +129,9 @@ class JobList { * @return Job */ public function getById($id) { - $query = \OC_DB::prepare('SELECT `id`, `class`, `last_run`, `argument` FROM `*PREFIX*jobs` WHERE `id` = ?'); - $result = $query->execute(array($id)); - if ($row = $result->fetchRow()) { + $query = $this->conn->prepare('SELECT `id`, `class`, `last_run`, `argument` FROM `*PREFIX*jobs` WHERE `id` = ?'); + $query->execute(array($id)); + if ($row = $query->fetch()) { return $this->buildJob($row); } else { return null; @@ -148,7 +162,7 @@ class JobList { * @param Job $job */ public function setLastJob($job) { - \OC_Appconfig::setValue('backgroundjob', 'lastjob', $job->getId()); + $this->config->setAppValue('backgroundjob', 'lastjob', $job->getId()); } /** @@ -157,7 +171,7 @@ class JobList { * @return string */ public function getLastJob() { - return \OC_Appconfig::getValue('backgroundjob', 'lastjob', 0); + return $this->config->getAppValue('backgroundjob', 'lastjob', 0); } /** @@ -166,7 +180,7 @@ class JobList { * @param Job $job */ public function setLastRun($job) { - $query = \OC_DB::prepare('UPDATE `*PREFIX*jobs` SET `last_run` = ? WHERE `id` = ?'); + $query = $this->conn->prepare('UPDATE `*PREFIX*jobs` SET `last_run` = ? WHERE `id` = ?'); $query->execute(array(time(), $job->getId())); } } diff --git a/lib/private/cache/fileglobal.php b/lib/private/cache/fileglobal.php index cdf2a11da3c..d9e0fd46d37 100644 --- a/lib/private/cache/fileglobal.php +++ b/lib/private/cache/fileglobal.php @@ -88,13 +88,14 @@ class FileGlobal { } static public function gc() { - $last_run = \OC_AppConfig::getValue('core', 'global_cache_gc_lastrun', 0); + $appConfig = \OC::$server->getAppConfig(); + $last_run = $appConfig->getValue('core', 'global_cache_gc_lastrun', 0); $now = time(); if (($now - $last_run) < 300) { // only do cleanup every 5 minutes return; } - \OC_AppConfig::setValue('core', 'global_cache_gc_lastrun', $now); + $appConfig->setValue('core', 'global_cache_gc_lastrun', $now); $cache_dir = self::getCacheDir(); if($cache_dir and is_dir($cache_dir)) { $dh=opendir($cache_dir); diff --git a/lib/private/config.php b/lib/private/config.php index 8a9d5ca6158..8399d0defbd 100644 --- a/lib/private/config.php +++ b/lib/private/config.php @@ -77,7 +77,7 @@ class Config { /** * @brief Gets a value from config.php * @param string $key key - * @param string $default = null default value + * @param mixed $default = null default value * @return string the value or $default * * This function gets the value from config.php. If it does not exist, @@ -94,7 +94,7 @@ class Config { /** * @brief Sets a value * @param string $key key - * @param string $value value + * @param mixed $value value * * This function sets the value and writes the config.php. * diff --git a/lib/private/db.php b/lib/private/db.php index 31132d82c0c..23e9593a579 100644 --- a/lib/private/db.php +++ b/lib/private/db.php @@ -44,7 +44,7 @@ class OC_DB { /** * @var \OC\DB\Connection $connection */ - static private $connection; //the prefered connection to use, only Doctrine + static private $connection; //the preferred connection to use, only Doctrine static private $prefix=null; static private $type=null; diff --git a/lib/private/db/mdb2schemareader.php b/lib/private/db/mdb2schemareader.php index b1fd2454cb0..f9a76786c3e 100644 --- a/lib/private/db/mdb2schemareader.php +++ b/lib/private/db/mdb2schemareader.php @@ -288,12 +288,13 @@ class MDB2SchemaReader { if (!empty($fields)) { if (isset($primary) && $primary) { $table->setPrimaryKey($fields, $name); - } else + } else { if (isset($unique) && $unique) { $table->addUniqueIndex($fields, $name); } else { $table->addIndex($fields, $name); } + } } else { throw new \DomainException('Empty index definition: ' . $name . ' options:' . print_r($fields, true)); } diff --git a/lib/private/db/statementwrapper.php b/lib/private/db/statementwrapper.php index 90dbef1c730..eaf215c7231 100644 --- a/lib/private/db/statementwrapper.php +++ b/lib/private/db/statementwrapper.php @@ -175,4 +175,18 @@ class OC_DB_StatementWrapper { public function fetchOne($colnum = 0) { return $this->statement->fetchColumn($colnum); } + + /** + * Binds a PHP variable to a corresponding named or question mark placeholder in the + * SQL statement that was use to prepare the statement. + * + * @param mixed $column Either the placeholder name or the 1-indexed placeholder index + * @param mixed $variable The variable to bind + * @param integer|null $type one of the PDO::PARAM_* constants + * @param integer|null $length max length when using an OUT bind + * @return boolean + */ + public function bindParam($column, &$variable, $type = null, $length = null){ + return $this->statement->bindParam($column, $variable, $type, $length); + } } diff --git a/lib/private/helper.php b/lib/private/helper.php index 58cb1b88d66..e5d1fa9b513 100644 --- a/lib/private/helper.php +++ b/lib/private/helper.php @@ -151,6 +151,7 @@ class OC_Helper { */ public static function mimetypeIcon($mimetype) { $alias = array( + 'application/octet-stream' => 'file', // use file icon as fallback 'application/xml' => 'code/xml', 'application/msword' => 'x-office/document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'x-office/document', diff --git a/lib/private/migrate.php b/lib/private/migrate.php index 7266d7772cd..b930b719289 100644 --- a/lib/private/migrate.php +++ b/lib/private/migrate.php @@ -35,12 +35,8 @@ class OC_Migrate{ static private $zip=false; // Stores the type of export static private $exporttype=false; - // Array of temp files to be deleted after zip creation - static private $tmpfiles=array(); // Holds the db object - static private $MDB2=false; - // Schema db object - static private $schema=false; + static private $migration_database=false; // Path to the sqlite db static private $dbpath=false; // Holds the path to the zip file @@ -131,7 +127,7 @@ class OC_Migrate{ if( !self::connectDB() ) { return json_encode( array( 'success' => false ) ); } - self::$content = new OC_Migration_Content( self::$zip, self::$MDB2 ); + self::$content = new OC_Migration_Content( self::$zip, self::$migration_database ); // Export the app info $exportdata = self::exportAppData(); // Add the data dir to the zip @@ -257,7 +253,7 @@ class OC_Migrate{ $userfolder = $extractpath . $json->exporteduser; $newuserfolder = $datadir . '/' . self::$uid; foreach(scandir($userfolder) as $file){ - if($file !== '.' && $file !== '..' && is_dir($file)) { + if($file !== '.' && $file !== '..' && is_dir($userfolder.'/'.$file)) { $file = str_replace(array('/', '\\'), '', $file); // Then copy the folder over @@ -359,24 +355,6 @@ class OC_Migrate{ } /** - * @brief connects to a MDB2 database scheme - * @returns bool - */ - static private function connectScheme() { - // We need a mdb2 database connection - self::$MDB2->loadModule( 'Manager' ); - self::$MDB2->loadModule( 'Reverse' ); - - // Connect if this did not happen before - if( !self::$schema ) { - require_once 'MDB2/Schema.php'; - self::$schema=MDB2_Schema::factory( self::$MDB2 ); - } - - return true; - } - - /** * @brief creates a migration.db in the users data dir with their app data in * @return bool whether operation was successfull */ @@ -463,47 +441,18 @@ class OC_Migrate{ return false; } // Already connected - if(!self::$MDB2) { - require_once 'MDB2.php'; - + if(!self::$migration_database) { $datadir = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ); - - // DB type - if( class_exists( 'SQLite3' ) ) { - $dbtype = 'sqlite3'; - } else if( is_callable( 'sqlite_open' ) ) { - $dbtype = 'sqlite'; - } else { - OC_Log::write( 'migration', 'SQLite not found', OC_Log::ERROR ); - return false; - } - - // Prepare options array - $options = array( - 'portability' => MDB2_PORTABILITY_ALL & (!MDB2_PORTABILITY_FIX_CASE), - 'log_line_break' => '<br>', - 'idxname_format' => '%s', - 'debug' => true, - 'quote_identifier' => true - ); - $dsn = array( - 'phptype' => $dbtype, - 'database' => self::$dbpath, - 'mode' => '0644' + $connectionParams = array( + 'path' => self::$dbpath, + 'driver' => 'pdo_sqlite', ); + $connectionParams['adapter'] = '\OC\DB\AdapterSqlite'; + $connectionParams['wrapperClass'] = 'OC\DB\Connection'; + $connectionParams['tablePrefix'] = ''; // Try to establish connection - self::$MDB2 = MDB2::factory( $dsn, $options ); - // Die if we could not connect - if( PEAR::isError( self::$MDB2 ) ) { - die( self::$MDB2->getMessage() ); - OC_Log::write( 'migration', 'Failed to create/connect to migration.db', OC_Log::FATAL ); - OC_Log::write( 'migration', self::$MDB2->getUserInfo(), OC_Log::FATAL ); - OC_Log::write( 'migration', self::$MDB2->getMessage(), OC_Log::FATAL ); - return false; - } - // We always, really always want associative arrays - self::$MDB2->setFetchMode(MDB2_FETCHMODE_ASSOC); + self::$migration_database = \Doctrine\DBAL\DriverManager::getConnection($connectionParams); } return true; @@ -515,10 +464,7 @@ class OC_Migrate{ * @return bool whether the operation was successful */ static private function createAppTables( $appid ) { - - if( !self::connectScheme() ) { - return false; - } + $schema_manager = new OC\DB\MDB2SchemaManager(self::$migration_database); // There is a database.xml file $content = file_get_contents(OC_App::getAppPath($appid) . '/appinfo/database.xml' ); @@ -538,29 +484,16 @@ class OC_Migrate{ file_put_contents( $file2, $content ); // Try to create tables - $definition = self::$schema->parseDatabaseDefinitionFile( $file2 ); - - unlink( $file2 ); - - // Die in case something went wrong - if( $definition instanceof MDB2_Schema_Error ) { - OC_Log::write( 'migration', 'Failed to parse database.xml for: '.$appid, OC_Log::FATAL ); - OC_Log::write( 'migration', $definition->getMessage().': '.$definition->getUserInfo(), OC_Log::FATAL ); - return false; - } - - $definition['overwrite'] = true; - - $ret = self::$schema->createDatabase( $definition ); - - // Die in case something went wrong - if( $ret instanceof MDB2_Error ) { + try { + $schema_manager->createDbFromStructure($file2); + } catch(Exception $e) { + unlink( $file2 ); OC_Log::write( 'migration', 'Failed to create tables for: '.$appid, OC_Log::FATAL ); - OC_Log::write( 'migration', $ret->getMessage().': '.$ret->getUserInfo(), OC_Log::FATAL ); + OC_Log::write( 'migration', $e->getMessage(), OC_Log::FATAL ); return false; } - return $tables; + return $tables; } /** @@ -646,7 +579,7 @@ class OC_Migrate{ if( !self::connectDB( $db ) ) { return false; } - $content = new OC_Migration_Content( self::$zip, self::$MDB2 ); + $content = new OC_Migration_Content( self::$zip, self::$migration_database ); $provider->setData( self::$uid, $content, $info ); // Then do the import if( !$appsstatus[$id] = $provider->import( $info->apps->$id, $importinfo ) ) { diff --git a/lib/private/migration/content.php b/lib/private/migration/content.php index 81b53817433..e7b6543171a 100644 --- a/lib/private/migration/content.php +++ b/lib/private/migration/content.php @@ -27,16 +27,16 @@ class OC_Migration_Content{ private $zip=false; - // Holds the MDB2 object + // Holds the database object private $db=null; // Holds an array of tmpfiles to delete after zip creation private $tmpfiles=array(); /** * @brief sets up the - * @param ZipArchive $zip ZipArchive object - * @param optional $db a MDB2 database object (required for exporttype user) - * @return boolean|null + * @param $zip ZipArchive object + * @param $db a database object (required for exporttype user) + * @return bool */ public function __construct( $zip, $db=null ) { @@ -67,17 +67,9 @@ class OC_Migration_Content{ // Optimize the query $query = $this->db->prepare( $query ); + $query = new OC_DB_StatementWrapper($query, false); - // Die if we have an error (error means: bad query, not 0 results!) - if( PEAR::isError( $query ) ) { - $entry = 'DB Error: "'.$query->getMessage().'"<br />'; - $entry .= 'Offending command was: '.$query.'<br />'; - OC_Log::write( 'migration', $entry, OC_Log::FATAL ); - return false; - } else { - return $query; - } - + return $query; } /** @@ -160,20 +152,14 @@ class OC_Migration_Content{ $sql .= $valuessql . " )"; // Make the query $query = $this->prepare( $sql ); - if( !$query ) { - OC_Log::write( 'migration', 'Invalid sql produced: '.$sql, OC_Log::FATAL ); - return false; - exit(); + $query->execute( $values ); + // Do we need to return some values? + if( array_key_exists( 'idcol', $options ) ) { + // Yes we do + $return[] = $row[$options['idcol']]; } else { - $query->execute( $values ); - // Do we need to return some values? - if( array_key_exists( 'idcol', $options ) ) { - // Yes we do - $return[] = $row[$options['idcol']]; - } else { - // Take a guess and return the first field :) - $return[] = reset($row); - } + // Take a guess and return the first field :) + $return[] = reset($row); } $fields = ''; $values = ''; diff --git a/lib/private/mimetypes.list.php b/lib/private/mimetypes.list.php index 40fb1d2d97d..174877d623b 100644 --- a/lib/private/mimetypes.list.php +++ b/lib/private/mimetypes.list.php @@ -29,10 +29,17 @@ return array( 'avi'=>'video/x-msvideo', 'bash' => 'text/x-shellscript', 'blend'=>'application/x-blender', + 'cb7' => 'application/x-cbr', + 'cba' => 'application/x-cbr', + 'cbr' => 'application/x-cbr', + 'cbt' => 'application/x-cbr', + 'cbtc' => 'application/x-cbr', + 'cbz' => 'application/x-cbr', 'cc' => 'text/x-c', 'cdr' => 'application/coreldraw', 'cpp' => 'text/x-c++src', 'css'=>'text/css', + 'cvbdl' => 'application/x-cbr', 'c' => 'text/x-c', 'c++' => 'text/x-c++src', 'doc'=>'application/msword', diff --git a/lib/private/server.php b/lib/private/server.php index fc8f170dc4a..7696fc207fd 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -151,6 +151,13 @@ class Server extends SimpleContainer implements IServerContainer { $this->registerService('AvatarManager', function($c) { return new AvatarManager(); }); + $this->registerService('JobList', function ($c) { + /** + * @var Server $c + */ + $config = $c->getConfig(); + return new \OC\BackgroundJob\JobList($c->getDatabaseConnection(), $config); + }); } /** @@ -348,4 +355,13 @@ class Server extends SimpleContainer implements IServerContainer { function getActivityManager() { return $this->query('ActivityManager'); } + + /** + * Returns an job list for controlling background jobs + * + * @return \OCP\BackgroundJob\IJobList + */ + function getJobList(){ + return $this->query('JobList'); + } } diff --git a/lib/private/setup.php b/lib/private/setup.php index 5232398d1d7..17ef75bc7b5 100644 --- a/lib/private/setup.php +++ b/lib/private/setup.php @@ -94,10 +94,11 @@ class OC_Setup { } if(count($error) == 0) { - OC_Appconfig::setValue('core', 'installedat', microtime(true)); - OC_Appconfig::setValue('core', 'lastupdatedat', microtime(true)); - OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php'); - OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php'); + $appConfig = \OC::$server->getAppConfig(); + $appConfig->setValue('core', 'installedat', microtime(true)); + $appConfig->setValue('core', 'lastupdatedat', microtime(true)); + $appConfig->setValue('core', 'remote_core.css', '/core/minimizer.php'); + $appConfig->setValue('core', 'remote_core.js', '/core/minimizer.php'); OC_Group::createGroup('admin'); OC_Group::addToGroup($username, 'admin'); diff --git a/lib/private/util.php b/lib/private/util.php index 1d24d5d9b5e..af39d983f67 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -94,9 +94,10 @@ class OC_Util { * @param string $user */ public static function getUserQuota($user){ - $userQuota = OC_Preferences::getValue($user, 'files', 'quota', 'default'); + $config = \OC::$server->getConfig(); + $userQuota = $config->getUserValue($user, 'files', 'quota', 'default'); if($userQuota === 'default') { - $userQuota = OC_AppConfig::getValue('files', 'default_quota', 'none'); + $userQuota = $config->getAppValue('files', 'default_quota', 'none'); } if($userQuota === 'none') { return \OC\Files\SPACE_UNLIMITED; |