Skip to content

Instantly share code, notes, and snippets.

@MichaelGooden
Created August 22, 2013 07:53
Show Gist options
  • Save MichaelGooden/6304297 to your computer and use it in GitHub Desktop.
Save MichaelGooden/6304297 to your computer and use it in GitHub Desktop.
Simple ZF2 CLI scripts.
<?php
/**
* This makes our life easier when dealing with paths. Everything is relative
* to the application root now.
*/
chdir(dirname(__DIR__));
// Setup autoloading
require 'init_autoloader.php';
// instead of running it, we just init it (which does any bootstrapping necessary),
// then grab the application instance
//Zend\Mvc\Application::init(require 'config/application.config.php')->run();
$application = Zend\Mvc\Application::init(require 'config/application.config.php');
$server = $application->getServiceManager()->get('My\Custom\Server\Etc');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment