Skip to content

Commit

Permalink
fixed #3 - Remove Zend Dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Fasching committed Jun 23, 2017
1 parent 3194dd1 commit e79e0de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/ConfigElement/Operator/Concatenator.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getLabeledValue($object) {

$childs = $this->getChilds();
$valueArray = [];

foreach($childs as $c) {
$value = $c->getLabeledValue($object)->value;

Expand All @@ -51,7 +51,8 @@ public function getLabeledValue($object) {
}

if($this->formatNumbers && is_numeric($value)) {
$value = \Zend_Locale_Format::toNumber($value, array("locale" => \Zend_Registry::get("Zend_Locale")) );
$formattingService = \Pimcore::getContainer()->get('pimcore.locale.intl_formatter');
$value = $formattingService->formatNumber($value);
}

if($value !== null) {
Expand Down
8 changes: 4 additions & 4 deletions src/OutputDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static function getByO_IdClassIdChannel($o_id, $classId, $channel) {
$cacheKey = self::getCacheKey($o_id, $classId, $channel);

try {
$config = \Zend_Registry::get($cacheKey);
$config = \Pimcore\Cache\Runtime::get($cacheKey);
}
catch (\Exception $e) {

Expand All @@ -45,7 +45,7 @@ public static function getByO_IdClassIdChannel($o_id, $classId, $channel) {
Logger::info($e->getMessage());
$config = null;
}
\Zend_Registry::set($cacheKey, $config);
\Pimcore\Cache\Runtime::set($cacheKey, $config);
} catch(\Exception $ex) {
Logger::debug($ex->getMessage());
return null;
Expand All @@ -64,7 +64,7 @@ public static function getById($id) {
} catch(\Exception $ex) {
Logger::debug($ex->getMessage());
return null;
}
}
}

private static function getCacheKey($o_id, $classId, $channel) {
Expand Down Expand Up @@ -93,7 +93,7 @@ public function save() {
*/
public function delete() {
$cacheKey = self::getCacheKey($this->getO_id(), $this->getO_ClassId(), $this->getChannel());
\Zend_Registry::set($cacheKey, null);
\Pimcore\Cache\Runtime::set($cacheKey, null);

$this->getDao()->delete();
}
Expand Down

0 comments on commit e79e0de

Please sign in to comment.