Exemplo n.º 1
0
	public function __construct()
	{
		parent::__construct();

		$this->addStage(array(
			'PERCENT' => 10,
			'CODE' => 'CREATE_TYPES',
			'CALLBACK' => 'stageCreateTypes'
		));

		$this->addStage(array(
			'PERCENT' => 30,
			'CODE' => 'CONVERT_TREE',
			'CALLBACK' => 'stageConvertTree'
			//'SUBPERCENT_CALLBACK' => 'getSubpercentForStageProcessFiles'
		));

		$this->addStage(array(
			'PERCENT' => 50,
			'CODE' => 'CONVERT_ZONES',
			'CALLBACK' => 'stageConvertZones'
		));

		$this->addStage(array(
			'PERCENT' => 70,
			'CODE' => 'CONVERT_LINKS',
			'CALLBACK' => 'stageConvertLinks'
		));

		$this->addStage(array(
			'PERCENT' => 90,
			'STEP_SIZE' => 1,
			'CODE' => 'COPY_DEFAULT_LOCATIONS',
			'CALLBACK' => 'stageCopyDefaultLocations'
		));

		$this->addStage(array(
			'PERCENT' => 100,
			'STEP_SIZE' => 1,
			'CODE' => 'COPY_ZIP_CODES',
			'CALLBACK' => 'stageCopyZipCodes'
		));
	}
Exemplo n.º 2
0
 public function __construct($options)
 {
     if ($options['ONLY_DELETE_ALL']) {
         $this->addStage(array('PERCENT' => 100, 'CODE' => 'DELETE_ALL', 'CALLBACK' => 'stageDeleteAll', 'SUBPERCENT_CALLBACK' => 'getSubpercentForstageDeleteAll'));
     } else {
         $this->addStage(array('PERCENT' => 5, 'CODE' => 'DOWNLOAD_FILES', 'CALLBACK' => 'stageDownloadFiles', 'SUBPERCENT_CALLBACK' => 'getSubpercentForStageDownloadFiles'));
         if ($_REQUEST['OPTIONS']['DROP_ALL']) {
             $this->addStage(array('PERCENT' => 7, 'CODE' => 'DELETE_ALL', 'CALLBACK' => 'stageDeleteAll', 'SUBPERCENT_CALLBACK' => 'getSubpercentForstageDeleteAll'));
         }
         $this->addStage(array('PERCENT' => 10, 'CODE' => 'DROP_INDEXES', 'CALLBACK' => 'stageDropIndexes', 'SUBPERCENT_CALLBACK' => 'getSubpercentForStageDropIndexes'));
         $this->addStage(array('PERCENT' => 60, 'STEP_SIZE' => 6000, 'CODE' => 'PROCESS_FILES', 'CALLBACK' => 'stageProcessFiles', 'SUBPERCENT_CALLBACK' => 'getSubpercentForStageProcessFiles'));
         if ($_REQUEST['OPTIONS']['INTEGRITY_PRESERVE']) {
             $this->addStage(array('PERCENT' => 65, 'STEP_SIZE' => 1, 'CODE' => 'INTEGRITY_PRESERVE', 'CALLBACK' => 'stageIntegrityPreserve'));
         }
         $this->addStage(array('PERCENT' => 90, 'STEP_SIZE' => 1, 'CODE' => 'REBALANCE_WALK_TREE', 'CALLBACK' => 'stageRebalanceWalkTree', 'SUBPERCENT_CALLBACK' => 'getSubpercentForStageRebalanceWalkTree'));
         $this->addStage(array('PERCENT' => 95, 'STEP_SIZE' => 1, 'CODE' => 'REBALANCE_CLEANUP_TEMP_TABLE', 'CALLBACK' => 'stageRebalanceCleanupTempTable'));
         $this->addStage(array('PERCENT' => 100, 'STEP_SIZE' => 1, 'CODE' => 'RESTORE_INDEXES', 'CALLBACK' => 'stageRestoreIndexes', 'SUBPERCENT_CALLBACK' => 'getSubpercentForStageRestoreIndexes'));
     }
     $this->dbConnection = Main\HttpApplication::getConnection();
     $this->dbConnType = $this->dbConnection->getType();
     $this->dbHelper = $this->dbConnection->getSqlHelper();
     parent::__construct($options);
 }