Skip to content

Instantly share code, notes, and snippets.

@Elexy
Created May 8, 2012 14:43
Show Gist options
  • Save Elexy/2635743 to your computer and use it in GitHub Desktop.
Save Elexy/2635743 to your computer and use it in GitHub Desktop.
Orchestra cleapscript
<?php
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/autoload.php';
use Symfony\Component\HttpKernel\Util\Filesystem;
try
{
echo "clearing cache....\n";
$file = new Filesystem();
echo $dir = sys_get_temp_dir() . '/sf2standard';
$file->remove($dir);
if ($handle = opendir($dir))
{
echo "Directory handle: $handle\n";
echo "Entries:\n";
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle)))
{
echo "$entry\n";
}
closedir($handle);
}
}
catch (Exception $exc)
{
echo $exc->getTraceAsString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment