Created
August 11, 2010 11:34
-
-
Save fprochazka/518847 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class Dependencies extends \Nette\Object | |
{ | |
/** | |
* Package version | |
*/ | |
//const VERSION = 0; // 1.0.0 | |
/** | |
* Unique key generated by system for specific extension | |
*/ | |
//const EXT_KEY = NULL; | |
/** | |
* List of dependencies that must be met for appropriate behaviour | |
*/ | |
protected $dependencies = array( | |
//'dependencyKey' => array('>=', 'version'); | |
); | |
private $init = False; | |
public function __construct() | |
{ | |
if( !defined(get_class($this).'::VERSION') OR !defined(get_class($this).'::EXT_KEY') ){ | |
throw new InvalidExtensionSetupException("Extension loader ".get_class($this)." has to have VERSION & EXT_KEY constants declared."); | |
} | |
// kontrola závislostí | |
$this->init = True; | |
} | |
final public function isInitialized() | |
{ | |
return $this->init; | |
} | |
final public function getVersion() | |
{ | |
return constant(get_class($this).'::VERSION'); | |
} | |
final public function getExtKey() | |
{ | |
return constant(get_class($this).'::EXT_KEY'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment