-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
require_once 'abstract.php'; | ||
|
||
/** | ||
* CoScale shell script that will reset the different elements of the module | ||
* | ||
* @package CoScale_Monitor | ||
* @author Mihai Oprea <[email protected]> | ||
* @created 2016-08-11 | ||
* @version 1.0 | ||
*/ | ||
class CoScale_Reset extends Mage_Shell_Abstract | ||
{ | ||
/** | ||
* Execute the script | ||
*/ | ||
public function run() | ||
{ | ||
$helper = Mage::helper('coscale_monitor'); | ||
|
||
// Reset data | ||
try { | ||
$helper->debugStart('Metrics reset'); | ||
Mage::getResourceModel('coscale_monitor/metric')->truncate(); | ||
|
||
Mage::getSingleton('coscale_monitor/metric_order')->initOrderData(); | ||
Mage::getSingleton('coscale_monitor/metric_customer')->updateTotalCount(); | ||
Mage::getSingleton('coscale_monitor/metric_product')->updateTotalCount(); | ||
$helper->debugEnd('Metrics reset'); | ||
} catch (Exception $ex) { | ||
$helper->debugEndError('Reset script', $ex); | ||
} | ||
} | ||
} | ||
|
||
$shell = new CoScale_Reset(); | ||
$shell->run(); |