jaxyeh/url-shortener-bundle

A basic implementation of URL Shortener Bundle for Symfony2

dev-master 2014-12-09 10:30 UTC

This package is not auto-updated.

Last update: 2024-04-23 14:06:07 UTC


README

A basic implementation of URL Shortener Bundle for Symfony2

Installation

Step 1: Download the Bundle

Add the bundle in your composer.json :

"require": {
    "jaxyeh/url-shortener-bundle": "dev-master"
}

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding the following line in the app/AppKernel.php file of your project:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Jaxyeh\UrlShortenerBundle\JaxyehUrlShortenerBundle(),
        );

        // ...
    }

    // ...
}

Step 3: Set Configuration

Add the following paramters to your configuration file:

parameters:
    jaxyeh_url.hashids.salt: mysalt
    jaxyeh_url.hashids.min_length: 5

Step 4: Generate Database Schema

Finally, you have to generate your database schema with this Symfony2 command:

php app/console doctrine:schema:update --force

License

This script is available under the MIT license.