git submodule add https://github.com/alanwagner/FhSiteKit.git vendor/FhSiteKit
This will make methods of FhSiteKit\FhskCore\Site
available via the autoloader even before the modules have been processed.
// Setup autoloading
require 'init_autoloader.php';
+ $loader->add('FhSiteKit\FhskCore', 'vendor/FhSiteKit/FhskCore/src');
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
For in-depth understanding of this step, see ZF2 Advanced Configuration Tricks:
http://framework.zend.com/manual/2.2/en/tutorials/config.advanced.html
<?php
+ $siteKey = FhSiteKit\FhskCore\Site::getKey();
+
+ $modules = array(
+ 'Application',
+ 'FhSiteKit\FhskCore',
+ 'FhSiteKit\FhskConfig',
+ 'MySpace\MyModule',
+ 'MySpace\MyOtherModule',
+ // ...
+ );
+
+ switch ($siteKey) {
+ case 'mysite' :
+ $modules[] = 'MySpace\MySite';
+ break;
+ case 'myothersite' :
+ $modules[] = 'MySpace\MyOtherSite';
+ break;
+ }
+
return array(
// This should be an array of module namespaces used in the application.
- 'modules' => array('Application'),
+ 'modules' => $modules,
// These are various options for the listeners attached to the ModuleManager
'module_listener_options' => array(
// ...
'config_glob_paths' => array(
- 'config/autoload/{,*.}{global,local}.php',
+ sprintf('config/autoload/{,*.}{global,%s,local}.php', $siteKey),
),
cd public/css
ln -s ../../vendor/FhSiteKit/*/resources/public/css/*
cd public/js
ln -s ../../vendor/FhSiteKit/*/resources/public/js/*
cd public/img
ln -s ../../vendor/FhSiteKit/*/resources/public/img/*
./bin/phpunit.sh
Add phpunit to composer.json
and run php composer.phar update
if you need to install phpunit into your project.
"require": {
"php": ">=5.3.3",
- "zendframework/zendframework": "2.2.*"
+ "zendframework/zendframework": "2.2.*",
+ "phpunit/phpunit": "3.7.*"
}
}