PHPEdit.net Community
   
1 2 3 4
Tutorials Tips Pasties Code Snippets
 

Home > Pasties > Pastie #13a

Created on 25/11/2009 10:31 by Anonymous

  1. <?php
  2.  
  3.  
  4.  
  5. require_once(dirname(__FILE__).'/../autoload/sfCoreAutoload.class.php'
    );
  6. sfCoreAutoload::register();
  7.  
  8. try
  9. {
  10. $dispatcher = new sfEventDispatcher();
  11. $logger = new sfCommandLogger($dispatcher);
  12.  
  13. $application = new sfSymfonyCommandApplication($dispatcher, new
    sfAnsiColorFormatter(), array('symfony_lib_dir' =>
    realpath(dirname(__FILE__).'/..')));
  14. $statusCode = $application->run();
  15. }
  16. catch (Exception $e)
  17. {
  18. if (!isset($application))
  19. {
  20. throw $e;
  21. }
  22.  
  23. $application->renderException($e);
  24. $statusCode = $e->getCode();
  25.  
  26. exit(is_numeric($statusCode) && $statusCode ? $statusCode : 1);
  27. }
  28.  
  29. exit(is_numeric($statusCode) ? $statusCode : 0);
  30. ?>

 
PHPEdit User Community, © 2008 WaterProof SARL
Powered by PHPEdit