NamespaceSim project can be used to emulate class namespaces under PHP 5.
Version: 0.5.0NamespaceSim project can be used to emulate class namespaces under PHP 5.
Operating System: Linux
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
Â· PHP 5.1
What's New in This Release:
Â· This release supports namespaces in class definitions (with inheritance and interface implementation), interface definitions (with inheritance), static class variables and functions, class constants, the instanceof operator, and type hinting.
Â· Errors trapped in rewritten files are mapped to the right file and line number.