cvs: pear /PHP_Annotation Annotation.php package2.xml /PHP_Annotation/Annotation Builder.php Cache.php Command.php CommandExecute.php
ContainerConfig.php ContainerFactory.php Director.php Factory.php InfoValuesParser.php Line.php ParseEngine.php /PHP_Annotation/Annotation/Builder
Console.php Info.php /PHP_Annotation/Annotation/Command Array.php Boolean.php INI.php Info.php Param.php Return.php Single.php Var.php
/PHP_Annotation/Annotation/Command/Doc Abstract.php Access.php Author.php Category.php Copyright.php Deprecated.php Example.php Filesource.php
Final.php Global.php Ignore.php Internal.php License.php Link.php Name.php Package.php Param.php Return.php See.php Since.php Static.php Staticvar.php
Subpackage.php Todo.php Tutorial.php Uses.php Var.php Version.php /PHP_Annotation/Annotation/Command/Util Commandcode.php
/PHP_Annotation/Annotation/ContainerConfig ArrayText.php /PHP_Annotation/Annotation/ContainerFilter Construct.php Filter.php Impl.php Instanc! e.php
Property.php /PHP_Annotation/Annotation/Factory Console.php Container.php /PHP_Annotation/Annotation/InfoValues ObjectGenerator.php Parser.php
Token.php /PHP_Annotation/Annotation/ObjectGenerator StdClass.php /PHP_Annotation/Annotation/Tool CUI.php /PHP_Annotation/Annotation/Type
ComponentInfo.php Info.php InfoItem.php Return.php Var.php /PHP_Annotation/tests AnnotationContainerFactoryTest.php AnnotationDocCommandTest.php
AnnotationInfoCommandTest.php AnnotationTest.php AnnotationUtilCommandTest.php AnnotationtErrorTest.php TestSample.php sample1.php sample2.php
sample3.php sample4.php sample5.php sample6.php sample7.php test.dicon test2.dicon /PHP_Annotation/tests/Command Sample.php Test.php

From: Date: Mon, 15 Jan 2007 15:13:07 +0000
Subject: cvs: pear /PHP_Annotation Annotation.php package2.xml /PHP_Annotation/Annotation Builder.php Cache.php Command.php CommandExecute.php
ContainerConfig.php ContainerFactory.php Director.php Factory.php InfoValuesParser.php Line.php ParseEngine.php /PHP_Annotation/Annotation/Builder
Console.php Info.php /PHP_Annotation/Annotation/Command Array.php Boolean.php INI.php Info.php Param.php Return.php Single.php Var.php
/PHP_Annotation/Annotation/Command/Doc Abstract.php Access.php Author.php Category.php Copyright.php Deprecated.php Example.php Filesource.php
Final.php Global.php Ignore.php Internal.php License.php Link.php Name.php Package.php Param.php Return.php See.php Since.php Static.php Staticvar.php
Subpackage.php Todo.php Tutorial.php Uses.php Var.php Version.php /PHP_Annotation/Annotation/Command/Util Commandcode.php
/PHP_Annotation/Annotation/ContainerConfig ArrayText.php /PHP_Annotation/Annotation/ContainerFilter Construct.php Filter.php Impl.php Instanc! e.php
Property.php /PHP_Annotation/Annotation/Factory Console.php Container.php /PHP_Annotation/Annotation/InfoValues ObjectGenerator.php Parser.php
Token.php /PHP_Annotation/Annotation/ObjectGenerator StdClass.php /PHP_Annotation/Annotation/Tool CUI.php /PHP_Annotation/Annotation/Type
ComponentInfo.php Info.php InfoItem.php Return.php Var.php /PHP_Annotation/tests AnnotationContainerFactoryTest.php AnnotationDocCommandTest.php
AnnotationInfoCommandTest.php AnnotationTest.php AnnotationUtilCommandTest.php AnnotationtErrorTest.php TestSample.php sample1.php sample2.php
sample3.php sample4.php sample5.php sample6.php sample7.php test.dicon test2.dicon /PHP_Annotation/tests/Command Sample.php Test.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-44227@lists.php.net to get a copy of this message
kouichi66 Mon Jan 15 15:13:07 2007 UTC Added files: /pear/PHP_Annotation Annotation.php package2.xml /pear/PHP_Annotation/Annotation Builder.php Cache.php Command.php CommandExecute.php ContainerConfig.php ContainerFactory.php Director.php Factory.php InfoValuesParser.php Line.php ParseEngine.php /pear/PHP_Annotation/Annotation/Builder Console.php Info.php /pear/PHP_Annotation/Annotation/Command Array.php Boolean.php INI.php Info.php Param.php Return.php Single.php Var.php /pear/PHP_Annotation/Annotation/Command/Doc Abstract.php Access.php Author.php Category.php Copyright.php Deprecated.php Example.php Filesource.php Final.php Global.php Ignore.php Internal.php License.php Link.php Name.php Package.php Param.php Return.php See.php Since.php Static.php Staticvar.php Subpackage.php Todo.php Tutorial.php Uses.php Var.php Version.php /pear/PHP_Annotation/Annotation/Command/Util Commandcode.php /pear/PHP_Annotation/Annotation/ContainerConfig ArrayText.php /pear/PHP_Annotation/Annotation/ContainerFilter Construct.php Filter.php Impl.php Instance.php Property.php /pear/PHP_Annotation/Annotation/Factory Console.php Container.php /pear/PHP_Annotation/Annotation/InfoValues ObjectGenerator.php Parser.php Token.php /pear/PHP_Annotation/Annotation/ObjectGenerator StdClass.php /pear/PHP_Annotation/Annotation/Tool CUI.php /pear/PHP_Annotation/Annotation/Type ComponentInfo.php Info.php InfoItem.php Return.php Var.php /pear/PHP_Annotation/tests AnnotationContainerFactoryTest.php AnnotationDocCommandTest.php AnnotationInfoCommandTest.php AnnotationTest.php AnnotationUtilCommandTest.php AnnotationtErrorTest.php TestSample.php sample1.php sample2.php sample3.php sample4.php sample5.php sample6.php sample7.php test.dicon test2.dicon /pear/PHP_Annotation/tests/Command Sample.php Test.php Log: PHP_Annotation first upload

http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation.php +++ pear/PHP_Annotation/Annotation.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. And, some functions using this are mounted. * <code> * PHP_Annotation_Command_Util_Console AnnotationCommand console like PEAR command. * PHP_Annotation_Command_Unit_TestCase UnitTest using PHPUnit. * PHP_Annotation_Command_Util_Validate Baritation that verifies argument of function. * </code> * * #It generates using : * <code> * PHP_Annotation::parse(string $class_name); * PHP_Annotation::parse(string $function_name); * PHP_Annotation::parseFunction(string $function_name); * PHP_Annotation::parseMethod(string $class_name, string $method_name); * PHP_Annotation::parseProperty(string $class_name, string $property_name); * PHP_Annotation::parse(Reflector $ref); * </code> * #Main methods : * <code> * PHP_Annotation::exec[Command Name](); //ref:PHP_Annotation::__call() * PHP_Annotation::exec_[Command Full Name](); //ref:PHP_Annotation::__call() * PHP_Annotation::execute(); * PHP_Annotation::method(); * PHP_Annotation::property(); * PHP_Annotation::addCommandGroup(); * PHP_Annotation::getReflector(); * </code> * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Annotation.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ require_once 'PEAR.php'; require_once 'PEAR/Exception.php'; require_once 'PHP/Annotation/Cache.php'; require_once 'PHP/Annotation/CommandExecute.php'; require_once 'PHP/Annotation/Line.php'; require_once 'PHP/Annotation/ParseEngine.php'; require_once 'PHP/Annotation/Director.php'; require_once 'PHP/Annotation/Builder.php'; require_once 'PHP/Annotation/Command.php'; require_once 'PHP/Annotation/Factory.php'; require_once 'PHP/Annotation/Command/Single.php'; require_once 'PHP/Annotation/Command/Var.php'; require_once 'PHP/Annotation/Command/Info.php'; require_once 'PHP/Annotation/Command/Return.php'; require_once 'PHP/Annotation/Command/Param.php'; require_once 'PHP/Annotation/Command/INI.php'; require_once 'PHP/Annotation/Command/Boolean.php'; require_once 'PHP/Annotation/Command/Array.php'; require_once 'PHP/Annotation/Command/Info.php'; require_once 'PHP/Annotation/InfoValues/Token.php'; require_once 'PHP/Annotation/InfoValues/Parser.php'; require_once 'PHP/Annotation/InfoValues/ObjectGenerator.php'; require_once 'PHP/Annotation/InfoValuesParser.php'; require_once 'PHP/Annotation/ObjectGenerator/stdClass.php'; require_once 'PHP/Annotation/Type/Var.php'; require_once 'PHP/Annotation/Type/Return.php'; require_once "PHP/Annotation/Type/Info.php"; require_once "PHP/Annotation/Type/InfoItem.php"; // /** * The class which maintains information on Annotation.It generates this class from the construct and not having been held. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation { /** * @access private * @var string */ private $__comment; /** * @access private * @var string */ private $__lines = array(); /** * @access private * @var Reflector */ private $__targetReflector = null; /** * sets a comment. * * @access public * @param string $comment * @return void */ public function setComment($commnet) { $this->__comment = $commnet; } /** * returns a comment. * * @access public * @return string */ public function getComment() { return $this->__comment; } /** * adds Annotation Line. * * @access public * @param PHP_Annotation_Line $param * @return void */ public function appendLine(PHP_Annotation_Line $param) { $this->__lines[] = $param; } /** * returns Target Reflector. * * @access public * @return Reflector */ public function getReflector() { return $this->__targetReflector; } /** * sets a Target Reflector. * * @access public * @param Reflector $reflector * @return Reflector */ public function setTargetReflector($reflector) { $this->__targetReflector = $reflector; } /** * Magic Method * 1.The annotation command is executed, and the result is returned. (relative path specification) * <code> * PHP_Annotation::exec[Command Name](mixid $options) * </code> * 2.The annotation command is executed, and the result is returned. (absolute path specification) * <code> * PHP_Annotation::exec_[Command Full Name](mixid $options) * </code> * * @access public * @return mixed */ public function __call($method, $args) { $matches = array(); if (preg_match("/^exec(.*)$/i", $method, $matches)) { $options = (0<count($args)) ? $args[0] : null ; return $this->execute($matches[1], $options); } throw new PEAR_Exception('Call to undefined method '.__CLASS__.'::'.$method.'()', PEAR_ERROR_EXCEPTION); } /** * get Annotation_Type_Info Object. * * @access public * @param PHP_Annotation_Factory $factory * @return Annotation_Type_Info * @since 0.2.0 */ public function exec() { return $this->execute('_PHP_Annotation_Command_Info'); } /** * get annotation of method. * <code> * include "PHP/Annotation.php"; * $annotation = PHP_Annotation::parse("PEAR"); * echo $annotation->method('getStaticProperty')->execDoc_Access(); * </code> * * @access public * @param string $method_name Method name * @return PHP_Annotation */ public function method($method_name) { return PHP_Annotation_Cache::singleton()->parseMethod($this, $method_name); } /** * get annotation of property. * <code> * include "PHP/Annotation.php"; * $annotation = PHP_Annotation::parse("PEAR"); * echo $annotation->property('_debug')->execDoc_Access(); * </code> * @access public * @param string $property_name Property name * @return PHP_Annotation */ public function property($property_name) { return PHP_Annotation_Cache::singleton()->parseProperty($this, $property_name); } /** * returns PHP_Annotation Object. * When failing, it returns NULL. * * @static * @access public * @param mixed $obj Class Name or Reflector Object * @return PHP_Annotation */ static public function parse($obj) { return PHP_Annotation_Cache::singleton()->parse($obj); } /** * returns PHP_Annotation Object. * When failing, it returns NULL. * * @static * @access public * @param string $func Function Name or Method Name * @return PHP_Annotation */ static public function parseFunction($func) { if (!is_string($func)) { return null; } return PHP_Annotation_Cache::singleton()->parse(new ReflectionFunction($func)); } /** * returns PHP_Annotation Object. * When failing, it returns NULL. * * @static * @access public * @param string $class Class Name * @param string $method Method Name * @return PHP_Annotation */ static public function parseMethod($class, $method) { if (!is_string($class) || !is_string($method)) { return null; } $ref_class = new ReflectionClass($class); return PHP_Annotation_Cache::singleton()->parse($ref_class->getMethod($method)); } /** * returns PHP_Annotation Object. * When failing, it returns NULL. * * @static * @access public * @param string $class Class Name * @param string $property Property Name * @return PHP_Annotation */ static public function parseProperty($class, $property) { if (!is_string($class) || !is_string($property)) { return null; } $ref_class = new ReflectionClass($class); return PHP_Annotation_Cache::singleton()->parse($ref_class->getProperty($property)); } /** * The annotation command group is added. As a result, the function of the customized annotation can be used. * * Example 1. * <code> * include "PHP/Annotation.php"; * PHP_Annotation::addCommandGroup(dirname(__FILE__).'/Command','MyCommand_'); * / * * @sample hogehoge * * @test * / * class Sample { * function func(){} * } * echo "Execute my commands\r\n"; * echo " Sample: "; * var_dump(PHP_Annotation::parse("Sample")->execSample()); * </code> * file : ./Command/Sample.php * <code> * class MyCommand_Sample extends PHP_Annotation_Command_AbstractSingle { * public function getCode() * { * return 'sample'; * } * } * * </code> * * @static * @access public * @param string $path Include dir * @param string $class_name_base Class name given to head * @param int $priority Read priority * @return void */ static public function addCommandGroup($path, $class_name_base, $priority=-1) { return PHP_Annotation_CommandExecute::singleton()->addCommandGroup($path, $class_name_base, $priority); } /** * returns Command Group * * @static * @access public * @return array */ static public function getCommandGroup() { return PHP_Annotation_CommandExecute::singleton()->getCommandGroup(); } /** * returns PHP_Annotation_ContainerFactory Object * * @static * @access public * @return array */ static public function & CF() { include_once "PHP/Annotation/ContainerFactory.php"; $cf = PHP_Annotation_ContainerFactory::singleton(); return $cf; } /** * executes a command. * * @access public * @param mixed $exec PHP_Annotation_Command Object or string * @param mixed $options construct param * @return mixed */ public function execute($exec, $options=null) { return PHP_Annotation_CommandExecute::singleton()->execute($this, $exec, $this->__lines, $options); } /** * throw Exception. * * @final * @access public * @param string $key Annotation Key Code * @param PHP_Annotation $annotation Annotation Object * @param integer $offset parse error offset * @return void */ final public function throwException($key, $offset=-1) { $ref = $this->getReflector(); $filepath = $this->__targetReflector->getFileName(); $line = $this->__targetReflector->getStartLine(); $mssg = "Annotation parse error, unexpected value "; if (-1<$offset) { $mssg .= "offset {$offset}"; } $mssg .= " of annotation '@{$key}' in {$filepath} on {$line}."; throw new PEAR_Exception($mssg, PEAR_ERROR_EXCEPTION); return ; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/package2.xml?view=markup&rev=1.1 Index: pear/PHP_Annotation/package2.xml +++ pear/PHP_Annotation/package2.xml <?xml version="1.0" encoding="UTF-8"?> <package packagerversion="1.4.11" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> <name>PHP_Annotation</name> <channel>__uri</channel> <summary>PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. And, the DI library is supported.</summary> <description>PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. And, some functions using this are mounted.</description> <lead> <name>Kouichi Sakamoto</name> <user>kouichi66</user> <email>sakamoto@servlet.sakura.ne.jp</email> <active>yes</active> </lead> <date>2006-11-15</date> <time>21:28:21</time> <version> <release>0.1.5</release> <api>0.1.5</api> </version> <stability> <release>alpha</release> <api>alpha</api> </stability> <license uri="http://www.php.net/license/3_01.txt">PHP License 3.01</license> <notes>[0.1.5] -The symbol of &apos;(&apos;, &apos;!&apos;, &apos;&lt;&apos; and so on corrects to do the wrong which is ignored at the time of Peirce of InfoValues. - When Annotation doesn&apos;t specify a key like &quot;@sample(foo={=&apos;111&apos;,=&apos;222&apos;,=&quot;333&quot;}) &quot;, it changes as the recognition of array( &apos;111&apos;, &apos;222&apos;, &apos;333&apos;). - It changes as it is possible to use &quot;&quot;&quot;, &quot;&apos;&quot;, &quot;=&quot; and so on for a key name with the java.lang.annotation type. [0.1.4] - The normality and instance management&apos;s correcting not to have been working - It is a refactoring in the change - Annotation.php in the technique to have used an interface from the acceding to the class of the Command neighborhood. - It adds a way of incorporating Peirce engine of Type_Info as it is possible to use space in the change - at Peirce. - It returns PHP_Annotation::CF() in the addition - the deletion of all of the numbers of Seki for the error, the substitute, PEAR_Exception that it is possible to use an ID library easily. - It deletes the command of Util_Console and it deletes a change - Doc_Description as the use of Info for the change. - It adds a switch feature as PHP_Annotation_ContainerFactory can do more than one piece of instance management. - It optimizes a change - the processing of ArrayText.php in the private member variable, that the instance cache of PHP_Annotation_ContainerFilter_Instance became static. - It supports value in ValuesParser. - The correction and the addition of the test case - The new addition of Doc_Filesource - The new addition of Doc_Internal - The new addition of Doc_Name - The correction of the routine of Builder_Console - It corrects one with the bug which was in ValuesParser. - The deletion of the unnecessary class [0.1.3] 1.[bug fix] rename from Annotation_ContainerFactory to PHP_Annotation_ContainerFactory. [0.1.2] 1. Delete PHP_Annotation_Command_Unit_TestCase, PHP_Annotation_Command_Unit_Info, PHP_Annotation_Command_Util_Validate, PHP_Annotation_Command_Util_ValidateError. 2. Support java.lang.annotation Format. 3. Support DI Library(Class:Annotation_ContainerFactory) can use annotation: @construct, @instance, @property exsample) sample6.php 4.Add Factory Class &quot;PHP_Annotation_Factory_PearPackage&quot;. This can generate PearPackage. exsample) sample5.php 5.Add Factory Class &quot;PHP_Annotation_Factory_Console&quot;.  This can generate Console Command line. exsample) sample7.php</notes> <contents> <dir baseinstalldir="/PHP/" name="/"> <file baseinstalldir="/PHP/" md5sum="9494593621c05ee448a17552136313c7" name="Annotation/Builder.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="ee74ee6c0f47e0e28986a315fd35c7f8" name="Annotation/Cache.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="287f022606dd610de0eed6b4cbd8ba5d" name="Annotation/Command.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="b3a37ceb41f162562ff3d10d6879912d" name="Annotation/CommandExecute.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="22249e1e5ba52b73f5510f7e7addb1c6" name="Annotation/ContainerConfig.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="88f3b22c8f4dea5612026e0c8e7c2179" name="Annotation/ContainerFactory.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="98c44c5daa8038ea3b074532c2a4a751" name="Annotation/Director.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="09295f77c5c19878c70ed5ccb62fee9d" name="Annotation/Factory.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="8b375721ba8f6ddc48824066ca520ac7" name="Annotation/InfoValuesParser.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="60bcfd0f982f154cf9d917db7e5883df" name="Annotation/Line.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="3e1d2655d2d1271665df6e8825fd6465" name="Annotation/ParseEngine.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="d376507b32fc3e020f60fc60f0059bfa" name="Annotation/Builder/Console.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="3fde851ccb7d3a427055803649770a3c" name="Annotation/Builder/GeneratePearPackage.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="270a54dbe2f7fda3e1d49a63863d0eba" name="Annotation/Builder/Info.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="723695fe1a9bf3a87b79cb9bb309e4c2" name="Annotation/Command/Array.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="d362a4c856a7bab5e9d8a5da7e7bc61e" name="Annotation/Command/Boolean.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="f6ab8202a42ee91f4859eebbaa5800de" name="Annotation/Command/Info.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="c9af5f5e682f0e5394ea4bbc05cc98ba" name="Annotation/Command/INI.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="a534fdf08c2dd0b3c66648c99d6b4b8e" name="Annotation/Command/Param.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="513e407f59cf8d6fac95d573867ece52" name="Annotation/Command/Return.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="acf5d6af80a829b0276bc8a3a3040516" name="Annotation/Command/Single.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="8b0bbf8417abbde0cb31035f75134591" name="Annotation/Command/Var.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="44528ef14544e134090fd568e8af452b" name="Annotation/Command/Doc/Abstract.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="6d5fa94b1d9acc81582731083abaeebf" name="Annotation/Command/Doc/Access.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="c814156ee218bb76415a48a21ecca590" name="Annotation/Command/Doc/Author.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="09057e118fa45cd2dfbfb1cebad2f647" name="Annotation/Command/Doc/Category.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="ac96b731d8251bcc32179de59789610f" name="Annotation/Command/Doc/Copyright.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="0dffc0950facd46930230261534b070c" name="Annotation/Command/Doc/Deprecated.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="eef44aa4af1c3e7768043dcdfe5ab241" name="Annotation/Command/Doc/Example.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="3a5f411f2d3e56c20bbae6b8035ccd6c" name="Annotation/Command/Doc/Filesource.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="82f7f2d42a1b7f4ed60b8a75ad3862e1" name="Annotation/Command/Doc/Final.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="d05de394bc7bbc5eb77a29abbd216ded" name="Annotation/Command/Doc/Global.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="c63eb9ac1cf79ffdf717a08d10f8de36" name="Annotation/Command/Doc/Ignore.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="54fd5d41720b09c74070f6d8149e21b8" name="Annotation/Command/Doc/Internal.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="0d16934c2a728b908f7741ebfa6ce36f" name="Annotation/Command/Doc/License.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="569765823b4cdc78d7dfab1b0fb16aef" name="Annotation/Command/Doc/Link.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="85f252bc9f9811f35f3ada9951febb33" name="Annotation/Command/Doc/Name.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="c36b08eea28a08c2a2ac9b9b71a3ca2d" name="Annotation/Command/Doc/Package.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="b0582564275051dc277e1e7ae5a05219" name="Annotation/Command/Doc/Param.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="91763a5b21b9e68c2f9a718769d7d775" name="Annotation/Command/Doc/Return.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="04bc282ea67b20d66c6f88d65736762a" name="Annotation/Command/Doc/See.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="a19b54fb35cedbda3659999b0026c2df" name="Annotation/Command/Doc/Since.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="01d5f2ab3c1e4423942e64168373f39e" name="Annotation/Command/Doc/Static.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="844c3abcabcf0b9670bb737ab4586977" name="Annotation/Command/Doc/Staticvar.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="ee7e572aa2ecad3e0d4a7f74df79a24c" name="Annotation/Command/Doc/Subpackage.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="c4dbfae2282f35bf719bac4a20f398bd" name="Annotation/Command/Doc/Todo.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="014bfc60019f6a9934d8823f41d05517" name="Annotation/Command/Doc/Tutorial.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="cbfde624450962818667322ff7536e09" name="Annotation/Command/Doc/Uses.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="7681587ee55ddc2868d1e522507d6208" name="Annotation/Command/Doc/Var.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="942b3f256f161b8c96658034d2e77a83" name="Annotation/Command/Doc/Version.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="ad9e16a3b0e3b7b4d181149c667abe50" name="Annotation/Command/Util/Commandcode.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="6bdf39ff09523700dd2f8e6f7747f22c" name="Annotation/ContainerConfig/ArrayText.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="67af7af1ae3a1b72006e38930c127524" name="Annotation/ContainerFilter/Construct.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="a44efd5ba1f406bbf480be829fd123f4" name="Annotation/ContainerFilter/Filter.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="6696ce67a686b35cab12e87a31a1c7ad" name="Annotation/ContainerFilter/Impl.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="fcf9921a7f6a1c8527bf4fb4b6c94dab" name="Annotation/ContainerFilter/Instance.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="4400dde294a6f42a1b96c9b0629a0a4d" name="Annotation/ContainerFilter/Property.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="655b756336955265e037fd304f2b41a3" name="Annotation/Factory/Console.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="c767f9c67fad47869e4f87a0dbc02ac5" name="Annotation/Factory/Container.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="0b96f3e685b63bd8df75bb262cf31762" name="Annotation/Factory/PearPackage.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="1eba27d2dac4c90d09a87cc1bbe7e7e1" name="Annotation/InfoValues/ObjectGenerator.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="b89eca90a70081704c35a05fc4edef95" name="Annotation/InfoValues/Parser.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="9a470f19eddb85fe8c644581ded62574" name="Annotation/InfoValues/Token.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="55c4a1e847a7b8127ce53d8cb95265aa" name="Annotation/ObjectGenerator/stdClass.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="e9e5cb15da843c8bbdcd1c3c23312871" name="Annotation/Tool/CUI.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="ea896bf8185d6cf3d840e98ef6a5a25f" name="Annotation/Type/ComponentInfo.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="c6eaddd84c832ea134a44857568ab7dd" name="Annotation/Type/Info.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="1eb9e4232a44c3b44735d56582b8738d" name="Annotation/Type/InfoItem.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="5491f3c139e5c9e5de4116f7e0ed5479" name="Annotation/Type/Return.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="84eb0f7c184c3a9214510037f87a0cf0" name="Annotation/Type/Var.php" role="php" /> <file baseinstalldir="/PHP/" md5sum="d04b4da40a3cdcf19362595d459e0753" name="tests/AnnotationContainerFactoryTest.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="55bd3b0369b56e1dd4a622ae93fd867f" name="tests/AnnotationDocCommandTest.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="025a5a50b35239b90f1e068f0680d009" name="tests/AnnotationInfoCommandTest.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="5fc2ea61e96f5b095ca66790c2076d07" name="tests/AnnotationtErrorTest.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="be704afa687e4744d77671eeef68f3b1" name="tests/AnnotationTest.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="ed4f0f52638f5d42fb113e7ddb7ec25b" name="tests/AnnotationUtilCommandTest.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="550122819f9998d027a3142955dea172" name="tests/sample1.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="6aa0b5371724805d0b61457620fa0d70" name="tests/sample2.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="b0f7a1ba9a550d12e3d34a2efee729b3" name="tests/sample3.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="e9de80a798cb7d3acc2bd743e382c401" name="tests/sample4.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="d6d5195d12a78f96e0f6caaca0226110" name="tests/sample5.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="f05d936d52f905cf39d46e1e19609307" name="tests/sample6.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="0f3950784e6fd65c26ac7add40e9360b" name="tests/sample7.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="60a8fc9e516b41467cb9fb7de0b11556" name="tests/test.dicon" role="test" /> <file baseinstalldir="/PHP/" md5sum="2e3dc3c195f6add5bc2ccd72e17ec5fa" name="tests/test2.dicon" role="test" /> <file baseinstalldir="/PHP/" md5sum="0bff3a10261c965def77c63765ee9a37" name="tests/TestSample.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="b5292439474cc8c6c7f92e883c08bb17" name="tests/Command/Sample.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="46a8ebe9450014c016268e705b19c057" name="tests/Command/Test.php" role="test" /> <file baseinstalldir="/PHP/" md5sum="6db294fdef926b97b200cc6af85795f2" name="Annotation.php" role="php" /> </dir> </contents> <dependencies> <required> <php> <min>5.1.3</min> </php> <pearinstaller> <min>1.4.6</min> </pearinstaller> </required> <optional> <package> <name>Console_Getargs</name> <channel>pear.php.net</channel> </package> </optional> </dependencies> <phprelease /> <changelog> <release> <version> <release>0.0.1</release> <api>0.0.1</api> </version> <stability> <release>alpha</release> <api>alpha</api> </stability> <date>2006-10-01</date> <license uri="http://www.php.net/license/3_01.txt">PHP License 3.01</license> <notes>notes</notes> </release> <release> <version> <release>0.1.2</release> <api>0.1.2</api> </version> <stability> <release>alpha</release> <api>alpha</api> </stability> <date>2006-10-01</date> <license uri="http://www.php.net/license/3_01.txt">PHP License 3.01</license> <notes>1. Delete PHP_Annotation_Command_Unit_TestCase, PHP_Annotation_Command_Unit_Info, PHP_Annotation_Command_Util_Validate, PHP_Annotation_Command_Util_ValidateError. 2. Support java.lang.annotation Format. 3. Support DI Library(Class:Annotation_ContainerFactory) can use annotation: @construct, @instance, @property exsample) sample6.php 4.Add Factory Class &quot;PHP_Annotation_Factory_PearPackage&quot;. This can generate PearPackage. exsample) sample5.php 5.Add Factory Class &quot;PHP_Annotation_Factory_Console&quot;.  This can generate Console Command line. exsample) sample7.php</notes> </release> <release> <version> <release>0.1.3</release> <api>0.1.3</api> </version> <stability> <release>alpha</release> <api>alpha</api> </stability> <date>2006-10-01</date> <license uri="http://www.php.net/license/3_01.txt">PHP License 3.01</license> <notes>[0.1.3] 1.[bug fix] rename from Annotation_ContainerFactory to PHP_Annotation_ContainerFactory. [0.1.2] 1. Delete PHP_Annotation_Command_Unit_TestCase, PHP_Annotation_Command_Unit_Info, PHP_Annotation_Command_Util_Validate, PHP_Annotation_Command_Util_ValidateError. 2. Support java.lang.annotation Format. 3. Support DI Library(Class:Annotation_ContainerFactory) can use annotation: @construct, @instance, @property exsample) sample6.php 4.Add Factory Class &quot;PHP_Annotation_Factory_PearPackage&quot;. This can generate PearPackage. exsample) sample5.php 5.Add Factory Class &quot;PHP_Annotation_Factory_Console&quot;.  This can generate Console Command line. exsample) sample7.php</notes> </release> <release> <version> <release>0.1.4</release> <api>0.1.4</api> </version> <stability> <release>alpha</release> <api>alpha</api> </stability> <date>2006-11-10</date> <license uri="http://www.php.net/license/3_01.txt">PHP License 3.01</license> <notes>[0.1.4] - The normality and instance management&apos;s correcting not to have been working - It is a refactoring in the change - Annotation.php in the technique to have used an interface from the acceding to the class of the Command neighborhood. - It adds a way of incorporating Peirce engine of Type_Info as it is possible to use space in the change - at Peirce. - It returns PHP_Annotation::CF() in the addition - the deletion of all of the numbers of Seki for the error, the substitute, PEAR_Exception that it is possible to use an ID library easily. - It deletes the command of Util_Console and it deletes a change - Doc_Description as the use of Info for the change. - It adds a switch feature as PHP_Annotation_ContainerFactory can do more than one piece of instance management. - It optimizes a change - the processing of ArrayText.php in the private member variable, that the instance cache of PHP_Annotation_ContainerFilter_Instance became static. - It supports value in ValuesParser. - The correction and the addition of the test case - The new addition of Doc_Filesource - The new addition of Doc_Internal - The new addition of Doc_Name - The correction of the routine of Builder_Console - It corrects one with the bug which was in ValuesParser. - The deletion of the unnecessary class [0.1.3] 1.[bug fix] rename from Annotation_ContainerFactory to PHP_Annotation_ContainerFactory. [0.1.2] 1. Delete PHP_Annotation_Command_Unit_TestCase, PHP_Annotation_Command_Unit_Info, PHP_Annotation_Command_Util_Validate, PHP_Annotation_Command_Util_ValidateError. 2. Support java.lang.annotation Format. 3. Support DI Library(Class:Annotation_ContainerFactory) can use annotation: @construct, @instance, @property exsample) sample6.php 4.Add Factory Class &quot;PHP_Annotation_Factory_PearPackage&quot;. This can generate PearPackage. exsample) sample5.php 5.Add Factory Class &quot;PHP_Annotation_Factory_Console&quot;.  This can generate Console Command line. exsample) sample7.php</notes> </release> <release> <version> <release>0.1.5</release> <api>0.1.5</api> </version> <stability> <release>alpha</release> <api>alpha</api> </stability> <date>2006-11-15</date> <license uri="http://www.php.net/license/3_01.txt">PHP License 3.01</license> <notes>[0.1.5] -The symbol of &apos;(&apos;, &apos;!&apos;, &apos;&lt;&apos; and so on corrects to do the wrong which is ignored at the time of Peirce of InfoValues. - When Annotation doesn&apos;t specify a key like &quot;@sample(foo={=&apos;111&apos;,=&apos;222&apos;,=&quot;333&quot;}) &quot;, it changes as the recognition of array( &apos;111&apos;, &apos;222&apos;, &apos;333&apos;). - It changes as it is possible to use &quot;&quot;&quot;, &quot;&apos;&quot;, &quot;=&quot; and so on for a key name with the java.lang.annotation type. [0.1.4] - The normality and instance management&apos;s correcting not to have been working - It is a refactoring in the change - Annotation.php in the technique to have used an interface from the acceding to the class of the Command neighborhood. - It adds a way of incorporating Peirce engine of Type_Info as it is possible to use space in the change - at Peirce. - It returns PHP_Annotation::CF() in the addition - the deletion of all of the numbers of Seki for the error, the substitute, PEAR_Exception that it is possible to use an ID library easily. - It deletes the command of Util_Console and it deletes a change - Doc_Description as the use of Info for the change. - It adds a switch feature as PHP_Annotation_ContainerFactory can do more than one piece of instance management. - It optimizes a change - the processing of ArrayText.php in the private member variable, that the instance cache of PHP_Annotation_ContainerFilter_Instance became static. - It supports value in ValuesParser. - The correction and the addition of the test case - The new addition of Doc_Filesource - The new addition of Doc_Internal - The new addition of Doc_Name - The correction of the routine of Builder_Console - It corrects one with the bug which was in ValuesParser. - The deletion of the unnecessary class [0.1.3] 1.[bug fix] rename from Annotation_ContainerFactory to PHP_Annotation_ContainerFactory. [0.1.2] 1. Delete PHP_Annotation_Command_Unit_TestCase, PHP_Annotation_Command_Unit_Info, PHP_Annotation_Command_Util_Validate, PHP_Annotation_Command_Util_ValidateError. 2. Support java.lang.annotation Format. 3. Support DI Library(Class:Annotation_ContainerFactory) can use annotation: @construct, @instance, @property exsample) sample6.php 4.Add Factory Class &quot;PHP_Annotation_Factory_PearPackage&quot;. This can generate PearPackage. exsample) sample5.php 5.Add Factory Class &quot;PHP_Annotation_Factory_Console&quot;.  This can generate Console Command line. exsample) sample7.php</notes> </release> </changelog> </package> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Builder.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Builder.php +++ pear/PHP_Annotation/Annotation/Builder.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Builder.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Builder interface to generate result thing using Annotation * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ interface PHP_Annotation_Builder { /** * init * * @access public * @param mixed $component * @param mixed $option * @return mixid if this is string. than change Annotation parse target. */ public function init($component, $option); /** * build * * @access public * @param PHP_Annotation $annotation PHP_Annotation Object * @return void */ public function build(PHP_Annotation $annotation); /** * get Result * * @access public * @return mixed */ public function getResult(); } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Cache.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Cache.php +++ pear/PHP_Annotation/Annotation/Cache.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. And, some functions using this are mounted. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Cache.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * The class which maintains information on Annotation.It generates this class from the construct and not having been held. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Cache { static private $singleton; private $__cache; /** * */ static public function singleton() { if (is_null(self::$singleton)) { self::$singleton = new self(); } return self::$singleton; } /** * */ private function __construct() { $this->__cache = array(); } /** * returns PHP_Annotation Object. * When failing, it returns NULL. * * @access public * @param mixed $obj Class Name or Reflector Object * @return PHP_Annotation */ public function parse($obj) { // It does Reflector at Peirce. if ($obj instanceof Reflector) { return $this->_getCacheAnnotation($obj); } if (!is_null($obj)) { if (is_object($obj)) { return $this->parse(new ReflectionClass(get_class($obj))); } else if (is_string($obj)) { if (class_exists($obj) || interface_exists($obj)) { return $this->parse(new ReflectionClass($obj)); } else if (function_exists($obj)) { return $this->parse(new ReflectionFunction($obj)); } } } throw new PEAR_Exception("Annotation cannot be acquired from '{$obj}' of Class", PEAR_ERROR_EXCEPTION); return null; } /** * get annotation of method. * <code> * include "PHP/Annotation.php"; * $annotation = PHP_Annotation::parse("PEAR"); * echo $annotation->method('getStaticProperty')->execDoc_Access(); * </code> * * @access public * @param string $method_name Method name * @return PHP_Annotation */ public function parseMethod(PHP_Annotation $annotation, $method_name) { $ref = $annotation->getReflector(); if (false===$ref->hasMethod($method_name)) { $class= $ref->getName(); throw new PEAR_Exception("Annotation cannot be acquired from '{$class}::{$method_name}' of method", PEAR_ERROR_EXCEPTION); return ; } return $this->parse($ref->getMethod($method_name)); } /** * get annotation of property. * <code> * include "PHP/Annotation.php"; * $annotation = PHP_Annotation::parse("PEAR"); * echo $annotation->property('_debug')->execDoc_Access(); * </code> * @access public * @param string $property_name Property name * @return PHP_Annotation */ public function parseProperty(PHP_Annotation $annotation, $property_name) { $ref = $annotation->getReflector(); if (false===$ref->hasProperty($property_name)) { $class= $ref->getName(); throw new PEAR_Exception("Annotation cannot be acquired from '{$class}::\${$property_name}' of property", PEAR_ERROR_EXCEPTION); return ; } return $this->parse($ref->getProperty($property_name)); } /** * gets Cache Annotaion. * * @static * @access private * @param Reflector $ref * @return PHP_Annotation */ private function _getCacheAnnotation(Reflector $ref) { //create Key $key = get_class($ref).'@'.$ref->getName(); if ($ref instanceof ReflectionMethod || $ref instanceof ReflectionProperty) { $key .= '::'.$ref->getDeclaringClass()->getName(); } // if (!isset($this->__cache[$key])) { // It does Reflector at Peirce. $engine = PHP_Annotation_ParseEngine :: singleton(); $annotation = $engine->parse($ref->getDocComment()); $annotation->setTargetReflector($ref); $this->__cache[$key] = $annotation; } return $this->__cache[$key]; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command.php +++ pear/PHP_Annotation/Annotation/Command.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Command.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Annotation Command Interface * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ interface PHP_Annotation_Command { public function __construct($options=null); public function getCode(); public function & getResult(); public function execute($key, $value, PHP_Annotation $annotation); } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/CommandExecute.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/CommandExecute.php +++ pear/PHP_Annotation/Annotation/CommandExecute.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. And, some functions using this are mounted. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: CommandExecute.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * The class which maintains information on Annotation.It generates this class from the construct and not having been held. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_CommandExecute { /** * */ static private $singleton; /** * */ private $__loaddires; /** * */ private $__loaded_class; /** * */ private $defaultpath; /** * */ static public function singleton() { if (is_null(self::$singleton)) { self::$singleton = new self(); } return self::$singleton; } /** * */ private function __construct() { $this->__loaddires = array(); $this->__loaded_class = array(); $this->defaultpath = array( 'path'=>"PHP/Annotation/Command", 'base'=>'PHP_Annotation_Command_', ); } /** * executes a command. * * @access public * @param mixed $exec PHP_Annotation_Command Object or string * @param mixed $options construct param * @return mixed */ public function execute(PHP_Annotation $annotation, $exec, $lines, $options=null) { if ($exec instanceof PHP_Annotation_Command) { foreach ($lines as $line) { $line->accept($exec, $annotation); } return $exec->getResult(); } else if ($exec instanceof PHP_Annotation_Command) { foreach ($lines as $line) { $line->accept($exec, $annotation); } return $exec->getResult(); } else if (is_string($exec)) { //Search loaded class. if (isset($this->__loaded_class[$exec])) { $class = $this->__loaded_class[$exec]; if (is_null($class)) { throw new PEAR_Exception("Annotation Command 'exec{$exec}' not found", PEAR_ERROR_EXCEPTION); return null; } return $this->execute($annotation, new $class($options), $lines); } // Absolute path if (preg_match("/^\_/", $exec)) { $matches = array(); foreach ($this->__loaddires as $num => $vars) { if (preg_match("/^\_".preg_quote($vars['base'])."(.*)$/", $exec, $matches)) { $result = $this->_execute($annotation, $vars['path'], $vars['base'], $matches[1], $lines, $options); if (false!==$result) { $this->__loaded_class[$exec] = $vars['base'].$matches[1]; return $result; } } } if (preg_match("/^\_".preg_quote($this->defaultpath['base'])."(.*)$/", $exec, $matches)) { $result = $this->_execute($annotation, $this->defaultpath['path'], $this->defaultpath['base'], $matches[1], $lines, $options); if (false!==$result) { $this->__loaded_class[$exec] = $this->defaultpath['base'].$matches[1]; return $result; } } } else { // Relative path foreach ($this->__loaddires as $num => $vars) { $result = $this->_execute($annotation, $vars['path'], $vars['base'], $exec, $lines, $options); if (false!==$result) { $this->__loaded_class[$exec] = $vars['base'].$exec; return $result; } } $result = $this->_execute($annotation, $this->defaultpath['path'], $this->defaultpath['base'], $exec, $lines, $options); if (false!==$result) { $this->__loaded_class[$exec] = $this->defaultpath['base'].$exec; return $result; } } $this->__loaded_class[$exec] = null; throw new PEAR_Exception("Annotation Command 'exec{$exec}' not found", PEAR_ERROR_EXCEPTION); return null; } } /** * executes a command. * * @access private * @param string $path * @param string $base * @param string &$exec * @param string &$option * @return mixed */ private function _execute(PHP_Annotation $annotation, $path, $base, &$exec, $lines, &$options) { $filepath = $path.'/'.str_replace("_", "/", $exec).".php"; if ( $this->_fileExists($filepath) ) { $class = $base.$exec; if (class_exists($class)) { return $this->execute($annotation, new $class($options), $lines); } if (include_once $filepath) { return $this->execute($annotation, new $class($options), $lines); } else { return null; } } return false; } /** * The annotation command group is added. As a result, the function of the customized annotation can be used. * * Example 1. * <code> * include "PHP/Annotation.php"; * PHP_Annotation::addCommandGroup(dirname(__FILE__).'/Command','MyCommand_'); * / * * @sample hogehoge * * @test * / * class Sample { * function func(){} * } * echo "Execute my commands\r\n"; * echo " Sample: "; * var_dump(PHP_Annotation::parse("Sample")->execSample()); * </code> * file : ./Command/Sample.php * <code> * class MyCommand_Sample extends PHP_Annotation_Command_AbstractSingle { * public function getCode() * { * return 'sample'; * } * } * * </code> * * @access public * @param string $path Include dir * @param string $class_name_base Class name given to head * @param int $priority Read priority * @return void */ public function addCommandGroup($path, $class_name_base, $priority=-1) { $tmp = array( 'path'=>$path, 'base'=>$class_name_base, ); $num = (0>$priority) ? count($priority) : $priority; $this->__loaddires[$num] = $tmp; } /** * returns Command Group * * @static * @access public * @return array */ public function getCommandGroup() { $result = array(); $tmp = array(); $result[-1] = $this->_getCommandFileList($this->defaultpath['path'], $this->defaultpath['base']); foreach ($this->__loaddires as $num =>$info) { $result[$num] = $this->_getCommandFileList($info['path'], $info['base']); } return $result; } /** * returns Command File List * * @static * @access private * @return array */ private function _getCommandFileList($path, $base) { $result = array(); $matches = array(); $dir = dir($path); while (false !== ($entry = $dir->read())) { if ('.'==$entry || '..'==$entry) { continue; } $filepath = $path.'/'.$entry; if (file_exists($filepath) && preg_match("/^([^_]*)\.php$/i", $entry, $matches)) { $result[$filepath] = $base.$matches[1]; } else if (is_dir($filepath)) { $tmp = $this->_getCommandFileList($filepath, $base.$entry.'_'); $result = array_merge($result, $tmp); } } $dir->close(); return $result; } /** * file_exists() on include_path * * @access private * @param string $path FilePath * @param boolean $use_include_path Check include_path * @return boolean */ private function _fileExists($path, $use_include_path = true) { if ($use_include_path == false) { return file_exists($path); } // check if absolute if ($this->_isAbsolutePath($path)) { return file_exists($path); } $include_path_list = explode(PATH_SEPARATOR, get_include_path()); if (is_array($include_path_list) == false) { return file_exists($path); } foreach ($include_path_list as $include_path) { if (file_exists($include_path . DIRECTORY_SEPARATOR . $path)) { return true; } } return false; } /** * It is Absolute Path Format. * * @access private * @param string $path FilePath * @return boolean true:Absolute false:Relative */ private function _isAbsolutePath($path) { if (0==strpos(constant('PHP_OS'), 'WIN')) { if (preg_match('/^[a-z]:/i', $path) && $path{2} == constant('DIRECTORY_SEPARATOR')) { return true; } } else { if ($path{0} == constant('DIRECTORY_SEPARATOR')) { return true; } } return false; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/ContainerConfig.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/ContainerConfig.php +++ pear/PHP_Annotation/Annotation/ContainerConfig.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: ContainerConfig.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * generate PHP_Annotation_Type_ComponentInfo Object * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_ContainerConfig { /** * Start of Get Component * * @access public * @param string $name Component name * @return mixed */ public function start($name) { return null; } /** * End of Get Component * * @access public * @param string $name Component name * @return mixed */ public function end($name) { return null; } /** * get Component * * @access public * @param string $name Component name * @return mixed */ public function getComponentInfo($name) { return null; } /** * Execute that get Component info * * @access public * @param string $name Component Name * @return object PHP_Annotation_Type_ComponentInfo object */ function execComponentInfo($name) { $compinfo = $this->getComponentInfo($name); if (is_null($compinfo)) { // $director = new PHP_Annotation_Director(new PHP_Annotation_Builder_Info()); if (false===$director->build($name)) { return null; } // $info = $director->getBuilder()->getResult(); // return new PHP_Annotation_Type_ComponentInfo($name, $name, $info); } // if ($name !== $compinfo->getClassName()) { $compinfo2 = $this->execComponentInfo($compinfo->getClassName()); $compinfo->merge($compinfo2); } // return $compinfo; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/ContainerFactory.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/ContainerFactory.php +++ pear/PHP_Annotation/Annotation/ContainerFactory.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: ContainerFactory.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ require_once "PHP/Annotation/Factory/Container.php"; /** * DIContainer * - use - * <code> * // file:sample.php * require_once "PHP/Annotation.php"; * require_once "PHP/Annotation/ContainerFactory.php"; * require_once "PHP/Annotation/ContainerConfig/ArrayText.php"; * * /** * * @construct(name="hello", value="world!!") * / * class SampleTest { * public $_name; * public $_value; * function __construct($name, $value) * { * $this->_name = $name; * $this->_name = $value; * } * } * * $factory = PHP_Annotation_ContainerFactory::singleton(); * $factory->setContainerConfig(); * //$factory->setContainerConfig(new PHP_Annotation_ContainerConfig_ArrayText($filepath)); * * var_dump($factory->getComponent('SampleTest')); * </code> * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_ContainerFactory { static private $singleton; private $current_alias = '@'; private $factorys = array(); private function __construct() { ; } static public function singleton() { if (is_null(self :: $singleton)) { self :: $singleton = new self(); } return self :: $singleton; } public function switchAlias($alias='') { $old = $this->current_alias; $this->current_alias = '@'.$alias; return $old; } public function getAlias() { return $this->current_alias; } public function loadConfig($args, $type='ArrayText') { $class = 'PHP_Annotation_ContainerConfig_'.$type; if (false===class_exists($class)) { include_once "PHP/Annotation/ContainerConfig/".$type.".php"; } $ref = new ReflectionClass($class); if (is_array($args)) { $this->setContainerConfig($ref->newInstanceArgs($args)); } else { $this->setContainerConfig($ref->newInstanceArgs(array($args))); } } public function setContainerConfig(PHP_Annotation_ContainerConfig $config) { $this->_getFactory()->setContainerConfig($config); } public function getComponent($name) { return $this->_getFactory()->getComponent($name); } public function getComponentInfo($name) { return $this->_getFactory()->getComponentInfo($name); } private function _getFactory() { if (false===isset($this->factorys[$this->current_alias])) { $this->factorys[$this->current_alias] = new PHP_Annotation_Factory_Container(); } return $this->factorys[$this->current_alias]; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Director.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Director.php +++ pear/PHP_Annotation/Annotation/Director.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Director.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Director interface to generate result thing using Annotation * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Director { /** * @access private * @var PHP_Annotation_Builder */ private $builder; /** * Construct * * @access public * @param object $builder PHP_Annotation_Builder */ public function __construct(PHP_Annotation_Builder $builder) { $this->builder = $builder; } /** * execute PHP_Annotation_Builder * * @access public * @return string Class name */ public function build($component, $option=null) { $result = $this->builder->init($component, $option); $annotation = (is_null($result) || is_boolean($result)) ? PHP_Annotation::parse($component) : PHP_Annotation::parse($result); if (is_null($annotation)) { return false; } $this->builder->build($annotation); return true; } /** * get PHP_Annotation_Builder object * * @access public * @return object PHP_Annotation_Builder object */ public function getBuilder() { return $this->builder; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Factory.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Factory.php +++ pear/PHP_Annotation/Annotation/Factory.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Factory.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Factory interface to generate result thing using Annotation * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ interface PHP_Annotation_Factory { /** * get Component * * @access public * @param string $name Component Name * @return mixed */ public function getComponent($name); } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/InfoValuesParser.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/InfoValuesParser.php +++ pear/PHP_Annotation/Annotation/InfoValuesParser.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: InfoValuesParser.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Value of Annotation(format:java.lang.annotation) Parser * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_InfoValuesParser { /** * */ static private $singleton; /** * */ static public function singleton() { if (is_null(self::$singleton)) { self::$singleton = new self(); } return self::$singleton; } /** * */ private function __construct() { $objgenerator = new PHP_Annotation_ObjectGenerator_stdClass(); $this->parser = new PHP_Annotation_InfoValues_Parser($objgenerator); } /** * */ public function build(&$value) { if ($this->parser->build($value)) { return $this->parser->getResult(); } return null; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Line.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Line.php +++ pear/PHP_Annotation/Annotation/Line.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Line.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Annotation Line * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Line { /** * @access private * @var string */ private $key; /** * @access private * @var string */ private $value; /** * construct * * @access public * @param string $key Annotation Command Code * @param string $value Value of Annotation Command Code * @return void */ public function __construct($key, $value) { $this->key = $key; $this->value = trim($value); } /** * execute Annotation Command * * @access public * @param PHP_Annotation_Command $command PHP_Annotation_Command object to execute * @param PHP_Annotation $annotation Annotation object * @return void */ public function accept(PHP_Annotation_Command $command, PHP_Annotation $annotation) { $codes = $command->getCode(); if (is_array($codes)) { if (in_array($this->key, $codes)) { $command->execute($this->key, $this->value, $annotation); } } else if (preg_match("/^\//", $codes)) { if (preg_match($codes, $this->key)) { $command->execute($this->key, $this->value, $annotation); } } else if ($this->key === $codes) { $command->execute($this->key, $this->value, $annotation); } } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/ParseEngine.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/ParseEngine.php +++ pear/PHP_Annotation/Annotation/ParseEngine.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: ParseEngine.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Annotation Parse Engine * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_ParseEngine { /** * @access private * @var PHP_Annotation_ParseEngine */ private static $singleton; /** * construct * * @access private * @return void */ private function __construct() { } /** * returns Instance * * @access public * @return PHP_Annotation_ParseEngine */ public static function singleton() { if (is_null(self :: $singleton)) { $class = __CLASS__; self :: $singleton = new $class(); } return self :: $singleton; } /** * It is Peirce in the character string. * * @access public * @param string $doc The character string which Annotation is contained in * @return PHP_Annotation Annotation object */ public function parse($doc) { $annotation = new PHP_Annotation(); $args = array(); preg_match_all("/^[ \t]*\*+[ \t^\/]+(\S.*)/m", $doc, $args, PREG_SET_ORDER); $p_key = ''; $p_val = ''; foreach ($args as $lines) { $matches = array(); if (!isset($lines[1])) { continue; } else if (preg_match("/^(#+)?@([^\s\(]+)[\s]*(.*)/", $lines[1], $matches)) { if (''!=$matches[1]) { continue; } $this->_appendData($annotation, $p_key, trim($p_val)); $p_key = $matches[2]; $p_val = $matches[3]."\n"; } else { $p_val .= $lines[1]."\n"; } } $this->_appendData($annotation, $p_key, trim($p_val)); return $annotation; } /** * Adds Annotation Information to the $annotation. * * @access private * @param PHP_Annotation $annotation PHP_Annotation Object * @param string $p_key Command Code * @param string $p_val Value of Annotation Command Code * @return void */ private function _appendData(&$annotation, $p_key, $p_val) { if ('' != $p_key) { $annotation->appendLine(new PHP_Annotation_Line($p_key, $p_val)); } else { $annotation->setComment($p_val); } } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Builder/Console.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Builder/Console.php +++ pear/PHP_Annotation/Annotation/Builder/Console.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Console.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * This builder generates a Console command object. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Builder_Console implements PHP_Annotation_Builder { /** * @access private * @var mixied */ private $argv; /** * init * * @access public * @param mixed $component * @param mixed $option * @return mixid if this is string. than change Annotation parse target. */ public function init($component, $option) { include_once 'Console/Getargs.php'; // if (is_null($option)) { global $argv; $this->argv = $argv; } else { $this->argv = $option; } } /** * build * * @access public * @param PHP_Annotation $annotation PHP_Annotation Object * @return void */ public function build(PHP_Annotation $annotation) { $conobj = $annotation->exec()->console; if (is_null($conobj)) { throw new PEAR_Exception('Not Found Console Class!!', PEAR_ERROR_EXCEPTION); return ; } $info = $conobj->info; if (0==strlen($info)) { $info = 'No Info'; } $ref = $annotation->getReflector(); //execute method if (isset($this->argv[1]) && method_exists($ref->getName(), $this->argv[1])) { $method = $this->argv[1]; $tmp = $this->argv; $tmp[1] = basename($this->argv[0]).' '.$this->argv[1]; array_shift($tmp); return $this->_executeMethod($annotation->method($method), $tmp); } // Make Help $methods = $ref->getMethods(); $tag_len = 23; $text = $info; $text .= "\r\n\r\nCommands:"; foreach ($methods as $num=>$method) { $name = $method->getName(); $conobj = $annotation->exec()->console; $tmp = ''; if (is_null($conobj)) { $tmp = $conobj->info; } if (0==strlen($tmp)) { $tmp = 'No Info'; } $text .= "\r\n".str_pad($name, $tag_len).$tmp; } $text .= "\r\nUsage: ".basename($this->argv[0]). " command [options] <parameters>\r\n"; echo $text; } /** * get Result * * @access public * @return mixed */ public function getResult() { return null; } /** * * * @access private * @param string $value Value of Annotation Command Code * @param PHP_Annotation $annotation PHP_Annotation Object * @return void */ private function _executeMethod(PHP_Annotation $method_anno, $args) { $conobj = $method_anno->exec()->console; if (is_null($conobj)) { throw new PEAR_Exception('Not Found Console Class!!', PEAR_ERROR_EXCEPTION); return ; } $info = $conobj->info; if (0==strlen($info)) { $method_info = 'No Info'; } $ref = $method_anno->getReflector(); $params = $ref->getParameters(); $param_infos = $method_anno->exec_PHP_Annotation_Command_Doc_Param(); //var_dump($param_infos); $config = array(); foreach ($params as $num => $param) { $name = $param->getName(); $tmp = array(); $tmp['desc'] = (isset($param_infos['$'.$name])) ? $param_infos['$'.$name]->getComment() : ''; $tmp['min'] = 1; if ($param->isArray()) { $tmp['max'] = -1; } else if (!isset($param_infos['$'.$name])) { $tmp['max'] = 1; } else if ('boolean'==$param_infos['$'.$name]->getType()) { $tmp['max'] = 0; } else { $tmp['max'] = 1; } if ($param->isDefaultValueAvailable()) { $tmp['default'] = $param->getDefaultValue(); } else if (0==$tmp['max']) { $tmp['default'] = 0; } $config[$name] = $tmp; } $console =& Console_Getargs::factory($config, $args); // if (PEAR::isError($console)) { $this->_outputHelp($info, $this->argv[0], $config, $console->getMessage()); return ; } // $method = array($ref->getDeclaringClass()->getName(), $ref->getName()); $args = array(); foreach ($params as $num => $param) { $tmp = $console->getValue($param->getName()); if (!$param->isDefaultValueAvailable() && is_null($tmp)) { $this->_outputHelp($info, $this->argv[0], $config); return; } $arg = $console->getValue($param->getName()); $args[] = ($param->isArray() && !is_array($arg)) ? array($arg) : $arg ; } return call_user_func_array($method, $args); } /** * Output Command Help * * @access private * @param string $value desc of command * @param string $command command name * @param mixed $config configure * @param string $error error message * @return void */ private function _outputHelp($value, $command, $config, $error='') { $head = $value; $head .= "\r\n\r\n"; $head .= 'Usage: '.$command.' '; $head .= implode(' ', Console_Getargs::getOptionalRequired($config)); $head .= "\r\n"; echo Console_Getargs::getHelp($config, $head, $error); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Builder/Info.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Builder/Info.php +++ pear/PHP_Annotation/Annotation/Builder/Info.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Info.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * This builder generates PHP_Annotation_Type_Info object. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Builder_Info implements PHP_Annotation_Builder { /** * @access private * @var mixied */ private $_Result; /** * @static * @access private * @var array */ static private $_Caches; /** * init * * @access public * @param mixed $component * @param mixed $option * @return mixid if this is string. than change Annotation parse target. */ public function init($component, $option) { ; } /** * build * * @access public * @param PHP_Annotation $annotation PHP_Annotation Object * @return void */ public function build(PHP_Annotation $annotation) { $cachekey = $annotation->getReflector()->getName(); if (isset(self :: $_Caches[$cachekey])) { $this->_Result = self :: $_Caches[$cachekey]; return ; } // $this->_Result = $annotation->exec(); self :: $_Caches[$cachekey] = $this->_Result; } /** * get Result * * @access public * @return mixed */ public function getResult() { return $this->_Result; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Array.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Array.php +++ pear/PHP_Annotation/Annotation/Command/Array.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Array.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode */ class PHP_Annotation_Command_Array implements PHP_Annotation_Command { private $result; private $options; public function __construct($options=null) { $this->options = $options; $this->result = array(); } public function getCode() { return ''; } public function & getResult() { return $this->result; } public function execute($key, $value, PHP_Annotation $annotation) { $matchs = array(); if (is_null($this->result)) { $this->result = array(); } if (!preg_match("/(?:\S.*)/is", $value, $matchs)) { $annotation->throwException($key); } // validate if ($this->validate($matchs[0])) { $this->result[] = $matchs[0]; } else { $annotation->throwException($key); } } protected function validate($value) { return true; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Boolean.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Boolean.php +++ pear/PHP_Annotation/Annotation/Command/Boolean.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Boolean.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode */ class PHP_Annotation_Command_Boolean implements PHP_Annotation_Command { private $result; private $options; public function __construct($options=null) { $this->options = $options; $this->result = false; } public function getCode() { return ''; } public function & getResult() { return $this->result; } public function execute($key, $value, PHP_Annotation $annotation) { $this->result = true; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/INI.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/INI.php +++ pear/PHP_Annotation/Annotation/Command/INI.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: INI.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode */ class PHP_Annotation_Command_INI implements PHP_Annotation_Command { private $result; private $options; public function __construct($options=null) { $this->options = $options; $this->result = null; } public function getCode() { return ''; } public function & getResult() { return $this->result; } public function execute($key, $value, PHP_Annotation $annotation) { $matchs = array(); if (!preg_match("/^(\S+)\s+(.*)/is", $value, $matchs)) { $annotation->throwException($key); } // validate if ($this->validate($matchs[1], $matchs[0])) { $this->result[$matchs[1]] = $matchs[2]; } else { $annotation->throwException($key); } } protected function validate($value) { return true; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Info.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Info.php +++ pear/PHP_Annotation/Annotation/Command/Info.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Info.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode */ class PHP_Annotation_Command_Info implements PHP_Annotation_Command { private $result; private $options; public function __construct($options=null) { $this->result = new PHP_Annotation_Type_Info(); } /** * returns Annotation Code * * @access public * @return string "/^.*$/" */ public function getCode() { return "/^.*$/"; } public function & getResult() { return $this->result; } /** * The implementing of processing. * * @final * @access public * @param string $key Key of Annotation Command Code * @param string $value Value of Annotation Command Code * @param PHP_Annotation $annotation PHP_Annotation Object * @return string */ final public function execute($key, $value, PHP_Annotation $annotation) { $matches = array(); if (!preg_match("/^(?:\(\s*(.*)\s*\)|\s*)$/ms", $value, $matches)) { return; } // $item = new PHP_Annotation_Type_InfoItem($key, $matches[1]); if (-1 < $item->getErrorOffset()) { $annotation->throwException($key, $item->getErrorOffset()); } else { // $this->result->addItem($item); } } /** * Verification * * @access protected * @param string $value Verification object * @return boolean */ protected function validate($value) { return true; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Param.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Param.php +++ pear/PHP_Annotation/Annotation/Command/Param.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Param.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode */ class PHP_Annotation_Command_Param implements PHP_Annotation_Command { private $result; private $options; public function __construct($options=null) { $this->options = $options; $this->result = array(); } public function getCode() { return ''; } public function & getResult() { return $this->result; } public function execute($key, $value, PHP_Annotation $annotation) { $matchs = array(); if (!preg_match("/^(\S+)\s+(\S+)\s*(.*)/is", $value, $matchs)) { $annotation->throwException($key); } // validate if ($this->validate($matchs[2], $matchs[1], $matchs[3])) { $this->result[$matchs[2]] = new PHP_Annotation_Type_Var($matchs[1], $matchs[3]); } else { $annotation->throwException($key); } } protected function validate($value) { return true; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Return.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Return.php +++ pear/PHP_Annotation/Annotation/Command/Return.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Return.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode */ class PHP_Annotation_Command_Return implements PHP_Annotation_Command { private $result; private $options; public function __construct($options=null) { $this->options = $options; $this->result = null; } public function getCode() { return ''; } public function & getResult() { return $this->result; } public function execute($key, $value, PHP_Annotation $annotation) { $matchs = array(); if (!is_null($this->result)) { throw new PEAR_Exception('Annotation parse error, It has already been set.(' . get_class($this) . ')', PEAR_ERROR_EXCEPTION); return ; } else if (!preg_match("/^(\S+)\s*(.*)$/is", $value, $matchs)) { $this->throwException($key, $annotation); return ; } // validate $types = explode('|', $matchs[1]); if ($this->_validate($types, $matchs[2])) { $this->result = new PHP_Annotation_Type_Return($types, $matchs[2]); } else { $annotation->throwException($key); } } private function _validate($value) { return true; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Single.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Single.php +++ pear/PHP_Annotation/Annotation/Command/Single.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Single.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode */ class PHP_Annotation_Command_Single implements PHP_Annotation_Command { private $result; private $options; public function __construct($options=null) { $this->options = $options; $this->result = null; } public function getCode() { return ''; } public function & getResult() { return $this->result; } public function execute($key, $value, PHP_Annotation $annotation) { $matchs = array(); if (!is_null($this->result)) { throw new PEAR_Exception('Annotation parse error, It has already been set.(' . get_class($this) . ')', PEAR_ERROR_EXCEPTION); return ; } else if (!preg_match("/(?:\s*)(.*)/is", $value, $matchs)) { $annotation->throwException($key); return ; } // validate if ($this->_validate($matchs[1])) { $this->result = $matchs[1]; } else { $annotation->throwException($key); } } private function _validate($value) { return true; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Var.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Var.php +++ pear/PHP_Annotation/Annotation/Command/Var.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Var.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode */ class PHP_Annotation_Command_Var implements PHP_Annotation_Command { private $result; private $options; public function __construct($options=null) { $this->options = $options; $this->result = null; } public function getCode() { return ''; } public function & getResult() { return $this->result; } public function execute($key, $value, PHP_Annotation $annotation) { $matchs = array(); if (!is_null($this->result)) { throw new PEAR_Exception('Annotation parse error, It has already been set.(' . get_class($this) . ')', PEAR_ERROR_EXCEPTION); return ; } else if (!preg_match("/^(\S+)\s*(.*)/is", $value, $matchs)) { $annotation->throwException($key); return ; } // validate if ($this->validate($matchs[1], $matchs[2])) { $this->result = new PHP_Annotation_Type_Var($matchs[1], $matchs[2]); } else { $annotation->throwException($key); } } protected function validate($value) { return true; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Abstract.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Abstract.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Abstract.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Abstract.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * It is specified that it is Abstract type. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode abstract * @format */ class PHP_Annotation_Command_Doc_Abstract implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Boolean($options); } /** * returns Annotation Code * * @access public * @return string "abstract" */ public function getCode() { return 'abstract'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Access.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Access.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Access.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Access.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Access qualifier * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @format private|protected|public * @commandcode access */ class PHP_Annotation_Command_Doc_Access implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "access" */ public function getCode() { return 'access'; } /** * Verification * * @access protected * @param string $value Verification object * @return boolean */ protected function validate($value) { return preg_match("/^(private|protected|public)$/", $value); } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Author.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Author.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Author.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Author.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Authors. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode author * @format name<mailaddress> */ class PHP_Annotation_Command_Doc_Author implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Array($options); } /** * returns Annotation Code * * @access public * @return string "author" */ public function getCode() { return 'author'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Category.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Category.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Category.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Category.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Category Path * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode category * @format category */ class PHP_Annotation_Command_Doc_Category implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "category" */ public function getCode() { return 'category'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Copyright.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Copyright.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Copyright.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Copyright.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Describing of copyright clearly * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode copyright * @format copyright */ class PHP_Annotation_Command_Doc_Copyright implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "copyright" */ public function getCode() { return 'copyright'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Deprecated.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Deprecated.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Deprecated.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Deprecated.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * The spit describes replacing clearly in abolition. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode deprecated@ * @format [New API] */ class PHP_Annotation_Command_Doc_Deprecated implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "deprecated" */ public function getCode() { return 'deprecated'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Example.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Example.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Example.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Example.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Sample file place * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode example * @format filepath comment */ class PHP_Annotation_Command_Doc_Example implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_INI($options); } /** * returns Annotation Code * * @access public * @return string "example" */ public function getCode() { return 'example'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Filesource.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Filesource.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Filesource.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Filesource.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * It is specified that it is Filesource type. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode final@ * @format */ class PHP_Annotation_Command_Doc_Filesource implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Boolean($options); } /** * returns Annotation Code * * @access public * @return string "filesource" */ public function getCode() { return 'filesource'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Final.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Final.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Final.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Final.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * It is specified that it is Final type. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode final@ * @format */ class PHP_Annotation_Command_Doc_Final implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Boolean($options); } /** * returns Annotation Code * * @access public * @return string "final" */ public function getCode() { return 'final'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Global.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Global.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Global.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Global.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Type information on global variable. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode global * @format type var comment */ class PHP_Annotation_Command_Doc_Global implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Var($options); } /** * returns Annotation Code * * @access public * @return string "global" */ public function getCode() { return 'global'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Ignore.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Ignore.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Ignore.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Ignore.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * It is specified that it is Ignore type. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode ignore@ * @format */ class PHP_Annotation_Command_Doc_Ignore implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Boolean($options); } /** * returns Annotation Code * * @access public * @return string "ignore" */ public function getCode() { return 'ignore'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Internal.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Internal.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Internal.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Internal.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode name * @format uri */ class PHP_Annotation_Command_Doc_Internal implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "internal" */ public function getCode() { return 'internal'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/License.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/License.php +++ pear/PHP_Annotation/Annotation/Command/Doc/License.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: License.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Mark of license * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode license * @format license */ class PHP_Annotation_Command_Doc_License implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "license" */ public function getCode() { return 'license'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Link.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Link.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Link.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Link.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Reference link * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode link * @format uri */ class PHP_Annotation_Command_Doc_Link implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "link" */ public function getCode() { return 'link'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Name.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Name.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Name.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Name.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode name * @format uri */ class PHP_Annotation_Command_Doc_Name implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "name" */ public function getCode() { return 'name'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Package.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Package.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Package.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Package.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Package name * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode package * @format PackageName */ class PHP_Annotation_Command_Doc_Package implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "package" */ public function getCode() { return 'package'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Param.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Param.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Param.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Param.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Type information on parameter * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode param * @format type var comment */ class PHP_Annotation_Command_Doc_Param implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Param($options); } /** * returns Annotation Code * * @access public * @return string "param" */ public function getCode() { return 'param'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Return.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Return.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Return.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Return.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Type information on return * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode return@ * @format type[|type|type....] [comment] */ class PHP_Annotation_Command_Doc_Return implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Return($options); } /** * returns Annotation Code * * @access public * @return string "return" */ public function getCode() { return 'return'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/See.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/See.php +++ pear/PHP_Annotation/Annotation/Command/Doc/See.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: See.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * The reference ahead * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode see@ * @format Related matter */ class PHP_Annotation_Command_Doc_See implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Array($options); } /** * returns Annotation Code * * @access public * @return string "see" */ public function getCode() { return 'see'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Since.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Since.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Since.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Since.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Version that began to be supported * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode since * @format version */ class PHP_Annotation_Command_Doc_Since implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "since" */ public function getCode() { return 'since'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Static.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Static.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Static.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Static.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * It is specified that it is Static type. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode static * @format */ class PHP_Annotation_Command_Doc_Static implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Boolean($options); } /** * returns Annotation Code * * @access public * @return string "static" */ public function getCode() { return 'static'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Staticvar.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Staticvar.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Staticvar.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Staticvar.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Type information on static variable. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode staticvar * @format type var comment */ class PHP_Annotation_Command_Doc_Staticvar implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Var($options); } /** * returns Annotation Code * * @access public * @return string "staticvar" */ public function getCode() { return 'staticvar'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Subpackage.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Subpackage.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Subpackage.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Subpackage.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Sub Package name * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode subpackage * @format SubPackageName */ class PHP_Annotation_Command_Doc_Subpackage implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "subpackage" */ public function getCode() { return 'subpackage'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Todo.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Todo.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Todo.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Todo.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Todo * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode todo * @format comment */ class PHP_Annotation_Command_Doc_Todo implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "todo" */ public function getCode() { return 'todo'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Tutorial.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Tutorial.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Tutorial.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Tutorial.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * uri of Tutorial * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode tutorial * @format uri */ class PHP_Annotation_Command_Doc_Tutorial implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "tutorial" */ public function getCode() { return 'tutorial'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Uses.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Uses.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Uses.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Uses.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Variable of outside class and class that uses it. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode uses * @format var comment */ class PHP_Annotation_Command_Doc_Uses implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_INI($options); } /** * returns Annotation Code * * @access public * @return string "uses" */ public function getCode() { return 'uses'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Var.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Var.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Var.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Var.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Type information on property. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode var * @format type comment */ class PHP_Annotation_Command_Doc_Var implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Var($options); } /** * returns Annotation Code * * @access public * @return string "var" */ public function getCode() { return 'var'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Doc/Version.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Doc/Version.php +++ pear/PHP_Annotation/Annotation/Command/Doc/Version.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Version.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Current Version * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode version@ * @format version */ class PHP_Annotation_Command_Doc_Version implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "version" */ public function getCode() { return 'version'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Command/Util/Commandcode.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Command/Util/Commandcode.php +++ pear/PHP_Annotation/Annotation/Command/Util/Commandcode.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Commandcode.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Annotation Command Code * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @commandcode commandcode */ class PHP_Annotation_Command_Util_Commandcode implements PHP_Annotation_Command { private $command; /** * */ public function __construct($options=null) { $this->command = new PHP_Annotation_Command_Single($options); } /** * returns Annotation Code * * @access public * @return string "commandcode" */ public function getCode() { return 'commandcode'; } public function & getResult() { return $this->command->getResult(); } public function execute($key, $value, PHP_Annotation $annotation) { return $this->command->execute($key, $value, $annotation); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/ContainerConfig/ArrayText.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/ContainerConfig/ArrayText.php +++ pear/PHP_Annotation/Annotation/ContainerConfig/ArrayText.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: ArrayText.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * ContainerConfig Engine. * The setting is read by using the format of java.lang.annotation. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_ContainerConfig_ArrayText extends PHP_Annotation_ContainerConfig { /** * @access private * @var array */ private $ini; /** * Construct * * @access public * @param string $filepath Config filepath * @return void */ public function __construct($filepath) { $this->ini = PHP_Annotation_InfoValuesParser::singleton()->build(file_get_contents($filepath)); } /** * get Component * * @access public * @param string $name Component Name * @return mixed */ public function getComponentInfo($name) { $name = strtolower($name); if (isset($this->ini[$name])) { $class = (isset($this->ini[$name]['class'])) ? $this->ini[$name]['class'] : $name ; $info = new PHP_Annotation_Type_Info(); if (isset($this->ini[$name]['component'])) { // foreach ($this->ini[$name]['component'] as $key=>$data) { $item = new PHP_Annotation_Type_InfoItem($key, $data); $info->addItem($item); } } return new PHP_Annotation_Type_ComponentInfo($name, $class, $info); } return null; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/ContainerFilter/Construct.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/ContainerFilter/Construct.php +++ pear/PHP_Annotation/Annotation/ContainerFilter/Construct.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Construct.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * It takes charge of the processing of Construct when Component is generated. * Format: @construct([construct_param1_name = construct_param1_value]...) * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_ContainerFilter_Construct implements PHP_Annotation_ContainerFilter_Impl { /** * build Component filter * * @access public * @param object $target Target component * @param object $component_info PHP_Annotation_Type_ComponentInfo object * @return boolean if it is false. than stop build. */ public function filter(&$target, PHP_Annotation_Type_ComponentInfo $component_info) { // $anno = PHP_Annotation::parse($component_info->getClassName()); // $target = $this->_generateClass($anno, $component_info->getInfo()); } /** * generate Class Object * * @access private * @param object $annotation PHP_Annotation object * @param object $info PHP_Annotation_Type_Info object * @return object Class Object */ private function _generateClass($annotation, $info) { // $ref = $annotation->getReflector(); $method = $ref->getConstructor(); if (is_null($method)) { return $ref->newInstance(); } // $tmp_pm = $method->getParameters(); $params = array(); if (!is_null($info->construct)) { foreach ($tmp_pm as $num=>$param) { $key = $param->getName(); $params[$num] = ($info->construct->has($key)) ? $info->construct->$key : null ; } } else { foreach ($tmp_pm as $num=>$param) { $key = $param->getName(); $params[$num] = null; } } // return $ref->newInstanceArgs($params); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/ContainerFilter/Filter.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/ContainerFilter/Filter.php +++ pear/PHP_Annotation/Annotation/ContainerFilter/Filter.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Filter.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * It takes charge of the filtering when Component is generated. * Format: none * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_ContainerFilter_Filter implements PHP_Annotation_ContainerFilter_Impl { /** * */ private $factorys; /** * Construct * * @access public */ public function __construct() { $this->factories= new ArrayObject(); } /** * add Container Filter object * * @access public * @param object $factory PHP_Annotation_ContainerFilter_Impl * @return void */ public function addContainerFilter(PHP_Annotation_ContainerFilter_Impl $factory) { $this->factories[] = $factory; } /** * build Component filter * * @access public * @param object $target Target component * @param object $component_info PHP_Annotation_Type_ComponentInfo object * @return boolean if it is false. than stop build. */ public function filter(&$target, PHP_Annotation_Type_ComponentInfo $component_info) { $iterator = $this->factories->getIterator(); $this->_filter(&$target, &$component_info, $iterator); } /** * build Component filter by iterator * * @access private * @param object $target Target component * @param object $component_info PHP_Annotation_Type_ComponentInfo object * @param object $iterator ArrayIterator object * @return boolean if it is false. than stop build. */ private function _filter(&$target, PHP_Annotation_Type_ComponentInfo $component_info, &$iterator) { if (false === $iterator->valid()) { return ; } $factory = $iterator->current(); if (false === $factory->filter($target, $component_info)) { return; } $iterator->next(); $this->_filter($target, $component_info, $iterator); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/ContainerFilter/Impl.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/ContainerFilter/Impl.php +++ pear/PHP_Annotation/Annotation/ContainerFilter/Impl.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Impl.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * The implement interface necessary to generate Component. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ interface PHP_Annotation_ContainerFilter_Impl { /** * build Component filter * * @access public * @param object $target Target component * @param object $component_info PHP_Annotation_Type_ComponentInfo object * @return boolean if it is false. than stop build. */ public function filter(&$target, PHP_Annotation_Type_ComponentInfo $component_info); } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/ContainerFilter/Instance.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/ContainerFilter/Instance.php +++ pear/PHP_Annotation/Annotation/ContainerFilter/Instance.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Instance.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * It takes charge of instance control when Component is generated. * Format: @instance(value=prototype|singleton) * - Set Value - * prototype: Generate any object * singleton: Generate only one object * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_ContainerFilter_Instance implements PHP_Annotation_ContainerFilter_Impl { /** * @static * @access private * @var array */ private $_Caches = array(); /** * build Component filter * * @access public * @param object $target Target component * @param object $component_info PHP_Annotation_Type_ComponentInfo object * @return boolean if it is false. than stop build. */ public function filter(&$target, PHP_Annotation_Type_ComponentInfo $component_info) { // if (!is_null($component_info->getInfo()->instance)) { switch($component_info->getInfo()->instance->value) { case 'prototype': return; case 'singleton': default : break; } } // $name = $component_info->getName(); if (array_key_exists($name, $this->_Caches)) { $target = $this->_Caches[$name]; return false; } // $this->_Caches[$name] = &$target; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/ContainerFilter/Property.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/ContainerFilter/Property.php +++ pear/PHP_Annotation/Annotation/ContainerFilter/Property.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Property.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * It takes charge of rewriting property when Component is generated. * Format: @property([property_name = rewrite_value]...) * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_ContainerFilter_Property implements PHP_Annotation_ContainerFilter_Impl { /** * build Component filter * * @access public * @param object $target Target component * @param object $component_info PHP_Annotation_Type_ComponentInfo object * @return boolean if it is false. than stop build. */ public function filter(&$target, PHP_Annotation_Type_ComponentInfo $component_info) { if (is_null($component_info->getInfo()->property)) { return ; } // $itr = $component_info->getInfo()->property->getIterator(); while (true===$itr->valid()) { $key = $itr->key(); $target->$key = $itr->current(); $itr->next(); } } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Factory/Console.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Factory/Console.php +++ pear/PHP_Annotation/Annotation/Factory/Console.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Console.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ require_once "PHP/Annotation/Builder/Console.php"; /** * Generate Console Command. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Factory_Console implements PHP_Annotation_Factory { /** * get Component * * @access public * @param string $name Component Name * @return mixed */ function getComponent($name) { $director = new PHP_Annotation_Director(new PHP_Annotation_Builder_Console()); $director->build($name); return $director->getBuilder()->getResult(); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Factory/Container.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Factory/Container.php +++ pear/PHP_Annotation/Annotation/Factory/Container.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Container.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ require_once "PHP/Annotation/ContainerConfig.php"; require_once "PHP/Annotation/Builder/Info.php"; require_once "PHP/Annotation/Type/ComponentInfo.php"; require_once "PHP/Annotation/ContainerFilter/Impl.php"; require_once "PHP/Annotation/ContainerFilter/Filter.php"; require_once "PHP/Annotation/ContainerFilter/Instance.php"; require_once "PHP/Annotation/ContainerFilter/Construct.php"; require_once "PHP/Annotation/ContainerFilter/Property.php"; /** * DI library * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Factory_Container implements PHP_Annotation_Factory { /** * @access private * @var object PHP_Annotation_ContainerFilter_Filter object */ private $_filter; /** * @access private * @var object PHP_Annotation_Factory_ComponentInfo object */ private $_factory; /** * Construct * * @access public */ public function __construct() { $this->_filter = new PHP_Annotation_ContainerFilter_Filter(); // $this->_filter->addContainerFilter(new PHP_Annotation_ContainerFilter_Instance()); $this->_filter->addContainerFilter(new PHP_Annotation_ContainerFilter_Construct()); $this->_filter->addContainerFilter(new PHP_Annotation_ContainerFilter_Property()); // $this->setContainerConfig(); } /** * set PHP_Annotation_Factory_ComponentInfo object * * @access public * @param object $factory PHP_Annotation_Factory_ComponentInfo */ public function setContainerConfig(PHP_Annotation_ContainerConfig $config=null) { // $this->_config = (is_null($config)) ? new PHP_Annotation_ContainerConfig() : $config ; } /** * get Component * * @access public * @param string $name Component Name * @return mixed */ public function getComponent($name) { // $compinfo = $this->getComponentInfo($name); // PHP_Annotation_Type_InfoItem :: setContainer($this); //var_dump($compinfo); if (is_null($compinfo)) {//testcode echo "Not Found Component '".$name."'.\n"; return null; } $this->_filter->filter($target, $compinfo); // return $target; } /** * get Component info * * @access public * @param string $name Component Name * @return object PHP_Annotation_Type_ComponentInfo object */ function getComponentInfo($name) { // $this->_config->start($name); $compinfo = $this->_config->execComponentInfo($name); $this->_config->end($name); return $compinfo; } /** * get PHP_Annotation_ContainerFilter_Filter Object * * @access public * @return object PHP_Annotation_ContainerFilter_Filter object */ public function &getFilter() { return $this->_filter; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/InfoValues/ObjectGenerator.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/InfoValues/ObjectGenerator.php +++ pear/PHP_Annotation/Annotation/InfoValues/ObjectGenerator.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: ObjectGenerator.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * This is the interface to return an object at the time of dater Peirce of InfoValues. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ interface PHP_Annotation_InfoValues_ObjectGenerator { /** * generate Object * * @access public * @param string $name object name * @param mixed $obj target object */ public function generate($name, &$obj); } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/InfoValues/Parser.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/InfoValues/Parser.php +++ pear/PHP_Annotation/Annotation/InfoValues/Parser.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Parser.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Parse to generate InfoValues. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_InfoValues_Parser { private $Result; private $gen; /** * Construct * * @access public * @param object $gen PHP_Annotation_InfoValues_ObjectGenerator */ public function __construct(PHP_Annotation_InfoValues_ObjectGenerator $gen) { $this->gen = $gen; } /** * Get Parse Result * * @access public * @return mixed */ public function getResult() { return $this->Result; } /** * parse string to generate Values. * * @access public * @param mixed $str target string * @return boolean */ public function build(&$str) { $target = new PHP_Annotation_InfoValues_Token($str); // $this->Result = array(); if (false===$this->_parseStart($target, $this->Result)) { $mssg = 'Parse error, unexpected value offset '.$target->getOffset().' \''.$target->getNearbyString().'\''; throw new PEAR_Exception($mssg, PEAR_ERROR_EXCEPTION); return false; } return (false===$target->valid()); } /** * * @access public * @param object $target PHP_Annotation_InfoValues_Token * @param mixed $result * @return boolean */ private function _parseStart(PHP_Annotation_InfoValues_Token $target, &$result) { if (false===$target->valid()) { return false; } $crrt = $target->current(); if (preg_match("/^\s+$/", $crrt)) { $target->next(); return $this->_parseStart($target, $result); } // $val = null; switch ($crrt) { case '{': case '"': case "'": $result['value'] = null; return $this->_parseValue($target, $result['value']); } // $target->next(); if (false===$this->_parseKey($target, $val)) { $target->reset(); $result['value'] = null; return $this->_parseValue($target, $result['value']); } $target->reset(); $target->setArrayEnd(); return $this->_parseArray($target, $result); } /** * * @access public * @param object $target PHP_Annotation_InfoValues_Token * @param mixed $result * @return boolean */ private function _parseValue(PHP_Annotation_InfoValues_Token $target, &$result) { if (false===$target->valid()) { return false; } $crrt = $target->current(); if (preg_match("/^\s+$/", $crrt)) { $target->next(); return $this->_parseValue($target, $result); } // switch ($crrt) { case '}': case '=': case ',': return false; case '{': $target->next(); return $this->_parseArray($target, $result); case '"': $target->next(); return $this->_parseDoubleQuotation($target, $result); case "'": $target->next(); return $this->_parseSingleQuotation($target, $result); } // switch (true) { case is_numeric($crrt): $target->next(); $result = 0+$crrt; return true; case 0===strcasecmp($crrt, 'true'): $target->next(); $result = true; return true; case 0===strcasecmp($crrt, 'false'): $target->next(); $result = false; return true; case 0===strcasecmp($crrt, 'null'): $target->next(); $result = null; return true; } // $target->next(); return $this->gen->generate($crrt, $result); } /** * * @access public * @param object $target PHP_Annotation_InfoValues_Token * @param mixed $result * @return boolean */ private function _parseArray(PHP_Annotation_InfoValues_Token $target, &$result) { if (false===$target->valid()) { return false; } $crrt = $target->current(); if (preg_match("/^\s+$/", $crrt)) { $target->next(); return $this->_parseArray($target, $result); } // switch ($crrt) { case '{': case '"': case "'": return false; case '}': $target->next(); return true; case ',': $target->next(); return $this->_parseArray($target, $result); } // $key = null; if (false === $this->_parseKey($target, $key)) { return false; } $key = (is_null($key))? count($result) : strtolower($key); $val = null; if ($this->_parseValue($target, $val)) { $result[$key] = $val; return $this->_parseArray($target, $result); } return false; } /** * * @access public * @param object $target PHP_Annotation_InfoValues_Token * @param mixed $result * @return boolean */ private function _parseKey(PHP_Annotation_InfoValues_Token $target, &$result) { if (false===$target->valid()) { return false; } $crrt = $target->current(); if (preg_match("/^\s+$/", $crrt)) { $target->next(); return $this->_parseKey($target, $result); } // $crrt = $target->current(); $target->next(); if ("\\"===$crrt) { $crrt = $target->current(); $target->next(); } else if ("="===$crrt) { return true; } // $result .= $crrt; return $this->_parseKey($target, $result); } /** * * @access public * @param object $target PHP_Annotation_InfoValues_Token * @param mixed $result * @return boolean */ private function _parseSingleQuotation(PHP_Annotation_InfoValues_Token $target, &$result) { if (false===$target->valid()) { return false; } $crrt = $target->current(); $target->next(); if ("\\"===$crrt) { $tmp = $target->current(); $crrt = ('"'===$tmp)?'\\"':$tmp; $target->next(); } else if ("'"===$crrt) { return true; } // $result .= $crrt; return $this->_parseSingleQuotation($target, $result); } /** * * @access public * @param object $target PHP_Annotation_InfoValues_Token * @param mixed $result * @return boolean */ private function _parseDoubleQuotation(PHP_Annotation_InfoValues_Token $target, &$result) { if (false===$target->valid()) { return false; } $crrt = $target->current(); $target->next(); if ("\\"===$crrt) { $tmp = $target->current(); $crrt = ("'"===$tmp)?"\\'":$tmp; $target->next(); } else if ('"'===$crrt) { return true; } // $result .= $crrt; return $this->_parseDoubleQuotation($target, $result); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/InfoValues/Token.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/InfoValues/Token.php +++ pear/PHP_Annotation/Annotation/InfoValues/Token.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Token.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Creates a token to parse. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_InfoValues_Token { private $data; private $offset; private $index; private $length; /** * Construct * * @access public * @param mixed $str target string */ public function __construct(&$str) { $matches = array(); preg_match_all("/\s+|\{|\}|\,|=|\"|\'|\\\|[^\{\}\,\\\=\'\"\s]+/S", $str, $matches); // $this->offset = 0; $this->index = 0; $this->data = $matches[0]; $this->length = count($this->data); } /** * Get current value. * * @access public * @return mixed crrent value */ public function & current() { return $this->data[$this->index]; } /** * Step Next Value. * * @access public * @return void */ public function next() { $this->offset += strlen($this->data[$this->index]); $this->index++; } /** * Does the value exist? * * @access public * @return boolean */ public function valid() { return ($this->length > $this->index); } /** * Step counts resets 0. * * @access public * @return void */ public function reset() { $this->offset = 0; $this->index = 0; } /** * Get current offset of target string. * * @access public * @return int */ public function getOffset() { return $this->offset; } /** * Add symbol '}' to End of Tokens. * * @access public * @return void */ public function setArrayEnd() { $this->data[] = '}'; $this->length++; } /** * Get current token nearby. * * @access public * @return string */ public function getNearbyString() { $str = ''; if (0<$this->index) { $str .= $this->data[$this->index-1]; } $str .= $this->data[$this->index]; if ($this->length>$this->index+1) { $str .= $this->data[$this->index+1]; } return $str; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/ObjectGenerator/StdClass.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/ObjectGenerator/StdClass.php +++ pear/PHP_Annotation/Annotation/ObjectGenerator/StdClass.php <?php /** * */ class PHP_Annotation_ObjectGenerator_StdClass implements PHP_Annotation_InfoValues_ObjectGenerator { /** * */ public function generate($name, &$obj) { $obj = new stdClass(); $obj->name = $name; return true; } } ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Tool/CUI.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Tool/CUI.php +++ pear/PHP_Annotation/Annotation/Tool/CUI.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: CUI.php,v 1.1 2007/01/15 15:13:06 kouichi66 Exp $ * @since File available since Release 0.1.0 */ require_once "PHP/Annotation.php"; require_once "PHP/Annotation/Factory/Console.php"; /** * PHP Annotation Command Tool * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 * @console PHP Annotation Command Tool */ class PHP_Annotation_Tool_CUI { /** * @console View PHP_Annotation Version * * @param string $class Class name */ function version($class = "PHP_Annotation") { $anno = PHP_Annotation::parse($class); $version = $anno->exec_PHP_Annotation_Command_Doc_Version(); echo 'Version of '.$class.' is "'.$version.'"'; } /** * @console Create package2.xml * * @param string $class Class name * @param string $filepath File path */ function createpear($class, $filepath) { include_once "PHP/Annotation/Factory/PearPackage.php"; if (!class_exists($class)) { include_once $filepath; } $factory = new PHP_Annotation_Factory_PearPackage(); $pkg = $factory->getComponent($class); $result = $pkg->writePackageFile(); if (true === $result) { echo "Create package2.xml."; return; } } } $factory = new PHP_Annotation_Factory_Console(); $factory->getComponent('PHP_Annotation_Tool_CUI'); /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Type/ComponentInfo.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Type/ComponentInfo.php +++ pear/PHP_Annotation/Annotation/Type/ComponentInfo.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: ComponentInfo.php,v 1.1 2007/01/15 15:13:07 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Component Info Object. To use it by PHP_Annotation_Factory_ComponentInfo. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Type_ComponentInfo { /** * @access private * @var string */ private $name; /** * @access private * @var string */ private $classname; /** * @access private * @var PHP_Annotation_Type_Info */ private $info; /** * Construct * * @access public * @param string $classname Class name * @param object $info PHP_Annotation_Type_Info */ public function __construct($name, $classname, PHP_Annotation_Type_Info $info) { $this->name = $name; $this->classname = $classname; $this->info = $info; } /** * get Component name * * @access public * @return string Component name */ public function getName() { return $this->name; } /** * get Class name * * @access public * @return string Class name */ public function getClassName() { return $this->classname; } /** * get PHP_Annotation_Type_Info Object * * @access public * @return object $info PHP_Annotation_Type_Info */ public function getInfo() { return $this->info; } /** * merge my PHP_Annotation_Type_Info Object * * @access public * @param object $info PHP_Annotation_Type_Info * @return void */ public function merge(PHP_Annotation_Type_ComponentInfo $info) { $this->info->merge($info->getInfo()); } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Type/Info.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Type/Info.php +++ pear/PHP_Annotation/Annotation/Type/Info.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Info.php,v 1.1 2007/01/15 15:13:07 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Value of Annotation(format:java.lang.annotation) Object * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Type_Info { /** * @access private * @var array */ private $properties; /** * Construct * * @access public */ public function __construct() { $this->properties = array(); } /** * add PHP_Annotation_Type_InfoItem object * * @access public * @param object $item PHP_Annotation_Type_InfoItem object * @return void */ public function addItem(PHP_Annotation_Type_InfoItem $item) { $name = $item->getName(); $this->properties[$name] = $item; } /** * get Iterator object * * @access public * @return ArrayIterator */ public function getIterator() { $arrayobject = new ArrayObject($this->properties); return $arrayobject->getIterator(); } /** * return boolean of has value * * @access public * @param string $name key name * @return boolean */ public function has($name) { return (isset($this->properties[$name])); } /** * get PHP_Annotation_Type_InfoItem object * * @access public * @param string $name key name * @return PHP_Annotation_Type_InfoItem */ public function __get($name) { if (!isset($this->properties[$name])) { return null; } return $this->properties[$name]; } /** * None action * * @access public * @param string $name * @param string $value * @return boolean */ public function __set($name, $value) { ; } /** * merge PHP_Annotation_Type_Info object * * @access public * @param object $info PHP_Annotation_Type_Info * @return void */ public function merge(PHP_Annotation_Type_Info $info) { $itr = $info->getIterator(); while (true===$itr->valid()) { if (false === $this->has($itr->key())) { $this->properties[$itr->key()] = $itr->current(); } $itr->next(); } } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Type/InfoItem.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Type/InfoItem.php +++ pear/PHP_Annotation/Annotation/Type/InfoItem.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: InfoItem.php,v 1.1 2007/01/15 15:13:07 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Item in Value of Annotation(format:java.lang.annotation) Object * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Type_InfoItem { /** * @static * @access private * @var PHP_Annotation_Factory_Container */ static private $__Factory; /** * @access private * @var string */ private $name; /** * @access private * @var array */ private $properties; /** * @access private * @var int */ private $error_offset; /** * Construct * * @access public * @param string $name key name * @param mixed $value string or array */ public function __construct($name, $value) { $this->name = $name; $this->error_offset = -1; $this->properties = array(); if (is_string($value)) { $this->properties = PHP_Annotation_InfoValuesParser::singleton()->build($value); } else if (is_array($value)) { $this->properties = $value; } } /** * set PHP_Annotation_Factory_Container object * * @access public * @param object $factory PHP_Annotation_Factory_Container object * @return void */ static public function setContainer(PHP_Annotation_Factory_Container $factory) { self :: $__Factory = $factory; } /** * get Parse Error offset * * @access public * @return int */ public function getErrorOffset() { return $this->error_offset; } /** * get Key name * * @access public * @return string */ public function getName() { return $this->name; } /** * get ArrayItaretor * * @access public * @return ArrayIterator */ public function getIterator() { $arrayobject = new ArrayObject($this->properties); return $arrayobject->getIterator(); } /** * return boolean of has value * * @access public * @param string $name value name * @return boolean */ public function has($name) { $name = strtolower($name); return isset($this->properties[$name]); } /** * None action * * @access public * @param string $name * @param string $value * @return boolean */ public function __set($name, $value) { ; } /** * get Value * * @access public * @param string $name value name * @return mixed */ public function __get($name) { $name = strtolower($name); if (!isset($this->properties[$name])) { return null; } if (is_array($this->properties[$name]) && !isset($this->check_convert_arrays[$name])) { $tmp = $this->properties[$name]; $this->_generateArray($tmp); return $tmp; } if ($this->properties[$name] instanceof stdClass) { return self :: $__Factory->getComponent($this->properties[$name]->name); } return $this->properties[$name]; } /** * generate Array object * * @access private * @param array $target * @return array */ private function _generateArray(&$target) { foreach ($target as $num=>&$data) { switch (true) { case ($data instanceof stdClass) : $data = self :: $__Factory->getComponent($data->name); break; case is_array($data) : $this->_generateArray($data); break; } } } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Type/Return.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Type/Return.php +++ pear/PHP_Annotation/Annotation/Type/Return.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Return.php,v 1.1 2007/01/15 15:13:07 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Annotation Type Return * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Type_Return { /** * @access private * @var string[] */ private $types; /** * @access private * @var string */ private $comment; /** * construct * * @access public * @param string $type var type * @param string $comment Comment * @return void */ public function __construct($types, $comment) { $this->types = $types; $this->comment = $comment; } /** * returns Type * * @access public * @param interger $num * @return string */ public function getType($num) { if (isset($this->types[$num])) { return $this->types[$num]; } } /** * returns Types count * * @access public * @return integer */ public function getTypeCount() { return count($this->types[$num]); } /** * returns Comment * * @access public * @return string */ public function getComment() { return $this->comment; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/Annotation/Type/Var.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/Annotation/Type/Var.php +++ pear/PHP_Annotation/Annotation/Type/Var.php <?php /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /** * PHP_Annotation, Attribute Extension is supported to Class,Function,Method and Property. * * PHP version 5 * * LICENSE: This source file is subject to version 3.0 of the PHP license * that is available through the world-wide-web at the following URI: * http://www.php.net/license/3_0.txt. If you did not receive a copy of * the PHP License and are unable to obtain it through the web, please * send a note to license@php.net so we can mail you a copy immediately. * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version $Id: Var.php,v 1.1 2007/01/15 15:13:07 kouichi66 Exp $ * @since File available since Release 0.1.0 */ /** * Annotation Type Var * * @category PHP * @package PHP_Annotation * @author Kouichi Sakamoto <sakamoto@servlet.sakura.ne.jp> * @copyright 2006 Kouichi Sakamoto * @license http://www.php.net/license/3_0.txt PHP License 3.0 * @version Release: 0.1.0 * @since Class available since Release 0.1.0 */ class PHP_Annotation_Type_Var { /** * @access private * @var string */ private $type; /** * @access private * @var string */ private $comment; /** * construct * * @access public * @param string $type var type * @param string $comment Comment */ public function __construct($type, $comment) { $this->type = $type; $this->comment = $comment; } /** * returns Type * * @access public * @return string */ public function getType() { return $this->type; } /** * returns Comment * * @access public * @return string */ public function getComment() { return $this->comment; } } /* * Local Variables: * mode: php * tab-width: 4 * c-basic-offset: 4 * End: */ ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/AnnotationContainerFactoryTest.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/AnnotationContainerFactoryTest.php +++ pear/PHP_Annotation/tests/AnnotationContainerFactoryTest.php <?php // Call AnnotationContainerFactoryTest::main() if this source file is executed directly. if (!defined("PHPUnit_MAIN_METHOD")) { define("PHPUnit_MAIN_METHOD", "AnnotationContainerFactoryTest::main"); } require_once "PHPUnit/Framework/TestCase.php"; require_once "PHPUnit/Framework/TestSuite.php"; require_once "PHP/Annotation.php"; require_once "TestSample.php"; /** * Test class for AnnotationCommand. * Generated by PHPUnit_Util_Skeleton on 2006-10-31 at 09:20:10. */ class AnnotationContainerFactoryTest extends PHPUnit_Framework_TestCase { /** * Runs the test methods of this class. * * @access public * @static */ public static function main() { require_once "PHPUnit/TextUI/TestRunner.php"; $suite = new PHPUnit_Framework_TestSuite("AnnotationContainerFactoryTest"); $result = PHPUnit_TextUI_TestRunner::run($suite); } /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { } /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. * * @access protected */ protected function tearDown() { } /** * @todo Implement testTest1(). */ public function testTest1() { $cf = PHP_Annotation::CF(); $cf->loadConfig(dirname(__FILE__).'/test2.dicon'); $cf->getComponent('TestSample4'); } } // Call AnnotationContainerFactoryTest::main() if this source file is executed directly. if (PHPUnit_MAIN_METHOD == "AnnotationContainerFactoryTest::main") { AnnotationContainerFactoryTest::main(); } ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/AnnotationDocCommandTest.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/AnnotationDocCommandTest.php +++ pear/PHP_Annotation/tests/AnnotationDocCommandTest.php <?php // Call AnnotationDocCommandTest::main() if this source file is executed directly. if (!defined("PHPUnit_MAIN_METHOD")) { define("PHPUnit_MAIN_METHOD", "AnnotationDocCommandTest::main"); } require_once "PHPUnit/Framework/TestCase.php"; require_once "PHPUnit/Framework/TestSuite.php"; require_once "PHP/Annotation.php"; require_once "TestSample.php"; /** * Test class for AnnotationDocCommand. * Generated by PHPUnit_Util_Skeleton on 2006-10-31 at 09:20:10. */ class AnnotationDocCommandTest extends PHPUnit_Framework_TestCase { /** * Runs the test methods of this class. * * @access public * @static */ public static function main() { require_once "PHPUnit/TextUI/TestRunner.php"; $suite = new PHPUnit_Framework_TestSuite("AnnotationDocCommandTest"); $result = PHPUnit_TextUI_TestRunner::run($suite); } /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { } /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. * * @access protected */ protected function tearDown() { } /** * @todo Implement testDoc_Abstract(). */ public function testDoc_Abstract() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Abstract(); $this->assertTrue($result); } /** * @todo Implement testDoc_Access(). */ public function testDoc_Access() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Access(); $this->assertEquals('private', $result); } /** * @todo Implement testDoc_Author(). */ public function testDoc_Author() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Author(); $this->assertEquals('authorname', $result[0]); } /** * @todo Implement testDoc_Category(). */ public function testDoc_Category() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Category(); $this->assertEquals('categoryname', $result); } /** * @todo Implement testDoc_Copyright(). */ public function testDoc_Copyright() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Copyright(); $this->assertEquals('copyright information', $result); } /** * @todo Implement testDoc_Deprecated(). */ public function testDoc_Deprecated() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Deprecated(); $this->assertEquals('version/info string', $result); } /** * @todo Implement testDoc_Example(). */ public function testDoc_Example() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Example(); foreach ($result as $key=>$val) { $this->assertEquals('relativepath/to/example.php', $key); $this->assertEquals('description', $val); } } /** * @todo Implement testDoc_Final(). */ public function testDoc_Final() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Final(); $this->assertTrue($result); } /** * @todo Implement testDoc_Filesource(). */ public function testDoc_Filesource() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Filesource(); $this->assertTrue($result); } /** * @todo Implement testDoc_Global(). */ public function testDoc_Global() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Global(); $this->assertEquals('datatype', $result->getType()); $this->assertEquals('description', $result->getComment()); } /** * @todo Implement testDoc_Ignore(). */ public function testDoc_Ignore() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Ignore(); $this->assertTrue($result); } /** * @todo Implement testDoc_Internal(). */ public function testDoc_Internal() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_internal(); $this->assertEquals('any information that should not be displayed in public documentation [unspecified format]', $result); } /** * @todo Implement testDoc_License(). */ public function testDoc_License() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_License(); $this->assertEquals('URL name of license', $result); } /** * @todo Implement testDoc_Link(). */ public function testDoc_Link() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Link(); $this->assertEquals('URL, URL, URL...', $result); } /** * @todo Implement testDoc_Name(). */ public function testDoc_Name() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Name(); $this->assertEquals('$globalvariablename', $result); } /** * @todo Implement testDoc_Package(). */ public function testDoc_Package() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Package(); $this->assertEquals('packagename', $result); } /** * @todo Implement testDoc_Param(). */ public function testDoc_Param() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Param(); foreach ($result as $key=>$val) { $this->assertEquals('$paramname', $key); $this->assertEquals('datatype', $val->getType()); $this->assertEquals('description', $val->getComment()); } } /** * @todo Implement testDoc_Return(). */ public function testDoc_Return() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Return(); $this->assertEquals('datatype', $result->getType(0)); $this->assertEquals('description', $result->getComment()); } /** * @todo Implement testDoc_See(). */ public function testDoc_See() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_See(); $this->assertEquals('file.ext|elementname|class::methodname()|class::$variablename|functionname()|function functionname unlimited number of values separated by commas', $result[0]); } /** * @todo Implement testDoc_Since(). */ public function testDoc_Since() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Since(); $this->assertEquals('version/info string [unspecified format]', $result); } /** * @todo Implement testDoc_Static(). */ public function testDoc_Static() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Static(); $this->assertTrue($result); } /** * @todo Implement testDoc_Staticvar(). */ public function testDoc_Staticvar() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Staticvar(); $this->assertEquals('datatype', $result->getType()); $this->assertEquals('description', $result->getComment()); } /** * @todo Implement testDoc_Subpackage(). */ public function testDoc_Subpackage() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Subpackage(); $this->assertEquals('subpackagename', $result); } /** * @todo Implement testDoc_Todo(). */ public function testDoc_Todo() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Todo(); $this->assertEquals('information string [unspecified format]', $result); } /** * @todo Implement testDoc_Tutorial(). */ public function testDoc_Tutorial() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Tutorial(); $this->assertEquals('package/ subpackage/ tutorialname.ext #section.subsection description', $result); } /** * @todo Implement testDoc_Uses(). */ public function testDoc_Uses() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Uses(); foreach ($result as $key=>$val) { $this->assertEquals('file.ext|elementname|class::methodname()|class::$variablename|functionname()|function', $key); $this->assertEquals('functionname description of how the element is used', $val); } } /** * @todo Implement testDoc_Var(). */ public function testDoc_Var() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Var(); $this->assertEquals('datatype', $result->getType()); $this->assertEquals('description', $result->getComment()); } /** * @todo Implement testDoc_Version(). */ public function testDoc_Version() { $annot = PHP_Annotation::parse('TestSample'); $result = $annot->execDoc_Version(); $this->assertEquals('versionstring [unspecified format]', $result); } } // Call AnnotationDocCommandTest::main() if this source file is executed directly. if (PHPUnit_MAIN_METHOD == "AnnotationDocCommandTest::main") { AnnotationDocCommandTest::main(); } ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/AnnotationInfoCommandTest.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/AnnotationInfoCommandTest.php +++ pear/PHP_Annotation/tests/AnnotationInfoCommandTest.php <?php // Call AnnotationInfoCommandTest::main() if this source file is executed directly. if (!defined("PHPUnit_MAIN_METHOD")) { define("PHPUnit_MAIN_METHOD", "AnnotationInfoCommandTest::main"); } require_once "PHPUnit/Framework/TestCase.php"; require_once "PHPUnit/Framework/TestSuite.php"; require_once "PHP/Annotation.php"; require_once "TestSample.php"; /** * Test class for AnnotationCommand. * Generated by PHPUnit_Util_Skeleton on 2006-10-31 at 09:20:10. */ class AnnotationInfoCommandTest extends PHPUnit_Framework_TestCase { /** * Runs the test methods of this class. * * @access public * @static */ public static function main() { require_once "PHPUnit/TextUI/TestRunner.php"; $suite = new PHPUnit_Framework_TestSuite("AnnotationInfoCommandTest"); $result = PHPUnit_TextUI_TestRunner::run($suite); } /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { } /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. * * @access protected */ protected function tearDown() { } /** * @todo Implement testTest1(). */ public function testTest1() { $annot = PHP_Annotation::parse('TestSample4')->method('test1'); $info = $annot->exec(); $result = $info->sample; $this->assertEquals('helloworld', $result->foo); } /** * @todo Implement testTest2(). */ public function testTest2() { $annot = PHP_Annotation::parse('TestSample4')->method('test2'); $info = $annot->exec(); $result = $info->sample; $this->assertEquals(1000, $result->foo); } /** * @todo Implement testTest3(). */ public function testTest3() { $annot = PHP_Annotation::parse('TestSample4')->method('test3'); $info = $annot->exec(); $result = $info->sample; $this->assertEquals(0.1234, $result->foo); } /** * @todo Implement testTest4(). */ public function testTest4() { $annot = PHP_Annotation::parse('TestSample4')->method('test4'); $info = $annot->exec(); $result = $info->sample; $this->assertEquals('111', $result->foo['ary1']); $this->assertEquals('222', $result->foo['ary2']); } /** * @todo Implement testTest5(). */ public function testTest5() { $annot = PHP_Annotation::parse('TestSample4')->method('test5'); $info = $annot->exec(); $result = $info->sample; $this->assertEquals('333', $result->foo[0]); $this->assertEquals('444', $result->foo[1]); } /** * @todo Implement testTest6(). */ public function testTest6() { $annot = PHP_Annotation::parse('TestSample4')->method('test6'); $info = $annot->exec(); $result = $info->sample; $this->assertEquals(100, $result->{'0'}); } /** * @todo Implement testTest7(). */ public function testTest7() { $annot = PHP_Annotation::parse('TestSample4')->method('test7'); $info = $annot->exec(); $result = $info->sample; $this->assertEquals("aaa bbb", $result->foo); } /** * @todo Implement testTest8(). */ public function testTest8() { $annot = PHP_Annotation::parse('TestSample4')->method('test8'); $info = $annot->exec(); $result = $info->sample; $this->assertEquals("stringtest", $result->value); } /** * @todo Implement testTest9(). */ public function testTest9() { $check = array(); $check['ary1'] = '1"11'; $check['ary\'2'] = '2\'22'; $check['ary3'] = "3'33"; $check['ary4'] = "4\"44"; $check['ary5'] = "5\"5\'5"; $check['ary6'] = '6\'6\"6'; $check['ary7'] = "7\\\"77"; $annot = PHP_Annotation::parse('TestSample4')->method('test9'); $info = $annot->exec(); $result = $info->sample; $this->assertEquals($check, $result->foo); } /** * @todo Implement testTest10(). */ public function testTest10() { $check = array(); $check[] = '111'; $check[] = '222'; $check[] = '333'; $annot = PHP_Annotation::parse('TestSample4')->method('test10'); $info = $annot->exec(); $result = $info->sample; $this->assertEquals($check, $result->foo); } } // Call AnnotationInfoCommandTest::main() if this source file is executed directly. if (PHPUnit_MAIN_METHOD == "AnnotationInfoCommandTest::main") { AnnotationInfoCommandTest::main(); } ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/AnnotationTest.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/AnnotationTest.php +++ pear/PHP_Annotation/tests/AnnotationTest.php <?php // Call AnnotationTest::main() if this source file is executed directly. if (!defined("PHPUnit_MAIN_METHOD")) { define("PHPUnit_MAIN_METHOD", "AnnotationTest::main"); } require_once "PHPUnit/Framework/TestCase.php"; require_once "PHPUnit/Framework/TestSuite.php"; require_once "PHP/Annotation.php"; require_once "TestSample.php"; /** * Test class for Anno. * Generated by PHPUnit_Util_Skeleton on 2006-10-31 at 08:44:19. */ class AnnotationTest extends PHPUnit_Framework_TestCase { /** * Runs the test methods of this class. * * @access public * @static */ public static function main() { require_once "PHPUnit/TextUI/TestRunner.php"; $suite = new PHPUnit_Framework_TestSuite("AnnotationTest"); $result = PHPUnit_TextUI_TestRunner::run($suite); } /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { } /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. * * @access protected */ protected function tearDown() { } /** * @todo Implement testParse(). */ public function testParse() { $annot = PHP_Annotation::parse('TestSample'); $this->assertEquals('PHP_Annotation',get_class($annot)); } /** * @todo Implement testParse_Object(). */ public function testParse_Object() { $obj = new TestSample(); $annot = PHP_Annotation::parse($obj); $this->assertEquals('PHP_Annotation',get_class($annot)); $this->assertEquals('ReflectionClass',get_class($annot->getReflector())); $this->assertEquals('TestSample',$annot->getReflector()->getName()); } /** * @todo Implement testParse_ReflectionClass(). */ public function testParse_ReflectionClass() { $ref = new ReflectionClass('TestSample'); $annot = PHP_Annotation::parse($ref); $this->assertEquals('PHP_Annotation',get_class($annot)); $this->assertEquals('ReflectionClass',get_class($annot->getReflector())); $this->assertEquals('TestSample',$annot->getReflector()->getName()); } /** * @todo Implement testParse_ReflectionMethod(). */ public function testParse_ReflectionMethod() { $ref = new ReflectionClass('TestSample'); $annot = PHP_Annotation::parse($ref->getMethod('hello')); $this->assertEquals('PHP_Annotation',get_class($annot)); $this->assertEquals('ReflectionMethod',get_class($annot->getReflector())); $this->assertEquals('hello',$annot->getReflector()->getName()); } /** * @todo Implement testParse_ReflectionProperty(). */ public function testParse_ReflectionProperty() { $ref = new ReflectionClass('TestSample'); $annot = PHP_Annotation::parse($ref->getProperty('var_public')); $this->assertEquals('PHP_Annotation',get_class($annot)); $this->assertEquals('ReflectionProperty',get_class($annot->getReflector())); $this->assertEquals('var_public',$annot->getReflector()->getName()); } /** * @todo Implement testMethod(). */ public function testMethod() { $annot = PHP_Annotation::parse('TestSample')->method('hello'); $this->assertEquals('PHP_Annotation',get_class($annot)); $this->assertEquals('ReflectionMethod',get_class($annot->getReflector())); $this->assertEquals('hello',$annot->getReflector()->getName()); } /** * @todo Implement testProperty(). */ public function testProperty() { $annot = PHP_Annotation::parse('TestSample')->property('var_public'); $this->assertEquals('PHP_Annotation',get_class($annot)); $this->assertEquals('ReflectionProperty',get_class($annot->getReflector())); $this->assertEquals('var_public',$annot->getReflector()->getName()); } /** * @todo Implement testGetReflector_Class(). */ public function testGetReflector_Class() { $annot = PHP_Annotation::parse('TestSample'); $ref = $annot->getReflector(); $this->assertEquals('ReflectionClass',get_class($ref)); } /** * @todo Implement testGetReflector_Method(). */ public function testGetReflector_Method() { $annot = PHP_Annotation::parse('TestSample')->method('hello'); $ref = $annot->getReflector(); $this->assertEquals('ReflectionMethod',get_class($ref)); } /** * @todo Implement testGetReflector_Property(). */ public function testGetReflector_Property() { $annot = PHP_Annotation::parse('TestSample')->property('var_public'); $ref = $annot->getReflector(); $this->assertEquals('ReflectionProperty',get_class($ref)); } } // Call AnnotationTest::main() if this source file is executed directly. if (PHPUnit_MAIN_METHOD == "AnnotationTest::main") { AnnotationTest::main(); } ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/AnnotationUtilCommandTest.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/AnnotationUtilCommandTest.php +++ pear/PHP_Annotation/tests/AnnotationUtilCommandTest.php <?php // Call AnnotationUtilCommandTest::main() if this source file is executed directly. if (!defined("PHPUnit_MAIN_METHOD")) { define("PHPUnit_MAIN_METHOD", "AnnotationUtilCommandTest::main"); } require_once "PHPUnit/Framework/TestCase.php"; require_once "PHPUnit/Framework/TestSuite.php"; require_once "PHP/Annotation.php"; require_once "TestSample.php"; /** * Test class for AnnotationCommand. * Generated by PHPUnit_Util_Skeleton on 2006-10-31 at 09:20:10. */ class AnnotationUtilCommandTest extends PHPUnit_Framework_TestCase { /** * Runs the test methods of this class. * * @access public * @static */ public static function main() { require_once "PHPUnit/TextUI/TestRunner.php"; $suite = new PHPUnit_Framework_TestSuite("AnnotationUtilCommandTest"); $result = PHPUnit_TextUI_TestRunner::run($suite); } /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { } /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. * * @access protected */ protected function tearDown() { } /** * @todo Implement testUtil_Commandcode(). */ public function testUtil_Commandcode() { $annot = PHP_Annotation::parse('TestSample2'); $result = $annot->execUtil_Commandcode(); $this->assertEquals('commandcodename', $result); } } // Call AnnotationUtilCommandTest::main() if this source file is executed directly. if (PHPUnit_MAIN_METHOD == "AnnotationUtilCommandTest::main") { AnnotationUtilCommandTest::main(); } ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/AnnotationtErrorTest.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/AnnotationtErrorTest.php +++ pear/PHP_Annotation/tests/AnnotationtErrorTest.php <?php // Call AnnotationErrorTest::main() if this source file is executed directly. if (!defined("PHPUnit_MAIN_METHOD")) { define("PHPUnit_MAIN_METHOD", "AnnotationErrorTest::main"); } require_once "PHPUnit/Framework/TestCase.php"; require_once "PHPUnit/Framework/TestSuite.php"; require_once "PHP/Annotation.php"; require_once "TestSample.php"; /** * Test class for AnnotationError. * Generated by PHPUnit_Util_Skeleton on 2006-10-30 at 20:51:22. */ class AnnotationErrorTest extends PHPUnit_Framework_TestCase { /** * Runs the test methods of this class. * * @access public * @static */ public static function main() { require_once "PHPUnit/TextUI/TestRunner.php"; $suite = new PHPUnit_Framework_TestSuite("AnnotationErrorTest"); $result = PHPUnit_TextUI_TestRunner::run($suite); } /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. * * @access protected */ protected function setUp() { } /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. * * @access protected */ protected function tearDown() { } /** * @todo Implement testError1(). */ public function testError1() { $msg = ''; try { $anno = PHP_Annotation::parse("PEAR2"); } catch(PEAR_Exception $e) { $msg = $e->getMessage(); } $this->assertEquals("Annotation 'PEAR2' not found", $msg); } /** * @todo Implement testError2(). */ public function testError2() { $msg = ''; try { $anno = PHP_Annotation::parse("PEAR"); $anno->method('ddddddddddddd'); } catch(PEAR_Exception $e) { $msg = $e->getMessage(); } $this->assertEquals("Annotation 'PEAR::ddddddddddddd' not found", $msg); } /** * @todo Implement testError3(). */ public function testError3() { $msg = ''; try { $anno = PHP_Annotation::parse("PEAR"); $anno->property('ddddddddddddd'); } catch(PEAR_Exception $e) { $msg = $e->getMessage(); } $this->assertEquals("Annotation 'PEAR::\$ddddddddddddd' not found", $msg); } /** * @todo Implement testError4(). */ public function testError4() { $msg = ''; try { $anno = PHP_Annotation::parse("PEAR"); echo $anno->exec_AAAAAAAAAAAAAAAAAAA(); } catch(PEAR_Exception $e) { $msg = $e->getMessage(); } $this->assertEquals("Annotation Command 'exec_AAAAAAAAAAAAAAAAAAA' not found", $msg); } /** * @todo Implement testError5(). */ public function testError5() { $msg = ''; try { $anno = PHP_Annotation::parse("TestSample3"); $anno->property('test')->execDoc_Var(); } catch(PEAR_Exception $e) { $msg = $e->getMessage(); } $this->assertEquals("Annotation parse error, It has already been set.(PHP_Annotation_Command_Doc_Var)", $msg); } /** * @todo Implement testError6(). */ public function testError6() { $msg = ''; try { $anno = PHP_Annotation::parse("TestSample3"); $anno->property('test')->execDoc_Access(); } catch(PEAR_Exception $e) { $msg = $e->getMessage(); } $this->assertEquals("Annotation parse error, It has already been set.(PHP_Annotation_Command_Doc_Access)", $msg); } /** * @todo Implement testError7(). */ public function testError7() { $msg = ''; try { $anno = PHP_Annotation::parse("TestSample3"); $anno->method('Frist')->execDoc_Return(); } catch(PEAR_Exception $e) { $msg = $e->getMessage(); } $this->assertEquals("Annotation parse error, It has already been set.(PHP_Annotation_Command_Doc_Return)", $msg); } /** * @todo Implement testError8(). */ public function testError8() { $msg = ''; try { $anno = PHP_Annotation::parse("TestSample3"); $info = $anno->exec(); $info->aaa; } catch( PEAR_Exception $e) { $msg = $e->getMessage(); } $this->assertEquals("Undefined annotation index: @aaa", $msg); } } // Call AnnotationErrorTest::main() if this source file is executed directly. if (PHPUnit_MAIN_METHOD == "AnnotationErrorTest::main") { AnnotationErrorTest::main(); } ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/TestSample.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/TestSample.php +++ pear/PHP_Annotation/tests/TestSample.php <?php /** * @abstract * @access private * @author authorname * @category categoryname * @copyright copyright information * @deprecated version/info string * @example relativepath/to/example.php description * @final * @filesource * @global datatype description * @ignore * @internal any information that should not be displayed in public documentation [unspecified format] * @license URL name of license * @link URL, URL, URL... * @name $globalvariablename * @package packagename * @param datatype $paramname description * @return datatype description * @see file.ext|elementname|class::methodname()|class::$variablename|functionname()|function functionname unlimited number of values separated by commas * @since version/info string [unspecified format] * @static * @staticvar datatype description * @subpackage subpackagename * @todo information string [unspecified format] * @tutorial package/ subpackage/ tutorialname.ext #section.subsection description * @uses file.ext|elementname|class::methodname()|class::$variablename|functionname()|function functionname description of how the element is used * @var datatype description * @version versionstring [unspecified format] */ class TestSample { public $var_public; protected $var_protected; private $var_private; public function hello() { ; } } /** * @commandcode commandcodename */ class TestSample2 { } /** * @aaa(aaa='eeee' */ class TestSample3 { /** * @var object * @var string * @access private * @access public */ private $test; /** * @return string * @return boolean */ function Frist() { } } class TestSample4 { /** * @sample(foo='helloworld') */ function test1() { } /** * @sample(foo=1000) */ function test2() { } /** * @sample(foo=0.1234) */ function test3() { } /** * @sample(foo={ary1='111',ary2='222'}) */ function test4() { } /** * @sample(foo={0='333',1='444'}) */ function test5() { } /** * @sample(0=100) */ function test6() { } /** * @sample(foo="aaa bbb") */ function test7() { } /** * @sample("stringtest") */ function test8() { } /** * @sample(foo={ary1='1"11',ary'2='2\'22',ary3="3'33",ary4="4\"44",ary5="5\"5\'5",ary6='6\'6\"6',ary7="7\\\"77"}) */ function test9() { } /** * @sample(foo={='111',='222',="333"}) */ function test10() { } } ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/sample1.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/sample1.php +++ pear/PHP_Annotation/tests/sample1.php <?php require_once "PHP/Annotation.php"; /* * get Annotation of PEAR. */ $annotation = PHP_Annotation::parse("PEAR"); /* * view PEAR Information. */ //Pattern 1 echo "PEAR Version: "; echo $annotation->execDoc_Version();// It specifies it by the relative path echo "\r\n"; //Pattern 3 echo "PEAR Authors: "; print_r($annotation->exec_PHP_Annotation_Command_Doc_Author());// It specifies it by the absolute path. echo "\r\n"; //Pattern 2 require_once "PHP/Annotation/Command/Doc/License.php"; echo "PEAR License: "; echo $annotation->execute(new PHP_Annotation_Command_Doc_License());// It specifies it with the object. echo "\r\n"; ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/sample2.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/sample2.php +++ pear/PHP_Annotation/tests/sample2.php <?php require_once "PHP/Annotation.php"; /* * get Annotation of PEAR::getStaticProperty. */ $anno1 = PHP_Annotation::parseMethod("PEAR", 'getStaticProperty'); $return = $anno1->execDoc_Return(); $params = $anno1->execDoc_Param(); echo "PEAR::getStaticProperty : "; echo "\r\n [access] ".$anno1->execDoc_Access(); foreach ($params as $name=>$param) { echo "\r\n [param] ".$param->getType().' '.$name."\r\n ".str_replace("\n", "\n ", $param->getComment()); } echo "\r\n [return] ".$return->getType(0)."\r\n ".str_replace("\n", "\n ", $return->getComment()); echo "\r\n"; echo "\r\n"; /* * get Annotation of PEAR::_debug. */ $anno2 = PHP_Annotation::parseProperty("PEAR", '_debug'); $var = $anno2->execDoc_Var(); echo "PEAR::\$_debug : "; echo "\r\n [access] ".$anno2->execDoc_Access(); echo "\r\n [var] ".$var->getType()."\r\n ".str_replace("\n", "\n ", $param->getComment()); echo "\r\n"; ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/sample3.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/sample3.php +++ pear/PHP_Annotation/tests/sample3.php <?php require_once "PHP/Annotation.php"; $annotation = PHP_Annotation::parse("PEAR"); /* * get Annotation of PEAR::getStaticProperty. */ $return = $annotation->method('getStaticProperty')->execDoc_Return(); $params = $annotation->method('getStaticProperty')->execDoc_Param(); echo "PEAR::getStaticProperty : "; echo "\r\n [access] ".$annotation->method('getStaticProperty')->execDoc_Access(); foreach ($params as $name=>$param) { echo "\r\n [param] ".$param->getType().' '.$name."\r\n ".str_replace("\n", "\n ", $param->getComment()); } echo "\r\n [return] ".$return->getType(0)."\r\n ".str_replace("\n", "\n ", $return->getComment()); echo "\r\n"; echo "\r\n"; /* * get Annotation of PEAR::_debug. */ $var = $annotation->property('_debug')->execDoc_Var(); echo "PEAR::\$_debug : "; echo "\r\n [access] ".$annotation->property('_debug')->execDoc_Access(); echo "\r\n [var] ".$var->getType()."\r\n ".str_replace("\n", "\n ", $param->getComment()); echo "\r\n"; ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/sample4.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/sample4.php +++ pear/PHP_Annotation/tests/sample4.php <?php require_once "PHP/Annotation.php"; PHP_Annotation::addCommandGroup(dirname(__FILE__).'/Command', 'MyCommand_'); /** * @sample hogehoge * @test */ class Sample { function func() { ; } } echo "Execute my commands\r\n"; echo " Sample: "; var_dump(PHP_Annotation::parse("Sample")->execSample()); echo " Test: "; var_dump(PHP_Annotation::parse("Sample")->execTest()); echo "\r\n\r\n"; ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/sample5.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/sample5.php +++ pear/PHP_Annotation/tests/sample5.php <?php error_reporting(E_ALL); require_once "PHP/Annotation.php"; require_once "PHP/Annotation/Factory/Console.php"; require_once "PHP/Annotation/Factory/PearPackage.php"; /** * @console(info="PearPackage Creater") */ class PearPackageCreater { /** * @console(info="Create package2.xml") * * @param string $class Class name * @param string $filepath File path */ function create($class, $filepath) { if (!class_exists($class)) { include_once $filepath; } $factory = new PHP_Annotation_Factory_PearPackage(); $pkg = $factory->getComponent($class); $result = $pkg->writePackageFile(); if (true === $result) { echo "Create package2.xml."; return; } } } $factory = new PHP_Annotation_Factory_Console(); $result = $factory->getComponent('PearPackageCreater'); ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/sample6.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/sample6.php +++ pear/PHP_Annotation/tests/sample6.php <?php error_reporting(E_ALL); require_once "PHP/Annotation.php"; require_once "PHP/Annotation/ContainerFactory.php"; require_once "PHP/Annotation/ContainerConfig/ArrayText.php"; /** * @construct(name="Test") */ class AAA { public $name; function __construct($name) { $this->name= $name; } } /** * @construct(name="hogehoge") * @instance(value="prototype") * @property(value="foo") * */ class BBB { public $name; public $value; function __construct($name) { $this->name= $name; } } /** * @console(info="PearPackage Creater") * @instance(value="prototype") * @construct( * name=AAA, * value="bbb" * ) * */ class CCC { public $test_name; public $test_value; function __construct($name, $value) { $this->test_name = $name; $this->test_value = $value; } } PHP_Annotation_ContainerFactory::singleton() ->setContainerConfig( new PHP_Annotation_ContainerConfig_ArrayText(dirname(__FILE__).'/test.dicon') ); var_dump(PHP_Annotation_ContainerFactory::singleton()->getComponent('CCC')); ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/sample7.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/sample7.php +++ pear/PHP_Annotation/tests/sample7.php <?php /** * Console Command */ require_once "PHP/Annotation.php"; require_once "PHP/Annotation/Factory/Console.php"; /** * @console(info="sample commands") */ class SampleCommands { /** * @console(info="It is Hello Command. view Hello Message") * @desc Hello Command * @param string $user UserName * @param boolean $flg */ function hello($user='aaa', $flg=true) { var_dump($flg); echo "Hello World {$user}!!"; } /** * @console View ENV List * @desc View ENV List */ function env() { print_r($_ENV); } } $factory = new PHP_Annotation_Factory_Console(); $factory->getComponent('SampleCommands'); ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/test.dicon?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/test.dicon +++ pear/PHP_Annotation/tests/test.dicon AAA={ class="BBB", component={ construct={ name="Hello" } }, } http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/test2.dicon?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/test2.dicon +++ pear/PHP_Annotation/tests/test2.dicon Test={ class="TestSample" } http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/Command/Sample.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/Command/Sample.php +++ pear/PHP_Annotation/tests/Command/Sample.php <?php class MyCommand_Sample extends PHP_Annotation_Command_AbstractSingle { public function getCode() { return 'sample'; } } ?> http://cvs.php.net/viewvc.cgi/pear/PHP_Annotation/tests/Command/Test.php?view=markup&rev=1.1 Index: pear/PHP_Annotation/tests/Command/Test.php +++ pear/PHP_Annotation/tests/Command/Test.php <?php class MyCommand_Test extends PHP_Annotation_Command_AbstractBoolean { public function getCode() { return 'test'; } } ?>
« previous php.pear.cvs (#44227) next »