2017 © Pedro Peláez
 

library urlshortener-bundle

Bundle for shortening urls

image

toffiak/urlshortener-bundle

Bundle for shortening urls

  • Friday, August 22, 2014
  • by toffiak
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ToffiakURLShortenerBundle

Symfony 2 bundle for shortening urls., (*1)

Instalation

Step 1: Download ToffiakURLShortenerBundle using composer

Add ToffiakURLShortenerBundle in your composer.json:, (*2)

{
    "require": {
        "toffiak/urlshortener-bundle": "1.0.*@dev"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/toffiak/URLShortenerBundle"
        }
    ],
}

Download the bundle by running the command:, (*3)

``` bash $ php composer.phar update toffiak/urlshortener-bundle, (*4)


### Step 2: Enable the bundle Enable the bundle in the kernel: ``` php <?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Toffiak\URLShortenerBundle\ToffiakURLShortenerBundle(), ); }

``` php <?php // src/Acme/URLShortenerBundle/Entity/Link.php, (*5)

namespace Acme\URLShortenerBundle\Entity;, (*6)

use Doctrine\ORM\Mapping as ORM; use Toffiak\URLShortenerBundle\Entity\Link as BaseLink;, (*7)

/** * @ORM\Entity * @ORM\Table(name="toffiak_urlshortener_link") */ class Link extends BaseLink {, (*8)

/**
 * @ORM\Id
 * @ORM\Column(type="integer")
 * @ORM\GeneratedValue(strategy="AUTO")
 */
protected $id;

}, (*9)


### Step 4: Create Link manager class ``` php <?php // src/Acme/URLShortenerBundle/Model/Manager/LinkManager.php namespace Acme\URLShortenerBundle\Model\Manager; use Toffiak\URLShortenerBundle\Model\Manager\LinkManager as BaseLinkManager; class LinkManager extends BaseLinkManager { }

Step 5: Configure the ToffiakURLShortenerBundle

``` yaml, (*10)

app/config/config.yml

toffiak_url_shortener: link: class: Acme\URLShortenerBundle\Entity\Link manager_class: Acme\URLShortenerBundle\Model\Manager\LinkManager, (*11)


### Step 6: Import ToffiakURLShortenerBundle routing files In YAML: ``` yaml # app/config/routing.yml toffiak_urlshortener: resource: "@ToffiakURLShortenerBundle/Resources/config/routing.yml" prefix: /

Step 7: Update your database schema

bash $ php app/console doctrine:schema:update --force, (*12)

The Versions

22/08 2014

1.0.x-dev

1.0.9999999.9999999-dev

Bundle for shortening urls

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

url

22/08 2014

dev-master

9999999-dev

Bundle for shortening urls

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

url