Changeset 2305 for plugins/dcFilterDuplicate/_install.php
- Timestamp:
- 06/06/10 01:00:49 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcFilterDuplicate/_install.php
r1981 r2305 3 3 # This file is part of dcFilterDuplicate, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 16 16 $new_version = $core->plugins->moduleInfo('dcFilterDuplicate','version'); 17 17 $old_version = $core->getVersion('dcFilterDuplicate'); 18 18 19 # Compare versions 19 20 if (version_compare($old_version,$new_version,'>=')) {return;} 21 20 22 # Install or update 21 try { 22 # Check DC version (dev on) 23 if (!version_compare(DC_VERSION,'2.1.5','>=')) { 24 throw new Exception('Plugin called dcFilterDuplicate requires Dotclear 2.1.5 or higher.'); 23 try 24 { 25 # Check version 26 if (version_compare(DC_VERSION,'2.2-beta','<')) 27 { 28 throw new Exception('dcFilterDuplicate requires Dotclear 2.2'); 25 29 } 26 # Check DC version (new settings) 27 if (version_compare(DC_VERSION,'2.2','>=')) { 28 throw new Exception('Plugin called dcFilterDuplicate requires Dotclear up to 2.2.'); 29 } 30 30 31 # Settings 31 $s = null; 32 $s =& $core->blog->settings; 33 $s->setNameSpace('dcFilterDuplicate'); 34 $s->put('dcfilterduplicate_minlen',30,'integer','Minimum lenght of comment to filter',false,true); 35 $s->setNameSpace('system'); 32 $core->blog->settings->addNamespace('dcFilterDuplicate'); 33 $core->blog->settings->dcFilterDuplicate->put('dcfilterduplicate_minlen',30,'integer','Minimum lenght of comment to filter',false,true); 34 36 35 # Version 37 36 $core->setVersion('dcFilterDuplicate',$new_version); 38 # All right baby 37 39 38 return true; 40 39 } 41 catch (Exception $e) { 40 catch (Exception $e) 41 { 42 42 $core->error->add($e->getMessage()); 43 43 return false;
Note: See TracChangeset
for help on using the changeset viewer.