A utility for parsing a PHP applications class/function library and compiling a list of all Namespaces, Classes, Class Methods & Parameters and their corresponding code/type hints, BUT stripping out all actual source code guts and other documentation.
The purpose is to allow contracted developers access to a reference library for your proprietary application, supporting code hinting in applications like Eclipse, or Eclipse based forks, but without having to provide them access to your actual source code.
The Code Hint Aggregator will generate a file similar to the one that Eclipse uses for providing Code Hinting for PHP's function/class libraries (i.e. standard.php).
The following is an example of the output generated when the Code Hint Agregator is aimed at itself...
namespace eCommunities\CodeHintAggregator {
class Aggregator {
/**
* Set the verbosity level
* @param boolean $verbose
* @return Aggregator
*/
public function setVerbose($verbose) { }
/**
* Self-referencing directory tree iterator that traverses the application path
* root and all subdirectories for PHP files
* @param string $path Application root path
* @return Aggregator
*/
public function listFiles($appPath) { }
/**
* Parses a list of input files and outputs to either the screen [default] or a
* target file.
* @param Constant $format OUTPUT_SCREEN|OUTPUT_STRING|OUTPUT_DOWNLOAD|OUTPUT_FILE
* @param string $filename Only required for OUTPUT_FILE
* @return mixed
*/
public function output($format, $filename = null) { }
/**
* Returns the file list generated from the path traversal
* @return array
*/
public function getFiles() { }
}
}
- If your application requires it's own
autoloader
, create a PHP include file in the/loaders/
directory and it will automatically be included by thereflection
utility while parsing your application files. - Edit the
example.php
file or create a copy of it and modify the$application_root
variable with the path for your application. - It is recommended that you run the utility with the default output method (
OUTPUT_SCREEN
) first, if all is well, you can use any of the other output methods available (OUTPUT_FILE
,OUTPUT_DOWNLOAD
,OUTPUT_STRING
). - Profit!
- None right now, but this is still al ALPHA so beware!
######(in no specific order of importance)
- Support non
.php
file extensions - Support 'ignore' lists
- Add proper Exception handling
- Add support for:
- Interface
- CONST
- public\protected parameters
- Add syntax highlighting support
- Namespace filtering (ignore remote resources)