Skip to content

Commit

Permalink
Define major version
Browse files Browse the repository at this point in the history
This will be later used as compatiblity check for themes.

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed May 15, 2017
1 parent bb26e2e commit 941e861
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libraries/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public function __construct($source = null)
public function checkSystem()
{
$this->set('PMA_VERSION', '4.8.0-dev');
/* Major version */
$this->set(
'PMA_MAJOR_VERSION',
implode('.', array_slice(explode('.', $this->get('PMA_VERSION'), 3), 0, 2))
);

$this->checkWebServerOs();
$this->checkWebServer();
Expand Down
1 change: 1 addition & 0 deletions test/bootstrap-dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
$CFG = new PMA\libraries\Config();
// Initialize PMA_VERSION variable
define('PMA_VERSION', $CFG->get('PMA_VERSION'));
define('PMA_MAJOR_VERSION', $CFG->get('PMA_MAJOR_VERSION'));
unset($CFG);

/* Ensure default langauge is active */
Expand Down
2 changes: 2 additions & 0 deletions test/classes/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function testCheckSystem()
$this->object->checkSystem();

$this->assertNotEmpty($this->object->get('PMA_VERSION'));
$this->assertNotEmpty($this->object->get('PMA_MAJOR_VERSION'));
}

/**
Expand Down Expand Up @@ -622,6 +623,7 @@ public function testEnableBc()

$defines = array(
'PMA_VERSION',
'PMA_MAJOR_VERSION',
'PMA_IS_WINDOWS',
'PMA_IS_GD2',
'PMA_USR_OS',
Expand Down

0 comments on commit 941e861

Please sign in to comment.