Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for verison verification

  • Loading branch information...
commit e1010293adc302dfbc249b678738ff1e4af909f8 1 parent 0338031
@romaninsh romaninsh authored
Showing with 21 additions and 3 deletions.
  1. +18 −0 lib/ApiCLI.php
  2. +3 −3 lib/ApiFrontend.php
View
18 lib/ApiCLI.php
@@ -180,5 +180,23 @@ function readConfig($file='config.php'){
function setConfig($config=array()){
$this->config=safe_array_merge($this->config,$config);
}
+ private $version_cache=null;
+ function versionRequirement($v,$return_only=false){
+ if(!$this->version_cache){
+ $f=dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'VERSION';
+ if(file_exists($f)){
+ $this->version_cache=trim(file_get_contents($f));
+ }else{
+ $this->version_cache='4.0.1';
+ }
+ }
+
+ if(($vc=version_compare($this->version_cache,$v))<0){
+ if($soft)return false;
+ throw new BaseException('Agile Toolkit is too old. Required at least: '.$v.', you have '.$this->version_cache);
+ }
+ return true;
+
+ }
}
?>
View
6 lib/ApiFrontend.php
@@ -35,9 +35,9 @@
* Created on 23.09.2008 by *Camper* (cmd@adevel.com)
*/
class ApiFrontend extends ApiWeb{
- protected $page_object=null;
- protected $content_type='page'; // content type: rss/page/etc
- protected $page_class='Page';
+ public $page_object=null;
+ public $content_type='page'; // content type: rss/page/etc
+ public $page_class='Page';
function init(){
parent::init();
Please sign in to comment.
Something went wrong with that request. Please try again.