Permalink
Browse files

moved server-type determination to base, added sample schema for doct…

…rine generation
  • Loading branch information...
1 parent a6859d4 commit c03698899ca18e926faf5387e8e7ee96aee36b8a Michael Kimsal committed Apr 27, 2010
Showing with 41 additions and 11 deletions.
  1. +33 −0 application/configs/schema.yml
  2. +7 −2 base.php
  3. +0 −9 public/index.php
  4. +1 −0 servertype.txt
@@ -6,4 +6,37 @@ options:
type: InnoDB
#put sample yaml here
+Book:
+ columns:
+ id:
+ type: integer(4)
+ primary: true
+ notnull: true
+ autoincrement: true
+ isbn:
+ type: string(20)
+ title:
+ type: string(20)
+ author_id:
+ type: integer(4)
+ relations:
+ author:
+ class: Author
+ local: author_id
+ foreign: id
+ foreignAlias: books
+
+
+Author:
+ columns:
+ id:
+ type: integer(4)
+ primary: true
+ notnull: true
+ autoincrement: true
+ firstName:
+ type: string(20)
+ lastName:
+ type: string(20)
+
View
@@ -4,8 +4,13 @@
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application'));
// Define application environment
-defined('APPLICATION_ENV')
- || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
+if(!defined('APPLICATION_ENV')) {
+ $value = trim(file_get_contents(dirname(__FILE__)."/servertype.txt"));
+ if($value=='') {
+ $value = 'development';
+ }
+ define('APPLICATION_ENV', $value);
+}
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
View
@@ -3,15 +3,6 @@
// date_default_timezone_set('America/New_York');
-// standard zf examples show this set in the virtual host
-// which is a pain to set/swap :)
-// set it to development, testing or production
-// (which match up with the application.ini headings)
-
-define("APPLICATION_ENV", "development");
-//define("APPLICATION_ENV", "testing");
-//define("APPLICATION_ENV", "production");
-
include("../base.php");
$application->bootstrap()
->run();
View
@@ -0,0 +1 @@
+development

0 comments on commit c036988

Please sign in to comment.