Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.

Commit

Permalink
install project & prepare bootstrap code (NB! Commiting /vendor direc…
Browse files Browse the repository at this point in the history
…tory si not recommended in a real life project, only doing this in case I get connectivity problems)
  • Loading branch information
inoryy committed Jan 29, 2013
1 parent ad2c8e3 commit e5f5052
Show file tree
Hide file tree
Showing 654 changed files with 71,767 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/app/cache/*

# In a real project you would probably want to uncomment this
# I just wanted to avoid potential problems with connectivity
# /vendor/
# composer.phar
33 changes: 33 additions & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Silex\Application;

class AppKernel extends Application
{
public function __construct(array $values = array())
{
parent::__construct($values);

$app = $this;
$app['debug'] = true;

// Twig
$app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => __DIR__.'/../app/views',
'twig.options' => array('cache' => __DIR__.'/../app/cache'),
));

// Routing in templates
$app->register(new Silex\Provider\UrlGeneratorServiceProvider());

// Doctrine DBAL
$app->register(new Silex\Provider\DoctrineServiceProvider(), array(
'db.options' => array(
'driver' => 'pdo_mysql',
'host' => 'localhost',
'dbname' => 'devclub',
'user' => 'root',
),
));
}
}
10 changes: 10 additions & 0 deletions app/database.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

require_once __DIR__.'/../vendor/autoload.php';

$app = new AppKernel();

// Init basic schema
// In a real project should probably use database migrations library
$sql = "CREATE TABLE IF NOT EXISTS cars (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))";
$app['db']->query($sql);
28 changes: 28 additions & 0 deletions app/views/_base.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Devclub - BDD</title>

<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/gh-fork-ribbon.css" rel="stylesheet">

<link href="/css/main.css" rel="stylesheet">
</head>

<body>
<div class="github-fork-ribbon-wrapper right">
<div class="github-fork-ribbon">
<a href="https://github.com/Inori">Fork me on GitHub</a>
</div>
</div>

<div class="container-narrow">
{% block content %}{% endblock %}
</div>

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/scripts.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions app/views/homepage.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{% extends '_base.html.twig' %}
9 changes: 9 additions & 0 deletions behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
default:
extensions:
Behat\MinkExtension\Extension:
default_session: 'goutte'
base_url: 'http://devclub.l/'
javascript_session: 'selenium2'
browser_name: firefox
goutte: ~
selenium2: ~
7 changes: 7 additions & 0 deletions bin/behat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh
SRC_DIR="`pwd`"
cd "`dirname "$0"`"
cd "../vendor/behat/behat/bin"
BIN_TARGET="`pwd`/behat"
cd "$SRC_DIR"
"$BIN_TARGET" "$@"
3 changes: 3 additions & 0 deletions bin/behat.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@ECHO OFF
SET BIN_TARGET=%~dp0\"../vendor/behat/behat/bin"\behat
php "%BIN_TARGET%" %*

0 comments on commit e5f5052

Please sign in to comment.