| 1 |
<?php |
| 2 |
/** |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
// Disallow direct access. |
| 7 |
defined('ABSPATH') or die("Access denied"); |
| 8 |
|
| 9 |
// Import dependencies! |
| 10 |
cssJSToolbox::import('includes:installer:upgrade:upgrade.class.php'); |
| 11 |
|
| 12 |
/** |
| 13 |
* |
| 14 |
*/ |
| 15 |
class CJTV03Upgrade extends CJTUpgradeNonTabledVersions { |
| 16 |
|
| 17 |
/** |
| 18 |
* |
| 19 |
*/ |
| 20 |
const BACKUPS_POINTER = 'cjtoolbox_tools_backups'; |
| 21 |
|
| 22 |
/** |
| 23 |
* put your comment there... |
| 24 |
* |
| 25 |
* @var mixed |
| 26 |
*/ |
| 27 |
protected $backups; |
| 28 |
|
| 29 |
/** |
| 30 |
* put your comment there... |
| 31 |
* |
| 32 |
*/ |
| 33 |
public function __construct() { |
| 34 |
// Import dependencies! |
| 35 |
cssJSToolbox::import('includes:installer:upgrade:0.3:includes:backup.class.php'); |
| 36 |
// Instantiate Backups iterator! |
| 37 |
$this->backups = new CJTInstallerBackup(get_option(self::BACKUPS_POINTER)); |
| 38 |
// Initialize hookable! |
| 39 |
parent::__construct(); |
| 40 |
} |
| 41 |
|
| 42 |
/** |
| 43 |
* put your comment there... |
| 44 |
* |
| 45 |
*/ |
| 46 |
public function backups() { |
| 47 |
// No custom work is neede for now just upgrade backups! |
| 48 |
foreach ($this->backups as $backup) { |
| 49 |
$this->backups->upgrade(); |
| 50 |
} |
| 51 |
return $this; |
| 52 |
} |
| 53 |
|
| 54 |
/** |
| 55 |
* put your comment there... |
| 56 |
* |
| 57 |
*/ |
| 58 |
public function finalize() { |
| 59 |
// Delete backups data! |
| 60 |
delete_option(self::BACKUPS_POINTER); |
| 61 |
// Parent finalize! |
| 62 |
return parent::finalize(); |
| 63 |
} |
| 64 |
|
| 65 |
/** |
| 66 |
* put your comment there... |
| 67 |
* |
| 68 |
* @param mixed $blocks |
| 69 |
*/ |
| 70 |
protected function getBlocksIterator($blocks) { |
| 71 |
// Import iterator class file! |
| 72 |
cssJSToolbox::import('includes:installer:upgrade:0.3:includes:block.class.php'); |
| 73 |
// Instantiate blocks iterator object! |
| 74 |
return new CJTInstallerBlocks03($blocks); |
| 75 |
} |
| 76 |
|
| 77 |
/** |
| 78 |
* put your comment there... |
| 79 |
* |
| 80 |
*/ |
| 81 |
public static function getInstance() { |
| 82 |
return new CJTV03Upgrade(); |
| 83 |
} |
| 84 |
|
| 85 |
} // End class. |