Archive for February, 2014

AWS PHP SDK – UploadSyncBuilder Uploads files already present remotely

I recently ran into an interesting issue with the Amazon Web Services PHP SDK, when using UploadSyncBuilder, as described in this section of the AWS documentation. The problem was that in some cases, Amazon cares about leading / characters, and other cases they do not matter.

For example, assume you are uploading a file with the following key: /myFiles/myLargeFile.txt. Amazon will effectively remove the beginning slash, and store that object as simply myFiles/myLargeFile.txt. This becomes problematic when using the UploadSyncBuilder as it relies on Aws\S3\Sync\ChangedFilesIterator. ChangedFilesIterator will do a string comparison of your local object key name with those remotely on S3. This means that it will assume, incorrectly, that the object ‘/myFiles/myLargeFile.txt’ does not exist because it does not exactly match ‘myFiles/myLargeFile.txt’.

If you use UploadSyncBuilder, and you find your finds being reuploaded regardless of if they are on the server, make sure you check that the local and remote keys match!

Using Compass and Sass with Symfony Assetic in Vagrant

[yaml]
# This file is auto-generated during the composer install
parameters:
# Your parameters

assetic.filter.compass.bin: /opt/vagrant_ruby/bin/compass
assetic.sass.bin: /opt/vagrant_ruby/bin/sass
assetic.ruby.bin: /opt/vagrant_ruby/bin/ruby
[/yaml]

To make sure the assets can be accessed by non bundle notation
php app/console assets:install web –symlink

Make sure you filter only scss files with compass, and not all css files. If you filter all CSS files with compass you will likely get indentation errors.