Created
May 8, 2012 14:43
-
-
Save Elexy/2635743 to your computer and use it in GitHub Desktop.
Orchestra cleapscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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