elfet / silicone-skeleton
Requires
- php: >=5.3.0
- doctrine/common: ~2.2
- doctrine/dbal: ~2.2
- doctrine/orm: ~2.2
- elfet/silicone: ~1.0
- monolog/monolog: ~1.0
- silex/silex: ~1.0
- silex/web-profiler: 1.0.*@dev
- symfony/config: ~2.1
- symfony/form: ~2.1
- symfony/locale: ~2.1
- symfony/security: ~2.1
- symfony/translation: ~2.1
- symfony/twig-bridge: ~2.1
- symfony/validator: ~2.1
- symfony/yaml: ~2.1
- twig/twig: ~1.8
This package is not auto-updated.
Last update: 2020-01-24 15:11:02 UTC
README
Silicone Skeleton is Silex Framework Edition Skeleton.
Every part is configurable. You can choose anything you want.
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
Structure
Structure of Silicone is very similar to Symfony's.
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.
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
:
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:
app/console schema:update
Install
Use Composer to create a new project:
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:
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:
chmod +x app/console
Database
After configuring console run the following commands to create sample database:
app/console database:create
app/console schema:create
TODO
- Documentation
- Tests
- SwiftMailer