start to implement database part
This commit is contained in:
@@ -22,7 +22,7 @@ foreach ($namespaces as $namespace => $directory) {
|
|||||||
$loader->registerNamespace($namespace, $directory);
|
$loader->registerNamespace($namespace, $directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
$loader->register('Thelia',__DIR__ . '/lib/');
|
$loader->registerNamespace('Thelia', __DIR__ . '/lib/');
|
||||||
|
|
||||||
|
|
||||||
$loader->register();
|
$loader->register();
|
||||||
|
|||||||
13
core/lib/Thelia/Core/Thelia.php
Normal file
13
core/lib/Thelia/Core/Thelia.php
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Thelia\Core;
|
||||||
|
|
||||||
|
use Symfony\Component\HttpKernel\Kernel;
|
||||||
|
|
||||||
|
|
||||||
|
class Thelia extends Kernel{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Thelia;
|
|
||||||
|
|
||||||
class Thelia {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@@ -1,8 +1,31 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Thelia\Core\Thelia;
|
||||||
|
|
||||||
$env = 'debug';
|
$env = 'debug';
|
||||||
require __DIR__ . '/core/bootstrap.php';
|
require __DIR__ . '/core/bootstrap.php';
|
||||||
|
|
||||||
|
$trustIp = array(
|
||||||
|
'::1',
|
||||||
|
'127.0.0.1'
|
||||||
|
);
|
||||||
|
|
||||||
|
$request = Request::createFromGlobals();
|
||||||
|
|
||||||
|
if( false === in_array($request->getClientIp(), $trustIp)){
|
||||||
|
//change request to send to a 404 error page
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//$thelia = new Thelia('dev');
|
||||||
|
////
|
||||||
|
//$response = $thelia->handle($request)->prepare($request)->send();
|
||||||
|
////
|
||||||
|
//$thelia->terminate($request, $reponse);
|
||||||
|
|
||||||
|
Thelia::run()->send();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
20
local/config/config_db.mysql.php
Normal file
20
local/config/config_db.mysql.php
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// database acces configuration for mysql
|
||||||
|
// ---------------------------------------------
|
||||||
|
|
||||||
|
//database type : mysql, sqlite, pgsql, etc
|
||||||
|
define('THELIA_DB_TYPE','mysql');
|
||||||
|
|
||||||
|
|
||||||
|
// database login
|
||||||
|
define('THELIA_BD_LOGIN', '__DB_LOGIN__');
|
||||||
|
|
||||||
|
// database password
|
||||||
|
define('THELIA_BD_PASSWORD', '__DB_PASSWORD__');
|
||||||
|
|
||||||
|
//database DSN
|
||||||
|
define('THELIA_DB_DSN','mysql:dbname=__DB_NAME__;host:__DB_HOST__');
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
19
local/config/config_db.pgsql.php
Normal file
19
local/config/config_db.pgsql.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// database acces configuration for postgresql
|
||||||
|
// ---------------------------------------------
|
||||||
|
|
||||||
|
//database type : mysql, sqlite, pgsql, etc
|
||||||
|
define('THELIA_DB_TYPE','pgsql');
|
||||||
|
|
||||||
|
// database login
|
||||||
|
define('THELIA_BD_LOGIN', '__DB_LOGIN__');
|
||||||
|
|
||||||
|
// database password
|
||||||
|
define('THELIA_BD_PASSWORD', '__DB_PASSWORD__');
|
||||||
|
|
||||||
|
|
||||||
|
define('THELIA_DB_DSN','pgsql:dbname=__DB_NAME__;host:__DB_HOST__');
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
19
local/config/config_db.sqlite.php
Normal file
19
local/config/config_db.sqlite.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// database acces configuration for sqlite
|
||||||
|
// ---------------------------------------------
|
||||||
|
|
||||||
|
//database type : mysql, sqlite, pgsql, etc
|
||||||
|
define('THELIA_DB_TYPE','sqlite');
|
||||||
|
|
||||||
|
// database login
|
||||||
|
define('THELIA_BD_LOGIN', '__DB_LOGIN__');
|
||||||
|
|
||||||
|
// database password
|
||||||
|
define('THELIA_BD_PASSWORD', '__DB_PASSWORD__');
|
||||||
|
|
||||||
|
|
||||||
|
define('THELIA_DB_DSN','sqlite:__DB_FILE__');
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user