1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:
<?php
namespace Net\Bazzline\Component\ApiDocumentBuilder\Command;
use Net\Bazzline\Component\Command\Command;
use Net\Bazzline\Component\Command\RuntimeException;
class CleanDirectory extends Command
{
public function clean($path)
{
if (!is_dir($path)
|| !is_writable($path)) {
throw new RuntimeException(
'given path must be a writable directory'
);
}
return $this->execute('/usr/bin/rm -fr ' . $path . '/*');
}
}