Appendix: Build Your Own

Here are the steps required to work from the Zend Skeleton Application to the Starter Application (as at 29 July 2015).

  1. Download and install the Zend Skeleton Application according to its instructions
  2. Browse to the virtual host to check that it works
  3. Remove or un-configure any features that you do not require, for example caching or translation
  4. Add or configure any additional features that you require, for example configure logging
  5. Rename the Application module to Core (or another name), and update configuration so that it works
  6. Add a Mapper module including a minimum configuration (Module.php)
  7. Create the following directory structure in the Core/src directory (to mirror the Core namespace):
    Core     
        /Controller         
            /Plugin
        /Domain
            /iDomain
            /Proxy
            /Factory           
            /Collection             
                /iCollection             
                /Proxy
        /Service         
            /Event         
            /InputFilters     
        /View         
            /Helper      
        /Exception     
        /iMapper
    
  8. In the root of the Mapper module, create the following directory: src/Mapper/Exception
  9. Create the following files, or copy them from the Starter Application:
    Core/HelperTrait.php
    Core/Controller/AbstractController.php
    Core/iMapper/Mapper.php
    
    Core/Exception/Exception.php
    Core/Exception/Collection.php
    Core/Exception/Factory.php
    Core/Exception/InvalidInput.php
    Core/Exception/Proxy.php
    
    Core/Domain/AbstractDomain.php
    Core/Domain/DomainWatcher.php
    Core/Domain/Collection/AbstractCollection.php
    Core/Domain/Collection/iCollection/Collection.php
    Core/Domain/Collection/Proxy/AbstractCollectionProxy.php
    Core/Domain/Factory/AbstractFactory.php
    Core/Domain/Factory/FactoryLoader.php
    Core/Domain/iDomain/Domain.php
    Core/Domain/Proxy/AbstractProxy.php
    
    Core/Service/AbstractService.php
    Core/Service/ServiceLoader.php
    Core/Service/Event/AbstractListener
    
    Mapper/AbstractMapper.php
    Mapper/MapperLoader.php
    Mapper/Exception/Exception.php
    
  10. Modify the IndexController.php to extend from AbstractController.php. Browse the virtual host to check that it still works
  11. Configure the Core module to use abstract factories that create Domain object factories and Service Layer services:
    'service_manager' => array(     
        'abstract_factories' => array(
            'Core\Domain\Factory\FactoryLoader',         
            'Core\Service\ServiceLoader',
        ),
     ),
  12. Configure the Mapper module to use an abstract factory to create Mapper objects:
    'service_manager' => array(
        'abstract_factories' => array(
            'Mapper\MapperLoader',
        ),
    ),
  13. Browse to the virtual host again to check that it still works
Tags: