1 ZendSkeletonApplication
2 =======================
6 This is a simple, skeleton application using the ZF2 MVC layer and module
7 systems. This application is meant to be used as a starting place for those
8 looking to get their feet wet with ZF2.
14 Using Composer (recommended)
15 ----------------------------
16 The recommended way to get a working copy of this project is to clone the repository
17 and use composer to install dependencies:
20 git clone git://github.com/zendframework/ZendSkeletonApplication.git
21 cd ZendSkeletonApplication
22 php composer.phar install
26 Alternatively, you can install using native git submodules. This method works fine but it is
27 recommended that you use Composer due to the dependency management it provides.
29 git clone git://github.com/zendframework/ZendSkeletonApplication.git --recursive
31 You will also need to update public/index.php and modules/Application/Module.php to enable autoloading.
32 For public/index.php, replace lines 2-13 with:
34 use Zend\Loader\AutoloaderFactory,
35 Zend\ServiceManager\ServiceManager,
36 Zend\Mvc\Service\ServiceManagerConfiguration;
38 chdir(dirname(__DIR__));
39 require_once (getenv('ZF2_PATH') ?: 'vendor/ZendFramework/library') . '/Zend/Loader/AutoloaderFactory.php';
42 AutoloaderFactory::factory();
44 Within modules/Application/Module.php add this method to the Application class:
46 public function getAutoloaderConfig()
49 'Zend\Loader\ClassMapAutoloader' => array(
50 __DIR__ . '/autoload_classmap.php',
52 'Zend\Loader\StandardAutoloader' => array(
53 'namespaces' => array(
54 __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
62 Afterwards, set up a virtual host to point to the public/ directory of the
63 project and you should be ready to go!