parkrooau-php
v1.0.1
Published
A Node module that adds a bit of preprocessing on top of PHP
Downloads
9
Readme
The Parkroo.com PHP Preprocessor
The Parkroo.com PHP Preprocessor (or P5 for short) adds a bit of object-oriented preprocessing on top of PHP's existing functionality stack. Take the following directory tree for example:
classes/
MySpecial.class.php
MySpecial/
sayHello.php
compiled/
...
classes/MySpecial.class.php
:
<?php
class MySpecial {
##P5.include("./MySpecial/sayHello.php")##
}
classes/MySpecial/sayHello.php
:
<?php##P5.partial##
public static function sayHello() {
echo "Hello World!";
}
compiled/MySpecial.class.php
:
<?php
class MySpecial {
public static function sayHello() {
return "Hello World!";
}
}
The purpose of this is to make unit testing really stupidly simple, and to prevent files from getting out-of-control-long. Also, where each function requires database functionality, I'm thinking of adding in the ability to load in a fresh RDBMS state on which unit testing operations can be run.