symfony/AsseticBundle — Issue #37: Dump to Amazon S3 via stream wrapper fails due to "is_dir"
Author: beryllium
Created: 2011-10-25 00:08:28+00:00
State: open

I am trying to implement a remote asset dump to Amazon S3 via a stream wrapper (Zend_Service_Amazon_S3_Stream), and the doDump method is failing because is_dir() cannot be used with Amazon S3. Apparently S3 doesn't really have directories, it only pretends to.

Is there any way we could modify the DumpCommand file to be Stream-Wrapper-friendly for cases like this?

```php
#AsseticBundle/Command/DumpCommand.php

private function doDump(AssetInterface $asset, OutputInterface $output)
{
$target = rtrim($this->basePath, '/').'/'.str_replace('_controller/', '', $asset->getTargetPath());
if (!is_dir($dir = dirname($target))) {
$output->writeln('[dir+] '.$dir);
if (false === @mkdir($dir, 0777, true)) {
throw new \RuntimeException('Unable to create directory '.$dir);
}
}
//...
}
```