diff options
author | Gary Kim <gary@garykim.dev> | 2021-06-29 19:20:33 -0400 |
---|---|---|
committer | Gary Kim <gary@garykim.dev> | 2021-06-30 15:28:02 -0400 |
commit | b78f3a57d1d05fb5f81ec8361139b64a3e54d7b0 (patch) | |
tree | c2051ba8b5b03b8e4152e7597a8a3ac4457980c6 /lib/private/legacy | |
parent | 6da9ccc9ee1e37932c6580e9831c74bbeeac741b (diff) | |
download | nextcloud-server-b78f3a57d1d05fb5f81ec8361139b64a3e54d7b0.tar.gz nextcloud-server-b78f3a57d1d05fb5f81ec8361139b64a3e54d7b0.zip |
Migrate HintException to OCP
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_Hook.php | 4 | ||||
-rw-r--r-- | lib/private/legacy/OC_Util.php | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/private/legacy/OC_Hook.php b/lib/private/legacy/OC_Hook.php index d9e4c99e498..b223b0fa6d6 100644 --- a/lib/private/legacy/OC_Hook.php +++ b/lib/private/legacy/OC_Hook.php @@ -81,7 +81,7 @@ class OC_Hook { * @param string $signalName name of signal * @param mixed $params default: array() array with additional data * @return bool true if slots exists or false if not - * @throws \OC\HintException + * @throws \OCP\HintException * @throws \OC\ServerNotAvailableException Emits a signal. To get data from the slot use references! * * TODO: write example @@ -107,7 +107,7 @@ class OC_Hook { } catch (Exception $e) { self::$thrownExceptions[] = $e; \OC::$server->getLogger()->logException($e); - if ($e instanceof \OC\HintException) { + if ($e instanceof \OCP\HintException) { throw $e; } if ($e instanceof \OC\ServerNotAvailableException) { diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 87964f98374..333b621e359 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -63,6 +63,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ + use bantu\IniGetWrapper\IniGetWrapper; use OC\AppFramework\Http\Request; use OC\Files\Storage\LocalRootStorage; @@ -1214,7 +1215,7 @@ class OC_Util { $fp = @fopen($testFile, 'w'); if (!$fp) { - throw new OC\HintException('Can\'t create test file to check for working .htaccess file.', + throw new \OCP\HintException('Can\'t create test file to check for working .htaccess file.', 'Make sure it is possible for the webserver to write to ' . $testFile); } fwrite($fp, $testContent); @@ -1225,10 +1226,11 @@ class OC_Util { /** * Check if the .htaccess file is working + * * @param \OCP\IConfig $config * @return bool * @throws Exception - * @throws \OC\HintException If the test file can't get written. + * @throws \OCP\HintException If the test file can't get written. */ public function isHtaccessWorking(\OCP\IConfig $config) { if (\OC::$CLI || !$config->getSystemValue('check_for_working_htaccess', true)) { @@ -1422,7 +1424,7 @@ class OC_Util { * * @param \OC\SystemConfig $config * @return bool whether the core or any app needs an upgrade - * @throws \OC\HintException When the upgrade from the given version is not allowed + * @throws \OCP\HintException When the upgrade from the given version is not allowed */ public static function needUpgrade(\OC\SystemConfig $config) { if ($config->getValue('installed', false)) { @@ -1442,11 +1444,11 @@ class OC_Util { return true; } else { // downgrade attempt, throw exception - throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); + throw new \OCP\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); } } elseif ($versionDiff < 0) { // downgrade attempt, throw exception - throw new \OC\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); + throw new \OCP\HintException('Downgrading is not supported and is likely to cause unpredictable issues (from ' . $installedVersion . ' to ' . $currentVersion . ')'); } // also check for upgrades for apps (independently from the user) |