Coming Soon project - a fully-functional Symfony2 application that you can use as the skeleton for your new applications.
create with composer
$ composer create-project fdevs/coming-soon coming
$ cd coming
Setting up Permissions using ACL on a system that supports chmod +a, or use any other method to folders var/cache var/logs var/spool
$ rm -rf var/cache/*
$ rm -rf var/logs/*
$ rm -rf var/spool/*
$ HTTPDUSER=`ps aux | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
$ sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs var/spool
$ sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs var/spool
add you project to web server
add to cron task
$ bin/console swiftmailer:spool:send
Installs bundles web assets under a public web directory
$ bin/console assets:install
- Install the Doctrine Bundle and Doctrine ORM
$ composer require doctrine/orm
$ composer require doctrine/doctrine-bundle
//app/AppKernel.php
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
//...
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
);
}
}
- Configuring the Databases and Doctrine
#app/config/config.yml
# Doctrine Configuration
doctrine:
dbal:
driver: pdo_mysql
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
# if using pdo_sqlite as your database driver:
# 1. add the path in parameters.yml
# e.g. database_path: "%kernel.root_dir%/data/data.db3"
# 2. Uncomment database_path in parameters.yml.dist
# 3. Uncomment next line:
# path: "%database_path%"
orm:
auto_generate_proxy_classes: "%kernel.debug%"
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
#app/config/parameters.yml and app/config/parameters.yml.dist
parameters:
#...
database_host: 127.0.0.1
database_port: null
database_name: symfony
database_user: root
database_password: null
- modify
app/config/config.yml
f_devs_contact_us:
#....
database:
db_driver: 'orm'
add support SonataAdmin
- install SonataAdminBundle
$ composer require sonata-project/admin-bundle
//app/AppKernel.php
public function registerBundles()
{
$bundles = array(
//...
new Sonata\CoreBundle\SonataCoreBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
);
}
- install Doctrine ORM Admin Bundle
$ composer require sonata-project/doctrine-orm-admin-bundle
//app/AppKernel.php
public function registerBundles()
{
$bundles = array(
//...
new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
);
}
- add to
app/config/config.yml
sonata_block:
default_contexts: [cms]
blocks:
sonata.admin.block.admin_list:
contexts: [admin]
sonata_admin:
security:
acl_user_manager: fos_user.user_manager
title: 4devs company
dashboard:
groups:
label.contactUs:
label_catalogue: FDevsContactUsBundle
items:
- f_devs_contact_us.admin.contact_us
- add to
app/config/routing.yml
admin:
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
prefix: /admin
_sonata_admin:
resource: .
type: sonata_admin
prefix: /admin
- modify
app/config/config.yml
f_devs_contact_us:
database:
admin_service: 'sonata'
- Install the Doctrine MongoDB Bundle and Doctrine MongoDB
$ composer require doctrine/mongodb-odm
$ composer require doctrine/mongodb-odm-bundle
//app/AppKernel.php
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
//...
new Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle(),
);
}
}
- Configuring the Doctrine MongoDB
#app/config/config.yml
doctrine_mongodb:
connections:
default:
server: "%default_server%"
options: {}
default_database: "%default_database%"
document_managers:
default:
auto_mapping: true
#app/config/parameters.yml and app/config/parameters.yml.dist
parameters:
#...
default_database: coming
default_server: 'mongodb://localhost:27017'
- modify
app/config/config.yml
f_devs_contact_us:
#....
database:
db_driver: 'mongodb'
add support SonataAdmin
- install SonataAdminBundle
$ composer require sonata-project/admin-bundle
//app/AppKernel.php
public function registerBundles()
{
$bundles = array(
//...
new Sonata\CoreBundle\SonataCoreBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
);
}
- install Doctrine MongoDB Admin Bundle
$ composer require sonata-project/doctrine-mongodb-admin-bundle
//app/AppKernel.php
public function registerBundles()
{
$bundles = array(
//...
new Sonata\DoctrineMongoDBAdminBundle\SonataDoctrineMongoDBAdminBundle(),
);
}
- add to
app/config/config.yml
sonata_block:
default_contexts: [cms]
blocks:
sonata.admin.block.admin_list:
contexts: [admin]
sonata_admin:
security:
acl_user_manager: fos_user.user_manager
title: 4devs company
dashboard:
groups:
label.contactUs:
label_catalogue: FDevsContactUsBundle
items:
- f_devs_contact_us.admin.contact_us
- add to
app/config/routing.yml
admin:
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
prefix: /admin
_sonata_admin:
resource: .
type: sonata_admin
prefix: /admin
- modify
app/config/config.yml
f_devs_contact_us:
database:
admin_service: 'sonata'
The Coming Soon is configured with the following defaults:
-
An AppBundle you can use to start coding;
-
Twig as the only configured template engine;
-
Swiftmailer;
-
Annotations enabled for everything.
It comes pre-configured with the following bundles:
-
FrameworkBundle - The core Symfony framework bundle
-
SensioFrameworkExtraBundle - Adds several enhancements, including template and routing annotation capability
-
TwigBundle - Adds support for the Twig templating engine
-
SecurityBundle - Adds security by integrating Symfony's security component
-
SwiftmailerBundle - Adds support for Swiftmailer, a library for sending emails
-
MonologBundle - Adds support for Monolog, a logging library
-
AsseticBundle - Adds support for Assetic, an asset processing library
-
WebProfilerBundle (in dev/test env) - Adds profiling functionality and the web debug toolbar
-
SensioDistributionBundle (in dev/test env) - Adds functionality for configuring and working with Symfony distributions
-
SensioGeneratorBundle (in dev/test env) - Adds code generation capabilities
-
FDevsContactUsBundle (in dev/test env) - Mail keeps the user in a convenient form
-
FDevsContactListBundle (in dev/test env) - concludes your contacts simple
-
LuneticsLocaleBundle (in dev/test env) - allows you to guess the Locale
All libraries and bundles included are released under the MIT or BSD license.
Enjoy!