Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/lisk/PhabricatorLiskDAO.php
Show All 36 Lines | /* -( Configuring Storage )------------------------------------------------ */ | ||||
/** | /** | ||||
* @task config | * @task config | ||||
*/ | */ | ||||
public static function getStorageNamespace() { | public static function getStorageNamespace() { | ||||
$namespace = end(self::$namespaceStack); | $namespace = end(self::$namespaceStack); | ||||
if (!strlen($namespace)) { | if (!strlen($namespace)) { | ||||
$namespace = self::getDefaultStorageNamespace(); | $namespace = self::getDefaultStorageNamespace(); | ||||
} | } | ||||
if (!strlen($namespace)) { | if ($namespace === null || !strlen($namespace)) { | ||||
throw new Exception(pht('No storage namespace configured!')); | throw new Exception(pht('No storage namespace configured!')); | ||||
} | } | ||||
return $namespace; | return $namespace; | ||||
} | } | ||||
public function setForcedStorageNamespace($namespace) { | public function setForcedStorageNamespace($namespace) { | ||||
$this->forcedNamespace = $namespace; | $this->forcedNamespace = $namespace; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 236 Lines • ▼ Show 20 Lines | /* -( Configuring Storage )------------------------------------------------ */ | ||||
} | } | ||||
protected function getUTF8StringFromStorage($string, $encoding) { | protected function getUTF8StringFromStorage($string, $encoding) { | ||||
if ($encoding == 'utf8') { | if ($encoding == 'utf8') { | ||||
return $string; | return $string; | ||||
} | } | ||||
if (function_exists('mb_detect_encoding')) { | if (function_exists('mb_detect_encoding')) { | ||||
if (strlen($encoding)) { | if ($encoding !== null && strlen($encoding)) { | ||||
$try_encodings = array( | $try_encodings = array( | ||||
$encoding, | $encoding, | ||||
); | ); | ||||
} else { | } else { | ||||
// TODO: This is pretty much a guess, and probably needs to be | // TODO: This is pretty much a guess, and probably needs to be | ||||
// configurable in the long run. | // configurable in the long run. | ||||
$try_encodings = array( | $try_encodings = array( | ||||
'JIS', | 'JIS', | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |