From d1e445f3c16f7687a5b9eded9c4561f37f3bd96a Mon Sep 17 00:00:00 2001 From: Martijn Durnez Date: Sat, 28 Apr 2012 20:36:01 +0200 Subject: [PATCH] moved from local vendor libraries to vendor git submodules --- .gitmodules | 12 ++++++++ app/config/appconfig.php | 42 ++++++++++++++------------ app/config/registry.php | 7 +++-- app/controllers/general.controller.php | 21 +++++++++++-- app/index.php | 41 +++++-------------------- vendor/Slim | 1 + vendor/Slim-Extras | 1 + vendor/Twig | 1 + vendor/php-activerecord | 1 + 9 files changed, 68 insertions(+), 59 deletions(-) create mode 100644 .gitmodules create mode 160000 vendor/Slim create mode 160000 vendor/Slim-Extras create mode 160000 vendor/Twig create mode 160000 vendor/php-activerecord diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..97f4c1f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "vendor/Slim"] + path = vendor/Slim + url = https://Tieno@github.com/codeguy/Slim.git +[submodule "vendor/Twig"] + path = vendor/Twig + url = https://Tieno@github.com/fabpot/Twig.git +[submodule "vendor/php-activerecord"] + path = vendor/php-activerecord + url = https://Tieno@github.com/Tieno/php-activerecord.git +[submodule "vendor/Slim-Extras"] + path = vendor/Slim-Extras + url = https://Tieno@github.com/Tieno/Slim-Extras.git diff --git a/app/config/appconfig.php b/app/config/appconfig.php index d7f9293..a2773dd 100755 --- a/app/config/appconfig.php +++ b/app/config/appconfig.php @@ -2,23 +2,23 @@ /** * ACTIVERECORD SETTINGS */ -ActiveRecord\Config::initialize(function($cfg) -{ - $models = ROOT.'/app/models'; - $cfg->set_model_directory($models); - try { - $cfg->set_connections(array( - 'development' => 'mysql://user:password@localhost/database?charset=utf8' - - )); - - } catch (ActiveRecord\DatabaseException $e) { - echo "Database error"; - } catch (ActiveRecord\ConfigException $e) { - echo "Config error"; - } - -}); +ActiveRecord\Config::initialize(function($cfg) +{ + $models = ROOT.'/app/models'; + $cfg->set_model_directory($models); + try { + $cfg->set_connections(array( + 'development' => 'mysql://root:durnez10@localhost/comm_sen?charset=utf8' + + )); + + } catch (ActiveRecord\DatabaseException $e) { + echo "Database error"; + } catch (ActiveRecord\ConfigException $e) { + echo "Config error"; + } + +}); ActiveRecord\DateTime::$DEFAULT_FORMAT = 'd-M-Y'; @@ -26,7 +26,7 @@ * TWIG SETTINGS */ -TwigView::$twigDirectory = ROOT.'/vendor/Twig'; +TwigView::$twigDirectory = ROOT.'/vendor/Twig/lib/Twig'; TwigView::$twigOptions = array( "debug" => true ); @@ -36,9 +36,11 @@ TwigView::$twigExtensions = array( - 'Extension_Twig_Slim', - 'Twig_Extension_Debug' + 'Twig_Extensions_Slim', + 'Twig_Extension_Debug', + 'Twig_Extensions_Markdown' ); + TwigView::$twigFunctions = array( ); \ No newline at end of file diff --git a/app/config/registry.php b/app/config/registry.php index 89d8f36..729185c 100755 --- a/app/config/registry.php +++ b/app/config/registry.php @@ -1,4 +1,5 @@ get('/route', $auth, function() use($app, $currentUser) { +//GET route +$app->get('/', function () use ($app) { + echo 'This is a GET route'; +}); +//POST route +$app->post('/post', function () { + echo 'This is a POST route'; +}); - })->name(''); +//PUT route +$app->put('/put', function () { + echo 'This is a PUT route'; +}); + +//DELETE route +$app->delete('/delete', function () { + echo 'This is a DELETE route'; +}); */ \ No newline at end of file diff --git a/app/index.php b/app/index.php index 95305b4..3df3f27 100755 --- a/app/index.php +++ b/app/index.php @@ -1,5 +1,4 @@ request()->getRootUri(); -$assetUri = $rootUri; -$app->view()->appendData( - array('currentUser' => $currentUser, - 'app' => $app, - 'rootUri' => $rootUri, - 'assetUri' => $assetUri, - 'resourceUri' => $resourceUri +$assetUri = $rootUri; +$app->view()->appendData( + array('currentUser' => $currentUser, + 'app' => $app, + 'rootUri' => $rootUri, + 'assetUri' => $assetUri, + 'resourceUri' => $resourceUri )); foreach(glob(ROOT.'/app/controllers/*.php') as $router) { include $router; } - -//GET route $app->get('/', function () use ($app) { $app->render('slim.html.twig'); }); - - -//POST route -$app->post('/post', function () { - echo 'This is a POST route'; -}); - -//PUT route -$app->put('/put', function () { - echo 'This is a PUT route'; -}); - -//DELETE route -$app->delete('/delete', function () { - echo 'This is a DELETE route'; -}); - -/** - * Step 4: Run the Slim application - * - * This method should be called last. This is responsible for executing - * the Slim application using the settings and routes defined above. - */ $app->run(); \ No newline at end of file diff --git a/vendor/Slim b/vendor/Slim new file mode 160000 index 0000000..aa7e919 --- /dev/null +++ b/vendor/Slim @@ -0,0 +1 @@ +Subproject commit aa7e919c454b4e4f0bd27aa28288b18202d5557e diff --git a/vendor/Slim-Extras b/vendor/Slim-Extras new file mode 160000 index 0000000..543ec23 --- /dev/null +++ b/vendor/Slim-Extras @@ -0,0 +1 @@ +Subproject commit 543ec23928be3b22d8b7a08c2442fe3dd0d91f37 diff --git a/vendor/Twig b/vendor/Twig new file mode 160000 index 0000000..f3491b5 --- /dev/null +++ b/vendor/Twig @@ -0,0 +1 @@ +Subproject commit f3491b5cbfd03a31538b6e8c82d65cd54996e870 diff --git a/vendor/php-activerecord b/vendor/php-activerecord new file mode 160000 index 0000000..66dcbfa --- /dev/null +++ b/vendor/php-activerecord @@ -0,0 +1 @@ +Subproject commit 66dcbfaa746c3d8a3835545c19120f6f7d59479e