Ejemplo n.º 1
0
    /**
     * Synchronize the codebase
     *
     * This method is used to synchronize the codebase and generate the
     * code for the actions that don't exist yet. The synchronisation is
     * done by comparing the existing file names. The ones that don't exist
     * will be created.
     *
     * @return Zend_View
     */
    public function syncAction()
    {
        $this->_helper->viewRenderer->setNoRender();
        $model = new Default_Model_Action;

        $dir  = ROOT_PATH . DIRECTORY_SEPARATOR . 'custom' . DIRECTORY_SEPARATOR . 'Action';
        if (!is_writable($dir)) {
            $this->addMessage(sprintf($this->tr->_('ACTION_WRITE_ERROR'), $dir));
            $this->_redirect('/action');
        }
        $model->sync();
        $this->addMessage($this->tr->_('ACTION_DEV_SYNC_SUCCESS'));
        $this->_redirect('/action');
    }
Ejemplo n.º 2
0
 public function syncAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $model = new Default_Model_Action();
     $dir = ROOT_PATH . DIRECTORY_SEPARATOR . 'custom' . DIRECTORY_SEPARATOR . 'Action';
     if (!is_writable($dir)) {
         $this->addMessage('The path : "' . $dir . '" is not currently writeable by this user, ' . 'therefore we cannot synchronize the codebase');
         $this->_redirect('/action');
     }
     $model->sync();
     $this->addMessage('Development environment has been sychronized');
     $this->_redirect('/action');
 }
Ejemplo n.º 3
0
 /**
  * Sync the actions
  *
  * This is the sync actions method. It syncs actions to the files.
  *
  * @return void
  */
 public function syncAction()
 {
     $this->_helper->viewRenderer->setViewSuffix('txt');
     $dir = CUSTOM_PATH . DIRECTORY_SEPARATOR . 'Action';
     if (!is_writable($dir)) {
         $this->view->message = $this->tr->_('ACTION_WRITE_ERROR', $dir) . PHP_EOL;
         return;
     }
     $model = new Default_Model_Action();
     try {
         $model->sync();
         $this->view->message = $this->tr->_('ACTION_DEV_SYNC_SUCCESS') . PHP_EOL;
     } catch (RuntimeException $e) {
         $this->view->message = $this->tr->_('ACTION_ERROR_SYNCHRO') . ' ' . $e->getMessage();
     }
 }
Ejemplo n.º 4
0
 /**
  * Sync the actions
  *
  * This is the sync actions method. It syncs actions to the files.
  *
  * @return void
  */
 public function syncAction()
 {
     $this->_helper->viewRenderer->setViewSuffix('txt');
     $dir = ROOT_PATH . DIRECTORY_SEPARATOR . 'custom' . DIRECTORY_SEPARATOR . 'Action';
     if (!is_writable($dir)) {
         $this->view->message = 'The path : "' . $dir . '" is not currently writeable by this user, ' . 'therefore we cannot synchronize the codebase' . PHP_EOL;
         return;
     }
     $model = new Default_Model_Action();
     try {
         $model->sync();
         $this->view->message = 'All actions have been synced successfully.' . PHP_EOL;
     } catch (RuntimeException $e) {
         $this->view->message = 'Error synchronizing actions. ' . $e->getMessage();
     }
 }