Skip to content

Commit

Permalink
Prepared WBCE for semantic versioning:
Browse files Browse the repository at this point in the history
- set VERSION to 1.0.0 (can be changed with final release)
- added TAG (referring to GitHub release)
- updated backend themes to show Version and Tag (no more SP and REV)
- updated installer and upgrade script to update TAG in DB
- reworked addon precheck to deal with WBCE_VERSION and WB_VERSION
  • Loading branch information
cwsoft committed Aug 3, 2015
1 parent c9680fa commit e2544d7
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 134 deletions.
58 changes: 14 additions & 44 deletions wbce/admin/interface/version.php
Original file line number Diff line number Diff line change
@@ -1,47 +1,12 @@
<?php
/*
* About WebsiteBaker
*
* Website Baker is a PHP-based Content Management System (CMS)
* designed with one goal in mind: to enable its users to produce websites
* with ease.
*
* LICENSE INFORMATION
*
* WebsiteBaker is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* WebsiteBaker is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* WebsiteBaker Extra Information
*
* This file is where the WB release version is stored.
*
*/
/**
* WebsiteBaker Community Edition (WBCE)
* More Baking. Less Struggling.
* Visit http://wbce.org to learn more or to join the community.
*
* @category admin
* @package interface
* @author WebsiteBaker Project
* @copyright WebsiteBaker Org. e.V.
* @link http://websitebaker.org/
* @license http://www.gnu.org/licenses/gpl.html
* @platform WebsiteBaker 2.8.3
* @requirements PHP 5.3.6 and higher
* @revision $Revision: 1638 $
* @version $Id: version.php 1638 2012-03-13 23:01:47Z darkviper $
* @filesource $HeadURL: svn://isteam.dynxs.de/wb_svn/wb280/branches/2.8.x/wb/admin/interface/version.php $
* @lastmodified $Date: 2012-03-14 00:01:47 +0100 (Mi, 14. Mrz 2012) $
*
* @copyright Ryan Djurovich (2004-2009)
* @copyright WebsiteBaker Org. e.V. (2009-2015)
* @license GNU GPL2
*/

if(!defined('WB_URL')) {
Expand All @@ -50,6 +15,11 @@
}

// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
if(!defined('VERSION')) define('VERSION', '2.8.3');
if(!defined('REVISION')) define('REVISION', '1641');
if(!defined('SP')) define('SP', 'SP4 CE 1');
if(!defined('VERSION')) define('VERSION', '1.0.0');
if(!defined('TAG')) define('TAG', 'WBCE1Beta2');

// Legacy: WB-classic
if(!defined('REVISION')) define('REVISION', '');
if(!defined('SP')) define('SP', '');


47 changes: 30 additions & 17 deletions wbce/framework/addon.precheck.inc.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<?php
/**
* WebsiteBaker Community Edition (WBCE)
* More Baking. Less Struggling.
* Visit http://wbce.org to learn more or to join the community.
*
* @category module
* @package precheck
* @author WebsiteBaker Project
* @copyright 2004-2009, Ryan Djurovich
* @copyright 2009-2011, Website Baker Org. e.V.
* @link http://www.websitebaker2.org/
* @license http://www.gnu.org/licenses/gpl.html
* @platform WebsiteBaker 2.8.x
* @requirements PHP 5.2.2 and higher
* @version $Id: addon.precheck.inc.php 1499 2011-08-12 11:21:25Z DarkViper $
* @filesource $HeadURL: svn://isteam.dynxs.de/wb_svn/wb280/tags/2.8.3/wb/framework/addon.precheck.inc.php $
* @lastmodified $Date: 2011-08-12 13:21:25 +0200 (Fr, 12. Aug 2011) $
*
* @copyright Ryan Djurovich (2004-2009)
* @copyright WebsiteBaker Org. e.V. (2009-2015)
* @license GNU GPL2
*/

/* -------------------------------------------------------- */
Expand Down Expand Up @@ -114,7 +107,7 @@ function sortPreCheckArray($precheck_array)
* This funtion sorts the precheck array to a common format
*/
// define desired precheck order
$key_order = array('WB_VERSION', 'WB_ADDONS', 'PHP_VERSION', 'PHP_EXTENSIONS', 'PHP_SETTINGS', 'CUSTOM_CHECKS');
$key_order = array('WBCE_VERSION', 'WB_VERSION', 'WB_ADDONS', 'PHP_VERSION', 'PHP_EXTENSIONS', 'PHP_SETTINGS', 'CUSTOM_CHECKS');

$temp_array = array();
foreach($key_order as $key) {
Expand Down Expand Up @@ -156,15 +149,15 @@ function preCheckAddon($temp_addon_file)
// check if specified addon requirements are fullfilled
foreach ($PRECHECK as $key => $value) {
switch ($key) {
case 'WB_VERSION':
case 'WBCE_VERSION':
if (isset($value['VERSION'])) {
// obtain operator for string comparison if exist
$operator = (isset($value['OPERATOR']) && trim($value['OPERATOR']) != '') ? $value['OPERATOR'] : '>=';

// compare versions and extract actual status
$status = versionCompare(WB_VERSION, $value['VERSION'], $operator);
$msg[] = array(
'check' => 'WB-' . $TEXT['VERSION'] .': ',
'check' => 'WBCE-' . $TEXT['VERSION'] .': ',
'required' => htmlentities($operator) . $value['VERSION'],
'actual' => WB_VERSION,
'status' => $status
Expand All @@ -175,6 +168,26 @@ function preCheckAddon($temp_addon_file)
}
break;

case 'WB_VERSION':
if (isset($value['VERSION'])) {
// Legacy: WB-classic (WBCE 1.0.0 was forked from WB 2.8.3)
// Ensure WB-Classic Addon supports WB 2.8.3 (exclude 2.8.4 and higher for now)
$wb_classic = '2.8.3';
$operator = '==';

$status = versionCompare($wb_classic, $value['VERSION'], $operator);
$msg[] = array(
'check' => 'WB-' . $TEXT['VERSION'] .': ',
'required' => htmlentities($operator) . $value['VERSION'],
'actual' => $wb_classic,
'status' => $status
);

// increase counter if required
if (!$status) $failed_checks++;
}
break;

case 'WB_ADDONS':
if (is_array($PRECHECK['WB_ADDONS'])) {
foreach($PRECHECK['WB_ADDONS'] as $addon => $values) {
Expand All @@ -197,7 +210,7 @@ function preCheckAddon($temp_addon_file)
if ($results && $row = $results->fetchRow()) {
$status = true;
$addon_status = $TEXT['INSTALLED'];

// compare version if required
if ($version != '') {
$status = versionCompare($row['version'], $version, $operator);
Expand Down
30 changes: 14 additions & 16 deletions wbce/framework/class.admin.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<?php
/**
* WebsiteBaker Community Edition (WBCE)
* More Baking. Less Struggling.
* Visit http://wbce.org to learn more or to join the community.
*
* @category framewotk
* @package backend admin
* @author Ryan Djurovich, WebsiteBaker Project
* @copyright WebsiteBaker Org. e.V.
* @link http://websitebaker.org/
* @license http://www.gnu.org/licenses/gpl.html
* @platform WebsiteBaker 2.8.3
* @requirements PHP 5.3.6 and higher
* @version $Id: class.admin.php 1625 2012-02-29 00:50:57Z Luisehahne $
* @filesource $HeadURL: svn://isteam.dynxs.de/wb_svn/wb280/branches/2.8.x/wb/framework/class.admin.php $
* @lastmodified $Date: 2012-02-29 01:50:57 +0100 (Mi, 29. Feb 2012) $
*
* @copyright Ryan Djurovich (2004-2009)
* @copyright WebsiteBaker Org. e.V. (2009-2015)
* @license GNU GPL2
*/
/* -------------------------------------------------------- */

// Must include code to stop this file being accessed directly
if(!defined('WB_PATH')) {
require_once(dirname(__FILE__).'/globalExceptionHandler.php');
Expand Down Expand Up @@ -126,8 +120,12 @@ function print_header($body_tags = '') {
'CHARSET' => $charset,
'LANGUAGE' => strtolower(LANGUAGE),
'VERSION' => VERSION,
'SP' => (defined('SP') ? SP : ''),
'REVISION' => REVISION,
'TAG' => (in_array(TAG, array('', '-'))
? '-'
: '<a href="https://github.com/WBCE/WebsiteBaker_CommunityEdition/releases/tag/'.TAG.'" target="_blank">'.TAG.'</a>'
),
'SP' => (defined('SP') ? SP : ''), // Legacy: WB-classic
'REVISION' => REVISION, // Legacy: WB-classic
'SERVER_ADDR' => ($this->get_user_id() == 1
? (!isset($_SERVER['SERVER_ADDR'])
? '129.0.0.1'
Expand All @@ -143,7 +141,7 @@ function print_header($body_tags = '') {
'URL_VIEW' => $view_url,
'URL_HELP' => 'http://websitebaker.org/en/help.php',
'BACKEND_MODULE_CSS' => $this->register_backend_modfiles('css'), // adds backend.css
'BACKEND_MODULE_JS' => $this->register_backend_modfiles('js') // adds backend.js
'BACKEND_MODULE_JS' => $this->register_backend_modfiles('js') // adds backend.js
)
);

Expand Down
24 changes: 9 additions & 15 deletions wbce/install/save.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<?php
/**
* WebsiteBaker Community Edition (WBCE)
* More Baking. Less Struggling.
* Visit http://wbce.org to learn more or to join the community.
*
* @category backend
* @package install
* @author WebsiteBaker Project
* @copyright Ryan Djurovich
* @copyright WebsiteBaker Org. e.V.
* @link http://websitebaker.org/
* @license http://www.gnu.org/licenses/gpl.html
* @platform WebsiteBaker 2.8.3
* @requirements PHP 5.3.6 and higher
* @version $Id: save.php 1638 2012-03-13 23:01:47Z darkviper $
* @filesource $HeadURL: $
* @lastmodified $Date: $
*
* @copyright Ryan Djurovich (2004-2009)
* @copyright WebsiteBaker Org. e.V. (2009-2015)
* @license GNU GPL2
*/

$debug = true;
Expand Down Expand Up @@ -355,8 +348,9 @@ function add_slashes($input) {
$sql = // add settings from install input
'INSERT INTO `'.TABLE_PREFIX.'settings` (`name`, `value`) VALUES '
.'(\'wb_version\', \''.VERSION.'\'),'
.'(\'wb_revision\', \''.REVISION.'\'),'
.'(\'wb_sp\', \''.SP.'\'),'
.'(\'wb_tag\', \''.TAG.'\'),'
.'(\'wb_revision\', \''.REVISION.'\'),' // Legacy: WB-Classic
.'(\'wb_sp\', \''.SP.'\'),' // Legacy: WB-Classic
.'(\'website_title\', \''.$website_title.'\'),'
.'(\'default_language\', \''.$default_language.'\'),'
.'(\'app_name\', \'wb-'.$session_rand.'\'),'
Expand Down
2 changes: 1 addition & 1 deletion wbce/templates/advancedThemeWbFlat/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
$template_directory = 'advancedThemeWbFlat';
$template_name = 'Advanced Theme WB Flat';
$template_function = 'theme';
$template_version = '0.3.6';
$template_version = '0.3.7';
$template_platform = '2.8.3';
$template_author = 'Yetiie';
$template_license = '<a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License (GPLv3)</a>';
Expand Down
4 changes: 2 additions & 2 deletions wbce/templates/advancedThemeWbFlat/templates/header.htt
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ function confirm_link(message, url) {
</div>

<div id="systeminfo" class="stickySidebarElement">
<span class="version">CMS Version {VERSION} {SP}</span><br/>
<span class="version">Revision {REVISION}</span><br/>
<span class="version">CMS Version: {VERSION} {SP}</span><br/>
<span class="version">Tag: {TAG}</span><br/>
<span id="admincheck" class="version" "><a href="#">Admin</a><span class="theme-version-number"></span></span>


Expand Down
6 changes: 2 additions & 4 deletions wbce/templates/argos_theme/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@
$template_directory = 'argos_theme';
$template_name = 'Argos Theme';
$template_function = 'theme';
$template_version = '1.7.1';
$template_version = '1.7.2';
$template_platform = '2.8.3';
$template_author = 'Jurgen Nijhuis (Argos Media) & Ruud Eisinga';
$template_license = '<a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>';
$template_license_terms = '-';
$template_description = 'Enhanced backend theme for Website Baker 2.8.';

?>
$template_description = 'Enhanced backend theme for Website Baker 2.8.';
6 changes: 3 additions & 3 deletions wbce/templates/argos_theme/templates/header.htt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ function confirm_link(message, url) {
<div id="topmenu"> <a href="{ADMIN_URL}" title="{TITLE_START}">Home</a>| <a href="{URL_VIEW}" target="_blank" title="{TITLE_VIEW}">{TITLE_VIEW}</a>| <a href="{ADMIN_URL}/logout/" title="{TITLE_LOGOUT}">{TITLE_LOGOUT}</a>
<br />
<br />
<span class="version">CMS Version {VERSION} {SP}</span><br/>
<span class="version">Revision {REVISION}</span><br/>
<span class="version">Admin version 1.6</span>
<span class="version">CMS Version: {VERSION}</span><br/>
<span class="version">Tag: {TAG}</span><br/>
<span class="version">Admin version 1.7.2</span>
</div>
<a href="{ADMIN_URL}" title="{TITLE_START}" id="website_title">
{WEBSITE_TITLE} - {TEXT_ADMINISTRATION}
Expand Down
Loading

0 comments on commit e2544d7

Please sign in to comment.