Giter VIP home page Giter VIP logo

fhsitekit's Introduction

Farther Horizon Site Kit

Installation

1. Install ##FhSiteKit## as a submodule

git submodule add https://github.com/alanwagner/FhSiteKit.git  vendor/FhSiteKit

2. Modify index.php

This will make methods of FhSiteKit\FhskCore\FhskSite\Core\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();

3. Modify application.config.php

For in-depth understanding of this step and the next, see ZF2 Advanced Configuration Tricks:

http://framework.zend.com/manual/2.2/en/tutorials/config.advanced.html

<?php

+ $siteKey = FhSiteKit\FhskCore\FhskSite\Core\Site::getKey();
+ 
+ $modules = array(
+     'Application',
+     'FhSiteKit\FhskCore',
+     'FhSiteKit\FhskConfig',
+     'Ndg\NdgSite',
+     'Ndg\NdgPattern',
+     'Ndg\NdgTemplate',
+     'Ndg\NdgNetwork',
+ );
+ 
+ switch ($siteKey) {
+     case 'pennshape' :
+         $modules[] = 'PennShape\PennShapeSite';
+         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),
        ),

4. Create links to web assets

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/*

Testing

Unit Tests

cd module
./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.*"
    }
}

API Doc

http://FhSiteKit.com/apigen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.