From 4ec30e83c446ddf0758f015d9ad5c5aebd2f0ca6 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Fri, 11 Mar 2011 10:02:36 +0100 Subject: bootos getressources --- application/controllers/BootosController.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'application/controllers') diff --git a/application/controllers/BootosController.php b/application/controllers/BootosController.php index 37886b4..3a7ab90 100644 --- a/application/controllers/BootosController.php +++ b/application/controllers/BootosController.php @@ -10,6 +10,7 @@ class BootosController extends Zend_Controller_Action public function indexAction() { + $bootosmapper = new Application_Model_BootOsMapper(); $groupmapper = new Application_Model_GroupMapper(); @@ -50,13 +51,21 @@ class BootosController extends Zend_Controller_Action $bootos->setCreated(time()); try { - $bootosmapper->save($bootos); + $bootosID = $bootosmapper->save($bootos); + + $initpath = "../resources/bootos/".$bootosID."/initramfs/"; + $kernelpath = "../resources/bootos/".$bootosID."/kernel/"; + + exec("wget -P ".$kernelpath." ".$bootos->getPath_kernel()); + exec("wget -P ".$initpath." ".$bootos->getPath_init()); + }catch(Zend_Exception $e) { echo "Caught exception: " . get_class($e) . "
"; echo "Message: " . $e->getMessage() . "
"; } + $this->_redirect('/bootos'); } } -- cgit v1.2.3-55-g7522