Code Generation: NamespaceSim
Martin Alterisio (contact me)
This package can be used to emulate class namespaces under PHP 5.
It parses PHP code to extract namespace definition statements. The code is rewritten to emulate the namespace support in a way similar to the Java language namespace support.
This package implements new commands named package and import. The package command defines the package that a class belongs. The package name is prepended to the class names using PEAR class naming and directory conventions.
The import command indicates that the package should be imported for use in the PHP script on which the import command is used. Classes that are not found in the current script are looked in the imported namespaces.
Error mapping has been added since 0.4.0, which requires that caching is enabled. This features makes php errors in rewritten files point to the right place in the original file.
As of version 0.5.0 nsim supports namespaces in:
* class definition (w/inheritance & interfaces implementation)
* interface definition (w/inheritance)
* static class vars & functions
* class constants
* instanceof operator
* type hinting
| Utility
| Consistency
| Docs
| Examples
| Tests
| Videos
| Overall
| Rank
|
| Good (95.0%)
| Good (90.0%)
| Good (87.5%)
| Good (95.0%)
| -
| -
| Sufficient (74.8%)
| 51 |
Click here for detailed information about this class on phpclasses.org
Class
a facade to access a class constants
Class
nsim source file error mapping
Class
nsim source file executer
Class
a facade to find a real class name when using instanceof operator
Class
nsim source file parser
Class
nsim source file rewriter
Class
a facade to access a class static vars
Example
access to nonsim'ed from nsim'ed example class
Example
nsim'ed example class