<commit_before>== AspectPHP ==

AspectPHP adds Aspect Oriented Programming features to PHP.
It allows hooking into most of the class methods that are not provided by the PHP Core.

=== Concept ===

AspectPHP uses a custom stream wrapper to hook into the class loading process.
It injects extension points and allows the registration of handler objects
that are invoked when the method of the source object is called.

=== Required classes ===

* Stream
  * Injects extension points
* Manager
  * Registers and unregisters aspects
  * Handles calls to extension points
  * Should *not* be static (but might save registrations as static attribute)
* MethodData (JoinPoint)
  * Contains data about called methods
    * Extension point
    * Context
    * Arguments
    * Return value
* Aspect (interface)
  * Can be registered for extension points (or methods?)
  * Will be called if extension point is notified
  
=== Refactoring ===

* Rename AspectPHP_Stream_Wrapper to AspectPHP_Stream
  
 === Misc ===
 
The following should be implemented in a first version:
* Registering aspects via regular expression that matches methods
* Support the following join points:
  * before
  * after
  * handle exception
* Replace constants to make AspectPHP as transparent as possible
  * __FILE__
  * __DIR__
   
More ToDos:
* set up ticket system
* set up build server project
  * upgrade server to PHP 5.3
* set up website
  * with Zend Framework
  * extract Mol library from nasmol project
* introduce coding standard
  * configure CodeSniffer
  * adjust formatting<commit_msg>added snippet<commit_after>== AspectPHP ==

AspectPHP adds Aspect Oriented Programming features to PHP.
It allows hooking into most of the class methods that are not provided by the PHP Core.

=== Concept ===

AspectPHP uses a custom stream wrapper to hook into the class loading process.
It injects extension points and allows the registration of handler objects
that are invoked when the method of the source object is called.

=== Required classes ===

* Stream
  * Injects extension points
* Manager
  * Registers and unregisters aspects
  * Handles calls to extension points
  * Should *not* be static (but might save registrations as static attribute)
* MethodData (JoinPoint)
  * Contains data about called methods
    * Extension point
    * Context
    * Arguments
    * Return value
* Aspect (interface)
  * Can be registered for extension points (or methods?)
  * Will be called if extension point is notified
  
=== Refactoring ===

* Rename AspectPHP_Stream_Wrapper to AspectPHP_Stream
  
 === Misc ===
 
The following should be implemented in a first version:
* Registering aspects via regular expression that matches methods
* Support the following join points:
  * before
  * after
  * handle exception
* Replace constants to make AspectPHP as transparent as possible
  * __FILE__
  * __DIR__
   
More ToDos:
* set up ticket system
* set up build server project
  * upgrade server to PHP 5.3
* set up website
  * with Zend Framework
  * extract Mol library from nasmol project
* introduce coding standard
  * configure CodeSniffer
  * adjust formatting
  
Snippet to output source tokens:
$tokens = token_get_all($this->original);
for ($i = 0; $i < count($tokens); $i++) {
    if (is_array($tokens[$i])) {
        $tokens[$i][0] = token_name($tokens[$i][0]);
    }
}
var_dump($tokens);
{'fraction_non_alphanumeric': 0.06559810032650638, 'fraction_numerical': 0.0020777678836449986, 'mean_word_length': 3.9705014749262535, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '578220', 'n_tokens_mistral': 901, 'n_tokens_neox': 880, 'n_words': 418}