├── .gitignore ├── .gitmodules ├── .travis.yml ├── Doxyfile ├── LICENSE ├── NOTES ├── README.md ├── bin └── genphp ├── build.xml ├── composer.json ├── doc ├── Flavor.md └── WrittingFlavor.md ├── package.ini ├── package.xml ├── phpdox.xml ├── phprelease.ini ├── phpunit-ci.xml ├── phpunit.xml ├── screenshots └── screenshot01.png ├── scripts ├── compile ├── genphp.php ├── install.sh ├── install_flavors.sh ├── local_install.sh └── release.sh ├── src ├── Application.php ├── Command │ ├── InitCommand.php │ ├── InstallCommand.php │ ├── ListCommand.php │ └── NewCommand.php ├── Config.php ├── Flavor │ ├── BaseGenerator.php │ ├── Flavor.php │ ├── FlavorLoader.php │ └── GenericGenerator.php ├── GeneratorRunner.php ├── Operation │ ├── CopyDirOperation.php │ ├── CopyFilesOperation.php │ ├── CopyOperation.php │ ├── CreateDirOperation.php │ ├── CreateOperation.php │ ├── GitCloneOperation.php │ ├── Helper.php │ ├── HgCloneOperation.php │ ├── InstallOperation.php │ ├── MoveOperation.php │ ├── Operation.php │ ├── RenderOperation.php │ ├── SVNCheckoutOperation.php │ ├── TouchOperation.php │ ├── WriteJsonOperation.php │ └── WriteYamlOperation.php ├── OperationDispatcher.php └── Path.php └── tests ├── GenPHP ├── ConfigTest.php ├── Flavor │ ├── FlavorLoaderTest.php │ └── FlavorTest.php └── OperationDispatcherTest.php ├── bootstrap.php ├── flavors └── license │ ├── Generator.php │ └── Resource │ ├── LICENSE.BSD │ ├── LICENSE.GPL2 │ ├── LICENSE.MIT │ ├── LICENSE.PHP │ └── LICENSE.ZEND └── helpers.php /.gitignore: -------------------------------------------------------------------------------- 1 | .onion 2 | build 3 | .DS_Store 4 | tests/root 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "flavors"] 2 | path = flavors 3 | url = git@github.com:c9s/GenPHP-Flavors.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | php: 3 | - 5.6 4 | - 7.0 5 | - 7.1 6 | 7 | before_script: 8 | - phpenv rehash 9 | - git clone https://github.com/c9s/GenPHP-Flavors.git flavors 10 | - ./genphp 11 | 12 | install: 13 | - composer install 14 | 15 | script: phpunit 16 | -------------------------------------------------------------------------------- /Doxyfile: -------------------------------------------------------------------------------- 1 | # Doxyfile 1.7.5.1 2 | 3 | # This file describes the settings to be used by the documentation system 4 | # doxygen (www.doxygen.org) for a project. 5 | # 6 | # All text after a hash (#) is considered a comment and will be ignored. 7 | # The format is: 8 | # TAG = value [value, ...] 9 | # For lists items can also be appended using: 10 | # TAG += value [value, ...] 11 | # Values that contain spaces should be placed between quotes (" "). 12 | 13 | #--------------------------------------------------------------------------- 14 | # Project related configuration options 15 | #--------------------------------------------------------------------------- 16 | 17 | # This tag specifies the encoding used for all characters in the config file 18 | # that follow. The default is UTF-8 which is also the encoding used for all 19 | # text before the first occurrence of this tag. Doxygen uses libiconv (or the 20 | # iconv built into libc) for the transcoding. See 21 | # http://www.gnu.org/software/libiconv for the list of possible encodings. 22 | 23 | DOXYFILE_ENCODING = UTF-8 24 | 25 | # The PROJECT_NAME tag is a single word (or sequence of words) that should 26 | # identify the project. Note that if you do not use Doxywizard you need 27 | # to put quotes around the project name if it contains spaces. 28 | 29 | PROJECT_NAME = 30 | 31 | # The PROJECT_NUMBER tag can be used to enter a project or revision number. 32 | # This could be handy for archiving the generated documentation or 33 | # if some version control system is used. 34 | 35 | PROJECT_NUMBER = 36 | 37 | # Using the PROJECT_BRIEF tag one can provide an optional one line description 38 | # for a project that appears at the top of each page and should give viewer 39 | # a quick idea about the purpose of the project. Keep the description short. 40 | 41 | PROJECT_BRIEF = 42 | 43 | # With the PROJECT_LOGO tag one can specify an logo or icon that is 44 | # included in the documentation. The maximum height of the logo should not 45 | # exceed 55 pixels and the maximum width should not exceed 200 pixels. 46 | # Doxygen will copy the logo to the output directory. 47 | 48 | PROJECT_LOGO = 49 | 50 | # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 51 | # base path where the generated documentation will be put. 52 | # If a relative path is entered, it will be relative to the location 53 | # where doxygen was started. If left blank the current directory will be used. 54 | 55 | OUTPUT_DIRECTORY = build 56 | 57 | # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 58 | # 4096 sub-directories (in 2 levels) under the output directory of each output 59 | # format and will distribute the generated files over these directories. 60 | # Enabling this option can be useful when feeding doxygen a huge amount of 61 | # source files, where putting all generated files in the same directory would 62 | # otherwise cause performance problems for the file system. 63 | 64 | CREATE_SUBDIRS = NO 65 | 66 | # The OUTPUT_LANGUAGE tag is used to specify the language in which all 67 | # documentation generated by doxygen is written. Doxygen will use this 68 | # information to generate all constant output in the proper language. 69 | # The default language is English, other supported languages are: 70 | # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 71 | # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 72 | # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 73 | # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 74 | # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, 75 | # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. 76 | 77 | OUTPUT_LANGUAGE = English 78 | 79 | # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 80 | # include brief member descriptions after the members that are listed in 81 | # the file and class documentation (similar to JavaDoc). 82 | # Set to NO to disable this. 83 | 84 | BRIEF_MEMBER_DESC = YES 85 | 86 | # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 87 | # the brief description of a member or function before the detailed description. 88 | # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 89 | # brief descriptions will be completely suppressed. 90 | 91 | REPEAT_BRIEF = YES 92 | 93 | # This tag implements a quasi-intelligent brief description abbreviator 94 | # that is used to form the text in various listings. Each string 95 | # in this list, if found as the leading text of the brief description, will be 96 | # stripped from the text and the result after processing the whole list, is 97 | # used as the annotated text. Otherwise, the brief description is used as-is. 98 | # If left blank, the following values are used ("$name" is automatically 99 | # replaced with the name of the entity): "The $name class" "The $name widget" 100 | # "The $name file" "is" "provides" "specifies" "contains" 101 | # "represents" "a" "an" "the" 102 | 103 | ABBREVIATE_BRIEF = 104 | 105 | # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 106 | # Doxygen will generate a detailed section even if there is only a brief 107 | # description. 108 | 109 | ALWAYS_DETAILED_SEC = NO 110 | 111 | # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 112 | # inherited members of a class in the documentation of that class as if those 113 | # members were ordinary class members. Constructors, destructors and assignment 114 | # operators of the base classes will not be shown. 115 | 116 | INLINE_INHERITED_MEMB = NO 117 | 118 | # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 119 | # path before files name in the file list and in the header files. If set 120 | # to NO the shortest path that makes the file name unique will be used. 121 | 122 | FULL_PATH_NAMES = NO 123 | 124 | # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 125 | # can be used to strip a user-defined part of the path. Stripping is 126 | # only done if one of the specified strings matches the left-hand part of 127 | # the path. The tag can be used to show relative paths in the file list. 128 | # If left blank the directory from which doxygen is run is used as the 129 | # path to strip. 130 | 131 | STRIP_FROM_PATH = 132 | 133 | # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 134 | # the path mentioned in the documentation of a class, which tells 135 | # the reader which header file to include in order to use a class. 136 | # If left blank only the name of the header file containing the class 137 | # definition is used. Otherwise one should specify the include paths that 138 | # are normally passed to the compiler using the -I flag. 139 | 140 | STRIP_FROM_INC_PATH = 141 | 142 | # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 143 | # (but less readable) file names. This can be useful if your file system 144 | # doesn't support long names like on DOS, Mac, or CD-ROM. 145 | 146 | SHORT_NAMES = NO 147 | 148 | # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 149 | # will interpret the first line (until the first dot) of a JavaDoc-style 150 | # comment as the brief description. If set to NO, the JavaDoc 151 | # comments will behave just like regular Qt-style comments 152 | # (thus requiring an explicit @brief command for a brief description.) 153 | 154 | JAVADOC_AUTOBRIEF = YES 155 | 156 | # If the QT_AUTOBRIEF tag is set to YES then Doxygen will 157 | # interpret the first line (until the first dot) of a Qt-style 158 | # comment as the brief description. If set to NO, the comments 159 | # will behave just like regular Qt-style comments (thus requiring 160 | # an explicit \brief command for a brief description.) 161 | 162 | QT_AUTOBRIEF = NO 163 | 164 | # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 165 | # treat a multi-line C++ special comment block (i.e. a block of //! or /// 166 | # comments) as a brief description. This used to be the default behaviour. 167 | # The new default is to treat a multi-line C++ comment block as a detailed 168 | # description. Set this tag to YES if you prefer the old behaviour instead. 169 | 170 | MULTILINE_CPP_IS_BRIEF = NO 171 | 172 | # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 173 | # member inherits the documentation from any documented member that it 174 | # re-implements. 175 | 176 | INHERIT_DOCS = YES 177 | 178 | # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 179 | # a new page for each member. If set to NO, the documentation of a member will 180 | # be part of the file/class/namespace that contains it. 181 | 182 | SEPARATE_MEMBER_PAGES = NO 183 | 184 | # The TAB_SIZE tag can be used to set the number of spaces in a tab. 185 | # Doxygen uses this value to replace tabs by spaces in code fragments. 186 | 187 | TAB_SIZE = 8 188 | 189 | # This tag can be used to specify a number of aliases that acts 190 | # as commands in the documentation. An alias has the form "name=value". 191 | # For example adding "sideeffect=\par Side Effects:\n" will allow you to 192 | # put the command \sideeffect (or @sideeffect) in the documentation, which 193 | # will result in a user-defined paragraph with heading "Side Effects:". 194 | # You can put \n's in the value part of an alias to insert newlines. 195 | 196 | ALIASES = 197 | 198 | # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 199 | # sources only. Doxygen will then generate output that is more tailored for C. 200 | # For instance, some of the names that are used will be different. The list 201 | # of all members will be omitted, etc. 202 | 203 | OPTIMIZE_OUTPUT_FOR_C = NO 204 | 205 | # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 206 | # sources only. Doxygen will then generate output that is more tailored for 207 | # Java. For instance, namespaces will be presented as packages, qualified 208 | # scopes will look different, etc. 209 | 210 | OPTIMIZE_OUTPUT_JAVA = NO 211 | 212 | # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 213 | # sources only. Doxygen will then generate output that is more tailored for 214 | # Fortran. 215 | 216 | OPTIMIZE_FOR_FORTRAN = NO 217 | 218 | # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 219 | # sources. Doxygen will then generate output that is tailored for 220 | # VHDL. 221 | 222 | OPTIMIZE_OUTPUT_VHDL = NO 223 | 224 | # Doxygen selects the parser to use depending on the extension of the files it 225 | # parses. With this tag you can assign which parser to use for a given extension. 226 | # Doxygen has a built-in mapping, but you can override or extend it using this 227 | # tag. The format is ext=language, where ext is a file extension, and language 228 | # is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, 229 | # C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make 230 | # doxygen treat .inc files as Fortran files (default is PHP), and .f files as C 231 | # (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions 232 | # you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. 233 | 234 | EXTENSION_MAPPING = 235 | 236 | # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 237 | # to include (a tag file for) the STL sources as input, then you should 238 | # set this tag to YES in order to let doxygen match functions declarations and 239 | # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 240 | # func(std::string) {}). This also makes the inheritance and collaboration 241 | # diagrams that involve STL classes more complete and accurate. 242 | 243 | BUILTIN_STL_SUPPORT = NO 244 | 245 | # If you use Microsoft's C++/CLI language, you should set this option to YES to 246 | # enable parsing support. 247 | 248 | CPP_CLI_SUPPORT = NO 249 | 250 | # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 251 | # Doxygen will parse them like normal C++ but will assume all classes use public 252 | # instead of private inheritance when no explicit protection keyword is present. 253 | 254 | SIP_SUPPORT = NO 255 | 256 | # For Microsoft's IDL there are propget and propput attributes to indicate getter 257 | # and setter methods for a property. Setting this option to YES (the default) 258 | # will make doxygen replace the get and set methods by a property in the 259 | # documentation. This will only work if the methods are indeed getting or 260 | # setting a simple type. If this is not the case, or you want to show the 261 | # methods anyway, you should set this option to NO. 262 | 263 | IDL_PROPERTY_SUPPORT = YES 264 | 265 | # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 266 | # tag is set to YES, then doxygen will reuse the documentation of the first 267 | # member in the group (if any) for the other members of the group. By default 268 | # all members of a group must be documented explicitly. 269 | 270 | DISTRIBUTE_GROUP_DOC = NO 271 | 272 | # Set the SUBGROUPING tag to YES (the default) to allow class member groups of 273 | # the same type (for instance a group of public functions) to be put as a 274 | # subgroup of that type (e.g. under the Public Functions section). Set it to 275 | # NO to prevent subgrouping. Alternatively, this can be done per class using 276 | # the \nosubgrouping command. 277 | 278 | SUBGROUPING = YES 279 | 280 | # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and 281 | # unions are shown inside the group in which they are included (e.g. using 282 | # @ingroup) instead of on a separate page (for HTML and Man pages) or 283 | # section (for LaTeX and RTF). 284 | 285 | INLINE_GROUPED_CLASSES = NO 286 | 287 | # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and 288 | # unions with only public data fields will be shown inline in the documentation 289 | # of the scope in which they are defined (i.e. file, namespace, or group 290 | # documentation), provided this scope is documented. If set to NO (the default), 291 | # structs, classes, and unions are shown on a separate page (for HTML and Man 292 | # pages) or section (for LaTeX and RTF). 293 | 294 | INLINE_SIMPLE_STRUCTS = NO 295 | 296 | # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 297 | # is documented as struct, union, or enum with the name of the typedef. So 298 | # typedef struct TypeS {} TypeT, will appear in the documentation as a struct 299 | # with name TypeT. When disabled the typedef will appear as a member of a file, 300 | # namespace, or class. And the struct will be named TypeS. This can typically 301 | # be useful for C code in case the coding convention dictates that all compound 302 | # types are typedef'ed and only the typedef is referenced, never the tag name. 303 | 304 | TYPEDEF_HIDES_STRUCT = NO 305 | 306 | # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 307 | # determine which symbols to keep in memory and which to flush to disk. 308 | # When the cache is full, less often used symbols will be written to disk. 309 | # For small to medium size projects (<1000 input files) the default value is 310 | # probably good enough. For larger projects a too small cache size can cause 311 | # doxygen to be busy swapping symbols to and from disk most of the time 312 | # causing a significant performance penalty. 313 | # If the system has enough physical memory increasing the cache will improve the 314 | # performance by keeping more symbols in memory. Note that the value works on 315 | # a logarithmic scale so increasing the size by one will roughly double the 316 | # memory usage. The cache size is given by this formula: 317 | # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 318 | # corresponding to a cache size of 2^16 = 65536 symbols 319 | 320 | SYMBOL_CACHE_SIZE = 0 321 | 322 | #--------------------------------------------------------------------------- 323 | # Build related configuration options 324 | #--------------------------------------------------------------------------- 325 | 326 | # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 327 | # documentation are documented, even if no documentation was available. 328 | # Private class members and static file members will be hidden unless 329 | # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES 330 | 331 | EXTRACT_ALL = NO 332 | 333 | # If the EXTRACT_PRIVATE tag is set to YES all private members of a class 334 | # will be included in the documentation. 335 | 336 | EXTRACT_PRIVATE = NO 337 | 338 | # If the EXTRACT_STATIC tag is set to YES all static members of a file 339 | # will be included in the documentation. 340 | 341 | EXTRACT_STATIC = NO 342 | 343 | # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 344 | # defined locally in source files will be included in the documentation. 345 | # If set to NO only classes defined in header files are included. 346 | 347 | EXTRACT_LOCAL_CLASSES = YES 348 | 349 | # This flag is only useful for Objective-C code. When set to YES local 350 | # methods, which are defined in the implementation section but not in 351 | # the interface are included in the documentation. 352 | # If set to NO (the default) only methods in the interface are included. 353 | 354 | EXTRACT_LOCAL_METHODS = NO 355 | 356 | # If this flag is set to YES, the members of anonymous namespaces will be 357 | # extracted and appear in the documentation as a namespace called 358 | # 'anonymous_namespace{file}', where file will be replaced with the base 359 | # name of the file that contains the anonymous namespace. By default 360 | # anonymous namespaces are hidden. 361 | 362 | EXTRACT_ANON_NSPACES = NO 363 | 364 | # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 365 | # undocumented members of documented classes, files or namespaces. 366 | # If set to NO (the default) these members will be included in the 367 | # various overviews, but no documentation section is generated. 368 | # This option has no effect if EXTRACT_ALL is enabled. 369 | 370 | HIDE_UNDOC_MEMBERS = NO 371 | 372 | # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 373 | # undocumented classes that are normally visible in the class hierarchy. 374 | # If set to NO (the default) these classes will be included in the various 375 | # overviews. This option has no effect if EXTRACT_ALL is enabled. 376 | 377 | HIDE_UNDOC_CLASSES = NO 378 | 379 | # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 380 | # friend (class|struct|union) declarations. 381 | # If set to NO (the default) these declarations will be included in the 382 | # documentation. 383 | 384 | HIDE_FRIEND_COMPOUNDS = NO 385 | 386 | # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 387 | # documentation blocks found inside the body of a function. 388 | # If set to NO (the default) these blocks will be appended to the 389 | # function's detailed documentation block. 390 | 391 | HIDE_IN_BODY_DOCS = NO 392 | 393 | # The INTERNAL_DOCS tag determines if documentation 394 | # that is typed after a \internal command is included. If the tag is set 395 | # to NO (the default) then the documentation will be excluded. 396 | # Set it to YES to include the internal documentation. 397 | 398 | INTERNAL_DOCS = NO 399 | 400 | # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 401 | # file names in lower-case letters. If set to YES upper-case letters are also 402 | # allowed. This is useful if you have classes or files whose names only differ 403 | # in case and if your file system supports case sensitive file names. Windows 404 | # and Mac users are advised to set this option to NO. 405 | 406 | CASE_SENSE_NAMES = NO 407 | 408 | # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 409 | # will show members with their full class and namespace scopes in the 410 | # documentation. If set to YES the scope will be hidden. 411 | 412 | HIDE_SCOPE_NAMES = NO 413 | 414 | # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 415 | # will put a list of the files that are included by a file in the documentation 416 | # of that file. 417 | 418 | SHOW_INCLUDE_FILES = YES 419 | 420 | # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen 421 | # will list include files with double quotes in the documentation 422 | # rather than with sharp brackets. 423 | 424 | FORCE_LOCAL_INCLUDES = NO 425 | 426 | # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 427 | # is inserted in the documentation for inline members. 428 | 429 | INLINE_INFO = YES 430 | 431 | # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 432 | # will sort the (detailed) documentation of file and class members 433 | # alphabetically by member name. If set to NO the members will appear in 434 | # declaration order. 435 | 436 | SORT_MEMBER_DOCS = YES 437 | 438 | # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 439 | # brief documentation of file, namespace and class members alphabetically 440 | # by member name. If set to NO (the default) the members will appear in 441 | # declaration order. 442 | 443 | SORT_BRIEF_DOCS = NO 444 | 445 | # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen 446 | # will sort the (brief and detailed) documentation of class members so that 447 | # constructors and destructors are listed first. If set to NO (the default) 448 | # the constructors will appear in the respective orders defined by 449 | # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. 450 | # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO 451 | # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. 452 | 453 | SORT_MEMBERS_CTORS_1ST = NO 454 | 455 | # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 456 | # hierarchy of group names into alphabetical order. If set to NO (the default) 457 | # the group names will appear in their defined order. 458 | 459 | SORT_GROUP_NAMES = NO 460 | 461 | # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 462 | # sorted by fully-qualified names, including namespaces. If set to 463 | # NO (the default), the class list will be sorted only by class name, 464 | # not including the namespace part. 465 | # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 466 | # Note: This option applies only to the class list, not to the 467 | # alphabetical list. 468 | 469 | SORT_BY_SCOPE_NAME = NO 470 | 471 | # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to 472 | # do proper type resolution of all parameters of a function it will reject a 473 | # match between the prototype and the implementation of a member function even 474 | # if there is only one candidate or it is obvious which candidate to choose 475 | # by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen 476 | # will still accept a match between prototype and implementation in such cases. 477 | 478 | STRICT_PROTO_MATCHING = NO 479 | 480 | # The GENERATE_TODOLIST tag can be used to enable (YES) or 481 | # disable (NO) the todo list. This list is created by putting \todo 482 | # commands in the documentation. 483 | 484 | GENERATE_TODOLIST = YES 485 | 486 | # The GENERATE_TESTLIST tag can be used to enable (YES) or 487 | # disable (NO) the test list. This list is created by putting \test 488 | # commands in the documentation. 489 | 490 | GENERATE_TESTLIST = YES 491 | 492 | # The GENERATE_BUGLIST tag can be used to enable (YES) or 493 | # disable (NO) the bug list. This list is created by putting \bug 494 | # commands in the documentation. 495 | 496 | GENERATE_BUGLIST = YES 497 | 498 | # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 499 | # disable (NO) the deprecated list. This list is created by putting 500 | # \deprecated commands in the documentation. 501 | 502 | GENERATE_DEPRECATEDLIST= YES 503 | 504 | # The ENABLED_SECTIONS tag can be used to enable conditional 505 | # documentation sections, marked by \if sectionname ... \endif. 506 | 507 | ENABLED_SECTIONS = 508 | 509 | # The MAX_INITIALIZER_LINES tag determines the maximum number of lines 510 | # the initial value of a variable or macro consists of for it to appear in 511 | # the documentation. If the initializer consists of more lines than specified 512 | # here it will be hidden. Use a value of 0 to hide initializers completely. 513 | # The appearance of the initializer of individual variables and macros in the 514 | # documentation can be controlled using \showinitializer or \hideinitializer 515 | # command in the documentation regardless of this setting. 516 | 517 | MAX_INITIALIZER_LINES = 30 518 | 519 | # Set the SHOW_USED_FILES tag to NO to disable the list of files generated 520 | # at the bottom of the documentation of classes and structs. If set to YES the 521 | # list will mention the files that were used to generate the documentation. 522 | 523 | SHOW_USED_FILES = YES 524 | 525 | # If the sources in your project are distributed over multiple directories 526 | # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 527 | # in the documentation. The default is NO. 528 | 529 | SHOW_DIRECTORIES = NO 530 | 531 | # Set the SHOW_FILES tag to NO to disable the generation of the Files page. 532 | # This will remove the Files entry from the Quick Index and from the 533 | # Folder Tree View (if specified). The default is YES. 534 | 535 | SHOW_FILES = YES 536 | 537 | # Set the SHOW_NAMESPACES tag to NO to disable the generation of the 538 | # Namespaces page. 539 | # This will remove the Namespaces entry from the Quick Index 540 | # and from the Folder Tree View (if specified). The default is YES. 541 | 542 | SHOW_NAMESPACES = YES 543 | 544 | # The FILE_VERSION_FILTER tag can be used to specify a program or script that 545 | # doxygen should invoke to get the current version for each file (typically from 546 | # the version control system). Doxygen will invoke the program by executing (via 547 | # popen()) the command , where is the value of 548 | # the FILE_VERSION_FILTER tag, and is the name of an input file 549 | # provided by doxygen. Whatever the program writes to standard output 550 | # is used as the file version. See the manual for examples. 551 | 552 | FILE_VERSION_FILTER = 553 | 554 | # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed 555 | # by doxygen. The layout file controls the global structure of the generated 556 | # output files in an output format independent way. The create the layout file 557 | # that represents doxygen's defaults, run doxygen with the -l option. 558 | # You can optionally specify a file name after the option, if omitted 559 | # DoxygenLayout.xml will be used as the name of the layout file. 560 | 561 | LAYOUT_FILE = 562 | 563 | # The CITE_BIB_FILES tag can be used to specify one or more bib files 564 | # containing the references data. This must be a list of .bib files. The 565 | # .bib extension is automatically appended if omitted. Using this command 566 | # requires the bibtex tool to be installed. See also 567 | # http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style 568 | # of the bibliography can be controlled using LATEX_BIB_STYLE. 569 | 570 | CITE_BIB_FILES = 571 | 572 | #--------------------------------------------------------------------------- 573 | # configuration options related to warning and progress messages 574 | #--------------------------------------------------------------------------- 575 | 576 | # The QUIET tag can be used to turn on/off the messages that are generated 577 | # by doxygen. Possible values are YES and NO. If left blank NO is used. 578 | 579 | QUIET = NO 580 | 581 | # The WARNINGS tag can be used to turn on/off the warning messages that are 582 | # generated by doxygen. Possible values are YES and NO. If left blank 583 | # NO is used. 584 | 585 | WARNINGS = YES 586 | 587 | # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 588 | # for undocumented members. If EXTRACT_ALL is set to YES then this flag will 589 | # automatically be disabled. 590 | 591 | WARN_IF_UNDOCUMENTED = YES 592 | 593 | # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 594 | # potential errors in the documentation, such as not documenting some 595 | # parameters in a documented function, or documenting parameters that 596 | # don't exist or using markup commands wrongly. 597 | 598 | WARN_IF_DOC_ERROR = YES 599 | 600 | # The WARN_NO_PARAMDOC option can be enabled to get warnings for 601 | # functions that are documented, but have no documentation for their parameters 602 | # or return value. If set to NO (the default) doxygen will only warn about 603 | # wrong or incomplete parameter documentation, but not about the absence of 604 | # documentation. 605 | 606 | WARN_NO_PARAMDOC = NO 607 | 608 | # The WARN_FORMAT tag determines the format of the warning messages that 609 | # doxygen can produce. The string should contain the $file, $line, and $text 610 | # tags, which will be replaced by the file and line number from which the 611 | # warning originated and the warning text. Optionally the format may contain 612 | # $version, which will be replaced by the version of the file (if it could 613 | # be obtained via FILE_VERSION_FILTER) 614 | 615 | WARN_FORMAT = "$file:$line: $text" 616 | 617 | # The WARN_LOGFILE tag can be used to specify a file to which warning 618 | # and error messages should be written. If left blank the output is written 619 | # to stderr. 620 | 621 | WARN_LOGFILE = 622 | 623 | #--------------------------------------------------------------------------- 624 | # configuration options related to the input files 625 | #--------------------------------------------------------------------------- 626 | 627 | # The INPUT tag can be used to specify the files and/or directories that contain 628 | # documented source files. You may enter file names like "myfile.cpp" or 629 | # directories like "/usr/src/myproject". Separate the files or directories 630 | # with spaces. 631 | 632 | INPUT = src 633 | 634 | # This tag can be used to specify the character encoding of the source files 635 | # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 636 | # also the default input encoding. Doxygen uses libiconv (or the iconv built 637 | # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 638 | # the list of possible encodings. 639 | 640 | INPUT_ENCODING = UTF-8 641 | 642 | # If the value of the INPUT tag contains directories, you can use the 643 | # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 644 | # and *.h) to filter out the source-files in the directories. If left 645 | # blank the following patterns are tested: 646 | # *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh 647 | # *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py 648 | # *.f90 *.f *.for *.vhd *.vhdl 649 | 650 | FILE_PATTERNS = 651 | 652 | # The RECURSIVE tag can be used to turn specify whether or not subdirectories 653 | # should be searched for input files as well. Possible values are YES and NO. 654 | # If left blank NO is used. 655 | 656 | RECURSIVE = YES 657 | 658 | # The EXCLUDE tag can be used to specify files and/or directories that should 659 | # excluded from the INPUT source files. This way you can easily exclude a 660 | # subdirectory from a directory tree whose root is specified with the INPUT tag. 661 | # Note that relative paths are relative to directory from which doxygen is run. 662 | 663 | EXCLUDE = 664 | 665 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or 666 | # directories that are symbolic links (a Unix file system feature) are excluded 667 | # from the input. 668 | 669 | EXCLUDE_SYMLINKS = NO 670 | 671 | # If the value of the INPUT tag contains directories, you can use the 672 | # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 673 | # certain files from those directories. Note that the wildcards are matched 674 | # against the file with absolute path, so to exclude all test directories 675 | # for example use the pattern */test/* 676 | 677 | EXCLUDE_PATTERNS = 678 | 679 | # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 680 | # (namespaces, classes, functions, etc.) that should be excluded from the 681 | # output. The symbol name can be a fully qualified name, a word, or if the 682 | # wildcard * is used, a substring. Examples: ANamespace, AClass, 683 | # AClass::ANamespace, ANamespace::*Test 684 | 685 | EXCLUDE_SYMBOLS = 686 | 687 | # The EXAMPLE_PATH tag can be used to specify one or more files or 688 | # directories that contain example code fragments that are included (see 689 | # the \include command). 690 | 691 | EXAMPLE_PATH = 692 | 693 | # If the value of the EXAMPLE_PATH tag contains directories, you can use the 694 | # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 695 | # and *.h) to filter out the source-files in the directories. If left 696 | # blank all files are included. 697 | 698 | EXAMPLE_PATTERNS = 699 | 700 | # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 701 | # searched for input files to be used with the \include or \dontinclude 702 | # commands irrespective of the value of the RECURSIVE tag. 703 | # Possible values are YES and NO. If left blank NO is used. 704 | 705 | EXAMPLE_RECURSIVE = NO 706 | 707 | # The IMAGE_PATH tag can be used to specify one or more files or 708 | # directories that contain image that are included in the documentation (see 709 | # the \image command). 710 | 711 | IMAGE_PATH = 712 | 713 | # The INPUT_FILTER tag can be used to specify a program that doxygen should 714 | # invoke to filter for each input file. Doxygen will invoke the filter program 715 | # by executing (via popen()) the command , where 716 | # is the value of the INPUT_FILTER tag, and is the name of an 717 | # input file. Doxygen will then use the output that the filter program writes 718 | # to standard output. 719 | # If FILTER_PATTERNS is specified, this tag will be 720 | # ignored. 721 | 722 | INPUT_FILTER = 723 | 724 | # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 725 | # basis. 726 | # Doxygen will compare the file name with each pattern and apply the 727 | # filter if there is a match. 728 | # The filters are a list of the form: 729 | # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 730 | # info on how filters are used. If FILTER_PATTERNS is empty or if 731 | # non of the patterns match the file name, INPUT_FILTER is applied. 732 | 733 | FILTER_PATTERNS = 734 | 735 | # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 736 | # INPUT_FILTER) will be used to filter the input files when producing source 737 | # files to browse (i.e. when SOURCE_BROWSER is set to YES). 738 | 739 | FILTER_SOURCE_FILES = NO 740 | 741 | # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file 742 | # pattern. A pattern will override the setting for FILTER_PATTERN (if any) 743 | # and it is also possible to disable source filtering for a specific pattern 744 | # using *.ext= (so without naming a filter). This option only has effect when 745 | # FILTER_SOURCE_FILES is enabled. 746 | 747 | FILTER_SOURCE_PATTERNS = 748 | 749 | #--------------------------------------------------------------------------- 750 | # configuration options related to source browsing 751 | #--------------------------------------------------------------------------- 752 | 753 | # If the SOURCE_BROWSER tag is set to YES then a list of source files will 754 | # be generated. Documented entities will be cross-referenced with these sources. 755 | # Note: To get rid of all source code in the generated output, make sure also 756 | # VERBATIM_HEADERS is set to NO. 757 | 758 | SOURCE_BROWSER = NO 759 | 760 | # Setting the INLINE_SOURCES tag to YES will include the body 761 | # of functions and classes directly in the documentation. 762 | 763 | INLINE_SOURCES = NO 764 | 765 | # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 766 | # doxygen to hide any special comment blocks from generated source code 767 | # fragments. Normal C and C++ comments will always remain visible. 768 | 769 | STRIP_CODE_COMMENTS = YES 770 | 771 | # If the REFERENCED_BY_RELATION tag is set to YES 772 | # then for each documented function all documented 773 | # functions referencing it will be listed. 774 | 775 | REFERENCED_BY_RELATION = NO 776 | 777 | # If the REFERENCES_RELATION tag is set to YES 778 | # then for each documented function all documented entities 779 | # called/used by that function will be listed. 780 | 781 | REFERENCES_RELATION = NO 782 | 783 | # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 784 | # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 785 | # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 786 | # link to the source code. 787 | # Otherwise they will link to the documentation. 788 | 789 | REFERENCES_LINK_SOURCE = YES 790 | 791 | # If the USE_HTAGS tag is set to YES then the references to source code 792 | # will point to the HTML generated by the htags(1) tool instead of doxygen 793 | # built-in source browser. The htags tool is part of GNU's global source 794 | # tagging system (see http://www.gnu.org/software/global/global.html). You 795 | # will need version 4.8.6 or higher. 796 | 797 | USE_HTAGS = NO 798 | 799 | # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 800 | # will generate a verbatim copy of the header file for each class for 801 | # which an include is specified. Set to NO to disable this. 802 | 803 | VERBATIM_HEADERS = YES 804 | 805 | #--------------------------------------------------------------------------- 806 | # configuration options related to the alphabetical class index 807 | #--------------------------------------------------------------------------- 808 | 809 | # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 810 | # of all compounds will be generated. Enable this if the project 811 | # contains a lot of classes, structs, unions or interfaces. 812 | 813 | ALPHABETICAL_INDEX = YES 814 | 815 | # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 816 | # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 817 | # in which this list will be split (can be a number in the range [1..20]) 818 | 819 | COLS_IN_ALPHA_INDEX = 5 820 | 821 | # In case all classes in a project start with a common prefix, all 822 | # classes will be put under the same header in the alphabetical index. 823 | # The IGNORE_PREFIX tag can be used to specify one or more prefixes that 824 | # should be ignored while generating the index headers. 825 | 826 | IGNORE_PREFIX = 827 | 828 | #--------------------------------------------------------------------------- 829 | # configuration options related to the HTML output 830 | #--------------------------------------------------------------------------- 831 | 832 | # If the GENERATE_HTML tag is set to YES (the default) Doxygen will 833 | # generate HTML output. 834 | 835 | GENERATE_HTML = YES 836 | 837 | # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 838 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 839 | # put in front of it. If left blank `html' will be used as the default path. 840 | 841 | HTML_OUTPUT = html 842 | 843 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for 844 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank 845 | # doxygen will generate files with .html extension. 846 | 847 | HTML_FILE_EXTENSION = .html 848 | 849 | # The HTML_HEADER tag can be used to specify a personal HTML header for 850 | # each generated HTML page. If it is left blank doxygen will generate a 851 | # standard header. Note that when using a custom header you are responsible 852 | # for the proper inclusion of any scripts and style sheets that doxygen 853 | # needs, which is dependent on the configuration options used. 854 | # It is adviced to generate a default header using "doxygen -w html 855 | # header.html footer.html stylesheet.css YourConfigFile" and then modify 856 | # that header. Note that the header is subject to change so you typically 857 | # have to redo this when upgrading to a newer version of doxygen or when 858 | # changing the value of configuration settings such as GENERATE_TREEVIEW! 859 | 860 | HTML_HEADER = 861 | 862 | # The HTML_FOOTER tag can be used to specify a personal HTML footer for 863 | # each generated HTML page. If it is left blank doxygen will generate a 864 | # standard footer. 865 | 866 | HTML_FOOTER = 867 | 868 | # The HTML_STYLESHEET tag can be used to specify a user-defined cascading 869 | # style sheet that is used by each HTML page. It can be used to 870 | # fine-tune the look of the HTML output. If the tag is left blank doxygen 871 | # will generate a default style sheet. Note that doxygen will try to copy 872 | # the style sheet file to the HTML output directory, so don't put your own 873 | # stylesheet in the HTML output directory as well, or it will be erased! 874 | 875 | HTML_STYLESHEET = 876 | 877 | # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or 878 | # other source files which should be copied to the HTML output directory. Note 879 | # that these files will be copied to the base HTML output directory. Use the 880 | # $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these 881 | # files. In the HTML_STYLESHEET file, use the file name only. Also note that 882 | # the files will be copied as-is; there are no commands or markers available. 883 | 884 | HTML_EXTRA_FILES = 885 | 886 | # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. 887 | # Doxygen will adjust the colors in the stylesheet and background images 888 | # according to this color. Hue is specified as an angle on a colorwheel, 889 | # see http://en.wikipedia.org/wiki/Hue for more information. 890 | # For instance the value 0 represents red, 60 is yellow, 120 is green, 891 | # 180 is cyan, 240 is blue, 300 purple, and 360 is red again. 892 | # The allowed range is 0 to 359. 893 | 894 | HTML_COLORSTYLE_HUE = 220 895 | 896 | # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of 897 | # the colors in the HTML output. For a value of 0 the output will use 898 | # grayscales only. A value of 255 will produce the most vivid colors. 899 | 900 | HTML_COLORSTYLE_SAT = 100 901 | 902 | # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to 903 | # the luminance component of the colors in the HTML output. Values below 904 | # 100 gradually make the output lighter, whereas values above 100 make 905 | # the output darker. The value divided by 100 is the actual gamma applied, 906 | # so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, 907 | # and 100 does not change the gamma. 908 | 909 | HTML_COLORSTYLE_GAMMA = 80 910 | 911 | # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 912 | # page will contain the date and time when the page was generated. Setting 913 | # this to NO can help when comparing the output of multiple runs. 914 | 915 | HTML_TIMESTAMP = YES 916 | 917 | # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 918 | # files or namespaces will be aligned in HTML using tables. If set to 919 | # NO a bullet list will be used. 920 | 921 | HTML_ALIGN_MEMBERS = YES 922 | 923 | # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 924 | # documentation will contain sections that can be hidden and shown after the 925 | # page has loaded. For this to work a browser that supports 926 | # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 927 | # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). 928 | 929 | HTML_DYNAMIC_SECTIONS = NO 930 | 931 | # If the GENERATE_DOCSET tag is set to YES, additional index files 932 | # will be generated that can be used as input for Apple's Xcode 3 933 | # integrated development environment, introduced with OSX 10.5 (Leopard). 934 | # To create a documentation set, doxygen will generate a Makefile in the 935 | # HTML output directory. Running make will produce the docset in that 936 | # directory and running "make install" will install the docset in 937 | # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 938 | # it at startup. 939 | # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html 940 | # for more information. 941 | 942 | GENERATE_DOCSET = NO 943 | 944 | # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 945 | # feed. A documentation feed provides an umbrella under which multiple 946 | # documentation sets from a single provider (such as a company or product suite) 947 | # can be grouped. 948 | 949 | DOCSET_FEEDNAME = "Doxygen generated docs" 950 | 951 | # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 952 | # should uniquely identify the documentation set bundle. This should be a 953 | # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 954 | # will append .docset to the name. 955 | 956 | DOCSET_BUNDLE_ID = org.doxygen.Project 957 | 958 | # When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify 959 | # the documentation publisher. This should be a reverse domain-name style 960 | # string, e.g. com.mycompany.MyDocSet.documentation. 961 | 962 | DOCSET_PUBLISHER_ID = org.doxygen.Publisher 963 | 964 | # The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. 965 | 966 | DOCSET_PUBLISHER_NAME = Publisher 967 | 968 | # If the GENERATE_HTMLHELP tag is set to YES, additional index files 969 | # will be generated that can be used as input for tools like the 970 | # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 971 | # of the generated HTML documentation. 972 | 973 | GENERATE_HTMLHELP = NO 974 | 975 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 976 | # be used to specify the file name of the resulting .chm file. You 977 | # can add a path in front of the file if the result should not be 978 | # written to the html output directory. 979 | 980 | CHM_FILE = 981 | 982 | # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 983 | # be used to specify the location (absolute path including file name) of 984 | # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 985 | # the HTML help compiler on the generated index.hhp. 986 | 987 | HHC_LOCATION = 988 | 989 | # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 990 | # controls if a separate .chi index file is generated (YES) or that 991 | # it should be included in the master .chm file (NO). 992 | 993 | GENERATE_CHI = NO 994 | 995 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 996 | # is used to encode HtmlHelp index (hhk), content (hhc) and project file 997 | # content. 998 | 999 | CHM_INDEX_ENCODING = 1000 | 1001 | # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 1002 | # controls whether a binary table of contents is generated (YES) or a 1003 | # normal table of contents (NO) in the .chm file. 1004 | 1005 | BINARY_TOC = NO 1006 | 1007 | # The TOC_EXPAND flag can be set to YES to add extra items for group members 1008 | # to the contents of the HTML help documentation and to the tree view. 1009 | 1010 | TOC_EXPAND = NO 1011 | 1012 | # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and 1013 | # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated 1014 | # that can be used as input for Qt's qhelpgenerator to generate a 1015 | # Qt Compressed Help (.qch) of the generated HTML documentation. 1016 | 1017 | GENERATE_QHP = NO 1018 | 1019 | # If the QHG_LOCATION tag is specified, the QCH_FILE tag can 1020 | # be used to specify the file name of the resulting .qch file. 1021 | # The path specified is relative to the HTML output folder. 1022 | 1023 | QCH_FILE = 1024 | 1025 | # The QHP_NAMESPACE tag specifies the namespace to use when generating 1026 | # Qt Help Project output. For more information please see 1027 | # http://doc.trolltech.com/qthelpproject.html#namespace 1028 | 1029 | QHP_NAMESPACE = org.doxygen.Project 1030 | 1031 | # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 1032 | # Qt Help Project output. For more information please see 1033 | # http://doc.trolltech.com/qthelpproject.html#virtual-folders 1034 | 1035 | QHP_VIRTUAL_FOLDER = doc 1036 | 1037 | # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to 1038 | # add. For more information please see 1039 | # http://doc.trolltech.com/qthelpproject.html#custom-filters 1040 | 1041 | QHP_CUST_FILTER_NAME = 1042 | 1043 | # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the 1044 | # custom filter to add. For more information please see 1045 | # 1046 | # Qt Help Project / Custom Filters. 1047 | 1048 | QHP_CUST_FILTER_ATTRS = 1049 | 1050 | # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this 1051 | # project's 1052 | # filter section matches. 1053 | # 1054 | # Qt Help Project / Filter Attributes. 1055 | 1056 | QHP_SECT_FILTER_ATTRS = 1057 | 1058 | # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 1059 | # be used to specify the location of Qt's qhelpgenerator. 1060 | # If non-empty doxygen will try to run qhelpgenerator on the generated 1061 | # .qhp file. 1062 | 1063 | QHG_LOCATION = 1064 | 1065 | # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files 1066 | # will be generated, which together with the HTML files, form an Eclipse help 1067 | # plugin. To install this plugin and make it available under the help contents 1068 | # menu in Eclipse, the contents of the directory containing the HTML and XML 1069 | # files needs to be copied into the plugins directory of eclipse. The name of 1070 | # the directory within the plugins directory should be the same as 1071 | # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before 1072 | # the help appears. 1073 | 1074 | GENERATE_ECLIPSEHELP = NO 1075 | 1076 | # A unique identifier for the eclipse help plugin. When installing the plugin 1077 | # the directory name containing the HTML and XML files should also have 1078 | # this name. 1079 | 1080 | ECLIPSE_DOC_ID = org.doxygen.Project 1081 | 1082 | # The DISABLE_INDEX tag can be used to turn on/off the condensed index at 1083 | # top of each HTML page. The value NO (the default) enables the index and 1084 | # the value YES disables it. 1085 | 1086 | DISABLE_INDEX = NO 1087 | 1088 | # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values 1089 | # (range [0,1..20]) that doxygen will group on one line in the generated HTML 1090 | # documentation. Note that a value of 0 will completely suppress the enum 1091 | # values from appearing in the overview section. 1092 | 1093 | ENUM_VALUES_PER_LINE = 4 1094 | 1095 | # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 1096 | # structure should be generated to display hierarchical information. 1097 | # If the tag value is set to YES, a side panel will be generated 1098 | # containing a tree-like index structure (just like the one that 1099 | # is generated for HTML Help). For this to work a browser that supports 1100 | # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). 1101 | # Windows users are probably better off using the HTML help feature. 1102 | 1103 | GENERATE_TREEVIEW = NO 1104 | 1105 | # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, 1106 | # and Class Hierarchy pages using a tree view instead of an ordered list. 1107 | 1108 | USE_INLINE_TREES = NO 1109 | 1110 | # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 1111 | # used to set the initial width (in pixels) of the frame in which the tree 1112 | # is shown. 1113 | 1114 | TREEVIEW_WIDTH = 250 1115 | 1116 | # When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open 1117 | # links to external symbols imported via tag files in a separate window. 1118 | 1119 | EXT_LINKS_IN_WINDOW = NO 1120 | 1121 | # Use this tag to change the font size of Latex formulas included 1122 | # as images in the HTML documentation. The default is 10. Note that 1123 | # when you change the font size after a successful doxygen run you need 1124 | # to manually remove any form_*.png images from the HTML output directory 1125 | # to force them to be regenerated. 1126 | 1127 | FORMULA_FONTSIZE = 10 1128 | 1129 | # Use the FORMULA_TRANPARENT tag to determine whether or not the images 1130 | # generated for formulas are transparent PNGs. Transparent PNGs are 1131 | # not supported properly for IE 6.0, but are supported on all modern browsers. 1132 | # Note that when changing this option you need to delete any form_*.png files 1133 | # in the HTML output before the changes have effect. 1134 | 1135 | FORMULA_TRANSPARENT = YES 1136 | 1137 | # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax 1138 | # (see http://www.mathjax.org) which uses client side Javascript for the 1139 | # rendering instead of using prerendered bitmaps. Use this if you do not 1140 | # have LaTeX installed or if you want to formulas look prettier in the HTML 1141 | # output. When enabled you also need to install MathJax separately and 1142 | # configure the path to it using the MATHJAX_RELPATH option. 1143 | 1144 | USE_MATHJAX = NO 1145 | 1146 | # When MathJax is enabled you need to specify the location relative to the 1147 | # HTML output directory using the MATHJAX_RELPATH option. The destination 1148 | # directory should contain the MathJax.js script. For instance, if the mathjax 1149 | # directory is located at the same level as the HTML output directory, then 1150 | # MATHJAX_RELPATH should be ../mathjax. The default value points to the 1151 | # mathjax.org site, so you can quickly see the result without installing 1152 | # MathJax, but it is strongly recommended to install a local copy of MathJax 1153 | # before deployment. 1154 | 1155 | MATHJAX_RELPATH = http://www.mathjax.org/mathjax 1156 | 1157 | # The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension 1158 | # names that should be enabled during MathJax rendering. 1159 | 1160 | MATHJAX_EXTENSIONS = 1161 | 1162 | # When the SEARCHENGINE tag is enabled doxygen will generate a search box 1163 | # for the HTML output. The underlying search engine uses javascript 1164 | # and DHTML and should work on any modern browser. Note that when using 1165 | # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets 1166 | # (GENERATE_DOCSET) there is already a search function so this one should 1167 | # typically be disabled. For large projects the javascript based search engine 1168 | # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. 1169 | 1170 | SEARCHENGINE = YES 1171 | 1172 | # When the SERVER_BASED_SEARCH tag is enabled the search engine will be 1173 | # implemented using a PHP enabled web server instead of at the web client 1174 | # using Javascript. Doxygen will generate the search PHP script and index 1175 | # file to put on the web server. The advantage of the server 1176 | # based approach is that it scales better to large projects and allows 1177 | # full text search. The disadvantages are that it is more difficult to setup 1178 | # and does not have live searching capabilities. 1179 | 1180 | SERVER_BASED_SEARCH = NO 1181 | 1182 | #--------------------------------------------------------------------------- 1183 | # configuration options related to the LaTeX output 1184 | #--------------------------------------------------------------------------- 1185 | 1186 | # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 1187 | # generate Latex output. 1188 | 1189 | GENERATE_LATEX = YES 1190 | 1191 | # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 1192 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1193 | # put in front of it. If left blank `latex' will be used as the default path. 1194 | 1195 | LATEX_OUTPUT = latex 1196 | 1197 | # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 1198 | # invoked. If left blank `latex' will be used as the default command name. 1199 | # Note that when enabling USE_PDFLATEX this option is only used for 1200 | # generating bitmaps for formulas in the HTML output, but not in the 1201 | # Makefile that is written to the output directory. 1202 | 1203 | LATEX_CMD_NAME = latex 1204 | 1205 | # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 1206 | # generate index for LaTeX. If left blank `makeindex' will be used as the 1207 | # default command name. 1208 | 1209 | MAKEINDEX_CMD_NAME = makeindex 1210 | 1211 | # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 1212 | # LaTeX documents. This may be useful for small projects and may help to 1213 | # save some trees in general. 1214 | 1215 | COMPACT_LATEX = NO 1216 | 1217 | # The PAPER_TYPE tag can be used to set the paper type that is used 1218 | # by the printer. Possible values are: a4, letter, legal and 1219 | # executive. If left blank a4wide will be used. 1220 | 1221 | PAPER_TYPE = a4 1222 | 1223 | # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 1224 | # packages that should be included in the LaTeX output. 1225 | 1226 | EXTRA_PACKAGES = 1227 | 1228 | # The LATEX_HEADER tag can be used to specify a personal LaTeX header for 1229 | # the generated latex document. The header should contain everything until 1230 | # the first chapter. If it is left blank doxygen will generate a 1231 | # standard header. Notice: only use this tag if you know what you are doing! 1232 | 1233 | LATEX_HEADER = 1234 | 1235 | # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for 1236 | # the generated latex document. The footer should contain everything after 1237 | # the last chapter. If it is left blank doxygen will generate a 1238 | # standard footer. Notice: only use this tag if you know what you are doing! 1239 | 1240 | LATEX_FOOTER = 1241 | 1242 | # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 1243 | # is prepared for conversion to pdf (using ps2pdf). The pdf file will 1244 | # contain links (just like the HTML output) instead of page references 1245 | # This makes the output suitable for online browsing using a pdf viewer. 1246 | 1247 | PDF_HYPERLINKS = YES 1248 | 1249 | # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 1250 | # plain latex in the generated Makefile. Set this option to YES to get a 1251 | # higher quality PDF documentation. 1252 | 1253 | USE_PDFLATEX = YES 1254 | 1255 | # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 1256 | # command to the generated LaTeX files. This will instruct LaTeX to keep 1257 | # running if errors occur, instead of asking the user for help. 1258 | # This option is also used when generating formulas in HTML. 1259 | 1260 | LATEX_BATCHMODE = NO 1261 | 1262 | # If LATEX_HIDE_INDICES is set to YES then doxygen will not 1263 | # include the index chapters (such as File Index, Compound Index, etc.) 1264 | # in the output. 1265 | 1266 | LATEX_HIDE_INDICES = NO 1267 | 1268 | # If LATEX_SOURCE_CODE is set to YES then doxygen will include 1269 | # source code with syntax highlighting in the LaTeX output. 1270 | # Note that which sources are shown also depends on other settings 1271 | # such as SOURCE_BROWSER. 1272 | 1273 | LATEX_SOURCE_CODE = NO 1274 | 1275 | # The LATEX_BIB_STYLE tag can be used to specify the style to use for the 1276 | # bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See 1277 | # http://en.wikipedia.org/wiki/BibTeX for more info. 1278 | 1279 | LATEX_BIB_STYLE = plain 1280 | 1281 | #--------------------------------------------------------------------------- 1282 | # configuration options related to the RTF output 1283 | #--------------------------------------------------------------------------- 1284 | 1285 | # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 1286 | # The RTF output is optimized for Word 97 and may not look very pretty with 1287 | # other RTF readers or editors. 1288 | 1289 | GENERATE_RTF = NO 1290 | 1291 | # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 1292 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1293 | # put in front of it. If left blank `rtf' will be used as the default path. 1294 | 1295 | RTF_OUTPUT = rtf 1296 | 1297 | # If the COMPACT_RTF tag is set to YES Doxygen generates more compact 1298 | # RTF documents. This may be useful for small projects and may help to 1299 | # save some trees in general. 1300 | 1301 | COMPACT_RTF = NO 1302 | 1303 | # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 1304 | # will contain hyperlink fields. The RTF file will 1305 | # contain links (just like the HTML output) instead of page references. 1306 | # This makes the output suitable for online browsing using WORD or other 1307 | # programs which support those fields. 1308 | # Note: wordpad (write) and others do not support links. 1309 | 1310 | RTF_HYPERLINKS = NO 1311 | 1312 | # Load stylesheet definitions from file. Syntax is similar to doxygen's 1313 | # config file, i.e. a series of assignments. You only have to provide 1314 | # replacements, missing definitions are set to their default value. 1315 | 1316 | RTF_STYLESHEET_FILE = 1317 | 1318 | # Set optional variables used in the generation of an rtf document. 1319 | # Syntax is similar to doxygen's config file. 1320 | 1321 | RTF_EXTENSIONS_FILE = 1322 | 1323 | #--------------------------------------------------------------------------- 1324 | # configuration options related to the man page output 1325 | #--------------------------------------------------------------------------- 1326 | 1327 | # If the GENERATE_MAN tag is set to YES (the default) Doxygen will 1328 | # generate man pages 1329 | 1330 | GENERATE_MAN = YES 1331 | 1332 | # The MAN_OUTPUT tag is used to specify where the man pages will be put. 1333 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1334 | # put in front of it. If left blank `man' will be used as the default path. 1335 | 1336 | MAN_OUTPUT = man 1337 | 1338 | # The MAN_EXTENSION tag determines the extension that is added to 1339 | # the generated man pages (default is the subroutine's section .3) 1340 | 1341 | MAN_EXTENSION = .3 1342 | 1343 | # If the MAN_LINKS tag is set to YES and Doxygen generates man output, 1344 | # then it will generate one additional man file for each entity 1345 | # documented in the real man page(s). These additional files 1346 | # only source the real man page, but without them the man command 1347 | # would be unable to find the correct page. The default is NO. 1348 | 1349 | MAN_LINKS = NO 1350 | 1351 | #--------------------------------------------------------------------------- 1352 | # configuration options related to the XML output 1353 | #--------------------------------------------------------------------------- 1354 | 1355 | # If the GENERATE_XML tag is set to YES Doxygen will 1356 | # generate an XML file that captures the structure of 1357 | # the code including all documentation. 1358 | 1359 | GENERATE_XML = NO 1360 | 1361 | # The XML_OUTPUT tag is used to specify where the XML pages will be put. 1362 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1363 | # put in front of it. If left blank `xml' will be used as the default path. 1364 | 1365 | XML_OUTPUT = xml 1366 | 1367 | # The XML_SCHEMA tag can be used to specify an XML schema, 1368 | # which can be used by a validating XML parser to check the 1369 | # syntax of the XML files. 1370 | 1371 | XML_SCHEMA = 1372 | 1373 | # The XML_DTD tag can be used to specify an XML DTD, 1374 | # which can be used by a validating XML parser to check the 1375 | # syntax of the XML files. 1376 | 1377 | XML_DTD = 1378 | 1379 | # If the XML_PROGRAMLISTING tag is set to YES Doxygen will 1380 | # dump the program listings (including syntax highlighting 1381 | # and cross-referencing information) to the XML output. Note that 1382 | # enabling this will significantly increase the size of the XML output. 1383 | 1384 | XML_PROGRAMLISTING = YES 1385 | 1386 | #--------------------------------------------------------------------------- 1387 | # configuration options for the AutoGen Definitions output 1388 | #--------------------------------------------------------------------------- 1389 | 1390 | # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 1391 | # generate an AutoGen Definitions (see autogen.sf.net) file 1392 | # that captures the structure of the code including all 1393 | # documentation. Note that this feature is still experimental 1394 | # and incomplete at the moment. 1395 | 1396 | GENERATE_AUTOGEN_DEF = NO 1397 | 1398 | #--------------------------------------------------------------------------- 1399 | # configuration options related to the Perl module output 1400 | #--------------------------------------------------------------------------- 1401 | 1402 | # If the GENERATE_PERLMOD tag is set to YES Doxygen will 1403 | # generate a Perl module file that captures the structure of 1404 | # the code including all documentation. Note that this 1405 | # feature is still experimental and incomplete at the 1406 | # moment. 1407 | 1408 | GENERATE_PERLMOD = NO 1409 | 1410 | # If the PERLMOD_LATEX tag is set to YES Doxygen will generate 1411 | # the necessary Makefile rules, Perl scripts and LaTeX code to be able 1412 | # to generate PDF and DVI output from the Perl module output. 1413 | 1414 | PERLMOD_LATEX = NO 1415 | 1416 | # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 1417 | # nicely formatted so it can be parsed by a human reader. 1418 | # This is useful 1419 | # if you want to understand what is going on. 1420 | # On the other hand, if this 1421 | # tag is set to NO the size of the Perl module output will be much smaller 1422 | # and Perl will parse it just the same. 1423 | 1424 | PERLMOD_PRETTY = YES 1425 | 1426 | # The names of the make variables in the generated doxyrules.make file 1427 | # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 1428 | # This is useful so different doxyrules.make files included by the same 1429 | # Makefile don't overwrite each other's variables. 1430 | 1431 | PERLMOD_MAKEVAR_PREFIX = 1432 | 1433 | #--------------------------------------------------------------------------- 1434 | # Configuration options related to the preprocessor 1435 | #--------------------------------------------------------------------------- 1436 | 1437 | # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 1438 | # evaluate all C-preprocessor directives found in the sources and include 1439 | # files. 1440 | 1441 | ENABLE_PREPROCESSING = YES 1442 | 1443 | # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 1444 | # names in the source code. If set to NO (the default) only conditional 1445 | # compilation will be performed. Macro expansion can be done in a controlled 1446 | # way by setting EXPAND_ONLY_PREDEF to YES. 1447 | 1448 | MACRO_EXPANSION = NO 1449 | 1450 | # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 1451 | # then the macro expansion is limited to the macros specified with the 1452 | # PREDEFINED and EXPAND_AS_DEFINED tags. 1453 | 1454 | EXPAND_ONLY_PREDEF = NO 1455 | 1456 | # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 1457 | # pointed to by INCLUDE_PATH will be searched when a #include is found. 1458 | 1459 | SEARCH_INCLUDES = YES 1460 | 1461 | # The INCLUDE_PATH tag can be used to specify one or more directories that 1462 | # contain include files that are not input files but should be processed by 1463 | # the preprocessor. 1464 | 1465 | INCLUDE_PATH = 1466 | 1467 | # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 1468 | # patterns (like *.h and *.hpp) to filter out the header-files in the 1469 | # directories. If left blank, the patterns specified with FILE_PATTERNS will 1470 | # be used. 1471 | 1472 | INCLUDE_FILE_PATTERNS = *.php 1473 | 1474 | # The PREDEFINED tag can be used to specify one or more macro names that 1475 | # are defined before the preprocessor is started (similar to the -D option of 1476 | # gcc). The argument of the tag is a list of macros of the form: name 1477 | # or name=definition (no spaces). If the definition and the = are 1478 | # omitted =1 is assumed. To prevent a macro definition from being 1479 | # undefined via #undef or recursively expanded use the := operator 1480 | # instead of the = operator. 1481 | 1482 | PREDEFINED = 1483 | 1484 | # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 1485 | # this tag can be used to specify a list of macro names that should be expanded. 1486 | # The macro definition that is found in the sources will be used. 1487 | # Use the PREDEFINED tag if you want to use a different macro definition that 1488 | # overrules the definition found in the source code. 1489 | 1490 | EXPAND_AS_DEFINED = 1491 | 1492 | # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 1493 | # doxygen's preprocessor will remove all references to function-like macros 1494 | # that are alone on a line, have an all uppercase name, and do not end with a 1495 | # semicolon, because these will confuse the parser if not removed. 1496 | 1497 | SKIP_FUNCTION_MACROS = YES 1498 | 1499 | #--------------------------------------------------------------------------- 1500 | # Configuration::additions related to external references 1501 | #--------------------------------------------------------------------------- 1502 | 1503 | # The TAGFILES option can be used to specify one or more tagfiles. 1504 | # Optionally an initial location of the external documentation 1505 | # can be added for each tagfile. The format of a tag file without 1506 | # this location is as follows: 1507 | # 1508 | # TAGFILES = file1 file2 ... 1509 | # Adding location for the tag files is done as follows: 1510 | # 1511 | # TAGFILES = file1=loc1 "file2 = loc2" ... 1512 | # where "loc1" and "loc2" can be relative or absolute paths or 1513 | # URLs. If a location is present for each tag, the installdox tool 1514 | # does not have to be run to correct the links. 1515 | # Note that each tag file must have a unique name 1516 | # (where the name does NOT include the path) 1517 | # If a tag file is not located in the directory in which doxygen 1518 | # is run, you must also specify the path to the tagfile here. 1519 | 1520 | TAGFILES = 1521 | 1522 | # When a file name is specified after GENERATE_TAGFILE, doxygen will create 1523 | # a tag file that is based on the input files it reads. 1524 | 1525 | GENERATE_TAGFILE = 1526 | 1527 | # If the ALLEXTERNALS tag is set to YES all external classes will be listed 1528 | # in the class index. If set to NO only the inherited external classes 1529 | # will be listed. 1530 | 1531 | ALLEXTERNALS = NO 1532 | 1533 | # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 1534 | # in the modules index. If set to NO, only the current project's groups will 1535 | # be listed. 1536 | 1537 | EXTERNAL_GROUPS = YES 1538 | 1539 | # The PERL_PATH should be the absolute path and name of the perl script 1540 | # interpreter (i.e. the result of `which perl'). 1541 | 1542 | PERL_PATH = /usr/bin/perl 1543 | 1544 | #--------------------------------------------------------------------------- 1545 | # Configuration options related to the dot tool 1546 | #--------------------------------------------------------------------------- 1547 | 1548 | # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 1549 | # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 1550 | # or super classes. Setting the tag to NO turns the diagrams off. Note that 1551 | # this option also works with HAVE_DOT disabled, but it is recommended to 1552 | # install and use dot, since it yields more powerful graphs. 1553 | 1554 | CLASS_DIAGRAMS = YES 1555 | 1556 | # You can define message sequence charts within doxygen comments using the \msc 1557 | # command. Doxygen will then run the mscgen tool (see 1558 | # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 1559 | # documentation. The MSCGEN_PATH tag allows you to specify the directory where 1560 | # the mscgen tool resides. If left empty the tool is assumed to be found in the 1561 | # default search path. 1562 | 1563 | MSCGEN_PATH = 1564 | 1565 | # If set to YES, the inheritance and collaboration graphs will hide 1566 | # inheritance and usage relations if the target is undocumented 1567 | # or is not a class. 1568 | 1569 | HIDE_UNDOC_RELATIONS = YES 1570 | 1571 | # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 1572 | # available from the path. This tool is part of Graphviz, a graph visualization 1573 | # toolkit from AT&T and Lucent Bell Labs. The other options in this section 1574 | # have no effect if this option is set to NO (the default) 1575 | 1576 | HAVE_DOT = NO 1577 | 1578 | # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is 1579 | # allowed to run in parallel. When set to 0 (the default) doxygen will 1580 | # base this on the number of processors available in the system. You can set it 1581 | # explicitly to a value larger than 0 to get control over the balance 1582 | # between CPU load and processing speed. 1583 | 1584 | DOT_NUM_THREADS = 0 1585 | 1586 | # By default doxygen will use the Helvetica font for all dot files that 1587 | # doxygen generates. When you want a differently looking font you can specify 1588 | # the font name using DOT_FONTNAME. You need to make sure dot is able to find 1589 | # the font, which can be done by putting it in a standard location or by setting 1590 | # the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the 1591 | # directory containing the font. 1592 | 1593 | DOT_FONTNAME = Helvetica 1594 | 1595 | # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 1596 | # The default size is 10pt. 1597 | 1598 | DOT_FONTSIZE = 10 1599 | 1600 | # By default doxygen will tell dot to use the Helvetica font. 1601 | # If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to 1602 | # set the path where dot can find it. 1603 | 1604 | DOT_FONTPATH = 1605 | 1606 | # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 1607 | # will generate a graph for each documented class showing the direct and 1608 | # indirect inheritance relations. Setting this tag to YES will force the 1609 | # the CLASS_DIAGRAMS tag to NO. 1610 | 1611 | CLASS_GRAPH = YES 1612 | 1613 | # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 1614 | # will generate a graph for each documented class showing the direct and 1615 | # indirect implementation dependencies (inheritance, containment, and 1616 | # class references variables) of the class with other documented classes. 1617 | 1618 | COLLABORATION_GRAPH = YES 1619 | 1620 | # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 1621 | # will generate a graph for groups, showing the direct groups dependencies 1622 | 1623 | GROUP_GRAPHS = YES 1624 | 1625 | # If the UML_LOOK tag is set to YES doxygen will generate inheritance and 1626 | # collaboration diagrams in a style similar to the OMG's Unified Modeling 1627 | # Language. 1628 | 1629 | UML_LOOK = NO 1630 | 1631 | # If set to YES, the inheritance and collaboration graphs will show the 1632 | # relations between templates and their instances. 1633 | 1634 | TEMPLATE_RELATIONS = NO 1635 | 1636 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 1637 | # tags are set to YES then doxygen will generate a graph for each documented 1638 | # file showing the direct and indirect include dependencies of the file with 1639 | # other documented files. 1640 | 1641 | INCLUDE_GRAPH = YES 1642 | 1643 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 1644 | # HAVE_DOT tags are set to YES then doxygen will generate a graph for each 1645 | # documented header file showing the documented files that directly or 1646 | # indirectly include this file. 1647 | 1648 | INCLUDED_BY_GRAPH = YES 1649 | 1650 | # If the CALL_GRAPH and HAVE_DOT options are set to YES then 1651 | # doxygen will generate a call dependency graph for every global function 1652 | # or class method. Note that enabling this option will significantly increase 1653 | # the time of a run. So in most cases it will be better to enable call graphs 1654 | # for selected functions only using the \callgraph command. 1655 | 1656 | CALL_GRAPH = NO 1657 | 1658 | # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 1659 | # doxygen will generate a caller dependency graph for every global function 1660 | # or class method. Note that enabling this option will significantly increase 1661 | # the time of a run. So in most cases it will be better to enable caller 1662 | # graphs for selected functions only using the \callergraph command. 1663 | 1664 | CALLER_GRAPH = NO 1665 | 1666 | # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 1667 | # will generate a graphical hierarchy of all classes instead of a textual one. 1668 | 1669 | GRAPHICAL_HIERARCHY = YES 1670 | 1671 | # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 1672 | # then doxygen will show the dependencies a directory has on other directories 1673 | # in a graphical way. The dependency relations are determined by the #include 1674 | # relations between the files in the directories. 1675 | 1676 | DIRECTORY_GRAPH = YES 1677 | 1678 | # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 1679 | # generated by dot. Possible values are svg, png, jpg, or gif. 1680 | # If left blank png will be used. If you choose svg you need to set 1681 | # HTML_FILE_EXTENSION to xhtml in order to make the SVG files 1682 | # visible in IE 9+ (other browsers do not have this requirement). 1683 | 1684 | DOT_IMAGE_FORMAT = png 1685 | 1686 | # If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to 1687 | # enable generation of interactive SVG images that allow zooming and panning. 1688 | # Note that this requires a modern browser other than Internet Explorer. 1689 | # Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you 1690 | # need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files 1691 | # visible. Older versions of IE do not have SVG support. 1692 | 1693 | INTERACTIVE_SVG = NO 1694 | 1695 | # The tag DOT_PATH can be used to specify the path where the dot tool can be 1696 | # found. If left blank, it is assumed the dot tool can be found in the path. 1697 | 1698 | DOT_PATH = 1699 | 1700 | # The DOTFILE_DIRS tag can be used to specify one or more directories that 1701 | # contain dot files that are included in the documentation (see the 1702 | # \dotfile command). 1703 | 1704 | DOTFILE_DIRS = 1705 | 1706 | # The MSCFILE_DIRS tag can be used to specify one or more directories that 1707 | # contain msc files that are included in the documentation (see the 1708 | # \mscfile command). 1709 | 1710 | MSCFILE_DIRS = 1711 | 1712 | # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 1713 | # nodes that will be shown in the graph. If the number of nodes in a graph 1714 | # becomes larger than this value, doxygen will truncate the graph, which is 1715 | # visualized by representing a node as a red box. Note that doxygen if the 1716 | # number of direct children of the root node in a graph is already larger than 1717 | # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 1718 | # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. 1719 | 1720 | DOT_GRAPH_MAX_NODES = 50 1721 | 1722 | # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 1723 | # graphs generated by dot. A depth value of 3 means that only nodes reachable 1724 | # from the root by following a path via at most 3 edges will be shown. Nodes 1725 | # that lay further from the root node will be omitted. Note that setting this 1726 | # option to 1 or 2 may greatly reduce the computation time needed for large 1727 | # code bases. Also note that the size of a graph can be further restricted by 1728 | # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. 1729 | 1730 | MAX_DOT_GRAPH_DEPTH = 0 1731 | 1732 | # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 1733 | # background. This is disabled by default, because dot on Windows does not 1734 | # seem to support this out of the box. Warning: Depending on the platform used, 1735 | # enabling this option may lead to badly anti-aliased labels on the edges of 1736 | # a graph (i.e. they become hard to read). 1737 | 1738 | DOT_TRANSPARENT = NO 1739 | 1740 | # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 1741 | # files in one run (i.e. multiple -o and -T options on the command line). This 1742 | # makes dot run faster, but since only newer versions of dot (>1.8.10) 1743 | # support this, this feature is disabled by default. 1744 | 1745 | DOT_MULTI_TARGETS = NO 1746 | 1747 | # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 1748 | # generate a legend page explaining the meaning of the various boxes and 1749 | # arrows in the dot generated graphs. 1750 | 1751 | GENERATE_LEGEND = YES 1752 | 1753 | # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 1754 | # remove the intermediate dot files that are used to generate 1755 | # the various graphs. 1756 | 1757 | DOT_CLEANUP = YES 1758 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 by CornelTek, All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 1. Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | 2. Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | 3. All advertising materials mentioning features or use of this software 12 | must display the following acknowledgement: 13 | This product includes software developed by CornelTek and its 14 | contributors. 15 | 4. Neither the name of the University nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /NOTES: -------------------------------------------------------------------------------- 1 | -class GenPHP 2 | -{ 3 | - /* return resources dir path from an object. 4 | - */ 5 | - function getResourcesDir() 6 | - { 7 | - $ref = new ReflectionClass($this); 8 | - $filename = $ref->getFileName(); 9 | - return dirname($filename); 10 | - } 11 | - 12 | - /* Use relative file path to get the absolute path of resource file 13 | - * from an GenPhp object. 14 | - */ 15 | - function getResourceFile( $filepath ) 16 | - { 17 | - return $this->getResourcesDir() . DIRECTORY_SEPARATOR . $filepath; 18 | - } 19 | -} 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | GenPHP 2 | ====== 3 | GenPHP is a powerful, flexible PHP code/project generator, 4 | which helps you avoid repeating jobs. 5 | 6 | GenPHP can generate anything you defined in the flavor, 7 | In the generator class, you can use the simple generator API to generate your code. 8 | 9 | By using GenPHP, you can also seperate your global generator (`~/.genphp/flavors`), project-scope generator (`./flavors`). 10 | 11 | GenPHP is using Twig template engine from Symfony. 12 | 13 | 14 | [![Build Status](https://secure.travis-ci.org/c9s/GenPHP.png)](http://travis-ci.org/c9s/GenPHP) 15 | 16 | ![](https://github.com/c9s/GenPHP/raw/master/screenshots/screenshot01.png) 17 | 18 | Requirements 19 | ------------ 20 | - PHP5.3 21 | 22 | Installation 23 | ------------ 24 | Copy this line to install genphp: 25 | 26 | $ curl https://raw.github.com/c9s/GenPHP/master/scripts/install.sh | bash 27 | 28 | Install built-in flavors 29 | ------------------------ 30 | 31 | $ git clone https://github.com/c9s/GenPHP-Flavors ~/.genphp/flavors 32 | 33 | ## Usage 34 | 35 | After installation, you can run `list` command to list your flavors, 36 | You can put your flavor (generator) in global flavor path (`~/.genphp/flavors`) or 37 | your current project flavor path (`./flavors` or `./.flavors`), for example: 38 | 39 | ~GenPHP $ genphp list 40 | 41 | Available flavors: 42 | command flavors 43 | flavor flavors 44 | operation flavors 45 | phpunit flavors 46 | project flavors 47 | flavor /Users/c9s/.genphp/flavors 48 | phpunit /Users/c9s/.genphp/flavors 49 | 50 | 51 | 52 | ### Creating New Flavors 53 | 54 | The concept of GenPHP is pretty simple, when you run `genphp new`, it first initialize a flavor loader, 55 | then use the flavor loader to look up matched flavor from several locations. 56 | 57 | The loaded flavor instance initializes a generator (which can be GenericGenerator, or BaseGenerator) to generate the stuff 58 | from the flavor resource directory to the destination directory. your 59 | generator class works between the flavor resource directory and the destination 60 | directory. 61 | 62 | 63 | #### Creating Flavor 64 | 65 | To create your flavor from your codebase in your project, type: 66 | 67 | $ cd your_project 68 | $ mkdir flavors 69 | $ genphp new flavor foo ~/path/to/codebase 70 | 71 | Loading flavor... 72 | Inializing option specs... 73 | Running generator... 74 | create flavors/foo/Resource 75 | create flavors/foo/Resource/file1 76 | create flavors/foo/Resource/file2 77 | create flavors/foo/Resource/file3 78 | Done 79 | 80 | You can see those created files files here, it's using GenericGenerator to copy 81 | `flavors/foo/Resource` to current directory. 82 | 83 | Now you can put your own files (used by generator) into the `Resource` directory. 84 | 85 | 86 | #### Customizing Your Flavor and Generator 87 | 88 | For more complex usage, to create your own generator, just run: 89 | 90 | $ genphp new flavor foo 91 | 92 | Loading flavor... 93 | Inializing option specs... 94 | Running generator... 95 | create flavors/foo/Resource 96 | render flavors/foo/Generator.php 97 | Done 98 | 99 | Create new flavor without codebase path, then open the `Generator.php` file, write your 100 | generator actions in the `generate` function. 101 | 102 | ```php 103 | class Generator { 104 | 105 | public function brief() { return 'your generator brief'; } 106 | 107 | public function generate($argument1,$argument2) 108 | { 109 | // do your operations here 110 | $this->copyDir('etc','etc'); 111 | } 112 | } 113 | ``` 114 | 115 | Put your favorite files into `flavors/foo/Resource`, then you can write operation code in PHP. 116 | 117 | #### Testing Your Flavor 118 | 119 | Once you have done, You can run `new` command to generate your flavor: 120 | 121 | $ genphp new foo argument1 argument2 122 | 123 | And your code is generated. 124 | 125 | If you want your flavor be global (system-wide), you can run install command: 126 | 127 | $ genphp install flavors/foo 128 | 129 | This installs flavor to your global flavor path. 130 | 131 | 132 | ### Using Operation 133 | 134 | GenPHP provides a lot of useful operations for you to write generation tasks very easily. 135 | 136 | #### CopyOperation 137 | 138 | To copy directory recursively from flavors/foo/Resource/from/path to to/path 139 | 140 | ```php 141 | $this->copyDir('from/path','to/path'); 142 | ``` 143 | 144 | #### TouchOperation 145 | 146 | To touch a file 147 | 148 | ```php 149 | $this->touch('path/to/touch'); 150 | ``` 151 | 152 | #### CreateOperation 153 | 154 | To create a new file with content 155 | 156 | ```php 157 | $this->create('path/to/file', 'file content' ); 158 | ``` 159 | 160 | #### CopyOperation 161 | 162 | To copy a file, copy path/file1 from Resource dir to file2 163 | 164 | ```php 165 | $this->copy( 'path/file1' , 'file2' ); 166 | ``` 167 | 168 | #### CreateDirOperation 169 | 170 | To create a directory: 171 | 172 | ```php 173 | $this->createDir( 'path/to/directory' ); 174 | ``` 175 | 176 | #### RenderOperation 177 | 178 | To load templateName.php.twig template from flavors/foo/Resource 179 | and render the code template with variables to a file: 180 | 181 | ```php 182 | $this->render('templateName.php.twig','path/to/file', array( 183 | 'className' => $className 184 | )); 185 | ``` 186 | 187 | #### WriteJsonOperation 188 | 189 | To write a json file 190 | 191 | ```php 192 | $this->writeJson('file.json', array( 'name' => 'John' ) ); // executes WriteJsonOperation 193 | ``` 194 | 195 | #### WriteYamlOperation 196 | 197 | To write a yaml file 198 | 199 | ```php 200 | $this->writeYaml('file.yaml', array( 'name' => 'John' ) ); // executes WriteJsonOperation 201 | ``` 202 | 203 | #### GitCloneOperation 204 | 205 | To clone/pull a git repository: 206 | ```php 207 | $this->gitClone( 'git@github.com:.....git' , 'path/to/repo' ); 208 | ``` 209 | 210 | #### HgCloneOperation 211 | 212 | To clone/pull a hg repository: 213 | ```php 214 | $this->hgClone( 'hg uri' , 'path/to/repo' ); 215 | ``` 216 | 217 | 218 | Command Usage 219 | ------------- 220 | 221 | To generate a generic PHP project structure, GenPHP provides a built-in 222 | template for this: 223 | 224 | ```bash 225 | $ genphp new project Foo 226 | 227 | create 228 | create src 229 | create src/Foo.php 230 | create src/Foo 231 | dependency ant 232 | create build.xml 233 | dependency phpunit 234 | create phpunit.xml.dist 235 | create tests 236 | ``` 237 | 238 | genphp looks for flavor in `./flavors`, `./.flavors`, `~/.genphp/flavors`, you 239 | can define your generator in those paths. 240 | 241 | to generate a new flavor: 242 | 243 | ```bash 244 | $ genphp new flavor flavorName 245 | ``` 246 | 247 | To generate a new flavor from current existing code base: 248 | 249 | ```bash 250 | $ genphp new flavor ProjectA ~/path/to/OneProject 251 | ``` 252 | 253 | To list schemas 254 | 255 | ```bash 256 | $ genphp list 257 | ``` 258 | 259 | please check `./flavors` directory of this repository 260 | for more details. 261 | 262 | ## Flavor API 263 | 264 | ```php 265 | $path = $flavor->path( 'license' ); 266 | 267 | ``` 268 | 269 | 270 | ## Generator Runner 271 | 272 | ```php 273 | $loader = new \Flavor\FlavorLoader; 274 | $flavor = $loader->load( $flavorName ); 275 | $generator = $flavor->getGenerator(); 276 | $generator->setLogger( $this->getLogger() ); 277 | 278 | $args = func_get_args(); 279 | array_shift($args); 280 | 281 | $runner = new \GenPHP\GeneratorRunner; 282 | $runner->logger = $logger; 283 | $runner->run($generator,$args); 284 | ``` 285 | 286 | 287 | ## Generator API 288 | 289 | ```php 290 | public fucntion generate($argument1,$argument2, ... ) 291 | { 292 | $file = $this->flavorLoader->load('license')->path('LICENSE.GPL2'); 293 | $this->copy($file, 'LICENSE' ); 294 | $this->copyDir( ); 295 | } 296 | ``` 297 | 298 | ### Operations 299 | By using built-in operations, you can create your code generator very easily, 300 | for example, the built-in flavor code generator from GenPHP: 301 | 302 | ```php 303 | namespace flavor; 304 | use GenPHP\Flavor\BaseGenerator; 305 | use GenPHP\Path; 306 | 307 | class Generator extends BaseGenerator 308 | { 309 | public function brief() { 310 | return "Default Flavor"; 311 | } 312 | 313 | public function generate($name) 314 | { 315 | $paths = Path::get_flavor_paths(); 316 | foreach( $paths as $path ) { 317 | if( file_exists($path) ) { 318 | $base = $path . DIRECTORY_SEPARATOR . $name; 319 | $this->createDir( $base . DIRECTORY_SEPARATOR . "Resource"); 320 | $this->render( 'Generator.php.twig', 321 | $base . DIRECTORY_SEPARATOR . 'Generator.php', 322 | array( 'name' => $name ) ); 323 | } 324 | } 325 | 326 | } 327 | } 328 | ``` 329 | 330 | Operation name magic: 331 | 332 | ```php 333 | // executes CopyDirOperation 334 | $this->copyDir('from/path','to/path'); 335 | 336 | // executes TouchOperation 337 | $this->touch('path/to/touch'); 338 | 339 | // executes TouchOperation 340 | $this->create('path/to/file', 'file content' ); 341 | 342 | // executes RenderOperation 343 | $this->render('templateName.php.twig','path/to/file', array( 344 | 'className' => $className 345 | )); 346 | 347 | // executes WriteJsonOperation 348 | $this->writeJson('file.json', array( ... ) ); // executes WriteJsonOperation 349 | ``` 350 | 351 | GenPHP supports many operations: 352 | 353 | - CopyDirOperation 354 | - CopyOperation 355 | - CreateDirOperation 356 | - CreateOperation 357 | - RenderOperation 358 | - TouchOperation 359 | - WriteJsonOperation 360 | - WriteYamlOperation 361 | 362 | ## Development 363 | 364 | - Fork this probject on GitHub 365 | - Git clone it: 366 | 367 | $ git clone git@github.com:{{ your Id }}/GenPHP.git 368 | 369 | - Install onion 370 | - run `onion bundle` to install PEAR dependencies. 371 | - run `scripts/genphp` to test your genphp script. 372 | - run `phpunit` to run the test suites. 373 | - run `scripts/compile.sh` to compile whole library into a executable phar file. 374 | 375 | ### Create New Opeartion 376 | 377 | There is a flavor for creating new opeartion already, just run: 378 | 379 | $ ./scripts/genphp new operation DoSomething 380 | 381 | ### Create New Flavor 382 | 383 | $ ./scripts/genphp new flavor flavor_name 384 | 385 | 386 | ### IRC 387 | 388 | Join us on irc channel: #genphp on irc.freenode.net 389 | 390 | ## Reference 391 | * newgem: http://newgem.rubyforge.org/ 392 | * Rails: http://guides.rubyonrails.org/command\_line.html 393 | -------------------------------------------------------------------------------- /bin/genphp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | run( $argv ); 7 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "corneltek/genphp", 3 | "require": { 4 | "php": ">=5.3.0", 5 | "corneltek/phptask": "~1", 6 | "corneltek/fileutil": "^1", 7 | "twig/twig": "~1.32.0|^2" 8 | }, 9 | "require-dev": { 10 | "corneltek/phpunit-testmore": "dev-master", 11 | "corneltek/cliframework": "4.0.x-dev", 12 | "corneltek/codegen": "@dev", 13 | "universal/universal": "*" 14 | }, 15 | "autoload": { 16 | "psr-4": { 17 | "GenPHP\\": "src/" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /doc/Flavor.md: -------------------------------------------------------------------------------- 1 | Flavor 2 | ====== 3 | 4 | 5 | ## Flavor Loader 6 | 7 | To create a flavor loader object: 8 | 9 | $loader = new Flavor\FlavorLoader; 10 | 11 | $loader = new Flavor\FlavorLoader( array( 'path/to/your/flavors', 'path/to/your/flavors2' ) ); 12 | 13 | To load a flavor by the flavor loader: 14 | 15 | $flavor = $loader->load( $flavorName ); 16 | 17 | To get the generator object from flavor: 18 | 19 | $generator = $flavor->getGenerator(); 20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/WrittingFlavor.md: -------------------------------------------------------------------------------- 1 | Writting Flavor 2 | ================ 3 | 4 | The generic structure of a flavor: 5 | 6 | flavors/foo_flavor # your flavor directory 7 | flavors/foo_flavor/Generator.php # your generator logics 8 | flavors/foo_flavor/Resource/ # your resource files (templates, assets or anything) 9 | flavors/foo_flavor/Resource/some_files/bar1 10 | flavors/foo_flavor/Resource/some_files/bar2 11 | 12 | A basic generator class, you can write the generator logic in the 13 | generate method, the arguments are passed from command-line. 14 | 15 | copyDir( 'your_path' , 'some_files' ); 33 | $this->render( 'template_file', 'target_file', array( 'name' => $name ) ); 34 | } 35 | 36 | To get flavor object from generator, simple get from `flavor` class member. 37 | 38 | public function generate() 39 | { 40 | $flavorName = $this->flavor->getName() 41 | $resDir = $this->flavor->getResourceDir(); 42 | $content = $this->flavor->getResourceContent( 'some_files/bar1' ); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /package.ini: -------------------------------------------------------------------------------- 1 | [package] 2 | name = GenPHP 3 | version = 1.2.5 4 | summary = PHP Code generator 5 | desc = PHP Code Generator 6 | author = Yo-An Lin 7 | channel = pear.corneltek.com 8 | stability = stable 9 | 10 | [require] 11 | php = 5.3 12 | pearinstaller = 1.4.1 13 | pear.corneltek.com/Universal = 0.0.0 14 | pear.corneltek.com/CLIFramework = 0.0.0 15 | pear.twig-project.org/Twig = 0.0.0 16 | 17 | [roles] 18 | bin/genphp = script 19 | -------------------------------------------------------------------------------- /package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | GenPHP 4 | pear.corneltek.com 5 | PHP Code generator 6 | PHP Code Generator 7 | 8 | Yo-An Lin 9 | 10 | cornelius.howl@gmail.com 11 | yes 12 | 13 | 2012-08-19 14 | 15 | 16 | 1.2.2 17 | 1.2.2 18 | 19 | 20 | stable 21 | stable 22 | 23 | PHP 24 | - 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 5.3 74 | 75 | 76 | 1.4.1 77 | 78 | 79 | Universal 80 | pear.corneltek.com 81 | 0.0.0 82 | 83 | 84 | CLIFramework 85 | pear.corneltek.com 86 | 0.0.0 87 | 88 | 89 | Twig 90 | pear.twig-project.org 91 | 0.0.0 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /phpdox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /phprelease.ini: -------------------------------------------------------------------------------- 1 | Steps = PHPUnit, BumpVersion, scripts/compile, GitCommit, GitTag, GitPush, GitPushTags 2 | VersionFrom = src/GenPHP/Application.php 3 | -------------------------------------------------------------------------------- /phpunit-ci.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | tests 18 | 19 | 20 | 21 | 22 | 25 | 26 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | tests 11 | 12 | 13 | 14 | 15 | 16 | src 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /screenshots/screenshot01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c9s/GenPHP/b86095b1a88c5d1224d4c5af44a278b413051bbe/screenshots/screenshot01.png -------------------------------------------------------------------------------- /scripts/compile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | onion -d compile \ 3 | --lib src \ 4 | --lib vendor/corneltek/cliframework/src \ 5 | --lib vendor/corneltek/getoptionkit/src \ 6 | --lib vendor/corneltek/universal/src \ 7 | --lib vendor/twig/twig/lib \ 8 | --classloader \ 9 | --bootstrap scripts/genphp.php \ 10 | --executable \ 11 | --output genphp.phar 12 | mv -v genphp.phar genphp 13 | chmod +x genphp 14 | -------------------------------------------------------------------------------- /scripts/genphp.php: -------------------------------------------------------------------------------- 1 | run( $argv ); 4 | -------------------------------------------------------------------------------- /scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | mkdir -p /var/tmp 3 | cd /var/tmp 4 | 5 | if [[ -e GenPHP ]] ; then 6 | cd GenPHP 7 | git remote update --prune 8 | git pull origin master 9 | else 10 | git clone git://github.com/c9s/GenPHP.git 11 | cd GenPHP 12 | fi 13 | ./genphp install flavors/flavor 14 | mkdir -p ~/bin 15 | mkdir -p ~/.genphp/flavors 16 | cp -v genphp ~/bin 17 | if [[ -e ~/.zshrc && -z $(grep GenPHP ~/.zshrc) ]] ; then 18 | echo "# GenPHP" >> ~/.zshrc 19 | echo "export PATH=\$PATH:~/bin" >> ~/.zshrc 20 | elif [[ -e ~/.bashrc && -z $(grep GenPHP ~/.bashrc) ]] ; then 21 | echo "# GenPHP" >> ~/bashrc 22 | echo "export PATH=\$PATH:~/bin" >> ~/.bashrc 23 | fi 24 | echo "Done" 25 | echo "" 26 | echo "Please reload your bashrc or zshrc" 27 | echo "" 28 | echo "To list genphp flavors:" 29 | echo " \$ genphp list " 30 | echo "" 31 | echo "To create new flavor:" 32 | echo " \$ genphp new flavor YourFlavor" 33 | echo "" 34 | echo "Enjoy!" 35 | -------------------------------------------------------------------------------- /scripts/install_flavors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | rsync -rv flavors/ ~/.genphp/flavors/ 3 | -------------------------------------------------------------------------------- /scripts/local_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./scripts/compile.sh 3 | onion.phar build 4 | sudo pear install -f package.xml 5 | -------------------------------------------------------------------------------- /scripts/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | version=$(cat package.ini|grep version|sed -e 's/version =//') 3 | scripts/compile.sh 4 | onion -d build 5 | git commit -a -m "Build Release for version $version" 6 | -------------------------------------------------------------------------------- /src/Application.php: -------------------------------------------------------------------------------- 1 | registerCommand('new'); 18 | $this->registerCommand('list'); 19 | $this->registerCommand('init'); 20 | $this->registerCommand('install'); 21 | parent::init(); 22 | } 23 | 24 | function options($opts) 25 | { 26 | parent::options( $opts ); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/Command/InitCommand.php: -------------------------------------------------------------------------------- 1 | add('s|string:','description ....'); 13 | } 14 | 15 | function execute() 16 | { 17 | $logger = $this->getLogger(); 18 | $path = Path::get_home_flavor_path(); 19 | $logger->info( "Creating $path ..." ); 20 | Helper::mktree( $path ); 21 | 22 | $logger->info( "Creating flavors/..." ); 23 | Helper::mktree( 'flavors' ); 24 | $logger->info( "Done" ); 25 | 26 | $config = new Config; 27 | if( $file = $config->getConfigFile() ) { 28 | if( ! file_exists($file) ) { 29 | // create default config file content 30 | $content =<<logger->info("Config file is generated at $file"); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Command/InstallCommand.php: -------------------------------------------------------------------------------- 1 | add('f|force','force install'); 20 | } 21 | 22 | function installFlavor($flavor) 23 | { 24 | if( isset( $this->installed[ $flavor->getName() ] ) ) 25 | return; 26 | 27 | $logger = $this->getLogger(); 28 | $homePath = Path::get_home_flavor_path(); 29 | 30 | Helper::mktree( $homePath ); 31 | 32 | $logger->info( "Installing " . $flavor->getName() . "..." ); 33 | Helper::copy_dir( 34 | $flavor->__toString(), 35 | $homePath . DIRECTORY_SEPARATOR . $flavor->getName(), 36 | function($target) use ($logger) { 37 | $logger->info( "Installing " . $target,1); 38 | }); 39 | 40 | // get dependencies 41 | $generator = $flavor->getGenerator(); 42 | $depGenerators = $generator->getDependencies(); 43 | foreach( $depGenerators as $depGenerator ) { 44 | $this->installFlavor( $depGenerator->getFlavor()); 45 | } 46 | } 47 | 48 | // xxx: should also install dependency flavors 49 | function execute($nameOrPath) 50 | { 51 | if( file_exists($nameOrPath) ) { 52 | $flavor = new Flavor($nameOrPath); 53 | $this->installFlavor( $flavor ); 54 | } 55 | else { 56 | $loader = new FlavorLoader; 57 | $flavor = $loader->load( $nameOrPath ); 58 | $this->installFlavor( $flavor ); 59 | } 60 | $this->getLogger()->info("Done"); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/Command/ListCommand.php: -------------------------------------------------------------------------------- 1 | add('s|string:','description ....'); 13 | } 14 | 15 | 16 | public function traverseDir($path, $parentPath = null) 17 | { 18 | if ( $handle = opendir( $path ) ) { 19 | while (false !== ($entry = readdir($handle))) { 20 | if ( $entry[0] == '.' || $entry == '..' ) { 21 | continue; 22 | } 23 | if ( file_exists($path . DIRECTORY_SEPARATOR . $entry . DIRECTORY_SEPARATOR . 'Resource') ) { 24 | $this->getLogger()->info( sprintf("%-20s", $parentPath ? $parentPath . '/' . $entry : $entry), 1 ); 25 | } else { 26 | if ( is_dir($path . DIRECTORY_SEPARATOR . $entry) ) { 27 | $this->traverseDir( 28 | $path . DIRECTORY_SEPARATOR . $entry, 29 | $entry 30 | ); 31 | } 32 | } 33 | } 34 | closedir($handle); 35 | } 36 | } 37 | 38 | public function execute() 39 | { 40 | $logger = $this->getLogger(); 41 | $paths = Path::get_flavor_paths(); 42 | foreach( $paths as $path ) { 43 | if ( ! file_exists($path) ) { 44 | continue; 45 | } 46 | $logger->info("flavors in '$path':"); 47 | $this->traverseDir($path); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/Command/NewCommand.php: -------------------------------------------------------------------------------- 1 | getLogger(); 21 | $formatter = $logger->getFormatter(); 22 | 23 | // load flavor and get generator 24 | $logger->info("Loading flavor $flavorName..."); 25 | $loader = new Flavor\FlavorLoader; 26 | $flavor = $loader->load( $flavorName ); 27 | $generator = $flavor->getGenerator(); 28 | 29 | // initialize option spec for generator command 30 | // generator command can have its options for generating code. 31 | $logger->info2("Inializing option specs..."); 32 | $generator->setLogger( $this->getLogger() ); 33 | 34 | /* use GetOptionKit to parse options from $args */ 35 | $args = func_get_args(); 36 | array_shift($args); 37 | 38 | $runner = new \GenPHP\GeneratorRunner; 39 | $runner->logger = $logger; 40 | $runner->run($generator,$args); 41 | 42 | $logger->info("Done"); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Config.php: -------------------------------------------------------------------------------- 1 | array( 23 | 'name' => 'Unknown', 24 | 'email' => '', 25 | 'copyright' => '', 26 | ) 27 | ); 28 | 29 | function __construct() 30 | { 31 | $this->home = $this->getHomeDir(); 32 | 33 | if( ! file_exists($this->home) ) 34 | mkdir( $this->home, 0755, true ); // recursive mkdir 35 | 36 | $file = null; 37 | if( $file = $this->getConfigFile() ) { 38 | if( file_exists( $file ) ) { 39 | $this->config = array_merge( $this->config , $this->_parseConfigFile( $file ) ); 40 | } 41 | } 42 | } 43 | 44 | function getHomeDir() 45 | { 46 | return getenv('HOME') . DS . '.genphp'; 47 | } 48 | 49 | function getConfigFile() 50 | { 51 | return $this->home . DS . 'config'; 52 | } 53 | 54 | function _parseConfigFile($configFile) 55 | { 56 | return parse_ini_file( $configFile, true ); 57 | } 58 | 59 | 60 | 61 | public function offsetSet($n,$v) 62 | { 63 | $this->config[ $n ] = $v; 64 | } 65 | 66 | public function offsetExists($n) 67 | { 68 | return isset($this->config[$n]); 69 | } 70 | 71 | public function offsetGet($n) 72 | { 73 | if( isset($this->config[$n]) ) 74 | return $this->config[ $n ]; 75 | } 76 | 77 | public function offsetUnset($n) 78 | { 79 | unset($this->config[$n]); 80 | } 81 | 82 | 83 | public function __get($n) 84 | { 85 | if( isset($this->config[$n]) ) 86 | return $this->config[ $n ]; 87 | } 88 | 89 | 90 | 91 | 92 | } 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /src/Flavor/BaseGenerator.php: -------------------------------------------------------------------------------- 1 | renderTo( 'from_file.php' , 'path/to/file.php' ); 22 | * $this->copy( 'from_file.php' , 'path/to/file.php' ); 23 | * $this->rename( 'from_file.php' , 'new_name.php' ); 24 | * $this->delete( 'old/file.php' ); 25 | * $this->writeYaml( 'yaml' , array( .... ) ); 26 | * $this->writeJson( 'json' , array( .... ) ); 27 | * $this->create( 'file.php' , $content ); 28 | * } 29 | * 30 | */ 31 | abstract class BaseGenerator 32 | { 33 | protected $options; 34 | protected $logger; 35 | protected $mixins = array(); 36 | 37 | public $flavor; 38 | protected $flavorLoader; 39 | 40 | /** 41 | * @var array global arguments 42 | **/ 43 | public $globalArguments = array(); 44 | 45 | public function __construct( Flavor $flavor ) 46 | { 47 | $this->mixins[] = new OperationDispatcher( $this ); 48 | $this->flavor = $flavor; 49 | 50 | // XXX: should be assigned from outside. 51 | $this->flavorLoader = new FlavorLoader; 52 | } 53 | 54 | /* subclass must implements this */ 55 | abstract function brief(); 56 | 57 | 58 | /** 59 | * return flavor dependencies 60 | */ 61 | public function dependency() 62 | { 63 | return array( 64 | /** 65 | * flavor name => array( ... default options ) 66 | * 67 | * 'name' => array( 'options' => array( .... ), 'arguments' => ... ), 68 | * 'name', 69 | */ 70 | ); 71 | } 72 | 73 | /** 74 | * initialize options 75 | */ 76 | public function options($opts) 77 | { 78 | // $opts->add('v|verbose','show verbose message'); 79 | } 80 | 81 | /** 82 | * xxx: refactor this, put this in a proper class. 83 | */ 84 | public function logAction($action,$data,$indent = 1) 85 | { 86 | $logger = $this->getLogger(); 87 | if( ! $logger ) 88 | return; 89 | $formatter = $logger->getFormatter(); 90 | $msg = sprintf( "%-24s %s" , 91 | $formatter->format( $action , 'strong_white' ), 92 | $formatter->format( $data, 'white' ) 93 | ); 94 | $logger->info( $msg, $indent ); 95 | } 96 | 97 | public function getFlavor() 98 | { 99 | return $this->flavor; 100 | } 101 | 102 | 103 | /** 104 | * Generator provides the methods from Flavor instance. 105 | */ 106 | public function __call($method,$args) 107 | { 108 | if ( method_exists( $this->flavor,$method) ) { 109 | return call_user_func_array( array($this->flavor, $method ), $args ); 110 | } 111 | 112 | /* call mixins */ 113 | foreach( $this->mixins as $mixin ) { 114 | return call_user_func_array( array($mixin,$method),$args); 115 | # if( method_exists( $mixin, $method ) ) { 116 | # return call_user_func_array( array($mixin,$method),$args); 117 | # } 118 | } 119 | } 120 | 121 | 122 | public function setLogger($logger) 123 | { 124 | $this->logger = $logger; 125 | } 126 | 127 | /** 128 | * get logger object 129 | */ 130 | public function getLogger() 131 | { 132 | return $this->logger; 133 | } 134 | 135 | 136 | 137 | public function getOption() 138 | { 139 | return $this->options; 140 | } 141 | 142 | public function setOption($result) 143 | { 144 | $this->options = $result; 145 | } 146 | 147 | // abstract function generate(); 148 | 149 | 150 | /** 151 | * Set global arguments 152 | */ 153 | public function setGlobalArguments(array $args) { 154 | $this->globalArguments = $args; 155 | } 156 | 157 | public function getGlobalArguments() { 158 | return $this->globalArguments; 159 | } 160 | 161 | public function getGlobalArgument($name) { 162 | return $this->globalArguments[ $name ]; 163 | } 164 | 165 | /** 166 | * Let subclass to define global arguments 167 | */ 168 | public function prepareGlobalArguments() { 169 | return array(); 170 | } 171 | 172 | 173 | public function getDependencies() 174 | { 175 | $depGenerators = array(); 176 | 177 | $loader = new FlavorLoader; 178 | $logger = $this->getLogger(); 179 | $deps = $this->dependency(); 180 | foreach( $deps as $depName => $options ) { 181 | /* swap for short dependency name */ 182 | if( is_integer($depName) ) { 183 | $depName = $options; 184 | $options = array(); 185 | } 186 | 187 | $depFlavor = $loader->load( $depName ); 188 | if( ! $depFlavor->exists() ) 189 | throw new Exception( "Dependency flavor $depName not found." ); 190 | $depGenerator = $depFlavor->getGenerator(); 191 | $depGenerator->setLogger( $logger ); 192 | 193 | $depSpecs = new OptionCollection; 194 | $depGenerator->options( $depSpecs ); 195 | $depOptionResult = OptionResult::create( 196 | $depSpecs, 197 | @$options['options'] ?: array(), 198 | @$options['arguments'] ?: array() 199 | ); 200 | $depGenerator->setOption( $depOptionResult ); 201 | 202 | $depGenerators[] = $depGenerator; 203 | } 204 | return $depGenerators; 205 | } 206 | 207 | } 208 | 209 | -------------------------------------------------------------------------------- /src/Flavor/Flavor.php: -------------------------------------------------------------------------------- 1 | loader = $loader; 16 | } 17 | } 18 | 19 | public function getGeneratorClassFile() 20 | { 21 | return $this->getPathname() . DIRECTORY_SEPARATOR . 'Generator.php'; 22 | } 23 | 24 | public function hasGeneratorClassFile() 25 | { 26 | return file_exists($this->getGeneratorClassFile()); 27 | } 28 | 29 | public function exists() 30 | { 31 | return file_exists($this->getPathname()); 32 | } 33 | 34 | public function requireGeneratorClassFile() 35 | { 36 | $class = $this->getGeneratorClass(); 37 | if ( class_exists($class) ) { 38 | return $class; 39 | } 40 | require $this->getGeneratorClassFile(); 41 | return $class; 42 | } 43 | 44 | public function getName() 45 | { 46 | return $this->getBasename(); 47 | } 48 | 49 | 50 | public function getNamespace() 51 | { 52 | $name = $this->getName(); 53 | return preg_replace( '#[-]+#', '_' , $name ); 54 | } 55 | 56 | public function getGeneratorClass() 57 | { 58 | return $this->getNamespace() . '\Generator'; 59 | } 60 | 61 | public function createGenericGenerator() 62 | { 63 | return new GenericGenerator($this); 64 | } 65 | 66 | public function getGenerator() 67 | { 68 | if( $this->hasGeneratorClassFile() ) { 69 | $class = $this->requireGeneratorClassFile(); 70 | return new $class( $this ); 71 | } elseif( $this->hasResourceDir() ) { 72 | return $this->createGenericGenerator(); 73 | } 74 | } 75 | 76 | 77 | 78 | 79 | 80 | /** 81 | * Set resource directory 82 | * 83 | * @param string $dir 84 | */ 85 | public function setResourceDir($dir) 86 | { 87 | $this->resourceDir = $dir; 88 | } 89 | 90 | public function setLoader($loader) 91 | { 92 | $this->loader = $loader; 93 | } 94 | 95 | public function getLoader() 96 | { 97 | return $this->loader; 98 | } 99 | 100 | /** 101 | * Get Flavor Directory from Generator class 102 | * 103 | * @return string $path 104 | */ 105 | public function getResourceDir() 106 | { 107 | if( $this->resourceDir ) 108 | return $this->resourceDir; 109 | return $this->getPathname() . DIRECTORY_SEPARATOR . 'Resource'; 110 | 111 | # XXX: old path gettter method from generator 112 | # $refl = new ReflectionObject($this); 113 | # $flavor = new Flavor( dirname($refl->getFilename()) ); 114 | # return $flavor->getResourceDir(); 115 | } 116 | 117 | public function getResourcePath($path) 118 | { 119 | return $this->getResourceDir() . DIRECTORY_SEPARATOR . $path; 120 | } 121 | 122 | 123 | /** 124 | * return resource file path 125 | * 126 | * @param string $path 127 | * @return SplFileInfo 128 | */ 129 | public function getResourceFile( $path ) 130 | { 131 | $file = $this->getResourceDir() . DIRECTORY_SEPARATOR . $path; 132 | if( file_exists($file) ) 133 | return new SplFileInfo( $file ); 134 | throw new Exception( "$file does not exist." ); 135 | } 136 | 137 | 138 | /** 139 | * return resource file content 140 | * 141 | * @param string $path 142 | * @return string content 143 | */ 144 | public function getResourceContent($path) 145 | { 146 | return file_get_contents( $this->getResourceFile( $path ) ); 147 | } 148 | 149 | 150 | /** 151 | * check if resource directory exists 152 | * 153 | * @return boolean 154 | */ 155 | public function hasResourceDir() 156 | { 157 | return file_exists($this->getResourceDir()); 158 | } 159 | 160 | 161 | /** 162 | * helper method for getting resource path 163 | * 164 | * @code 165 | * 166 | * $file = $flavor->path('path/to/file'); 167 | * 168 | * @param string $path 169 | * @see getResourceFile 170 | */ 171 | public function path($path) 172 | { 173 | return $this->getResourceDir() . DIRECTORY_SEPARATOR . $path; 174 | } 175 | 176 | } 177 | 178 | -------------------------------------------------------------------------------- /src/Flavor/FlavorLoader.php: -------------------------------------------------------------------------------- 1 | dirs = $dirs ? (array) $dirs : Path::get_flavor_paths(); 19 | } 20 | 21 | 22 | /** 23 | * load flavor 24 | * 25 | * @param string $name flavor name 26 | * @return FlavirDirectory object. 27 | */ 28 | public function load($name) 29 | { 30 | foreach( $this->dirs as $dir ) { 31 | if ( ! file_exists($dir . DIRECTORY_SEPARATOR . $name) ) { 32 | continue; 33 | } 34 | 35 | $flavor = new Flavor($dir . DIRECTORY_SEPARATOR . $name, $this); 36 | if ( $flavor->exists() ) { 37 | return $flavor; 38 | } 39 | } 40 | throw new Exception("Flavor $name not found."); 41 | } 42 | 43 | 44 | /** 45 | * load flavor generator 46 | */ 47 | public function loadGeneratorClass($name) 48 | { 49 | if( $flavor = $this->loadFlavor( $name ) ) { 50 | return $flavor->getGenerator(); 51 | } else { 52 | throw new Exception("Flavor $name not found."); 53 | } 54 | } 55 | 56 | 57 | /** 58 | * Add flavor path 59 | * 60 | * @param string $dir 61 | */ 62 | public function addPath($dir) 63 | { 64 | $this->dirs[] = $dir; 65 | } 66 | 67 | /** 68 | * Set flavor directory paths 69 | * 70 | * @param array $dirs 71 | */ 72 | public function setPaths($dirs) 73 | { 74 | $this->dirs = (array) $dirs; 75 | } 76 | 77 | /** 78 | * Get flavor generator from flavor name 79 | * 80 | * @param string $name flavor name 81 | */ 82 | public function getFlavorGenerator($name) 83 | { 84 | $generator = $this->loadGeneratorClass($name); 85 | if( ! $generator ) { 86 | throw new Exception("Flavor $name not found."); 87 | } 88 | return $generator; 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /src/Flavor/GenericGenerator.php: -------------------------------------------------------------------------------- 1 | getResourceDir(); 12 | $this->copyDir( $rs , '.' ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/GeneratorRunner.php: -------------------------------------------------------------------------------- 1 | getDependencies(); 19 | 20 | foreach ($deps as $depGenerator) { 21 | $depGenerator->logAction("dependency", get_class($depGenerator) , 1); 22 | $subargs = $depGenerator->getOption()->getArguments(); 23 | $this->runGenerator($depGenerator , $subargs); 24 | } 25 | 26 | $specs = new OptionCollection; 27 | $generator->options($specs); 28 | 29 | $parser = new OptionParser($specs); 30 | 31 | array_unshift($args, 'genphp'); // option parser doesn't parse the first argument (program name) 32 | $result = $parser->parse($args); 33 | 34 | /* pass rest arguments for generation */ 35 | $generator->setOption($result); 36 | 37 | $this->runGenerator($generator, $result->getArguments()); 38 | } 39 | 40 | /** 41 | * Use ReflectionObject to check the generator parameters. 42 | * 43 | * @param Generator $generator 44 | * @param array $args 45 | */ 46 | public function checkGeneratorParameters($generator,$args) 47 | { 48 | $gClass = get_class( $generator ); 49 | $refl = new ReflectionObject($generator); 50 | $reflMethod = $refl->getMethod('generate'); 51 | $requiredNumber = $reflMethod->getNumberOfRequiredParameters(); 52 | if ( count($args) < $requiredNumber ) { 53 | $this->getLogger()->error( "Generator $gClass requires $requiredNumber arguments." ); 54 | $params = $reflMethod->getParameters(); 55 | foreach ( $params as $param ) { 56 | $this->getLogger()->error( 57 | $param->getPosition() . ' => $' . $param->getName() , 1 ); 58 | } 59 | throw new RuntimeException("Invalid Generator Arguments."); 60 | } 61 | } 62 | 63 | public function runGenerator($generator, array $args = array()) 64 | { 65 | $this->checkGeneratorParameters($generator, $args); 66 | return call_user_func_array([$generator,'generate'],$args); 67 | } 68 | 69 | public function getLogger() 70 | { 71 | return $this->logger; 72 | } 73 | 74 | } 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/Operation/CopyDirOperation.php: -------------------------------------------------------------------------------- 1 | getResourceDir(); 22 | $from = realpath($from) ?: $resDir . DIRECTORY_SEPARATOR . $from; 23 | $to = realpath($to) ?: $to; 24 | 25 | $iterator = new RecursiveIteratorIterator( 26 | new RecursiveDirectoryIterator($from, RecursiveDirectoryIterator::SKIP_DOTS), 27 | RecursiveIteratorIterator::SELF_FIRST); 28 | 29 | foreach ($iterator as $path) { 30 | $target = $to . DIRECTORY_SEPARATOR . $iterator->getSubPathname(); 31 | if ( $path->isDir() ) { 32 | $this->logAction( 'copy' , Helper::short_path($target) ); 33 | futil_mkdir_if_not_exists($target, 0755, true); 34 | } else { 35 | if ( file_exists($target) ) { 36 | $this->logAction( 'skip' , Helper::short_path($target) ); 37 | } else { 38 | $this->logAction( 'copy' , Helper::short_path($target) ); 39 | Helper::copy( $path , $target ); 40 | } 41 | } 42 | } 43 | } 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/Operation/CopyFilesOperation.php: -------------------------------------------------------------------------------- 1 | generator->copy( $file , $file); 12 | } 13 | } 14 | 15 | } 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Operation/CopyOperation.php: -------------------------------------------------------------------------------- 1 | logAction('copy',$to); 10 | $rsDir = $this->getResourceDir(); 11 | Helper::copy($rsDir . DIRECTORY_SEPARATOR . $from,$to); 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/Operation/CreateDirOperation.php: -------------------------------------------------------------------------------- 1 | logAction('create', $dir); 16 | Helper::mktree($dir); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/Operation/CreateOperation.php: -------------------------------------------------------------------------------- 1 | logAction('create',$file); 17 | Helper::put( $file, $content ); 18 | } 19 | 20 | } 21 | 22 | -------------------------------------------------------------------------------- /src/Operation/GitCloneOperation.php: -------------------------------------------------------------------------------- 1 | logAction('git:pull',$repoUri); 14 | Helper::system('git','--git-dir',$target . DIRECTORY_SEPARATOR . '.git', 15 | 'remote','update','--prune'); 16 | Helper::system('git','--git-dir',$target . DIRECTORY_SEPARATOR . '.git', 17 | 'pull','--all'); 18 | } 19 | else { 20 | $this->logAction('git:clone',$repoUri); 21 | Helper::system('git','clone',$repoUri,$target); 22 | } 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/Operation/Helper.php: -------------------------------------------------------------------------------- 1 | getSubPathname(); 49 | if ($path->isDir()) { 50 | self::mktree( $target ); 51 | if ( $cb ) { 52 | $cb($target); 53 | } 54 | } else { 55 | self::copy( $path , $target ); 56 | if ( $cb ) { 57 | $cb($target); 58 | } 59 | } 60 | } 61 | } 62 | 63 | static function short_path($path) { 64 | $rpath = realpath($path) ?: $path; 65 | $curpath = getcwd(); 66 | 67 | if( 0 === strpos( $rpath,$curpath ) ) 68 | return substr($rpath,strlen($curpath) + 1); 69 | return $path; 70 | } 71 | 72 | /** 73 | * a system function wrapper, with escapeshellarg 74 | */ 75 | static function system() 76 | { 77 | $args = func_get_args(); 78 | $args = array_map( 'escapeshellarg' , $args ); 79 | system(join( ' ' , $args )); 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/Operation/HgCloneOperation.php: -------------------------------------------------------------------------------- 1 | logAction('hg:pull',$repoUri); 11 | Helper::system('hg','-R',$target,'pull','-u'); 12 | } 13 | else { 14 | $this->logAction('hg:clone',$repoUri); 15 | Helper::system('hg','clone',$repoUri,$target); 16 | } 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/Operation/InstallOperation.php: -------------------------------------------------------------------------------- 1 | getResourcePath($path); 16 | if ( is_dir($sourcePath) ) { 17 | $this->generator->copyDir($path, $path); 18 | } else { 19 | $this->generator->copy($path, $path); 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/Operation/MoveOperation.php: -------------------------------------------------------------------------------- 1 | logAction('move',$to); 17 | rename($from,$to); 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/Operation/Operation.php: -------------------------------------------------------------------------------- 1 | run( ... ); 14 | */ 15 | abstract class Operation 16 | { 17 | protected $generator; 18 | 19 | public function __construct($generator) 20 | { 21 | $this->generator = $generator; 22 | } 23 | 24 | public function setGenerator($generator) 25 | { 26 | $this->generator = $generator; 27 | } 28 | 29 | public function logAction($action,$path,$indent = 1) 30 | { 31 | $this->generator->logAction( $action,$path,$indent); 32 | } 33 | 34 | 35 | public function getLogger() 36 | { 37 | return $this->generator->getLogger(); 38 | } 39 | 40 | public function getResourcePath($path) 41 | { 42 | return $this->generator->getResourcePath($path); 43 | } 44 | 45 | public function getResourceDir() 46 | { 47 | return $this->generator->getResourceDir(); 48 | } 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /src/Operation/RenderOperation.php: -------------------------------------------------------------------------------- 1 | render('template.php.twig','target.php', array( 14 | * ... 15 | * )); 16 | * 17 | * @param string $templateFile template file path (related from ResourceDir) 18 | * @param string $target path to target file. 19 | */ 20 | function run($templateFile,$target,$args = array() ) 21 | { 22 | $rsDir = $this->getResourceDir(); 23 | $loader = new Twig_Loader_Filesystem(array($rsDir)); 24 | $twig = new Twig_Environment($loader, array( )); 25 | 26 | // XXX: register some built-in template for php doc or code. 27 | 28 | $template = $twig->loadTemplate($templateFile); 29 | $output = $template->render($args); 30 | 31 | $this->logAction('render',$target); 32 | Helper::put( $target, $output ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Operation/SVNCheckoutOperation.php: -------------------------------------------------------------------------------- 1 | logAction('svn:update',$repoUri); 14 | $pdir = getcwd(); 15 | chdir($target); 16 | Helper::system('svn', 'update'); 17 | chdir($pdir); 18 | } 19 | else { 20 | $this->logAction('svn:checkout',$repoUri); 21 | Helper::system('svn','checkout',$repoUri,$target); 22 | } 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/Operation/TouchOperation.php: -------------------------------------------------------------------------------- 1 | logAction('touch',$path); 16 | touch($path); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/Operation/WriteJsonOperation.php: -------------------------------------------------------------------------------- 1 | logAction('create',$file); 16 | Helper::put($file, json_encode($data)); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/Operation/WriteYamlOperation.php: -------------------------------------------------------------------------------- 1 | logAction( 'yaml' , $path ); 21 | Helper::put( $path, yaml_emit($data) ); 22 | } 23 | else { 24 | $this->getLogger()->error( 'yaml extension not found.' ); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/OperationDispatcher.php: -------------------------------------------------------------------------------- 1 | self = $self; 29 | } 30 | 31 | 32 | /** 33 | * push user-specified namespace to the lookup namespace array. 34 | * 35 | * @param string $ns namespace name 36 | */ 37 | static function insertNamespace($ns) { 38 | // insert namespace at first place. 39 | array_splice(static::$namespaces,0, 0 ,$ns); 40 | } 41 | 42 | public function unregisterOperation($methodName) 43 | { 44 | unset( $this->registered[ $methodName ] ); 45 | } 46 | 47 | public function registerOperation( $methodName, Operation $operation) 48 | { 49 | $operation->setGenerator( $this->self ); 50 | $this->registered[ $methodName ] = $operation; 51 | } 52 | 53 | /** 54 | * Here does the magic to convert method name into operation class. 55 | */ 56 | public function __call($method,$args) 57 | { 58 | /* check registered operations */ 59 | if( isset( $this->registered[ $method ] ) ) { 60 | $operation = $this->registered[ $method ]; 61 | return call_user_func_array( array($operation,'run') , $args ); 62 | } 63 | 64 | // look up for built-in operations 65 | foreach ( static::$namespaces as $ns ) { 66 | $class = $ns . '\\' . ucfirst($method) . 'Operation'; 67 | if ( ! class_exists($class) ) { 68 | spl_autoload_call( $class ); 69 | } 70 | if ( class_exists($class) ) { 71 | $operation = new $class( $this->self ); 72 | return call_user_func_array( array($operation,'run') , $args ); 73 | } else { 74 | throw new Exception("Operation class not found: $class"); 75 | } 76 | } 77 | } 78 | 79 | } 80 | 81 | -------------------------------------------------------------------------------- /src/Path.php: -------------------------------------------------------------------------------- 1 | load('license'); 14 | ok( $flavor ); 15 | return $flavor; 16 | } 17 | 18 | public function flavorProvider() 19 | { 20 | return array( 21 | array('license', array('MIT')) 22 | ); 23 | } 24 | 25 | 26 | /** 27 | * @dataProvider flavorProvider 28 | */ 29 | public function testFlavors($flavorName, $args) 30 | { 31 | $loader = new \GenPHP\Flavor\FlavorLoader(array( ROOT_DIR . '/tests/flavors', 'flavors' )); 32 | $flavor = $loader->load($flavorName); 33 | $this->assertNotEmpty($flavor); 34 | 35 | ok( $flavor->exists() ); 36 | is( $flavorName, $flavor->getName() ); 37 | 38 | $dir = $flavor->getResourceDir(); 39 | path_ok( $dir , 'Found resource directory' ); 40 | 41 | 42 | $generator = $flavor->getGenerator(); 43 | $pwd = getcwd(); 44 | $this->prepareChdir(); 45 | chdir(self::CHDIR); 46 | $runner = new \GenPHP\GeneratorRunner; 47 | $runner->run($generator, $args); 48 | chdir($pwd); 49 | } 50 | 51 | public function prepareChdir() 52 | { 53 | if ( ! file_exists(self::CHDIR) ) { 54 | mkdir(self::CHDIR,0755,true); 55 | } 56 | } 57 | 58 | /** 59 | * @depends testLoader 60 | */ 61 | public function testFlavor($flavor) { 62 | $generator = $flavor->getGenerator(); 63 | ok( $generator ); 64 | ok( $flavor->exists() ); 65 | 66 | is( 'license', $flavor->getName() ); 67 | is( 'license', $flavor->getNamespace() ); 68 | $dir = $flavor->getResourceDir(); 69 | path_ok( $dir ); 70 | 71 | $pwd = getcwd(); 72 | $root = "tests/root"; 73 | if ( ! file_exists($root) ) { 74 | mkdir($root,0755,true); 75 | } 76 | chdir($root); 77 | chdir($pwd); 78 | } 79 | } 80 | 81 | -------------------------------------------------------------------------------- /tests/GenPHP/Flavor/FlavorTest.php: -------------------------------------------------------------------------------- 1 | getResourceDir() ); 13 | ok( $fl->hasResourceDir() ); 14 | ok( $fl->hasGeneratorClassFile() ); 15 | ok( $fl->getGeneratorClassFile() ); 16 | ok( $fl->exists() ); 17 | is( 'command', $fl->getName()); 18 | is('command\Generator', $fl->getGeneratorClass() ); 19 | 20 | ok( $fl->createGenericGenerator() ); 21 | } 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/GenPHP/OperationDispatcherTest.php: -------------------------------------------------------------------------------- 1 | copy('/var/tmp/copy_1','/var/tmp/copy_2'); 20 | ok( file_exists('/var/tmp/copy_2') ); 21 | unlink( '/var/tmp/copy_1' ); 22 | unlink( '/var/tmp/copy_2' ); 23 | unlink( '/var/tmp/copy_1' ); 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | choose("Please select license type",array( 16 | 'MIT License' => 'MIT', 17 | 'PHP License' => 'PHP', 18 | 'Zend License' => 'ZEND', 19 | 'GPL2 License' => 'GPL2', 20 | 'BSD License' => 'BSD', 21 | )); 22 | } 23 | 24 | $licenseFile = 'LICENSE.' . $licenseType; 25 | 26 | $config = new Config; 27 | $this->render( $licenseFile , 'LICENSE' , array( 'config' => $config ) ); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /tests/flavors/license/Resource/LICENSE.BSD: -------------------------------------------------------------------------------- 1 | Copyright (c) 1982, 1986, 1990, 1991, 1993 2 | The Regents of the University of California. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 3. All advertising materials mentioning features or use of this software 13 | must display the following acknowledgement: 14 | This product includes software developed by the University of 15 | California, Berkeley and its contributors. 16 | 4. Neither the name of the University nor the names of its contributors 17 | may be used to endorse or promote products derived from this software 18 | without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /tests/flavors/license/Resource/LICENSE.GPL2: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /tests/flavors/license/Resource/LICENSE.MIT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (C) {{config.author.name}} <{{config.author.email}}> 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /tests/flavors/license/Resource/LICENSE.PHP: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------- 2 | The PHP License, version 3.01 3 | Copyright (c) 1999 - 2010 The PHP Group. All rights reserved. 4 | -------------------------------------------------------------------- 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, is permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in 15 | the documentation and/or other materials provided with the 16 | distribution. 17 | 18 | 3. The name "PHP" must not be used to endorse or promote products 19 | derived from this software without prior written permission. For 20 | written permission, please contact group@php.net. 21 | 22 | 4. Products derived from this software may not be called "PHP", nor 23 | may "PHP" appear in their name, without prior written permission 24 | from group@php.net. You may indicate that your software works in 25 | conjunction with PHP by saying "Foo for PHP" instead of calling 26 | it "PHP Foo" or "phpfoo" 27 | 28 | 5. The PHP Group may publish revised and/or new versions of the 29 | license from time to time. Each version will be given a 30 | distinguishing version number. 31 | Once covered code has been published under a particular version 32 | of the license, you may always continue to use it under the terms 33 | of that version. You may also choose to use such covered code 34 | under the terms of any subsequent version of the license 35 | published by the PHP Group. No one other than the PHP Group has 36 | the right to modify the terms applicable to covered code created 37 | under this License. 38 | 39 | 6. Redistributions of any form whatsoever must retain the following 40 | acknowledgment: 41 | "This product includes PHP software, freely available from 42 | ". 43 | 44 | THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND 45 | ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 46 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 47 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP 48 | DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 49 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 50 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 51 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 52 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 53 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 54 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 55 | OF THE POSSIBILITY OF SUCH DAMAGE. 56 | 57 | -------------------------------------------------------------------- 58 | 59 | This software consists of voluntary contributions made by many 60 | individuals on behalf of the PHP Group. 61 | 62 | The PHP Group can be contacted via Email at group@php.net. 63 | 64 | For more information on the PHP Group and the PHP project, 65 | please see . 66 | 67 | PHP includes the Zend Engine, freely available at 68 | . 69 | -------------------------------------------------------------------------------- /tests/flavors/license/Resource/LICENSE.ZEND: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------- 2 | The Zend Engine License, version 2.00 3 | Copyright (c) 1999-2002 Zend Technologies Ltd. All rights reserved. 4 | -------------------------------------------------------------------- 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, is permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following 15 | disclaimer in the documentation and/or other materials provided 16 | with the distribution. 17 | 18 | 3. The names "Zend" and "Zend Engine" must not be used to endorse 19 | or promote products derived from this software without prior 20 | permission from Zend Technologies Ltd. For written permission, 21 | please contact license@zend.com. 22 | 23 | 4. Zend Technologies Ltd. may publish revised and/or new versions 24 | of the license from time to time. Each version will be given a 25 | distinguishing version number. 26 | Once covered code has been published under a particular version 27 | of the license, you may always continue to use it under the 28 | terms of that version. You may also choose to use such covered 29 | code under the terms of any subsequent version of the license 30 | published by Zend Technologies Ltd. No one other than Zend 31 | Technologies Ltd. has the right to modify the terms applicable 32 | to covered code created under this License. 33 | 34 | 5. Redistributions of any form whatsoever must retain the following 35 | acknowledgment: 36 | "This product includes the Zend Engine, freely available at 37 | http://www.zend.com" 38 | 39 | 6. All advertising materials mentioning features or use of this 40 | software must display the following acknowledgment: 41 | "The Zend Engine is freely available at http://www.zend.com" 42 | 43 | THIS SOFTWARE IS PROVIDED BY ZEND TECHNOLOGIES LTD. ``AS IS'' AND 44 | ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 45 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 46 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZEND 47 | TECHNOLOGIES LTD. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 48 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 49 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 50 | USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 51 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 52 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 53 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 54 | SUCH DAMAGE. 55 | 56 | -------------------------------------------------------------------- 57 | -------------------------------------------------------------------------------- /tests/helpers.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | * 10 | */ 11 | 12 | if( ! defined('DEBUG_BACKTRACE_PROVIDE_OBJECT') ) 13 | define('DEBUG_BACKTRACE_PROVIDE_OBJECT',1); 14 | 15 | function ok( $v , $msg = null ) 16 | { 17 | $stacks = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); # XXX: limit is only availabel in PHP5.4 18 | $testobj = $stacks[1]['object']; 19 | $testobj->assertTrue( $v ? true : false , $msg ); 20 | } 21 | 22 | function not_ok( $v , $msg = null ) 23 | { 24 | $stacks = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); # XXX: limit is only availabel in PHP5.4 25 | $testobj = $stacks[1]['object']; 26 | $testobj->assertFalse( $v ? true : false , $msg ); 27 | } 28 | 29 | function is( $expected , $v , $msg = null ) 30 | { 31 | $stacks = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); # XXX: limit is only availabel in PHP5.4 32 | $testobj = $stacks[1]['object']; 33 | $testobj->assertEquals( $expected , $v , $msg ); 34 | } 35 | 36 | function isa_ok( $expected , $v , $msg = null ) 37 | { 38 | $stacks = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); # XXX: limit is only availabel in PHP5.4 39 | $testobj = $stacks[1]['object']; 40 | $testobj->assertInstanceOf( $expected , $v , $msg ); 41 | } 42 | 43 | function is_class( $expected , $v , $msg = null ) 44 | { 45 | $stacks = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); # XXX: limit is only availabel in PHP5.4 46 | $testobj = $stacks[1]['object']; 47 | $testobj->assertInstanceOf( $expected , $v , $msg ); 48 | } 49 | 50 | function count_ok( $expected,$v, $msg = null ) 51 | { 52 | $stacks = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); # XXX: limit is only availabel in PHP5.4 53 | $testobj = $stacks[1]['object']; 54 | $testobj->assertCount( $expected , $v , $msg ); 55 | } 56 | 57 | 58 | function like( $e, $v , $msg = null ) 59 | { 60 | $stacks = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); # XXX: limit is only availabel in PHP5.4 61 | $testobj = $stacks[1]['object']; 62 | $testobj->assertRegExp($e,$v,$msg); 63 | } 64 | 65 | function is_true($e,$v,$msg = null) 66 | { 67 | $stacks = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); # XXX: limit is only availabel in PHP5.4 68 | $testobj = $stacks[1]['object']; 69 | $testobj->assertTrue($e,$v,$msg); 70 | } 71 | 72 | function is_false($e,$v,$msg= null) 73 | { 74 | $stacks = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); # XXX: limit is only availabel in PHP5.4 75 | $testobj = $stacks[1]['object']; 76 | $testobj->assertFalse($e,$v,$msg); 77 | } 78 | 79 | function file_equals($e,$v,$msg = null) 80 | { 81 | $stacks = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT ); # XXX: limit is only availabel in PHP5.4 82 | $testobj = $stacks[1]['object']; 83 | $testobj->assertFileEquals($e,$v,$msg); 84 | } 85 | 86 | function dump($e) 87 | { 88 | var_dump($e); 89 | ob_flush(); 90 | } 91 | 92 | 93 | --------------------------------------------------------------------------------