Browse Source
Merge pull request #17378 from owncloud/kill-more-legacy-classes
Merge pull request #17378 from owncloud/kill-more-legacy-classes
Kill more legacy classesremotes/origin/handlebars-approach
53 changed files with 184 additions and 555 deletions
-
2apps/files_sharing/ajax/publicpreview.php
-
8apps/files_trashbin/lib/trashbin.php
-
4core/ajax/preview.php
-
3core/ajax/update.php
-
2core/setup/controller.php
-
2cron.php
-
2lib/autoloader.php
-
9lib/base.php
-
24lib/private/app.php
-
2lib/private/cache/file.php
-
6lib/private/connector/sabre/file.php
-
4lib/private/db.php
-
2lib/private/db/connection.php
-
2lib/private/db/statementwrapper.php
-
4lib/private/files.php
-
2lib/private/files/cache/cache.php
-
2lib/private/files/cache/scanner.php
-
4lib/private/files/mount/mountpoint.php
-
6lib/private/files/storage/local.php
-
2lib/private/files/view.php
-
4lib/private/hook.php
-
20lib/private/installer.php
-
131lib/private/legacy/appconfig.php
-
69lib/private/legacy/log.php
-
70lib/private/legacy/search.php
-
31lib/private/legacy/search/provider.php
-
29lib/private/legacy/search/provider/file.php
-
41lib/private/legacy/search/result.php
-
22lib/private/log.php
-
6lib/private/log/owncloud.php
-
2lib/private/log/rotate.php
-
10lib/private/log/syslog.php
-
2lib/private/naturalsort.php
-
2lib/private/ocsclient.php
-
2lib/private/preview.php
-
2lib/private/preview/bitmap.php
-
2lib/private/preview/office.php
-
2lib/private/preview/svg.php
-
20lib/private/setup/mssql.php
-
2lib/private/setup/mysql.php
-
22lib/private/setup/oci.php
-
10lib/private/setup/postgresql.php
-
80lib/private/share/share.php
-
8lib/private/user.php
-
4lib/private/user/database.php
-
8lib/private/util.php
-
6lib/public/util.php
-
2settings/ajax/enableapp.php
-
2settings/ajax/setquota.php
-
1tests/bootstrap.php
-
1tests/lib/appconfig.php
-
2tests/lib/logger.php
-
32tests/lib/share/share.php
@ -1,131 +0,0 @@ |
|||
<?php |
|||
/** |
|||
* @author Bart Visscher <bartv@thisnet.nl> |
|||
* @author Morris Jobke <hey@morrisjobke.de> |
|||
* @author Robin Appelman <icewind@owncloud.com> |
|||
* @author Robin McCorkell <rmccorkell@karoshi.org.uk> |
|||
* @author Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> |
|||
* @author Vincent Petry <pvince81@owncloud.com> |
|||
* |
|||
* @copyright Copyright (c) 2015, ownCloud, Inc. |
|||
* @license AGPL-3.0 |
|||
* |
|||
* This code is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License, version 3, |
|||
* as published by the Free Software Foundation. |
|||
* |
|||
* This program 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, version 3, |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|||
* |
|||
*/ |
|||
|
|||
/** |
|||
* This class provides an easy way for apps to store config values in the |
|||
* database. |
|||
* |
|||
* @deprecated use \OC::$server->getAppConfig() to get an \OCP\IAppConfig instance |
|||
*/ |
|||
class OC_Appconfig { |
|||
/** |
|||
* @return \OCP\IAppConfig |
|||
*/ |
|||
private static function getAppConfig() { |
|||
return \OC::$server->getAppConfig(); |
|||
} |
|||
|
|||
/** |
|||
* Get all apps using the config |
|||
* @return array an array of app ids |
|||
* |
|||
* This function returns a list of all apps that have at least one |
|||
* entry in the appconfig table. |
|||
*/ |
|||
public static function getApps() { |
|||
return self::getAppConfig()->getApps(); |
|||
} |
|||
|
|||
/** |
|||
* Get the available keys for an app |
|||
* @param string $app the app we are looking for |
|||
* @return array an array of key names |
|||
* |
|||
* This function gets all keys of an app. Please note that the values are |
|||
* not returned. |
|||
*/ |
|||
public static function getKeys($app) { |
|||
return self::getAppConfig()->getKeys($app); |
|||
} |
|||
|
|||
/** |
|||
* Gets the config value |
|||
* @param string $app app |
|||
* @param string $key key |
|||
* @param string $default = null, default value if the key does not exist |
|||
* @return string the value or $default |
|||
* |
|||
* This function gets a value from the appconfig table. If the key does |
|||
* not exist the default value will be returned |
|||
*/ |
|||
public static function getValue($app, $key, $default = null) { |
|||
return self::getAppConfig()->getValue($app, $key, $default); |
|||
} |
|||
|
|||
/** |
|||
* check if a key is set in the appconfig |
|||
* @param string $app |
|||
* @param string $key |
|||
* @return bool |
|||
*/ |
|||
public static function hasKey($app, $key) { |
|||
return self::getAppConfig()->hasKey($app, $key); |
|||
} |
|||
|
|||
/** |
|||
* sets a value in the appconfig |
|||
* @param string $app app |
|||
* @param string $key key |
|||
* @param string $value value |
|||
* |
|||
* Sets a value. If the key did not exist before it will be created. |
|||
*/ |
|||
public static function setValue($app, $key, $value) { |
|||
self::getAppConfig()->setValue($app, $key, $value); |
|||
} |
|||
|
|||
/** |
|||
* Deletes a key |
|||
* @param string $app app |
|||
* @param string $key key |
|||
* |
|||
* Deletes a key. |
|||
*/ |
|||
public static function deleteKey($app, $key) { |
|||
self::getAppConfig()->deleteKey($app, $key); |
|||
} |
|||
|
|||
/** |
|||
* Remove app from appconfig |
|||
* @param string $app app |
|||
* |
|||
* Removes all keys in appconfig belonging to the app. |
|||
*/ |
|||
public static function deleteApp($app) { |
|||
self::getAppConfig()->deleteApp($app); |
|||
} |
|||
|
|||
/** |
|||
* get multiply values, either the app or key can be used as wildcard by setting it to false |
|||
* |
|||
* @param string|false $app |
|||
* @param string|false $key |
|||
* @return array |
|||
*/ |
|||
public static function getValues($app, $key) { |
|||
return self::getAppConfig()->getValues($app, $key); |
|||
} |
|||
} |
@ -1,69 +0,0 @@ |
|||
<?php |
|||
/** |
|||
* @author Bart Visscher <bartv@thisnet.nl> |
|||
* @author Jörn Friedrich Dreyer <jfd@butonic.de> |
|||
* @author Morris Jobke <hey@morrisjobke.de> |
|||
* @author Thomas Müller <thomas.mueller@tmit.eu> |
|||
* |
|||
* @copyright Copyright (c) 2015, ownCloud, Inc. |
|||
* @license AGPL-3.0 |
|||
* |
|||
* This code is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License, version 3, |
|||
* as published by the Free Software Foundation. |
|||
* |
|||
* This program 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, version 3, |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|||
* |
|||
*/ |
|||
|
|||
/** |
|||
* logging utilities |
|||
* |
|||
* Log is saved by default at data/owncloud.log using OC_Log_Owncloud. |
|||
* Selecting other backend is done with a config option 'log_type'. |
|||
*/ |
|||
|
|||
OC_Log::$object = new \OC\Log(); |
|||
/** |
|||
* @deprecated use \OC::$server->getLogger() to get an \OCP\ILogger instance |
|||
*/ |
|||
class OC_Log { |
|||
public static $object; |
|||
|
|||
const DEBUG=0; |
|||
const INFO=1; |
|||
const WARN=2; |
|||
const ERROR=3; |
|||
const FATAL=4; |
|||
|
|||
static private $level_funcs = array( |
|||
self::DEBUG => 'debug', |
|||
self::INFO => 'info', |
|||
self::WARN => 'warning', |
|||
self::ERROR => 'error', |
|||
self::FATAL => 'emergency', |
|||
); |
|||
|
|||
static public $enabled = true; |
|||
static protected $class = null; |
|||
|
|||
/** |
|||
* write a message in the log |
|||
* @param string $app |
|||
* @param string $message |
|||
* @param int $level |
|||
*/ |
|||
public static function write($app, $message, $level) { |
|||
if (self::$enabled) { |
|||
$context = array('app' => $app); |
|||
$func = array(self::$object, self::$level_funcs[$level]); |
|||
call_user_func($func, $message, $context); |
|||
} |
|||
} |
|||
} |
@ -1,70 +0,0 @@ |
|||
<?php |
|||
/** |
|||
* @author Andrew Brown <andrew@casabrown.com> |
|||
* @author Jörn Friedrich Dreyer <jfd@butonic.de> |
|||
* @author Morris Jobke <hey@morrisjobke.de> |
|||
* |
|||
* @copyright Copyright (c) 2015, ownCloud, Inc. |
|||
* @license AGPL-3.0 |
|||
* |
|||
* This code is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License, version 3, |
|||
* as published by the Free Software Foundation. |
|||
* |
|||
* This program 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, version 3, |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|||
* |
|||
*/ |
|||
|
|||
/** |
|||
* provides an interface to all search providers |
|||
* |
|||
* @deprecated use \OCP\ISearch / \OC\Search instead |
|||
*/ |
|||
class OC_Search { |
|||
/** |
|||
* @return \OCP\ISearch |
|||
*/ |
|||
private static function getSearch() { |
|||
return \OC::$server->getSearch(); |
|||
} |
|||
|
|||
/** |
|||
* Search all providers for $query |
|||
* @param string $query |
|||
* @return array An array of OCP\Search\Result's |
|||
*/ |
|||
public static function search($query) { |
|||
return self::getSearch()->search($query); |
|||
} |
|||
|
|||
/** |
|||
* Register a new search provider to search with |
|||
* @param string $class class name of a OCP\Search\Provider |
|||
* @param array $options optional |
|||
*/ |
|||
public static function registerProvider($class, $options = array()) { |
|||
return self::getSearch()->registerProvider($class, $options); |
|||
} |
|||
|
|||
/** |
|||
* Remove one existing search provider |
|||
* @param string $provider class name of a OCP\Search\Provider |
|||
*/ |
|||
public static function removeProvider($provider) { |
|||
return self::getSearch()->removeProvider($provider); |
|||
} |
|||
|
|||
/** |
|||
* Remove all registered search providers |
|||
*/ |
|||
public static function clearProviders() { |
|||
return self::getSearch()->clearProviders(); |
|||
} |
|||
|
|||
} |
@ -1,31 +0,0 @@ |
|||
<?php |
|||
/** |
|||
* @author Andrew Brown <andrew@casabrown.com> |
|||
* @author Jörn Friedrich Dreyer <jfd@butonic.de> |
|||
* @author Morris Jobke <hey@morrisjobke.de> |
|||
* |
|||
* @copyright Copyright (c) 2015, ownCloud, Inc. |
|||
* @license AGPL-3.0 |
|||
* |
|||
* This code is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License, version 3, |
|||
* as published by the Free Software Foundation. |
|||
* |
|||
* This program 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, version 3, |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|||
* |
|||
*/ |
|||
|
|||
/** |
|||
* Class OC_Search_Provider |
|||
* |
|||
* @deprecated use \OCP\Search\Provider instead |
|||
*/ |
|||
abstract class OC_Search_Provider extends \OCP\Search\Provider { |
|||
|
|||
} |
@ -1,29 +0,0 @@ |
|||
<?php |
|||
/** |
|||
* @author Andrew Brown <andrew@casabrown.com> |
|||
* @author Jörn Friedrich Dreyer <jfd@butonic.de> |
|||
* @author Morris Jobke <hey@morrisjobke.de> |
|||
* |
|||
* @copyright Copyright (c) 2015, ownCloud, Inc. |
|||
* @license AGPL-3.0 |
|||
* |
|||
* This code is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License, version 3, |
|||
* as published by the Free Software Foundation. |
|||
* |
|||
* This program 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, version 3, |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|||
* |
|||
*/ |
|||
|
|||
/** |
|||
* @deprecated use \OC\Search\Provider\File instead |
|||
*/ |
|||
class OC_Search_Provider_File extends \OC\Search\Provider\File { |
|||
|
|||
} |
@ -1,41 +0,0 @@ |
|||
<?php |
|||
/** |
|||
* @author Andrew Brown <andrew@casabrown.com> |
|||
* @author Jörn Friedrich Dreyer <jfd@butonic.de> |
|||
* @author Morris Jobke <hey@morrisjobke.de> |
|||
* |
|||
* @copyright Copyright (c) 2015, ownCloud, Inc. |
|||
* @license AGPL-3.0 |
|||
* |
|||
* This code is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU Affero General Public License, version 3, |
|||
* as published by the Free Software Foundation. |
|||
* |
|||
* This program 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, version 3, |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|||
* |
|||
*/ |
|||
|
|||
/** |
|||
* @deprecated use \OCP\Search\Result instead |
|||
*/ |
|||
class OC_Search_Result extends \OCP\Search\Result { |
|||
/** |
|||
* Create a new search result |
|||
* @param string $id unique identifier from application: '[app_name]/[item_identifier_in_app]' |
|||
* @param string $name displayed text of result |
|||
* @param string $link URL to the result within its app |
|||
* @param string $type @deprecated because it is now set in \OC\Search\Result descendants |
|||
*/ |
|||
public function __construct($id = null, $name = null, $link = null, $type = null) { |
|||
$this->id = $id; |
|||
$this->name = $name; |
|||
$this->link = $link; |
|||
$this->type = $type; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue