1. Go to this page and download the library: Download mremi/url-shortener-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Mremi\UrlShortenerBundle\MremiUrlShortenerBundle(),
);
}
php
// src/Acme/UrlShortenerBundle/Entity/Link.php
namespace Acme\UrlShortenerBundle\Entity;
use Mremi\UrlShortenerBundle\Entity\Link as BaseLink;
class Link extends BaseLink
{
/**
* @var integer
*/
protected $id;
}
php
// app/DoctrineMigrations/VersionYYYYMMDDHHIISS.php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
class VersionYYYYMMDDHHIISS extends AbstractMigration
{
public function up(Schema $schema)
{
// customize index size as you want...
$this->addSql("CREATE INDEX idx_url_shortener_link_long_url ON link (long_url(20))");
}
public function down(Schema $schema)
{
$this->addSql("DROP INDEX idx_url_shortener_link_long_url ON link;");
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.