Controller/UpdateController.php
/**
     * Update all packages (dry run)
     *
     * @return Response
     */
Update all packages (dry run)
@return Response
Update all packages ( dry run ) @return Response
public function dryRunAction()
    {
        $success = true;
        $path = realpath($this->get('kernel')->getRootDir() . '/../');
        $options = $this->container->getParameter('automatic_update.options');
        $commands = array();
        $secret = isset($_POST['secret'])?$_POST['secret']:false;
        if ($rightsecret = $secret == $options['secret']) {
            foreach ($options['dry_run_commands'] as $command) {
                $object = $this->runCommand($path, $command);
                $commands[] = $object;
                if ($object->result) {
                    $success = false;
                    break;
                }
            }
        } else {
            $success = false;
        }
        $username = exec('whoami');;
        $hostname = trim(gethostname());
        return $this->render(
            'LswAutomaticUpdateBundle:Update:dry_run.html.twig',
            compact('username', 'hostname', 'path', 'commands', 'success', 'secret', 'rightsecret')
        );
    }
public function dryRunAction ( ) { $ success = true ; $ path = realpath ( $ this -> get ( 'kernel' ) -> getRootDir ( ) . '/../' ) ; $ options = $ this -> container -> getParameter ( 'automatic_update.options' ) ; $ commands = array ( ) ; $ secret = isset ( $ _POST [ 'secret' ] ) ? $ _POST [ 'secret' ] : false ; if ( $ rightsecret = $ secret == $ options [ 'secret' ] ) { foreach ( $ options [ 'dry_run_commands' ] as $ command ) { $ object = $ this -> runCommand ( $ path , $ command ) ; $ commands [ ] = $ object ; if ( $ object -> result ) { $ success = false ; break ; } } } else { $ success = false ; } $ username = exec ( 'whoami' ) ; ; $ hostname = trim ( gethostname ( ) ) ; return $ this -> render ( 'LswAutomaticUpdateBundle:Update:dry_run.html.twig' , compact ( 'username' , 'hostname' , 'path' , 'commands' , 'success' , 'secret' , 'rightsecret' ) ) ; }
Update all packages (dry run)
 @return Response
Update all packages ( dry run ) @return Response