functional.php 792 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /*
  3. * This file is part of the symfony package.
  4. * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. // guess current application
  10. if (!isset($app))
  11. {
  12. $traces = debug_backtrace();
  13. $caller = $traces[0];
  14. $dirPieces = explode(DIRECTORY_SEPARATOR, dirname($caller['file']));
  15. $app = array_pop($dirPieces);
  16. }
  17. require_once dirname(__FILE__).'/../../config/ProjectConfiguration.class.php';
  18. $configuration = ProjectConfiguration::getApplicationConfiguration($app, 'test', isset($debug) ? $debug : true);
  19. sfContext::createInstance($configuration);
  20. // remove all cache
  21. sfToolkit::clearDirectory(sfConfig::get('sf_app_cache_dir'));