Skip to content

Commit

Permalink
Merge pull request #21 in PSDK/ext-ruby from bugfix-asinko-rubymng-do…
Browse files Browse the repository at this point in the history
…es-not-show-patch-level-PPP-23411 to master

* commit '8e6e377405ee3c7523d1a499c46fa6feb1765f6f':
  BUGFIX PPP-23411 rubymng Does Not Show Patch Level for Ruby Versions
  • Loading branch information
alexeysinko committed Jun 20, 2016
2 parents 8c77af1 + 8e6e377 commit f1931e7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/plib/controllers/DomainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function indexAction()
return;
}

$this->view->rubyVersion = $domainHandler->getHandler()->getVersion();
$this->view->rubyVersion = $domainHandler->getHandler()->getFullVersion();
$application = $domainHandler->getApplication();
if (!$application){
$this->view->smallTools = [[
Expand Down
2 changes: 1 addition & 1 deletion src/plib/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private function _getList()
$data = [];
foreach ($em->getRepository(Handler::class)->findAll() as $handler) {
$data[] = [
'version' => $handler->getVersion(),
'version' => $handler->getFullVersion(),
'path' => $handler->getPath(),
'domains' => count($handler->getDomainHandlers()),
];
Expand Down
2 changes: 1 addition & 1 deletion src/plib/hooks/ActiveList.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getItemServices($controller, $action, $itemId)
}

$description = '<br>' .pm_Locale::lmsg('activeList.service.version', [
'version' => $application->getDomainHandler()->getHandler()->getVersion(),
'version' => $application->getDomainHandler()->getHandler()->getFullVersion(),
]);
$description .= '; ' . pm_Locale::lmsg('activeList.service.mode', [
'mode' => $application->getMode(),
Expand Down
2 changes: 1 addition & 1 deletion src/plib/hooks/CustomButtons.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getButtons()
}

return pm_Locale::lmsg('activeList.rubyButtonEnabled', [
'version' => $domainHandler->getHandler()->getVersion(),
'version' => $domainHandler->getHandler()->getFullVersion(),
]);
} catch (Exception $e) {
pm_Log::err($e);
Expand Down
22 changes: 22 additions & 0 deletions src/plib/library/Entity/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ class Handler
*/
protected $version;

/**
* @Column(type="string")
* @var string
*/
protected $fullVersion;

/**
* @Column(type="string")
* @var string
Expand Down Expand Up @@ -64,6 +70,22 @@ public function setVersion($version)
$this->version = $version;
}

/**
* @return string
*/
public function getFullVersion()
{
return $this->fullVersion;
}

/**
* @param string $fullVersion
*/
public function setFullVersion($fullVersion)
{
$this->fullVersion = $fullVersion;
}

/**
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/plib/library/Form/SelectVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function init()

$options = [];
foreach (EntityManager::getInstance()->getRepository(Handler::class)->findAll() as $handler) {
$options[$handler->getId()] = $handler->getVersion();
$options[$handler->getId()] = $handler->getFullVersion();
}

$this->addElement('select', 'handlerId', [
Expand Down
2 changes: 2 additions & 0 deletions src/plib/library/Repository/HandlerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public function scan()
foreach ($old as $handler) {
if (isset($new[$handler->getVersion()])) {
$handler->setPath($new[$handler->getVersion()]['path']);
$handler->setFullVersion($new[$handler->getVersion()]['fullversion']);
unset($new[$handler->getVersion()]);
} else {
$this->getEntityManager()->remove($handler);
Expand All @@ -24,6 +25,7 @@ public function scan()
foreach ($new as $version => $data) {
$handler = new Handler();
$handler->setVersion($version);
$handler->setFullVersion($data['fullversion']);
$handler->setPath($data['path']);
$this->getEntityManager()->persist($handler);
}
Expand Down

0 comments on commit f1931e7

Please sign in to comment.