Created
August 9, 2015 13:43
-
-
Save gmoigneu/ef9835775a6a37ad6c96 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
<crontab> | |
<jobs> | |
<your_module_getfile> | |
<schedule><cron_expr>30 2 * * *</cron_expr></schedule> | |
<run><model>your_module/observer::getLocalFileForCronJob</model></run> | |
</gem_crawler_generate> | |
</jobs> | |
</crontab> |
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
// Helper Data | |
class Your_Module_Helper_Data extends Mage_Core_Helper_Abstract | |
{ | |
protected function handleFile($file) { | |
// Open file and do whatever you want | |
} | |
} |
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
class Your_Module_Model_Observer | |
{ | |
protected function getLocalFileForCronjob() { | |
// Get the file | |
$file = ... | |
// Send it to the helper | |
Mage::helper('yourModule')->handleFile($file); | |
} | |
} |
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
class TestCrontroller extends Controller | |
{ | |
public function uploadFile() { | |
// Get the file | |
$file = ... | |
// Send it to the helper | |
Mage::helper('yourModule')->handleFile($file); | |
return $whatever; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment