コード例 #1
0
    protected function tearDown()
    {
        $filesystem = new Filesystem();
        $filesystem->remove($this->dir);

        $this->dir = null;
    }
コード例 #2
0
ファイル: bootstrapTest.php プロジェクト: rouffj/Sismo
 public function tearDown()
 {
     parent::tearDown();
     $this->app['storage']->close();
     $fs = new Filesystem();
     $fs->remove($this->baseDir);
 }
コード例 #3
0
 /**
  * @see Command
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->writeSection($output, '[Propel] You are running the command: propel:build-sql');
     if ($input->getOption('verbose')) {
         $this->additionalPhingArgs[] = 'verbose';
     }
     $finder = new Finder();
     $filesystem = new Filesystem();
     $sqlDir = $this->getApplication()->getKernel()->getRootDir() . DIRECTORY_SEPARATOR . 'propel' . DIRECTORY_SEPARATOR . 'sql';
     $filesystem->remove($sqlDir);
     $filesystem->mkdir($sqlDir);
     // Execute the task
     $ret = $this->callPhing('build-sql', array('propel.sql.dir' => $sqlDir));
     if (true === $ret) {
         $files = $finder->name('*')->in($sqlDir);
         $nbFiles = 0;
         foreach ($files as $file) {
             $this->writeNewFile($output, (string) $file);
             if ('sql' === pathinfo($file->getFilename(), PATHINFO_EXTENSION)) {
                 $nbFiles++;
             }
         }
         $this->writeSection($output, sprintf('<comment>%d</comment> <info>SQL file%s ha%s been generated.</info>', $nbFiles, $nbFiles > 1 ? 's' : '', $nbFiles > 1 ? 've' : 's'), 'bg=black');
     } else {
         $this->writeSection($output, array('[Propel] Error', '', 'An error has occured during the "build-sql" task process. To get more details, run the command with the "--verbose" option.'), 'fg=white;bg=red');
     }
 }
コード例 #4
0
ファイル: WikiCommand.php プロジェクト: hotfics/lichess-old
 /**
  * @see Command
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $fs = new Filesystem();
     $repoUrl = 'git://github.com/ornicar/lichess.wiki.git';
     //$repoUrl = '/home/thib/lichess.wiki/';
     $repoName = 'lichess_wiki';
     $repoDir = '/tmp';
     $repo = $repoDir . '/' . $repoName;
     $fs->remove($repo);
     $command = sprintf('cd %s && git clone %s %s', $repoDir, $repoUrl, $repoName);
     system($command);
     $finder = new Finder();
     $mdFiles = $finder->files()->depth(0)->name('*.md')->in($repo);
     $pages = array();
     foreach ($mdFiles as $mdFile) {
         $name = preg_replace('/^(.+)\\.md$/', '$1', $mdFile->getFileName());
         if ($name == "Home") {
             continue;
         }
         $output->writeLn('* ' . $name);
         $command = sprintf('sundown %s/%s', $repo, $mdFile->getFileName());
         exec($command, $out);
         $body = implode($out, "\n");
         unset($out);
         $pages[] = new WikiPage($name, $body);
     }
     if (empty($pages)) {
         throw new \Exception('No pages to save');
     }
     $this->getContainer()->get('lichess.repository.wiki_page')->replaceWith($pages);
     $this->getContainer()->get('doctrine.odm.mongodb.document_manager')->flush();
     $output->writeLn('Flushed');
 }
コード例 #5
0
ファイル: TranslatorTest.php プロジェクト: novaki/symfony
 protected function deleteTmpDir()
 {
     if (!file_exists($dir = $this->tmpDir)) {
         return;
     }
     $fs = new Filesystem();
     $fs->remove($dir);
 }
コード例 #6
0
 /**
  * Shuts the kernel down if it was used in the test
  * and remove temp files.
  */
 protected function tearDown()
 {
     if (null !== static::$kernel) {
         static::$kernel->shutdown();
         $fs = new Filesystem();
         $fs->remove(static::$tmpPath);
     }
 }
コード例 #7
0
ファイル: WebTestCase.php プロジェクト: usefulthink/symfony
 protected function deleteTmpDir($testCase)
 {
     if (!file_exists($dir = sys_get_temp_dir() . '/' . Kernel::VERSION . '/' . $testCase)) {
         return;
     }
     $fs = new Filesystem();
     $fs->remove($dir);
 }
コード例 #8
0
 protected function setUp()
 {
     $this->cacheDir = __DIR__ . '/Resources/cache';
     if (file_exists($this->cacheDir)) {
         $filesystem = new Filesystem();
         $filesystem->remove($this->cacheDir);
     }
     mkdir($this->cacheDir, 0777, true);
 }
コード例 #9
0
 /**
  * @see Command
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     list($name, $defaultConfig) = $this->getConnection($input, $output);
     $this->callPhing('reverse', array('propel.project' => $name, 'propel.database.url' => $defaultConfig['connection']['dsn'], 'propel.database.database' => $defaultConfig['adapter'], 'propel.database.user' => $defaultConfig['connection']['user'], 'propel.database.password' => $defaultConfig['connection']['password']));
     $filesystem = new Filesystem();
     $dest = $this->getApplication()->getKernel()->getRootDir() . '/propel/' . $name . '_reversed_schema.xml';
     $filesystem->copy($this->getTmpDir() . '/schema.xml', $dest);
     $output->writeln(sprintf('New generated schema is <comment>%s</comment>.', $dest));
 }
コード例 #10
0
ファイル: AppKernel.php プロジェクト: nicolaschenet/testdd
 public function __construct($config)
 {
     parent::__construct('test', true);
     $fs = new Filesystem();
     if (!$fs->isAbsolutePath($config)) {
         $config = __DIR__ . '/config/' . $config;
     }
     if (!file_exists($config)) {
         throw new \RuntimeException(sprintf('The config file "%s" does not exist.', $config));
     }
     $this->config = $config;
 }
コード例 #11
0
ファイル: AppKernel.php プロジェクト: artz20/Tv-shows-zone
 public function __construct($testCase, $rootConfig, $environment, $debug)
 {
     if (!is_dir(__DIR__ . '/' . $testCase)) {
         throw new \InvalidArgumentException(sprintf('The test case "%s" does not exist.', $testCase));
     }
     $this->testCase = $testCase;
     $fs = new Filesystem();
     if (!$fs->isAbsolutePath($rootConfig) && !file_exists($rootConfig = __DIR__ . '/' . $testCase . '/' . $rootConfig)) {
         throw new \InvalidArgumentException(sprintf('The root config "%s" does not exist.', $rootConfig));
     }
     $this->rootConfig = $rootConfig;
     parent::__construct($environment, $debug);
 }
コード例 #12
0
 /**
  * @see Command
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->callPhing('sql', array('propel.packageObjectModel' => false));
     $filesystem = new Filesystem();
     $basePath = $this->getApplication()->getKernel()->getRootDir() . DIRECTORY_SEPARATOR . 'propel' . DIRECTORY_SEPARATOR . 'sql';
     $sqlMap = file_get_contents($basePath . DIRECTORY_SEPARATOR . 'sqldb.map');
     foreach ($this->tempSchemas as $schemaFile => $schemaDetails) {
         $sqlFile = str_replace('.xml', '.sql', $schemaFile);
         $targetSqlFile = $schemaDetails['bundle'] . '-' . str_replace('.xml', '.sql', $schemaDetails['basename']);
         $targetSqlFilePath = $basePath . DIRECTORY_SEPARATOR . $targetSqlFile;
         $sqlMap = str_replace($sqlFile, $targetSqlFile, $sqlMap);
         $filesystem->remove($targetSqlFilePath);
         $filesystem->rename($basePath . DIRECTORY_SEPARATOR . $sqlFile, $targetSqlFilePath);
         $output->writeln(sprintf('Wrote SQL file for bundle "<info>%s</info>" in "<info>%s</info>"', $schemaDetails['bundle'], $targetSqlFilePath));
     }
     file_put_contents($basePath . DIRECTORY_SEPARATOR . 'sqldb.map', $sqlMap);
 }
コード例 #13
0
 /**
  * @see Command
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $container = $this->getApplication()->getKernel()->getContainer();
     $propelConfiguration = $container->get('propel.configuration');
     $name = $input->getOption('connection') ? $input->getOption('connection') : $container->getParameter('propel.dbal.default_connection');
     if (isset($propelConfiguration['datasources'][$name])) {
         $defaultConfig = $propelConfiguration['datasources'][$name];
     } else {
         throw new \InvalidArgumentException(sprintf('Connection named %s doesn\'t exist', $name));
     }
     $output->writeln(sprintf('<info>Generate XML schema from connection named <comment>%s</comment></info>', $name));
     $this->callPhing('reverse', array('propel.project' => $name, 'propel.database.url' => $defaultConfig['connection']['dsn'], 'propel.database.database' => $defaultConfig['adapter'], 'propel.database.user' => $defaultConfig['connection']['user'], 'propel.database.password' => $defaultConfig['connection']['password']));
     $filesystem = new Filesystem();
     $dest = $this->getApplication()->getKernel()->getRootDir() . '/propel/' . $name . '_reversed_schema.xml';
     $filesystem->copy($this->getTmpDir() . '/schema.xml', $dest);
     $output->writeln(sprintf('New generated schema is "<info>%s</info>".', $dest));
 }
コード例 #14
0
 /**
  * @see Command
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     list($name, $defaultConfig) = $this->getConnection($input, $output);
     $this->callPhing('datadump', array('propel.database.url' => $defaultConfig['connection']['dsn'], 'propel.database.database' => $defaultConfig['adapter'], 'propel.database.user' => $defaultConfig['connection']['user'], 'propel.database.password' => $defaultConfig['connection']['password'], 'propel.schema.dir' => $this->getApplication()->getKernel()->getRootDir() . '/propel/schema/'));
     $finder = new Finder();
     $filesystem = new Filesystem();
     $datas = $finder->name('*_data.xml')->in($this->getTmpDir());
     foreach ($datas as $data) {
         $dest = $this->getApplication()->getKernel()->getRootDir() . self::$destPath . '/xml/' . $data->getFilename();
         $filesystem->copy((string) $data, $dest);
         $filesystem->remove($data);
         $output->writeln(sprintf('Wrote dumped data in "<info>%s</info>".', $dest));
     }
     if (count($datas) <= 0) {
         $output->writeln('No new dumped files.');
     }
 }
コード例 #15
0
 /**
  * Prepare the cache directory
  *
  * @param string $tmpdir    The temporary directory path.
  */
 protected function prepareCache($tmpdir)
 {
     // Recreate a propel directory in cache
     $this->filesystem->remove($tmpdir);
     $this->filesystem->mkdir($tmpdir);
     $fixturesdir = $tmpdir . '/fixtures/';
     $this->filesystem->remove($fixturesdir);
     $this->filesystem->mkdir($fixturesdir);
 }
コード例 #16
0
 /**
  * @see Command
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $rootDir = $this->getApplication()->getKernel()->getRootDir();
     $schemaDir = $rootDir . '/propel/schema/';
     $sqlDir = $rootDir . '/propel/sql/';
     $xmlDumpDir = $rootDir . '/propel/dump/xml/';
     $filesystem = new Filesystem();
     $finder = new Finder();
     foreach ($finder->name('*_data.xml')->in($xmlDumpDir) as $data) {
         $filesystem->copy((string) $data, $schemaDir . $data->getFilename());
     }
     $this->callPhing('datasql', array('propel.sql.dir' => $sqlDir, 'propel.schema.dir' => $schemaDir));
     $finder = new Finder();
     foreach ($finder->name('*_data.xml')->in($schemaDir) as $data) {
         $filesystem->remove($data);
     }
     $this->summary($output, 'propel-data-sql');
     $output->writeln(sprintf('SQL from XML data dump file is in <comment>%s</comment>.', $sqlDir));
 }
コード例 #17
0
 /**
  * @see Command
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $items = array("Unlimited", "Rated", "Casual", "No game available right now, create one!", "This game is rated", "White creates the game", "Black creates the game", "White joins the game", "Black joins the game", "Draw offer sent", "Draw offer declined", "Draw offer accepted", "Draw offer canceled", "Takeback proposition sent", "Takeback proposition declined", "Takeback proposition accepted", "Takeback proposition canceled", "Game over", "Your turn", "Waiting for opponent");
     $tm = $this->getContainer()->get('lichess_translation.manager');
     $translator = $this->getContainer()->get('translator');
     $fs = new Filesystem();
     $dir = $this->getContainer()->getParameter('kernel.root_dir') . '/../web/trans';
     $fs->mkdir($dir);
     foreach ($tm->getAvailableLanguages() as $code => $name) {
         $translator->setLocale($code);
         $translations = array();
         foreach ($items as $item) {
             $translations[$item] = $translator->trans($item);
         }
         $content = sprintf("lichess_translations = %s;", json_encode($translations));
         $file = sprintf("%s/%s.js", $dir, $code);
         file_put_contents($file, $content);
     }
     $output->writeLn('Done');
 }
コード例 #18
0
 /**
  * @see Command
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->writeSection($output, '[Propel] You are running the command: propel:reverse');
     if ($input->getOption('verbose')) {
         $this->additionalPhingArgs[] = 'verbose';
     }
     list($name, $defaultConfig) = $this->getConnection($input, $output);
     $ret = $this->callPhing('reverse', array('propel.project' => $name, 'propel.database.url' => $defaultConfig['connection']['dsn'], 'propel.database.database' => $defaultConfig['adapter'], 'propel.database.user' => $defaultConfig['connection']['user'], 'propel.database.password' => isset($defaultConfig['connection']['password']) ? $defaultConfig['connection']['password'] : ''));
     if (true === $ret) {
         $filesystem = new Filesystem();
         $generated = $this->getCacheDir() . '/schema.xml';
         $filename = $name . '_reversed_schema.xml';
         $destFile = $this->getApplication()->getKernel()->getRootDir() . '/propel/generated-schemas/' . $filename;
         if (file_exists($generated)) {
             $filesystem->copy($generated, $destFile);
             $output->writeln(array('', sprintf('>>  <info>File+</info>    %s', $destFile)));
         } else {
             $output->writeln(array('', 'No generated files.'));
         }
     } else {
         $this->writeTaskError($output, 'reverse');
     }
 }
コード例 #19
0
 /**
  * @see Command
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($input->getOption('verbose')) {
         $this->additionalPhingArgs[] = 'verbose';
     }
     if (true === $this->callPhing('sql', array('propel.packageObjectModel' => false))) {
         $this->writeSection($output, '[Propel] You are running the command: propel:build-sql');
         $filesystem = new Filesystem();
         $basePath = $this->getApplication()->getKernel()->getRootDir() . DIRECTORY_SEPARATOR . 'propel' . DIRECTORY_SEPARATOR . 'sql';
         $sqlMap = file_get_contents($basePath . DIRECTORY_SEPARATOR . 'sqldb.map');
         foreach ($this->tempSchemas as $schemaFile => $schemaDetails) {
             $sqlFile = str_replace('.xml', '.sql', $schemaFile);
             $targetSqlFile = $schemaDetails['bundle'] . '-' . str_replace('.xml', '.sql', $schemaDetails['basename']);
             $targetSqlFilePath = $basePath . DIRECTORY_SEPARATOR . $targetSqlFile;
             $sqlMap = str_replace($sqlFile, $targetSqlFile, $sqlMap);
             $filesystem->remove($targetSqlFilePath);
             $filesystem->rename($basePath . DIRECTORY_SEPARATOR . $sqlFile, $targetSqlFilePath);
             $output->writeln(sprintf('Wrote SQL file for bundle <info>%s</info> in <comment>%s</comment>.', $schemaDetails['bundle'], $targetSqlFilePath));
         }
         file_put_contents($basePath . DIRECTORY_SEPARATOR . 'sqldb.map', $sqlMap);
     } else {
         $output->writeln('<error>WARNING ! An error has occured.</error>');
     }
 }
コード例 #20
0
 /**
  * @see Command
  *
  * @throws \InvalidArgumentException When the target directory does not exist
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $container = $this->getApplication()->getKernel()->getContainer();
     $propelConfiguration = $container->get('propel.configuration');
     $name = $input->getOption('connection') ? $input->getOption('connection') : $container->getParameter('propel.dbal.default_connection');
     if (isset($propelConfiguration['datasources'][$name])) {
         $defaultConfig = $propelConfiguration['datasources'][$name];
     } else {
         throw new \InvalidArgumentException(sprintf('Connection named %s doesn\'t exist', $name));
     }
     $output->writeln(sprintf('<info>Generate XML schema from connection named <comment>%s</comment></info>', $name));
     $this->callPhing('datadump', array('propel.database.url' => $defaultConfig['connection']['dsn'], 'propel.database.database' => $defaultConfig['adapter'], 'propel.database.user' => $defaultConfig['connection']['user'], 'propel.database.password' => $defaultConfig['connection']['password'], 'propel.schema.dir' => $this->getApplication()->getKernel()->getRootDir() . '/propel/schema/'));
     $finder = new Finder();
     $filesystem = new Filesystem();
     $datas = $finder->name('*_data.xml')->in($this->getTmpDir());
     foreach ($datas as $data) {
         $dest = $this->getApplication()->getKernel()->getRootDir() . self::$destPath . '/xml/' . $data->getFilename();
         $filesystem->copy((string) $data, $dest);
         $output->writeln(sprintf('Wrote dumped data in "<info>%s</info>".', $dest));
     }
     if (count($datas) <= 0) {
         $output->writeln('No new dumped files.');
     }
 }
コード例 #21
0
<?php

require_once __DIR__ . '/../app/bootstrap.php.cache';
require '../app/autoload.php';
use Symfony\Component\HttpKernel\Util\Filesystem;
$file = new Filesystem();
$file->remove(sys_get_temp_dir() . '/sf2standard');
コード例 #22
0
 /**
  * Create a 'build.properties' file.
  *
  * @param KernelInterface $kernel   The application kernel.
  * @param string $file  Should be 'build.properties'.
  */
 protected function createBuildPropertiesFile(KernelInterface $kernel, $file)
 {
     $filesystem = new Filesystem();
     $buildPropertiesFile = $kernel->getRootDir() . '/config/propel.ini';
     if (file_exists($buildPropertiesFile)) {
         $filesystem->copy($buildPropertiesFile, $file);
     } else {
         $filesystem->touch($file);
     }
 }
コード例 #23
0
ファイル: PhingCommand.php プロジェクト: rozwell/PropelBundle
 /**
  * Call a Phing task.
  *
  * @param string $taskName  A Propel task name.
  * @param array $properties An array of properties to pass to Phing.
  */
 protected function callPhing($taskName, $properties = array())
 {
     $kernel = $this->getApplication()->getKernel();
     $filesystem = new Filesystem();
     if (isset($properties['propel.schema.dir'])) {
         $this->tmpDir = $properties['propel.schema.dir'];
     } else {
         $this->tmpDir = sys_get_temp_dir() . '/propel-gen';
         $filesystem->remove($this->tmpDir);
         $filesystem->mkdir($this->tmpDir);
     }
     foreach ($kernel->getBundles() as $bundle) {
         if (is_dir($dir = $bundle->getPath() . '/Resources/config')) {
             $finder = new Finder();
             $schemas = $finder->files()->name('*schema.xml')->followLinks()->in($dir);
             $parts = explode(DIRECTORY_SEPARATOR, realpath($bundle->getPath()));
             $length = count(explode('\\', $bundle->getNamespace())) * -1;
             $prefix = implode('.', array_slice($parts, 1, $length));
             foreach ($schemas as $schema) {
                 $tempSchema = md5($schema) . '_' . $schema->getBaseName();
                 $this->tempSchemas[$tempSchema] = array('bundle' => $bundle->getName(), 'basename' => $schema->getBaseName(), 'path' => $schema->getPathname());
                 $file = $this->tmpDir . DIRECTORY_SEPARATOR . $tempSchema;
                 $filesystem->copy((string) $schema, $file);
                 // the package needs to be set absolute
                 // besides, the automated namespace to package conversion has not taken place yet
                 // so it needs to be done manually
                 $database = simplexml_load_file($file);
                 if (isset($database['package'])) {
                     $database['package'] = $prefix . '.' . $database['package'];
                 } elseif (isset($database['namespace'])) {
                     $database['package'] = $prefix . '.' . str_replace('\\', '.', $database['namespace']);
                 } else {
                     throw new \RuntimeException(sprintf('Please define a `package` attribute or a `namespace` attribute for schema `%s`', $schema->getBaseName()));
                 }
                 foreach ($database->table as $table) {
                     if (isset($table['package'])) {
                         $table['package'] = $prefix . '.' . $table['package'];
                     } elseif (isset($table['namespace'])) {
                         $table['package'] = $prefix . '.' . str_replace('\\', '.', $table['namespace']);
                     } else {
                         $table['package'] = $database['package'];
                     }
                 }
                 file_put_contents($file, $database->asXML());
             }
         }
     }
     // build.properties
     $this->buildPropertiesFile = $kernel->getRootDir() . '/config/propel.ini';
     $filesystem->touch($this->buildPropertiesFile);
     $filesystem->copy($this->buildPropertiesFile, $this->tmpDir . '/build.properties');
     // Required by the Phing task
     $this->createBuildTimeFile($this->tmpDir . '/buildtime-conf.xml');
     $args = array();
     $properties = array_merge(array('propel.database' => 'mysql', 'project.dir' => $this->tmpDir, 'propel.output.dir' => $kernel->getRootDir() . '/propel', 'propel.php.dir' => '/', 'propel.packageObjectModel' => true), $properties);
     $properties = array_merge($properties, $this->getContainer()->get('propel.build_properties')->getProperties());
     foreach ($properties as $key => $value) {
         $args[] = "-D{$key}={$value}";
     }
     // Build file
     $args[] = '-f';
     $args[] = realpath($this->getContainer()->getParameter('propel.path') . '/generator/build.xml');
     $bufferPhingOutput = !$this->getContainer()->getParameter('kernel.debug');
     // Add any arbitrary arguments last
     foreach ($this->additionalPhingArgs as $arg) {
         if (in_array($arg, array('verbose', 'debug'))) {
             $bufferPhingOutput = false;
         }
         $args[] = '-' . $arg;
     }
     $args[] = $taskName;
     // enable output buffering
     Phing::setOutputStream(new \OutputStream(fopen('php://output', 'w')));
     Phing::setErrorStream(new \OutputStream(fopen('php://output', 'w')));
     Phing::startup();
     Phing::setProperty('phing.home', getenv('PHING_HOME'));
     ob_start();
     $phing = new Phing();
     $returnStatus = true;
     // optimistic way
     try {
         $phing->execute($args);
         $phing->runBuild();
         $this->buffer = ob_get_contents();
         $returnStatus = false !== preg_match('#failed. Aborting.#', $this->buffer);
     } catch (Exception $e) {
         $returnStatus = false;
     }
     if ($bufferPhingOutput) {
         ob_end_clean();
     } else {
         ob_end_flush();
     }
     chdir($kernel->getRootDir());
     return $returnStatus;
 }
コード例 #24
0
ファイル: BaseTestCase.php プロジェクト: nicolaschenet/testdd
 protected function tearDown()
 {
     parent::tearDown();
     $fs = new Filesystem();
     $fs->remove(sys_get_temp_dir() . '/JMSSecurityExtraBundle');
 }
コード例 #25
0
ファイル: BaseTestCase.php プロジェクト: almaaro/Ilmokilke
 private function cleanTmpDir()
 {
     $fs = new Filesystem();
     $fs->remove(sys_get_temp_dir() . '/JMSDiExtraBundle');
 }
コード例 #26
0
 protected function tearDown()
 {
     $filesystem = new Filesystem();
     $filesystem->remove($this->cacheDir);
 }
コード例 #27
0
 protected function tearDown()
 {
     parent::tearDown();
     $fs = new Filesystem();
     $fs->remove(sys_get_temp_dir() . '/JMSI18nRoutingBundle');
 }
コード例 #28
0
ファイル: Kernel.php プロジェクト: tarjei/statsdbundle
 public function __destruct()
 {
     $fs = new Filesystem();
     $fs->remove($this->tmpDir);
 }
コード例 #29
0
ファイル: Application.php プロジェクト: rafalp/Miblo
 /**
  * Prune existing pages
  *  
  */
 protected function _pruneExistingPages()
 {
     // Start helper
     $Filesystem = new Filesystem();
     echo "\nPruning existing entries... ";
     foreach (new \DirectoryIterator($this->_makeDirPath('site')) as $dir) {
         if ($dir->isDir() && is_numeric($dir->getFilename())) {
             $Filesystem->remove($this->_makeDirPath('site/' . $dir->getFilename()));
         }
     }
     echo "done.";
 }