| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace ThurData\Servers\KerioEmail\Core\Configuration\Addon\Update\Patch;
- use ThurData\Servers\KerioEmail\Core\Helper\DatabaseHelper;
- use ThurData\Servers\KerioEmail\Core\ModuleConstants;
- /**
- * Description of AbstractPatch
- *
- * @autor ThurData <info@thrudata.ch>
- */
- class AbstractPatch
- {
- /**
- * @var DatabaseHelper
- */
- protected $databaseHelper;
- /**
- * @var string
- */
- private $path;
- /**
- * @var string
- */
- private $versionName;
- protected $version;
- /**
- * @param DatabaseHelper $databaseHelper
- */
- public function __construct(DatabaseHelper $databaseHelper)
- {
- $this->databaseHelper = $databaseHelper;
- $this->path = ModuleConstants::getModuleRootDir() . DS . 'app' . DS . 'Database';
- $this->versionName = end(explode("\\",get_called_class()));
- }
- /**
- * @return bool
- */
- protected function runSchema()
- {
- return ($this->databaseHelper->performQueryFromFile($this->path . DS . $this->versionName . DS . 'schema.sql') === true)
- ?false
- :true;
- }
- /**
- * @return bool
- */
- protected function runData()
- {
- return ($this->databaseHelper->performQueryFromFile($this->path . DS . $this->versionName . DS . 'data.sql') === true)
- ?false
- :true;
- }
- public function setVersion($version = null)
- {
- $this->version = $version;
- return $this;
- }
- public function getVersion()
- {
- return $this->version;
- }
- public function execute()
- {
-
- }
- }
|