2017 © Pedro Peláez
 

library silicone-skeleton

image

elfet/silicone-skeleton

  • Monday, August 10, 2015
  • by medv
  • Repository
  • 18 Watchers
  • 116 Stars
  • 525 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 17 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Silicone Skeleton

Silicone Skeleton is Silex Framework Edition Skeleton., (*1)

Every part is configurable. You can choose anything you want., (*2)

This Silex modification contains the following: * HttpCache * Class Controllers * Doctrine Common * Doctrine ORM * Monolog * Session * Twig * Translation * Validator * Unique validator for entities * Forms * Security * User Registration and Authorization. * Annotation Routes * WebProfiler (with Doctrine queries logger) * Console, (*3)

Structure

Structure of Silicone is very similar to Symfony's., (*4)

app/
    config/  -- Configuration
    lang/    -- Language Yml, Xliff files
    open/    -- Writable directory for caches, logs, ext.
    src/     -- Application sources
    vendor/  -- Vendors
    view/    -- Twig view files
    console  -- Console Tool
web/
    index.php

Controller

You can use Silex controllers $app->get(...) with class controllers., (*5)

class Blog extends Controller
{
    /**
     * @Route("/blog/{post}")
     */
    public function post($post)
    {
        return $this->render('post.twig');
    }
}

Doctrine ORM

You can use all Doctrine ORM functionality, not just DBAL. Create file app/src/Entity/Post.php:, (*6)

namespace Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 */
class Post
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     */
    protected $id;

    /**
     * @ORM\Column
     * @Assert\NotBlank()
     * @Assert\Length(min = "3", max = "1000")
     */
    protected $text;
}

After this just run:, (*7)

app/console schema:update

Install

Use Composer to create a new project:, (*8)

composer create-project elfet/silicone-skeleton your/app/path

Open directory used for writing caches, logs, ext. So you must give write permissions for www-data user. Example:, (*9)

sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit" app/open/
sudo chmod +a "[your user name] allow delete,write,append,file_inherit,directory_inherit" app/open/

Add permissions to execute console command. Example:, (*10)

chmod +x app/console

Database

After configuring console run the following commands to create sample database:, (*11)

app/console database:create
app/console schema:create

TODO

  • Documentation
  • Tests
  • SwiftMailer

The Versions