2017 © Pedro Peláez
 

library photon-bundle

image

bencagri/photon-bundle

  • Monday, February 12, 2018
  • by bencagri
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Photon for Symfony

Photon is an image acceleration and modification service for Jetpack-connected WordPress sites., (*1)

To use in symfony, PhotonBundle uses Photon Wrapper, (*2)

compatibility Symfony 3.x, 4.x, (*3)

Installation

composer require bencagri/photon-bundle

Then register the bundle in app/AppKernel.php, (*4)

<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            ....
            //Photon Bundle
            new \Bencagri\PhotonBundle\PhotonBundle(),
        ];

Thats it., (*5)

Usage

There is a service that you can use in Symfony., (*6)

in your controller;, (*7)

use Photon\Wrapper\Effect\Filter;
use Photon\Wrapper\Effect\Width;
use Photon\Wrapper\Effects;

...

public function indexAction(Request $request)
{
    //get the service
    $generator = $this->get('bencagri.photon.service');

    //register the effects that you want to use
    $effects = new Effects(
        new Width(700),
        new Filter('emboss')
    );

    $imageUrl = 'https://images.com/my.jpg';

    //generate the picture
    $generator->setImageUrl($imageUrl);
    $generator->setEffects($effects);
    $generator->generate();
}

See all effects that you can use on Photon Wrapper examples., (*8)

Licence

  • The Photon Bundle is open-sourced software licensed under the MIT license.
  • The Photon Wrapper is open-sourced software licensed under the MIT license.
  • The Photon is open-sourced software licenced under GNU GENERaL PUBLIC LICENCE

The Versions

12/02 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

by Avatar bencagri

09/02 2018

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

by Avatar bencagri