Releases for sf 1.4
| Version |
License |
API |
Released |
|
1.0.3stable
|
MIT license |
1.0.0stable
|
27/05/2010 |
|
1.0.1stable
|
MIT license |
1.0.0stable
|
07/05/2010 |
Releases for sf 1.3
| Version |
License |
API |
Released |
|
1.0.3stable
|
MIT license |
1.0.0stable
|
27/05/2010 |
|
1.0.1stable
|
MIT license |
1.0.0stable
|
07/05/2010 |
Releases for sf 1.2
| Version |
License |
API |
Released |
|
1.0.3stable
|
MIT license |
1.0.0stable
|
27/05/2010 |
|
1.0.1stable
|
MIT license |
1.0.0stable
|
07/05/2010 |
Changelog for release 1.0.3 - 27/05/2010
- fixed issue with task not detecting already available assets
- added possibility to add multiple cdn hosts for rotation
- added "sync_with_amazon" helper method that can be used to manually sync a single file with amazon (after upload)
- added documentation for ./symfony sync:s3 task
- updated readme
Other releases
Release 1.0.3 - 27/05/2010
- fixed issue with task not detecting already available assets
- added possibility to add multiple cdn hosts for rotation
- added "sync_with_amazon" helper method that can be used to manually sync a single file with amazon (after upload)
- added documentation for ./symfony sync:s3 task
- updated readme
Release 1.0.1 - 07/05/2010
- removed included package
- updated licence
- automatic creation of bucket
- added changelog
dbAmazonS3 plugin
The dbAmazonS3Plugin is a symfony plugin that makes using the Amazon S3 cloud (even more) easy!
Installation
Install the plugin
$ symfony plugin:install dbAmazonS3Plugin
Enable the plugin in your ProjectConfiguration:
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins('dbAmazonS3Plugin');
}
}
[/php]
Create an AWS account at http://aws.amazon.com/s3/
Set your bucket-url & aws-keys in app.yml, and set enable to true for the environments you want, for example:
all:
amazon_s3:
enabled: false #default
bucket: bucket-name
bucket_url: http://s3.amazonaws.com/bucket-name
aws_key: aws_key
aws_secret_key: aws_secret-key
stylesheets_prefix: s3 #default, dir where the css-files are stored (under web/css) containing absolute urls (to S3 cloud), used when amazon_s3 is enabled
prefixed_stylesheets: [ foo.css, bar.css ] #default empty array
prod:
amazon_s3:
enabled: true
[/yml]
Add AmazonS3 to your standard helpers in settings.yml
[yml]
all:
actions:
standard_helpers: [Partial, Cache, Form, I18N, AutoLanguage, diba, db, AmazonS3 ]
[/yml]
In your layout files: replace include_stylesheets() & include_javascripts() helper calls with include_stylesheets_s3() & include_javascripts_s3()
- In all your template files: replace image_tag() helper calls with image_tag_s3
To synchronize your assets to the Amazon S3 bucket (defined by app_amazon_s3_bucket), run the sync S3 task (by default your whole web folder is synced)
./symfony s3:sync-files [--directory="/css"]
** Note 1: If the bucket doesn't exist, this task will create it for you!
** Note 2: At the moment this task doesn't really sync, rather it deletes all files and uploads them again.
CSS files containing URI's & sgLESS
If your css files contain URI's, for example if you use background images, then they wouldn't be loaded from the Amazon cloud.
You can opt to have two versions of those files: one with the relative url, and thus pointing to your local server, and one which points to the cloud.
If you choose to do so, then the files with URI's pointing to the cloud should be in the folder defined by app_amazon_s3_stylesheets_prefix.
You should also define which those files are, and if s3 is enabled (can be different per environment) the AmazonS3Helper will load them from this new directory.
If it's not enabled, the helpers will load them from their original location (with the URI's pointing to your local sever).
Note: these files can easily be generated with the sgLessPlugin