title: PHP Library for Amazon S3 with local fallback
body: <p>Is there a library out there for PHP to access Amazon S3 that will let me use the exact same code to either read/write S3 buckets or to do the same with local files?</p>
  
  <p>I would like to use S3 but I need a way to run my application locally for testing.</p>
  
  <p>If there is not a library that directly supports switching to a local filesystem, is there one that is written in a good OOP manner so that I could use the same interface to make a local filesystem version of it?</p>
  
  <p>I'm using Symfony2 so if there are bundles for this that would be a plus but I can always make it a bundle myself.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I'm trying to make a bundle now to do this.  I just need the operations "create", "exists", and "delete" so I made an interface to handle that.  Then I have a "local" implementation and an "S3" implementation.</p>
  
  <p>What's a clean, Symfony2 method of allowing another class to access some service by ID and get either the <code>LocalStorage</code> or the <code>S3Storage</code> class depending on a config parameter?  I thought about using a "class" parameter, but my S3 service has a dependency on the underlying AmazonS3 class (using the AWS bundle).</p>