PHPackages                             j7mbo/silex-auth-skeleton - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. j7mbo/silex-auth-skeleton

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

j7mbo/silex-auth-skeleton
=========================

Silex skeleton with already integrated login, mysql auth (doctrine), firewalls, routing, config files and auryn DiC.

3229PHP

Since Apr 19Pushed 11y ago3 watchersCompare

[ Source](https://github.com/J7mbo/silex-auth-skeleton)[ Packagist](https://packagist.org/packages/j7mbo/silex-auth-skeleton)[ RSS](/packages/j7mbo-silex-auth-skeleton/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

silex-auth-skeleton
===================

[](#silex-auth-skeleton)

Annoyed with having to figure out the best code and directory structure for a working Silex skeleton? Well, look no further. This code is a great baseline for all your needs.

**Update (19/04/2015)**: Keep an eye on the new [Aurex](https://github.com/J7mbo/Aurex) project which will replace silex-auth-skeleton. It's faster, nicer and uses the latest Silex (2.x) and Symfony 2 components (2.7.\*).

Features
--------

[](#features)

- Configuration loaded from YAML files, just like in Symfony2
- Environment specific config file (dev/live), routes config file, firewall file
- Login form using MySQL authentication (username *or* email) and a SHA1 password requirement
- Twig set up and ready to go for your templates
- Awesome autowiring DiC [Auryn](https://github.com/rdlowrey/Auryn) for auto object instantiation / wiring
- Working firewall - currently, anonymous users can visit `/` and `/login`. Everything else is secured!
- BCrypt password authentication via ircmaxell's [password\_compat](https://github.com/ircmaxell/password_compat) library
- Doctrine ORM Integration with Entity / Repositories / Command-Line (the awesome stuff that Symfony has)
- Code is in controllers, with requests routed to these automatically
- Nicely laid out PSR compliant code

Installation
------------

[](#installation)

You can **clone this repo** to get the code directly:

```
$ git clone git://github.com/j7mbo/silex-auth-skeleton.git

```

Once you have the code, you'll need to use **composer** to update your dependencies:

```
$ cd silex-auth-skeleton/
$ composer update

```

You will need the following database table:

```
+----------+------------------+------+-----+---------+----------------+
| Field    | Type             | Null | Key | Default | Extra          |
+----------+------------------+------+-----+---------+----------------+
| id       | int(11) unsigned | NO   | PRI | NULL    | auto_increment |
| username | varchar(100)     | NO   | UNI |         |                |
| email    | varchar(100)     | NO   | UNI | NULL    |                |
| password | varchar(255)     | NO   |     |         |                |
| roles    | varchar(255)     | NO   |     |         |                |
| is_active| tinyint(1)       | NO   |     | 0       |                |
+----------+------------------+------+-----+---------+----------------+

```

SQL statement to **create the above database and table**:

```
mysql> CREATE DATABASE `silexauth`;
mysql> CREATE TABLE `users` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `username` varchar(100) NOT NULL DEFAULT '',
    `email` varchar(100) NOT NULL,
    `password` varchar(255) NOT NULL DEFAULT '',
    `roles` varchar(255) NOT NULL DEFAULT '',
    `is_active` tinyint(1) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `unique_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

```

You'll also need a **test user**:

```
mysql> INSERT INTO `users` (username, email, password, roles) VALUES (
    'test', 'test@test.com', '$2y$10$k5O1HnSI8N0ORJQnMnFpR.Z0.r7nx4Epk0a8J3d/sCdATF0BStBKe', 'ROLE_USER', '1'
);

```

You'll also need a **host / vhost** to route everything through.

Add "`127.0.0.1 silex-auth.local`" (no quotes) to your `/etc/hosts` file.

Run the following commands to create a **vhost file** for `silex-auth.local`.

```
$ cd /etc/apache2/sites-available
$ sudo nano silex-auth.local

```

Copy / paste the following into your `silex-auth.local` file:

```

    ServerName silex-auth.local
    ServerAlias silex-auth.local

    DocumentRoot "/home/james/Dev/github/silex-auth/web/"
    DirectoryIndex index.php

        AllowOverride All
        Allow from All

```

Now save it, enable the vhost, and restart apache so that everything loads properly.

```
$ ctrl + x, then y, then enter
$ sudo a2ensite silex-auth.local
$ sudo service apache2 restart

```

Importantly, you also need a `.htaccess` file in the silx-auth root directory (not `/web`), containing:

```
FallbackResource /index.php

```

You should now be able to point at `http://silex-auth.local` in your browser and see the home page. After clicking the login link, you should be able to login with either **"test" and "password"**, or **"" and "password"**.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e14d34d0841dff2b3abd09f889f8c5c968fd2ccaccc00f8a6dd4d1c5ceb02f5a?d=identicon)[J7mbo](/maintainers/J7mbo)

---

Top Contributors

[![J7mbo](https://avatars.githubusercontent.com/u/2657310?v=4)](https://github.com/J7mbo "J7mbo (14 commits)")[![iroegbu](https://avatars.githubusercontent.com/u/4746694?v=4)](https://github.com/iroegbu "iroegbu (1 commits)")

### Embed Badge

![Health badge](/badges/j7mbo-silex-auth-skeleton/health.svg)

```
[![Health](https://phpackages.com/badges/j7mbo-silex-auth-skeleton/health.svg)](https://phpackages.com/packages/j7mbo-silex-auth-skeleton)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
