Ejemplo n.º 1
0
 /**
  *  Will Fetch the project object
  *
  *  @return Faker\Project
  */
 public function getProject()
 {
     if (self::$project === null) {
         $boot = new Bootstrap();
         self::$project = $boot->boot('1.0.3-test', null);
     }
     return self::$project;
 }
Ejemplo n.º 2
0
//
//--------------------------------------------------------------
error_reporting(E_ALL);
ini_set('display_errors', 1);
//---------------------------------------------------------------
// Load Composer
//
//--------------------------------------------------------------
if (is_dir($vendor = __DIR__ . '/../vendor')) {
    $composer = (require $vendor . '/autoload.php');
} elseif (is_dir($vendor = __DIR__ . '/../../../../vendor')) {
    $composer = (require $vendor . '/autoload.php');
} else {
    die('You must set up the project dependencies, run the following commands:' . PHP_EOL . 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . 'php composer.phar install' . PHP_EOL);
}
$boot = new Bootstrap();
$project = $boot->boot('1.0.4', $composer);
//---------------------------------------------------------------------
// Create Helper sets for commands
//
//--------------------------------------------------------------------
$project->getConsole()->setHelperSet(new HelperSet(array('dialog' => new DialogHelper())));
//---------------------------------------------------------------------
// Inject Faker Install Ccommands
//
//--------------------------------------------------------------------
$project->getConsole()->add(new GenerateCommand('faker:generate'));
$project->getConsole()->add(new AnalyseCommand('faker:analyse'));
$project->getConsole()->add(new ConfigureCommand('faker:configure'));
$project->getConsole()->add(new InitProjectCommand('faker:init'));
//---------------------------------------------------------------------