2017 © Pedro Peláez
 

library zf2-aspect

Skeleton Application for ZF2

image

lisachenko/zf2-aspect

Skeleton Application for ZF2

  • Sunday, October 26, 2014
  • by lisachenko
  • Repository
  • 3 Watchers
  • 10 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

GO AOP PHP and ZF2

This module showcases a simple implementation of Go! AOP PHP into ZendSkelettonApplication of ZF2. It contains the full bootstrapping of ZF2 including a DemoAspect from which you'll be able to learn from., (*1)

For more information on different aspects please see the full documentation., (*2)

Installation

The easiest way to get Go! running with ZF2 is to create a composer project using this repository. You're able to create it as easily as running the following command in your CLI (assuming you have composer installed):, (*3)

composer create-project -s dev lisachenko/zf2-aspect

The second option would be to clone this repository and run composer install., (*4)

git clone https://github.com/lisachenko/zf2-aspect && cd zf2-aspect && composer install

Once you've done this you're good to go and test out the power of Go! within your known ZF2 environment., (*5)

Enable AOP

Per default this project is running the ZendSkelettonApplication without AOP enabled. To enable AOP all you have to do is to append ?aspect to your URL. For example http://localhost:8080/?aspect., (*6)

To enable AOP by default with your own aspect, all you need to do is change the contents of public/index.php to the following:, (*7)

<?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_aspect.php';

// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();

You should only do this for your own aspects though. The DemoAspect will match every function call and will echo its hook. So disable the DemoAspect in aspect/DemoAspectKernel.php and you're good to go., (*8)

The Versions

26/10 2014

dev-master

9999999-dev http://framework.zend.com/

Skeleton Application for ZF2

  Sources   Download

BSD-3-Clause

The Requires

 

framework zf2