PHP Classes

File: tests/bootstrap.php

Recommend this page to a friend!
  Classes of AlexanderC   AOPHP   tests/bootstrap.php   Download  
File: tests/bootstrap.php
Role: Example script
Content type: text/plain
Description: Example script
Class: AOPHP
Alter the behavior of classes with AOP
Author: By
Last change: Update of tests/bootstrap.php
Date: 11 months ago
Size: 733 bytes
 

Contents

Class file image Download
<?php
/**
 * @author AlexanderC <self@alexanderc.me>
 * @date 10/28/13
 * @time 8:24 PM
 */

require __DIR__ . '/../autoload.php';

$AOPHP = \AOPHP\AOPHP::crete();

// see DocBlockTest to understand lib usage
$object = new DocBlockTest();

// add target object (methods called on this)
//$AOPHP->addTarget($AOPHP->createTarget($object));
// add aspect object (advices would be applied before and after calling a target)
//$AOPHP->addAspect($AOPHP->createAspect(clone $object));

// call target method
//$AOPHP->advice($object, 'doThings', ['"Lorem Ipsum dolor sit amet"']);
// call another target method
//$AOPHP->advice($object, 'doAnotherThings', ['"Lorem Ipsum dolor sit amet"']);

$object->doThings("Lorem Ipsum dolor sit amet");