Skip to content

Commit 75feb57

Browse files
committed
Adds propel2 integration files and updates README project status
1 parent e69f20a commit 75feb57

File tree

6 files changed

+96
-1
lines changed

6 files changed

+96
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ The Open Source Extensible App Engine
33

44
by Ryan Rentfro & Isaac Mendoza
55

6+
# NOTES
7+
- This development stack/framework is just at Beta 1 and for testing and research purposes.
8+
- Documentation is coming in the wiki as time goes on.
9+
610
# INSTALL INSTRUCTIONS
711
We will be bringing this app to Composer and other loaders once code is stable.
812

@@ -26,6 +30,16 @@ Node JS
2630

2731
Documentation is included in source or you can compile it with phpdoc.
2832

33+
34+
35+
Integration Information
36+
37+
Task | Details
38+
------------- | -------------
39+
Propel2 | Rename system/core/example.propel.php to propel.php and propel is enabled.
40+
Propel2 | Run build.sh to build propel then composer update to update your autoloader
41+
42+
2943
# FEATURE MATRIX
3044
The feature matrix covers the base features we plan to implement.
3145

build.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
echo "----------------------------------------------------------------"
3+
echo "Welcome to Strider Engine - We Will Now Build the ORM with Haste"
4+
echo "----------------------------------------------------------------"
5+
echo
6+
echo "================================================================"
7+
echo "Building Propel2 ORM"
8+
echo "================================================================"
9+
php vendor/propel/propel/bin/propel.php sql:build --output-dir="db/"
10+
php vendor/propel/propel/bin/propel.php model:build --output-dir="orm/"
11+
echo "================================================================"
12+
echo "Jobs Done"
13+
echo "================================================================"

example.propel.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
return [
3+
'propel' => [
4+
'database' => [
5+
'connections' => [
6+
'<database>' => [
7+
'adapter' => '<adapter>',
8+
'classname' => 'Propel\Runtime\Connection\ConnectionWrapper',
9+
'dsn' => 'mysql:host=localhost;dbname=<database>',
10+
'user' => '<user>',
11+
'password' => '<pass>',
12+
'attributes' => []
13+
]
14+
]
15+
],
16+
'runtime' => [
17+
'defaultConnection' => '<database>',
18+
'connections' => ['<database>']
19+
],
20+
'generator' => [
21+
'defaultConnection' => '<database>',
22+
'connections' => ['<database>']
23+
]
24+
]
25+
];

schema.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?xml version="1.0" encoding="utf-8"?>

system/core/application.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@
4646
Globals::setValue('debug', true);
4747
}
4848

49-
49+
/*
50+
* Load Propel Config if it exists
51+
*/
52+
if (file_exists(Config::$filePath . 'system/core/propel.php')) require('propel.php');
53+
5054
/*
5155
* Run the Application via the Strider Controller
5256
*/

system/core/example.propel.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/**
3+
* @package Strider
4+
* @author Ryan Rentfro & Isaac Mendoza
5+
* @license MIT
6+
*/
7+
namespace Strider;
8+
use Propel\Runtime\Propel;
9+
use Propel\Runtime\Connection;
10+
use Propel\Runtime\Connection\ConnectionManagerSingle;
11+
use Monolog\Logger;
12+
use Monolog\Handler\StreamHandler;
13+
14+
/*
15+
* Configure Propel 2
16+
*/
17+
$serviceContainer = \Propel\Runtime\Propel::getServiceContainer();
18+
if (Config::$debugMode == true)
19+
{
20+
$defaultLogger = new Logger('propelLogger');
21+
$defaultLogger->pushHandler(new StreamHandler(Config::$filePath . Config::$logStorage . 'propel-' . date('Ymd') . '.log', Logger::WARNING));
22+
$serviceContainer->setLogger('propelLogger', $defaultLogger);
23+
}
24+
25+
$serviceContainer->checkVersion('2.0.0-dev');
26+
$serviceContainer->setAdapterClass(Config::$dbDatabase, Config::$dbAdapter);
27+
$manager = new \Propel\Runtime\Connection\ConnectionManagerSingle();
28+
$manager->setConfiguration(array (
29+
'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper',
30+
'dsn' => 'mysql:host=' . Config::$dbHost . ';dbname=' . Config::$dbDatabase,
31+
'user' => Config::$dbUser,
32+
'password' => Config::$dbPass,
33+
));
34+
35+
// Configure Propel 2.0 Connection Manager
36+
$manager->setName(Config::$dbDatabase);
37+
$serviceContainer->setConnectionManager(Config::$dbDatabase, $manager);
38+
$serviceContainer->setDefaultDatasource(Config::$dbDatabase);

0 commit comments

Comments
 (0)