diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2005-06-19 11:25:02 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2005-06-19 11:25:02 +0000 |
| commit | 8de8b4235b53a5f27dfb13cc6ce5ce47736a9ff2 (patch) | |
| tree | 1aca0833f837e31758165fb9c49e910d3ef1d05d | |
| parent | ffb75d78fd5d62828e22883536ae03d55cb2a590 (diff) | |
| download | kernel-8de8b4235b53a5f27dfb13cc6ce5ce47736a9ff2.tar.gz kernel-8de8b4235b53a5f27dfb13cc6ce5ce47736a9ff2.tar.bz2 kernel-8de8b4235b53a5f27dfb13cc6ce5ce47736a9ff2.zip | |
introducing version check for bitweaver releases
| -rwxr-xr-x | BitSystem.php | 15 | ||||
| -rw-r--r-- | admin/index.php | 13 | ||||
| -rw-r--r-- | setup_inc.php | 9 | ||||
| -rw-r--r-- | templates/admin.tpl | 39 |
4 files changed, 63 insertions, 13 deletions
diff --git a/BitSystem.php b/BitSystem.php index ee6f208..1bc9694 100755 --- a/BitSystem.php +++ b/BitSystem.php @@ -14,7 +14,7 @@ // +----------------------------------------------------------------------+ // | Authors: spider <spider@steelsun.com> // +----------------------------------------------------------------------+ -// $Id: BitSystem.php,v 1.3 2005/06/19 10:46:41 squareing Exp $ +// $Id: BitSystem.php,v 1.4 2005/06/19 11:25:02 squareing Exp $ /** * kernel::BitSystem * @@ -29,7 +29,7 @@ * is Package specific should be moved into that package * * @author spider <spider@steelsun.com> -* @version $Revision: 1.3 $ +* @version $Revision: 1.4 $ * @access public */ @@ -2093,10 +2093,10 @@ Proceed to the Tiki installer <b>at <a href=\"".BIT_ROOT_URL."install/install.ph } @fclose( $fsock ); - if( !empty( $data ) ) { - // nuke all blank lines and comments - '//' - $data = preg_replace( "/^\/\/.*\n/", "", $data ); - $versions = explode( "\n", $data ); + // nuke all lines that don't start with a number + $data = preg_match_all( "/(\d.*)\n/", $data, $versions ); + $versions = $versions[1]; + if( !empty( $versions ) ) { sort( $versions ); foreach( $versions as $version ) { if( preg_match( "/^".BIT_RELEASE."/", $version ) ) { @@ -2109,6 +2109,9 @@ Proceed to the Tiki installer <b>at <a href=\"".BIT_ROOT_URL."install/install.ph if( $release[0] > BIT_RELEASE ) { $ret['release'] = implode( '.', $release ); } + } else { + $error['number'] = 1; + $error['string'] = tra( 'No version information could be gathered. Perhaps there was a problem connecting to bitweaver.org.' ); } } $ret['error'] = $error; diff --git a/admin/index.php b/admin/index.php index c461e63..3d49bb0 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,6 +1,6 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_kernel/admin/index.php,v 1.1 2005/06/19 04:52:54 bitweaver Exp $ +// $Header: /cvsroot/bitweaver/_bit_kernel/admin/index.php,v 1.2 2005/06/19 11:25:02 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. @@ -68,11 +68,11 @@ if (isset($_REQUEST["page"])) { $adminPage = constant( strtoupper( $package ).'_PKG_PATH' ).'/admin/admin_'.$file.'_inc.php'; } -$smarty->assign('package', $package ); -$smarty->assign('file', $file ); + $smarty->assign('package', $package ); + $smarty->assign('file', $file ); include_once ( $adminPage ); // Spiderr - a bit hackish, but need to force preferences refresh -$gBitSystem->loadPreferences(); + $gBitSystem->loadPreferences(); } else { //vd( $gBitSystem->mPackages ); $adminTemplates = array(); @@ -91,6 +91,11 @@ $gBitSystem->loadPreferences(); $admin_panels = $gBitSystem->mAppMenu; $smarty->assign('admin_panels', $admin_panels); +if( !empty( $_REQUEST['version_check'] ) ) { + $smarty->assign( 'version_info', $gBitSystem->checkBitVersion() ); + //vd($gBitSystem->checkBitVersion()); +} + // Display the template $gBitSystem->display( 'bitpackage:kernel/admin.tpl' ); diff --git a/setup_inc.php b/setup_inc.php index 4c153b7..69762d8 100644 --- a/setup_inc.php +++ b/setup_inc.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_kernel/setup_inc.php,v 1.1 2005/06/19 04:52:53 bitweaver Exp $ +// $Header: /cvsroot/bitweaver/_bit_kernel/setup_inc.php,v 1.2 2005/06/19 11:25:02 squareing Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details. @@ -7,10 +7,13 @@ require_once(BIT_ROOT_PATH . 'kernel/config_defaults_inc.php'); error_reporting( BIT_PHP_ERROR_REPORTING ); +// i propose we use: BIT_RELEASE.BIT_RELEASE_COUNT.BIT_RELEASE_SUB_COUNT +// not sure what we should do with BIT_VERSION define('BIT_VERSION', 'Clyde'); -define('BIT_RELEASE', '3'); +define('BIT_RELEASE', '1'); +define('BIT_RELEASE_COUNT', '0'); +define('BIT_RELEASE_SUB_COUNT', '0'); define('BIT_RELEASE_LEVEL', 'BETA'); -define('BIT_RELEASE_COUNT', '2'); $dbversion_tiki = BIT_VERSION; define('BIT_PKG_PATH', BIT_ROOT_PATH); diff --git a/templates/admin.tpl b/templates/admin.tpl index de56e26..5d69f68 100644 --- a/templates/admin.tpl +++ b/templates/admin.tpl @@ -23,6 +23,45 @@ {* SPIDERKILL FOR NOW include file="bitpackage:kernel/anchors.tpl" *} {include file="bitpackage:$package/admin_`$file`.tpl"} {else} + {if $version_info.error.number ne 0} + {formfeedback error=$version_info.error.string} + {elseif $version_info} + {legend legend="Version Check"} + {if $version_info.compare eq 0 and !$version_info.release} + {formfeedback success="{tr}Your version is up to date.{/tr}"} + {elseif $version_info.compare lt 0 or $version_info.release} + {formfeedback warning="{tr}Your version is not up to date.{/tr}"} + {/if} + + <div class="row"> + {formlabel label="Your Version"} + {forminput} + <strong>bitweaver {$version_info.local}</strong> + {/forminput} + </div> + + {if $version_info.compare lt 0} + <div class="row"> + {formlabel label="Upgrade"} + {forminput class=warning} + <strong>bitweaver {$version_info.upgrade}</strong> + {formhelp page="Release_`$version_info.upgrade`} + {/forminput} + </div> + {/if} + + {if $version_info.release} + <div class="row"> + {formlabel label="Latest Release"} + {forminput class=warning} + <strong>bitweaver {$version_info.release}</strong> + {formhelp page="Release_`$version_info.release`} + {/forminput} + </div> + {/if} + {/legend} + {/if} + <table width="100%" class="menutable"> <tr> <td style="width:25%;vertical-align:top;" rowspan="10"> |
