Added basic blog functionality

Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely Polonkai (W00d5t0ck)
2012-09-04 13:09:32 +02:00
parent ea325aab7f
commit 5bcd9f079b
17 changed files with 412 additions and 21 deletions

View File

@@ -20,7 +20,9 @@ class AppKernel extends Kernel
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new Io\TcpdfBundle\IoTcpdfBundle(),
new Io\TcpdfBundle\IoTcpdfBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new GergelyPolonkai\FrontBundle\GergelyPolonkaiFrontBundle(),
new GergelyPolonkai\GeshiBundle\GergelyPolonkaiGeshiBundle(),
);

View File

@@ -0,0 +1,32 @@
<?php
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your need!
*/
class Version20120904115727 extends AbstractMigration
{
public function up(Schema $schema)
{
// this up() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("CREATE TABLE users (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(50) NOT NULL, name VARCHAR(100) NOT NULL, UNIQUE INDEX UNIQ_1483A5E9F85E0677 (username), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB");
$this->addSql("CREATE TABLE blog_posts (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, title VARCHAR(100) NOT NULL, slug VARCHAR(100) NOT NULL, content LONGTEXT NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_78B2F932A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = InnoDB");
$this->addSql("ALTER TABLE blog_posts ADD CONSTRAINT FK_78B2F932A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)");
}
public function down(Schema $schema)
{
// this down() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("ALTER TABLE blog_posts DROP FOREIGN KEY FK_78B2F932A76ED395");
$this->addSql("DROP TABLE users");
$this->addSql("DROP TABLE blog_posts");
}
}

View File

@@ -57,3 +57,15 @@ swiftmailer:
username: %mailer_user%
password: %mailer_password%
spool: { type: memory }
jms_di_extra:
locations:
all_bundles: false
bundles: [ GergelyPolonkaiFrontBundle ]
stof_doctrine_extensions:
default_locale: en_US
orm:
default:
sluggable: true
timestampable: true

View File

@@ -2,9 +2,9 @@ parameters:
database_driver: pdo_mysql
database_host: localhost
database_port: ~
database_name: symfony
database_user: root
database_password: ~
database_name: gergelypolonkai
database_user: gergelypolonkai
database_password: the8dooM
mailer_transport: smtp
mailer_host: localhost
@@ -12,4 +12,4 @@ parameters:
mailer_password: ~
locale: en
secret: ThisTokenIsNotSoSecretChangeIt
secret: rie5chooqu8oche5ha6Keidop3ahxoob