sfPixlrPlugin
0.1.1alpha
for sf 1.2 MIT
The sfPixlrPlugin is a symfony plugin that provides support for Pixlr image editing service API to symfony applications.
New in version 0.1.1: Support for Pixlr Express application.
Developers
License
Copyright (C) 2009, Dragan Bosnjak
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Releases for sf 1.2
| Version |
License |
API |
Released |
|
0.1.1alpha
|
MIT license |
0.1.1alpha
|
19/05/2009 |
|
0.1.0alpha
|
MIT license |
0.1.0alpha
|
02/05/2009 |
Changelog for release 0.1.1 - 19/05/2009
- support for express application
- readme file
- various bugfixes and refactoring
Other releases
Release 0.1.1 - 19/05/2009
- support for express application
- readme file
- various bugfixes and refactoring
Release 0.1.0 - 02/05/2009
- initial release
- some documentation is comming soon, please be patient
sfPixlrPlugin plugin
The sfPixlrPlugin is a symfony plugin that provides support for Pixlr
image editing service API to symfony applications.
It gives you helpers that generate URL-s for sending images to Pixlr service,
and utility module that can automatically save your edited images.
For informations about Pixlr service please visit Pixlr website
Installation
Install the plugin
$ symfony plugin:install sfPixlrPlugin
Enable module sfPixlr in your settings.yml
all:
.settings:
enabled_modules: [default, sfPixlr]
Secure module sfPixlr if necessary.
Clear you cache
$ symfony cc
Usage
Sending images to the Pixlr services can be done in two ways: via a GET
or a POST request. This plugin provides helpers for each of this methods.
pixlr_get_url helper
To send image via GET request use pixlr_get_url helper:
pixlr_get_url($absolute_url, $target, $options=array())
Example:
pixlr_get_url("http://example.com/images/my%26image.jpg", url_for("mymodule/done", true), array("save_to"=>"images/saved"))
Parameters:
$absolute_url: Absolute URL to original image. This URL must be accessible over internet so Pixlr can download it.
$target: Absolute URL to action where request will be redirected after image is saved.
$options: Array containing helper options
pixlr_post_url helper
To send image via POST request use pixlr_post_url helper:
pixlr_post_url($file, $target, $options=array())
Example:
pixlr_post_url("/var/www/web/uploads/images/my&image.jpg", url_for("mymodule/done", true), array("save_to"=>"images/saved"))
Parameters:
$file: Path to image on server. This file will be sent via POST method from sfPixlr module.
$target: Absolute URL to action where request will be redirected after image is saved.
$options: Array containing helper options
Helper options
save_to: path to folder on server to which file will be saved.
- this parameter is appended to
app_pixlr_upload_dir or sf_upload_dir
- if TRUE, default symfony upload folder is used
- if FALSE or not specified file will not be automatically saved
title: default name for new file (default: original file name)
referrer: displayed in save dialog (default: HTTP_HOST)
exit: where to send the visitor when he/she clicks on the File->Exit
loc: pixlr localization (default: en)
skip_default: By default, image is sent from Pixlr to sfPixlr/save action,
and then forwarded from there to $target. If you set skip_default to true
Image will be sent directly to $target.
target_vars: Should Pixlr return informations be appended to $target URL as
GET variables or not. Default is true.