Skip to content

Commit

Permalink
Added some bootstrapping configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralph Schindler committed Jun 17, 2011
1 parent 610b0b0 commit a76719a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config.php
5 changes: 5 additions & 0 deletions config.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

define('ZF2_PATH',
(getenv('ZF2_PATH') ? getenv('ZF2_PATH') : realpath(__DIR__ . '/../zf2/library'))
);
12 changes: 7 additions & 5 deletions run.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<?php

// Defint the ZF2 Path
define('ZF_PATH', realpath(__DIR__ . '/../ZFGit/library/'));
$config = (file_exists(__DIR__ . '/config.php')) ? __DIR__ . '/config.php' : __DIR__ . '/config.dist.php';
include $config;

// error_reporting & display_errors
error_reporting(32767);
ini_set('display_errors', 1);

// bootstrap
simple_autoloader_register('Zend', ZF_PATH);
simple_autoloader_register('Zend', ZF2_PATH);

$exampleToRun = $_SERVER['argv'][1];

if (strpos($exampleToRun, '_main_.php') === false) {
if (strpos($exampleToRun, '.php') === false) {
$exampleToRun = rtrim($exampleToRun, '\\/') . DIRECTORY_SEPARATOR . '_main_.php';
}

include __DIR__ . DIRECTORY_SEPARATOR . ltrim($exampleToRun, '\\/');

_main_();
if (strpos($exampleToRun, '_main_.php') !== false) {
_main_();
}



Expand Down

0 comments on commit a76719a

Please sign in to comment.