2017 © Pedro Peláez
 

project coming-soon

A simple countdown system

image

fdevs/coming-soon

A simple countdown system

  • Friday, April 29, 2016
  • by andrey1s
  • Repository
  • 3 Watchers
  • 0 Stars
  • 6 Installations
  • CSS
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Coming Soon Project

Coming Soon project - a fully-functional Symfony2 application that you can use as the skeleton for your new applications., (*1)

Installation

create with [composer][17], (*2)

$ 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, (*3)

$ 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][18], (*4)

add to cron task, (*5)

$ bin/console swiftmailer:spool:send

Installs bundles web assets under a public web directory, (*6)

$ bin/console assets:install

Use with 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(),
        );
    }
}

#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

$ 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(),
    );
}
$ 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'

Use with 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(),
        );
    }
}

#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

$ 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(),
    );
}
$ 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'

What's inside?

The Coming Soon is configured with the following defaults:, (*7)

  • An AppBundle you can use to start coding;, (*8)

  • Twig as the only configured template engine;, (*9)

  • Swiftmailer;, (*10)

  • Annotations enabled for everything., (*11)

It comes pre-configured with the following bundles:, (*12)

  • FrameworkBundle - The core Symfony framework bundle, (*13)

  • SensioFrameworkExtraBundle - Adds several enhancements, including template and routing annotation capability, (*14)

  • TwigBundle - Adds support for the Twig templating engine, (*15)

  • SecurityBundle - Adds security by integrating Symfony's security component, (*16)

  • SwiftmailerBundle - Adds support for Swiftmailer, a library for sending emails, (*17)

  • MonologBundle - Adds support for Monolog, a logging library, (*18)

  • AsseticBundle - Adds support for Assetic, an asset processing library, (*19)

  • WebProfilerBundle (in dev/test env) - Adds profiling functionality and the web debug toolbar, (*20)

  • SensioDistributionBundle (in dev/test env) - Adds functionality for configuring and working with Symfony distributions, (*21)

  • SensioGeneratorBundle (in dev/test env) - Adds code generation capabilities, (*22)

  • [FDevsContactUsBundle][14] (in dev/test env) - Mail keeps the user in a convenient form, (*23)

  • [FDevsContactListBundle][15] (in dev/test env) - concludes your contacts simple, (*24)

  • [LuneticsLocaleBundle][16] (in dev/test env) - allows you to guess the Locale, (*25)

All libraries and bundles included are released under the MIT or BSD license., (*26)

Enjoy!, (*27)

The Versions