PHP
PHP
PHP
Contents
phpDocumentor Guide to Creating Fantastic Documentation
phpDocumentor Quickstart Source code for sample1.php Source code for sample2.php Source code for sample3.php phpDocumentor Tutorial Documentable PHP Elements phpDocumentor Tutorials phpDocumentor Manual phpDocumentor tags @abstract @access @author @category @copyright @deprecated @example @final @filesource @global @ignore @internal @license @link @method @name @package @param @property @return @see @since @static @staticvar @subpackage @todo @tutorial @uses @var @version phpDocumentor Inline tags inline {@example} inline {@id} 1 3 10 12 15 16 36 41 47 49 51 52 54 55 56 57 58 60 61 62 65 66 67 68 69 70 71 73 76 78 80 82 83 85 86 88 89 91 94 95 96 97 99
inline {@internal}} inline {@inheritdoc} inline {@link} inline {@source} inline {@toc} inline {@tutorial}
101 102 104 106 109 111 113 117 122 128 131 133 134 135 136 137 143 143 144 145 145 145 146 146 146 146 147 147 147 147 147 148 148 148 148 149 149 149 150 150 150 151 151 151 151 152
Converter Manual Using the PDFParser XML templating language Writing templates for the PDFdefault Converter Writing templates for the CHMdefault Converter Writing templates for the XMLDocBook Converter Writing templates for the HTMLSmarty Converter Writing templates for the HTMLframes Converter Package Converters Procedural Elements
Converter.inc Function adv_htmlentities
Var $path Var $pkg_elements Var $processSpecialRoots Var $quietmode Var $smarty_dir Var $sort_absolutely_everything Var $sort_page_contents_by_type Var $sourcePaths Var $subpackage Var $targetDir Var $templateDir Var $templateName Var $template_options Var $title Var $todoList Constructor Converter Method AttrToString Method Bolden Method Br Method checkState Method cleanup Method Convert Method convertClass Method convertConst Method convertDefine Method ConvertErrorLog Method convertFunction Method convertGlobal Method convertInclude Method convertMethod Method convertPage Method ConvertTitle Method ConvertTodoList Method convertTutorial Method convertVar Method Convert_RIC Method copyFile Method createParentDir Method EncloseList Method EncloseParagraph Method endClass Method endPage Method exampleProgramExample Method flushHighlightCache Method formatIndex Method formatLeftIndex Method formatPkgIndex Method formatTutorialTOC Method generateChildClassList
152 152 152 152 153 153 153 153 153 154 154 154 154 154 155 155 155 156 156 156 157 157 157 158 158 158 159 159 160 160 160 161 161 161 162 162 162 163 163 163 163 164 164 164 165 165 165 165 166
Method generateFormattedClassTree Method getClassesOnPage Method getClassLink Method getConstLink Method getConverterDir Method getCurrentPageLink Method getCurrentPageURL Method getDefineLink Method getFileSourceName Method getFileSourcePath Method getFormattedConflicts Method getFormattedDescMethods Method getFormattedDescVars Method getFormattedImplements Method getFormattedInheritedConsts Method getFormattedInheritedMethods Method getFormattedInheritedVars Method getFormattedMethodImplements Method getFormattedOverrides Method getFunctionLink Method getGlobalLink Method getGlobalValue Method getHighlightState Method getId Method getIncludeValue Method getLink Method getMethodLink Method getPageLink Method getSortedClassTreeFromClass Method getSourceLink Method getState Method getTutorialId Method getTutorialLink Method getTutorialTree Method getVarLink Method hasSourceCode Method hasTutorial Method highlightDocBlockSource Method highlightSource Method highlightTutorialSource Method Italicize Method Kbdize Method ListItem Method newSmarty Method Output Method postProcess Method prepareDocBlock Method PreserveWhiteSpace Method ProgramExample
166 167 167 167 168 168 168 168 169 169 169 169 170 170 170 171 171 172 172 172 173 173 173 173 174 174 175 176 176 178 178 178 179 180 180 181 181 181 181 182 182 182 183 183 183 184 184 184 185
Method returnLink Method returnSee Method Sampize Method setSourcePaths Method setTargetDir Method setTemplateBase Method setTemplateDir Method sortPageContentsByElementType Method sourceLine Method startHighlight Method TranslateEntity Method TranslateTag Method TutorialExample Method type_adjust Method unmangle Method vardump_tree Method Varize Method walk Method walk_everything Method writeExample Method writeFile Method writeSource Method _rmdir Method _setHighlightCache Method _tutorial_path CHMdefaultConverter.inc Class CHMdefaultConverter Var $base_dir Var $class_dir Var $current Var $currentclass Var $juststarted Var $KLinks Var $leftindex Var $name Var $outputformat Var $package_pages Var $page_dir Var $ric_set Var $sort_page_contents_by_type Var $wrote Constructor CHMdefaultConverter Method addHHP Method addKLink Method addSourceTOC Method addTOC Method convertClass Method convertConst Method convertDefine
185 185 186 186 186 187 187 187 188 188 188 188 189 189 189 190 190 190 191 191 192 192 193 193 193 194 194 195 195 195 195 196 196 196 196 196 196 197 197 197 197 197 198 198 198 199 199 199 200
Method ConvertErrorLog Method convertFunction Method convertGlobal Method convertInclude Method convertMethod Method convertPackagepage Method convertPage Method ConvertTodoList Method convertTutorial Method convertVar Method Convert_RIC Method copyMediaRecursively Method endClass Method endPage Method formatIndex Method formatLeftIndex Method formatPkgIndex Method formatTutorialTOC Method generateElementIndex Method generateFormattedClassTree Method generateFormattedClassTrees Method generateFormattedInterfaceTrees Method generateKLinks Method generatePkgElementIndex Method generatePkgElementIndexes Method generateTOC Method getCData Method getClassLink Method getConstLink Method getCurrentPageLink Method getDefineLink Method getExampleLink Method getFunctionLink Method getGlobalLink Method getId Method getIndexInformation Method getMethodLink Method getPageLink Method getPageName Method getRootTree Method getSourceAnchor Method getSourceLink Method getTutorialId Method getVarLink Method Output Method postProcess Method ProgramExample Method rcNatCmp Method rcNatCmp1
200 200 201 201 201 201 202 202 202 202 203 203 203 203 203 204 204 205 205 205 205 206 206 206 207 207 207 207 207 208 208 208 208 209 209 209 210 210 210 211 211 211 211 212 212 213 213 213 213
Method returnLink Method returnSee Method setTargetDir Method setTemplateDir Method SmartyInit Method sourceLine Method TutorialExample Method unmangle Method writeExample Method writefile Method writeNewPPage Method writeSource HTMLframesConverter.inc HTMLSmartyConverter.inc Class HTMLframesConverter Var $base_dir Var $class_dir Var $current Var $currentclass Var $juststarted Var $leftindex Var $name Var $outputformat Var $package_pages Var $page_dir Var $processSpecialRoots Var $ric_set Var $sort_page_contents_by_type Var $wrote Constructor HTMLframesConverter Method convertClass Method convertConst Method convertDefine Method ConvertErrorLog Method convertFunction Method convertGlobal Method convertInclude Method convertMethod Method convertPackagepage Method convertPage Method ConvertTodoList Method convertTutorial Method convertVar Method Convert_RIC Method copyMediaRecursively Method endClass Method endPage Method formatIndex Method formatLeftIndex
214 214 214 214 214 215 215 215 215 216 216 216 217 218 219 219 219 219 219 220 220 220 220 220 220 221 221 221 221 221 222 222 222 223 223 223 224 224 224 224 225 225 225 225 226 226 226 226 227
Method formatPkgIndex Method formatTutorialTOC Method generateElementIndex Method generateFormattedClassTree Method generateFormattedClassTrees Method generateFormattedInterfaceTrees Method generatePkgElementIndex Method generatePkgElementIndexes Method getCData Method getClassLink Method getConstLink Method getCurrentPageLink Method getDefineLink Method getExampleLink Method getFunctionLink Method getGlobalLink Method getId Method getIndexInformation Method getMethodLink Method getPageLink Method getPageName Method getRootTree Method getSourceAnchor Method getSourceLink Method getTutorialId Method getTutorialTree Method getVarLink Method makeLeft Method Output Method postProcess Method ProgramExample Method rcNatCmp Method rcNatCmp1 Method returnLink Method returnSee Method setTargetDir Method SmartyInit Method sourceLine Method TutorialExample Method unmangle Method writeExample Method writeNewPPage Method writeSource Class HTMLSmartyConverter Var $base_dir Var $class_dir Var $current Var $currentclass Var $juststarted
227 227 228 228 228 228 229 229 229 229 230 230 230 231 231 231 232 232 232 232 233 233 233 234 234 234 234 235 235 235 235 235 235 236 236 236 236 237 237 237 237 237 238 238 238 239 239 239 239
Var $leftindex Var $name Var $outputformat Var $package_pages Var $page_dir Var $processSpecialRoots Var $ric_set Var $sort_page_contents_by_type Var $wrote Constructor HTMLSmartyConverter Method convertClass Method convertConst Method convertDefine Method ConvertErrorLog Method convertFunction Method convertGlobal Method convertInclude Method convertMethod Method convertPackagepage Method convertPage Method ConvertTodoList Method convertTutorial Method convertVar Method Convert_RIC Method copyMediaRecursively Method endClass Method endPage Method formatIndex Method formatLeftIndex Method formatPkgIndex Method formatTutorialTOC Method generateElementIndex Method generateFormattedClassTree Method generateFormattedClassTrees Method generateFormattedInterfaceTrees Method generatePkgElementIndex Method generatePkgElementIndexes Method getCData Method getClassContents Method getClassLeft Method getClassLink Method getConstLink Method getCurrentPageLink Method getDefineLink Method getExampleLink Method getFunctionLink Method getGlobalLink Method getId Method getIndexInformation
239 239 239 239 240 240 240 240 240 240 241 241 241 242 242 242 243 243 243 244 244 244 244 245 245 245 245 245 246 246 247 247 247 247 248 248 248 249 249 249 249 249 249 250 250 250 250 251 251
Method getMethodLink Method getPageContents Method getPageLeft Method getPageLink Method getPageName Method getRootTree Method getSourceAnchor Method getSourceLink Method getTutorialId Method getTutorialList Method getTutorialTree Method getVarLink Method makeLeft Method Output Method postProcess Method ProgramExample Method rcNatCmp Method rcNatCmp1 Method returnLink Method returnSee Method setTargetDir Method SmartyInit Method sourceLine Method TutorialExample Method unmangle Method writeExample Method writeNewPPage Method writeRIC Method writeSource class.phpdocpdf.php ParserPDF.inc Define PHPDOCUMENTOR_PDF_EVENT_CONTENT Define PHPDOCUMENTOR_PDF_EVENT_FONT Define PHPDOCUMENTOR_PDF_EVENT_NEWPAGE Define PHPDOCUMENTOR_PDF_EVENT_PDFFUNCTION Define PHPDOCUMENTOR_PDF_EVENT_TEXT Define PHPDOCUMENTOR_PDF_STATE_CONTENT Define PHPDOCUMENTOR_PDF_STATE_FONT Define PHPDOCUMENTOR_PDF_STATE_NEWPAGE Define PHPDOCUMENTOR_PDF_STATE_PDFFUNCTION Define PHPDOCUMENTOR_PDF_STATE_TEXT PDFdefaultConverter.inc Class PDFdefaultConverter Var $classpackage_pagenums Var $curclasspackage Var $curpagepackage Var $leftindex Var $name Var $outputformat
251 252 252 252 252 252 253 253 253 253 253 253 254 254 254 254 254 255 255 255 255 256 256 256 256 257 257 257 257 258 259 259 259 260 260 260 260 260 260 260 260 261 262 262 262 262 262 262 262
Var $pagepackage_pagenums Var $pdf Var $ric_set Var $smarty_dir Var $sort_absolutely_everything Var $_sourcecode Constructor PDFdefaultConverter Method convertClass Method convertConst Method convertDefine Method convertDocBlock Method convertFunction Method convertGlobal Method convertInclude Method convertMethod Method convertPackagepage Method convertPage Method convertParams Method convertTutorial Method convertVar Method Convert_RIC Method generateFormattedClassTrees Method getCData Method getClassLink Method getConstLink Method getDefineLink Method getExampleLink Method getFileSourceName Method getFunctionLink Method getGlobalLink Method getGlobalValue Method getMethodLink Method getPageLink Method getPageName Method getRootTree Method getSourceAnchor Method getSourceLink Method getState Method getTutorialId Method getVarLink Method mystrnatcasecmp Method Output Method postProcess Method returnLink Method returnSee Method setTemplateDir Method TranslateTag Method unmangle Method writeExample
263 263 263 263 263 263 263 264 264 264 264 264 265 265 265 265 265 265 266 266 266 266 266 267 267 267 268 268 268 268 269 269 269 270 270 270 270 270 270 271 271 271 271 272 272 272 272 272 273
Method writeSource Class PDFParser Constructor PDFParser Method getParserEventName Method parse Method setupStates Class phpdocpdf Var $converter Var $font_dir Var $indents Var $indexContents Var $listType Var $reportContents Var $set_pageNumbering Var $_colorStack Var $_save Constructor phpdocpdf Method addMessage Method bullet Method dots Method ezNewPage Method ezOutput Method ezProcessText Method ezText Method getColor Method getYPlusOffset Method indent Method index Method IndexLetter Method orderedBullet Method rf Method setColorArray Method setHTMLColor Method setupTOC Method textcolor Method validHTMLColor Method _ezText XMLDocBookpeardoc2Converter.inc XMLDocBookConverter.inc Class XMLDocBookConverter Var $base_dir Var $category Var $class Var $class_data Var $class_dir Var $current Var $currentclass Var $function_data Var $juststarted
273 273 273 274 274 274 274 275 275 275 275 275 275 275 275 275 275 276 276 276 276 276 276 277 277 277 277 277 277 278 278 278 278 278 278 278 278 280 281 281 281 282 282 282 282 282 282 282 283
Var $leftindex Var $local Var $method_data Var $name Var $outputformat Var $package_pages Var $page Var $page_data Var $page_dir Var $path Var $sort_page_contents_by_type Var $sourceloc Var $template_options Constructor XMLDocBookConverter Method convertClass Method convertDefine Method ConvertErrorLog Method convertFunction Method convertGlobal Method convertInclude Method convertMethod Method convertPackagePage Method convertPage Method convertTutorial Method convertVar Method endClass Method endPage Method formatIndex Method formatLeftIndex Method formatPkgIndex Method generateElementIndex Method generateFormattedClassTree Method generateFormattedClassTrees Method generatePkgElementIndex Method generatePkgElementIndexes Method getCData Method getClassLink Method getDefineLink Method getFunctionLink Method getGlobalLink Method getId Method getLink Method getMethodLink Method getPageLink Method getPageName Method getRootTree Method getTutorialId Method getVarLink Method makeLeft
283 283 283 283 283 283 284 284 284 284 284 284 284 285 285 286 286 286 287 287 287 288 288 288 288 289 289 289 289 290 290 290 291 291 292 292 292 292 293 293 293 294 294 294 295 295 295 295 296
Method Output Method postProcess Method prepareDocBlock Method rcNatCmp Method rcNatCmp1 Method returnLink Method returnSee Method setTargetDir Method setTemplateDir Method SmartyInit Method type_adjust Method unmangle Method writeNewPPage Class XMLDocBookpeardoc2Converter Var $base_dir Var $category Var $class Var $class_data Var $class_dir Var $current Var $currentclass Var $function_data Var $juststarted Var $leftindex Var $local Var $method_data Var $name Var $outputformat Var $packagexml Var $package_pages Var $page Var $page_data Var $page_dir Var $path Var $processSpecialRoots Var $sort_absolutely_everything Var $sort_page_contents_by_type Var $sourceloc Var $template_options Var $_peardoc2_constants Var $_peardoc2_globals Var $_write_constants_xml Var $_write_globals_xml Constructor XMLDocBookpeardoc2Converter Method addSummaryToPackageXml Method Br Method convertClass Method convertDefine Method ConvertErrorLog
296 296 296 296 296 297 297 297 297 298 298 298 298 298 299 299 299 299 299 300 300 300 300 300 300 300 301 301 301 301 301 301 301 301 302 302 302 302 302 303 303 303 303 303 303 304 304 304 304
Method convertFunction Method convertGlobal Method convertInclude Method convertMethod Method convertPackagePage Method convertPage Method convertTutorial Method convertVar Method endClass Method exampleProgramExample Method flushPackageXml Method formatIndex Method formatLeftIndex Method formatPkgIndex Method generateChildClassList Method generateElementIndex Method generateFormattedClassTree Method generateFormattedClassTrees Method generateFormattedInterfaceTrees Method generatePkgElementIndex Method generatePkgElementIndexes Method getCData Method getClassLink Method getDefineLink Method getExampleLink Method getFunctionLink Method getGlobalLink Method getId Method getLink Method getMethodLink Method getPageLink Method getPageName Method getRootTree Method getSourceAnchor Method getTutorialId Method getVarLink Method makeLeft Method Output Method postProcess Method prepareDocBlock Method ProgramExample Method rcNatCmp Method rcNatCmp1 Method returnLink Method returnSee Method setTemplateDir Method type_adjust Method unmangle Method wordwrap
305 305 305 305 306 306 306 307 307 307 308 308 308 308 308 308 309 309 309 310 310 310 310 311 311 311 312 312 312 313 313 313 313 314 314 314 315 315 315 315 315 316 316 316 316 316 317 317 317
317 317 318 318 320 320 321 321 321 321 321 321 321 322 322 322 322 322 322 322 323 323 323 323 323 323 323 323 324 324 324 324 324 325 325 325 325 325 326 326 326 326 326 327 327 327 327 327
Var $checkpoint Var $currentBaseFont Var $currentColour Var $currentContents Var $currentFont Var $currentFontNum Var $currentLineStyle Var $currentNode Var $currentPage Var $currentStrokeColour Var $currentTextState Var $destinations Var $encrypted Var $encryptionKey Var $fileIdentifier Var $firstPageId Var $fontFamilies Var $fonts Var $infoObject Var $looseObjects Var $messages Var $nCallback Var $nStack Var $nStateStack Var $numFonts Var $numImages Var $numObj Var $numPages Var $objects Var $options Var $procsetObjectId Var $stack Var $stateStack Var $wordSpaceAdjust Constructor Cpdf Method addDestination Method addImage Method addInfo Method addInternalLink Method addJpegFromFile Method addLink Method addMessage Method addObject Method addPngFromFile Method addText Method addTextWrap Method ARC4 Method ARC4_init Method checkAllHere
327 328 328 328 328 328 328 328 329 329 329 329 329 329 329 330 330 330 330 330 330 330 331 331 331 331 331 331 331 332 332 332 332 332 332 333 333 333 334 334 334 334 335 335 335 335 336 336 336
Method closeObject Method curve Method ellipse Method encryptInit Method filledEllipse Method filledRectangle Method getFirstPageId Method getFontDecender Method getFontHeight Method getTextWidth Method line Method md5_16 Method newPage Method openHere Method openObject Method output Method o_action Method o_annotation Method o_catalog Method o_contents Method o_destination Method o_encryption Method o_font Method o_fontDescriptor Method o_fontEncoding Method o_image Method o_info Method o_outlines Method o_page Method o_pages Method o_procset Method o_viewerPreferences Method partEllipse Method polygon Method rectangle Method reopenObject Method restoreState Method saveState Method selectFont Method setColor Method setEncryption Method setFontFamily Method setLineStyle Method setPreferences Method setStrokeColor Method stopObject Method stream Method transaction
336 336 337 337 338 338 338 338 339 339 339 339 339 340 340 340 340 341 341 341 341 342 342 342 342 343 343 343 343 344 344 344 344 345 345 345 345 346 346 346 347 347 347 348 348 348 348 349 351
351 352 353 353 353 353 354 354 354 354 355 355 355 356 356 356 356 356 357 357 357 357 358 358 358 358 358 359 359 359 360 360 360 360 360 360 361 361 361 361 361 361 362 362 365 365 365 367
Config_File.class.php Smarty.class.php Define DIR_SEP Define SMARTY_DIR Define SMARTY_PHP_ALLOW Define SMARTY_PHP_PASSTHRU Define SMARTY_PHP_QUOTE Define SMARTY_PHP_REMOVE Smarty_Compiler.class.php
367 368 368 368 369 369 369 369 370 371 371 371 371 371 372 372 372 372 372 373 373 373 373 373 374 374 374 375 375 375 375 375 376 376 376 376 376 377 377 377 377 377 377 378 378 378 378 379 379
Var $force_compile Var $global_assign Var $left_delimiter Var $php_handling Var $plugins_dir Var $request_use_auto_globals Var $request_vars_order Var $right_delimiter Var $secure_dir Var $security Var $security_settings Var $template_dir Var $trusted_dir Var $undefined Var $use_sub_dirs Constructor Smarty Method append Method append_by_ref Method assign Method assign_by_ref Method clear_all_assign Method clear_all_cache Method clear_assign Method clear_cache Method clear_compiled_tpl Method clear_config Method config_load Method display Method fetch Method get_config_vars Method get_registered_object Method get_template_vars Method is_cached Method load_filter Method register_block Method register_compiler_function Method register_function Method register_modifier Method register_object Method register_outputfilter Method register_postfilter Method register_prefilter Method register_resource Method template_exists Method trigger_error Method unregister_block Method unregister_compiler_function Method unregister_function Method unregister_modifier
379 379 380 380 380 380 381 381 381 381 381 382 382 382 382 382 383 383 383 383 384 384 384 384 384 385 385 385 385 386 386 386 386 386 387 387 387 388 388 388 388 388 389 389 389 389 390 390 390
Method unregister_object Method unregister_outputfilter Method unregister_postfilter Method unregister_prefilter Method unregister_resource Method _compile_resource Method _compile_source Method _dequote Method _eval Method _fetch_resource_info Method _get_auto_filename Method _get_auto_id Method _get_compile_path Method _get_plugin_filepath Method _include Method _is_compiled Method _parse_resource_name Method _process_compiled_include_callback Method _read_file Method _run_mod_handler Method _smarty_cache_attrs Method _smarty_include Method _trigger_fatal_error Method _unlink Class Smarty_Compiler Constructor Smarty_Compiler Method _add_plugin Method _compile_arg_list Method _compile_block_tag Method _compile_capture_tag Method _compile_compiler_tag Method _compile_custom_tag Method _compile_file Method _compile_foreach_start Method _compile_if_tag Method _compile_include_php_tag Method _compile_include_tag Method _compile_insert_tag Method _compile_plugin_call Method _compile_registered_object_tag Method _compile_section_start Method _compile_smarty_ref Method _compile_tag Method _expand_quoted_text Method _load_filters Method _parse_attrs Method _parse_conf_var Method _parse_is_expr Method _parse_modifiers
390 390 391 391 391 391 391 392 392 392 393 393 393 393 394 394 394 394 395 395 395 395 396 396 396 396 397 397 397 397 398 398 398 398 399 399 399 399 399 400 400 400 400 401 401 401 401 401 402
Method _parse_parenth_args Method _parse_section_prop Method _parse_var Method _parse_vars_props Method _parse_var_props Method _pop_cacheable_state Method _push_cacheable_state Method _quote_replace Method _syntax_error core.assemble_plugin_filepath.php Function smarty_core_assemble_plugin_filepath core.assign_smarty_interface.php Function smarty_core_assign_smarty_interface core.create_dir_structure.php Function smarty_core_create_dir_structure core.display_debug_console.php Function smarty_core_display_debug_console core.get_include_path.php Function smarty_core_get_include_path core.get_microtime.php Function smarty_core_get_microtime core.get_php_resource.php Function smarty_core_get_php_resource core.is_secure.php Function smarty_core_is_secure core.is_trusted.php Function smarty_core_is_trusted core.load_plugins.php Function smarty_core_load_plugins core.load_resource_plugin.php Function smarty_core_load_resource_plugin core.process_cached_inserts.php Function smarty_core_process_cached_inserts core.process_compiled_include.php Function smarty_core_process_compiled_include core.read_cache_file.php Function smarty_core_read_cache_file core.rmdir.php Function smarty_core_rmdir core.rm_auto.php Function smarty_core_rm_auto core.run_insert_handler.php Function smarty_core_run_insert_handler core.smarty_include_php.php Function smarty_core_smarty_include_php core.write_cache_file.php Function smarty_core_write_cache_file core.write_compiled_include.php Function smarty_core_write_compiled_include
402 402 402 403 403 403 403 403 404 405 405 406 406 407 407 408 408 409 409 410 410 411 411 412 412 413 413 414 414 415 415 416 416 417 417 418 418 419 419 420 420 421 421 422 422 423 423 424 424
core.write_compiled_resource.php Function smarty_core_write_compiled_resource core.write_file.php Function smarty_core_write_file block.strip.php Function smarty_block_strip block.textformat.php Function smarty_block_textformat function.assign.php Function smarty_function_assign function.assign_debug_info.php Function smarty_function_assign_debug_info function.config_load.php Function smarty_function_config_load function.counter.php Function smarty_function_counter function.cycle.php Function smarty_function_cycle function.debug.php Function smarty_function_debug function.eval.php Function smarty_function_eval function.fetch.php Function smarty_function_fetch function.html_checkboxes.php Function smarty_function_html_checkboxes Function smarty_function_html_checkboxes_output function.html_image.php Function smarty_function_html_image function.html_options.php Function smarty_function_html_options Function smarty_function_html_options_optgroup Function smarty_function_html_options_optoutput function.html_radios.php Function smarty_function_html_radios Function smarty_function_html_radios_output function.html_select_date.php Function smarty_function_html_select_date function.html_select_time.php Function smarty_function_html_select_time function.html_table.php Function smarty_function_html_table Function smarty_function_html_table_cycle function.mailto.php Function smarty_function_mailto function.math.php Function smarty_function_math function.popup.php Function smarty_function_popup
425 425 426 426 427 427 428 428 429 429 430 430 431 431 432 432 433 433 435 435 436 436 437 437 438 438 439 440 440 442 442 442 443 444 444 445 446 446 448 448 449 449 450 451 451 453 453 454 454
function.popup_init.php Function smarty_function_popup_init function.var_dump.php Function smarty_function_var_dump modifier.capitalize.php Function smarty_modifier_capitalize modifier.cat.php Function smarty_modifier_cat modifier.count_characters.php Function smarty_modifier_count_characters modifier.count_paragraphs.php Function smarty_modifier_count_paragraphs modifier.count_sentences.php Function smarty_modifier_count_sentences modifier.count_words.php Function smarty_modifier_count_words modifier.date_format.php Function smarty_modifier_date_format modifier.debug_print_var.php Function smarty_modifier_debug_print_var modifier.default.php Function smarty_modifier_default modifier.escape.php Function smarty_modifier_escape modifier.htmlentities.php Function smarty_modifier_htmlentities modifier.indent.php Function smarty_modifier_indent modifier.lower.php Function smarty_modifier_lower modifier.nl2br.php Function smarty_modifier_nl2br modifier.rawurlencode.php Function smarty_modifier_rawurlencode modifier.regex_replace.php Function smarty_modifier_regex_replace modifier.replace.php Function smarty_modifier_replace modifier.spacify.php Function smarty_modifier_spacify modifier.string_format.php Function smarty_modifier_string_format modifier.strip.php Function smarty_modifier_strip modifier.strip_tags.php Function smarty_modifier_strip_tags modifier.truncate.php Function smarty_modifier_truncate modifier.upper.php
455 455 456 456 457 457 458 458 459 459 460 460 461 461 462 462 463 463 464 464 465 465 466 466 467 467 468 468 469 469 470 470 471 471 472 472 473 473 474 474 475 475 476 476 477 477 478 478 479
Function smarty_modifier_upper modifier.wordwrap.php Function smarty_modifier_wordwrap outputfilter.trimwhitespace.php Function smarty_outputfilter_trimwhitespace Function smarty_outputfilter_trimwhitespace_replace shared.escape_special_chars.php Function smarty_function_escape_special_chars shared.make_timestamp.php Function smarty_make_timestamp
479 480 480 481 481 481 483 483 484 484 486 486 486 486 487 487 488 488 488 489 489 489 489 489 489 489 490 490 490 490 491 491 491 492 492 493 493 494 494 495 495 496 496 497 497 497 498 498 499
bug-553137.php Function func1 Function func2 Function func3 bug-554712.php Function passbyref Function returnsme bug-557861.php bug-558031.php Function test_558031 bug-558051.php Function one bug-559467.php Define CONSTANT1 Define CONSTANT2 bug-559494.php bug-559668.php Config Global Variable $_MLIB_GLOBAL_DSN Define MLIB_GLOBAL_DEBUG Define MLIB_INCLUDE_PATH Define MLIB_LOG_FILE Define MLIB_SYSLOG_PRIORITY Define MLIB_TEMPLATE_PATH Define MLIB_USE_SYSLOG bug-560578.php bug-560595.php Define one bug-562997.php Define PDERROR_MULTIPLE_PARENT bug-566200.php Function ezStartPageNumbers bug-566600.php Function a bug-567059.php Function aa_567059 bug-645588.php Function globalGetVar Function globalSetVar bug-698356.php Function bug698356_Output bug-authoremail.php Function test_authoremail bug-defineparse.php Define SMART_PATH_DELIMITER bug-eofquotes.php Function test_eofquotes bug-escaping.php Function test_escape
500 500 500 500 501 501 501 502 503 503 504 504 505 505 505 506 507 508 508 508 509 509 509 509 510 513 514 514 515 515 516 516 517 517 518 518 519 519 519 521 521 522 522 523 523 524 524 525 525
Function test_escape2 bug-loseprocedural.php Function test Function test2 bug-pageleveldocsblocks.php Function dummy bug-quote_new_parser.php Global Variable $bqnp_tester Define bqnp_tester Function bqnp_testie bug-shortdesc.php Define testContantBlah Define testContantBlah2 Define testContantBlah3 Define testContantBlah4 Define testContantBlah5
525 526 526 526 527 527 528 528 528 528 529 529 529 529 529 529 530 530 530 530 530 530 531 531 531 531 531 531 532 532 532 532 533 533 533 533 533 534 534 534 534 535 535 535 536 536 536 536 537
Method _PHPDOCUMENTOR_DEBUG Class ctest Var $t1 Var $t3 Constructor ctest Method btest Class few Var $pfh Class functionincomment Method process Class iConverter Method walk Class iHTMLConverter Method Convert Class iiparserBase Var $type Var $value Method getType Method getValue Method setValue Class iNewRender Var $classpackage Var $classpackages Var $classsubpackage Var $classtree Var $class_children Var $data Var $elements Var $event_handlers Var $links Var $methods Var $packageoutput Var $pages Var $parsePrivate Var $pkg_elements Var $private_class Var $quietMode Var $targetDir Var $vars Class iParser Class iparserElement Class kiddie_b587733 Constructor kiddie_b587733 Class mama Class metoo Var $mine Class multipl Var $manyvars Method func
537 538 538 538 538 538 538 539 539 539 539 540 540 541 541 542 542 542 542 542 542 542 543 543 543 543 544 544 544 544 545 545 545 546 546 546 546 546 547 547 547 548 548 548 548 548 549 549 549
Class parent_b587733 549 Class priv1 549 Class RecordWarning 550 Class summary_form 550 Var $dp 550 Method blah 550 Method get_header2 550 Class test 551 Class test2 551 Class testarraybug 551 Var $arrayType 552 Var $arrayType1 552 Var $myarrayName 552 Var $myarrayName1 552 Class testClass 552 Constructor testClass 552 Class testme 552 Var $me 553 bug-541886.php 554 Class test_541886 554 Class notseen 554 HighlightParserGetInlineTagsTests.php 555 IntermediateParserAddPrivatePageTests.php 557 ParserClassGetSourceLocationTests.php 559 ParserPageGetSourceLocationTests.php 561 phpDocumentorSetupCleanConverterNamePieceTests.php 563 phpDocumentorSetupDecideOnOrOffTests.php 565 Define PHPDOCUMENTOR_BASE 565 Define PHPUnit_MAIN_METHOD 565 phpDocumentorTParserGetInlineTagsTests.php 567 Class tests_HighlightParserGetInlineTagsTests 568 Method main 568 Method setUp 568 Method tearDown 569 Method testShowCorrectBehaviorWhenGivenOneEmptyArg 569 Method testShowCorrectBehaviorWhenGivenOneEmptyArgAndFalse 569 Method testShowCorrectBehaviorWhenGivenOneEmptyArgAndTrue 569 Class tests_IntermediateParserAddPrivatePageTests 570 Method main 570 Method setUp 570 Method tearDown 571 Method testShowCorrectBehaviorWhenPrivatePageArrayIsEmpty 571 Method testShowCorrectBehaviorWhenPrivatePageArrayIsNotAlreadyEmpty 571 Class tests_ParserClassGetSourceLocationTests 572 Method main 572 Method setUp 572 Method tearDown 572 Method testWhenLocationNotSetAndPearizeFalse 573 Method testWhenLocationNotSetAndPearizeNull 573
Method testWhenLocationNotSetAndPearizeTrue Method testWhenNonPearLocationSetAndPearizeFalse Method testWhenNonPearLocationSetAndPearizeNull Method testWhenNonPearLocationSetAndPearizeTrue Method testWhenNonPearLocationSetIncludingDotsAndPearizeFalse Method testWhenNonPearLocationSetIncludingDotsAndPearizeNull Method testWhenNonPearLocationSetIncludingDotsAndPearizeTrue Method testWhenNonPearRelativeLocationSetAndPearizeFalse Method testWhenNonPearRelativeLocationSetAndPearizeNull Method testWhenNonPearRelativeLocationSetAndPearizeTrue Method testWhenPearLocationSetAndPearizeFalse Method testWhenPearLocationSetAndPearizeNull Method testWhenPearLocationSetAndPearizeTrue Method testWhenPearLocationSetIncludingDotsAndPearizeFalse Method testWhenPearLocationSetIncludingDotsAndPearizeNull Method testWhenPearLocationSetIncludingDotsAndPearizeTrue Method testWhenPearRelativeLocationSetAndPearizeFalse Method testWhenPearRelativeLocationSetAndPearizeNull Method testWhenPearRelativeLocationSetAndPearizeTrue Class tests_ParserPageGetSourceLocationTests Method main Method setUp Method tearDown Method testWhenLocationNotSetAndPearizeFalse Method testWhenLocationNotSetAndPearizeNull Method testWhenLocationNotSetAndPearizeTrue Method testWhenNonPearLocationSetAndPearizeFalse Method testWhenNonPearLocationSetAndPearizeNull Method testWhenNonPearLocationSetAndPearizeTrue Method testWhenNonPearLocationSetIncludingDotsAndPearizeFalse Method testWhenNonPearLocationSetIncludingDotsAndPearizeNull Method testWhenNonPearLocationSetIncludingDotsAndPearizeTrue Method testWhenNonPearRelativeLocationSetAndPearizeFalse Method testWhenNonPearRelativeLocationSetAndPearizeNull Method testWhenNonPearRelativeLocationSetAndPearizeTrue Method testWhenPearLocationSetAndPearizeFalse Method testWhenPearLocationSetAndPearizeNull Method testWhenPearLocationSetAndPearizeTrue Method testWhenPearLocationSetIncludingDotsAndPearizeFalse Method testWhenPearLocationSetIncludingDotsAndPearizeNull Method testWhenPearLocationSetIncludingDotsAndPearizeTrue Method testWhenPearRelativeLocationSetAndPearizeFalse Method testWhenPearRelativeLocationSetAndPearizeNull Method testWhenPearRelativeLocationSetAndPearizeTrue Class tests_phpDocumentorSetupCleanConverterNamePieceTests Method main Method setUp Method tearDown Method testDoNotAllowTruePathingOnPrimaryWithOneArg
573 574 574 574 575 575 575 575 576 576 576 577 577 577 578 578 578 578 579 579 579 580 580 580 580 581 581 581 582 582 582 583 583 583 584 584 584 585 585 585 585 586 586 586 587 587 587 588 588
Method testDoNotAllowTruePathingOnPrimaryWithTwoArgs Method testDoNotAllowTruePathingOnSecondary Method testDoNotAllowTruePathingOnTertiary Method testExtremeExampleAndInvalidSecondary Method testExtremeExampleAndInvalidTertiaryA Method testExtremeExampleAndInvalidTertiaryB Method testExtremeExampleButValidPrimaryWithOneArg Method testExtremeExampleButValidPrimaryWithTwoArgs Method testExtremeExampleButValidSecondary Method testNormalSecondaryDefault Method testNormalSecondaryDocbookPeardoc2 Method testNormalSecondaryFrames Method testNormalSecondarySmarty Method testNormalTertiaryDefault Method testNormalTertiaryDomDefault Method testNormalTertiaryDomEarthli Method testNormalTertiaryDomL0l33t Method testNormalTertiaryDomPhpdocde Method testNormalTertiaryDomPhphtmllib Method testNormalTertiaryEarthli Method testNormalTertiaryHands Method testNormalTertiaryL0l33t Method testNormalTertiaryPear Method testNormalTertiaryPhp Method testNormalTertiaryPhpdocde Method testNormalTertiaryPhphtmllib Method testNormalWithOneArgPrimaryCHM Method testNormalWithOneArgPrimaryHTML Method testNormalWithOneArgPrimaryPDF Method testNormalWithOneArgPrimaryXML Method testNormalWithTwoArgsPrimaryCHM Method testNormalWithTwoArgsPrimaryHTML Method testNormalWithTwoArgsPrimaryPDF Method testNormalWithTwoArgsPrimaryXML Method testPreventUpToParentPathingOnPrimaryWithOneArg Method testPreventUpToParentPathingOnPrimaryWithTwoArgs Method testPreventUpToParentPathingOnSecondary Method testPreventUpToParentPathingOnTertiary Method testUserDefinedTertiaryValue Class tests_phpDocumentorSetupDecideOnOrOffTests Method main Method setUp Method tearDown Method testBasicOff Method testBasicOn Method testFuzzyEmpty Method testFuzzyFalseA Method testFuzzyFalseB Method testFuzzyFalseC
588 589 589 589 590 590 590 591 591 591 591 592 592 592 593 593 593 594 594 594 595 595 595 595 596 596 596 597 597 597 598 598 598 599 599 599 600 600 600 601 601 601 601 602 602 602 602 603 603
Method testFuzzyNoA Method testFuzzyNoB Method testFuzzyNoC Method testFuzzyOffA Method testFuzzyOffB Method testFuzzyOnA Method testFuzzyOnB Method testFuzzyOne Method testFuzzyTrueA Method testFuzzyTrueB Method testFuzzyTrueC Method testFuzzyYesA Method testFuzzyYesB Method testFuzzyYesC Method testFuzzyYesD Method testFuzzyYesE Method testFuzzyZero Method testUnexpectedGreatLiterature Method testUnexpectedLargeNumber Method testUnexpectedNegative Method testUnexpectedNull Method testUnexpectedSpaces Class tests_phpDocumentorTParserGetInlineTagsTests Method main Method setUp Method tearDown Method testShowCorrectBehaviorInlineExampleWhenParsePrivateOff Method testShowCorrectBehaviorInlineExampleWhenParsePrivateOn Method testShowCorrectBehaviorInlineInternalWhenParsePrivateOff Method testShowCorrectBehaviorInlineInternalWhenParsePrivateOn Method testShowCorrectBehaviorInlineLinkWhenParsePrivateOff Method testShowCorrectBehaviorInlineLinkWhenParsePrivateOn Method testShowCorrectBehaviorInlineSourceWhenParsePrivateOff Method testShowCorrectBehaviorInlineSourceWhenParsePrivateOn Method testShowCorrectBehaviorInlineTutorialWhenParsePrivateOff Method testShowCorrectBehaviorInlineTutorialWhenParsePrivateOn Class bug_556894_base Var $test Method test Class bug_556894_sub1 Class bug_556894_sub2
603 603 604 604 604 604 605 605 605 605 605 606 606 606 606 607 607 607 607 608 608 608 608 609 609 609 610 610 610 611 611 611 611 612 612 612 613 613 613 613 614 616 616 617 617 617 619 619
builder.php config.php utilities.php Function getDir Function htmlArraySelect Function recurseDir Function showImage Function switchDirTree Function vdump_par top.php new_phpdoc.php phpdoc.php Classes.inc clone.inc.php Function phpDocumentor_clone clone5.inc.php common.inc.php Function debug Function fancy_debug Define PATH_DELIMITER Function phpDocumentor_ConfigFileList Function phpDocumentor_get_class Function phpDocumentor_parse_ini_file Define PHPDOCUMENTOR_VER Define PHPDOCUMENTOR_WEBSITE Define PHPDOCUMENTOR_WINDOWS Define SMART_PATH_DELIMITER Define tokenizer_ext Define _IN_PHP5 EventStack.inc IntermediateParser.inc Io.inc Function get_include_path Function Ioinc_mystrucsort Function Ioinc_sortfiles Function setup_dirs Function set_dir ParserDescCleanup.inc Define PHPDOCUMENTOR_PDP_EVENT_B Define PHPDOCUMENTOR_PDP_EVENT_BR Define PHPDOCUMENTOR_PDP_EVENT_CODE Define PHPDOCUMENTOR_PDP_EVENT_DOUBLECR Define PHPDOCUMENTOR_PDP_EVENT_ESCAPE Define PHPDOCUMENTOR_PDP_EVENT_ESCAPE_CODE Define PHPDOCUMENTOR_PDP_EVENT_ESCAPE_PRE Define PHPDOCUMENTOR_PDP_EVENT_I Define PHPDOCUMENTOR_PDP_EVENT_KBD Define PHPDOCUMENTOR_PDP_EVENT_LIST Define PHPDOCUMENTOR_PDP_EVENT_P
621 623 625 625 625 626 626 626 626 628 629 630 631 632 632 634 635 635 636 636 636 636 637 637 637 637 637 637 637 638 639 640 640 640 641 641 641 643 643 644 644 644 644 644 644 644 644 645 645
Define PHPDOCUMENTOR_PDP_EVENT_PRE Define PHPDOCUMENTOR_PDP_EVENT_SAMP Define PHPDOCUMENTOR_PDP_EVENT_SIMLIST Define PHPDOCUMENTOR_PDP_EVENT_VAR Define PHPDOCUMENTOR_PDP_STATE_B Define PHPDOCUMENTOR_PDP_STATE_BR Define PHPDOCUMENTOR_PDP_STATE_CODE Define PHPDOCUMENTOR_PDP_STATE_DOUBLECR Define PHPDOCUMENTOR_PDP_STATE_ESCAPE Define PHPDOCUMENTOR_PDP_STATE_ESCAPE_CODE Define PHPDOCUMENTOR_PDP_STATE_ESCAPE_PRE Define PHPDOCUMENTOR_PDP_STATE_I Define PHPDOCUMENTOR_PDP_STATE_KBD Define PHPDOCUMENTOR_PDP_STATE_LIST Define PHPDOCUMENTOR_PDP_STATE_P Define PHPDOCUMENTOR_PDP_STATE_PRE Define PHPDOCUMENTOR_PDP_STATE_SAMP Define PHPDOCUMENTOR_PDP_STATE_SIMLIST Define PHPDOCUMENTOR_PDP_STATE_VAR phpdoc.inc ProceduralPages.inc Publisher.inc Setup.inc.php Global Variable $interface Global Variable $phpDocumentor_DefaultCategoryName Global Variable $phpDocumentor_DefaultPackageName Global Variable $_phpDocumentor_setting Function checkForBugCondition Function decideOnOrOff Function phpDocumentor_out HighlightParserTests.php IntermediateParserTests.php ParserClassTests.php ParserPageTests.php phpDocumentorSetupTests.php phpDocumentorTParserTests.php Define PHPUnit_MAIN_METHOD
645 645 645 645 645 645 645 646 646 646 646 646 646 646 646 647 647 647 647 648 649 650 651 651 651 652 652 652 652 654 655 656 657 658 659 660 660 661 661 661 662 662 662 663 663 663 664 664 664
Method getDefiniteChildren Method getParentClass Method getRoots Method Inherit Method nextFile Method processChild Method setClassParent Class EventStack Var $num Var $stack Method getEvent Method popEvent Method pushEvent Class Io Var $ignore Var $phpDocOptions Var $valid_booleans Constructor Io Method checkIgnore Method dirList Method displayHelpMsg Method getAllFiles Method getBase Method getDirTree Method getReadmeInstallChangelog Method getRegExpableSearchString Method getTutorials Method isIncludeable Method parseArgv Method readPhpFile Method removeNonMatches Method _setupIgnore Class phpDocumentor_IntermediateParser Var $all_packages Var $classes Var $converters Var $cur_class Var $data Var $db_template Var $event_handlers Var $last Var $lasttype Var $packagecategories Var $packageoutput Var $package_pages Var $package_parents Var $pages Var $parsePrivate Var $privatepages
664 665 665 665 666 666 667 667 668 668 668 668 668 668 669 669 669 669 670 670 670 670 671 671 672 672 672 672 673 673 673 674 674 675 675 675 676 676 676 676 677 677 677 678 678 678 679 679 679
Var $private_class Var $proceduralpages Var $quietMode Var $ric Var $targetDir Var $templateBase Var $title Var $type Var $undocumentedElementWarnings Var $uses Constructor phpDocumentor_IntermediateParser Method addConverter Method addElementToPage Method addPackageParent Method addPage Method addPageIfNecessary Method addPrivatePage Method addUses Method ClasselementCmp Method Convert Method elementCmp Method handleClass Method handleConst Method handleDefine Method handleDocBlock Method HandleEvent Method handleFunction Method handleGlobal Method handleInclude Method handleMethod Method handlePackagePage Method handlePage Method handleTutorial Method handleVar Method Output Method parsePackagePage Method setParsePrivate Method setQuietMode Method setTargetDir Method setTemplateBase Method setUndocumentedElementWarningsMode Method _guessPackage Class phpDocumentor_setup Var $dirs Var $files Var $hidden Var $ignoresymlinks Var $ignore_files Var $packages
679 680 680 680 681 681 681 681 682 682 682 682 683 683 683 684 684 684 685 685 686 686 686 687 687 688 688 689 689 689 690 690 690 691 691 692 692 692 692 693 693 693 694 694 694 695 695 695 695
Var $parse Var $render Var $setup Constructor phpDocumentor_setup Method checkIgnoreTag Method createDocs Method parseHiddenFiles Method parseIni Method readCommandLineSettings Method readConfigFile Method setDirectoriesToParse Method setFilesToParse Method setIgnore Method setJavadocDesc Method setMemoryLimit Method setPackageOutput Method setParsePrivate Method setQuietMode Method setTargetDir Method setTemplateBase Method setTitle Method setUndocumentedElementWarnings Class ProceduralPages Var $curfile Var $defineconflicts Var $definesbyfile Var $definesbynamefile Var $functionconflicts Var $functionsbyfile Var $functionsbynamefile Var $globalconflicts Var $globalsbyfile Var $globalsbynamefile Var $ignorepages Var $includesbyfile Var $pageclasspackages Var $pageconflicts Var $pagepackages Var $pages Var $pathpages Method addClassPackageToFile Method addDefine Method addFunction Method addGlobal Method addInclude Method addPage Method addPagePackage Method getPathInfo Method getRealPath
695 695 696 696 696 696 696 696 697 697 697 697 697 697 697 698 698 698 698 698 698 698 699 699 699 700 700 700 701 701 701 702 702 702 702 703 703 703 704 704 704 704 705 705 705 705 705 706 706
Method ignorePage Method pathMatchesParsedFile Method replaceElement Method setName Method setParseBase Method setupPagePackages Method setupPages Class Publisher Var $popEvent Var $pushEvent Var $subscriber Var $tokens Method publishEvent Method subscribe Class tests_HighlightParserTests Method main Method suite Class tests_IntermediateParserTests Method main Method suite Class tests_ParserClassTests Method main Method suite Class tests_ParserPageTests Method main Method suite Class tests_phpDocumentorSetupTests Method main Method suite Class tests_phpDocumentorTParserTests Method main Method suite DescHTML.inc Class parserB Method Convert Class parserBr Method Convert Class parserCode Method Convert Class parserDescVar Method Convert Class parserI Method Convert Class parserKbd Method Convert Class parserList Var $items Var $numbered Constructor parserList
706 707 707 707 707 707 708 708 709 709 709 709 709 709 710 710 710 711 711 711 711 711 712 712 712 712 712 713 713 713 713 713 715 716 716 717 717 718 718 718 719 719 720 720 721 721 721 722 722
Method addItem Method addList Method Convert Class parserPre Method Convert Class parserSamp Method Convert DocBlockTags.inc Class parserAccessTag Var $isvalid Var $keyword Constructor parserAccessTag Method Convert Method getString Class parserExampleTag Var $keyword Constructor parserExampleTag Method ConvertSource Method getSourceLink Class parserFileSourceTag Var $keyword Var $path Var $source Constructor parserFileSourceTag Method Convert Method ConvertSource Method getSourceLink Method writeSource Class parserLicenseTag Var $keyword Constructor parserLicenseTag Class parserLinkTag Var $keyword Constructor parserLinkTag Class parserMethodTag Var $keyword Var $returnType Class parserNameTag Var $keyword Constructor parserNameTag Method Convert Class parserParamTag Var $keyword Class parserPropertyReadTag Var $keyword Class parserPropertyTag Var $keyword Var $returnType Constructor parserPropertyTag
722 722 722 723 723 724 724 725 726 726 726 726 727 727 727 728 728 728 729 729 729 730 730 730 730 730 731 731 732 732 732 732 733 733 733 734 734 734 735 735 735 735 736 736 736 737 737 737 737
Class parserPropertyWriteTag Var $keyword Class parserReturnTag Var $converted_returnType Var $keyword Var $returnType Constructor parserReturnTag Method Convert Class parserSeeTag Var $keyword Constructor parserSeeTag Method Convert Class parserStaticvarTag Var $keyword Class parserTag Var $keyword Var $type Constructor parserTag Method Convert Method getString Method HandleEvent Class parserTutorialTag Var $keyword Method Convert Class parserUsedByTag Var $keyword Constructor parserUsedByTag Method Convert Class parserUsesTag Var $keyword Constructor parserUsesTag Method Convert Method getDescription Class parserVarTag Var $keyword Var $returnType Errors.inc Global Variable $phpDocumentor_errors Global Variable $phpDocumentor_error_descrip Global Variable $phpDocumentor_warning_descrip Function addError Function addErrorDie Function addWarning Define PDERROR_ACCESS_WRONG_PARAM Define PDERROR_BEAUTIFYING_FAILED Define PDERROR_CANNOT_EXTEND_SELF Define PDERROR_CANT_HAVE_INLINE_IN_TAGNAME Define PDERROR_CANT_NEST_IN_B Define PDERROR_CHILD_TUTORIAL_NOT_FOUND
738 738 738 739 739 739 740 740 740 741 741 741 741 742 742 743 743 743 743 744 744 744 745 745 746 746 746 746 747 747 747 748 748 748 749 749 750 750 754 756 756 756 757 757 757 757 758 758 758
Define PDERROR_CLASS_CONFLICT Define PDERROR_CLASS_EXISTS Define PDERROR_CLASS_NOT_IN_PACKAGE Define PDERROR_CLASS_PARENT_NOT_FOUND Define PDERROR_CONVERTER_NOT_FOUND Define PDERROR_CONVERTER_OVR_GFCT Define PDERROR_DANGEROUS_PHP_BUG_EXISTS Define PDERROR_DB_TEMPLATE_UNTERMINATED Define PDERROR_DOCBLOCK_CONFLICT Define PDERROR_DOCBLOCK_GOES_CLASS Define PDERROR_DUMB_USES Define PDERROR_ELEMENT_IGNORED Define PDERROR_EMPTY_EXAMPLE_TITLE Define PDERROR_EXAMPLE_NOT_FOUND Define PDERROR_FUNCTION_HAS_NONAME Define PDERROR_GLOBAL_NOT_FOUND Define PDERROR_ID_MUST_BE_INLINE Define PDERROR_IGNORE_TAG_IGNORED Define PDERROR_ILLEGAL_PACKAGENAME Define PDERROR_INHERITANCE_CONFLICT Define PDERROR_INHERITDOC_DONT_WORK_HERE Define PDERROR_INLINETAG_IN_SEE Define PDERROR_INTERNAL_NOT_CLOSED Define PDERROR_INVALID_VALUES Define PDERROR_LOOP_RECURSION_LIMIT_REACHED Define PDERROR_MALFORMED_GLOBAL_TAG Define PDERROR_MALFORMED_TAG Define PDERROR_MISSING_PROPERTY_TAG_NAME Define PDERROR_MULTIPLE_ACCESS_TAGS Define PDERROR_MULTIPLE_CATEGORY_TAGS Define PDERROR_MULTIPLE_GLOBAL_TAGS Define PDERROR_MULTIPLE_NAME_TAGS Define PDERROR_MULTIPLE_PACKAGE_TAGS Define PDERROR_MULTIPLE_PARENT Define PDERROR_MULTIPLE_RETURN_TAGS Define PDERROR_MULTIPLE_SUBPACKAGE_TAGS Define PDERROR_MULTIPLE_VAR_TAGS Define PDERROR_NAME_ALIAS_SAME_AS_TARGET Define PDERROR_NEED_WHITESPACE Define PDERROR_NESTED_INTERNAL Define PDERROR_NOTODO_INCLUDE Define PDERROR_NO_CONVERTERS Define PDERROR_NO_CONVERTER_HANDLER Define PDERROR_NO_DOCBOOK_ID Define PDERROR_NO_PACKAGE_TAG Define PDERROR_NO_PAGE_LEVELDOCBLOCK Define PDERROR_OVERRIDDEN_PACKAGE_TAGS Define PDERROR_OVERRIDDEN_SUBPACKAGE_TAGS Define PDERROR_PACKAGECAT_SET
758 758 758 758 758 758 759 759 759 759 759 759 759 759 759 760 760 760 760 760 760 760 760 761 761 761 761 761 761 761 761 761 762 762 762 762 762 762 762 762 762 762 763 763 763 763 763 763 763
Define PDERROR_PACKAGEOUTPUT_DELETES_PARENT_FILE Define PDERROR_PARENT_NOT_FOUND Define PDERROR_PARSEPRIVATE Define PDERROR_PDFFUNCTION_NO_FUNC Define PDERROR_PDF_METHOD_DOESNT_EXIST Define PDERROR_PDF_TEMPVAR_DOESNT_EXIST Define PDERROR_PRIVATE_ASSUMED Define PDERROR_SOURCECODE_IGNORED Define PDERROR_SOURCE_TAG_FUNCTION_NOT_FOUND Define PDERROR_SOURCE_TAG_IGNORED Define PDERROR_TAG_NOT_HANDLED Define PDERROR_TEMPLATEDIR_DOESNT_EXIST Define PDERROR_TEXT_OUTSIDE_LI Define PDERROR_TUTORIAL_IS_OWN_CHILD Define PDERROR_TUTORIAL_IS_OWN_GRANDPA Define PDERROR_TUTORIAL_NOT_FOUND Define PDERROR_TUTORIAL_SUBSECTION_NOT_FOUND Define PDERROR_UL_IN_UL Define PDERROR_UNCLOSED_TAG Define PDERROR_UNDOCUMENTED_ELEMENT Define PDERROR_UNKNOWN_COMMANDLINE Define PDERROR_UNKNOWN_TAG Define PDERROR_UNMATCHED_LIST_TAG Define PDERROR_UNMATCHED_TUTORIAL_TAG Define PDERROR_UNTERMINATED_ATTRIB Define PDERROR_UNTERMINATED_ENTITY Define PDERROR_UNTERMINATED_INLINE_TAG Class ErrorTracker Var $curfile Var $errors Var $lasterror Var $lastwarning Var $linenum Var $warnings Method addError Method addErrorReturn Method addWarning Method handleEvent Method returnErrors Method returnLastError Method returnLastWarning Method returnWarnings Class RecordError Var $type Method output Class RecordWarning Var $data Var $file Var $linenum
763 763 764 764 764 764 764 764 764 764 764 764 765 765 765 765 765 765 765 765 765 766 766 766 766 766 766 766 767 767 767 767 767 767 767 768 768 768 769 769 769 769 769 770 770 770 770 771 771
Var $num Var $type Constructor RecordWarning Method output InlineTags.inc Class parserExampleInlineTag Constructor parserExampleInlineTag Method arrayConvert Method getProgramListing Method setSource Class parserIdInlineTag Var $category Var $id Var $inlinetype Var $package Var $subpackage Var $tutorial Constructor parserIdInlineTag Method Convert Class parserInheritdocInlineTag Var $inlinetype Constructor parserInheritdocInlineTag Method Convert Class parserInlineTag Var $inlinetype Var $type Constructor parserInlineTag Method getString Method Strlen Class parserLinkInlineTag Var $linktext Constructor parserLinkInlineTag Method Convert Method ConvertPart Class parserSourceInlineTag Var $end Var $inlinetype Var $source Var $start Constructor parserSourceInlineTag Method arrayConvert Method Convert Method getString Method setSource Method stringConvert Method Strlen Class parserTocInlineTag Var $inlinetype Constructor parserTocInlineTag
771 771 771 772 773 773 774 774 775 775 775 776 776 776 776 776 776 776 777 777 778 778 778 778 779 779 779 779 779 780 780 780 781 781 781 782 782 782 782 783 783 783 784 784 784 784 785 785 785
Method Convert Method setPath Method setTOC Class parserTutorialInlineTag Constructor parserTutorialInlineTag Method Convert LinkClasses.inc Class abstractLink Var $category Var $fileAlias Var $name Var $package Var $path Var $subpackage Var $type Method addLink Class classLink Var $type Class constLink Var $type Class defineLink Var $type Class functionLink Var $type Class globalLink Var $type Class methodLink Var $class Var $type Method addLink Class pageLink Var $type Class tutorialLink Var $section Var $title Var $type Method addLink Class varLink Var $type ParserData.inc Class parserBase Var $type Var $value Method getType Method getValue Method setValue Class parserData Var $classelements Var $clean
785 786 786 786 787 787 788 789 789 789 789 789 789 789 789 790 790 790 791 791 791 791 792 792 792 793 793 793 793 793 794 794 794 795 795 795 795 795 796 797 797 798 798 798 798 798 799 799 799
Var $docblock Var $elements Var $links Var $parent Var $privateclasselements Var $privateelements Var $tutorial Var $type Method addElement Method addLink Method addTutorial Method explicitDocBlock Method getClasses Method getLink Method getName Method getTutorial Method hasClasses Method hasExplicitDocBlock Method hasInterfaces Method isClean Method setDocBlock Method setParent Class parserPage Var $category Var $file Var $id Var $modDate Var $name Var $origName Var $package Var $packageOutput Var $parserVersion Var $path Var $source Var $sourceLocation Var $subpackage Var $type Constructor parserPage Method getFile Method getName Method getPackageOutput Method getParseData Method getPath Method getSourceLocation Method getType Method setFile Method setName Method setPackageOutput Method setPath
800 800 800 800 800 800 801 801 801 801 801 802 802 802 802 802 802 802 802 802 803 803 803 804 804 804 804 804 804 804 804 805 805 805 805 805 805 806 806 806 806 806 806 806 807 807 807 807 808
Method setSource Method setSourceLocation Class parserStringWithInlineTags Var $type Var $value Method add Method Convert Method getString Method hasInlineTag Method setSource Method trimmedStrlen ParserDocBlock.inc Class parserDesc Var $type Method add Method hasInheritDoc Method hasSource Method replaceInheritDoc Class parserDocBlock Var $category Var $desc Var $endlinenumber Var $explicitcategory Var $explicitpackage Var $funcglobals Var $hasaccess Var $hasname Var $linenumber Var $package Var $packagedescrip Var $params Var $processed_desc Var $processed_sdesc Var $properties Var $return Var $sdesc Var $statics Var $subpackage Var $subpackagedescrip Var $tags Var $unknown_tags Var $var Constructor parserDocBlock Method addAccess Method addExample Method addFileSource Method addFuncGlobal Method addKeyword Method addLink
808 808 809 809 809 809 809 810 810 810 811 812 812 813 813 813 813 813 814 814 814 814 814 815 815 815 815 815 815 816 816 816 816 816 816 817 817 817 817 817 817 817 817 818 818 818 818 819 819
Method addName Method addPackage Method addParam Method addProperty Method addReturn Method addSee Method addStaticVar Method addTag Method addUnknownTag Method addUses Method addVar Method canSource Method cantSource Method changeGlobal Method changeParam Method changeStatic Method getDesc Method getEndLineNumber Method getExplicitCategory Method getExplicitPackage Method getKeyword Method getLineNumber Method getSDesc Method getType Method hasInheritDoc Method listParams Method listProperties Method listTags Method overridePackage Method postProcess Method replaceInheritDoc Method resetParams Method setDesc Method setEndLineNumber Method setExplicitCategory Method setExplicitPackage Method setLineNumber Method setShortDesc Method setSource Method updateGlobals Method updateModifiers Method updateParams Method updateStatics ParserElements.inc Class parserClass Var $curfile Var $extends Var $ignore Var $parent
819 819 820 820 820 820 821 821 821 821 822 822 822 822 822 823 823 823 823 823 823 823 823 823 823 824 824 824 824 824 824 825 825 825 825 825 825 826 826 826 827 827 827 828 828 829 829 829 829
Var $sourceLocation Var $tutorial Var $type Var $_implements Method addImplements Method addTutorial Method getChildClassList Method getConflicts Method getConstNames Method getConsts Method getExtends Method getImplements Method getInheritedConsts Method getInheritedMethods Method getInheritedVars Method getLink Method getMethod Method getMethodNames Method getMethods Method getModifiers Method getParent Method getParentClassTree Method getSourceLocation Method getTutorial Method getVar Method getVarNames Method getVars Method hasConst Method hasMethod Method hasVar Method isInterface Method setAccessModifiers Method setExtends Method setInterface Method setModifiers Method setParent Method setParentNoClass Method setSourceLocation Class parserConst Var $class Var $type Constructor parserConst Method getClass Method getLink Class parserDefine Var $type Method getConflicts Method getLink Class parserElement
830 830 830 830 830 831 831 831 831 832 832 832 832 832 832 833 833 833 833 833 833 834 834 834 835 835 835 835 835 835 835 836 836 836 836 836 837 837 837 837 838 838 838 838 839 839 839 839 840
Var $conflicts Var $docblock Var $endlinenumber Var $file Var $linenumber Var $name Var $path Method getEndLineNumber Method getFile Method getLineNumber Method getName Method getPackage Method getPath Method setDocBlock Method setEndLineNumber Method setFile Method setLineNumber Method setName Method setPath Class parserFunction Var $globals Var $params Var $returnsreference Var $source Var $statics Var $type Method addGlobals Method addParam Method addSource Method addStatics Method getConflicts Method getFunctionCall Method getIntricateFunctionCall Method getLink Method getParam Method getReturnsReference Method getSource Method hasSource Method listGlobals Method listParams Method listStatics Method setReturnsReference Class parserGlobal Var $datatype Var $type Method getConflicts Method getDataType Method getLink Method setDataType
840 840 841 841 841 841 841 841 841 841 841 841 841 842 842 842 842 842 842 843 843 843 844 844 844 844 844 845 845 845 845 846 846 846 846 846 846 846 847 847 847 847 847 847 847 847 848 848 848
Class parserInclude Var $type Class parserMethod Var $class Var $isConstructor Var $isDestructor Var $type Var $_modifiers Constructor parserMethod Method addParam Method getClass Method getFunctionCall Method getImplements Method getIntricateFunctionCall Method getLink Method getModifiers Method getOverrides Method getOverridingMethods Method getOverridingMethodsForClass Method setConstructor Method setDestructor Method setModifiers Class parserPackagePage Var $package Var $type Constructor parserPackagePage Method Convert Class parserTutorial Var $children Var $ini Var $linked_element Var $name Var $next Var $package Var $parent Var $path Var $prev Var $tutorial_type Var $type Var $_xml Constructor parserTutorial Method Convert Method getLink Method getNext Method getParent Method getPrev Method getTitle Method isChildOf Method setNext
849 849 849 850 850 850 850 851 851 851 851 851 851 851 852 852 852 852 852 853 853 853 853 853 853 854 854 854 854 854 855 855 855 855 855 856 856 856 856 856 857 857 857 857 857 858 858 858 858
Method setParent Method setPrev Class parserVar Var $class Var $type Var $_modifiers Constructor parserVar Method getClass Method getLink Method getModifiers Method getOverrides Method getOverridingVars Method getOverridingVarsForClass Method setModifiers Beautifier.php Tokenizer.php Define PHPDOC_BEAUTIFIER_CDATA Define PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE Define PHPDOC_XMLTOKEN_EVENT_CDATA Define PHPDOC_XMLTOKEN_EVENT_CLOSETAG Define PHPDOC_XMLTOKEN_EVENT_COMMENT Define PHPDOC_XMLTOKEN_EVENT_DEF Define PHPDOC_XMLTOKEN_EVENT_DOUBLEQUOTE Define PHPDOC_XMLTOKEN_EVENT_ENTITY Define PHPDOC_XMLTOKEN_EVENT_IN_CDATA Define PHPDOC_XMLTOKEN_EVENT_NOEVENTS Define PHPDOC_XMLTOKEN_EVENT_OPENTAG Define PHPDOC_XMLTOKEN_EVENT_PI Define PHPDOC_XMLTOKEN_EVENT_SINGLEQUOTE Define PHPDOC_XMLTOKEN_EVENT_XML Define STATE_XMLTOKEN_ATTRIBUTE Define STATE_XMLTOKEN_CDATA Define STATE_XMLTOKEN_CLOSETAG Define STATE_XMLTOKEN_COMMENT Define STATE_XMLTOKEN_DEF Define STATE_XMLTOKEN_DOUBLEQUOTE Define STATE_XMLTOKEN_ENTITY Define STATE_XMLTOKEN_IN_CDATA Define STATE_XMLTOKEN_NOEVENTS Define STATE_XMLTOKEN_OPENTAG Define STATE_XMLTOKEN_PI Define STATE_XMLTOKEN_SINGLEQUOTE Define STATE_XMLTOKEN_XML HighlightParser.inc Parser.inc Define PARSER_EVENT_ACCESS_MODIFIER Define PARSER_EVENT_ARRAY Define PARSER_EVENT_CLASS Define PARSER_EVENT_CLASS_CONSTANT
859 859 860 860 860 860 860 860 861 861 861 861 861 861 863 864 864 864 865 865 865 865 865 865 865 865 865 865 865 865 866 866 866 866 866 866 866 866 866 866 866 866 867 868 870 870 870 870 871
Define PARSER_EVENT_CLASS_MEMBER Define PARSER_EVENT_COMMENT Define PARSER_EVENT_COMMENTBLOCK Define PARSER_EVENT_DEFINE Define PARSER_EVENT_DEFINE_GLOBAL Define PARSER_EVENT_DEFINE_PARAMS Define PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS Define PARSER_EVENT_DESC Define PARSER_EVENT_DOCBLOCK Define PARSER_EVENT_DOCBLOCK_TEMPLATE Define PARSER_EVENT_DOCKEYWORD Define PARSER_EVENT_DOCKEYWORD_EMAIL Define PARSER_EVENT_END_DOCBLOCK_TEMPLATE Define PARSER_EVENT_END_STATEMENT Define PARSER_EVENT_EOFQUOTE Define PARSER_EVENT_ESCAPE Define PARSER_EVENT_FUNCTION Define PARSER_EVENT_FUNCTION_PARAMS Define PARSER_EVENT_FUNCTION_PARAM_VAR Define PARSER_EVENT_FUNC_GLOBAL Define PARSER_EVENT_GLOBAL_VALUE Define PARSER_EVENT_IMPLEMENTS Define PARSER_EVENT_INCLUDE Define PARSER_EVENT_INCLUDE_PARAMS Define PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS Define PARSER_EVENT_INLINE_DOCKEYWORD Define PARSER_EVENT_LOGICBLOCK Define PARSER_EVENT_METHOD Define PARSER_EVENT_METHOD_LOGICBLOCK Define PARSER_EVENT_NOEVENTS Define PARSER_EVENT_OUTPHP Define PARSER_EVENT_PHPCODE Define PARSER_EVENT_QUOTE Define PARSER_EVENT_QUOTE_VAR Define PARSER_EVENT_SINGLEQUOTE Define PARSER_EVENT_STATIC_VAR Define PARSER_EVENT_STATIC_VAR_VALUE Define PARSER_EVENT_TAGS Define PARSER_EVENT_VAR Define PARSER_EVENT_VAR_ARRAY Define PARSER_EVENT_VAR_ARRAY_COMMENT Define PHPDOCUMENTOR_EVENT_CLASS Define PHPDOCUMENTOR_EVENT_CONST Define PHPDOCUMENTOR_EVENT_DEFINE Define PHPDOCUMENTOR_EVENT_DOCBLOCK Define PHPDOCUMENTOR_EVENT_DOCBLOCK_TEMPLATE Define PHPDOCUMENTOR_EVENT_END_DOCBLOCK_TEMPLATE Define PHPDOCUMENTOR_EVENT_END_PAGE Define PHPDOCUMENTOR_EVENT_FUNCTION
871 871 871 871 871 871 871 871 871 871 871 872 872 872 872 872 872 872 872 872 872 872 872 872 873 873 873 873 873 873 873 873 873 873 873 873 874 874 874 874 874 874 874 874 874 874 874 874 875
Define PHPDOCUMENTOR_EVENT_GLOBAL Define PHPDOCUMENTOR_EVENT_INCLUDE Define PHPDOCUMENTOR_EVENT_MESSAGE Define PHPDOCUMENTOR_EVENT_NEWFILE Define PHPDOCUMENTOR_EVENT_NEWLINENUM Define PHPDOCUMENTOR_EVENT_NEWSTATE Define PHPDOCUMENTOR_EVENT_PACKAGEPAGE Define PHPDOCUMENTOR_EVENT_PAGE Define PHPDOCUMENTOR_EVENT_README_INSTALL_CHANGELOG Define PHPDOCUMENTOR_EVENT_TUTORIAL Define PHPDOCUMENTOR_EVENT_VAR Define STATE_ACCESS_MODIFIER Define STATE_ARRAY Define STATE_CLASS Define STATE_CLASS_CONSTANT Define STATE_CLASS_MEMBER Define STATE_COMMENT Define STATE_COMMENTBLOCK Define STATE_DEFINE Define STATE_DEFINE_PARAMS Define STATE_DEFINE_PARAMS_PARENTHESIS Define STATE_DESC Define STATE_DOCBLOCK Define STATE_DOCBLOCK_TEMPLATE Define STATE_DOCKEYWORD Define STATE_DOCKEYWORD_EMAIL Define STATE_END_CLASS Define STATE_END_DOCBLOCK_TEMPLATE Define STATE_EOFQUOTE Define STATE_ESCAPE Define STATE_FUNCTION Define STATE_FUNCTION_PARAMS Define STATE_FUNCTION_PARAM_VAR Define STATE_FUNC_GLOBAL Define STATE_GLOBAL Define STATE_GLOBAL_VALUE Define STATE_IMPLEMENTS Define STATE_INCLUDE Define STATE_INCLUDE_PARAMS Define STATE_INCLUDE_PARAMS_PARENTHESIS Define STATE_INLINE_DOCKEYWORD Define STATE_LOGICBLOCK Define STATE_METHOD Define STATE_METHOD_LOGICBLOCK Define STATE_NOEVENTS Define STATE_OUTPHP Define STATE_PHPCODE Define STATE_QUOTE Define STATE_QUOTE_VAR
875 875 875 875 875 875 875 875 875 876 876 876 876 876 876 876 876 876 876 876 876 877 877 877 877 877 877 877 877 877 877 877 877 878 878 878 878 878 878 878 878 878 878 878 878 878 879 879 879
Define STATE_SINGLEQUOTE Define STATE_STATIC_VAR Define STATE_STATIC_VAR_VALUE Define STATE_TAGS Define STATE_VAR Define STATE_VAR_ARRAY Define STATE_VAR_ARRAY_COMMENT Define T_ABSTRACT Define T_CONST Define T_DOC_COMMENT Define T_FINAL Define T_IMPLEMENTS Define T_INTERFACE Define T_ML_COMMENT Define T_PRIVATE Define T_PROTECTED Define T_PUBLIC phpDocumentorTParser.inc TutorialHighlightParser.inc Define STATE_TUTORIAL_ATTRIBUTE Define STATE_TUTORIAL_CLOSETAG Define STATE_TUTORIAL_COMMENT Define STATE_TUTORIAL_DOUBLEQUOTE Define STATE_TUTORIAL_ENTITY Define STATE_TUTORIAL_ITAG Define STATE_TUTORIAL_NOEVENTS Define STATE_TUTORIAL_OPENTAG Define STATE_TUTORIAL_SINGLEQUOTE Define TUTORIAL_EVENT_ATTRIBUTE Define TUTORIAL_EVENT_CLOSETAG Define TUTORIAL_EVENT_COMMENT Define TUTORIAL_EVENT_DOUBLEQUOTE Define TUTORIAL_EVENT_ENTITY Define TUTORIAL_EVENT_ITAG Define TUTORIAL_EVENT_NOEVENTS Define TUTORIAL_EVENT_OPENTAG Define TUTORIAL_EVENT_SINGLEQUOTE XMLpackagePageParser.inc Define PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES Define PHPDOCUMENTOR_PDP_EVENT_CDATA Define PHPDOCUMENTOR_PDP_EVENT_ENTITY Define PHPDOCUMENTOR_PDP_EVENT_PROGRAMLISTING Define PHPDOCUMENTOR_PDP_EVENT_TAG Define PHPDOCUMENTOR_PDP_STATE_ATTRIBUTES Define PHPDOCUMENTOR_PDP_STATE_CDATA Define PHPDOCUMENTOR_PDP_STATE_ENTITY Define PHPDOCUMENTOR_PDP_STATE_PROGRAMLISTING Define PHPDOCUMENTOR_PDP_STATE_TAG Class Parser
879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 879 880 881 882 883 883 883 883 883 883 883 883 883 883 883 883 884 884 884 884 884 884 885 885 885 886 886 886 886 886 886 886 886 886
Constructor Parser Method categoryTagHandler Method checkEventPop Method checkEventPush Method configWordParser Method defaultTagHandler Method endTag Method exampleTagHandler Method getParserEventName Method globalTagHandler Method invalidTagHandler Method packageTagHandler Method paramTagHandler Method parse Method propertyTagHandler Method returnTagHandler Method setupStates Method staticvarTagHandler Method usesTagHandler Method varTagHandler Class parserDescParser Constructor parserDescParser Method doSimpleList Method getParserEventName Method parse Method setupStates Class phpDocumentorTParser Var $eventHandlers Var $inlineTagHandlers Var $source_location Constructor phpDocumentorTParser Method parse Class phpDocumentor_HighlightParser Constructor phpDocumentor_HighlightParser Method configWordParser Method newLineNum Method parse Method setLineNum Method setupStates Class phpDocumentor_HighlightWordParser Method backupPos Method getWord Method nextToken Method setup Class phpDocumentor_peardoc2_XML_Beautifier Method formatFile Method formatString Class phpDocumentor_TutorialHighlightParser Constructor phpDocumentor_TutorialHighlightParser
887 887 887 887 888 888 888 888 889 889 889 890 890 890 891 891 891 892 892 892 893 893 893 894 894 894 895 896 896 896 896 896 897 897 897 898 898 899 899 899 900 900 900 900 901 901 901 902 902
Method checkEventPop Method checkEventPush Method configWordParser Method getParserEventName Method newLineNum Method parse Method setLineNum Method setupStates Class phpDocumentor_XML_Beautifier_Tokenizer Var $eventHandlers Constructor phpDocumentor_XML_Beautifier_Tokenizer Method checkEventPop Method checkEventPush Method configWordParser Method getParserEventName Method incdataHandler Method parseString Method setupStates Class ppageParser Var $package Var $subpackage Constructor ppageParser Method defaultHandler Method handleInlineDockeyword Method parse Method setupStates Class XMLPackagePageParser Var $context Var $eventHandlers Var $pars Var $refsect1id Var $refsect2id Var $refsect3id Constructor XMLPackagePageParser Method getParserEventName Method parse Method setupStates find_phpdoc.php PackagePageElements.inc Class parserCData Method Convert Class parserEntity Constructor parserEntity Method Convert Class parserXMLDocBookTag Var $attributes Var $name Constructor parserXMLDocBookTag Method add
902 903 903 904 904 904 905 905 905 906 906 906 906 907 907 907 907 908 909 909 909 909 909 910 910 910 910 911 911 911 911 911 911 911 912 913 913 914 915 916 916 917 917 917 918 918 919 919 919
Method addAttribute Method addCData Method Convert Method endCData Method getId Method getSubsection Method getTitle Method getTOC Method hasTitle Method setId Method setTitle Method setTOC Method startCData phpDocumentorTWordParser.inc WordParser.inc Class ObjectWordParser Constructor ObjectWordParser Method getWord Method nextIsObjectOrNonNL Method setup Class phpDocumentorTWordParser Method addFileSource Method addSource Method backupPos Method concatTokens Method findGlobal Method getFileSource Method getSource Method getWord Method setup Method tokenEquals Class WordParser Method backupPos Method getBlock Method getPos Method getSource Method getWord Method setPos Method setSeperator Method setup Method setWhitespace
919 920 920 920 920 921 921 921 921 921 922 922 922 923 924 924 925 925 925 925 925 926 926 926 927 927 927 928 928 928 928 928 929 929 929 929 930 930 930 931 931 932 933 933 939 939 945 945 946
Appendices
Appendix A - Class Trees phpDocumentor HTML_TreeMenu tests org-phpdoc Converters XML_Beautifier
Cpdf Smarty Appendix B - README/CHANGELOG/INSTALL README ChangeLog INSTALL FAQ Appendix C - Source Code Package phpDocumentor source code: Converter.inc source code: CHMdefaultConverter.inc source code: HTMLframesConverter.inc source code: HTMLSmartyConverter.inc source code: class.phpdocpdf.php source code: ParserPDF.inc source code: PDFdefaultConverter.inc source code: XMLDocBookpeardoc2Converter.inc Package phpDocumentor source code: file_dialog.php Package phpDocumentor source code: builder.php source code: config.php source code: top.php source code: new_phpdoc.php source code: phpdoc.php source code: Classes.inc source code: clone.inc.php source code: clone5.inc.php source code: common.inc.php source code: EventStack.inc source code: IntermediateParser.inc source code: Io.inc source code: phpdoc.inc source code: DescHTML.inc source code: DocBlockTags.inc source code: Errors.inc source code: InlineTags.inc source code: LinkClasses.inc source code: Beautifier.php source code: Tokenizer.php source code: HighlightParser.inc source code: find_phpdoc.php Appendix D - Todo List
946 947 948 949 952 952 954 958 959 960 1034 1060 1086 1113 1118 1126 1140 1163 1164 1168 1169 1171 1181 1183 1184 1185 1203 1204 1205 1210 1212 1238 1252 1253 1259 1277 1292 1306 1311 1313 1323 1356 1357
When writing documentation for an open-source project intending to be both used and extended, this challenge is magnified by the fact that many people will also intend to extend the source, or even find obscure bugs and fix them. These two audiences tend to be opposed to each other in their needs.
An end-user generally wants: Instruction-style writing, that explains and describes general concepts more than how a particular variable is used Interface information only, no low-level details Examples of how to use, and tutorials Whereas a programmer may want in addition: Details on how program elements interact, which elements use others Where in the source code an action or series of actions occurs How to extend the code to add new functionality
These two kinds of users can not be serviced by just API documentation or just tutorials, but a subtle blend of the two.
Page 1 of 1382
option using a few things. First, using the command-line file-selection options, one can write two sets of documentation, one for end-users, and the other for programmers, and put them in different subdirectories. For instance, one could put enduser docs in "enduser/tutorials" and programmer docs in "programmer/tutorials." In addition, using the @access tag, one can mark programmer-level elements with @access private, and they will be ignored by default. The @internal tag and inline {@internal}} inline tag construct can be used to mark documentation that is low-level or internal to a smaller audience of developers. When creating programmer documentation, turn on the parse private option (see -pp, --parseprivate), and the low-level detail will be generated.
More important, the in-code documents in your DocBlocks must be written for both end-users and programmers wherever possible.
phpDocumentor uses the chaining feature of tutorials to link together related documentation like chapters in a book, and this is another way to organize documentation. Experiment, and find what's best for your project's needs.
Tips on Revising
There are many ways of creating good documentation, but perhaps the best is to read what you have written from different perspectives. Open up your documentation, and try to use it to figure out your software project. If this is difficult, go back and edit or rewrite. Remove anything that is confusing or unnecessary, make sure everything is there that is needed, and then when it seems good, ask a php user that doesn't know your project, or even a nonprogrammer to read it and use their reactions to tailor the documentation.
Conclusion
The use of phpDocumentor will definitely improve the look and feel of your documentation, but don't stop there, let it help you to create truly dynamic documents that are easily maintained and kept up-to-date. After all, great docs for great programs will help to secure PHP's rightful throne as the best out there!
Page 2 of 1382
phpDocumentor Quickstart
phpDocumentor for newbies
phpDocumentor generates manual-format documentation by reading it from special PHP comments called DocBlocks. DocBlocks are where you as the author of a software project should document helpful information that can be used by others (or your future self) to determine how to use and extend your PHP package.
Although the ability to add succinct documentation in the source code is essential, it cannot replace the importance of verbose documentation that is not in the source code, such as a user manual, or tutorials such as the one you are reading now. If the text you see here were placed in the source code for phpDocumentor, it would serve little useful purpose, clutter up the code, and be difficult to locate. However, the ability to hyperlink between documentation in the source code and external documentation is essential. External documentation for function foo must be able to reference the generated in-code documentation, and with phpDocumentor this is finally possible. To learn more, read about phpDocumentor Tutorials.
Installation
There are two official installation methods for phpDocumentor. The first is through downloading and extracting one of the available archives downloadable through pear.php.net and sourceforge.net, and the other is through the PEAR installer. There is planning for a Phing task and for distribution through other new and promising installation frameworks like the ZZ/OSS installer. However, only the two official installation methods are supported by phpDocumentor's developers.
Page 3 of 1382
sourceforge.net, first determine whether you will be using phpDocumentor's web or command-line interface (see the Basic usage of phpDocumentor tool section for help in making this decision).
If you wish to use the command-line interface, unzip the archive into any directory, say /home/myuser/phpdoc or C:\Program Files\phpdoc, and add that directory to your path statement. To use, run the "phpdoc" command. In windows, you will need to edit the phpdoc.bat file, and change the first line to the path of the CLI version of PHP (usually C:\php4\cli\php.exe by default).
To use the web interface, you must have a web server such as Apache installed, and must have a working PHP sapi for that webserver. To test, save the code below as phpinfo.php in your document root and browse to http://localhost/phpinfo.php
If you see a beautiful purple display of PHP information, then your PHP setup is working. To use phpDocumentor's web interface, simply unzip the archive into a subdirectory of your document root (such as phpdoc) and browse to that location (http://localhost/phpdoc).
Caution A Javascript-enabled browser such as Netscape, Mozilla, Internet Explorer, Opera, or Konqueror is required to view the newer web interface. If you wish to use a non-javascript browser such as links/lynx, use the old web interface, phpdoc.php at http://localhost/phpdoc/phpdoc.php.
Installing phpDocumentor for use on the command-line is simple. Simply run: $ pear install PhpDocumentor and you then have full access to the phpdoc command, both in windows and unix, without further configuration.
To install phpDocumentor to use the web interface, you must first change one of PEAR's configuration variables, data_dir, to be a sub-directory of your web server's document root. The simplest way to do this is through PEAR's command-line interface with the command: $ pear config-set data_dir /path/to/document_root/pear
Page 4 of 1382
Configuring this value through the web interface is also simple. Click on the configuration icon in the left-hand frame, and type in the path in the data_dir text box.
Once this configuration is complete, simply install phpDocumentor as described in the second paragraph above, and you can then browse to http://localhost/pear/PhpDocumentor to have access to the web interface. Once this configuration step has been taken, there is never any need to change, and you can easily upgrade to future phpDocumentor versions by using pear's upgrade command.
First of all, run phpDocumentor on the blank file sample1.php. If you are using the command-line interface, run this command from the tutorials/sample directory:
If you are using the web interface, click the "Files" tab, and type in the full path to tutorials/sample/sample1.php. Then click the "Output" tab and type in the full path to tutorials/sample/docs, and finally click the "Create" button in the lower right-hand corner.
With a web browser, open the newly created tutorials/sample/docs/index.html file and you will see the rich array of information that phpDocumentor can parse from the source code even without any documentation comments. Inheritance information, polymorphism and constants are all recognized automatically. Note that the only element that is not automatically documented is the global variable - to do this, you must use a phpDocumentor DocBlock as described in the next section of this quickstart manual. Also note that although the include_once specifies a file within the include_path, phpDocumentor will not automatically parse sample2.php, you must manually specify the files or directories to parse.
If you're feeling adventurous, experiment with the parse options available and parse the sample files a few times to see how they affect the documentation output. To find out options in the command-line interface, type $ phpdoc -h
Page 5 of 1382
Note that every DocBlock comment is a C-style comment with two leading asterisks (*), like so:
1 2 3
/** * */
All other comments are ignored by the documentation parser. Note that although most of the documentation is plain English, there are a few "@" characters floating around the source code. This symbol is used to pass a special command to the parser, and is called a tag. If the symbol is at the beginning of a line, it is a standard tag, and if it is enclosed in {curly brackets}, it is an inline tag. You can read more about tags at phpDocumentor tags and phpDocumentor Inline tags.
1 2 3 4 5 6
/** * {@inlinetag} * this is @not a standardtag - must begin a line. * this is a valid {@inlinetag} also * @standardtag */
1 2 3 4 5 6
/** * Special global variable declaration DocBlock * @global integer $GLOBALS['_myvar'] * @name $_myvar */ $GLOBALS '_myvar'] = 6; [
In this segment, we can see the two important tags used for documenting global variables. The @global tag is used to tell the parser how to find a global variable declaration. Without this tag, no documentation would be generated for $_myvar. The @global tag can take many forms - be sure to specify the type and global name, with no description, or the parser will generate a warning and fail to document the variable.
Now, parse sample3.php and observe the generated documentation. The @name tag is used to tell the parser how the global variable would be referenced by a global statement in a function.
1 2 3 4 5 6
/** * @global integer this is a function-based @global tag, * because the variable name is missing */ function someFunction() {
Page 6 of 1382
7 8
global$_myvar ; }
The @global tag here will associate the information with the declared global statements in the function body in the same order of their declaration.
phpDocumentor organizes procedural elements and classes into special groupings called packages. In earlier versions of phpDocumentor, if package was not specified explicitly using the @package tag, the program would make an educated guess as to which package a source element belongs to.
Over time, it became apparent that in many cases, source elements were incorrectly grouped into a package due to the guesswork phpDocumentor uses. Finally, the decision was made to require an explicit @package tag, and to raise a warning any time this tag was missing from a top-level source element.
The greatest confusion comes from the documenting of files. phpDocumentor documents all source elements by reading the DocBlock that immediately precedes the element, like so:
1 2 3 4 5 6 7 8
<?php /** * Documents the class following * @package SomePackage */ class SomeClass { } ?>
phpDocumentor also can document the contents of a file. But how can a DocBlock immediately precede the file that contains it? The easy answer is to assume the first DocBlock in a file documents the file that contains it, and this works well, but can be deceptive:
1 2 3 4 5 6 7 8
<?php /** * Documents the class following or the file? * @package SomePackage */ class SomeClass { } ?>
The same example shows the ambiguity - does this DocBlock document the class, or the file? To resolve this ambiguity, phpDocumentor uses a simple algorithm to make its decision.
Page 7 of 1382
1.
If the first DocBlock in a file contains a @package tag, it documents the file unless it precedes a class declaration If the first DocBlock in a file precedes another DocBlock, it documents the file
phpDocumentor provides a simple and elegant solution to all of these problems. External documentation in DocBook format can be easily converted to other formats. Using inline tags, phpDocumentor can generate a consistent manual in many different formats by combining the output from parsing the source and parsing external documentation. The words you read at this moment are in a DocBook-based file located in tutorials/phpDocumentor/phpDocumentor.quickstart.pkg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<refentry id=" {@id}" > <refnamediv> <refname> Simple Tutorial</refname> <refpurpose> The simplest Tutorial Possible</refpurpose> </refnamediv> <refsynopsisdiv> <author> Gregory Beaver <authorblurb> {@link mailto:[email protected] [email protected]} </authorblurb> </author> </refsynopsisdiv> <refsect1 id=" {@id intro}" > <para> Hello World</para> </refsect1> </refentry>
Page 8 of 1382
Page 9 of 1382
sample1.php
1 2 3 4 5 6 7 8 9 10 11 12 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 <?php // sample file #1 include_once 'sample2.php'; $GLOBALS '_myvar'] = 6; [ define('testing', 6); define('anotherconstant', strlen('hello')); function firstFunc($param1, $param2 = 'optional') { static$staticvar= 7; global$_myvar ; return$staticvar ; } class myclass { var $firstvar= 6; var $secondvar= array( 'stuff' => array( 6, 17, 'armadillo' ), testing => anotherconstant ); function myclass() { $this -> firstvar= }
7;
function parentfunc($paramie ) { if ($paramie { ) return 6; } else { returnnew babyclass; } } } class babyclass extends myclass { var $secondvar= 42;
Page 10 of 1382
48 49 50 51 52 53 54 55 56 57 58 59 60 61
var $thirdvar ; function babyclass() { parent::myclass(); $this -> firstvar +; + } function parentfunc($paramie ) { returnnew myclass; } } ?>
Page 11 of 1382
sample2.php
1 <?php 2 /** 3 * Sample File 2, phpDocumentor Quickstart 4 * 5 * This file demonstrates the rich information that can be included in 6 * in-code documentation through DocBlocks and tags. 7 * @author Greg Beaver <[email protected]> 8 * @version 1.0 9 * @package sample 10 */ 11 // sample file #1 12 /** 13 * Dummy include value, to demonstrate the parsing power of phpDocumentor 14 */ 15 include_once 'sample3.php'; 16 17 /** 18 * Special global variable declaration DocBlock 19 * @global integer $GLOBALS['_myvar'] 20 * @name $_myvar 21 */ 22 $GLOBALS '_myvar'] = 6; [ 23 24 /**#@+ 25 * Constants 26 */ 27 /** 28 * first constant 29 */ 30 define('testing', 6); 31 /** 32 * second constant 33 */ 34 define('anotherconstant', strlen('hello')); 35 36 /** 37 * A sample function docblock 38 * @global string document the fact that this function uses $_myvar 39 * @staticvar integer $staticvar is actually what is returned this 40 * @param string $param1name to declare 41 * @param string $param2value of the name 42 * @return integer 43 */ 44 function firstFunc($param1, $param2 = 'optional') 45 { 46 static$staticvar= 7; 47 global$_myvar ;
Page 12 of 1382
return$staticvar ; } /** * The first example class, this is in the same package as the * procedural stuff in the start of the file * @package sample * @subpackage classes */ class myclass { /** * A sample private variable, this can be hidden with the --parseprivate * option * @access private * @var integer|string */ var $firstvar= 6; /** * @link http://www.example.com Example link * @see myclass() * @uses testing, anotherconstant * @var array */ var $secondvar= array( 'stuff' => array( 6, 17, 'armadillo' ), testing => anotherconstant ); /** * Constructor sets up {@link $firstvar} */ function myclass() { $this -> firstvar= 7; } /** * Return a thingie based on $paramie * @param boolean $paramie * @return integer|babyclass */ function parentfunc($paramie ) { if ($paramie { ) return 6; } else { returnnew babyclass; } } } /** * @package sample1
Page 13 of 1382
107 */ 108 class babyclass extends myclass { 109 /** 110 * The answer to Life, the Universe and Everything 111 * @var integer 112 */ 113 var $secondvar= 42; 114 /** 115 * Configuration values 116 * @var array 117 */ 118 var $thirdvar ; 119 120 /** 121 * Calls parent constructor, then increments {@link $firstvar} 122 */ 123 function babyclass() 124 { 125 parent::myclass(); 126 $this -> firstvar +; + 127 } 128 129 /** 130 * This always returns a myclass 131 * @param ignored $paramie 132 * @return myclass 133 */ 134 function parentfunc($paramie ) 135 { 136 returnnew myclass; 137 } 138 } 139 ?>
Page 14 of 1382
sample3.php
1 <?php 2 /** 3 * Sample File 3, phpDocumentor Quickstart 4 * 5 * This file demonstrates the use of the @name tag 6 * @author Greg Beaver <[email protected]> 7 * @version 1.0 8 * @package sample 9 */ 10 /** 11 * Special global variable declaration DocBlock 12 * @global integer $GLOBALS['_myvar'] 13 */ 14 $GLOBALS '_myvar'] = 6; [ 15 /** 16 * Notice that the @name tag does not validate what you give it! 17 * @global string $GLOBALS['turkey'] 18 * @name $turkify 19 */ 20 $GLOBALS 'turkey'] = 'tester'; [ 21 /** 22 * Sample function @global usage 23 * 24 * Note that the $turkey variable is not linked to its documentation at 25 * {@link $turkify} because of the improper @name tag 26 * @global integer 27 * @global string this one has the optional description 28 */ 29 function testit() 30 { 31 global$_myvar $turkey , ; 32 } 33 ?>
Page 15 of 1382
phpDocumentor Tutorial
An in-depth look at using phpDocumentor to document PHP Source Code, and phpDocumentor internals
Introduction
phpDocumentor is the most advanced automatic documentation system written for PHP, in PHP. This package has many features: NEW The first auto-documentor with PHP 5 support Extended documentation in docbook format with linking to any element and to other documentation, including sub-sections, from the source code (see phpDocumentor Tutorials) docblock templates to cut down on repetition XML:DocBook:peardoc2 templates for PEAR developers Greater ease of extending a Converter, see Converter Manual ability to parse any PHP file, regardless of documentation format conforms loosely to the JavaDOC protocol, and will be familiar to Java programmers documents all includes, constants, functions, static functions, classes, methods, static variables, class variables, and can document global variables and external tutorials auto-linking to pre-defined PHP functions Output in HTML, CHM, PDF, XML DocBook formats templateable with many bundled templates automatic linking to elements in any documented package documents name conflicts between packages to help avoid PHP errors document CVS repository directly. support for JavaDoc doclet-like output through Converters error/warning tracking system extreme class intelligence: inherits documentation, package complete phpdoc.de DocBlock tag support. Additions include @var, @magic, @deprec, @todo, and phpdoc.de parsing of @param. alphabetical indexing of all elements by package and overall class trees MUCH more than just this short list
phpDocumentor Basics
Starting Out From Scratch
The documentation process begins with the most basic element of phpDocumentor: a Documentation block or DocBlock. A basic DocBlock looks like this:
1 2 3
/** * */
Page 16 of 1382
A DocBlock is an extended C++-style PHP comment that begins with "/**" and has an "*" at the beginning of every line. DocBlocks precede the element they are documenting.
Caution Any line within a DocBlock that doesn't begin with a * will be ignored. To document function "foo()", place the DocBlock immediately before the function declaration:
1 2 3 4 5 6
/** * Defies imagination, extends boundaries and saves the world ...all before breakfast! */ function foo() { }
This example will apply the DocBlock to "define('me',2);" instead of to "function foo()": 1 2 3 4 5 6 7 8 9 /** * DocBlock for function foo? * * No, this will be for the constant me! */ define('me',2); function foo( param = me) $ { }
define() statements, functions, classes, class methods, and class vars, include() statements, and global variables can all be documented, see Elements of the source code that can be documented
DocBlocks
A DocBlock contains three basic segments in this order: Short Description Long Description Tags
The Short Description starts on the first line, and can be terminated with a blank line or a period. A period inside a word (like example.com or 0.1 %) is ignored. If the Short Description would become more than three lines long, only the first line is taken. The Long Description continues for as many lines as desired and may contain html markup for display formatting. Here is a sample DocBlock with a Short and a Long Description:
1 2
Page 17 of 1382
3 4 5 6 7 8
* * Using the formula from "Formulas that are way too complicated for anyone to * ever understand except for me" by Irwin Nerdy, this function calculates the * date of Easter given a date in the Ancient Mayan Calendar, if you can also * guess the birthday of the author. */
Optionally, you may enclose all paragraphs in a <p></p> tag. Be careful, if the first paragraph does not begin with <p>, phpDocumentor will assume that the DocBlock is using the simple double linebreak to define paragraph breaks as in:
1 2 3 4 5 6 7 8 9 10
/** * Short desc * * Long description first sentence starts here * and continues on this line for a while * finally concluding here at the end of * this paragraph * * The blank line above denotes a paragraph break */
1 2 3 4 5 6 7 8 9 10
/** * Short desc * * <p>Long description first sentence starts here * and continues on this line for a while * finally concluding here at the end of * this paragraph</p> * This text is completely ignored! it is not enclosed in p tags * <p>This is a new paragraph</p> */
phpDocumentor also supports JavaDoc's DocBlock format through the command-line option -j, --javadocdesc. Due to the non-xhtml compliant unmatched p tag, we highly recommend you avoid this syntax whenever possible
1 2 3 4 5 6 7 8 9 10 11 12
/** * <p> * Short desc is only to the first period. * This means a sentence like: * "Parses Mr./Mrs. out of $_GET." will * parse a short description of "Parses Mr." * which is rather silly. Long description is * the entire DocBlock description including the * Short desc, and paragraphs begin where p is like: * <p> * The p above denotes a paragraph break */
Page 18 of 1382
phpDocumentor will convert all whitespace into a single space in the long description, use paragraph breaks to define newlines, or <pre>, as discussed in the next section.
For the rare case when the text "<b>" is needed in a DocBlock, use a double delimiter as in <<b>>. phpDocumentor will automatically translate that to the physical text "<b>".
Similarly, if you need an actual "@" in your DocBlock's description parts, you should be careful to either ensure it is not the first character on a line, or else escape it ("\@") to avoid it being interpreted as a PhpDocumentor tag marker.
1 2 3 4 5 6 7 8
/** * Demonstrate an @include file * line in a code block: * * <code> * \@include somefile.php * </code> */
Page 19 of 1382
1 2 3 4 5 6 7 8
/** * Demonstrate an @include file * line in a code block: * * <code> * @include somefile.php * </code> */
The <code>, <kbd>, and <pre> tags ignore any html listed above except for their own closing tags (</code> </kbd> </pre>). This is obviously necessary for each of those tag's behavior of controlling the appearance of the text inside their tag blocks, without allowing other nested tags (like <b>) interfering inside them. In general, other tags will allow other tags to be nested in them (i.e. <samp><b>bold_my_sample</b></samp>). New 1.2.0rc1: If you need to use the closing comment "*/" in a DocBlock, use the special escape sequence "{@*}." Here's an example:
1 2 3 4 5 6 7 8 9
/** * Simple DocBlock with a code example containing a docblock * * <code> * /** * * My sample DocBlock in code * {@*} * </code> */
1 2 3 4 5 6 7 7 8 9
/** * Simple DocBlock with a code example containing a docblock * * <code> * /** * * My sample DocBlock in code * */ * </ code> */
New 1.2.0rc1: The phpEdit tool supports very clever list extraction from DocBlocks, and now phpDocumentor supports the same cleverness. This example:
1 2 3 4 5 6
/** * Simple DocBlock with simple lists * * Here's a simple list: * - item 1 * - item 2, this one
Page 20 of 1382
7 8 9 10 11 12 13 14 15
* is multi-line * - item 3 * end of list. Next list is ordered * 1 ordered item 1 * 2 ordered item 2 * end of list. This is also ordered: * 1. ordered item 1 * 2. ordered item 2 */
phpDocumentor recognizes any simple list that begins with "-", "+", "#" and "o", and any ordered list with sequential numbers or numbers followed by "." as above. The list delimiter must be followed by a space (not a tab!) and whitespace must line up exactly, or phpDocumentor will not recognize the list items as being in the same list.
1 2 3 4 5 6 7 8 9 10
/** * Simple DocBlock with screwy lists * * +not a list at all, no space * Here's 3 lists! * - item 1 * - item 2, this one * is multi-line *- item 3 */
Again, you must line up the list iterators in the same vertical column in order for those list items to be considered "on the same list". Also, you cannot create nested lists using the simple list iterators... doing so means it's no longer a "simple" list! Varying the spacing of the list iterators does not create nesting of the lists... it only starts up new simple lists. If you specifically need a nested list, you must use the list tags (<ol>, <ul>):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/** * DocBlock with nested lists * * Here's the "complex" list: * <ul> * <li>outer item 1</li> * <li>outer item 2, this one * is multi-line</li> * <li>item 3 is a nested inner list * <ul> * <li>inner item 1</li> * <li>inner item 2</li> * </ul> * <li>outer item 4</li> * </ul> */
In some cases, the text description in a doc tag can contain a list, be it simple
Page 21 of 1382
or complex. Notice that a title line is needed, with the list items themselves beginning on the next line:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/** * DocBlock with nested lists * in the tag descriptions * @todo My Simple TODO List * - item 1 * - item 2 * - item 3 * @todo My Complex TODO List * <ol> * <li>item 1.0</li> * <li>item 2.0</li> * <li>item 3.0</li> * <ol> * <li>item 3.1</li> * <li>item 3.2</li> * </ol> * <li>item 4.0</li> * </ol> */
Tagged lists are always a more robust and predictable option for you to use. Simple lists are convenient, but if you find yourself trying to bend a simple list into displaying a certain way in your generated docs, you may be better served by switching to a tagged list instead.
For in-depth information on how phpDocumentor parses the description field, see ParserDescCleanup.inc
DocBlock Templates
New for version 1.2.0, phpDocumentor supports the use of DocBlock templates. The purpose of a DocBlock template is to reduce redundant typing. For instance, if a large number of class variables are private, one would use a DocBlock template to mark them as private. DocBlock templates simply augment any normal DocBlocks found in the template block.
A DocBlock template is distinguished from a normal DocBlock by its header. Here is the most basic DocBlock template:
1 2 3
/**#@+ * */
The text that marks this as a DocBlock template is "/**#@+" - all 6 characters must be present. DocBlock templates are applied to all documentable elements until the ending template marker:
/**#@-*/
Page 22 of 1382
Note that all 8 characters must appear as "/**#@-*/" in order for phpDocumentor to recognize them as a template. Here is an example of a DocBlock template in action:
1 class Bob 2 { 3 // beginning of docblock template area 4 /**#@+ 5 * @access private 6 * @var string 7 */ 8 var $_var1 = 'hello'; 9 var $_var2 = 'my'; 10 var $_var3 = 'name'; 11 var $_var4 = 'is'; 12 var $_var5 = 'Bob'; 13 var $_var6 = 'and'; 14 var $_var7 = 'I'; 15 /** 16 * Two words 17 */ 18 var $_var8 = 'like strings'; 19 /**#@-*/ 20 var $publicvar= 'Lookee me!'; 21 }
1 class Bob 2 { 3 // beginning of docblock template area 4 /** 5 * @access private 6 * @var string 7 */ 8 var $_var1 = 'hello'; 9 /** 10 * @access private 11 * @var string 12 */ 13 var $_var2 = 'my'; 14 /** 15 * @access private 16 * @var string 17 */ 18 var $_var3 = 'name'; 19 /** 20 * @access private 21 * @var string 22 */ 23 var $_var4 = 'is'; 24 /** 25 * @access private 26 * @var string
Page 23 of 1382
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
*/ var $_var5 = 'Bob'; /** * @access private * @var string */ var $_var6 = 'and'; /** * @access private * @var string */ var $_var7 = 'I'; /** * Two words * @access private * @var string */ var $_var8 = 'like strings'; var $publicvar= 'Lookee me!'; }
Note that for $_var8 the DocBlock template merged with the DocBlock. The rules for merging are simple: The long description of the docblock template is added to the front of the long description. The short description is ignored. All tags are merged from the docblock template
Tags
Tags are single words prefixed by a "@" symbol. Tags inform phpDocumentor how to present information and modify display of documentation. All tags are optional, but if you use a tag, they do have specific requirements to parse properly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/** * The short description * * As many lines of extendend description as you want {@link element} * links to an element * {@link http://www.example.com Example hyperlink inline link} links to * a website. The inline * source tag displays function source code in the description: * {@source } * * In addition, in version 1.2+ one can link to extended documentation like this * documentation using {@tutorial phpDocumentor/phpDocumentor.howto.pkg} * In a method/class var, {@inheritdoc may be used to copy documentation from} * the parent method * {@internal * This paragraph explains very detailed information that will only * be of use to advanced developers, and can contain
Page 24 of 1382
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
* {@link http://www.example.com Other inline links!} as well as text}}} * * Here are the tags: * * @abstract * @access public or private * @author author name <author@email> * @copyright name date * @deprecated description * @deprec alias for deprecated * @example /path/to/example * @exception Javadoc-compatible, use as needed * @global type $globalvarname or * @global type description of global variable usage in a function * @ignore * @internal private information for advanced developers only * @param type [$varname] description * @return type description * @link URL * @name procpagealias or * @name $globalvaralias * @magic phpdoc.de compatibility * @package package name * @see name of another element that can be documented, * produces a link to it in the documentation * @since a version or a date * @static * @staticvar type description of static variable usage in a function * @subpackage sub package name, groupings inside of a project * @throws Javadoc-compatible, use as needed * @todo phpdoc.de compatibility * @var type a data type for a class variable * @version version */ function if_there_is_an_inline_source_tag_this_must_be_a_function() { // ... }
In addition, tutorials allow two addition inline tags: {@id}, used to allow direct linking to sections in a tutorial, and {@toc}, used to generate a table of contents from {@id}s in the file. Think of {@id} like an <a name="idname"> HTML tag, it serves the same function.
In the example below, {@id} is used to name the refsect1 "mysection" and the refsect2 "mysection.mysubsection" - note that the sub-sections inherit the parent section's id.
Example:
Page 25 of 1382
role = "xml"<refentry id="{@id}"> <refsect1 id="{@id mysection}"> <refsect2 id="{@id mysubsection}"> </refsect2> </refsect1> </refentry>
For an in-depth look at phpDocumentor tags, read phpDocumentor tags, and for an in-depth look at inline tags, read phpDocumentor Inline tags.
Caution phpDocumentor is a great tool, but it will not write good documentation for you. Please read the phpDocumentor Guide to Creating Fantastic Documentation
1.
2.
Functions, Constants and Global Variables are grouped into files (by the filesystem), which are in turn grouped into packages using the @package tag in a page-level DocBlock Methods and Class Variables are grouped into classes (by PH),
Page 26 of 1382
which are in turn grouped into packages in a Class DocBlock These two definitions of package are exclusive. In other words, it is possible to have classes of a different package of the file that contains it! Here's an example:
Caution It may be possible, but don't put classes into a different package from the file they reside in, that will be very confusing and unnecessary. This behavior is deprecated, in version 2.0, phpDocumentor will halt parsing upon this condition. 1 <?php 2 /** 3 * Pretend this is a file 4 * 5 * Page-level DocBlock is here because it is the first DocBlock 6 * in the file, and is immediately followed by the second 7 * DocBlock before any documentable element is declared 8 * (function, define, class, global variable, include) 9 * @package pagepackage 10 */ 11 /** 12 * Here is the class DocBlock 13 * 14 * The class package is different from the page package! 15 * @package classpackage 16 */ 17 class myclass 18 { 19 } 20 ?>
For more information on page-level versus class-level packaging, see Procedural Elements
Perhaps the best way to organize packages is to put all procedural code into separate files from classes. PEAR recommends putting every class into a separate file. For small, utility classes, this may not be the best solution for all cases, but it is still best to separate packages into different files for consistency.
Give phpDocumentor the ability to parse external documentation in a common format and then convert it to the appropriate format for each converter. The implementation of this solution in version 1.2.0 is very versatile. Making use of the standard DocBook XML format, external documentation can be designed and then reformatted for any output. No longer is external documentation tied down to one "look." Here's a short
Page 27 of 1382
Benefits of using DocBook as the format: DocBook is very similar to HTML at the basic level and very easy to learn. Each template has its own options.ini file which determines how the DocBook tags will be translated into the output language - no need to learn xslt. Adding in xslt support will be very easy to allow for future customization Benefits of integrating tutorials/external documentation into phpDocumentor: Linking to external documentation from within API docs is possible Linking to API docs from external documentation is also possible Customizable table of contents, both of all tutorials and within a tutorial via inline {@toc} It is possible to create User-level documentation that has direct access to Programmer-level documentation
User-level documentation generally consists of tutorials and information on how to use a package, and avoids extreme detail. On the other hand, programmer-level documentation has all the details a programmer needs to extend and modify a package. phpDocumentor has been assisting the creation of programmer-level documentation since its inception. With the addition of tutorials, it can now ease the creation of user-level documentation.
Running phpDocumentor
There are two bundled ways of invoking phpDocumentor, the command-line phpdoc, or the web interface phpdoc.php/new_phpdoc.php.
Page 28 of 1382
html directory.
Caution Security is always an issue with the internet. Do not place phpDocumentor into the web server publicly available path on a server connected to the internet. Make sure that phpDocumentor will not have the power to overwrite ANY system or user files. Note that since the webserver runs as user nobody in unix, the generated files will be owned by nobody. The only way to change this is to either run phpDocumentor from the command-line or to add a chuser wrapper around httpd. We do not recommend using a chuser wrapper or running phpDocumentor as root. It is much easier and safer to use a config file (see phpDocumentor's dynamic User-defined config files) from the command line.
An alternative is to edit the phpdoc.bat file, and place phpdoc in the path, then you can run phpdoc as a normal command.
.\phpdoc [commandline]
-c, --config
Use this option to load a config file (see phpDocumentor's dynamic User-defined config files)
-cp, --converterparams
This option is only used to pass dynamic parameters to extended converters. The options passed should be separated by commas, and are placed in the global variable $_phpDocumentor_setting['converterparams'], an array. It is the responsibility of the Converter to access this variable, the code included with phpDocumentor does nothing with it.
Page 29 of 1382
-ct, --customtags
Use this option to specify tags that should be included in the list of valid tags for the current run of phpdoc
1 2 3 4
without raising any errors, and include the tags in the known tags list for the template to handle. Note that in version 1.2.0+, the unknown_tags array is passed to templates.
-dh, --hidden
Use this option to tell phpDocumentor to parse files and directories that begin with a period (.)
-dc, --defaultcategoryname
This will tell phpDocumentor to group any uncategorized elements into the primary categoryname. If not specified, the primary category is "default." The category should be specified using the @category tag.
1 2 3 4 5 6 7 8
/** * This package has no category and will be grouped into the default * category unless -dc categoryname is used * @package mypackage */ class nocategory { }
-dn, --defaultpackagename
Use this option to tell phpDocumentor what the primary package's name is. This will also tell phpDocumentor to group any unpackaged elements into the primary packagename. If not specified, the primary package is "default"
1 2 3 4 5 6 7
/** * This class has no package and will be grouped into the default * package unless -dn packagename is used */ class nopackage { }
-d, --directory
This or the -f option must be present, either on the command-line or in the config file.
Page 30 of 1382
Unlike -f, -d does not accept wildcards. Use -d to specify full paths or relative paths to the current directory that phpDocumentor should recursively search for documentable files. phpDocumentor will search through all subdirectories of any directory in the command-line list for tutorials/ and any files that have valid .php extensions as defined in phpDocumentor.ini. For example:
"phpdoc -d relative/path/to/dir1,/fullpath/to/here,.."
-ed, --examplesdir
The -ed option is used to specify the full path to a directory that example files are located in. This commandline setting affects the output of the @example tag.
-f, --filename
This or the -d option must be present, either on the command-line or in the config file.
This option is used to specify individual files or expressions with wildcards * and ?. Use * to match any string, and ? to match any single character. phpdoc -f m*.p* will match myfile.php, mary_who.isthat.phtml, etc. phpdoc -f /path/m* will match /path/my/files/here.php, /path/mommy.php /path/mucho/grande/what.doc, etc. phpdoc -f file?.php will match file1.php, file2.php and will not match file10.php
-i, --ignore
Use the -i option to exclude files and directories from parsing. The -i option recognizes the * and ? wildcards, like -f does. In addition, it is possible to ignore a subdirectory of any directory using "dirname/". phpdoc -i tests/ will ignore /path/to/here/tests/* and /path/tests/* phpdoc -i *.inc will ignore all .inc files phpdoc -i *path/to/* will ignore /path/path/to/my/* as well as /path/to/* phpdoc -i *test* will ignore /path/tests/* and /path/here/my_test.php
Since v1.3.2, the value or pattern you provide will be case-sensitive (OS permitting, anyway), and will be applied relative to the top-level directory in the -d argument. phpdoc -i CVS/ will ignore /path/to/CVS/* but will not ignore /path/to/cvs phpdoc -d /home/myhome/cvs/myproject -i cvs/ will ignore /home/myhome/cvs/myproject/files/cvs/* but will not ignore /home/myhome/cvs/*
-is, --ignoresymlinks
Use the -is option to explicitly ignore any symlinks, whether they be links to directories or links to files.
This only works on a Unix/Linux environment, since Windows doesn't have symlinks.
Page 31 of 1382
-it, --ignore-tags
Use the -it option to exclude specific tags from output. This is used for creating multiple sets of documentation for different audiences. For instance, to generate documentation for end-users, it may not be desired to output all @todo tags, so --ignore-tags @todo would be used. To ignore inline tags, surround them with brackets {} like --ignore-tags {@internal}.
--ignore-tags will not ignore the core tags @global, @access, @package, @ignore, @name, @param, @return, @staticvar or @var.
Caution The --ignore-tags option requires a full tag name like --ignore-tags @todo. --ignore-tags todo will not work.
-j, --javadocdesc
Use this command-line option to enforce strict compliance with JavaDoc. JavaDoc DocBlocks are much less flexible than phpDocumentor's DocBlocks (see DocBlocks for information).
-o, --output
Use this required option to tell phpDocumentor which Converters and templates to use. In this release, there are several choices: HTML:frames:* - output is HTML with frames. HTML:frames:default - JavaDoc-like template, very plain, minimal formatting HTML:frames:earthli - BEAUTIFUL template written by Marco von Ballmoos HTML:frames:l0l33t - Stylish template HTML:frames:phpdoc.de - Similar to phpdoc.de's PHPDoc output HTML:frames:phphtmllib - Very nice user-contributed template all of the templates listed above are also available with javascripted expandable indexes, as HTML:frames:DOM/name where name is default, l0l33t, phpdoc.de, etcetera HTML:frames:phpedit - Based on output from PHPEdit Help Generator HTML:Smarty:* - output is HTML with no frames. HTML:Smarty:default - Bold template design using css to control layout HTML:Smarty:HandS - Layout is based on PHP, but more refined, with logo image HTML:Smarty:PHP - Layout is identical to the PHP website CHM:default:* - output is CHM, compiled help file format (Windows help). CHM:default:default - Windows help file, based on HTML:frames:l0l33t PDF:default:* - output is PDF, Adobe Acrobat format PDF:default:default - standard, plain PDF formatting XML:DocBook:* - output is XML, in DocBook format XML:DocBook/peardoc2:default - documentation ready for compiling into peardoc for online pear.php.net documentation, 2nd revision
Page 32 of 1382
In 1.2.0+, it is possible to generate output for several converters and/or templates at once. Simply specify a comma-delimited list of output:converter:template like:
-pp, --parseprivate
By default, phpDocumentor does not create documentation for any elements marked @access private. This allows creation of end-user API docs that filter out low-level information that will not be useful to most developers using your code. To create complete documentation of all elements, use this command-line option to turn on parsing of elements marked private with @access private.
-po, --packageoutput
Use this option to remove all elements grouped by @package tags in a comma-delimited list from output. This option is useful for projects that are not organized into separate files for each package. Parsing speed is not affected by this option, use -i, --ignore whenever possible instead of --packageoutput.
phpdoc -o HTML:frames:default -t ./docs -d . -po mypackage,thatotherpackage will only display documentation for elements marked with "@package mypackage" or "@package thatotherpackage"
-p, --pear
Use this option to parse a PEAR-style repository. phpDocumentor will do several "smart" things to make life easier: PEAR-style destructors are automatically parsed If no @package tag is present in a file or class DocBlock, it will guess the package based on subdirectory If a variable or method name begins with "_", it will be assumed to be @access private, unless an @access tag is present. Constructors are also assumed to be @access private in the current version. Warnings will be raised for every case above, as @package should always be explicit, as should @access private. We do not like to assume that phpDocumentor knows better than you what to do with your code, and so will always require explicit usage or raise warnings if phpDocumentor does make any assumptions.
-q, --quiet
This option tells phpDocumentor to suppress output of parsing/conversion information to the console. Use this for cron jobs or other situations where human intervention will not be needed.
-ric, --readmeinstallchangelog
This comma-separated list of files specifies files that should be parsed and included in the documentation. phpDocumentor will automatically grab files listed here if and only if they are located in the top-level directory that is parsed. In other words, if you parse these files: /path/to/files/file1.php /path/to/files/file2.php /path/to/files/README /path/to/files/subdir/file2.php /path/to/files/subdir/README
-s, --sourcecode
Page 33 of 1382
This option tells phpDocumentor to generate highlighted cross-referenced source code for every file parsed. The highlighting code is somewhat unstable, so use this option at your own risk.
-t, --target
Use this to tell phpDocumentor where to put generated documentation. Legal values are paths that phpDocumentor will have write access and directory creation priveleges.
-tb, --templatebase
-tb accepts a single pathname as its parameter. The default value of -tb if unspecified is <phpDocumentor install directory>/phpDocumentor. This raises a very important point to understand. The -tb command-line is designed to tell phpDocumentor to look for all templates for all converters in subdirectories of the path specified. By default, templates are located in a special subdirectory structure.
For the hypothetical outputformat:convertername:templatename -o, --output argument, the directory structure is Converters/outputformat/convertname/templates/templatename/. The class file for convertname should be in the convertname/templates directly, right beside your templatename directory/ies. In addition, Smarty expects to find two subdirectories, templates/ (containing the Smarty template files) and templates_c/ (which will contain the compiled template files).
"phpdoc -tb ~/phpdoctemplates -o HTML:frames:default" will only work if the directory ~/phpdoctemplates/Converters/HTML/frames/default/templates contains all the template files, and ~/phpdoctemplates/Converters/HTML/frames/default/templates_c exists.
-ti, --title
Set the global title of the generated documentation
-ue, --undocumentedelements
This option tells phpDocumentor whether or not to suppress warnings about certain objects (classes, methods) that are not documented via a DocBlock comment. Use this to help identify objects that you still need to write documentation for.
phpdoc -c myconfig
What makes this all possible is the use of config files that contain all of the command-line information. There are two configuration files included in the distribution of phpDocumentor, and both are in the user/ subdirectory. To use a configuration file "myconfig.ini," simply place it in the user directory, and the command-line "phpdoc -c myconfig" will tell phpDocumentor to read all the command-line settings from
Page 34 of 1382
that config file. Configuration files may also be placed in another directory, just specify the full path to the configuration file:
phpdoc -c /full/path/to/myconfig.ini
The best way to ensure your config file matches the format expected by phpDocumentor is to copy the default.ini config file, and modify it to match your needs. Lines that begin with a semi-colon (;) are ignored, and can be used for comments.
Be sure to put in your config file all the runtime options you need, because all other command-line arguments are ignored if you use a config file.
Page 35 of 1382
Procedural Elements
From phpDocumentor's perspective, the basic container for procedural elements (as in real life) is the file that contains them. To reflect this, it is possible to document information about the entire contents of a file. This is accomplished through the use of a page-level DocBlock (see DocBlocks for basic information on what a DocBlock is). A page-level DocBlock is the only DocBlock that cannot precede the element that it is documenting, as there is no way to precede a file. To solve this issue, the way phpDocumentor finds a page-level DocBlock is to parse the first DocBlock in a file as the page-level DocBlock, with certain conditions.
1 2 3 4 5 6
This last example has one DocBlock, and it is the first DocBlock in a file, but it is not a Page-level DocBlock. How can phpDocumentor tell the difference between a Page-level DocBlock and any other DocBlock? Simple:
1 <?php 2 /** 3 * Pretend this is a file 4 * 5 * Page-level DocBlock is here because it is the first DocBlock 6 * in the file, and contains a @package tag 7 * @package pagepackage 8 */ 9 define("almost" ,"Now the Page-level DocBlock is for the page, and the Define has no docblock" );?>
Page 36 of 1382
In phpDocumentor version 1.2.2, a Page-level DocBlock is the first DocBlock in a file if it contains a @package tag. However, this example will raise a warning like WARNING in test.php on line 8: Pagelevel DocBlock precedes "define almost", use another DocBlock to document the source element. You can eliminate the warning by adding documentation to the define as follows:
1 <?php 2 /** 3 * Page-level DocBlock 4 * @package pagepackage 5 */ 6 /** 7 * Define DocBlock 8 */ 9 define("ahhhh" ,"Now the Page-level DocBlock is for the page, and the Define DocBlock for the define" ); 10 ?>
Now, the page has its documentation, and the define has its own documentation.
1. 2. 3. 4.
The first DocBlock in a file One of: Contains a @package tag Immediately followed by another DocBlock for any documentable PHP element this is deprecated, always use a @package tag
A Page-level DocBlock may have any of the standard phpDocumentor Tags (see Standard phpDocumentor Tags) plus the following tags: @package @subpackage
Caution phpDocumentor will not document a file like the first example, there must be at least one documentable PHP element in the file.
include/require/include_once/require_once statements
phpDocumentor extracts the filename and attempts to link to documentation for that filename if possible. Include statements may only have any of the Standard phpDocumentor Tags
phpDocumentor will attempt to locate the included file in the list of files parsed, and if found will make a link to that file's documentation.
Page 37 of 1382
define statements
A define statement's DocBlock may have any of the standard phpDocumentor Tags (see Standard phpDocumentor Tags) plus the following tag: @name
function declarations
A function's DocBlock may have any of the standard phpDocumentor Tags (see Standard phpDocumentor Tags) plus the following tags: @global @param @return @staticvar inline {@source}
global variables
A global variable's DocBlock may have any of the standard phpDocumentor Tags (see Standard phpDocumentor Tags) plus the following tag: @name In addition, the global variable's DocBlock must contain the @global tag.
Class Elements
A class's DocBlock may have any of the standard phpDocumentor Tags (see Standard phpDocumentor Tags) plus the following tags: @package @subpackage @static
DocBlock inheritance
New in version 1.2.0, DocBlock's are inherited by child classes, variables, and methods. There are a few simple rules for inheritance: tags @author, @version, and @copyright are automatically inherited unless explicitly specified in the DocBlock As in previous versions, @package and @subpackage are inherited unless explicitly specified in the DocBlock. We recommend that you explicitly use @package and @subpackage for every class to avoid problems with name conflicts that may arise If there is no short description, the short description will be inherited. If there is no long description, the long description will be inherited. If there is a long description, and you still want to inherit the parent's description, use inline {@inheritdoc}
Page 38 of 1382
1 2 3 4 5 6 7 8 9 10 11 12 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
/** * short desc * * long desc * @package test * @author me * @version 1.0 * @abstract * @copyright never */ class parclass { } // inherits entire DocBlock minus @abstract class child1 extends parclass { } // inherits DocBlock minus @abtract, short desc /** * overriding short desc */ class child2 extends parclass { } // inherits @author, @version, @copyright, @package /** * overriding short desc * * overriding long desc */ class child3 extends parclass { } // inherits @version, @copyright, @package /** * overriding short desc * * overriding long desc * @author you */ class child4 extends parclass { }
class variables
A class variable's DocBlock may have any of the standard phpDocumentor Tags (see Standard phpDocumentor Tags) plus the following tag: @var
Page 39 of 1382
class methods
A method's DocBlock may have any of the standard phpDocumentor Tags (see Standard phpDocumentor Tags) plus the following tags: @global @param @return @static @staticvar inline {@source}
Page 40 of 1382
phpDocumentor Tutorials
Writing User-level documentation/tutorials with phpDocumentor
In addition, tutorials are grouped by the same packages that group documented elements (see Dividing projects into packages for more information). To associate a tutorial with a package, place it in a subdirectory of tutorials/ named after the package. A tutorial for package "phpDocumentor" goes in "tutorials/phpDocumentor," a tutorial for subpackage "CHMDefault" of package "Converters" goes in "tutorials/Converters/CHMdefault/" - for an example, see the tutorials/ subdirectory of phpDocumentor.
Page 41 of 1382
At the bare minimum, assuming your one package is named "MyApp", you should create the "tutorials/MyApp/MyApp.pkg" file, with this minimal content: 1 <refentry id=" {@id}" > 2 <refnamediv> 3 <refname> User Guide for My Application</refname> 4 <refpurpose> To demonstrate the various tasks available in My app</refpurpose> 5 </refnamediv> 6 <refsynopsisdiv> 7 <author> 8 My Name 9 <authorblurb> 10 {@link mailto:[email protected] My Name} 11 </authorblurb> 12 </author> 13 </refsynopsisdiv> 14 {@toc} 15 <refsect1 id=" {@id intro}" > 16 <title> User Guide</title> 17 <para> 18 This will be the User Guide for My app. 19 </para> 20 </refsect1> 21 </refentry>
One common "gotcha" here is ensuring that you name the PKG file and its parent directory with your package's exact name, as well as ensuring you have indeed used the "@package MyApp" tag in your codebase. Running PhpDocumentor against this minimal tutorial file, when no PHP files use this package name, will NOT result in your tutorial being generated.
A second common "gotcha" is that if you attempt to run PhpDocumentor against ONLY the tutorial directory and its files, you'll get "ERROR: nothing parsed"... because you did not give PhpDocumentor any PHP files to process. PhpDocumentor does need at least one "code" file to process, along with the tutorials, in order for any tutorials to be generated. This is a common mistake when first trying to write tutorial docs... writing the files and then trying to run PhpDocumentor against ONLY the tutorials directory to test your tutorial files. You will need at least one PHP file included in your test run, to avoid getting "ERROR: nothing parsed".
A third "gotcha" can occur when you make your tutorial for your package and expect that the top-level index.html file will show its content, only to see an empty page showing little more than "Welcome to default!". What has happened is that the default package name for a documentation generation is "default", so unless you specify "--defaultpackagename MyApp", then your resulting top-level index.html file wants to tie itself to a "default.pkg" tutorial file for the "default" package, which does not exist, and it therefore decides there is no tutorial and instead displays that generic "Welcome" message.
Page 42 of 1382
Package-level documentation
The primary documentation for a package or subpackage should go in a file with the same name as the package or subpackage. For package "phpDocumentor" the primary package-level documentation is in "tutorials/phpDocumentor/phpDocumentor.pkg" For subpackage "CHMdefault" of package "Converters," the primary subpackage-level documentation is in "tutorials/Converters/CHMDefault/CHMdefault.pkg"
Other package-level documentation can have any filename, but must have the package-tutorial extension .pkg.
Class-level documentation
Similar to package-level documentation, the primary documentation for a class must have the same name as the class. The primary documentation for the class "Converter" in package "Converters" will be found in "tutorials/Converters/Converter.cls."
Procedural-level documentation
If a package contains a number of functions, it may be good to include procedural-level documentation. If a particular file contains a large amount of procedural information that must be documented, it is possible to link tutorials to that file's API docs in the same manner it is possible to link to a class's API docs.
The primary documentation for the procedural component of a PHP file must have the same name as the file. The primary procedural documentation for the file test.php in package "examples" will be found in "tutorials/examples/test.php.proc."
In order for a tutorial to be linked to another tutorial as a child, it must be in the same package, subpackage and be the same tutorial type. tutorials/phpDocumentor/phpDocumentor.pkg cannot have tutorials/phpDocumentor/oops.cls as a child tutorial, nor can it have tutorials/phpDocumentor/oops/almostworks.pkg as a child tutorial. It can have tutorials/phpDocumentor/works.pkg as a child, because the tutorial is in the same package, and is package-level documentation.
To help enforce this rule, the [Linked Tutorials] section is a list of filenames minus path and extension.
Page 43 of 1382
phpDocumentor will search for tutorials/test/child1.pkg, tutorials/test/child2.pkg, and tutorials/test/child3.pkg and link them in that order. Note that any tutorial can have an .ini file, allowing unlimited depth of tutorials. We don't recommend going beyond 3 sub-levels, that will probably confuse readers more than it helps them.
For a working example, check out the .ini files in phpDocumentor's own tutorials/ directory.
The first section of the .ini file, [desctranslate], is for conversion of DocBlocks and is covered elsewhere (see DocBlock Description details).
After that comes the section that deals with tutorials, [ppage].
Page 44 of 1382
Note that to specify a ", it must be enclosed in double quotes, hence the usage of """
If the start and endtag should be different, specify the exact text using a slash before the tagname as in: tagname = <starttext attr="myval" /> /tagname = "\n"
If a tag needs only a new tag and attribute name (for example link and linkend become a and href): tagname = newtagname tagname->attr = newattrname
If a tag needs only a new tag and attribute name, and a new attribute value (for example table frame="all" becomes table frame="border"): tagname = newtagname tagname->attr = newattrname tagname->attr+val = newval
If a tag needs only a new tag and attribute name, and two attributes combine into one (for example table colsep="1" rowsep="1" becomes table rules="all"): tagname = newtagname tagname->attr = newattrname tagname->attr2 = newattrname tagname->attr+val|attr2+val = newval
Page 45 of 1382
If a tag should have all attributes and be a single tag (like <br />: tagname = newtagname tagname/ =
If an attribute should be changed to a new name for all cases (like role changed to class, which would be $attr$role = class): $attr$attrname = newattrname
Note that escaping of quotation marks is not needed, phpDocumentor_parse_ini() only strips the outer tags and then performs http://www.php.net/stripcslashes on the remaining string.
What next?
Write your tutorials and extended documentation!
Page 46 of 1382
phpDocumentor Manual
Introduction to phpDocumentor
Authors:Gregory Beaver [email protected] Joshua Eichorn [email protected] Kellin [email protected] Juan Pablo Morales [email protected] Florian Clever [email protected] Dennis Kehrig [email protected] Robert Hoffmann [email protected] Roberto Berto [email protected] Dave Viner [email protected] Walter A Boring IV [email protected] Mark van Reunswolde [email protected] Julien Damon [email protected] Harald Fielker
Page 47 of 1382
[email protected] Marco von Ballmoos [email protected] Andrew Eddie [email protected] William K. Hardeman [email protected] Chuck Burgess [email protected]
Documentation
The release of phpDocumentor 1.2.0+ marks a radical shift in the design philosophy of phpDocumentor. No longer is this tool intended only to generate documentation from the source code. Now it facilitates generating user-level documentation for people who only wish to use your software, and not to modify it. This allows complete integration of all the documentation for the software project, and that means even greater ease of documenting, and ultimately more time to work on making the software work!
The old functionality of phpDocumentor has not been changed, only extended. The old HTMLdefaultConverter has been ported to a new HTMLframesConverter. The output looks the same, or better, but the templates are now smarty.php.net-based templates, and allow much greater customization. To start out right away, read phpDocumentor Tutorial.
If there is a feature you're dying to have, check our feature tracker at PEAR and http://sourceforge.net/tracker/?func=browse&group_id=11194&atid=361194 Sourceforge . Please don't hesitate to look right at the source code and help apply your feature. We love that, and can easily give you access to the cvs.
Page 48 of 1382
phpDocumentor tags
How to use tags in DocBlocks
Tags Manual
Welcome to the phpDocumentor Tags Manual
phpDocumentor tags are very similar to tags for the JavaDoc tool for Sun's Java Programming Language. Tags are only parsed if they are the first thing on a new line of a DocBlock. You may use the @ character freely throughout documents as long as it does not begin a new line. An example:
1 2 3 4 5
/** * tags demonstration * @author this tag is parsed, but this @version tag is ignored * @version 1.0 this version tag is parsed */
Any tags that phpDocumentor does not recognize will not be parsed, and will be displayed in text flow as if they are part of the DocBlock long description. The example below displays text "tags demonstration @foobar this is silly," and also displays the author as "this tag is parsed, but this @version tag is ignored"
1 2 3 4 5
/** * tags demonstration * @foobar this is silly * @author this tag is parsed, but this @version tag is ignored */
Inline tags display in the text flow where they appear, and are not separated from the description. As of version 1.2, there are several inline tags. The allowed inline tag list is different for tutorials and regular incode documentation. See phpDocumentor Inline tags for more information.
The example below will display the text "this function works heavily with foo() to rule the world" where foo() represents a hyperlink that links to the function foo()'s documentation.
1 /** 2 * inline tags demonstration 3 * 4 * this function works heavily with {@link foo()} to rule the world 5 */ 6 function bar() 7 { 8 } 9 10 function foo()
Page 49 of 1382
11 12
{ }
Page 50 of 1382
@abstract
Document an abstract class, class variable or method
Description
Use the @abstract tag to declare a method, class variable, or class that must be re-defined in a child class to be valid.
Warning: The @abstract tag is only valid in PHP 4, PHP 5 has a keyword abstract.
Example
Here's an example:
1 /** 2 * example of basic @abstract usage in a class 3 * Use this if every single element of the class is abstract 4 * @abstract 5 */ 6 class myabstractclass 7 { 8 function function1($baz) 9 { 10 ... 11 } 12 13 function function2() 14 { 15 ... 16 } 17 }
Page 51 of 1382
@access
Access control for an element. @access private prevents documentation of the following element (if enabled).
Description
@access controls phpDocumentor's documentation of an element.
If @access is private, the element will not be documented unless specified by command-line switch -parseprivate.
Example
1 2 3 4 5 6 7 8 9 10 11 12 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 /** * function func1, public access is assumed */ function func1() { } /** * function func2, access is private, will not be documented * @access private */ function func2() { } /** * This is possible, but redundant. An element has @access public by default * @access public */ class class1 { /** * all text in this DocBlock will be ignored, unless command-line switch or * setting in a user INI file enables documenting of private elements * @access private */ var $private_var ; /** * Protected is allowed, but does absolutely nothing. Use it to inform users * that an element should only be referenced by this and child classes, * and not directly * @access protected */ /** * this function is documented */
Page 52 of 1382
38 39 40 41
function publicmethod() { } }
Page 53 of 1382
@author
Author of current element
Description
The @author tag is used to document the author of any element that can be documented (global variable, include, constant, function, define, class, variable, method, page). phpDocumentor will take any text between angle brackets (< and >) and try to parse it as an email address. If successful, it will be displayed with a mailto link in the page
NEW v1.2 - @author is now inherited by child classes from a parent class, see inline {@inheritdoc}.
Example
1 /** 2 * Page-Level DocBlock example. 3 * displays as Gregory Beaver<u>[email protected]</u> 4 * , where underlined text is a "mailto:[email protected]" link 5 * @author Gregory Beaver <[email protected]> 6 */ 7 /** 8 * function datafunction 9 * another contributor authored this function 10 * @author Joe Shmoe 11 */ 12 function datafunction() 13 { 14 ... 15 }
Page 54 of 1382
@category
Specify a category to organize the documented element's package into
Description
The @category tag is used to organize groups of packages together. This is directly applicable to the XML:DocBook/peardoc2 Converter, and can be used by other converters. Other Converters packaged with phpDocumentor ignore the category, but this may change in future versions. It is also possible to dynamically specify category using the -dc, --defaultcategoryname command-line switch.
Example
Here's an example:
1 /** 2 * Page-Level DocBlock 3 * @package MyPackage 4 * @category mycategory 5 */ 6 7 /** 8 * @global array used for stuff 9 */ 10 function mine() 11 { 12 global$baz; 13 ... 14 }
Page 55 of 1382
@copyright
Document Copyright information
Description
The @copyright tag is used to document the copyright information of any element that can be documented (global variable, include, constant, function, define, class, variable, method, page). phpDocumentor will display the copyright string unaltered.
NEW v1.2 - @copyright is now inherited by child classes from a parent class, see inline {@inheritdoc}.
Example
1 /** 2 * Page-Level DocBlock example. 3 * @author Gregory Beaver <[email protected]> 4 * @copyright Copyright (c) 2002, Gregory Beaver 5 */ 6 /** 7 * function datafunction 8 */ 9 function datafunction() 10 { 11 ... 12 }
Page 56 of 1382
@deprecated
Document elements that have been deprecated and should not be used as they may be removed at any time from a future version
Description
The @deprecated tag is used to document the deprecation version or other information of any element that can be documented except for page (global variable, include, constant, function, define, class, variable, method). If present, phpDocumentor will display the optional version/info string unaltered.
Use @deprecated to notify users of deprecated elements that should not be used any longer
Example
Here's an example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/** * @deprecated deprecated since version 2.0 */ function uselessfunction() { ... } /** * also legal * @deprecated */ class stupidclass { ... }
Page 57 of 1382
@example
Include an external example file with syntax highlighting
Description
The example tag can be used to parse an example file for syntax highlighting and linking to documentation. This versatile tag attempts to read the file from the full path specified, and will accept any path that http://www.php.net/fopen will accept. phpDocumentor checks the path to ensure that the file retrieved has a valid .php extension as defined in phpDocumentor.ini, and then opens the file. It will parse the file, and output syntax-highlighted source with line numbers, links to documentation and will then add a link to the documentation to that file.
If given an absolute path, phpDocumentor will not search for the example file any further. If given a relative path (no leading c:\ or /) phpDocumentor searches for examples files first in the directory specified by the -ed, --examplesdir command-line, if present. As of phpDocumentor 1.2.1, it will next search for the file in an examples/ subdirectory of the current file's directory. Otherwise, it will search for a subdirectory named "examples" in the top-level parsing directory, and if not found, in the top-level directory.
The top-level parsing directory is simply the directory that every file parsed has in common.
The @filesource tag serves a similar purpose, but instead of parsing a separate file, it parses the current file's source.
To do an inline code example, use the html tag <code> or the new
Warning: @example only works with PHP 4.3.0+ due to the use of the tokenizer extension, which was not stable prior to PHP 4.3.0. Go to http://www.php.net and download PHP 4.3.0 to use @example
Example
Here's an example:
1 2 3 4 5 6 7 8 9 10 11
/** * My function * * Here is an inline example: * <code> * <?php * echo strlen('6'); * ?> * </code> * @example /path/to/example.php How to use this function * @example anotherexample.inc This example is in the "examples" subdirectory
Page 58 of 1382
12 13 14 15
*/ function mine() { }
Page 59 of 1382
@final
Document a class method that should never be overridden in a child class
Description
Use the @final tag to declare a method that cannot be overridden in a child class.
Warning: The @final tag is only valid in PHP 4, PHP 5 has a keyword final.
Example
Here's an example:
1 /** 2 * example of basic @final usage in a class 3 */ 4 class myclass 5 { 6 /** 7 * function1 should never be overridden 8 * @final 9 */ 10 function function1($baz) 11 { 12 ... 13 } 14 15 function function2() 16 { 17 ... 18 } 19 }
Page 60 of 1382
@filesource
create a syntax-highlighted cross-referenced file containing source code of the current file and link to it
Description
The @filesource tag can only be used in a page-level DocBlock, it will be ignored anywhere else. phpDocumentor parses the file source of the current file, and outputs syntax-highlighted source code with line numbers, links to documentation and then adds a link to the generated file in the documentation.
The @example tag serves a similar purpose, but is designed to parse and create a link to an external example file.
Warning: @filesource only works with PHP 4.3.0+ due to the use of the tokenizer extension, which was not stable prior to PHP 4.3.0. Go to http://www.php.net and download PHP 4.3.0 to use @filesource
Example
Here's an example:
1 /** 2 * Contains several example classes that I want to parse but I 3 * also want to show the full source 4 * @package mypackage 5 * @subpackage example 6 * @filesource 7 */ 8 /** 9 * This class does things 10 * @package mypackage 11 * @subpackage example 12 */ 13 class oneofmany extends mainclass 14 { 15 ...
Page 61 of 1382
@global
Document a global variable, or its use in a function/method
Description
Since there is no standard way to declare global variables, phpDocumentor requires that a @global tag be used in a docblock preceding a global variable's definition. To support previous usage of @global, there is an alternate syntax that applies to DocBlocks preceding a function, used to document usage of global variables. in other words, There are two usages of @global: definition and function usage.
phpDocumentor will not attempt to automatically parse out any global variables. Only one @global tag is allowed per global variable DocBlock. A global variable DocBlock must be followed by the global variable's definition before any other element or DocBlock occurs in the source, or an error will be raised.
$varname should be the EXACT name of the global variable as it is declared in the source (use @name to change the name displayed by documentation)
The function/method @global syntax is used to document usage of global variables in a function, and MUST NOT have a $ starting the third word. The datatype will be ignored if a match is made between the declared global variable and a variable documented in the project.
phpDocumentor will check to see if the type specified is the name of a class that has been parsed. If so, it will make a link to that class as the type instead of just the type.
Example
Here's an example of documenting the definition of a global variable:
1 /** 2 * example of incorrect @global declaration #1 3 * @global bool $GLOBALS['baz'] 4 * @author blahblah 5 * @version -6 6 */ 7 include "file.ext" ( ); 8 // error - element encountered before global variable declaration, docblock will apply to this include! 9 $GLOBALS 'baz'] = array('foo','bar'); [ 10 11 /** example of incorrect @global declaration #2 12 * @global parserElement $_Element
Page 62 of 1382
13 */ 14 /** 15 * error - this DocBlock occurs before the global variable definition and will apply to the function, 16 * ignoring the global variable completely 17 * / 18 $_Element = new parserElement; 19 20 function oopsie() 21 { 22 ... 23 } 24 25 /** example of correct @global declaration, 26 * even with many irrelevant things in between 27 * @global mixed $_GLOBALS["myvar"] 28 */ 29 // this is OK 30 if ($pre) 31 { 32 $thisstuff 'is fine too'; = 33 } 34 $_GLOBALS "myvar" [ ] = array( "this" => 'works just fine'); 35 36 /** 37 * example of using @name with @global 38 * the @name tag *must* have a $ in the name, or an error will be raised 39 * @global array $GLOBALS['neato'] 40 * @name $neato 41 */ 42 $GLOBALS 'neato'] = 'This variable\'s name is documented as $neato, and not as [ $GLOBALS[\'neato\']';
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/** * Used to showcase linking feature of function @global */ class test { } /** * @global test $GLOBALS['baz'] * @name $bar */ $GLOBALS 'bar'] = new test [ /** * example of basic @global usage in a function * assume global variables "$foo" and "$bar" are already documented * @global bool used to control the weather * @global test used to calculate the division tables * @param bool $baz * @return mixed */ function function1($baz) {
Page 63 of 1382
24 25 26 27 28 29 30 31 32 33 34 35 36
global$foo,$bar; // note that this also works as: // global $foo; // global $bar; if ($baz) { $a = 5; } else { $a = array(1,4); } return$a; }
Page 64 of 1382
@ignore
Prevent documentation of an element
Description
Use @ignore to prevent phpDocumentor from documenting an element, such as a duplicate element.
Example
Here is an example of how to use @ignore:
1 if ($ostest ) 2 { 3 /** 4 * This define will either be 'Unix' or 'Windows' 5 */ 6 define("OS" ,"Unix" ); 7 } else 8 { 9 /** 10 * @ignore 11 */ 12 define("OS" ,"Windows" ); 13 }
Page 65 of 1382
@internal
Mark documentation as private, internal to the software project
Description
Use @internal to facilitate the creation of two sets of documentation, one for advanced developers or for internal company use, and the other for the general PHP public. Use this tag or its cousin, inline {@internal}}
@internal responds to the command-line -pp, --parseprivate, as both @internal and --parseprivate share the same purpose. In both cases, the intent is to allow the creation of two sets of documentation, one for public use, and the other for a subset of developers, either the project developers or those who wish to extend the project. In essence, it allows the creation of both user-level and programmer-level documentation from the same source, and is one of phpDocumentor's most useful features.
Example
Here is an example of how to use @internal and {@internal}}:
1 2 3 4 5 6 7 8 9 10 11
/** * This class does things * * {@internal To access the company guidelines on modifying this class, * see {@link http://www.example.com Company Guidelines}, or contact * your supervisor}}} * Using this class can be very helpful for several reasons. etc. etc. * @internal the class uses the private methods {@link _foo()} and * {@link _bar()} to do some wacky stuff */ class Doesthings
Page 66 of 1382
@license
Display a hyperlink to a URL for a license
Description
You may use the @license tag to document any element (include, page, class, function, define, method, variable)
URL is any valid Uniform Resource Locator that points to the full text of a license. The description for the license is optional
Example
Here's an example:
1 /** 2 * Displays <a href="http://opensource.org/licenses/gpl-license.php">GNU Public License</a> 3 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 4 */ 5 class opensource_class {...}
Page 67 of 1382
@link
Display a hyperlink to a URL in the documentation
Description
You may use the @link tag to document any element (include, page, class, function, define, method, variable). The guidelines for giving the element name to @link are the same as outlined in the @see manual page.
Caution Unless linking to an element, @link assumes the arguments passed are fully-formed URLs. Generally speaking, if you want to link to an element's documentation, use @see or inline {@link}... you can use @link, but the other options are better. URL is any valid Uniform Resource Locator (http://www.example.com, telnet://example.com, ftp://ftp.example.com, mailto:[email protected], etc.)
Note that as of version 1.2.0, it is possible to specify a short description for the link to use as the link text instead of the URL.
Example
Here's an example:
1 /** 2 * Displays <a href="http://www.example.com">http://www.example.com</a> 3 * @link http://www.example.com 4 */ 5 define("TEST_CONSTANT" ,3); 6 /** 7 * Displays <a href="http://www.example.com">Hello</a> 8 * @link http://www.example.com Hello 9 */ 10 define("TEST_CONSTANT2" ,3); 11 /** 12 * You SHOULD use @see here instead of @link, but here's how it works: 13 * displays <a href="./MyDocs/MyPackage/MyClass.html">MyClass</a> 14 * @link MyClass 15 */ 16 define("TEST_CONSTANT3" ,3);
Page 68 of 1382
@method
"Magic" Method of a class.
Description
@method shows a "magic" method that is found inside the class.
returntype should be a valid PHP type or "mixed." phpDocumentor will display the optional description unmodified, and defaults to "void" if the returntype is not present.
Example
1 /** 2 * show off @method 3 * 4 * @method int borp() borp(int $int1, int $int2) multiply two integers 5 */ 6 class Magician 7 { 8 function __call( method $params $ , ) 9 { 10 if ($method== 'borp') { 11 if ( count( $params == 2) { ) 12 return$params 0] * [ $params 1]; [ 13 }}}}
Using this "magic" tag will result in the tag info being listed in the "infomational" tag listing for the class itself. It does NOT generate actual "method" or "function" entities in the document.
In the example above, when using PhpDocumentor with the HTML:Smarty:HandS converter, you'll see the "__call()" method shown in the "Method Summary" listing of your class methods, but you will NOT see "borp()" there, because the latter is not an explicitly declared method in your code. You WILL see "borp()" in the class-level's "API Tags" listing, thanks to your "@method" tag in the class-level docblock.
Page 69 of 1382
@name
Specify an alias to use for a procedural page or global variable in displayed documentation and linking
Description
phpDocumentor recognizes the @name tag in global variable DocBlocks (in conjunction with @global), and uses it to rename a global variable for documentation to make it more readable. A global variable name MUST begin with a dollar sign ($) or phpDocumentor will ignore the tag and raise an error.
Example
Here's an examples:
1 /** 2 * Now, when @global is used in a function, it will link to $baz 3 * @name $baz 4 * @global array $GLOBALS['baz'] 5 */ 6 $GLOBALS 'baz'] = array('foo','bar'); [ 7 8 /** 9 * @global array used for stuff 10 */ 11 function mine() 12 { 13 global$baz; 14 }
Page 70 of 1382
@package
Specify package to group classes or functions and defines into
Description
@package can only be used to document procedural pages or classes.
Packages are used to help you logically group related elements. You write classes to group related functions and data together, and phpDocumentor represents the contents of files (functions, defines, and includes) as "Procedural Pages." A package is used to group classes and procedural pages together in the same manner that a directory groups related files together.
If found in a page-level DocBlock, packagename specifies the package that all functions, includes, and defines in the php file belong to. If found in a class-level DocBlock, packagename specifies the package that the class belongs to.
Caution If not present, a class's package is set to default, or the value of the -dn command-line switch, even if the page-level package is set to another value. This may be changed by the command-line option -dn or --defaultpackagename. PACKAGES MUST BE ONE WORD WITH NO SPACES OR NEWLINES CONTAINING ONLY LETTERS, DIGITS, and "_", "-", "[" or "]" @package groups php files together for documentation.
There are two ways a @package tag is parsed: <ol role = "I"> page-level package (defines, functions, includes/requires) class-level package (class, all its variables and methods)
If a file contains functions and defines, they will be packaged by a page-level DocBlock. A page-level DocBlock is a DocBlock at the top of a file that precedes another DocBlock. In other words, it is not paired with any phpDocumentor element (include, function, define, class, class function, class variable).
Example
phpDocumentor parses a DocBlock as a page-level DocBlock if it precedes another DocBlock like this:
1 2 3 4
/** * Page-Level DocBlock example. * This DocBlock precedes another DocBlock and will be parsed as the page-level. * Put your @package and @subpackage tags here
Page 71 of 1382
A page is documented as a procedural page if it is parsed, regardless of its content (NEW in 1.0).
A class-level DocBlock is any DocBlock that precedes a class definition in a php file.
1 <?php 2 /** 3 * class bluh 4 * class-level DocBlock example. 5 * @package applies_to_bluh 6 */ 7 class bluh 8 { 9 /** 10 * This variable is parsed as part of package applies_to_bluh 11 */ 12 var $foo; 13 14 /** 15 * So is this function 16 */ 17 function bar() 18 { 19 }} 20 ?>
If no @package tag is specified, the package named "default" will be used, with one major exception. If a class extends a parent class that has a @package tag, it will inherit the package from the parent class. This can be very useful in small projects. HOWEVER, it is highly recommended that a @package tag is used before every class that should have that package to avoid name collisions. What is a name collision? If you are documenting two related but separate packages, and both packages contain classes with the same name. For example, the tests package included with phpDocumentor contains several files used to verify the eradication of bugs from phpDocumentor. Several of these files contain classes with the same name as classes in phpDocumentor. phpDocumentor cannot determine the correct parent class automatically and will not inherit package at all to avoid a wrong guess. WE HIGHLY RECOMMEND THAT YOU USE @package IN THE DOCBLOCK OF EVERY CLASS OR PROCEDURAL PAGE YOU WISH TO BE IN A PACKAGE.
Page 72 of 1382
@param
Document a function parameter
Description
NOTE: as of 0.4.1, @param can document phpdoc.de-style, with optional $paramname
The datatype should be a valid PHP type (int, string, bool, etc), a class name for the type of object, or simply "mixed". Further, you can list multiple datatypes for a single parameter by delimiting them with the pipe (e.g. "@param int|string $p1"). You may document parameters listed or any optional paramters that will be parsed by standard PHP functions func_num_args()/get_func_arg(). Recommended name format for parameters listed with func_get_arg() is: $paramname if there is only one parameter $paramname,... if the number of parameters is unlimited
Note that the $paramname,... will be shown in the output docs in both the parameter listing AND the function signature. If you are not indicating in the actual code that the parameter is optional (via "$paramname = 'a default value'"), then you should mention in the parameter's description that the parameter is optional.
Example
Here's an example:
1 /** 2 * example of basic @param usage 3 * @param bool $baz 4 * @return mixed 5 */ 6 function function1($baz) 7 { 8 if ($baz) 9 { 10 $a = 5; 11 } else 12 { 13 $a = array(1,4); 14 } 15 return$a; 16 } 17 18 class class1 19 { 20 /**
Page 73 of 1382
21 * example of documenting a method, and using optional description with @return 22 * @return string de-html_entitied string (no entities at all) 23 */ 24 function bar( foo) $ 25 { 26 return strtr($foo, array_flip(get_html_translation_table(HTML_ENTITIES))); 27 } 28 } 29 30 /** 31 * Example of documenting multiple possible datatypes for a given parameter 32 * @param bool|string $foo sometimes a boolean, sometimes a string (or, could have just used "mixed") 33 * @param bool|int $bar sometimes a boolean, sometimes an int (again, could have just used "mixed") 34 */ 35 function function2($foo, $bar) 36 { 37 if (!$foo) 38 { 39 // definitely not a string, and not a boolean TRUE... could ONLY be a boolean FALSE 40 } 41 42 if (!$bar) 43 { 44 // could ONLY be a boolean FALSE or an integer "0" 45 } 46 } 47 48 /** 49 * Example of documenting undetermined function arguments 50 * (notice how $foo_desc is NOT part of the actual function signature in the code, but still gets documented) 51 * @param string $foo 52 * @param mixed $foo_descoptional description of foo 53 */ 54 function function3($foo) 55 { 56 echo $foo; 57 if ( func_num_args == 2) 58 { 59 echo 'Description: '.func_get_arg(1); 60 } 61 } 62 63 /** 64 * Example of unlimited parameters. 65 * Returns a formatted var_dump for debugging purposes 66 * (since the recurrences of $v are not listed in the actual function signature in the code, 67 * you may wish to highlight they are "optional" in their description) 68 * @param string $sstring to display 69 * @param mixed $vvariable to display with var_dump() 70 * @param mixed $v,...unlimited OPTIONAL number of additional variables to display with var_dump() 71 */ 72 function fancy_debug($s,$v) 73 { 74 print $s. <blockquote>\n" " ; 75 var_dump( $v); 76 if ( func_num_args()> 2)
Page 74 of 1382
77 78 79 80 81 82 83 84 85
{ for($i= 2; i< func_num_args(); $i++) $ { $a = func_get_arg( $i); var_dump( $a); print "<br>\n" ; }} print "</blockquote>\n" ; }
Page 75 of 1382
@property
"Magic" Property of a class.
Description
@property shows a "magic" property variable that is found inside the class.
datatype should be a valid PHP type or "mixed." phpDocumentor will display the optional description unmodified, and defaults to "mixed" if the datatype is not present.
The property is presumed to be available for both read and write operations. If the property is read-only, you should use the @property-read tag instead. If the property is write-only, use @property-write.
Example
1 /** 2 * show off @property, @property-read, @property-write 3 * 4 * @property mixed $regular regular read/write property 5 * @property-read int $foo foo prop the 6 * @property-write string $bar bar prop the 7 */ 8 class Magician 9 { 10 private $_thingy ; 11 private $_bar; 12 13 function __get( var) $ 14 { 15 switch($var) { 16 case 'foo' : 17 return 45; 18 case 'regular' : 19 return$this -> _thingy ; 20 }} 21 22 function __set( var, $val) $ 23 { 24 switch($var) { 25 case 'bar' : 26 $this -> _bar = $val; 27 break; 28 case 'regular' : 29 if ( is_string( $val)) { 30 $this -> _thingy= $val; 31 }}} 32 }
Page 76 of 1382
Using these "magic" tags will result in the tag info being listed in the "infomational" tag listing for the class itself. It does NOT generate actual "property" or "variable" entities in the document.
In the example above, when using PhpDocumentor with the HTML:Smarty:HandS converter and the "-parseprivate on" setting, you'll see "$_thingy" and "$_bar" shown in the "Property Summary" listing of your class variables, but you will NOT see "$regular", "$foo", or "$bar" there, because the latter three are not explicitly declared variables in your code. You WILL see "$regular", "$foo" and "$bar" in the class-level's "API Tags" listing, thanks to your "@property" tags in the class-level docblock.
Page 77 of 1382
@return
Specify the return type of a function or method
Description
The @return tag is used to document the return value of functions or methods. @returns is an alias for @return to support tag formats of other automatic documentors
The datatype should be a valid PHP type (int, string, bool, etc), a class name for the type of object returned, or simply "mixed". If you want to explicitly show multiple possible return types, list them pipe-delimited without spaces (e.g. "@return int|string"). If a class name is used as the datatype in the @return tag, phpDocumentor will automatically create a link to that class's documentation. In addition, if a function returns multiple possible values, separate them using the | character, and phpDocumentor will parse out any class names in the return value. phpDocumentor will display the optional description unmodified.
Example
Here's an example:
1 /** 2 * example of basic @return usage 3 * @return mixed 4 */ 5 function function1($baz) 6 { 7 if ($baz) 8 { 9 $a = 5; 10 } else 11 { 12 $a = array(1,4); 13 } 14 return$a; 15 } 16 17 /** 18 * example of showing multiple possible return types 19 * @return int|string could be an int, could be a string 20 */ 21 function function2($foo) 22 { 23 if ($foo) 24 { 25 return 0; 26 } 27 else 28 { 29 return "zero" ; 30 }
Page 78 of 1382
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
} class class1 { /** * example of documenting a method, and using optional description with @return * @return string de-html_entitied string (no entities at all) */ function bar( foo) $ { return strtr($foo, array_flip(get_html_translation_table(HTML_ENTITIES))); } /** * example of using @return with a class name * @param integer even or odd integer * @return Parser|false phpDocumentor Parser object or error */ function& factory( number $ ) { $returnval= true; if ($number% 2) { $returnval= new Parser; } else { $returnval= false; } return$returnval ; } }
Page 79 of 1382
@see
Display a link to the documentation for an element
Description
The @see tag may be used to document any element (global variable, include, page, class, function, define, method, variable)
Caution @see only displays links to element documentation. If you want to display a hyperlink, use @link or inline {@link} New in version 1.2: You can link to any defined function in the current php version using the function's name. This linking is done using the standard php function http://www.php.net/get_defined_functions, and so relies on the version of php that is used to execute phpDocumentor. A benefit of this method is that the function highlighting will automatically upgrade with a php upgrade without any change to the underlying code. You may also link directly to any portion of the php website using the fake package override PHP_MANUAL (as in PHP_MANUAL#get_defined_functions, or PHP_MANUAL#support.php)
Along with inline {@link}, the @see tag is among the most useful features of phpDocumentor. With this tag, you can create a link to any element (except include/require) in the documentation with a very wide range of options. The @see parser can be told exactly where to look using some basic punctuation: :: -- This is the class scope override. Use it to tell the @see parser which class to look in for the element specified, like classname::methodname() or classname::$variablename. () -- When present at the end of elementname, like elementname(), this tells the @see parser to search for a function or method. $ -- When present at the beginning of elementname, like $elementname, this tells the @see parser to search for a variable in the current class.
However, @see is also intelligent enough to recognize shorthand. If @see receives an elementname with no punctuation, it will search for an element in this order:
1. 2. 3. 4.
is elementname the name of a class? is elementname the name of a procedural page? (file.ext) is elementname the name of a define? if the DocBlock containing the @see is in a class:
1. 2.
is elementname a function?
Page 80 of 1382
@see parsing is slightly slower when passed an elementname with no punctuation, especially if the elementname is a function, so use it sparingly in large projects (500+ elements with @sees in their DocBlocks). The best use for punctuation-less elementname is in a project whose classnames are in flux.
Example
Here's an example of valid @see syntax:
1 /** 2 * class 1 3 * 4 * example of use of the :: scope operator 5 * @see subclass::method() 6 */ 7 class main_class 8 { 9 /** 10 * example of linking to same class, outputs <u>main_class::parent_method()</u> 11 * @see parent_method 12 */ 13 var foo = 3; 14 15 /** 16 * subclass inherits this method. 17 * example of a word which is either a constant or class name, in this case a classname 18 * @see subclass 19 * @see subclass::$foo 20 */ 21 22 function parent_method() 23 { 24 if ($this -> foo== 9) die; 25 } 26 } 27 28 /** 29 * this class extends main_class. 30 * example of linking to a constant, and of putting more than one element on the same line 31 * @see main_class, TEST_CONST 32 */ 33 subclass extendsmain_class 34 { 35 /** 36 * example of same class lookup - see will look through parent hierarchy to 37 * find the method in { @link main_class} 38 * the above inline link tag will parse as <u>main_class</u> 39 * @see parent_method() 40 */ 41 var $foo = 9; 42 } 43 44 define("TEST_CONST" ,"foobar" );
Page 81 of 1382
@since
Document when (at which version) an element was first added to a package
Description
The @since tag may be used to document the release version of any element that can be documented (global variable, include, constant, function, define, class, variable, method, page). phpDocumentor will display the version/info string unaltered.
Use @since to document revisions, as in "This function has been a part of this package since version 2.0"
Example
Here's an example:
1 /** 2 * Page-level DocBlock 3 * @package BigImportantProjectWithLotsofVersions 4 * @version 72.5 5 */ 6 /** 7 * function datafunction 8 * @since Version 21.1 9 */ 10 function datafunction() 11 { 12 ... 13 }
Page 82 of 1382
@static
Document a static property or method
Description
Use the @static tag to declare a variable or method to be static. Static elements can be called without reference to an instantiated class object, as in class::variable and class::method().
Example
Here's an example:
1 /** 2 * example of a class 3 * with a single static variable 4 * and method 5 */ 6 class myclass 7 { 8 /** 9 * a static variable 10 * @static 11 */ 12 public static$astaticvar= 0; 13 /** 14 * normal variable 15 */ 16 public $anormalvar= 1; 17 /** 18 * a static function 19 * @static 20 */ 21 function mystaticfunction() 22 { 23 ... 24 } 25 /** 26 * normal function 27 */ 28 function mynormalfunction() 29 { 30 ... 31 } 32 } 33 34 // example of usage of static methods 35 myclass::mystaticvar; 36 myclass::mystaticfunction();
Page 83 of 1382
Just using the static keyword in your code is enough for PhpDocumentor on PHP5 to recognize static variables and methods, and PhpDocumentor will mark them as static.
However, using the static tag will also result in PhpDocumentor marking the variable or method as static, even if the PHP code does not use the static keyword. So, using the tag but not the keyword actually means your code behavior will not match your API doc... so handle with care. The good news is that using both the keyword and the tag will not result in a double "static" in the resulting doc.
Ideally, the static keyword in your code is sufficient for the resulting docs to show your members are static. This tag appears to be a "helpful" tag for use in PHP4 code, allowing you to hint that you want the member to be treated as static, even if PHP4 doesn't have the ability to make it act that way. Most likely, you'll use this tag as a reminder that your intention with this member, once you move the code from PHP4 to PHP5, will be for that member to be static.
Page 84 of 1382
@staticvar
Document a static variable's use in a function/method
Description
Datatype should be a valid PHP type or "mixed."
Example
Here's an example:
1 /** 2 * example of basic @staticvar usage in a function 3 * @staticvar integer used to calculate the division tables 4 * @staticvar array $bar used to make me happy. Note that $bar is part of the description is 5 * @param bool $baz 6 * @return mixed 7 */ 8 function function1($baz) 9 { 10 static$foo = 6, $bar = array(); 11 // note that this works as: 12 // static $foo = 6; 13 // static $bar = array(); 14 if ($baz) 15 { 16 $a = 5; 17 } else 18 { 19 $a = array(1,4); 20 } 21 return$a; 22 }
Page 85 of 1382
@subpackage
Specify sub-package to group classes or functions and defines into. Requires @package tag
Description
@subpackage works with @package to group php files together for documentation.
If found in a page-level DocBlock, specifies the sub-package that all functions and defines in the php file belong to. If found in a class-level DocBlock, specifies the sub-package that the class belongs to.
Caution If @package is not present in the same DocBlock, the @subpackage tag is ignored. A SUBPACKAGE NAME MUST BE ONE WORD WITH NO SPACES OR NEWLINES CONTAINING ONLY LETTERS, DIGITS, and "_", "-", "[" or "]" A @subpackage tag is applied to documented elements in the same way that @package is applied.
If a file contains functions and defines, they will be packaged by a page-level DocBlock. A page-level DocBlock is a DocBlock that is not paired with any phpDocumentor element (include, function, define, class, class function, class variable).
NOTE: The @subpackage tag is intended to help categorize the elements that are in an actual @package value. Since PHP itself doesn't allow you to have two functions with the same name in the same script, PhpDocumentor also requires all names in an @package to be unique... meaning, @subpackage does not allow further "naming separation" inside that @package. What it does do is allow a level of visual grouping/separation of the elements inside that @package.
Example
phpDocumentor parses a DocBlock as a page-level DocBlock if it precedes another DocBlock like this:
1 /** 2 * Page-Level DocBlock example. 3 * This DocBlock precedes another DocBlock and will be parsed as the page-level. 4 * Put your @package and @subpackage tags here 5 * @package pagelevel_package 6 * @subpackage data 7 */ 8 /** 9 * function datafunction 10 */ 11 function datafunction() 12 {
Page 86 of 1382
13 14
... }
A class-level DocBlock is any DocBlock that precedes a class definition in a php file.
1 <?php 2 /** 3 * class bluh 4 * class-level DocBlock example. 5 * @package applies_to_bluh 6 * @subpackage bluh 7 */ 8 class bluh 9 { 10 /** 11 * This variable is parsed as part of package applies_to_bluh, and subpackage bluh 12 */ 13 var $foo; 14 15 /** 16 * So is this function 17 */ 18 function bar() 19 { 20 }} 21 ?>
Page 87 of 1382
@todo
Document changes that will be made in the future
Description
Use @todo to document planned changes to an element that have not been implemented. phpDocumentor will display the information string unaltered.
The @todo tag may be used to document future changes to almost any element that can be documented (global variable, constant, function, define, class, variable, method, page). Since v1.3.0, @todo can no longer be used on an "include" element.
Example
Here's an example:
1 /** 2 * Page-level DocBlock 3 * @package unfinished 4 * @todo finish the functions on this page 5 */ 6 /** 7 * function datafunction 8 * @todo make it do something 9 */ 10 function datafunction() 11 { 12 }
Page 88 of 1382
@tutorial
Display a link to the documentation for a tutorial
Description
The @tutorial tag may be used to document any element (global variable, include, page, class, function, define, method, variable)
Caution @tutorial only displays links to tutorials/extended documentation. If you want to display a hyperlink or link to a documented element, use @see or @link or inline {@link} Along with inline {@tutorial}, the @tutorial tag is among the most useful features of phpDocumentor. With this tag, you can create a link to any tutorial or extended documentation. The @tutorial parser can be told exactly where to look using a format similar to a URI: package/ -- Preface to specify a tutorial in a specific package subpackage/ -- Preface to specify a tutorial in a specific package/subpackage #section -- Link to a specific section of the documentation package/subpackage/tutorial.ext#section .subsection -- Link to a specific sub-section of the documentation package/subpackage/tutorial.ext#section.subsection
However, @tutorial, like @see, is also intelligent enough to recognize shorthand. The search order for a tutorial is identical to what is specified in @see
Example
Here's an example of valid @tutorial syntax:
1 /** 2 * This will link to the phpDocumentor.pkg tutorial if it is unique, regardless 3 * of its location 4 * @tutorial phpDocumentor.pkg 5 */ 6 class test1 7 { 8 } 9 10 /** 11 * This will link to the phpDocumentor.pkg tutorial if and only if it is in the 12 * phpDocumentor package, any subpackage. 13 * @tutorial phpDocumentor/phpDocumentor.pkg 14 */ 15 class test2 16 {
Page 89 of 1382
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
} /** * This will link to the phpDocumentor.pkg tutorial if and only if it is in the * phpDocumentor package, info subpackage. * @tutorial phpDocumentor/info/phpDocumentor.pkg */ class test3 { } /** * This will link to the phpDocumentor.pkg tutorial, section1 and subsection one * @tutorial phpDocumentor.pkg#section1, phpDocumentor.pkg#section1.subsection1 */ class test4 { }
Page 90 of 1382
@uses
Display a link to the documentation for an element, and create a backlink in the other element's documentation to this
Description
Caution Since version 1.2.0beta3, the syntax for @uses has changed. It differs in that @uses now contains a description of how the element is used and does not allow a comma-delimited list of values any longer. The @uses tag may be used to document any element (global variable, include, page, class, function, define, method, variable)
Caution @uses only displays links to element documentation. If you want to display a hyperlink, use @link or inline {@link} @uses is very similar to @see, see the documentation for @see for details on format and structure. The @uses tag differs from @see in two ways. @see is a one-way link, meaning the documentation containing a @see tag contains a link to other documentation. The @uses tag automatically creates a virtual @usedby tag in the other documentation that links to the documentation containing the @uses tag. In other words, it is exactly like @see, except a return link is added automatically.
The other difference is that @uses only accepts one element to link to, and a description of that element.
Example
Here's an example of valid @uses syntax:
1 /** 2 * class 1 3 * 4 */ 5 class main_class 6 { 7 /** 8 * @var integer 9 */ 10 var foo = 3; 11 12 /** 13 * subclass inherits this method. 14 * example of a word which is either a constant or class name, 15 * in this case a classname 16 * @uses subclass sets a temporary variable
Page 91 of 1382
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
* @uses subclass::$foo this is compared to TEST_CONST * @uses TEST_CONST compared to subclass::$foo, we * die() if not found */ function parent_method() { if ($this -> foo== 9) die; $test = new subclass; $a = $test-> foo; if ($a == TEST_CONST) die; } } /** * this class extends main_class. */ subclass extendsmain_class { /** * @var integer */ var $foo = 9; } define("TEST_CONST" ,"foobar" );
1 /** 2 * class 1 3 * 4 */ 5 class main_class 6 { 7 /** 8 * @var integer 9 */ 10 var foo = 3; 11 12 /** 13 * subclass inherits this method. 14 * example of a word which is either a constant or class name, 15 * in this case a classname 16 * @uses subclass sets a temporary variable 17 * @uses subclass::$foo this is compared to TEST_CONST 18 * @uses TEST_CONST compared to subclass::$foo, we 19 * die() if not found 20 */ 21 22 function parent_method() 23 { 24 if ($this -> foo== 9) die; 25 $test = new subclass; 26 $a = $test-> foo; 27 if ($a == TEST_CONST) die; 28 }
Page 92 of 1382
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
} /** * this class extends main_class. * @usedby main_class::parent_method() sets a temporary variable */ subclass extendsmain_class { /** * @var integer * @usedby main_class::parent_method() this is compared to TEST_CONST */ var $foo = 9; } /** * @usedby main_class::parent_method() compared to subclass::$foo, we * die() if not found */ define("TEST_CONST" ,"foobar" );
Page 93 of 1382
@var
Document the data type of a class variable
Description
You may use the @var tag to document the data type of class variables.
The datatype should be a valid PHP type (int, string, bool, etc), a class name for the type of object, or simply "mixed". phpDocumentor will display the optional description unmodified, and defaults to "mixed" if the datatype is not present
Example
Here's an example:
1 class class1 2 { 3 /** 4 * example of documenting a variable's type 5 * @var string 6 */ 7 var $variable ; 8 /** 9 * example of documenting a variable's type 10 * @var string contains class1 information 11 */ 12 var $variable_with_desc ; 13 /** 14 * this variable is documented as type "mixed" since no @var tag is present 15 */ 16 var $mixed_variable ; 17 }
Page 94 of 1382
@version
Version of current element
Description
Documents the version of any element, including a page-level block
NEW v1.2 - @version is now inherited by child classes from a parent class, see inline {@inheritdoc}.
Example
phpDocumentor displays a @version string without modification, so it may be used in any way you'd like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/** * example of @version tag with CVS tag * @version $Id: tags.version.pkg,v 1.2 2006-04-29 04:08:27 cellog Exp $; */ function datafunction() { } /** * Custom version string * @version customversionstring1.0 */ class blah { }
Page 95 of 1382
Unlike regular tags (see phpDocumentor tags), Inline tags display in the text flow where they appear. As of version 1.2, there are several inline tags. The allowed inline tag list is different for tutorials and regular in-code documentation.
Inline tags allowed in both tutorials and DocBlocks include: inline {@link} inline {@tutorial}
Inline tags allowed in only DocBlocks include: inline {@source} inline {@inheritdoc}
Inline tags allowed in only tutorials include: inline {@id} inline {@toc}
The example below will display the text "this function works heavily with foo() to rule the world" where foo() represents a hyperlink that links to the function foo()'s documentation.
1 /** 2 * inline tags demonstration 3 * 4 * this function works heavily with {@link foo()} to rule the world. If I want 5 * to use the characters "{@link" in a docblock, I just use "{@}link." If 6 * I want the characters "{@*}" I use "{@}*}" 7 */ 8 function bar() 9 { 10 } 11 12 function foo()
Page 96 of 1382
inline {@example}
Display source code of an example file inline
Description
Like the @example tag, the inline example tag can be used to parse an example file for syntax highlighting and linking to documentation. This versatile tag attempts to read the file from the full path specified, and will accept any path that http://www.php.net/fopen will accept. phpDocumentor checks the path to ensure that the file retrieved has a valid .php extension as defined in phpDocumentor.ini, and then opens the file. It will parse the file, and output syntax-highlighted source with line numbers, links to documentation and will then add a link to the documentation to that file.
If given an absolute path, phpDocumentor will not search for the example file any further. If given a relative path (no leading c:\ or /) phpDocumentor searches for examples files first in the directory specified by the -ed, -examplesdir command-line, if present. As of phpDocumentor 1.2.1, it will next search for the file in an examples/ subdirectory of the current file's directory. Otherwise, it will search for a subdirectory named "examples" in the top-level parsing directory, and if not found, in the top-level directory.
The top-level parsing directory is simply the directory that every file parsed has in common.
The inline {@source} tag serves a similar purpose, but instead of parsing a separate file, it parses the current function or method's source.
The {@example} tag has two optional parameters, the starting line number to display and the ending line number to display. If only the first parameter is present, {@example} will print the source code starting on that line number to the end of the function source code. If both parameters are present, {@example} will print an excerpt of the source code beginning on the starting line number, and concluding with the ending line number.
Example
Here's an example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/** * My function * * Here is an inline example: * <code> * <?php * echo strlen('6'); * ?> * </code> * and using an external example file: * {@example /path/to/example.php} * * Display only the first 2 lines: * {@example /path/to/example.php 0 2}
Page 97 of 1382
15 16 17 18 19 20
* @example /path/to/example.php How to use this function * @example anotherexample.inc This example is in the "examples" subdirectory */ function mine() { }
Page 98 of 1382
inline {@id}
Used to control XML tutorial ids in refsects
Description
The {@id} inline tag is used only in tutorials/extended documentation. It is very simply designed to solve the problem of identifying sections for hyperlinking. For instance, in the DocBook Converter, id's are in the format package.packagename[.subpackagename].file[.sectionname], where file is either the classname, function/method name, or summary. In the other Converters, the id is not nearly as restrictive, but this inline tag allows for the potential of future converters that are equally exacting. Use <refsect1 id="{@id idname}"> in the tutorial (tutorialname.pkg/tutorialname.cls/tutorialname.proc) to do this.
The {@id} tag is context-sensitive, and will pre-pend the id of the current refsect1, refsect2, or refsect3 to any {@id}, allowing further error control.
Caution The sectionname may only consist of lower-case letters, numbers, and hyphens "-." No other characters are allowed Here is an example of how {@id} must be used
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<refentry id=" {@id}" > <refnamediv> <refname> Main Title</refname> <refpurpose> Description of tutorial</refpurpose> </refnamediv> <refsynopsisdiv> <refsynopsisdivinfo> <author> Gregory Beaver </author> <copyright> Copyright 2002, Gregory Beaver</copyright> </refsynopsisdivinfo> </refsynopsisdiv> <refsect1 id=" {@id section}" > <title> First Section Title</title> <para> Note that the id parameter must be within quotes and there must be no whitespace on either side. id=" {@id section}" will break the id parsing </para> <para> This section's name is "packagesubpackagetutorial.ext.section" by default. The HTML/CHM converters name it "section," the XML converter names it "package.subpackage.tutorial-ext.section" </para>
Page 99 of 1382
27 28 29 30 31 32 33 34 35 36 37
<refsect2 id=" {@id subsection}" > <title> Subsection Title</title> <para> This section inherit's the refsect1's id, and is named "packagesubpackagetutorial.ext.section.subsection" or "section.subsection" for HTML/CHM, and "package.subpackage.tutorial-ext.section.subsection" in XML </para> </refsect2> </refsect1> </refentry>
inline {@internal}}
Mark documentation as private, internal to the software project in text flow
Description
Caution Unlike other inline tags, {@internal}} may contain other inline tags due to its purpose. To terminate an {@internal}} inline tag, you must use two ending brackets "}}" Use {@internal}} to facilitate the creation of two sets of documentation, one for advanced developers or for internal company use, and the other for the general PHP public. Use this inline tag or its cousin, @internal
inline {@inheritdoc}
Used to directly inherit the long description from the parent class in child classes
Description
The {@inheritdoc} inline tag is used in the DocBlocks of classes, methods and class variables of child classes. phpDocumentor will automatically inherit the @author tag, @version tag, and @copyright tag from a parent class. In addition, if there is no documentation comment present, it will inherit the parent's documentation.
Note that if the {@inheritdoc} inline tag is not present, and a child class is undocumented, the child class will still attempt to inherit documentation from the parent class as is. {@inheritdoc} allows flexibility of where to put documentation from the parent class in a child class's documentation.
Example
In some cases, the child class may want to simply augment the parent class's documentation. This is the primary purpose {@inheritdoc} was designed for. For example:
1 /** 2 * Makes bars 3 * 4 * This class generates bars using the main algorithm. 5 */ 6 class bar 7 { 8 } 9 10 /** 11 * Makes chocolate bars 12 * 13 * There are two aspects to this class. 14 * {@inheritdoc } In addition, the foo class 15 * makes the bars chocolate 16 */ 17 class foo extends bar 18 { 19 }
1 2 3 4 5 6 7
/** * Makes bars * * Generates bars using the main algorithm. */ class bar {
8 } 9 10 /** 11 * Makes chocolate bars 12 * 13 * There are two aspects to this class. 14 * This class generates bars using the main algorithm. In addition, the foo class 15 * makes the bars chocolate 16 */ 17 class foo extends bar 18 { 19 }
inline {@link}
Display a link to a URL, or link to an element's documentation in the the flow of descriptive text
Description
The inline {@link} tag is used to document any element (page, global variable, include, class, function, define, method, variable).
New in version 1.2: You can link to any defined function in the current php version using the function's name. This linking is done using the standard php function http://www.php.net/get_defined_functions, and so relies on the version of php that is used to execute phpDocumentor. A benefit of this method is that the function highlighting will automatically upgrade with a php upgrade without any change to the underlying code. You may also link directly to any portion of the php website using the fake package override PHP_MANUAL (as in PHP_MANUAL#get_defined_functions, or PHP_MANUAL#support.php).
Caution inline {@link} displays links directly in the natural text flow of a DocBlock. If you want to display links prominently after descriptive text, use @see or @link. For parameter information, see @see or @link. The guidelines for giving the element name to inline @link are the same as outlined in the @see manual page.
Example
The inline {@link} differs from ordinary non-inline tags. Inline tags parse and display their output directly in the documentation. In other words, this DocBlock:
1 /** 2 * Text with a normal @see and @link tag 3 * (the parentheses in "element()" are only necessary 4 * because it is a function) 5 * @see element() 6 * @link http://www.example.com 7 */ 8 function element() 9 { 10 }
1 2 3
<H3> element</H3> <P><B> element ( )</B></P> <!-- ========== Info from phpDoc block ========= -->
4 <b> </b> 5 <pre> 6 Text with a normal @see and @link tag (the parentheses in "element()" are only necessary because it is a function) 7 </pre> 8 <DL> 9 <DT> Function Parameters:</DT> 10 11 12 <DT> Function Info:</DT> 13 <DD><b> See</b> - <CODE><a href="../default/_fake_page_php.html#element" > element()</a></CODE></DD> 14 <DD><b> Link</b> - <CODE><a href="www.example.com" > www.example.com</a></CODE></DD> 15 16 </DL> 17 18 <HR>
1 2 3 4 5 6 7 8 9
/** * Text with an {@link http://www.example.com Inline Link to a Hyperlink} and an inline * link to {@link element()} displays without a break in the flow * (again, the parentheses in "element()" are only necessary * because it is a function) */ function element() { }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<H3> element</H3> <P><B> element ( )</B></P> <!-- ========== Info from phpDoc block ========= --> <b> </b> <pre> Text with an <a href="http://www.example.com" > Inline Link to a Hyperlink</a> and an inline link to <a href="../default/_fake_page_php.html#element" > element()</a> displays without a break in the flow (again, the parentheses in "element()" are only necessary because it is a function) </pre> <DL> <DT> Function Parameters:</DT>
Function Info:</DT>
inline {@source}
Display source code of a function or method in the long description
Description
The {@source} inline tag is used in the DocBlock of functions or methods to extract source code of the function/method for display in generated documentation. This tag is designed to allow detailed line-by-line description of how a function works without having to cut and paste from the source. This allows modification to the source and automatic update of documentation so that it remains current.
Example
The inline {@source} differs from all ordinary tags. Inline tags parse and display their output directly in the documentation. In other words, this DocBlock:
1 2 3 4 5 6 7
/** * Text with a normal tag, @copyright * @copyright Copyright 2002, Greg Beaver */ function element() { }
This DocBlock:
1 /** 2 * Text with an inline source tag: 3 * 4 * {@source } 5 * displays without a break in the flow 6 */ 7 function element( $pages) 8 { 9 if (empty( $pages)) 10 { 11 die( "<b>ERROR</b>: nothing parsed" 12 } 13 }
);
will display the complete source inside the documentation as if we had typed it out
1 2
3 4 5 6 7 8 9 10 11 12 13 14
* * <code> * function element($pages) *{ * if (empty($pages)) * { * die("<b>ERROR</b>: nothing parsed"); * } *} * </code> * displays without a break in the flow */
The {@source tag has two optional parameters, the starting line number to display and the ending line number to display. If only the first parameter is present, {@source} will print the source code starting on that line number to the end of the function source code. If both parameters are present, {@source} will print an excerpt of the source code beginning on the starting line number, and concluding with the ending line number.
1 /** 2 * Text with an inline source tag: 3 * 4 * {@source 3} 5 * displays without a break in the flow 6 */ 7 function element( $pages) 8 { 9 if (empty( $pages)) 10 { 11 die( "<b>ERROR</b>: nothing parsed" 12 } 13 foreach ($test as $hello ) 14 { 15 echo " I love $hello " ; 16 } 17 }
);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/** * Text with an inline source tag: * * <code> * if (empty($pages)) * { * die("<b>ERROR</b>: nothing parsed"); * } * foreach($test as $hello) * { * echo "I love $hello"; * } *} * </code> * displays without a break in the flow */
1 /** 2 * Text with an inline source tag: 3 * {@source 3 1} 4 * displays without a break in the flow 5 */ 6 function element( $pages) 7 { 8 if (empty( $pages)) 9 { 10 die( "<b>ERROR</b>: nothing parsed" 11 } 12 foreach ($test as $hello ) 13 { 14 echo " I love $hello " ; 15 } 16 }
);
1 2 3 4 5 6 7 8
/** * Text with an inline source tag: * * <code> * if (empty($pages)) * </code> * displays without a break in the flow */
inline {@toc}
Display a table of contents of all {@id}s declared in a file
Description
The inline {@toc} tag is used as a sub-element of the <refentry> tag to display a table of contents of the current tutorial. This table of contents is generated directly by a call to Converter::formatTutorialTOC().
Example
This sample tutorial:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
< refentry id="{@id}" > < refnamediv> < refname>{@} toc} example</ refname> < refpurpose> Uses {@}toc} to generate a table of contents</ refpurpose> </ refnamediv> {@toc} < refsect1 id="{@id one}" > < title> First section</ title> </ refsect1> < refsect1 id="{@id two}" > < title> Second section</ title> < refsect2 id="{@id sub}" > < title> Sub-section</ title> </ refsect2> </ refsect1> < refsect1 id="{@id three}" > < title> Third section</ title> </ refsect1> </ refentry>
1 2 3 4 5 6 7 8 9 10 11 12 13 14
refentry id="{@id}" > refnamediv> refname>{@} toc} example</ refname> refpurpose> Uses {@}toc} to generate a table of contents</ refpurpose> refnamediv>
< refsect1> < itemizedlist> < listitem>< para>{@ tutorial mytutorial#one}</para></listitem> < listitem>< para>{@ tutorial mytutorial#two} < itemizedlist> < listitem>< para>{@ tutorial mytutorial#two.sub}</para></listitem> </ itemizedlist> </ para></ listitem>
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
< listitem>< </ refsect1> < < </ < < < < </ </ < < </ </
para>{@
tutorial mytutorial#three}</para></listitem>
refsect1 id="{@id one}" > title> First section</ title> refsect1> refsect1 id="{@id two}" > title> Second section</ title> refsect2 id="{@id sub}" > title> Sub-section</ title> refsect2> refsect1> refsect1 id="{@id three}" > title> Third section</ title> refsect1> refentry>
The format of the table of contents is Converter-dependent, and for the converters supplied with phpDocumentor, can be set up through the use of tutorial_toc.tpl in the template for tremendous customization control
inline {@tutorial}
Display a link to a tutorial in the the flow of descriptive text
Description
The inline {@tutorial} tag is used in any context to link to the documentation for a tutorial.
Caution inline {@tutorial} displays links directly in the natural text flow of a DocBlock. If you want to display links to a tutorial prominently after descriptive text, use @tutorial
Example
The inline {@tutorial} differs from ordinary non-inline tags. Inline tags parse and display their output directly in the documentation. In other words, this DocBlock:
1 2 3 4 5 6 7
/** * Text with a normal @tutorial tag * @tutorial phpDocumentor/phpDocumentor.pkg */ function element() { }
Example: role = "html"<H3>element</H3> <P><B>element ( )</B></P> <!-- ========== Info from phpDoc block ========= --> <b></b> <pre> Text with a normal @tutorial tag </pre> <DL> <DT>Function Parameters:</DT>
<HR>
1 2 3 4 5 6 7
/** * Text with an inline link to {@tutorial phpDocumentor/phpDocumentor.pkg} displays * without a break in the flow */ function element() { }
Example: role = "html"<H3>element</H3> <P><B>element ( )</B></P> <!-- ========== Info from phpDoc block ========= --> <b></b> <pre> Text with an an inline link to <a href="../phpDocumentor/tutorial_phpDocumentor.pkg.html">phpDocumentor 1.2.2 Tutorial</a> displays without a break in the flow </pre> <DL> <DT>Function Parameters:</DT>
Introduction to Converters
This documentation deals only with the advanced programming topic of creating a new output converter. To learn how to use phpDocumentor, read the phpDocumentor Guide to Creating Fantastic Documentation. To learn how to extend an existing Converter, read Converter Manual
Basic Concepts
Abstract Parsing Data
Source Code Elements
A Converter's job is to take abstract data from parsing and create documentation. What is the abstract data? phpDocumentor is capable of documenting tutorials, and a php file and its re-usable or structurally important contents. In other words, phpDocumentor can document: A XML DocBook-based tutorial (see phpDocumentor Tutorials) Procedural Page (PHP source file) Include Statements Define Statements Global Variables Functions Classes Class Variables Class Methods
phpDocumentor represents these PHP elements using classes: parserTutorial parserData, parserPage parserInclude parserDefine parserGlobal parserFunction parserClass parserVar
parserMethod
This relationship between the source code and abstract data is quite clear, and very simple. The data members of each abstract representation correspond with the information needed to display the documentation. All PHP elements contain a DocBlock, and this is represented by a class as well, parserDocBlock. The elements of a DocBlock are simple: Short Description, containing any number of inline tags Long Description, containing any number of inline tags Tags, some containing any number of inline tags in their general description field
phpDocumentor represents these elements using classes as well: parserDesc for both short and long descriptions parserInlineTag for inline tags parserTag for regular tags
HTML-specific issues
There are some other issues that Converters solve. In HTML, a link is represented by an <a> tag, but in the PDF Converter, it is represented by a <c:ilink> tag. How can we handle both cases? Through another abstract class, the abstractLink and its descendants: tutorialLink pageLink defineLink globalLink functionLink classLink varLink methodLink Note the absence of an "includeLink" class - this is intentional, as only re-usable elements need to be linked. An include statement is always attached to the file that it is in, and cannot be anywhere else.
These abstract linking classes contain the information necessary to differentiate between the location of any of the element's documentation. They are only used to allow linking to documentation, and not to source code. A link is then converted to the appropriate text representation for the output format by Converter::returnSee() (a href=link for html, c:ilink:link for pdf, link linkend=link in xml:docbook, and so on).
The other issues solved by a converter involves html in a DocBlock. To allow better documentation, html is allowed in DocBlocks to format the output. Unfortunately, this complicates output in other formats. To solve this issue, phpDocumentor also parses out all allowed HTML (see phpDocumentor Tutorial for more detailed information) into abstract structures: <b> -- emphasize/bold text <br> -- hard line break, may be ignored by some converters <code> -- Use this to surround php code, some converters will highlight it <i> -- italicize/mark as important <li> -- list item <ol> -- ordered list
<p> -- If used to enclose all paragraphs, otherwise it will be considered text <pre> -- Preserve line breaks and spacing, and assume all tags are text (like XML's CDATA) <ul> -- unordered list is mapped to classes: parserB parserBr parserCode parserI parserList - both types of lists are represented by this object, and each <li> is represented by an array item parserPre <p> is represented by partitioning text into an array, where each array item is a new paragraph. (as in parserDocBlock::$processed_desc)
With these simple structures and a few methods to handle them, the process of writing a new converter is straightforward.
A Converter must override these core methods: Convert() - take any descendant of parserElement or a parserPackagePage and convert it into output returnSee() - takes a abstract link and returns a string that links to an element's documentation returnLink() - takes a URL and text to display and returns an internet-enabled link Output() - generate output, or perform other cleanup activities Convert_RIC() - Converts README/INSTALL/CHANGELOG file contents for inclusion in documentation ConvertErrorLog() - formats errors and warnings from $phpDocumentor_errors. see HTMLframesConverter::ConvertErrorLog() getFunctionLink() - for all of the functions below, see HTMLframesConverter::getFunctionLink() for an example getClassLink() getDefineLink() getGlobalLink() getMethodLink() getVarLink()
endPage() - do any post-processing of procedural page elements, possibly output documentation for the page endClass() - do any post-processing of class elements, possibly output documentation for the class formatIndex() - format the $elements array into an index see HTMLframesConverter::generateElementIndex() formatPkgIndex() - format the $pkg_elements array into an index see HTMLframesConverter::generatePkgElementIndex() formatLeftIndex() - format the $elements array into an index see HTMLframesConverter::formatLeftIndex() formatTutorialTOC() - format the output of a {@toc} tag, see HTMLframesConverter::formatTutorialTOC() getRootTree() - generates an output-specific tree of class inheritance SmartyInit() - initialize a Smarty template object writeSource() - write out highlighted source code for a parsed file writeExample() - write out highlighted source code for an example unmangle() - do any post-processing of class elements, possibly output documentation for the class
The following methods may need to be overridden for proper functionality, and are for advanced situations. checkState() - used by the parserStringWithInlineTags::Convert() cache to determine whether a cache hit or miss occurs getState() - used by the parserStringWithInlineTags::Convert() cache to save state for the next Convert() call type_adjust() - used to enclose type names in proper tags as in XMLDocBookConverter::type_adjust() postProcess() - called on all converted text, so that any illegal characters may be escaped. The HTML Converters, for example, pass all output through http://www.php.net/htmlentities getTutorialId() - called by the {@id} inline tag to get the Converter's way of representing a document anchor
Smarty
What is Smarty? This is a versatile compiling template engine, and has its home page at http://smarty.php.net, please read the manual and the tutorials if you are unfamiliar with Smarty. This tutorial only describes how to use the templates, and will be confusing if you have never used Smarty before. In particular, you must understand fully how to use the {section} and {foreach} tags. Please read http://smarty.php.net/manual/en/language.function.section.php and http://smarty.php.net/manual/en/language.function.foreach.php
All template files have available to them these smarty variables: {$date} string - the current date and time, as formatted by date("r",time) {$maintitle} string - the contents of the phpDocumentor Tutorial command-line switch {$package} string - the package of the current template item {$subpackage} string - the subpackage of the current template item {$phpdocversion} string - the version number of phpDocumentor {$phpdocwebsite} string - the official phpDocumentor website (http://www.phpdoc.org)
The source code elements (function, include, global variable, define, class, class variable, method) all have a few template variables in common. They are: {$sdesc} string - Summary from the DocBlock {$desc} string - Long description from the DocBlock {$tags} array - Tags found in the DocBlock, array('keyword' => tagname, 'data' => description). access in this manner: {section name=sec loop=$tags}{$tags[sec].keyword} = {$tags[sec].data}{/section} or {foreach from=$tags item=tag}{$tag.keyword} = {$tag.data}{/foreach} {$api_tags} array - Tags found in the DocBlock useful in documenting the API, array('keyword' => tagname, 'data' => description). Access in the same manner as {$tags} {$info_tags} array - Tags found in the DocBlock that are purely informational in nature, offering no particular use in documenting the actual software API, array('keyword' => tagname, 'data' => description). Access in the same manner as {$tags}
{$utags} array - Unknown tags found in the DocBlock, array('keyword' => tagname, 'data' => description). Access in the same manner as {$tags} {$line_number} integer - The line number in the source code that this element appears {$id} string - EXCEPT for include, all elements have a unique ID. This should be used to create a document anchor that will allow hyperlinking to that element's documentation.
All functions are appended to the {$functions} template variable of the procedural page that contains them. In version 2.0, there will be greater flexibility possible with locating template variables.
All global variables are appended to the {$globals} template variable of the procedural page that contains them. In version 2.0, there will be greater flexibility possible with locating template variables.
All define constants are appended to the {$defines} template variable of the procedural page that contains them. In version 2.0, there will be greater flexibility possible with locating template variables.
All include statements are appended to the {$includes} template variable of the procedural page that contains them. In version 2.0, there will be greater flexibility possible with locating template variables.
Class Conversion
Class Converter Variables
Like ConvertPage(), the Converter::ConvertClass() method sets up a few important variables that are used by the other conversion methods. These are: Converter::$class_data - the Smarty template that contains all class contents for this class Converter::$class - the name of the current class
All class variables are appended to the {$vars} template variable of the class that contains them. In version 2.0, there will be greater flexibility possible with locating template variables.
All methods are appended to the {$methods} template variable of the class that contains them. In version 2.0, there will be greater flexibility possible with locating template variables.
{$next} string - link to the next tutorial in the tutorial hierarchy {$nexttitle} string - title of the next tutorial
There are literally no restrictions on how a converter does its job. If the predefined Converter::walk() method does not do anything a converter needs to do, all one needs to do is override walk() and perform any necessary processing directly on the parsed elements. Be forewarned that this is a bit like trying to fix a problem in a program by tinkering with the operating system, and we cannot be even in the slightest responsible for any suffering you might incur.
Having said that nasty disclaimer, let's begin with the good news. The only thing a standard converter needs to know is that it must define a few methods. The only crucial methods to define are Convert(), returnSee(), and returnLink().
The Convert() method expects it will be passed all parsed data. Data will be passed either by file or by package, but in either case, all data will pass through Convert(), and so must be handled by it. Good programming practice suggests having one method for every parsed element, and that is what the bundled Converters do.
returnSee() is the core of phpDocumentor's advanced linking @see, @tutorial, inline {@tutorial} and inline {@link}. returnLink() handles hyperlinks to URLs on the internet.
Beyond these three essential methods, there are a slew of methods that assist phpDocumentor in creating its advanced source highlighting feature, in creating an error log and todo list, and a few advanced functions that speed up conversion through a cache. Beyond this, there are many helper functions that assist in the creation of indexes, class trees, inheritance and conflict information, and so on. phpDocumentor does not restrict their use, to allow for future possibilities.
For most cases, it is best to start writing a new converter by copying the code from one of the existing converters, and then begin modifying methods to generate the appropriate output. In addition, this will leverage the existing use of the Smarty template engine to separate specifics of output formatting from the data source. In theory, one could create a single converter and use many templates for creating different output, but this is often not possible because templates are still organized into files, and this is invariant. In the future of phpDocumentor, we may have a base converter from which all other converters can extend, greatly simplifying development. For now, development is still relatively easy, after the basic concepts behind phpDocumentor are grasped.
Convert()
The Converter::Convert() method is called by Converter::walk() to process all Converter classes: parserData - representation of a file parserInclude - representation of include statements parserDefine - representation of define statements parserFunction - representation of functions parserGlobal - representation of global variables parserClass - representation of a class parserVar - representation of class variables parserMethod - representation of class methods parserPage - representation of old Package Pages (deprecated) parserTutorial - representation of tutorials (like what you are reading now) It is up to this method to distribute processing of these elements, or do any post-processing that is necessary. All of the converters included with phpDocumentor process elements by passing them to individual Convert*() methods like HTMLframesConverter::ConvertClass(), and one can simply copy this style, or write a completely new method.
Data is passed to the Converter organized by file, procedural elements first followed by class elements, unless Converter::$sort_absolutely_everything is set to true. Then data is passed organized by package, with all files and procedural elements first, followed by all class elements. The PDFdefaultConverter set $sort_absolutely_everything = true, and HTML converters set $sort_absolutely_everything = false
returnSee()
This method takes a abstractLink class descendant and converts it to an output-format compatible link to an element's documentation. HTML converters convert the link to an <a href=""> tag, the XML converter changes it to a <link linkend=""> tag, etc. This function is also responsible for distinguishing between sections of documentation. All information needed to distinguish between elements is included in the data members of a link class, it is up to the returnSee() method to translate that into a unique string identifier. A good strategy is to write a function that takes a link class and returns a unique identifier as in XMLDocBookConverter::getId(), and then reference this function to grab identification strings for defining anchors in the generated output.
returnLink()
This method takes a URL and converts it to an external link to that URL in the appropriate output format. In HTML, the link will be a standard <a href= tag.
Output()
This method is called at the end of the walk() method. It may be used to generate output or do any necessary cleanup. Nothing is required of Output, and it may do nothing as it does in the HTML converters, which write output continuously as converting, or perform special operations as in CHMdefaultConverter::Output().
Convert_RIC()
This method is called to format the contents of README, INSTALL, CHANGELOG, NEWS, and FAQ files grabbed from the base parse directory. This function allows standard distribution files to be embedded in generated documentation. A Converter should format these files in a monospace font, if possible.
ConvertErrorLog()
This method is called at the end of parsing to convert the error log into output for viewing later by the developer. Error output is very useful for finding mistakes in documentation comments. A simple solution is to copy the HTMLframesConverter::ConvertErrorLog() function and the errors.tpl template file to the new converter. The error log should not be embedded in generated output, as no end-user wants to see that information.
getFunctionLink()
This function should call Converter::getFunctionlink(), and then use returnSee() to return a string containing a converter-specific link. Code can literally be copied from any of the converters. This function is called by the parserFunction::getLink() method.
getClassLink()
This function should call Converter::getClasslink(), and then use returnSee() to return a string containing a converter-specific link. Code can literally be copied from any of the converters. This function is called by the parserClass::getLink() method.
getDefineLink()
This function should call Converter::getDefinelink(), and then use returnSee() to return a string containing a converter-specific link. Code can literally be copied from any of the converters. This function is called by the parserDefine::getLink() method.
getGlobalLink()
This function should call Converter::getGloballink(), and then use returnSee() to return a string containing a converter-specific link. Code can literally be copied from any of the converters. This function is called by the parserGlobal::getLink() method.
getMethodLink()
This function should call Converter::getMethodlink(), and then use returnSee() to return a string containing a converter-specific link. Code can literally be copied from any of the converters. This function is called by the parserMethod::getLink() method.
getVarLink()
This function should call Converter::getVarlink(), and then use returnSee() to return a string containing a converter-specific link. Code can literally be copied from any of the converters. This function is called by the parserVar::getLink() method.
endClass()
This method is called by the Converter::walk() method when all class elements (methods, variables) in a class have been processed. The purpose is to allow the converter to reset any state variables that apply to the page. endPage() is not called by Converter::walk_everything() and so if your converter sets Converter::$sort_absolutely_everything = true, you will not need to implement this method.
formatIndex()
This method is called before processing any elements, and is not required to do anything. The intent is to allow processing of a global element index to occur in a separate method, which logically separates activities performed by the Converter. See the HTMLframesConverter::formatIndex() method for details on one possible implementation
formatPkgIndex()
Like formatIndex(), this method is called before processing any elements, and is not required to do anything. The intent is to allow processing of a package-level index to occur in a separate method, which logically separates activities performed by the Converter. See the HTMLframesConverter::formatPkgIndex() method for details on one possible implementation
formatLeftIndex()
Like formatIndex(), this oddly-named method is called before processing any elements, and is not required to do anything. The name comes from the original JavaDoc design of putting an index in the lower left frame of output. The indexes needed by this function are automatically generated based on the value of Converter::$leftindex. These indexes are arrays of links organized by package and subpackage. Left indexes can be generated for files (procedural pages), functions, classes, constants (define statements), and global variables.
formatTutorialTOC()
This method is used to format the automatically generated table of contents from an inline {@toc} in a tutorial. The data structure passed is an array generated by parserTocInlineTag::Convert() that contains each entry. All that formatTutorialTOC needs to do is structure the inherent hierarchy of the original DocBook tutorial source according to the requirements of the output format. This is remarkably simple, and can often be implemented simply by passing the entire array to a template engine, as HTMLframesConverter::formatTutorialTOC() does.
getRootTree()
This is a very fast non-recursive method that generates a string containing class trees. In earlier phpDocumentor versions, the getRootTree() method was recursive, and both consumed too much memory and was very slow. It was also easier to understand. The data structure processed in the current version of phpDocumentor still contains the same information, but requires a precise algorithm to process. The good news is that we have worked out this algorithm for you, and to implement this method in a new converter, you need only copy the code from one of the existing converters. See Converter::getRootTree() for low-level details.
SmartyInit()
The primary template engine for phpDocumentor is the Smarty template engine. This utility function is used to initialize a new Smarty template object with pre-initialized variables. The Converter::newSmarty initializes several variables, see Converter::newSmarty() for details. If your converter needs to have variables available to every template, extend this function, and use Smarty::assign() to assign values to variables. Note that the
function &SmartyInit(&$templ) { $somevalue = "whatever you want, babe"; $templ->assign("variable",$somevalue); return $templ; }
writeSource()
writeExample()
unmangle()
This function is used by the pre-PHP 4.2.3 inline {@source} tag's parserInlineSourceTag::Convert() method to process output from http://www.php.net/highlight_string. In non-HTML converters, it should return an empty string. For advanced source highlighting, implement highlightSource(), highlightDocBlockSource().
getState()
type_adjust()
This method is passed type names from @param/@return/@var tags and can be used to enclose types in special formatting. The only converter that really uses this capability is the DocBook converter. Since the type name can be a link class, it is possible to determine what kind of element the type is, a constant, class, or anything that can be documented. For example, the DocBook converter encloses classes in <classname> tags, constants in <constant> tags, variables in <varname> tags, and also will enclose functions in <function> tags.
postProcess()
This method takes a string and should "escape" any illegal characters. For instance, in HTML, all "<" characters must be escaped to "<" entities. This is to prevent documentation comments from being interpreted as text modifiers in the output format.
getTutorialId()
This method is used to pass back a valid ID for a tutorial section. In HTML, most of the id is coded in the file containing the data, and only the section and subsection need to be used to differentiate sections. In DocBook, the id is packages.categoryname.packagename.subpackagename.class/filename.section.subsection, a much more involved scenario.
Utility methods
getSortedClassTreeFromClass()
This method is used by getRootTree() to create class trees for a package. Also see the docs in Converter::getSortedClassTreeFromClass()
hasTutorial()
This helper method is used to determine whether a particular tutorial has been parsed, and can be used to perform association between parsed elements and their tutorials
getTutorialTree()
This helper method returns a recursive data structure containing all tutorials in the table-of-contents style hierarchy that they should have in final output. This is used to create a table of contents for tutorials in the left frame of the HTML Converters, and in the PDF Converter, to determine indentation level in the top-level table of contents.
vardump_tree()
This function is a utility function. It performs what looks like a http://www.php.net/var_dump of any recursive data structure, but if it encounters an object, it only prints out its class and name if the $name data member exists. This allows checking of the tree structure without having to wade through pages of class information, and was very useful for debugging, so we added it for your use.
Converter Manual
Learn how to use and extend a Converter
If you are wondering how to extend the capabilities of phpDocumentor's output, this is the documentation you need. This documentation does not discuss how to document your code or project, and only deals with the specific requirements of extending phpDocumentor.
Parser internals
The Parser component does the work of reading the actual files, both source code and tutorial/manual files. For a detailed discussion of how to write a tutorial, see phpDocumentor Tutorials, or read the source files for phpDocumentor's manual in the tutorials/ subdirectory. The Parser encapsulates input into abstract classes, all of which are defined in seven files: DescHTML.inc DocBlockTags.inc InlineTags.inc ParserData.inc ParserElements.inc ParserDocBlock.inc PackagePageElements.inc The abstract classes are then passed to the Intermediate Parser. The IntermediateParser class organizes and processes abstract data passed in with the assistance of the ProceduralPages and Classes classes. All data is sorted alphabetically and then passed to the converters specified on the command-line one by one. Traditionally, the next step would be to generate output by passing the abstract data to a template engine. phpDocumentor has one more layer of separation to accomodate different output formats called "Converters." What is a Converter? To understand this, one must first understand the problem that Converters solve. Documentation is not always best viewed as a web page. Sometimes a user may want to print it out, or view it in XML with an interface program that can search or perform other advanced functions. Printing html does not work very well, and may look very different on different user's screens. To solve this problem, we need an interface between the parser and the template engine, hence the Converter.
On an even more basic level, the linking performed by phpDocumentor requires that the program pass over the data at least twice to set up relationships and create the @see, @tutorial, {@tutorial} and {@link} hyperlinks that make it such an effective tool. In earlier versions of phpDocumentor, the parser passed over the data twice, with significant redundancy and slow parsing times. In addition, the linking pass had to be first, and the order of parsing was important. In other words, if file A contains class B extends foo, and file B contains class foo, if file A is parsed before file B, no inheritance occurs between the classes (you can try this with phpDocumentor 0.4.2a and earlier, it breaks the parser). The Converter works with temporary data structures (all defined in ParserData.inc, ParserElements.inc, and ParserDocBlock.inc if you want a peek), and allows the linking pass to occur in-memory after parsing, with a significant speedup (almost twice as fast as earlier versions).
Adding a template
In most cases, it is possible to leverage the existing code to create spectacular output simply by writing a new set of templates for one of the existing Converters. To learn how to write templates for each specific converter, choose from the list below: Writing templates for the HTMLframes Converter Writing templates for the HTMLSmarty Converter Writing templates for the PDFdefault Converter Writing templates for the XMLDocBook Converter Writing templates for the CHMdefault Converter
Once a name has been chosen, a subdirectory of the parent converter (HTMLframesConverter is in phpDocumentor/Converters/HTML/frames/) must be created with the same name as the child converter. So, for our "Search" Converter, the directory phpDocumentor/Converters/HTML/frames/Search/ must be created. Put your new Converter in a file called "HTMLframes SearchConverter.inc". Note the insertion of our new Converter's name before the word "Converter" in the filename.
1 2 3 4
/** * HTML output converter. * * This Converter takes output from the {@link Parser} and converts it to HTML-ready output for use with
{@link Smarty}. 5 * Add any extra documentation about the search capabilities here 6 * @package Converters 7 * @subpackage HTMLframes 8 * @author Your Name <[email protected]> 9 */ 10 class HTMLframesSearchConverter extends Converter 11 { 12 /** 13 * frames/Search Converter wants elements sorted by type as well as alphabetically 14 * @see Converter::$sort_page_contents_by_type 15 * @var boolean 16 */ 17 var $sort_page_contents_by_type true; = 18 /** @var string */ 19 var $outputformat 'HTML'; = 20 /** @var string */ 21 var $name = 'frames/Search';
Note the var $name is set to the relative subdirectory. This is very important. Do not set the name to be "framesSearch", as the Converter::setTemplateDir() method uses this variable to set the template directory.
If the existing templates work fine, and there is some other change needed, set the name to be the same as the parent, and phpDocumentor will use the parent templates.
After extending the methods the new Search Converter will need, place the templates in a subdirectory named templates/ (as in phpDocumentor/Converters/HTML/frames/Search/templates/), just as they are used in the converters that come with phpDocumentor.
PDFParser Introduction
This documentation deals only with the PDFParser XML templating language. To learn how to use phpDocumentor, read the phpDocumentor Guide to Creating Fantastic Documentation. To learn how to write a new Converter, read Converter Manual
Overview
The PDF:default Converter uses the powerful Cezpdf class library written by Wayne Munro. Although the Cezpdf library is very versatile and useful, it is designed to be used as PHP code, and does not allow access to its methods from the text passed to it. The PDFParser class was written to solve this problem. Through the use of a few basic XML-based tags, and the versatile <pdffunction /> tag, one can access any feature of the Cezpdf library and do anything that it can do. This is what makes it possible to use Smarty templates without modifying any code in phpDocumentor, a primary goal of the 1.2.0 release.
Examples might include: <text size="11">Hello World!</text> <text size="11" justification="right">Hello World!</text> <text size="11" left="10" right="10" justification="center">Hello World!</text>
<font>
Unlike HTML, the <font /> tag is a self-enclosed tag, and is only used to select the font face (and future
versions will also select color). Syntax is <font face="fontface" /> The fontface must be present in the Converters/PDF/default/templates/fonts/ subdirectory as a fontface-php.afm and fontface.afm file, otherwise Cezpdf will cause all kinds of PHP warnings. This is an issue with Cezpdf that we are assisting the author in fixing, and will not be a problem in the future.
<newpage>
This is the simplest tag, use it as <newpage /> to tell Cezpdf to jump to the top of the next page in output.
<pdffunction>
The <pdffunction> tag is the most versatile of the PDFParser tags. This tag can be used to arbitrarily call any Cpdf or Cezpdf method. Arguments can be passed to the function both as literal values and using dynamic variables, both class variables and temporary variables. The method chosen is selected as if pdffunction were a namespace rather than a
Here are the parameters to the pdffunction: return (optional) set a temporary variable to the value returned from the function. This parameter allows a later reference to the temporary variable like: <pdffunction:getYPlusOffset return="newy" offset="0" /> <pdffunction:addJpegFromFile arg="logo.jpg" x="250" y=$newy /> any other parameter represents an argument. Since the parameters passed are simply passed by value to the method, the names can be anything that is useful to understanding how they work. <pdffunction:ezStartPageNumbers x="500" y="28" size="10" pos="" pattern="{ldelim}PAGENUM{rdelim} of {ldelim}TOTALPAGENUM{rdelim}" num="1" /> could just as easily be <pdffunction:ezStartPageNumbers arg="500" foo="28" bar="10" mylord="" goodnessgracious="{ldelim}PAGENUM{rdelim} of {ldelim}TOTALPAGENUM{rdelim}" num="1" /> and the code would still work splendidly. The first way is obviously easier to handle, and so is recommended.
Most arguments to the method will be literals, like numbers or strings, but some arguments may need to be more dynamic, based on the values returned from other pdffunction tags. To do this, use the return parameter as described above, and reference the temporary variable as if it were a php variable like <pdffunction:whatever arg=$tempvar /> It may even be necessary to access a data member of the pdf class. In this case, use $this->datamember as in <pdffunction:whatever arg=$this->datamember />
PDF:default:* Introduction
This documentation deals only with adding a new template to the PDFdefault Converter. To learn how to use phpDocumentor, read the phpDocumentor Guide to Creating Fantastic Documentation. To learn how to write a new Converter, read Converter Manual
CHM:default:* Introduction
This documentation deals only with adding a new template to the CHMdefault Converter. To learn how to use phpDocumentor, read the phpDocumentor Guide to Creating Fantastic Documentation. To learn how to write a new Converter, read Converter Manual To generate a CHM file, go to http://go.microsoft.com/fwlink/?LinkId=14188 and download Microsoft's Help Workshop.
XML:DocBook:* Introduction
This documentation deals only with adding a new template to the XMLDocBook Converter. To learn how to use phpDocumentor, read the phpDocumentor Guide to Creating Fantastic Documentation. To learn how to write a new Converter, read Converter Manual
HTML:Smarty:* Introduction
This documentation deals only with adding a new template to the HTMLSmarty Converter. To learn how to use phpDocumentor, read the phpDocumentor Guide to Creating Fantastic Documentation. To learn how to write a new Converter, read Converter Manual
HTML:frames:* Introduction
This documentation deals only with adding a new template to the HTMLframes Converter. To learn how to use phpDocumentor, read the phpDocumentor Guide to Creating Fantastic Documentation. To learn how to write a new Converter, read Converter Manual
Overview
The HTML:frames converter uses all of the values from the generic Converter (see Converter Default Template Variables), and adds a few more.
All templates have the standard smarty template variables available to them, as well as these: {$subdir } string - the combination of "../" that will lead to the base output directory, used for linking to other generated documentation. {$packageindex} array - a list of all the packages and their index pages in the format array('link' => link to the index page, 'title' => package name)
Template Variables
Source Code formatting - filesource.tpl
When source code is generated via the @filesource tag, the output is passed into these templates variables: {$source} string - the fully formatted source code, use as is {$package} string - the package name of the source file {$subpackage} string - the subpackage name of the source file {$name} string - the name of the source file file.ext {$source_loc} string - the relative path to the file, used for include() statements {$docs} string - a link to the documentation for this file
The HTML:frames Converter places a table of contents in the left frame. This table of contents contains links to class trees, alphabetical indexes, tutorials, and elements organized by category (class/procedural code).
The {$info} variable contains these sub-variables (assuming that {section name=p loop=$info} was used): {$info[p].package} string - package name {$info[p].subpackage} string - subpackage name {$info[p].packagedoc} string - link to old format .html-based package-level documentation (deprecated) {$info[p].packagetutorial} string - link to new package-level documentation, or subpackage-level documentation for subpackages {$info[p].packagetutorialnoa} string - link to new package-level documentation, or subpackage-level documentation for subpackages, without enclosing <a href="link to docs"> HTML tag. Use this to do special link handling (opening a new window, opening in the _right frame, etc.) {$info[p].packagetutorialtitle} string - title of package-level documentation {$info[p].files}/{$info[p].classes}/{$info[p].functions} array - links to documentation array('link' => html link, 'title' => name of element) {$info[p].tutorials} string - Formatted tutorial table of contents, see Tutorial table of contents formatting tutorial_tree.tpl
The tutorial_tree.tpl file should represent the hierarchy of tutorials through some form of a nested html tag, such as a nested list (like the default converter), or a nested DHTML menu (like the phpedit or earthli templates).
{$index} contents
The {$index} variable is an array of index listings organized by their first letter. All documented elements whose name begins with the letter A will be grouped into the sub-array 'a' => array(listing,listing,...). The listing is organized as follows: {$index[xxx].name} string - name of the documented element {$index[xxx].title} string - One of Variable, Global, Method, Function, Constant, Page, Include {$index[xxx].link} string - hyperlink to the element's documentation, or the file included for include statements {$index[xxx].listing} string - A fully-formatted index listing in English.
The structure of the errors array passed to errors.tpl is somewhat complex to learn, but easy to use once learned. Every error or warning is grouped by the file that triggered it. In the case of post-parsing errors, they are grouped into the pseudo-file "Post-parsing". Within each file, warnings are grouped separately from errors. Hence, the structure looks something like: 1 array('Post-parsing' => array( 'warnings' => array( 2 array('name' => name of warning, 3 'listing' => description of warning),... 4 ) 5 'errors' => array( 6 array('name' => name of error, 7 'listing' => description of error),... 8 ) 9 ), 10 'file1.php' => array( same structure as 'Post-parsing'),... 11 ); {$all} array - This is the structure listed above {$files} array - a listing of all the files, useful for making a table of contents {$title} string - this is hard-coded in English. Override by simple using {assign var="title" value="whatever you want"} before including header.tpl
Functions - function.tpl
The only additional variable is: {$function_dest} string - html anchor used to pinpoint this function's documentation in the procedural file's documentation. Use as in: <a name="#{$function_dest}"></a>
Defines - define.tpl
The only additional variable is: {$define_link} string - html anchor used to pinpoint this define statement's documentation in the procedural file's documentation. Use as in: <a name="#{$define_link}"></a>
Converter.inc
Base class for all Converters phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2001-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package Converters Author Greg Beaver < [email protected]> Version CVS: $Id: Converter.inc 287891 2009-08-30 08:08:00Z ashnazg $ Copyright 2001-2006 Gregory Beaver See parserDefine, parserFunction, parserMethod, parserVar See parserDocBlock, parserInclude, parserPage, parserClass Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.0rc1 Filesource Source Code for this file License LGPL
string $s
smart htmlentities, doesn't entity the allowed tags list Since version 1.1, this function uses htmlspecialchars instead of htmlentities, for international support This function has been replaced by functionality in ParserDescCleanup.inc
Deprecated As of v1.2, No longer needed, as valid tags are parsed out of the source, everything else is Converter::postProcess() handled
and
43]
Class Converter
[line 74]
Base class for all output converters. The Converter marks the final stage in phpDocumentor. phpDocumentor works in this order: Parsing => Intermediate Parsing organization => Conversion to output A Converter takes output from the phpDocumentor_IntermediateParser and converts it to output. With version 1.2, phpDocumentor includes a variety of output converters: HTMLframesConverter HTMLSmartyConverter PDFdefaultConverter CHMdefaultConverter CSVdia2codeConverter XMLDocBookConverter {@ and using walk() or walk_everything (depending on the value of $sort_absolutely_everything) it "walks" over an array of phpDocumentor elements.}}
Package Converters Author Greg Beaver < [email protected]> Version $Id: Converter.inc 287891 2009-08-30 08:08:00Z ashnazg $ Abstract Element Since 1.0rc1
See phpDocumentor_IntermediateParser::$all_packages
alphabetical index of all methods and vars in a class by package/subpackage The class itself has a link under ###main
Var Format: array(package => array(subpackage => array(path => array(class => array(abstractLink descendant 1, ... ) ) ) ) See Converter::formatLeftIndex()
Var Format: array(first letter of element name => array( parserElement or parserPage,...)) See Converter::formatIndex(), HTMLframesConverter::formatIndex()
Var Format: array(package => array(subpackage => array( 2,...) See Converter::$leftindex
functionLink 1,functionLink
Generation of these indexes for large packages is time-consuming. This is an optimization feature. An example of how to use this is in HTMLframesConverter::$leftindex, and in HTMLframesConverter::formatLeftIndex(). These indexes are intended for use as navigational aids through documentation, but can be used for anything by converters.
output format of this converter in Child converters, this will match the first part of the -o command-line as in -o HTML:frames:default "HTML"
Packages associated with categories Used by the XML:DocBook/peardoc2 converter, and available to others, to group many packages into categories
See phpDocumentor_IntermediateParser::$packagecategories
alphabetical index of all elements sorted by package, subpackage, page, and class.
Var Format: array(package => array(subpackage => array('page'|'class' => array(path|classname => array(element, element,...))))) Uses Converter::$sort_absolutely_everything - if true, then $package_elements is used, otherwise, the ParserData::$classelements and ParserData::$pageelements variables are used
Hierarchy of packages Every package that contains classes may have parent or child classes packages. In other words, this code is legal:
1
in other
See phpDocumentor_IntermediateParser::$package_parents
alphabetical index of all elements on a page by package/subpackage The page itself has a link under ###main
Var Format: array(package => array(subpackage => array(path => array( descendant 1, ...))) See Converter::formatLeftIndex()
abstractLink
controls processing of elements marked private with @access private defaults to false. Set with command-line --parseprivate or -pp
Var Format: array(first letter of element name => array( parserElement or parserPage,...)) See Converter::formatPkgIndex(), HTMLframesConverter::formatPkgIndex()
This converter knows about the new root tree processing In order to fix PEAR Bug #6389
controls display of progress information while parsing. defaults to false. Set to true for cron jobs or other situations where no visual output is necessary
Converter::$smarty_dir
This is used if the content must be passed in the order it should be read, i.e. by package, procedural then classes This fixes bug 637921, and is used by PDFdefaultConverter
Usedby Converter::$package_elements - if true, then $package_elements is used, otherwise, the ParserData::$classelements and ParserData::$pageelements variables are used
This determines whether the $page_contentsarray should be sorted by element type as well as alphabetically by name
See Converter::sortPageContentsByElementType()
Options for each template, parsed from the options.ini file in the template base directory
See phpDocumentor_IntermediateParser::$title
List of all @todo tags and a link to the element with the @todo Format: array(package => array(link to element, array(todo parserTag,...)),...)
Tutorial @todo
Constructor void function Converter::Converter(&$allp, &$packp, &$classes, &$procpages, $po, $pp, $qm, $targetDir, $template, $title) [line 452] Function Parameters:
array &$allp $all_packages value array &$packp $package_parents value Classes &$classes $classes value ProceduralPages &$procpages $proceduralpages value array $po $package_output value boolean $pp $parseprivate value boolean $qm $quietmode value string $targetDir $targetDir value string $template $templateDir value string $title (@link $title} value
string $tag tag name attribute $attr array boolean $unmodified if true, returns attrname="value"...
Convert the attribute of a Tutorial docbook tag's attribute list to a string based on the template options.ini
string $para
Usedby parserB::Convert()
string $para
Usedby parserBr::Convert()
mixed $state
Convert all elements to output format This will call ConvertXxx where Xxx is http://www.php.net/ucfirst($element->type). It is expected that a child converter defines a handler for every element type, even if that handler does nothing. phpDocumentor will terminate with an error if a handler doesn't exist.
Throws PDERROR_NO_CONVERT_HANDLER
&$element
Default Class Handler Conversion Handlers All of the convert* handlers set up template variables for the Smarty template. Sets up the class template. {@, getFormattedConflicts, getFormattedInheritedMethods, and getFormattedInheritedVars are called to complete vital template setup.}}
Converts class constants for template output. Conversion Handlers All of the convert* handlers set up template variables for the Smarty template. This function must be called by a child converter with any extra needed in the parameter $addition template variables
parserDefine &$element array $addition any additional template variables should be in this array
Converts defines for template output Conversion Handlers All of the convert* handlers set up template variables for the Smarty template. This function must be called by a child converter with any extra template variables needed in the parameter $addition {@, this method also uses utility functions getGlobalValue(), getFormattedConflicts()}}
Abstract Element
Converts function for template output Conversion Handlers All of the convert* handlers set up template variables for the Smarty template. This function must be called by a child converter with any extra template variables needed in the parameter $addition
See Converter::prepareDocBlock()
parserGlobal &$element array $addition any additional template variables should be in this array
Converts global variables for template output Conversion Handlers All of the convert* handlers set up template variables for the Smarty template. This function must be called by a child converter with any extra template variables needed in the parameter $addition {@, this method also uses utility functions getGlobalValue(), getFormattedConflicts()}}
Converts includes for template output Conversion Handlers All of the convert* handlers set up template variables for the Smarty template. This function must be called by a child converter with any extra template variables needed in the parameter $addition
See Converter::prepareDocBlock()
Converts method for template output Conversion Handlers All of the convert* handlers set up template variables for the Smarty template. This function must be called by a child converter with any extra template variables needed in the parameter $addition
parserPage &$element
Default Page Handler Conversion Handlers All of the convert* handlers set up template variables for the Smarty template. {@, this class uses getSourceLocation() and getClassesOnPage() to set template variables. Also used is getPageName(), to get a Converter-specific name for the page.}}
string function Converter::ConvertTitle($tag, $attr, $title, $cdata) [line 1396] Function Parameters:
string $tag tag name array $attr string $title title text string $cdata
Convert the title of a Tutorial docbook tag section to a string based on the template options.ini
Abstract Element
parserTutorial &$element
Default Tutorial Handler Conversion Handlers All of the convert* handlers set up template variables for the Smarty template. Sets up
the tutorial template, and its prev/next/parent links {@ and uses the parserTutorial::prev, parserTutorial::next, parserTutorial::parent links to set up those links.}}
Converts class variables for template output. Conversion Handlers All of the convert* handlers set up template variables for the Smarty template. This function must be called by a child converter with any extra needed in the parameter $addition template variables
Abstract Element
Copies a file from the template directory to the target directory thanks to Robert Hoffmann for this fix
string $dir
Recursively creates all subdirectories that don't exist in the $dir path
string function Converter::EncloseList($list, $ordered) [line 888] Function Parameters:
string $para
Called bywalk() while converting, when the last class element has been parsed. A Converter can use this method in any way it pleases. HTMLframesConverter uses it to complete the template for the class and to output its documentation
Called by walk() while converting, when the last procedural page element has been parsed. A Converter can use this method in any way it pleases. HTMLframesConverter uses it to complete the template for the procedural page and to output its documentation
string function Converter::exampleProgramExample($example, [$tutorial = false], [$inlinesourceparse = null], [$class = null], [$linenum = null], [$filesourcepath = null]) [line 773] Function Parameters:
string $example boolean $tutorial true if this is to highlight a tutorial <programlisting> $inlinesourceparse $class $linenum $filesourcepath
Used to convert the {@example} inline tag in a docblock. By default, this just wraps ProgramExample
See XMLDocBookpeardoc2Converter::exampleProgramExample
Called bywalk() while converting. This method is intended to be the place that $elements is formatted for output.
Called bywalk() while converting. This method is intended to be the place that any of $class_elements, $function_elements, $page_elements, $define_elements, and $global_elements is formatted for output, depending on the value of $leftindex
Called bywalk() while converting. This method is intended to be the place that $pkg_elements is formatted for output.
array $toc format: array(array('tagname' => section, 'link' => returnsee link, 'id' =>
Creates a table of contents for a {@toc} inline tag in a tutorial This function should return a formatted table of contents. By default, it does nothing, it is up to the converter to format the TOC
Uses parserClass::getChildClassList()
returns an array containing the class inheritance tree from the root object to the class. This method must be overridden, or phpDocumentor will halt with a fatal error
Abstract Element
parserData &$element
gets a list of all classes declared on a procedural page represented by $element, a parserData class
mixed function Converter::getClassLink($expr, $package, [$file = false], [$text = false]) [line 3179] Function Parameters:
string $expr class name string $package package name $file $text
See classLink
mixed function Converter::getConstLink($expr, $class, $package, [$file = false], [$text = false]) [line 3354] Function Parameters:
string $expr constant name string $class class name string $package package name $file $text
See constLink
Abstract Element
string $pathinfo
string $expr constant name string $package package name $file $text
See defineLink
Translate the path info into a unique file name for the highlighted source code.
string function Converter::getFileSourcePath($base) [line 1083] Function Parameters:
mixed &$element parserClass, parserFunction, parserDefine or parserGlobal string $type type to display. either 'class','function','define' or 'global variable'
parserMethod &$element
Uses parserMethod::getOverridingMethods()
parserVar &$element
Uses parserVar::getOverridingVars()
returns an array containing the class inheritance tree from the root object to the class. This method must be overridden, or phpDocumentor will halt with a fatal error
Abstract Element
Return template-enabled list of inherited class constants uses parserConst helper function getInheritedConsts and generates a enabled list using getClassLink()
template-
Return template-enabled list of inherited methods uses parserMethod helper function getInheritedMethods and generates a templateenabled list using getClassLink()
Return template-enabled list of inherited variables uses parserVar helper function getInheritedVars and generates a template-enabled list using getClassLink()
parserMethod &$element
Uses parserMethod::getImplements()
parserMethod &$element
See parserMethod::getOverrides()
mixed function Converter::getFunctionLink($expr, $package, [$file = false], [$text = false]) [line 3203] Function Parameters:
string $expr function name string $package package name $file $text
See functionLink
mixed function Converter::getGlobalLink($expr, $package, [$file = false], [$text = false]) [line 3251] Function Parameters:
string $expr global variable name (with leading $) string $package package name $file $text
See defineLink
Parse a global variable's default value for class initialization. If a global variable's default value is "new class" as in:
1 $globalvar = new Parser
This method will document it not as "new Parser" but instead as "new Parser". examples, see phpdoc.inc. Many global variables are classes, and phpDocumentor links to their documentation
For
void function Converter::getHighlightState() [line 588] string function Converter::getId(&$link) [line 3952] Function Parameters:
abstractLink &$link
take abstractLink descendant and text $eltext and return a unique ID in the format needed for the Converter
Abstract Element
string $value file included by include statement. string $ipath path of file that has the include statement
Parse an include's file to see if it is a file documented in this project Although not very smart yet, this method will try to look for the included file file.ext:
1 include ("file.ext" );
If it finds it, it will return a link to the file's documentation. As of 1.2.0rc1, phpDocumentor is smarty enough to find these cases: absolute path to file ./file.ext or ../file.ext relpath/to/file.ext if relpath is a subdirectory of the base parse directory For examples, see Setup.inc.php includes. Every include auto-links to the documentation for the file that is included
mixed function Converter::getLink($expr, [$package = false], [$packages = false]) [line 3565] Function Parameters:
string $expr expression to search for a link string $package package to start searching in array $packages list of all packages to search in
The meat of the @see tag and inline {@link} tag $expr is a string with many allowable formats:
1. 2. 3. 4. 5. 6. 7. 8. 9. 10.
proceduralpagename.ext constant_name classname::function() classname::constantname classname::$variablename classname object classname function functionname() global $globalvarname packagename#expr where expr is any of the above
New in version 1.1, you can explicitly specify a package to link to that is different from the current package. Use the # operator to specify a new package, as in tests#bug540368.php (which should appear as a link like: " tests#bug-540368.php"). This example links to the procedural page bug-540368.php in package tests. Also, the "function" operator is now used to specifically link to a function instead of a method in the current class.
1 class myclass 2 { 3 // from inside the class definition, use "function conflict()" to refer to procedural function "conflict()" 4 function conflict() 5 { 6 } 7 } 8 9 function conflict() 10 { 11 }
If classname:: is not present, and the see tag is in a documentation block within a class, then the function uses the classname to search for $expr as a function or variable within classname, or any of its parent classes. given an $expr without '$', '::' or '()' getLink first searches for classes, procedural pages, constants, global variables, and then searches for methods and variables within the default class, and finally for any function
See pageLink, functionLink, defineLink, classLink, methodLink, varLink See Converter::getPageLink(), Converter::getDefineLink(), Converter::getVarLink(), Converter::getFunctionLink(), Converter::getClassLink()
mixed function Converter::getMethodLink($expr, $class, $package, [$file = false], [$text = false]) [line 3300] Function Parameters:
string $class class name string $package package name $file $text
See methodLink
mixed function Converter::getPageLink($expr, $package, [$path = false], [$text = false], [$packages = false]) [line 3275] Function Parameters:
string $expr procedural page name string $package package name $path $text $packages
See pageLink
Return a tree of all classes that extend this class The data structure returned is designed for a non-recursive algorithm, somewhat complex. In most cases, the array returned is:
and is
array('#root' => array('link' => classLink to $class, 'parent' => false, 'children' => array(array('class' => 'childclass1', 'package' => 'child1package'), array('class' => 'childclass2', 'package' => 'child2package'),... ) ), 'child1package#childclass1' => array('link' => classLink to childclass1, 'parent' => '#root', 'children' => array(array('class' => 'kidclass', 'package' => 'kidpackage'),... ) ), 'kidpackage#kidclass' => array('link' => classLink to kidclass, 'parent' => 'child1package#childclass1', 'children' => array() // no children ), .... ) To describe this format using language, every class in the tree has an entry in the first level of the array. The index for all child classes that extend the root class is childpackage#childclassname. Each entry in the array has 3 elements: link, parent, and children. link - a classLink to the current class parent - a classLink to the class's parent, or false (except for one special case described below) children - an array of arrays, each entry has a 'class' and 'package' index to the child class, used to find the entry in the big array
special cases are when the #root class has a parent in another package, or when the #root class extends a class not found by phpDocumentor. In the first case, parent will be a classLink to the parent class. In the second, parent will be the extends clause, as in:
1 2 3 4 class X extends Y { ... }
in this case, the #root entry will be array('link' => classLink to X, 'parent' => 'Y', children => array(...)) The fastest way to design a method to process the array returned is to copy HTMLframesConverter::getRootTree() into your converter and to modify the html to whatever output format you are going to use
See HTMLframesConverter::getRootTree()
$path
string function Converter::getTutorialId($package, $subpackage, $tutorial, $id) [line 1418] Function Parameters:
Usedby parserTocInlineTag::Convert() - retrieve the tutorial ID for Usedby parserIdInlineTag::Convert() - retrieve converter-specific ID
tutorialLink|string function Converter::getTutorialLink($expr, [$package = false], [$subpackage = false], [$packages = false]) [line 3417] Function Parameters:
string $expr the original expression string $package package to look in first string $subpackage subpackage to look in first array $packages array of package names to search in if not found in parent packages. This is used to limit the search, phpDocumentor automatically searches all packages
The meat of the @tutorial tag and inline {@tutorial} tag Take a string and return an abstract link to the tutorial it represents. Since tutorial naming literally works like the underlying filesystem, the way to reference the tutorial is similar. Tutorials are located in a subdirectory of any directory parsed, which is named 'tutorials/' (we try to make things simple when we can :). They are further organized by package and subpackage as: tutorials/package/subpackage and the files are named *.cls, *.pkg, or *.proc, and so a link to a tutorial named file.cls can be referenced (depending on context) as any of:
1 2 3 * @tutorial package/subpackage/file.cls * @tutorial package/file.cls * @tutorial file.cls
The first case will only be needed if file.cls exists in both the current package, in anotherpackage/file.cls and in anotherpackage/subpackage/file.cls and you wish to reference the one in anotherpackage/subpackage. The second case is only needed if you wish to reference file.cls in another package and it is unique in that package. the third will link to the first file.cls it finds using this search method:
1. 2. 3. 4.
current package/subpackage all other subpackages of current package parent package, if this package has classes that extend classes in another package all other packages
Since 1.2
parserTutorial|array $tutorial
Get a tree structure representing the hierarchy of tutorials Returns an array in format: array('tutorial' => parserTutorial, 'kids' => array( // child tutorials array('tutorial' => child parserTutorial, 'kids' => array(...) ) ) )
mixed function Converter::getVarLink($expr, $class, $package, [$file = false], [$text = false]) [line 3327] Function Parameters:
string $expr var name string $class class name string $package package name $file $text
See varLink
Determine whether an element's file has generated source code, used for linking to line numbers of source. Wrapper for $sourcePaths in this version
false|parserTutorial function Converter::hasTutorial($type, $name, $package, [$subpackage = '']) [line 490] Function Parameters:
pkg|cls|proc $type the tutorial type to search for tutorial $name name string $package package name string $subpackage subpackage name, if any
string function Converter::highlightDocBlockSource($token, $word, [$preformatted = false]) [line 690] Function Parameters:
string $token name of docblock token type string $word contents of token boolean $preformatted whether the contents are preformatted or need modification
Used to allow converters to format the source code of DocBlocks the way they'd like. default returns it unchanged. Mainly used by the HighlightParser
string function Converter::highlightSource($token, $word, [$preformatted = false]) [line 637] Function Parameters:
integer $token token value from tokenizer constants string $word contents of token boolean $preformatted whether the contents are preformatted or need modification
Used to allow converters to format the source code the way they'd like. default returns it unchanged. Mainly used by the HighlightParser
string function Converter::highlightTutorialSource($token, $word, [$preformatted = false]) [line 728] Function Parameters:
string $token name of docblock token type string $word contents of token boolean $preformatted whether the contents are preformatted or need modification
Used to allow converters to format the source code of Tutorial XML the way they'd like. default returns it unchanged. Mainly used by the HighlightParser
string $para
Usedby parserI::Convert()
string $para
Usedby parserKbd::Convert()
string $item
Return a Smarty template object to operate with This returns a Smarty template with pre-initialized variables for use. If the method "SmartyInit()" exists, it is called.
$title
$text
This version does nothing Perform necessary post-processing of string data. Converters should escape < and > to become < and >
Usedby Converter::convertDefine() - on define_value template value, makes it displayable Usedby Converter::convertGlobal() - on global_value template value, makes it displayable
array function Converter::prepareDocBlock(&$element, [$names = array()], [$nopackage = true]) [line 4456] Function Parameters:
mixed &$element any descendant of parserElement, or parserData array $names used to translate tagnames into other tags boolean $nopackage set to false for pages and classes, the only elements allowed to specify @package
convert the element's DocBlock for output This function converts all tags and descriptions for output
string $string
Usedby parserPre::Convert()
string function Converter::ProgramExample($example, [$tutorial = false], [$inlinesourceparse = null], [$class = null], [$linenum = null], [$filesourcepath = null]) [line 785] Function Parameters:
string $example boolean $tutorial true if this is to highlight a tutorial <programlisting> $inlinesourceparse $class $linenum $filesourcepath
Usedby parserCode::Convert()
take URL $link and text $text and return a link in the format needed for the Converter
Abstract Element
abstractLink &$link
string $eltext
take abstractLink descendant and text $eltext and return a link in the format needed for the Converter
Abstract Element
string $para
Usedby parserSamp::Convert()
Sets the output directory for generated documentation As of 1.3.0RC6, this also sets the compiled templates directory inside the target directory
sets the template directory based on the $outputformat and $name Also sets $templateName to the $dir parameter
&$pages
See $sort_page_contents_by_element_type
string function Converter::sourceLine($linenumber, $line, [$path = false]) [line 1130] Function Parameters:
integer $linenumber line number string $line highlighted source code line false|string $path full path to @filesource file this line is a part of, from a complete file.
Return a line of highlighted source code with formatted line number If the $path is a full path, then an anchor to the line number will be added as well
Used to translate an XML DocBook entity like ” from a tutorial by reading the options.ini file for the template.
string function Converter::TranslateTag($name, $attr, $cdata, $unconvertedcdata) [line 1214] Function Parameters:
string $name tag name string $attr any attributes Format: array(name => value) string $cdata the tag contents, if any string $unconvertedcdata the tag contents, if any, unpost-processed
Used to translate an XML DocBook tag from a tutorial by reading the options.ini file for the template.
Usedby parserXMLDocBookTag::Convert() - Calls this to enclose the contents of the DocBook tag based on the values in template options.ini file
string $example
string $typename
Called by parserReturnTag::Convert() allow converters to change type names to to desired formatting Used by XMLDocBookConverter::type_adjust() to change true and false to the peardoc2 values
string $sourcecode output from highlight_string() - use this function to reformat the returned data for Converter-specific output
Called by parserSourceInlineTag::stringConvert() allow converters to format the to source code the way they'd like. default returns it unchanged (html with xhtml tags)
Deprecated in favor of tokenizer-based highlighting. This will be removed for 2.0 Usedby parserSourceInlineTag::stringConvert() - remove the extraneous stuff from http://www.php.net/highlight_string
$tree $indent
string $para
Usedby parserDescVar::Convert()
array &$pages Format: array(fullpath => parserData structure with full parserData::$elements and parserData::$class_elements. array &$package_pages Format: array(parserPackagePage 1, parserPackagePage 2,...)
called by phpDocumentor_IntermediateParser::Convert() traverse the array of to pages and their elements, converting them to the output format The walk() method should be flexible enough such that it never needs modification. walk() sets up all of the indexes, and sorts everything in logical alphabetical order. It then passes each element individually to Convert(), which then passes to the Convert*()
methods. A child Converter need not override any of these unless special functionality must be added. see Converter Default Template Variables for details. {@ and the left indexes specified by $leftindexes, and then sorts them by calling sortIndexes(). Next, it converts all README/CHANGELOG/INSTALL-style files, using Convert_RIC. After this, it passes all package-level docs to Convert(). Then, it calls the index sorting functions formatPkgIndex(), formatIndex() and formatLeftIndex(). Finally, it converts each procedural page in alphabetical order. This stage passes elements from the physical file to Convert() in alphabetical order. First, procedural page elements parserDefine, parserInclude parserGlobal, and parserFunction are passed to Convert(). Then, class elements are passed in this order: parserClass, then all of the parserVars in the class and all of the parserMethods in the class. Classes are in alphabetical order, and both vars and methods are in alphabetical order. Finally, ConvertErrorLog() is called and the data walk is complete.}}
Usedby phpDocumentor_IntermediateParser::Convert() - passes $pages and $package_pages Uses Converter::_createPkgElements() - sets up $elements and $pkg_elements array, as well as $links
walk over elements by package rather than page This method is designed for converters like the PDF converter that need everything passed in alphabetical order by package/subpackage and by procedural and then class information
string $title example title string $path example filename (no path) string $source fully highlighted/linked source code of the file
Write out the formatted source code for an example php file This function provides the primary functionality for the @example tag.
Abstract Element
void function Converter::writeFile($file, $data, [$binary = false]) [line 5318] Function Parameters:
string $file string $data boolean $binary true if the data is binary and not text
string $filepath full path to the file string $source fully highlighted/linked source code of the file
Write out the formatted source code for a php file This function provides the primary functionality for the @filesource tag.
string $directory
$type $token
string function Converter::_tutorial_path($pkg, [$subpkg = 0], [$namepkg = 0]) [line 2081] Function Parameters:
CHMdefaultConverter.inc
CHM (Compiled Help Manual) output converter for Smarty Template. phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2003-2006 Andrew Eddie, Greg Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package Converters Sub-Package CHMdefault Author Joshua Eichorn < [email protected]> Author Greg Beaver < [email protected]> Version CVS: $Id: CHMdefaultConverter.inc 234145 2007-04-19 20:20:57Z ashnazg $ Copyright 2000-2006 Joshua Eichorn, Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.0rc1 Filesource Source Code for this file License LGPL
Class CHMdefaultConverter
[line 56]
Generates files that MS HTML Help Worshop can use to create a MS Windows compiled help file (CHM) The free MS HTML Help compiler takes the project file (phpdoc.hhp) and reads the table of contents file specified in the project (which is always contents.hhc in phpDocumentor). When the converter reaches stable state, it will also output an index file index.hhk. The free download for MS HTML Help Workshop is available below
Package Converters Sub-Package CHMdefault Author Greg Beaver < [email protected]> Version $Revision: 234145 $ Link MS HTML Help Workshop download Since 1.0rc1
target directory passed on the command-line. $targetDir is malleable, always adding package/ and package/subpackage/ subdirectories onto it.
contains all of the template procedural page element loop data needed for the current template
CHMdefaultConverter::$currentclass array = [line 122]
contains all of the template class element loop data needed for the current template
controls formatting of parser informative output Converter prints: "Converting /path/to/file.php... Procedural Page Elements... Classes..." Since CHMdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that and is purely cosmetic
CHMdefaultConverter::$leftindex array = array('classes' => true, 'pages' => true, 'functions' => true, 'defines' => false, 'globals' => false) [line 72]
array of converted package page names. Used to link to the package page in the left index
See Converter::$sort_page_contents_by_type
CHMdefaultConverter::$wrote mixed = false [line 123] Constructor void function CHMdefaultConverter::CHMdefaultConverter(&$allp, &$packp, &$classes, &$procpages, $po, $pp, $qm, $targetDir, $templateDir, $title) [line 135] Function Parameters:
&$allp &$packp &$classes &$procpages $po $pp $qm $targetDir $templateDir $title
See Converter::Converter()
$file
void function CHMdefaultConverter::addKLink($name, $file, [$bookmark = ''], [$group = '']) [line 1794] Function Parameters:
string $name index entry name string $file filename containing index string $bookmark html anchor of location in file, if any string $group group this entry with a string
Author Andrew Eddie < [email protected]> Uses CHMdefaultConverter::$KLinks - tracks the index
void function CHMdefaultConverter::addSourceTOC($name, $file, $package, $subpackage, [$source = false]) [line 1761] Function Parameters:
$subpackage $source
void function CHMdefaultConverter::addTOC($name, $file, $package, $subpackage, [$class = false], [$tutorial = false]) [line 1772] Function Parameters:
parserClass &$element
parserDefine &$element
parserDefine &$element
Create errors.html template file output This method takes all parsing errors and warnings and spits them out ordered by file and line number.
Global Variable Used ErrorTracker $phpDocumentor_errors: We'll be using it's output facility
parserFunction &$element
parserGlobal &$element
parserInclude &$element
See Converter::prepareDocBlock()
parserDefine &$element
parserPackagePage &$element
parserData &$element
void function CHMdefaultConverter::ConvertTodoList() [line 644] void function CHMdefaultConverter::convertTutorial(&$element) [line 794] Function Parameters:
parserTutorial &$element
parserDefine &$element
Writes out the template file of $class_dataand unsets the template to save memory
Writes out the template file of $page_data and unsets the template to save memory
CHMdefaultConverter uses this function to format template index.html and packages.html This function generates the package list from $all_packages, eliminating any packages that don't have any entries in their package index (no files at all, due to @ignore or other factors). Then it uses the default package name as the first package index to
display. It sets the right pane to be either a blank file with instructions on making packagelevel docs, or the package-level docs for the default package.
Global Variable Used string $phpDocumentor_DefaultPackageName: Used to set the starting package to display
Generate indexes for li_package.html and classtree output files This function generates the li_package.html files from the template file left.html. It does this by iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve the pre-sorted abstractLink descendants needed for index generation. Conversion of these links to text is done by returnSee(). The $local parameter is set to false to ensure that paths are correct. Then it uses generateFormattedClassTrees() to create class trees from the template file classtrees.html. Output filename is classtrees_packagename.html. This function also unsets $elements and $pkg_elements to free up the considerable memory these two class vars use
CHMdefaultConverter chooses to format both package indexes and the complete index here This function formats output for the elementindex.html and pkgelementindex.html template files. It then writes them to the target directory
array $toc format: array(array('tagname' => section, 'link' => returnsee link, 'id' => anchor name, 'title' => from title tag),...)
returns an array containing the class inheritance tree from the root object to the class
Uses parserClass::getParentClassTree()
See CHMdefaultConverter::generatePkgElementIndex()
Usedby bug698356_Output() - assigns to the toc template variable Usedby CHMdefaultConverter::Output() - assigns to the toc template variable
$value
mixed function CHMdefaultConverter::getClassLink($expr, $package, [$file = false], [$text = false], [$with_a = true]) [line 1516] Function Parameters:
string $expr name of class string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $with_a return just the URL, or enclose it in an html a tag
See Converter::getClassLink()
mixed function CHMdefaultConverter::getConstLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 1631] Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of class constant string $class class containing class constant string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getVarLink()
void function CHMdefaultConverter::getCurrentPageLink() [line 289] mixed function CHMdefaultConverter::getDefineLink($expr, $package, [$file = false], [$text = false], 4) [line 1548] Function Parameters:
boolean 4 return just the URL, or enclose it in an html a tag string $expr name of define string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getDefineLink()
$path $title
mixed function CHMdefaultConverter::getFunctionLink($expr, $package, [$file = false], [$text = false], 4) [line 1532] Function Parameters:
boolean 4 return just the URL, or enclose it in an html a tag string $expr name of function string $package package name
string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getFunctionLink()
mixed function CHMdefaultConverter::getGlobalLink($expr, $package, [$file = false], [$text = false], 4) [line 1564] Function Parameters:
boolean 4 return just the URL, or enclose it in an html a tag string $expr name of global variable string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getGlobalLink()
$element $fullpath
See CHMdefaultConverter::generateElementIndex()
mixed function CHMdefaultConverter::getMethodLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 1597] Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of method string $class class containing method string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getMethodLink()
mixed function CHMdefaultConverter::getPageLink($expr, $package, [$path = false], [$text = false], 4) [line 1580] Function Parameters:
boolean 4 return just the URL, or enclose it in an html a tag string $expr name of procedural page string $package package name string $path full path to look in (used in index generation) boolean $text deprecated
See Converter::getPageLink()
&$element
string function CHMdefaultConverter::getRootTree($tree, $package, [$noparent = false], $nounknownparent) [line 1134] Function Parameters:
array $tree output from getSortedClassTreeFromClass() string $package package boolean $nounknownparent if true, an object's parent will not be checked $noparent
string function CHMdefaultConverter::getSourceAnchor($sourcefile, $anchor, [$text = ''], [$link = false]) [line 220] Function Parameters:
string $sourcefile full path to source file string $anchor name of anchor string $text link text, if this is a link boolean $link returns either a link or a destination based on this
parameter
Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag.
void function CHMdefaultConverter::getSourceLink($path) [line 204] Function Parameters:
$path
void function CHMdefaultConverter::getTutorialId($package, $subpackage, $tutorial, $id) [line 764] Function Parameters:
$id
mixed function CHMdefaultConverter::getVarLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 1614] Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of var string $class class containing var string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getVarLink()
Create the phpdoc.hhp, contents.hhc files needed by MS HTML Help Compiler create a CHM file The output function generates the table of contents (contents.hhc) and file (phpdoc.hhp) files used to create a .CHM by the free MS HTML Help compiler. {@, a of all separate .html files is created in CHM format, and written to phpdoc.hhp. This was generated by writefile. Next, a call to the table of contents: 12 phpDocumentor_out("NOTE: to create the documentation.chm file, you must now run Microsoft Help Workshop on phpdoc.hhp\n" ); 13 phpDocumentor_out("To get the free Microsoft Help Workshop, browse to: http://go.microsoft.com/fwlink/?LinkId=14188\n" ); finishes things off}}
Link http://www.microsoft.com/downloads/release.asp?releaseid=33071 TODO use to directly call html help compiler hhc.exe Uses CHMdefaultConverter::generateTOC() - assigns to the toc template variable
$text
mixed $a mixed $b
does a nat case sort on the specified second level value of the array
int function CHMdefaultConverter::rcNatCmp1($a, $b) [line 1661] Function Parameters:
mixed $a mixed $b
does a nat case sort on the specified second level value of the array. this one puts constructors first
void function CHMdefaultConverter::returnSee(&$element, [$eltext = false], [$with_a = true], 3) [line 561] Function Parameters:
boolean 3 determines whether the returned text is enclosed in an <a> tag abstractLink &$element a descendant of abstractlink should be passed, and never text string $eltext text to display in the link boolean $with_a this parameter is not used, and is deprecated
$dir
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
See Converter::setTargetDir()
$dir
&$templ
string function CHMdefaultConverter::sourceLine($linenumber, $line, [$path = false]) [line 242] Function Parameters:
integer $linenumber line number string $line highlighted source code line false|string $path full path to @filesource file this line is a part of, from a complete file.
Return a line of highlighted source code with formatted line number If the $path is a full path, then an anchor to the line number will be added as well
string $example
$sourcecode
$file $contents
Write a file to disk, and add it to the $hhp_files list of files to include in the generated CHM 1 function writefile($file,$contents ) 2 { 3 $this -> addHHP( this $ -> targetDir . PATH_DELIMITER .$file); 4 Converter::writefile( $file,$contents ); 5 }
$key
string $path full path to the source file string $value fully highlighted source code
HTMLframesConverter.inc
HTML original framed output converter, modified to use Smarty Template. This Converter takes output from the Parser and converts it to HTML-ready output for use with Smarty. phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package Converters Sub-Package HTMLframes Author Gregory Beaver < [email protected]> Version CVS: $Id: HTMLframesConverter.inc 234145 2007-04-19 20:20:57Z ashnazg $ Copyright 2002-2006 Gregory Beaver See parserDefine, parserFunction, parserMethod, parserVar See parserDocBlock, parserInclude, parserPage, parserClass Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.2 Filesource Source Code for this file License LGPL
HTMLSmartyConverter.inc
HTML output converter for Smarty Template. This Converter takes output from the Parser and converts it to HTML-ready output for use with Smarty. phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2000-2006 Joshua Eichorn, Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package Converters Sub-Package HTMLframes Author Joshua Eichorn < [email protected]> Author Greg Beaver < [email protected]> Version CVS: $Id: HTMLSmartyConverter.inc 234145 2007-04-19 20:20:57Z ashnazg $ Copyright 2000-2006 Joshua Eichorn, Gregory Beaver See parserDefine, parserFunction, parserMethod, parserVar See parserDocBlock, parserInclude, parserPage, parserClass Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.0rc1 Filesource Source Code for this file License LGPL
Class HTMLframesConverter
[line 53]
HTML output converter. This Converter takes output from the Parser and converts it to HTML-ready output for use with Smarty.
Package Converters Sub-Package HTMLframes Author Greg Beaver < [email protected]> Version $Id: HTMLframesConverter.inc 234145 2007-04-19 20:20:57Z ashnazg $ See parserDocBlock, parserInclude, parserPage, parserClass, parserDefine, parserFunction, parserMethod, parserVar Since 1.2
target directory passed on the command-line. $targetDir is malleable, always adding package/ and package/subpackage/ subdirectories onto it.
contains all of the template procedural page element loop data needed for the current template
HTMLframesConverter::$currentclass array = [line 125]
contains all of the template class element loop data needed for the current template
HTMLframesConverter::$juststarted boolean = false [line 113]
controls formatting of parser informative output Converter prints: "Converting /path/to/file.php... Procedural Page Elements... Classes..." Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that and is purely cosmetic
HTMLframesConverter::$leftindex array = array('classes' => true, 'pages' => true, 'functions' => true, 'defines' => false, 'globals' => false) [line 75]
array of converted package page names. Used to link to the package page in the left index
This converter knows about the new root tree processing In order to fix PEAR Bug #6389
HTMLframesConverter::$ric_set mixed = array() [line 127] HTMLframesConverter::$sort_page_contents_by_type boolean = true [line 66]
See Converter::$sort_page_contents_by_type
HTMLframesConverter::$wrote mixed = false [line 126] Constructor void function HTMLframesConverter::HTMLframesConverter(&$allp, &$packp, &$classes, &$procpages, $po, $pp, $qm, $targetDir, $templateDir, $title) [line 133] Function Parameters:
&$allp &$packp &$classes &$procpages $po $pp $qm $targetDir $templateDir $title
See Converter::Converter()
parserClass &$element
parserDefine &$element
parserDefine &$element
Create errors.html template file output This method takes all parsing errors and warnings and spits them out ordered by file and line number.
Global Variable Used ErrorTracker $phpDocumentor_errors: We'll be using it's output facility
parserFunction &$element
parserGlobal &$element
parserInclude &$element
See Converter::prepareDocBlock()
parserDefine &$element
parserPackagePage &$element
parserData &$element
void function HTMLframesConverter::ConvertTodoList() [line 879] void function HTMLframesConverter::convertTutorial(&$element) [line 1006] Function Parameters:
parserTutorial &$element
parserDefine &$element
void function HTMLframesConverter::copyMediaRecursively($media, $targetdir, [$subdir = '']) [line 1558] Function Parameters:
Writes out the template file of $class_dataand unsets the template to save memory
Writes out the template file of $page_data and unsets the template to save memory
HTMLdefaultConverter uses this function to format template index.html and packages.html This function generates the package list from $all_packages, eliminating any packages that don't have any entries in their package index (no files at all, due to @ignore or other factors). Then it uses the default package name as the first package index to display. It sets the right pane to be either a blank file with instructions on making packagelevel docs, or the package-level docs for the default package.
Global Variable Used string $phpDocumentor_DefaultPackageName: Used to set the starting package to display
Generate indexes for li_package.html and classtree output files This function generates the li_package.html files from the template file left.html. It does this by iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve the pre-sorted abstractLink descendants needed for index generation. Conversion of these links to text is done by returnSee(). The $local parameter is set to false to ensure that paths are correct. Then it uses generateFormattedClassTrees() to create class trees from the template file classtrees.html. Output filename is classtrees_packagename.html. This function also unsets $elements and $pkg_elements to free up the considerable memory these two class vars use
HTMLdefaultConverter chooses to format both package indexes and the complete index here This function formats output for the elementindex.html and pkgelementindex.html template files. It then writes them to the target directory
array $toc format: array(array('tagname' => section, 'link' => returnsee link, 'id' => anchor name, 'title' => from title tag),...)
returns an array containing the class inheritance tree from the root object to the class
Uses parserClass::getParentClassTree()
See HTMLframesConverter::generatePkgElementIndex()
$value
mixed function HTMLframesConverter::getClassLink($expr, $package, [$file = false], [$text = false], [$with_a = true]) [line 1714] Function Parameters:
string $expr name of class string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $with_a return just the URL, or enclose it in an html a tag
See Converter::getClassLink()
mixed function HTMLframesConverter::getConstLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 1829] Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of class constant string $class class containing class constant string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getVarLink()
void function HTMLframesConverter::getCurrentPageLink() [line 284] mixed function HTMLframesConverter::getDefineLink($expr, $package, [$file = false], [$text = false], 4) [line 1746] Function Parameters:
boolean 4 return just the URL, or enclose it in an html a tag string $expr name of define string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getDefineLink()
$path $title
mixed function HTMLframesConverter::getFunctionLink($expr, $package, [$file = false], [$text = false], 4) [line 1730] Function Parameters:
boolean 4 return just the URL, or enclose it in an html a tag string $expr name of function string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getFunctionLink()
mixed function HTMLframesConverter::getGlobalLink($expr, $package, [$file = false], [$text = false], 4) [line 1762] Function Parameters:
boolean 4 return just the URL, or enclose it in an html a tag string $expr name of global variable string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getGlobalLink()
$element $fullpath
See HTMLframesConverter::generateElementIndex()
mixed function HTMLframesConverter::getMethodLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 1795] Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of method string $class class containing method string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getMethodLink()
mixed function HTMLframesConverter::getPageLink($expr, $package, [$path = false], [$text = false], 4) [line 1778] Function Parameters:
string $expr name of procedural page string $package package name string $path full path to look in (used in index generation) boolean $text deprecated
See Converter::getPageLink()
&$element
string function HTMLframesConverter::getRootTree($tree, $package, [$noparent = false], $nounknownparent) [line 1318] Function Parameters:
array $tree output from getSortedClassTreeFromClass() string $package package boolean $nounknownparent if true, an object's parent will not be checked $noparent
string function HTMLframesConverter::getSourceAnchor($sourcefile, $anchor, [$text = ''], [$link = false]) [line 215] Function Parameters:
string $sourcefile full path to source file string $anchor name of anchor string $text link text, if this is a link boolean $link returns either a link or a destination based on this
parameter
Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag.
void function HTMLframesConverter::getSourceLink($path) [line 199] Function Parameters:
$path
void function HTMLframesConverter::getTutorialId($package, $subpackage, $tutorial, $id) [line 975] Function Parameters:
$tutorial $k
mixed function HTMLframesConverter::getVarLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 1812] Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of var string $class class containing var string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getVarLink()
void function HTMLframesConverter::makeLeft() [line 380] void function HTMLframesConverter::Output() [line 1886]
$text
mixed $a mixed $b
does a nat case sort on the specified second level value of the array
int function HTMLframesConverter::rcNatCmp1($a, $b) [line 1859] Function Parameters:
mixed $a mixed $b
does a nat case sort on the specified second level value of the array. this one puts constructors first
void function HTMLframesConverter::returnSee(&$element, [$eltext = false], [$with_a = true], 3) [line 781] Function Parameters:
boolean 3 determines whether the returned text is enclosed in an <a> tag abstractLink &$element a descendant of abstractlink should be passed, and never text string $eltext text to display in the link boolean $with_a this parameter is not used, and is deprecated
$dir
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
See Converter::setTargetDir()
&$templ
string function HTMLframesConverter::sourceLine($linenumber, $line, [$path = false]) [line 236] Function Parameters:
integer $linenumber line number string $line highlighted source code line false|string $path full path to @filesource file this line is a part of, from a complete file.
Return a line of highlighted source code with formatted line number If the $path is a full path, then an anchor to the line number will be added as well
string $example
$sourcecode
$key
string $path full path to the source file string $value fully highlighted source code
Class HTMLSmartyConverter
[line 54]
HTML output converter. This Converter takes output from the Parser and converts it to HTML-ready output for use with Smarty.
Package Converters Sub-Package HTMLSmarty Author Greg Beaver < [email protected]> Version $Revision: 234145 $ See parserDocBlock, parserInclude, parserPage, parserClass, parserDefine, parserFunction, parserMethod, parserVar Since 1.0rc1
target directory passed on the command-line. $targetDir is malleable, always adding package/ and package/subpackage/ subdirectories onto it.
HTMLSmartyConverter::$class_dir
contains all of the template procedural page element loop data needed for the current template
HTMLSmartyConverter::$currentclass array = [line 126]
contains all of the template class element loop data needed for the current template
HTMLSmartyConverter::$juststarted boolean = false [line 114]
controls formatting of parser informative output Converter prints: "Converting /path/to/file.php... Procedural Page Elements... Classes..." Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that and is purely cosmetic
HTMLSmartyConverter::$leftindex array = array('classes' => true, 'pages' => true, 'functions' => true, 'defines' => false, 'globals' => false) [line 76]
This converter knows about the new root tree processing In order to fix PEAR Bug #6389
HTMLSmartyConverter::$ric_set mixed = array() [line 128] HTMLSmartyConverter::$sort_page_contents_by_type boolean = true [line 67]
See Converter::$sort_page_contents_by_type
HTMLSmartyConverter::$wrote mixed = false [line 127] Constructor void function HTMLSmartyConverter::HTMLSmartyConverter(&$allp, &$packp, &$classes, &$procpages, $po, $pp, $qm, $targetDir, $templateDir, $title) [line 148] Function Parameters:
&$allp &$packp &$classes &$procpages $po $pp $qm $targetDir $templateDir $title
parserClass &$element
parserDefine &$element
parserDefine &$element
Create errors.html template file output This method takes all parsing errors and warnings and spits them out ordered by file and line number.
Global Variable Used ErrorTracker $phpDocumentor_errors: We'll be using it's output facility
parserFunction &$element
parserGlobal &$element
parserInclude &$element
See Converter::prepareDocBlock()
parserDefine &$element
Function Parameters:
parserPackagePage &$element
parserData &$element
void function HTMLSmartyConverter::ConvertTodoList() [line 893] void function HTMLSmartyConverter::convertTutorial(&$element) [line 1034] Function Parameters:
parserTutorial &$element
parserDefine &$element
Writes out the template file of $class_dataand unsets the template to save memory
Writes out the template file of $page_data and unsets the template to save memory
HTMLdefaultConverter uses this function to format template index.html and packages.html This function generates the package list from $all_packages, eliminating any packages that don't have any entries in their package index (no files at all, due to @ignore
or other factors). Then it uses the default package name as the first package index to display. It sets the right pane to be either a blank file with instructions on making packagelevel docs, or the package-level docs for the default package.
Global Variable Used string $phpDocumentor_DefaultPackageName: Used to set the starting package to display
Generate indexes for li_package.html and classtree output files This function generates the li_package.html files from the template file left.html. It does this by iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve the pre-sorted abstractLink descendants needed for index generation. Conversion of these links to text is done by returnSee(). Then it uses generateFormattedClassTrees() to create class trees from the template file classtrees.html. Output filename is classtrees_packagename.html. This function also unsets $elements and $pkg_elements to free up the considerable memory these two class vars use
HTMLdefaultConverter chooses to format both package indexes and the complete index here This function formats output for the elementindex.html and pkgelementindex.html template files. It then writes them to the target directory
array $toc format: array(array('tagname' => section, 'link' => returnsee link, 'id' => anchor name, 'title' => from title tag),...)
returns an array containing the class inheritance tree from the root object to the class
Uses parserClass::getParentClassTree()
See HTMLSmartyConverter::generatePkgElementIndex()
$value
void function HTMLSmartyConverter::getClassContents() [line 466] void function HTMLSmartyConverter::getClassLeft() [line 436] mixed function HTMLSmartyConverter::getClassLink($expr, $package, [$file = false], [$text = false], [$with_a = true]) [line 1766] Function Parameters:
string $expr name of class string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $with_a return just the URL, or enclose it in an html a tag
See Converter::getClassLink()
mixed function HTMLSmartyConverter::getConstLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 1881] Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of class constant string $class class containing class constant string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getVarLink()
void function HTMLSmartyConverter::getCurrentPageLink() [line 287] mixed function HTMLSmartyConverter::getDefineLink($expr, $package, [$file = false], [$text = false], 4) [line
boolean 4 return just the URL, or enclose it in an html a tag string $expr name of define string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getDefineLink()
$path $title
mixed function HTMLSmartyConverter::getFunctionLink($expr, $package, [$file = false], [$text = false], 4) [line 1782] Function Parameters:
boolean 4 return just the URL, or enclose it in an html a tag string $expr name of function string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getFunctionLink()
mixed function HTMLSmartyConverter::getGlobalLink($expr, $package, [$file = false], [$text = false], 4) [line 1814] Function Parameters:
string $expr name of global variable string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getGlobalLink()
$element $fullpath
See HTMLSmartyConverter::generateElementIndex()
mixed function HTMLSmartyConverter::getMethodLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 1847] Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of method string $class class containing method string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getMethodLink()
void function HTMLSmartyConverter::getPageContents() [line 482] void function HTMLSmartyConverter::getPageLeft() [line 499] mixed function HTMLSmartyConverter::getPageLink($expr, $package, [$path = false], [$text = false], 4) [line 1830] Function Parameters:
boolean 4 return just the URL, or enclose it in an html a tag string $expr name of procedural page string $package package name string $path full path to look in (used in index generation) boolean $text deprecated
See Converter::getPageLink()
&$element
string function HTMLSmartyConverter::getRootTree($tree, $package, [$noparent = false], $nounknownparent) [line 1370] Function Parameters:
array $tree output from getSortedClassTreeFromClass() string $package package boolean $nounknownparent if true, an object's parent will not be checked $noparent
string function HTMLSmartyConverter::getSourceAnchor($sourcefile, $anchor, [$text = ''], [$link = false]) [line 211] Function Parameters:
string $sourcefile full path to source file string $anchor name of anchor string $text link text, if this is a link boolean $link returns either a link or a destination based on this
parameter
Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag.
void function HTMLSmartyConverter::getSourceLink($path) [line 195] Function Parameters:
$path
void function HTMLSmartyConverter::getTutorialId($package, $subpackage, $tutorial, $id) [line 995] Function Parameters:
void function HTMLSmartyConverter::getTutorialList() [line 369] void function HTMLSmartyConverter::getTutorialTree($tutorial, [$k = false]) [line 396] Function Parameters:
$tutorial $k
mixed function HTMLSmartyConverter::getVarLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 1864]
Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of var string $class class containing var string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getVarLink()
void function HTMLSmartyConverter::makeLeft() [line 554] void function HTMLSmartyConverter::Output() [line 1938]
$text
Function Parameters:
mixed $a mixed $b
does a nat case sort on the specified second level value of the array
int function HTMLSmartyConverter::rcNatCmp1($a, $b) [line 1911] Function Parameters:
mixed $a mixed $b
does a nat case sort on the specified second level value of the array. this one puts constructors first
void function HTMLSmartyConverter::returnSee(&$element, [$eltext = false], [$with_a = true], 3) [line 784] Function Parameters:
boolean 3 determines whether the returned text is enclosed in an <a> tag abstractLink &$element a descendant of abstractlink should be passed, and never text string $eltext text to display in the link boolean $with_a this parameter is not used, and is deprecated
$dir
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
See Converter::setTargetDir()
&$templ
string function HTMLSmartyConverter::sourceLine($linenumber, $line, [$path = false]) [line 232] Function Parameters:
integer $linenumber line number string $line highlighted source code line false|string $path full path to @filesource file this line is a part of, from a complete file.
Return a line of highlighted source code with formatted line number If the $path is a full path, then an anchor to the line number will be added as well
string $example
$sourcecode
$key
void function HTMLSmartyConverter::writeRIC() [line 878] void function HTMLSmartyConverter::writeSource($path, $value) [line 154] Function Parameters:
$path $value
class.phpdocpdf.php
Cezpdf callback class customized for phpDocumentor phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2000-2006 Joshua Eichorn, Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package Converters Sub-Package PDFdefault Author Greg Beaver < [email protected]> Version CVS: $Id: class.phpdocpdf.php 212211 2006-04-30 22:18:14Z cellog $ Copyright 2000-2006 Joshua Eichorn, Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.2 Filesource Source Code for this file License LGPL
42]
41]
ezPdf libraries
ParserPDF.inc
This class handles the XML-based CezPDF markup language created to allow templates for the PDFdefaultConverter phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package Converters Sub-Package PDFdefault Author Greg Beaver < [email protected]> Version CVS: $Id: ParserPDF.inc 238276 2007-06-22 14:58:30Z ashnazg $ Copyright 2002-2006 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.2 Filesource Source Code for this file License LGPL
PDFdefaultConverter.inc
Outputs documentation in PDF format phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package Converters Sub-Package PDFdefault Author Greg Beaver < [email protected]> Version CVS: $Id: PDFdefaultConverter.inc 236747 2007-05-31 02:02:42Z ashnazg $ Copyright 2002-2006 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.2 Filesource Source Code for this file License LGPL
42]
Class PDFdefaultConverter
[line 55]
PDF output converter. This Converter takes output from the Parser and converts it to PDF-ready output for use with Cezpdf. This is now beta code
Package Converters Sub-Package PDFdefault Author Greg Beaver < [email protected]> Version $Id: PDFdefaultConverter.inc 236747 2007-05-31 02:02:42Z ashnazg $ TODO Implement links to conflicts/inheritance Since 1.1
PDFdefaultConverter::$classpackage_pagenums mixed = array() [line 65] PDFdefaultConverter::$curclasspackage mixed = false [line 71] PDFdefaultConverter::$curpagepackage mixed = false [line 70] PDFdefaultConverter::$leftindex mixed = array('classes' => false, 'pages' => false, 'functions' => false, 'defines' => false, 'globals' => false) [line 63] PDFdefaultConverter::$name string = 'default' [line 69]
PDFdefaultConverter::$pagepackage_pagenums mixed = array() [line 64] PDFdefaultConverter::$pdf Cezpdf = false [line 76] PDFdefaultConverter::$ric_set mixed = array() [line 77] PDFdefaultConverter::$smarty_dir mixed = [line 72] PDFdefaultConverter::$sort_absolutely_everything boolean = true [line 62]
See Converter::$sort_page_contents_by_type
Source files for appendix C are stored here Format: array(array(package => array(highlightedsource code 1, ...)))
packagename,
code
=>
Constructor void function PDFdefaultConverter::PDFdefaultConverter(&$allp, &$packp, &$classes, &$procpages, $po, $pp, $qm, $targetDir, $templateDir, $title) [line 88] Function Parameters:
&$allp &$packp
See Converter::Converter()
&$element
&$element
&$element
&$element
&$element
&$element
&$element
&$element
&$element
Deprecated html package pages just don't work with PDF, use phpDocumentor Tutorials
&$element
&$element
&$element
&$element
$value
mixed function PDFdefaultConverter::getClassLink($expr, $package, [$file = false], [$text = false]) [line 843] Function Parameters:
string $expr name of class string $package package name string $file full path to look in (used in index generation) $text
See Converter::getClassLink()
mixed function PDFdefaultConverter::getConstLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 953] Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of class constant string $class class containing class constant string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getConstLink()
mixed function PDFdefaultConverter::getDefineLink($expr, $package, [$file = false], [$text = false]) [line 873] Function Parameters:
string $expr name of define string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getDefineLink()
$path $title
$path $anchor
mixed function PDFdefaultConverter::getFunctionLink($expr, $package, [$file = false], [$text = false]) [line 858] Function Parameters:
string $expr name of function string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getFunctionLink()
mixed function PDFdefaultConverter::getGlobalLink($expr, $package, [$file = false], [$text = false]) [line 888] Function Parameters:
string $expr name of global variable string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getGlobalLink()
$value
mixed function PDFdefaultConverter::getMethodLink($expr, $class, $package, [$file = false], [$text = false]) [line 919] Function Parameters:
string $expr name of method string $class class containing method string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getMethodLink()
mixed function PDFdefaultConverter::getPageLink($expr, $package, [$path = false], [$text = false]) [line 903] Function Parameters:
string $expr name of procedural page string $package package name string $path full path to look in (used in index generation) boolean $text deprecated
See Converter::getPageLink()
&$element
string function PDFdefaultConverter::getSourceAnchor($sourcefile, $anchor, [$text = ''], [$link = false]) [line 167] Function Parameters:
string $sourcefile full path to source file string $anchor name of anchor string $text link text, if this is a link boolean $link returns either a link or a destination based on this
parameter
Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag.
void function PDFdefaultConverter::getSourceLink($path) [line 146] Function Parameters:
$path
1 function PDFdefaultConverter::getState() [line 967] void function PDFdefaultConverter::getTutorialId($package, $subpackage, $tutorial, $id) [line 625] Function Parameters:
mixed function PDFdefaultConverter::getVarLink($expr, $class, $package, [$file = false], [$text = false], 5) [line 936] Function Parameters:
boolean 5 return just the URL, or enclose it in an html a tag string $expr name of var string $class class containing var string $package package name string $file full path to look in (used in index generation) boolean $text deprecated
See Converter::getVarLink()
$a $b
$title
$text
abstractLink &$element a descendant of abstractlink should be passed, and never text string $eltext text to display in the link
$dir
string function PDFdefaultConverter::TranslateTag($name, $attr, $cdata, $unconvertedcdata) [line 602] Function Parameters:
string $name tag name string $attr any attributes Format: array(name => value) string $cdata the tag contents, if any string $unconvertedcdata the tag contents, if any, unpost-processed
Used to translate an XML DocBook tag from a tutorial by reading the options.ini file for the template.
void function PDFdefaultConverter::unmangle($notused, $source) [line 975] Function Parameters:
$notused $source
See Converter::unmangle()
$path $value
Class PDFParser
[line 68]
Package Converters Sub-Package PDFdefault Author Greg Beaver < [email protected]> Version $Id: Parser.inc 238276 2007-06-22 14:58:30Z ashnazg $ Copyright 2000-2007 Kellin, Joshua Eichorn Since 1.2 Usedby phpdocpdf::ezText() - extracts all meta-tags and processes text for output
integer $value
string $parse_data text to parse for PDFParser XML tags string $fontdir full path to the font directory phpdocpdf &$pdf boolean $debug determines whether output is saved in a variable or directly to the output
added
Parse text for PDFParser XML tags, and add the text to the PDF file
Static Variable Used integer $endrecur: used for recursion limiting if a handler for an event is not found
Class phpdocpdf
[line 50]
Generated by phpDocumentor v1.4.3 http://www.phpdoc.org - http://pear.php.net/package/PhpDocumentor - http://www.sourceforge.net/projects/phpdocu
Package Converters Sub-Package PDFdefault Author Wayne Munro, R&OS Ltd, http://www.ros.co.nz/pdf Version 009 (versioning is linked to class.pdf.php) released under a public domain licence.
phpdocpdf::$converter mixed = [line 57] phpdocpdf::$font_dir mixed = false [line 55] phpdocpdf::$indents mixed = array() [line 54] phpdocpdf::$indexContents mixed = array() [line 53] phpdocpdf::$listType mixed = 'ordered' [line 59] phpdocpdf::$reportContents mixed = array() [line 52] phpdocpdf::$set_pageNumbering mixed = false [line 56] phpdocpdf::$_colorStack mixed = array() [line 60] phpdocpdf::$_save mixed = '' [line 58] Constructor void function phpdocpdf::phpdocpdf(&$pdfconverter, $fontdir, [$paper = 'a4'], [$orientation = 'portrait']) [line 62] Function Parameters:
$message
$Data
$info
$debug
$debug $template
$text
void function phpdocpdf::ezText($text, [$size = 0], [$options = array()], [$test = 0]) [line 215] Function Parameters:
Uses PDFParser - extracts all meta-tags and processes text for output
$offset
$info
$info
$info
$info
$info
$color
$color
void function phpdocpdf::setupTOC() [line 225] void function phpdocpdf::textcolor($info) [line 111] Function Parameters:
$info
$color
void function phpdocpdf::_ezText($text, [$size = 0], [$options = array()], [$test = 0]) [line 253] Function Parameters:
XMLDocBookpeardoc2Converter.inc
Outputs documentation in XML DocBook format, in the version expected by pear.php.net's documentation team phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package Converters Sub-Package XMLDocBook Author Greg Beaver < [email protected]> Version CVS: $Id: XMLDocBookpeardoc2Converter.inc 234423 2007-04-24 21:32:15Z ashnazg $ Copyright 2002-2006 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.2 Filesource Source Code for this file License LGPL
XMLDocBookConverter.inc
XML output converter for DocBook. This Converter takes output from the Parser and converts it to DocBook output
Package Converters Sub-Package XMLDocBook Author Greg Beaver < [email protected]> Version $Id: XMLDocBookConverter.inc 234145 2007-04-19 20:20:57Z ashnazg $ See parserDocBlock, parserInclude, parserPage, parserClass, parserDefine, parserFunction, parserMethod, parserVar Since 1.0
Class XMLDocBookConverter
[line 43]
XML DocBook converter. This Converter takes output from the Parser and converts it to DocBook output
Package Converters Sub-Package XMLDocBook Author Greg Beaver < [email protected]> Version $Id: XMLDocBookConverter.inc 234145 2007-04-19 20:20:57Z ashnazg $ See parserDocBlock, parserInclude, parserPage, parserClass, parserDefine, parserFunction, parserMethod, parserVar TODO templates TODO indexes for other DocBook converters not based on peardoc Since 1.0
$targetDir is malleable, always adding package/ and package/subpackage/ subdirectories onto it.
peardoc2 Category
XMLDocBookConverter::$class string = [line 82]
contains all of the template procedural page element loop data needed for the current template
XMLDocBookConverter::$currentclass array = [line 144]
contains all of the template class element loop data needed for the current template
XMLDocBookConverter::$function_data mixed = array() [line 155] XMLDocBookConverter::$juststarted
controls formatting of parser informative output Converter prints: "Converting /path/to/file.php... Procedural Page Elements... Classes..." Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that and is purely cosmetic
XMLDocBookConverter::$leftindex array = array('classes' => true, 'pages' => true, 'functions' => false, 'defines' => false, 'globals' => false) [line 59]
array of converted package page names. Used to link to the package page in the left index
See Converter::$sort_page_contents_by_type
XMLDocBookConverter::$sourceloc mixed = '' [line 157] XMLDocBookConverter::$template_options array = array('usepear' => false) [line 153]
template options. Currently only 1 recognized option usepear usepear tells the getLink() function to return a package link to PEAR and
Generated
by
phpDocumentor
v1.4.3
http://www.phpdoc.org
http://pear.php.net/package/PhpDocumentor
http://www.sourceforge.net/projects/phpdocu
PEAR_ERROR if possible, and to link directly to the fully-delimited link package#class.method or package#file.method in PEAR style, if possible, even if the package is not parsed. This will allow parsing of separate PEAR packages without parsing the entire thing at once!
Constructor void function XMLDocBookConverter::XMLDocBookConverter(&$allp, &$packp, &$classes, &$procpages, $po, $pp, $qm, $targetDir, $templateDir, $title) [line 167] Function Parameters:
&$allp &$packp &$classes &$procpages $po $pp $qm $targetDir $templateDir $title
See Converter::Converter()
parserClass &$element
parserDefine &$element
Create errors.html template file output This method takes all parsing errors and warnings and spits them out ordered by file and line number.
Global Variable Used ErrorTracker $phpDocumentor_errors: We'll be using it's output facility
parserFunction &$element
parserGlobal &$element
parserInclude &$element
See XMLDocBookConverter::prepareDocBlock()
parserMethod &$element
Converter::getFormattedDescMethods(), Converter::getFormattedOverrides()
parserPackagePage &$element
parserData &$element
&$element
parserVar &$element
Writes out the template file of $class_dataand unsets the template to save memory
Writes out the template file of $page_data and unsets the template to save memory
HTMLdefaultConverter uses this function to format template index.html and packages.html This function generates the package list from $all_packages, eliminating any packages that don't have any entries in their package index (no files at all, due to @ignore or other factors). Then it uses the default package name as the first package index to display. It sets the right pane to be either a blank file with instructions on making packagelevel docs, or the package-level docs for the default package.
Global Variable Used string $phpDocumentor_DefaultPackageName: Used to set the starting package to display
This function generates the li_package.html files from the template file left.html. It does this by iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve the pre-sorted abstractLink descendants needed for index generation. Conversion of these links to text is done by returnSee(). The $local parameter is set to false to ensure that paths are correct. Then it uses generateFormattedClassTrees() to create class trees from the template file classtrees.html. Output filename is classtrees_packagename.html. This function also unsets $elements and $pkg_elements to free up the considerable memory these two class vars use
HTMLdefaultConverter chooses to format both package indexes and the complete index here This function formats output for the elementindex.html and pkgelementindex.html template files. It then writes them to the target directory
returns an array containing the class inheritance tree from the root object to the class
Uses parserClass::getParentClassTree()
See XMLDocBookConverter::generatePkgElementIndex()
$value
mixed function XMLDocBookConverter::getClassLink($expr, $package, [$file = false], [$text = false], [$local = true], [$with_a = true]) [line 1627] Function Parameters:
string $expr name of class string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag $with_a
See Converter::getClassLink()
mixed function XMLDocBookConverter::getDefineLink($expr, $package, [$file = false], [$text = false], [$local = true]) [line 1659] Function Parameters:
string $expr name of define string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getDefineLink()
mixed function XMLDocBookConverter::getFunctionLink($expr, $package, [$file = false], [$text = false], [$local = true]) [line 1643] Function Parameters:
string $expr name of function string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getFunctionLink()
mixed function XMLDocBookConverter::getGlobalLink($expr, $package, [$file = false], [$text = false], [$local = true]) [line 1675] Function Parameters:
string $expr name of global variable string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getGlobalLink()
void function XMLDocBookConverter::getLink($expr, [$package = false], [$packages = false]) [line 175] Function Parameters:
string $expr name of method string $class class containing method string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getMethodLink()
mixed function XMLDocBookConverter::getPageLink($expr, $package, [$path = false], [$text = false], [$local = true]) [line 1691] Function Parameters:
string $expr name of procedural page string $package package name string $path full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getPageLink()
&$element
void function XMLDocBookConverter::getTutorialId($package, $subpackage, $tutorial, $id) [line 696] Function Parameters:
mixed function XMLDocBookConverter::getVarLink($expr, $class, $package, [$file = false], [$text = false], [$local = true]) [line 1725] Function Parameters:
string $expr name of var string $class class containing var string $package package name
string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getVarLink()
void function XMLDocBookConverter::makeLeft() [line 282] void function XMLDocBookConverter::Output() [line 1782]
$text
&$element $nopackage
mixed $a mixed $b
does a nat case sort on the specified second level value of the array
int function XMLDocBookConverter::rcNatCmp1($a, $b) [line 1755] Function Parameters:
mixed $a mixed $b
does a nat case sort on the specified second level value of the array. this one puts constructors first
void function XMLDocBookConverter::returnSee(&$element, [$eltext = false], [$local = true], [$with_a = true]) [line 476] Function Parameters:
abstractLink &$element a descendant of abstractlink should be passed, and never text string $eltext text to display in the link boolean $local this parameter is not used, and is deprecated boolean $with_a determines whether the returned text is enclosed in an <a> tag
$dir
calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
See Converter::setTargetDir()
$dir
&$templ
$typename
$s $sourcecode
$key
Class XMLDocBookpeardoc2Converter
[line 58]
XML DocBook converter. This Converter takes output from the Parser and converts it to DocBook output for PEAR documentation. This Converter differs from the parent DocBook Converter in that it does not recognize the possibility of procedural pages or of functions! All functions must be defined as static methods for namespace purposes. In addition, all constants and global variables for a package are grouped together as per peardoc2 requirements. Include statements are
not documented. If you want to document a normal project, don't use the peardoc2 converter, use the DocBook converter.
Package Converters Sub-Package XMLDocBook Author Greg Beaver < [email protected]> Version $Id: XMLDocBookpeardoc2Converter.inc 234423 2007-04-24 21:32:15Z ashnazg $ Since 1.2
target directory passed on the command-line. $targetDir is malleable, always adding package/ and package/subpackage/ subdirectories onto it.
peardoc2 Category
XMLDocBookpeardoc2Converter::$class string = [line 103]
contains all of the template procedural page element loop data needed for the current template
XMLDocBookpeardoc2Converter::$currentclass array = [line 182]
contains all of the template class element loop data needed for the current template
XMLDocBookpeardoc2Converter::$function_data mixed = array() [line 198] XMLDocBookpeardoc2Converter::$juststarted boolean = false [line 170]
controls formatting of parser informative output Converter prints: "Converting /path/to/file.php... Procedural Page Elements... Classes..." Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that and is purely cosmetic
XMLDocBookpeardoc2Converter::$leftindex array = array('classes' => true, 'pages' => false, 'functions' => false, 'defines' => true, 'globals' => true) [line 80]
string = 'DocBook/peardoc2' [line 75] XMLDocBookpeardoc2Converter::$outputformat string = 'XML' [line 73] XMLDocBookpeardoc2Converter::$packagexml Smarty = [line 159]
array of converted package page names. Used to link to the package page in the left index
This converter knows about the new root tree processing In order to fix PEAR Bug #6389
See Converter::$sort_page_contents_by_type
XMLDocBookpeardoc2Converter::$sourceloc mixed = '' [line 202] XMLDocBookpeardoc2Converter::$template_options array = array('usepear' => false) [line 196]
template options. Currently only 1 recognized option usepear usepear tells the getLink() function to return a package link to PEAR and PEAR_ERROR if possible, and to link directly to the fully-delimited link package#class.method or package#file.method in PEAR style, if possible, even if the package is not parsed. This will allow parsing of separate PEAR packages without parsing the entire thing at once!
XMLDocBookpeardoc2Converter::$_peardoc2_constants
&$allp &$packp &$classes &$procpages $po $pp $qm $targetDir $templateDir $title
See Converter::Converter()
$template_output
$input
parserClass &$element
Uses XMLDocBookpeardoc2Converter::flushPackageXml() - creates packagename.xml file when all classes in a package have been converted
parserDefine &$element
Create errors.html template file output This method takes all parsing errors and warnings and spits them out ordered by file and line number.
Global Variable Used ErrorTracker $phpDocumentor_errors: We'll be using it's output facility
parserFunction &$element
parserGlobal &$element
parserInclude &$element
Converts include elements for template output Completely ignored by this converter
parserMethod &$element
parserPackagePage &$element
parserData &$element
parserTutorial &$element
parserVar &$element
Writes out the template file of $class_dataand unsets the template to save memory
See registerCurrentClass() See Converter::endClass() TODO move class summary into an array to be written out at the end package
of parsing each
string function XMLDocBookpeardoc2Converter::exampleProgramExample($example, [$tutorial = false], [$inlinesourceparse = null], [$class = null], [$linenum = null], [$filesourcepath = null]) [line 276] Function Parameters:
string $example boolean $tutorial true if this is to highlight a tutorial <programlisting> $inlinesourceparse $class $linenum $filesourcepath
Used to convert the {@example} inline tag in a docblock. By default, this just wraps ProgramExample
See XMLDocBookpeardoc2Converter::exampleProgramExample
Usedby XMLDocBookpeardoc2Converter::convertClass() - creates packagename.xml file when all classes in a package have been converted
Does nothing
void function XMLDocBookpeardoc2Converter::formatLeftIndex() [line 440]
Does nothing
void function XMLDocBookpeardoc2Converter::generateChildClassList($class) [line 1165] Function Parameters:
Uses parserClass::getChildClassList()
does nothing
returns an array containing the class inheritance tree from the root object to the class
Uses parserClass::getParentClassTree()
See XMLDocBookpeardoc2Converter::generatePkgElementIndex()
$value
mixed function XMLDocBookpeardoc2Converter::getClassLink($expr, $package, [$file = false], [$text = false], [$local = true], [$with_a = true]) [line 1415] Function Parameters:
string $expr name of class string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag $with_a
See Converter::getClassLink()
mixed function XMLDocBookpeardoc2Converter::getDefineLink($expr, $package, [$file = false], [$text = false], [$local = true]) [line 1447] Function Parameters:
string $expr name of define string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getDefineLink()
$unused $title
mixed function XMLDocBookpeardoc2Converter::getFunctionLink($expr, $package, [$file = false], [$text = false], [$local = true]) [line 1431] Function Parameters:
string $expr name of function string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getFunctionLink()
mixed function XMLDocBookpeardoc2Converter::getGlobalLink($expr, $package, [$file = false], [$text = false], [$local = true]) [line 1463] Function Parameters:
string $expr name of global variable string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getGlobalLink()
mixed &$el descendant of parserElement or parserData/parserPage boolean $returnpackage true to return the id for the package page
void function XMLDocBookpeardoc2Converter::getLink($expr, [$package = false], [$packages = false]) [line 237] Function Parameters:
mixed function XMLDocBookpeardoc2Converter::getMethodLink($expr, $class, $package, [$file = false], [$text = false], [$local = true]) [line 1496] Function Parameters:
string $expr name of method string $class class containing method string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getMethodLink()
mixed function XMLDocBookpeardoc2Converter::getPageLink($expr, $package, [$path = false], [$text = false], [$local = true]) [line 1479] Function Parameters:
string $expr name of procedural page string $package package name string $path full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getPageLink()
&$element
string function XMLDocBookpeardoc2Converter::getRootTree($tree, $package, [$noparent = false], $nounknownparent) [line 1312] Function Parameters:
array $tree output from getSortedClassTreeFromClass() string $package package boolean $nounknownparent if true, an object's parent will not be checked $noparent
string function XMLDocBookpeardoc2Converter::getSourceAnchor($sourcefile, $anchor, [$text = ''], [$link = false]) [line 676] Function Parameters:
string $sourcefile full path to source file string $anchor name of anchor string $text link text, if this is a link boolean $link returns either a link or a destination based on this
parameter
Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag. NOTE: unused
void function XMLDocBookpeardoc2Converter::getTutorialId($package, $subpackage, $tutorial, $id, $category) [line 656] Function Parameters:
mixed function XMLDocBookpeardoc2Converter::getVarLink($expr, $class, $package, [$file = false], [$text = false], [$local = true]) [line 1513]
Function Parameters:
string $expr name of var string $class class containing var string $package package name string $file full path to look in (used in index generation) boolean $text deprecated boolean $local return just the URL, or enclose it in an html a tag
See Converter::getVarLink()
void function XMLDocBookpeardoc2Converter::makeLeft() [line 405] void function XMLDocBookpeardoc2Converter::Output() [line 1575]
$text
&$element $nopackage
void function XMLDocBookpeardoc2Converter::ProgramExample($listing, [$tutorial = false], [$inlinesourceparse = null], [$class = null], [$linenum = null], [$filesourcepath = null], [$origsource = null]) [line 691] Function Parameters:
mixed $a mixed $b
does a nat case sort on the specified second level value of the array
int function XMLDocBookpeardoc2Converter::rcNatCmp1($a, $b) [line 1543] Function Parameters:
mixed $a mixed $b
does a nat case sort on the specified second level value of the array. this one puts constructors first
void function XMLDocBookpeardoc2Converter::returnSee(&$element, [$eltext = false], [$local = true], [$with_a = true]) [line 453] Function Parameters:
abstractLink &$element a descendant of abstractlink should be passed, and never text string $eltext text to display in the link boolean $local this parameter is not used, and is deprecated boolean $with_a determines whether the returned text is enclosed in an <link> tag
Function Parameters:
$dir
$typename
$s $sourcecode
$string
void function XMLDocBookpeardoc2Converter::writeFile($file, $data, [$binary = false]) [line 254] Function Parameters:
string $file filename string $data file contents boolean $binary true if the data is binary and not text
$key
Does nothing
void function XMLDocBookpeardoc2Converter::writeSource() [line 433]
Does nothing
class.ezpdf.php
Package Cpdf
Cpdf class
Class Cezpdf
[line 23]
This class will take the basic interaction facilities of the Cpdf class and make more useful functions so that the user does not have to know all the ins and outs of pdf presentation to produce something pretty. IMPORTANT NOTE there is no warranty, implied or otherwise with this software.
Package Cpdf Author Wayne Munro, R&OS Ltd, http://www.ros.co.nz/pdf Version 009 (versioning is linked to class.pdf.php) released under a public domain licence.
Cezpdf::$ez mixed = array('fontSize'=>10) [line 39] Cezpdf::$ezPageCount mixed = 0 [line 42] Cezpdf::$ezPages mixed = array() [line 41] Cezpdf::$y mixed = [line 40] Constructor void function Cezpdf::Cezpdf([$paper = 'a4'], [$orientation = 'portrait']) [line 46] Function Parameters:
$paper $orientation
$info $internal
void function Cezpdf::execTemplate($id, [$data = array()], [$options = array()]) [line 1478] Function Parameters:
$options
void function Cezpdf::ezColumnsStop() [line 195] void function Cezpdf::ezGetCurrentPageNumber() [line 284] void function Cezpdf::ezImage($image, [$pad = 5], [$width = 0], [$resize = 'full'], [$just = 'center'], [$border = '']) [line 1319] Function Parameters:
void function Cezpdf::ezInsertMode([$status = 1], [$pageNum = 1], [$pos = 'before']) [line 205] Function Parameters:
void function Cezpdf::ezNewPage() [line 222] void function Cezpdf::ezOutput([$options = 0]) [line 479] Function Parameters:
$options
$text
void function Cezpdf::ezPRVTaddPageNumbers() [line 395] void function Cezpdf::ezPRVTcleanUp() [line 466] void function Cezpdf::ezPrvtGetTextWidth($size, $text) [line 609] Function Parameters:
$size $text
$lbl &$tmp
void function Cezpdf::ezPrvtTableColumnHeadings($cols, $pos, $maxWidth, $height, $decender, $gap, $size, &$y, [$optionsAll = array()]) [line 544] Function Parameters:
void function Cezpdf::ezPrvtTableDrawLines($pos, $gap, $x0, $x1, $y0, $y1, $y2, $col, $inner, $outer, [$opt = 1]) [line 515] Function Parameters:
$pos $gap $x0 $x1 $y0 $y1 $y2 $col $inner $outer $opt
void function Cezpdf::ezSetCmMargins($top, $bottom, $left, $right) [line 152] Function Parameters:
$dy $mod
void function Cezpdf::ezSetMargins($top, $bottom, $left, $right) [line 264] Function Parameters:
$y
void function Cezpdf::ezStartPageNumbers($x, $y, $size, [$pos = 'left'], [$pattern = '{PAGENUM} of {TOTALPAGENUM}'], [$num = '']) [line 291] Function Parameters:
void function Cezpdf::ezStopPageNumbers([$stopTotal = 0], [$next = 0], [$i = 0]) [line 349] Function Parameters:
$stopTotal $next $i
$options
void function Cezpdf::ezTable(&$data, [$cols = ''], [$title = ''], [$options = '']) [line 625] Function Parameters:
void function Cezpdf::ezText($text, [$size = 0], [$options = array()], [$test = 0]) [line 1223] Function Parameters:
$test
$pageNum $i
$info
$templateFile
$info
Class Cpdf
[line 26]
Cpdf A PHP class to provide the basic functionality to create a pdf document without any requirement for additional modules. Note that they companion class CezPdf can be used to extend this class and dramatically simplify the creation of documents. IMPORTANT NOTE there is no warranty, implied or otherwise with this software.
LICENCE This code has been placed in the Public Domain for all to enjoy.
Package Cpdf Author Wayne Munro < [email protected]> Version 009 Link http://www.ros.co.nz/pdf
array contains infomation about how the loose objects are to be added to the document
Cpdf::$arc4 mixed = '' [line 159]
the objectId (number within the objects array) of the document catalog
Cpdf::$checkpoint mixed = '' [line 194]
store the stack for the transaction commands, each item in here is a record of the values of all the variables within the class, so that the user can rollback at will (from each 'start' command) note that this includes the objects array, so these can be large.
Cpdf::$currentBaseFont mixed = '' [line 52]
current colour for fill operations, defaults to inactive value, all three components should be between 0 and 1 inclusive when active
Cpdf::$currentContents mixed = [line 68]
store label->id pairs for named destinations, these will be used to replace internal links done this way so that destinations can be defined after the location that links to them
the ancryption key for the encryption of all the document content (structure is not encrypted)
Cpdf::$fileIdentifier mixed = '' [line 167]
store the information about the relationship between font families this used so that the code knows which font is the bold version of another font, etc. the value of this array is initialised in the constuctor function.
array carrying information about the fonts that the system currently knows about used to ensure that a font is not loaded twice, among other things
the objectId of the information object for the document this contains authorship, title etc.
Cpdf::$looseObjects mixed = array() [line 110]
an array which contains information about the objects which are not firmly attached to pages these have been added with the addObject function
messages are stored here during processing, these can be selected afterwards to give some useful debug information
Cpdf::$nCallback mixed = 0 [line 183]
this array contains all of the pdf objects, ready for final assembly
Cpdf::$options
an array containing options about the document it defaults to turning on the compression of the objects
an array which is used to save the state of the document, mainly the colours and styles it is used to temporarily change to another state, the change back to what it was before
used to track the last used value of the inter-word spacing, this is so that it is known when the spacing is changed.
Constructor void function Cpdf::Cpdf([$pageSize = array(0,0,612,792)]) [line 200] Function Parameters:
$pageSize
Var array of 4 numbers, defining the bottom left and upper right corner of the page. first two are normally zero.
void function Cpdf::addDestination($label, $style, [$a = 0], [$b = 0], [$c = 0]) [line 2972] Function Parameters:
$label $style $a $b $c
&$img $x $y $w $h $quality
add an image into the document, from a GD object this function is not all that reliable, and I would probably encourage people to use the file based functions
$label $value
void function Cpdf::addInternalLink($label, $x0, $y0, $x1, $y1) [line 1176] Function Parameters:
add a link in the document to an internal destination (ie. within the document)
void function Cpdf::addJpegFromFile($img, $x, $y, [$w = 0], [$h = 0]) [line 2828] Function Parameters:
$img $x $y $w $h
$message
$id $options
after an object has been created, it wil only show if it has been added, using this function.
void function Cpdf::addPngFromFile($file, $x, $y, [$w = 0], [$h = 0]) [line 2640] Function Parameters:
$file $x $y $w $h
add a PNG image into the document, from a file this should work with remote files
void function Cpdf::addText($x, $y, $size, $text, [$angle = 0], [$wordSpaceAdjust = 0]) [line 2159] Function Parameters:
add text to the document, at a specified location, size and angle on the page
void function Cpdf::addTextWrap($x, $y, $width, $size, $text, [$justification = 'left'], [$angle = 0], [$test = 0]) [line 2334] Function Parameters:
add text to the page, but ensure that it fits within a certain width if it does not fit then put in as much as possible, splitting at word boundaries and return the remainder. justification and angle can also be specified for the text
$text
$key
close an object
void function Cpdf::curve($x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3) [line 1685] Function Parameters:
$x0 $y0 $r1 $r2 $angle $nSeg $astart $afinish $close $fill
draw an ellipse note that the part and filled ellipse are just special cases of this function draws an ellipse in the current line style centered at $x0,$y0, radii $r1,$r2 if $r2 is not set, then a circle is drawn nSeg is not allowed to be less than 2, as this will simply draw a line (and will even draw a pretty crappy shape at 2, as we are approximating with bezier curves.
$id
void function Cpdf::filledEllipse($x0, $y0, $r1, [$r2 = 0], [$angle = 0], [$nSeg = 8], [$astart = 0], [$afinish = 360]) [line 1702] Function Parameters:
a filled rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not the coordinates of the upper-right corner
function for the user to find out what the ID is of the first page that was created during startup - useful if they wish to add something to it later.
void function Cpdf::getFontDecender($size) [line 1946] Function Parameters:
$size
return the font decender, this will normally return a negative number if you add this number to the baseline, you get the level of the bottom of the font it is in the pdf user units
$size
return the height in units of the current font in the given size
void function Cpdf::getTextWidth($size, $text) [line 2251] Function Parameters:
$size $text
calculate how wide a given text string will be on a page, at a given size. this can be called externally, but is alse used by the other class functions
void function Cpdf::line($x1, $y1, $x2, $y2) [line 1678] Function Parameters:
$string
calculate the 16 byte version of the 128 bit md5 digest of the string
void function Cpdf::newPage([$insert = 0], [$id = 0], [$pos = 'after']) [line 1854]
Function Parameters:
add a new page to the document this also makes the new page the current active object
void function Cpdf::openHere($style, [$a = 0], [$b = 0], [$c = 0]) [line 2952] Function Parameters:
$style $a $b $c
make a loose object, the output will go into this object, until it is closed, then will revert to the current one. this object will not appear until it is included within a page. the function will return the object number
$debug
$id $action
$options
an annotation object, this will add an annotation to the current page. initially will support just link annotations
void function Cpdf::o_catalog($id, $action, [$options = '']) [line 300] Function Parameters:
define the document catalog, the overall controller for the document
void function Cpdf::o_contents($id, $action, [$options = '']) [line 893] Function Parameters:
the contents objects hold all of the content which appears on pages
void function Cpdf::o_destination($id, $action, [$options = '']) [line 227] Function Parameters:
$id
$action $options
destination object, used to specify the location for the user to jump to, presently on opening
void function Cpdf::o_encryption($id, $action, [$options = '']) [line 1018] Function Parameters:
encryption object.
void function Cpdf::o_font($id, $action, [$options = '']) [line 478] Function Parameters:
$id
$action $options
an image object, will be an XObject in the document, includes description and data
void function Cpdf::o_info($id, $action, [$options = '']) [line 685] Function Parameters:
$id $action
$options
the document procset, solves some problems with printing to old PS printers
void function Cpdf::o_viewerPreferences($id, $action, [$options = '']) [line 262] Function Parameters:
$p $np $f
draw a polygon, the syntax for this is similar to the GD polygon command
void function Cpdf::rectangle($x1, $y1, $width, $height) [line 1846] Function Parameters:
draw a rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not the coordinates of the upper-right corner
$id
Function Parameters:
$pageEnd
$pageEnd
this will be called at a new page to return the state to what it was on the end of the previous page, before the stack was closed down This is to get around not being able to have open 'q' across pages
void function Cpdf::selectFont($fontName, [$encoding = ''], [$set = 1]) [line 1420] Function Parameters:
if the font is not loaded then load it and make the required object else just make it the current font the encoding array can contain 'encoding'=> 'none','WinAnsiEncoding','MacRomanEncoding' or 'MacExpertEncoding' note that encoding='none' will need to be used for symbolic fonts and 'differences' => an array of mappings between numbers 0->255 and character names.
void function Cpdf::setColor($r, $g, $b, [$force = 0]) [line 1658] Function Parameters:
$r $g $b $force
set the encryption of the document can be used to turn it on and/or set the passwords which it will have. also the functions that the user will have are set here, such as print, modify, add
$family $options
define font families, this is used to initialize the font families for the default fonts and for the user to add new ones for their fonts. The default bahavious can be overridden should that be desired.
void function Cpdf::setLineStyle([$width = 1], [$cap = ''], [$join = ''], [$dash = ''], [$phase = 0]) [line 1792] Function Parameters:
this sets the line drawing style. width, is the thickness of the line in user units cap is the type of cap to put on the line, values can be 'butt','round','square' where the diffference between 'square' and 'butt' is that 'square' projects a flat end past the end of the line. join can be 'miter', 'round', 'bevel' dash is an array which sets the dash pattern, is a series of length values, which are the lengths of the on and off dashes. (2) represents 2 on, 2 off, 2 on , 2 off ... (2,1) is 2 on, 1 off, 2 on, 1 off.. etc phase is a modifier on the dash pattern which is
$label $value
set the viewer preferences of the document, it is up to the browser to obey these.
void function Cpdf::setStrokeColor($r, $g, $b, [$force = 0]) [line 1668] Function Parameters:
$r $g $b $force
$id
$options
output the pdf code, streaming it to the browser the relevant headers are set so that hopefully the browser will recognise it
$action
file_dialog.php
phpDocumentor :: docBuilder Web Interface Advanced Web Interface to phpDocumentor PHP versions 4 and 5 Copyright (c) 2003-2006 Andrew Eddie, Greg Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package HTML_TreeMenu Author Greg Beaver < [email protected]> Author Andrew Eddie Version CVS: $Id: file_dialog.php 231860 2007-03-14 12:48:37Z ashnazg $ Copyright 2003-2006 Andrew Eddie, Greg Beaver See phpdoc.php License LGPL Filesource Source Code for this file
Class DirNode
[line 130]
Directory Node
Package HTML_TreeMenu Author Richard Heyes < [email protected]> Author Harald Radi < [email protected]>
Class HTML_TreeMenu
[line 67]
HTML_TreeMenu Class A simple couple of PHP classes and some not so simple Jabbascript which produces a tree menu. In IE this menu is dynamic, with branches being collapsable. In IE5+ the status of the collapsed/open branches persists across page refreshes.In any other browser the tree is static. Code is based on work of Harald Radi. Usage. After installing the package, copy the example php script to your servers document root. Also place the TreeMenu.js and the images folder in the same place. Running the script should then produce the tree. Thanks go to Chip Chapin (http://www.chipchapin.com) for many improvements. excellent ideas and
Package HTML_TreeMenu Author Harald Radi < [email protected]> Author Richard Heyes < [email protected]> Access public
Constructor
Access public
object $node The node to add. This object should be object. &$node
a HTML_TreeNode
Access public
Class HTML_TreeMenu_DHTML
[line 329]
HTML_TreeMenu_DHTML class This class is a presentation class for the tree structure created using the TreeMenu/TreeNode. It presents the traditional tree, static for browsers that can't handle the DHTML.
Package HTML_TreeMenu
Dynamic status of the treemenu. If true (default) this has no effect. If false it will override all dynamic status vars and set the menu to be fully expanded an nondynamic.
HTML_TreeMenu_DHTML::$linkTarget string = [line 348]
object $structure The menu structure array $options Array of options bool $isDynamic Whether the tree is dynamic or not &$structure
Constructor, takes the tree structure as an argument and an array of options which can consist of: images - The path to the images folder. Defaults to "images" linkTarget - The target for the link. Defaults to "_self" defaultClass - The default CSS class to apply to a node. Default is none. usePersistence - Whether to use clientside persistence. This persistence is achieved using cookies. Default is true. noTopLevelImages - Whether to skip displaying the first level of images if there is multiple top level branches.
And also a boolean for whether the entire tree is dynamic or not. This overrides any perNode dynamic settings.
Returns the HTML for the menu. This method can be used instead of printMenu() to use the menu system with a template system.
Access public
Class HTML_TreeMenu_Listbox
[line 493]
Package HTML_TreeMenu
object $structure The menu structure array $options Options whic affect the display of the listbox. consist of: promoText The text that appears at the the top of the listbox Defaults to "Select..." indentChar The character to use for indenting the nodes Defaults to " " indentNum How many of the indentChars to use per indentation level Defaults to 2 linkTarget Target for the links. Defaults to "_self" submitText Text for the submit button. Defaults to "Go"
These can
Constructor
void function HTML_TreeMenu_Listbox::toHTML() [line 552]
Class HTML_TreeMenu_Presentation
[line 282]
HTML_TreeMenu_Presentation class Base class for other presentation classes to inherit from.
Package HTML_TreeMenu
Prints the HTML generated by the toHTML() method. toHTML() must therefore be defined by the derived class.
Access public
Class HTML_TreeNode
[line 113]
HTML_TreeNode class This class is supplementary to the above and provides a way to add nodes to the tree. A node can have other nodes added to it.
Package HTML_TreeMenu Author Harald Radi < [email protected]> Author Richard Heyes < [email protected]> Access public
array $options An array of options which you can pass to change the way this node looks/acts. This can consist of: text The title of the node, defaults to blank link The link for the node, defaults to blank icon The icon for the node, defaults to blank class The CSS class for this node, defaults to blank expanded The default expanded status of this node, defaults to false This doesn't affect non dynamic presentation types isDynamic If this node is dynamic or not. Only affects certain presentation types. ensureVisible If true this node will be made visible despite the expanded settings, and client side persistence. Will not affect
some presentation styles, such as Listbox. Default is false array $events An array of javascript events and the corresponding event handlers. Additionally to the standard javascript events you can specify handlers for the 'onexpand', 'oncollapse' and 'ontoggle' events which will be fired whenever a node is collapsed and/or expanded.
Constructor
Access public
Access public
string $option Option to set string $value Value to set the option to
Allows setting of various parameters after the initial constructor call. Possible options you can set are: text link icon
Access public
bug-904820.php
This is a test of a package with a . in its name
Package org-phpdoc
I'm an element
Config_File.class.php
Config_File class. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA You may contact the author of Config_File by e-mail at: [email protected] The latest version of Config_File can be obtained from: http://smarty.php.net/
Package Smarty Author Andrei Zmievski < [email protected]> Version 2.6.0 Copyright Copyright: 2001-2003 ispi of Lincoln, Inc. Link http://smarty.php.net/ Access public
Smarty.class.php
Project: Smarty: the PHP compiling template engine File: Smarty.class.php This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For questions, help, comments, discussion, etc., please join the Smarty mailing list. Send a blank e-mail to [email protected] You may contact the authors of Smarty by e-mail at: [email protected] [email protected] Or, write to: Monte Ohrt Director of Technology, ispi 237 S. 70th suite 220 Lincoln, NE 68510 The latest version of Smarty can be obtained from: http://smarty.php.net/
Package Smarty Author Monte Ohrt < [email protected]> Author Andrei Zmievski < [email protected]> Version 2.6.0 Copyright 2001-2003 ispi of Lincoln, Inc. Link http://smarty.php.net/
set SMARTY_DIR to absolute path to Smarty library files. if not defined, include_path will be used. Sets SMARTY_DIR only if user application has not already defined it.
SMARTY_PHP_ALLOW = 3 [line 68] SMARTY_PHP_PASSTHRU = 0 [line 65] SMARTY_PHP_QUOTE = 1 [line 66] SMARTY_PHP_REMOVE = 2 [line 67]
Smarty_Compiler.class.php
Project: Smarty: the PHP compiling template engine File: Smarty_Compiler.class.php This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA You may contact the authors of Smarty by e-mail at: [email protected] [email protected] Or, write to: Monte Ohrt Director of Technology, ispi 237 S. 70th suite 220 Lincoln, NE 68510 The latest version of Smarty can be obtained from: http://smarty.php.net/
Package Smarty Author Andrei Zmievski < [email protected]> Author Monte Ohrt < [email protected]> Version 2.6.0 Copyright 2001-2003 ispi of Lincoln, Inc. Link http://smarty.php.net/
Class Config_File
[line 39]
Package Smarty
Controls whether config values of on/true/yes and off/false/no get converted to boolean values automatically. Options
Controls whether or not to fix mac or dos formatted newlines. Options If set to true, \r or \r\n will be changed to \n.
Controls whether variables with the same name overwrite each other.
Options
Controls whether hidden config sections/vars are read from the file. Options
Config_File::$_config_data mixed = array() [line 69] Constructor void function Config_File::Config_File([$config_path = NULL]) [line 77] Function Parameters:
string $file_name config file to get info for string $section_name (optional) section to get info for string $var_name (optional) variable to get info for
Retrieves config info based on the file, section, and variable name.
string $file_name config file to get info for string $section_name (optional) section to get info for $section
string $file_name file name to load boolean $prepend_path whether current config path should be prepended to the filename
Class Smarty
[line 73]
Package Smarty
This indicates which filters are automatically loaded into Smarty. Smarty Configuration Section
The name of the directory for cache files. Smarty Configuration Section
The function used for cache file handling. If not set, built-in caching is used. Smarty Configuration Section
This is the number of seconds cached content will persist. Smarty Configuration Section 0 = always regenerate cache -1 = never expires
Only used when $caching is enabled. If true, then If-Modified-Since headers are respected with cached content, and appropriate HTTP headers are sent. Smarty Configuration Section This way repeated hits to a cached page do not send the entire page to the client every time.
This enables template caching. Smarty Configuration Section 0 = no caching 1 = use class cache_lifetime value 2 = use cache_lifetime in cache file
The file that contains the compiler class. This can a full pathname, or relative to the php_include path.
Smarty::$compile_check boolean = true [line 143]
This tells Smarty whether to check for recompiling or not. Recompiling does not need to happen unless a template or config file is changed. Smarty Configuration Section Typically you enable this during development, and disable for production.
The directory where compiled templates are located. Smarty Configuration Section
Set this if you want different sets of compiled files for the same templates. This is useful for things like different languages. Smarty Configuration Section Instead of creating separate sets of templates per language, you set different compile_ids like 'en' and 'de'.
This tells whether or not to automatically booleanize config file variables. If enabled, then the strings "on", "true", and "yes" are treated as boolean true, and "off", "false" and "no" are treated as boolean false.
The directory where config files are located. Smarty Configuration Section
This tells whether or not automatically fix newlines in config files. It basically converts \r (mac) or \r\n (dos) to \n
This tells if config file vars of the same name overwrite each other or not. if disabled, same name variables are accumulated in an array.
This tells whether hidden sections [.foobar] are readable from the tempalates or
not. Normally you would never allow this since that is the point behind hidden sections: the application can access them, but the templates cannot.
Smarty::$debugging boolean = false [line 114]
If debugging is enabled, a debug console window will display when the page loads (make sure your browser allows unrequested popup windows) Smarty Configuration Section
This determines if debugging is enable-able from the browser. Smarty Configuration Section NONE => no debugging control allowed URL => enable debugging when SMARTY_DEBUG is found in the URL.
Link http://www.foo.dom/index.php?SMARTY_DEBUG
This is the path to the debug console template. If not set, the default one will be used. Smarty Configuration Section
This is a list of the modifiers to apply to all template variables. Smarty Configuration Section Put each modifier in a separate array element in the order you want them applied. example:
1 array('escape:"htmlall"' );
This is the resource type to be used when not specified Smarty Configuration Section at the beginning of the resource path. examples: $smarty->display('file:index.tpl'); $smarty->display('db:index.tpl'); $smarty>display('index.tpl'); // will use default resource type {include file="file:index.tpl"} {include file="db:index.tpl"} {include file="index.tpl"} {* will use default resource type *}
If a template cannot be found, this PHP function will be executed. Useful for creating templates on-the-fly or other special action.
This forces templates to compile every time. Useful for development or debugging. Smarty Configuration Section
These are the variables from the globals array that are assigned to all templates automatically. This isn't really necessary any more, you can use the $smarty var to access them directly. Smarty Configuration Section
Usedby Smarty::Smarty() - uses assign() to assign each corresponding value from $GLOBALS to the template vars
The left delimiter used for the template tags. Smarty Configuration Section
This determines how Smarty handles "<?php ... ?>" tags in templates. Smarty Configuration Section possible values: SMARTY_PHP_PASSTHRU -> print tags as plain text SMARTY_PHP_QUOTE -> escape tags as entities SMARTY_PHP_REMOVE -> remove php tags SMARTY_PHP_ALLOW -> execute php tags
Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false) Smarty Configuration Section are uses as request-vars or $_*[]-vars. note: if request_use_auto_globals is true, then $request_vars_order has no effect, but the phpini-value "gpc_order"
Smarty::$request_vars_order
The order in which request variables are registered, similar to variables_order in php.ini E = Environment, G = GET, P = POST, C = Cookies, S = Server Smarty Configuration Section
The right delimiter used for the template tags. Smarty Configuration Section
This is the list of template directories that are considered secure. This is used only if $security is enabled. One directory per array element. $template_dir is in this list implicitly. Smarty Configuration Section
This enables template security. When enabled, many things are restricted Smarty Configuration Section in the templates that normally would go unchecked. This is useful when untrusted parties are editing templates and you want a reasonable level of security. (no direct execution of PHP in templates for example)
Smarty::$security_settings array = array( 'PHP_HANDLING' => false, 'IF_FUNCS' => array('array', 'list', 'isset', 'empty', 'count', 'sizeof', 'in_array', 'is_array', 'true','false'),'INCLUDE_ANY'=>false,'PHP_TAGS'=>false,'MODIFIER_FUNCS'=>array('count'),'ALLOW _CONSTANTS'=>false) [line 231]
These are the security settings for Smarty. They are used only when $securityis
The name of the directory where templates are located. Smarty Configuration Section
This is an array of directories where trusted php scripts reside. Smarty Configuration Section $security is disabled during their inclusion/execution.
This tells Smarty whether or not to use sub dirs in the cache/ and templates_c/ directories. sub directories better organized, but may not work well with PHP safe mode enabled. Smarty Configuration Section
Uses Smarty::$global_assign - uses assign() to assign each corresponding value from $GLOBALS to the template vars
void function Smarty::append($tpl_var, [$value = null], [$merge = false]) [line 657] Function Parameters:
array|string $tpl_var the template variable name(s) mixed $value the value to append $merge
string $tpl_var the template variable name mixed $value the referenced value to append &$value $merge
array|string $tpl_var the template variable name(s) mixed $value the value to assign
string $tpl_var the template variable name mixed $value the referenced value to assign &$value
string $tpl_file name of template file string $cache_id name of cache_id string $compile_id name of compile_id string $exp_time expiration time
files if one is not specified. This function is for advanced use only, not normally needed.
string $var
string $name
Function Parameters:
string $block name of template block string $block_impl PHP function to register $cacheable $cache_attrs
string $function name of template function string $function_impl name of PHP function to register $cacheable
string $function the name of the template function string $function_impl the name of the PHP function to register $cacheable $cache_attrs
string $modifier name of template modifier string $modifier_impl name of PHP function to register
string $object name of template object object &$object_impl the referenced PHP object to register null|array $allowed list of allowed methods (empty = all) boolean $smarty_args smarty argument format, else traditional null|array $block_functs list of methods that are block format $block_methods
string $type name of resource array $functions array of functions to handle resource
string $tpl_file
Unregisters modifier
void function Smarty::unregister_object($object) [line 774] Function Parameters:
Unregisters object
void function Smarty::unregister_outputfilter($function) [line 946] Function Parameters:
Unregisters a resource
boolean function Smarty::_compile_resource($resource_name, $compile_path) [line 1446] Function Parameters:
string $string
$code $params
string $resource_name string $source_content integer $resource_timestamp boolean $get_source boolean $quiet &$params
fetch the template info. Gets timestamp, and source if get_source is true sets $source_content to the source of the template, and $resource_timestamp to its time stamp
string function Smarty::_get_auto_filename($auto_base, [$auto_source = null], [$auto_id = null]) [line 1796] Function Parameters:
string|null function Smarty::_get_auto_id([$cache_id = null], [$compile_id = null]) [line 1854] Function Parameters:
string $resource_name
$match
string function Smarty::_read_file($filename, [$start = null], [$lines = null]) [line 1751] Function Parameters:
read in a file from line $start for $lines. read the entire file if $start and $lines are null.
Handle modifiers
array function Smarty::_smarty_cache_attrs($cache_serial, $count) [line 1963] Function Parameters:
$cache_serial $count
get or set an array of cached attributes for function that is not cacheable
void function Smarty::_trigger_fatal_error($error_msg, [$tpl_file = null], [$tpl_line = null], [$file = null], [$line = null], [$error_type = E_USER_ERROR]) [line 1873] Function Parameters:
string $error_msg string $tpl_file integer $tpl_line string $file integer $line integer $error_type
Class Smarty_Compiler
[line 48]
Package Smarty
void function Smarty_Compiler::_add_plugin($type, $name, [$delayed_loading = null]) [line 1856] Function Parameters:
add plugin
void function Smarty_Compiler::_compile_arg_list($type, $name, $attrs, &$cache_code) [line 1306] Function Parameters:
boolean function Smarty_Compiler::_compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output, $output) [line 621] Function Parameters:
compile block function tag sets $output to compiled block function tag
boolean function Smarty_Compiler::_compile_compiler_tag($tag_command, $tag_args, &$output, $output) [line 552] Function Parameters:
compile the custom compiler tag sets $output to the compiled custom compiler tag
string $tag_args
string $tag_args
string $tag_args
string $tag_args
compiles call to plugin of type $type with name $name returns a string containing the function-name or method call without the paramter-list that would have follow to make the call valid php-syntax
string $tag_args
string $template_tag
string $var_expr
string $tag_args
string $conf_var_expr
Parse is expression
void function Smarty_Compiler::_parse_modifiers(&$output, $modifier_string, $output) [line 1787] Function Parameters:
parse modifier chain into PHP code sets $output to parsed modified chain
string $parenth_args
string $section_prop_expr
compile multiple variables and section properties tokens into PHP code
string function Smarty_Compiler::_parse_var_props($val, $tag_attrs) [line 1506] Function Parameters:
compile single variable and section properties token into PHP code
string function Smarty_Compiler::_pop_cacheable_state($type, $name) [line 2090] Function Parameters:
$type $name
check if the compilation changes from non-cacheable to cacheable state with the end of the current plugin return php-code to reflect the transition.
string function Smarty_Compiler::_push_cacheable_state($type, $name) [line 2072] Function Parameters:
$type $name
check if the compilation changes from cacheable to non-cacheable state with the beginning of the current plugin. return php-code to reflect the transition.
string function Smarty_Compiler::_quote_replace($string) [line 2041] Function Parameters:
string $string
core.assemble_plugin_filepath.php
Smarty plugin
string|false function smarty_core_assemble_plugin_filepath($params, &$smarty, $type, $name) [line 15] Function Parameters:
core.assign_smarty_interface.php
Smarty plugin
Smarty assign_smarty_interface core plugin Type: core Name: assign_smarty_interface Purpose: assign the $smarty interface variable
core.create_dir_structure.php
Smarty plugin
core.display_debug_console.php
Smarty plugin
Smarty debug_console function plugin Type: core Name: display_debug_console Purpose: display the javascript debug console window
core.get_include_path.php
Smarty plugin
boolean function smarty_core_get_include_path(&$params, &$smarty, $file_path, $new_file_path) [line 19] Function Parameters:
core.get_microtime.php
Smarty plugin
$params &$smarty
core.get_php_resource.php
Smarty plugin
boolean function smarty_core_get_php_resource(&$params, &$smarty, $resource, $resource_type, 2) [line 18] Function Parameters:
core.is_secure.php
Smarty plugin
boolean function smarty_core_is_secure($params, &$smarty, $resource_type, $resource_name) [line 18] Function Parameters:
core.is_trusted.php
Smarty plugin
boolean function smarty_core_is_trusted($params, &$smarty, $resource_type, $resource_name) [line 21] Function Parameters:
core.load_plugins.php
Smarty plugin
core.load_resource_plugin.php
Smarty plugin
core.process_cached_inserts.php
Smarty plugin
core.process_compiled_include.php
Smarty plugin
string function smarty_core_process_compiled_include($params, &$smarty, $compiled_tpl, $cached_source) [line 17] Function Parameters:
core.read_cache_file.php
Smarty plugin
boolean function smarty_core_read_cache_file(&$params, &$smarty, $tpl_file, $cache_id, $compile_id, $results) [line 21] Function Parameters:
string $tpl_file string $cache_id string $compile_id string $results &$params &$smarty
core.rmdir.php
Smarty plugin
boolean function smarty_core_rmdir($params, &$smarty, $dirname, $level, $exp_time) [line 20] Function Parameters:
delete a dir recursively (level=0 -> keep root) WARNING: no tests, it will try to remove what you tell it!
core.rm_auto.php
Smarty plugin
boolean function smarty_core_rm_auto($params, &$smarty, $auto_base, $auto_source, $auto_id, $exp_time) [line 20] Function Parameters:
string $auto_base string $auto_source string $auto_id integer $exp_time $params &$smarty
core.run_insert_handler.php
Smarty plugin
core.smarty_include_php.php
Smarty plugin
void function smarty_core_smarty_include_php($params, &$smarty, $smarty_file, $smarty_assign, $smarty_once, $smarty_include_vars) [line 21] Function Parameters:
string $smarty_file string $smarty_assign variable to assign the included template's boolean $smarty_once uses include_once if this is true array $smarty_include_vars associative array of vars from file="blah" var=$var} $params &$smarty
core.write_cache_file.php
Smarty plugin
true|null function smarty_core_write_cache_file($params, &$smarty, $tpl_file, $cache_id, $compile_id, $results) [line 21] Function Parameters:
string $tpl_file string $cache_id string $compile_id string $results $params &$smarty
core.write_compiled_include.php
Smarty plugin
boolean function smarty_core_write_compiled_include($params, &$smarty, $compile_path, $template_compiled, $template_timestamp) [line 17] Function Parameters:
core.write_compiled_resource.php
Smarty plugin
true function smarty_core_write_compiled_resource($params, &$smarty, $compile_path, $compiled_content, $resource_timestamp) [line 16] Function Parameters:
core.write_file.php
Smarty plugin
boolean function smarty_core_write_file($params, &$smarty, $filename, $contents, $create_dirs) [line 16] Function Parameters:
block.strip.php
Smarty plugin
array $params unused, no parameters for this block string $content content of {strip}{/strip} tags Smarty &$this clever method emulation
Smarty {strip}{/strip} block plugin Type: block function Name: strip Purpose: strip unwanted white space from text
block.textformat.php
Smarty plugin
array $params Params: style: string (email) indent: integer (0) wrap: integer (80) wrap_char string ("\n") indent_char: string (" ") wrap_boundary: boolean (true) string $content contents of the block Smarty &$smarty clever simulation of a method
Smarty {textformat}{/textformat} block plugin Type: block function Name: textformat Purpose: format text a certain way with preset styles settings
or custom wrap/indent
function.assign.php
Smarty plugin
array $params Format: array('var' => variable name, 'value' => value to assign) Smarty &$smarty
Smarty {assign} function plugin Type: function Name: assign Purpose: assign a value to a template variable
function.assign_debug_info.php
Smarty plugin
array $params unused in this plugin, this plugin uses Smarty::$_config, Smarty::$_tpl_vars and Smarty::$_smarty_debug_info Smarty &$smarty
Smarty {assign_debug_info} function plugin Type: function Name: assign_debug_info Purpose: assign debug info to the template
function.config_load.php
Smarty plugin
array $params Format: array('file' => required config file name, 'section' => optional config file section to load 'scope' => local/parent/global 'global' => overrides scope, setting to parent if true) Smarty &$smarty
Smarty {config_load} function plugin Type: function Name: config_load Purpose: load config file vars
function.counter.php
Smarty plugin
Smarty {counter} function plugin Type: function Name: counter Purpose: print out a counter value
function.cycle.php
Smarty plugin
Smarty {cycle} function plugin Type: function Name: cycle Date: May 3, 2002 Purpose: cycle through given values Input: name = name of cycle (optional) values = comma separated list of values to cycle, or an array of values to cycle (this can be left out for subsequent calls) reset = boolean - resets given var to true print = boolean - print var or not. default is true advance = boolean - whether or not to advance the cycle delimiter = the value delimiter, default is "," assign = boolean, assigns to template var instead of printed. Examples: {cycle values="#eeeeee,#d0d0d0d"} {cycle name=row values="one,two,three" reset=true} {cycle name=row}
Author Monte Ohrt < [email protected]> Author credit to Mark Priatel < [email protected]> Author credit to Gerard < [email protected]>
Author credit to Jason Sweat < [email protected]> Version 1.3 Link {cycle} (Smarty online manual)
function.debug.php
Smarty plugin
Smarty {debug} function plugin Type: function Name: debug Date: July 1, 2002 Purpose: popup debug window
Author Monte Ohrt < [email protected]> Version 1.0 Link {debug} (Smarty online manual)
function.eval.php
Smarty plugin
Smarty {eval} function plugin Type: function Name: eval Purpose: evaluate a template variable as a template
function.fetch.php
Smarty plugin
Smarty {fetch} plugin Type: function Name: fetch Purpose: fetch file, web or ftp data and display results
function.html_checkboxes.php
Smarty plugin
Smarty {html_checkboxes} function plugin File: function.html_checkboxes.php Type: function Name: html_checkboxes Date: 24.Feb.2003 Purpose: Prints out a list of checkbox input types Input: name (optional) - string default "checkbox" values (required) - array options (optional) - associative array checked (optional) - array default not set separator (optional) - ie or output (optional) - without this one the buttons don't have names Examples: {html_checkboxes values=$ids output=$names} {html_checkboxes values=$ids name='box' separator='<br>' output=$names} {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}
Author credits to Monte Ohrt < [email protected]> Author Christopher Kvarme < [email protected]> Version 1.0 Link {html_checkboxes} (Smarty online manual)
Uses smarty_function_escape_special_chars()
void function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) [line 118] Function Parameters:
function.html_image.php
Smarty plugin
Smarty {html_image} function plugin Type: function Name: html_image Date: Feb 24, 2003 Purpose: format HTML tags for the image Input: file = file (and path) of image (required) border = border width (optional, default 0) height = image height (optional, default actual height) image =image width (optional, default actual width) basedir = base directory for absolute paths, default is environment variable DOCUMENT_ROOT Examples: {html_image file="images/masthead.gif"} Output: src="images/masthead.gif" border=0 width=400 height=23>
<img
Author credits to Duda < [email protected]> - wrote first image function helped with lots of functionality Author Monte Ohrt < [email protected]> Version 1.0 Link {html_image} (Smarty online manual) Uses smarty_function_escape_special_chars()
in repository,
function.html_options.php
Smarty plugin
Smarty {html_options} function plugin Type: function Name: html_options Input: name (optional) - string default "select" values (required if no options supplied) - array options (required if no values supplied) - associative array selected (optional) - string default not set output (required if not options supplied) - array Purpose: Prints the list of <option> tags generated from parameters
the passed
$key
$values $selected
function.html_radios.php
Smarty plugin
Smarty {html_radios} function plugin File: function.html_radios.php Type: function Name: html_radios Date: 24.Feb.2003 Purpose: Prints out a list of radio input types Input: name (optional) - string default "radio" values (required) - array options (optional) - associative array checked (optional) - array default not set separator (optional) - ie or output (optional) - without this one the buttons don't have names Examples: {html_radios values=$ids output=$names} {html_radios values=$ids name='box' separator='<br>' output=$names} {html_radios values=$ids checked=$checked separator='<br>' output=$names}
Author credits to Monte Ohrt < [email protected]> Author Christopher Kvarme < [email protected]> Version 1.0 Link {html_radios} (Smarty online manual)
Uses smarty_function_escape_special_chars()
void function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels) [line 121] Function Parameters:
function.html_select_date.php
Smarty plugin
Smarty {html_select_date} plugin Type: function Name: html_select_date Purpose: Prints the dropdowns for date selection. ChangeLog: 1.0 initial release 1.1 added support for +/- N syntax for begin and end year values. (Monte) 1.2 added support for yyyy-mm-dd syntax for time value. (Jan Rosier) 1.3 added support for choosing format for month values (Gary Loescher) 1.3.1 added support for choosing format for day values (Marcus Bointon)
Author Andrei Zmievski Version 1.3 Link {html_select_date} (Smarty online manual)
function.html_select_time.php
Smarty plugin
Smarty {html_select_time} function plugin Type: function Name: html_select_time Purpose: Prints the dropdowns for time selection
function.html_table.php
Smarty plugin
Smarty {html_table} function plugin Type: function Name: html_table Date: Feb 17, 2003 Purpose: make an html table from an array of data Input: loop = array to loop through cols = number of columns rows = number of rows table_attr = table attributes tr_attr = table row attributes (arrays are cycled) td_attr = table cell attributes (arrays are cycled) trailpad = value to pad trailing cells with vdir = vertical direction (default: "down", means top-to-bottom) hdir = horizontal direction (default: "right", means left-to-right) inner = inner loop (default "cols": print $loop line by line, $loop will be printed column by column otherwise)
Examples: {table loop=$data} {table loop=$data cols=4 tr_attr='"bgcolor=red"'} {table loop=$data cols=4 tr_attr=$colors}
Author Monte Ohrt < [email protected]> Version 1.0 Link {html_table} (Smarty online manual)
function.mailto.php
Smarty plugin
Smarty {mailto} function plugin Type: function Name: mailto Date: May 21, 2002 Purpose: automate mailto address link creation, and optionally encode them. Input: address = e-mail address text = (optional) text to display, default is address encode = (optional) can be one of: * none : no encoding (default) * javascript : encode with javascript * hex : encode with hexidecimal (no javascript) cc = (optional) address(es) to carbon copy bcc = (optional) address(es) to blind carbon copy subject = (optional) e-mail subject newsgroups = (optional) newsgroup(s) to post to followupto = (optional) address(es) to follow up to extra = (optional) extra tags for the href link Examples: {mailto address="[email protected]"} {mailto address="[email protected]" encode="javascript"} {mailto address="[email protected]" encode="hex"} {mailto address="[email protected]" subject="Hello to you!"} {mailto address="[email protected]" cc="[email protected],[email protected]"} {mailto address="[email protected]" extra='class="mailto"'}
Author Monte Ohrt < [email protected]> Author credits to Jason Sweat (added cc, bcc and subject functionality) Version 1.2 Link {mailto} (Smarty online manual)
function.math.php
Smarty plugin
Smarty {math} function plugin Type: function Name: math Purpose: handle math computations in template
function.popup.php
Smarty plugin
Smarty {popup} function plugin Type: function Name: popup Purpose: make text pop up in windows via overlib
function.popup_init.php
Smarty plugin
Smarty {popup_init} function plugin Type: function Name: popup_init Purpose: initialize overlib
function.var_dump.php
Package Smarty Sub-Package plugins
$params &$smarty
Smarty plugin ------------------------------------------------------------- Type: function Name: assign Purpose: assign a value to a template variable ------------------------------------------------------------
modifier.capitalize.php
Smarty plugin
string $string
Smarty capitalize modifier plugin Type: modifier Name: capitalize Purpose: capitalize words in the string
modifier.cat.php
Smarty plugin
Smarty cat modifier plugin Type: modifier Name: cat Date: Feb 24, 2003 Purpose: catenate a value to a variable Input: catenate Example: {$var|cat:"foo"}
string to
Author Monte Ohrt < [email protected]> Version 1.0 Link cat (Smarty online manual)
modifier.count_characters.php
Smarty plugin
Smarty count_characters modifier plugin Type: modifier Name: count_characteres Purpose: count the number of characters in a text
modifier.count_paragraphs.php
Smarty plugin
string $string
Smarty count_paragraphs modifier plugin Type: modifier Name: count_paragraphs Purpose: count the number of paragraphs in a text
modifier.count_sentences.php
Smarty plugin
string $string
Smarty count_sentences modifier plugin Type: modifier Name: count_sentences Purpose: count the number of sentences in a text
modifier.count_words.php
Smarty plugin
string $string
Smarty count_words modifier plugin Type: modifier Name: count_words Purpose: count the number of words in a text
modifier.date_format.php
Smarty plugin
Smarty date_format modifier plugin Type: modifier Name: date_format Purpose: format datestamps via strftime Input: string: input date string format: strftime format for output default_date: default date if $string is empty
modifier.debug_print_var.php
Smarty plugin
string function smarty_modifier_debug_print_var($var, [$depth = 0], [$length = 40]) [line 22] Function Parameters:
Smarty debug_print_var modifier plugin Type: modifier Name: debug_print_var Purpose: formats variable contents for display in the console
modifier.default.php
Smarty plugin
Smarty default modifier plugin Type: modifier Name: default Purpose: designate default value for empty variables
modifier.escape.php
Smarty plugin
Smarty escape modifier plugin Type: modifier Name: escape Purpose: Escape the string according to escapement type
modifier.htmlentities.php
Package Smarty Sub-Package plugins
$string
Smarty plugin ------------------------------------------------------------- Type: modifier Name: upper Purpose: convert string to uppercase -------------------------------------------------------------
modifier.indent.php
Smarty plugin
string function smarty_modifier_indent($string, [$chars = 4], [$char = " "]) [line 22] Function Parameters:
Smarty indent modifier plugin Type: modifier Name: indent Purpose: indent lines of text
modifier.lower.php
Smarty plugin
string $string
Smarty lower modifier plugin Type: modifier Name: lower Purpose: convert string to lowercase
modifier.nl2br.php
Smarty plugin
string $string
Smarty plugin Type: modifier Name: nl2br Date: Feb 26, 2003 Purpose: convert \r\n, \r or \n to <br> Input: contents = contents to replace preceed_test = if true, includes preceeding break tags in replacement Example: {$text|nl2br}
Author Monte Ohrt < [email protected]> Version 1.0 Link nl2br (Smarty online manual)
modifier.rawurlencode.php
Package Smarty Sub-Package plugins
$string
Smarty plugin ------------------------------------------------------------- Type: modifier Name: rawurlencode Purpose: encode string for use in PDFdefaultConverter TOC ------------------------------------------------------------
modifier.regex_replace.php
Smarty plugin
Smarty regex_replace modifier plugin Type: modifier Name: regex_replace Purpose: regular epxression search/replace
modifier.replace.php
Smarty plugin
Smarty replace modifier plugin Type: modifier Name: replace Purpose: simple search/replace
modifier.spacify.php
Smarty plugin
string function smarty_modifier_spacify($string, [$spacify_char = ' ']) [line 21] Function Parameters:
Smarty spacify modifier plugin Type: modifier Name: spacify Purpose: add spaces between characters in a string
modifier.string_format.php
Smarty plugin
Smarty string_format modifier plugin Type: modifier Name: string_format Purpose: format strings via sprintf
modifier.strip.php
Smarty plugin
string function smarty_modifier_strip($text, [$replace = ' ']) [line 26] Function Parameters:
Smarty strip modifier plugin Type: modifier Name: strip Purpose: Replace all repeated spaces, newlines, tabs with a single space or supplied replacement string. Example: {$var|strip} {$var|strip:" "} Date: September 25th, 2002
Author Monte Ohrt < [email protected]> Version 1.0 Link strip (Smarty online manual)
modifier.strip_tags.php
Smarty plugin
Smarty strip_tags modifier plugin Type: modifier Name: strip_tags Purpose: strip html tags from text
modifier.truncate.php
Smarty plugin
string function smarty_modifier_truncate($string, [$length = 80], [$etc = '...'], [$break_words = false]) [line 25] Function Parameters:
Smarty truncate modifier plugin Type: modifier Name: truncate Purpose: Truncate a string to a certain length if necessary, the middle of a word, and appending the $etc string.
optionally splitting in
modifier.upper.php
Smarty plugin
string $string
Smarty upper modifier plugin Type: modifier Name: upper Purpose: convert string to uppercase
modifier.wordwrap.php
Smarty plugin
string function smarty_modifier_wordwrap($string, [$length = 80], [$break = "\n"], [$cut = false]) [line 23] Function Parameters:
Smarty wordwrap modifier plugin Type: modifier Name: wordwrap Purpose: wrap a string of text at a given length
outputfilter.trimwhitespace.php
Smarty plugin
Smarty trimwhitespace outputfilter plugin File: outputfilter.trimwhitespace.php Type: outputfilter Name: trimwhitespace Date: Jan 25, 2003 Purpose: trim leading white space and blank lines from template source after it gets interpreted, cleaning up code and saving bandwidth. Does not affect <<PRE>></PRE> and <SCRIPT></SCRIPT> blocks. Install: Drop into the plugin directory, call
1 $smarty-> load_filter('output','trimwhitespace');
from application.
Author Contributions from Lars Noschinski < [email protected]> Author Monte Ohrt < [email protected]> Version 1.3
shared.escape_special_chars.php
Smarty shared plugin
string $string
escape_special_chars common function Function: smarty_function_escape_special_chars Purpose: used by other smarty functions to escape already escaped ones
shared.make_timestamp.php
Smarty shared plugin
string $string
Function: smarty_make_timestamp Purpose: used by other smarty functions to make a timestamp string.
from a
bug-441275.php
Package tests
void function test2_441275([$foo = array("item1","item2",'item3' => "item4",array("item5","item6"),'item7'=>array('item8','item9',"array('it em9','item10')"))], $foobar) [line 13] Function Parameters:
$foo $foobar
This tests some more advanced cases to make sure to handle them
void function test_441275([$foo = array()]) [line 6] Function Parameters:
$foo
bug-441278.php
Package tests
bug-441287.php
Package tests
Check to see if we are stripping whitespace before the * 1234567890 Test Test2
bug-441289.php
Package tests
This desc tries to fool the non period short desc systems junk should only show the first line since we dont' look that far down for the short desc line break
This desc tries to fool the non period short desc systems junk junk
This is a test case where i think things break extended desc many lines of desc many lines of desc many lines of desc many lines of desc many lines of desc many lines of desc many lines of desc many lines of desc more extended desc that ends with a period. without a line limiter everything til period. would be part of the short desc allowing this many lines to be part of the short desc seemed like a problem to me so now using both the period and line break as a seperator you can only have a 4 line extended desc. the first line is usually blank since its the /** line
This is a long comment which needs more than one line. This is the detailed documentation. This is another line of detailed docs
I started my short desc on the first line. This is the detailed documentation.
I am using a blank line to end my short desc I think this looks the nicest when writing your readable
This is a test to see if the desc is fooled by 2.4 the short desc ends here. This is the detailed documentation.
This example is really tricky The short desc should end on the blank line even though this line ends with a period. Here is the long desc
This example is also really tricky The tries to break the parser test. Here is the long desc
bug-441433.php
Package tests
$sendto
This is a Test
void function test_441433([$test = "Some stuff in a quote"]) [line 16] Function Parameters:
$test
a second test. Make sure that we are clearing out quote data after using it since how we set that values has changed
bug-443153.php
Package tests
test function
Author Joshua Eichorn < [email protected]> Author Test Person < [email protected]>
bug-445298.php
Package tests
test function
bug-445305.php
Package tests
bug-445820.php
Package tests
void function test_445820([$val = array("1","2",'3' => 4)], $string, $my_array) [line 5] Function Parameters:
test function
bug-540368.php
Package tests
bug-542586.php
Package tests
testie
bug-550489.php
Package tests
bug-551120.php
Package tests
include
bug-553137.php
Package tests
func 1
void function func2() [line 12] void function func3() [line 19]
bug-554712.php
Package tests
&$varname
returns a reference
bug-557861.php
bug is fixed. to test, remove this page-level docblock
Package tests
bug-558031.php
Package tests
Access public
bug-558051.php
Package tests
Access public
bug-559467.php
Package tests
CONSTANT1 = 1 [line 8]
See CONSTANT2
See CONSTANT1
bug-559494.php
tests variable names with the word 'array' in them
Package tests
bug-559668.php
Package tests
include tests
Config
Config file for MLib File includes all of the static variables that controls the default behavior of MLib.
Package tests Author Joe Stump < [email protected]> Version 0.1 See MLib Access public Name Config
$_MLIB_GLOBAL_DSN array = array('db_type'=> 'mysql', 'username' => 'nobody', 'password' => '', 'database' => 'miester', 'server' => 'localhost') [line 99]
Global DSN to be used by classes The DSN to be used. Please see the PEAR documentation information.
Global debugging By turning on global debugging you enable debugging in ALL classes derived from MLib on ALL pages. BE CAREFUL SETTING THIS TO TRUE!!
Author Joe Stump < [email protected]> The absolute path to the directory where MLib resides.
Default log file The log file where you wish all class errors to be Must be writable by the webserver.
Syslog priority The PHP function syslog takes a priority as a parameter. do not know what this means do NOT change this variable.
Template path MLib comes with a template class that lets you separate your code from your HTML. This is the path where the template reside.
Use syslog If set to true MLib will send errors to syslog instead of MLIB_LOG_FILE
See TemplateVar
See DSN
See Debug
See Table
See Template
See TemplateDB
See TemplateFile
See MLib
bug-560578.php
page-level stuff
bug-560595.php
Package tests
bug-562997.php
This page returns a class with name "%s"'."\n", and shouldn't find class at all
Package tests
PDERROR_MULTIPLE_PARENT = 1 [line 9]
warning triggered when inheritance could be from more than one class
bug-566200.php
Package tests
void function ezStartPageNumbers($x, $y, $size, [$pos = 'left'], [$pattern = '{PAGENUM} of {TOTALPAGENUM}'], [$num = '']) [line 8] Function Parameters:
bug-566600.php
Package tests
bug-567059.php
Package tests
bug-645588.php
Global functions
Package tests Author Mark van Renswoude Version 1.0 Since 26-03-2002 15:56
Get a variable's value globalGetVar returns the value of an internal variable. This variable must be previously assigned using either globalSetVar, or an indirect setvar-tag in a loaded template.
See globalSetVar()
string $name the name of the variable to set string $value new value
Set a variable, used by the template engine but available to all scripts globalSetVar sets an internal variable. This variable may later be retrieved using globalGetVar, and is automagically available to templates using the getvar-tag.
See globalGetVar()
bug-698356.php
This is a test of bug 698356. Must be parsed with -pp on to test should not throw error.
Package tests
Create the phpdoc.hhp, contents.hhc files needed by MS HTML Help Compiler create a CHM file The output function generates the table of contents (contents.hhc) and file (phpdoc.hhp) files used to create a .CHM by the free MS HTML Help compiler. {@, a of all separate .html files is created in CHM format, and written to phpdoc.hhp. This was generated by writefile. Next, a call to the table of contents: finishes things off}}
bug-authoremail.php
Package tests
test function
bug-defineparse.php
Package tests
bug-eofquotes.php
Package tests
tests
bug-escaping.php
Package tests
tests
void function test_escape2() [line 11]
bug-loseprocedural.php
Package tests
bug-pageleveldocsblocks.php
Im a page level docblock
Package tests
Im a dummy function currently you need at least one function in your procedural page for this to work
bug-quote_new_parser.php
Package tests
$bqnp_tester string = "testing this testing this $parser;$me thingo\"" [line 15]
The tokenizer splits up strings that have inline variables and will fool the GLOBAL_VALUE handler here
The tokenizer splits up strings that have inline variables and will fool the DEFINE_PARAMS_PARENTHESIS handler here
The tokenizer splits up strings that have inline variables and will fool the STATICVAR handler here
bug-shortdesc.php
Package tests
Short Desc 2.0 Test. This is the Extended Comment and so is this
Short Desc 2.0 Test. This is the Extended Comment and so is this
Short Desc 2.0 Test This is still the short desc Comment and this is the extended
Short Desc 2.0 Test This is still the short desc Comment and so is this Now were to the extended
Class a
[line 8]
Package tests
a::$a mixed = [line 9] a::$c mixed = [line 11] void function a::b() [line 10]
Class b553607_Parser
[line 9]
Package tests See b553607_Parser
Class baby
[line 8]
Package tests
Class brokenlinkstovars
[line 8]
Package tests
brokenlinkstovars::$broken mixed = [line 10] Constructor void function brokenlinkstovars::brokenlinkstovars() [line 14]
See brokenlinkstovars::$broken
Class bug540341
[line 4]
Generated by phpDocumentor v1.4.3 http://www.phpdoc.org - http://pear.php.net/package/PhpDocumentor - http://www.sourceforge.net/projects/phpdocu
Package tests
$atate
Class bug557861
[line 9]
this page will not be shown in the package list and should be
Package tests
Class bug_489398
[line 4]
Package tests
bug_489398::$test_01 mixed = '$Id: bug-489398.php 198623 2005-10-17 18:37:50Z jeichorn $' [line 9]
Class childofpriv
[line 58]
Package tests
Class ClubBase
[line 103]
Package tests
ClubBase::$_bPrintFlush mixed = false [line 146] Constructor void function ClubBase::ClubBase() [line 158]
ClubBase() Der Konstruktor Macht nicht viel mehr, als fuer alle abgeleiteten Klassen abzusetzten und PEAR-Funktionen einzubinden
eine Debug-Meldung
Access public
array function ClubBase::getAllProperties([$simplify = false], [$exclude = array()]) [line 216] Function Parameters:
getAllProperties() Gibt die Wert aller Eigenschaften einer Klasse zurueck Es werden nur 'oeffentliche' Eigenschaften (ohne '_' davor) zurueckgegeben/bearbeitet Wird ein optionales 'Target' angegeben wird versucht den Werte eines Hashes auszulesen (z.B. $class->$target[$property]) bzw. zu schreiben
mixed function ClubBase::getProperty($property, [$target = ''], [$index = 0], [$simplify = false]) [line 176] Function Parameters:
string $property Name der Eigenschaft/Schluessel string $target Name des Targets $index $simplify
getProperty() Gibt den Wert einer Eigenschaft zurueck Es werden nur 'oeffentliche' Eigenschaften (ohne '_' davor) zurueckgegeben/bearbeitet Wird ein optionales 'Target' angegeben wird versucht den Werte eines Hashes auszulesen (z.B. $class->$target[$property]) bzw. zu schreiben
string function ClubBase::getPropType($property, [$target = null], [$index = 0]) [line 271] Function Parameters:
Access public
void function ClubBase::loadClass($classname, [$path = './'], [$ext = '.class.inc'], [$require = false]) [line 333] Function Parameters:
$classname $path
$ext $require
void function ClubBase::printFlush() [line 319] void function ClubBase::printVar($var, [$info = '']) [line 326] Function Parameters:
$var $info
void function ClubBase::setDebug($level, [$hide = true], [$file = ''], [$print = true], [$flush = false]) [line 298] Function Parameters:
integer $level Level, bis zu dem Debugausgaben angezeigt werden boolean $hide Sollen Debugausgaben im HTML in Kommentare gepackt werden? string $file Soll in eine Datei geschrieben werden (null = nein) boolean $print Sollen Kommentare in HTML geschrieben werden, wenn schon in Datei geloggt wird? $flush
auch
set_debug() Debug-Level fuer die Klasse setzen Wird diese Methode statisch (ClubBase::set_debug()) aufgerufen, dann wird die globale Variable $_ClubDebugOptions gesetzt. Diese gilt fuer ALLE KLASSEN, die keine eigenen Werte mit $obj->set_debug() gestzt haben.
Global Variable Used array $_ClubDebugOptions: Globale Debugging-Einstellungen See $_ClubDebugOptions, ClubBase::set_debug(), ClubBase::_PHPDOCUMENTOR_DEBUG() See $_bDebugLevel, $_bHideDebug, $_sLogFile, $_bPrintDebug Static Access public
mixed function ClubBase::setProperty($property, $value, [$target = ''], [$index = 0], [$force = false]) [line 240] Function Parameters:
mixed $value Wert der der Eigenschaft zugewiesen werden soll $property $target
$index $force
Access public
void function ClubBase::_ERROR([$message = 'unknown error'], [$code = PHPDOCUMENTOR_DEBUG_ERROR], [$mode = null], [$options = null], [$userinfo = null], [$error_class = null]) [line 423] Function Parameters:
_ERROR() Fehler registrieren und ggf. zur Debug-Ausgabe weiterleiten Dies muss erst noch implementiert werden ;-))
_PHPDOCUMENTOR_DEBUG() Debugmeldungen ausgeben Mit dieser Funktion koennen alle Klassen einheitlich Debug-Meldungnen ausgeben.
Global Variable Used array $_ClubDebugOptions: Globale Debugging-Einstellungen See $_ClubDebugOptions, ClubBase::set_debug(), ClubBase::_PHPDOCUMENTOR_DEBUG() See $_bDebugLevel, $_bHideDebug, $_sLogFile, $_bPrintDebug Static Access public
Class ctest
[line 23]
Package tests
ctest::$t1 mixed = [line 25] ctest::$t3 mixed = [line 28] Constructor void function ctest::ctest() [line 29] void function ctest::btest() [line 38]
Class few
[line 8]
Package tests
Class functionincomment
[line 8]
Package tests
$trxtype $tender
Class iConverter
[line 34]
Base class for all output converters. A Converter takes output from the Parser and converts it to template-friendly output. A converter for the standard phpDocumentor template, HTMLConverter, is provided with this release. Future releases will have support for other formats and templates, including DocBook, XML, and possibly other HTML templates. The converter takes output directly from NewRender and using walk() it "walks" over an array of phpDocumentor elements, as represented by descendants of parserElement
a converter must define the abstract function Convert (an example is HTMLConverter::Convert()), a function that takes a passed object and uses it to generate structures for an output template, or directly generates output. Since all elements have their DocBlocks linked directly, this allows for more logical parsing than earlier versions of phpDocumentor. A Converter is passed several data structures in its constructor, all of which are optional in output and may be handled in any way the converter would like. These structures are arrays: array of methods by class (see NewRender::$methods) array of variables by class (see NewRender::$vars) array of links to documented elements (see NewRender::$links) array of class parents by name (see NewRender::$classtree) array of class packages by classname (see NewRender::$classpackages) array of packages to document (see NewRender::$packageoutput) array of extended classes by parent classname (see NewRender::$class_children) array of all documented elements by name (see NewRender::$elements) array of all documented elements by name, split by package (see NewRender::$pkg_elements) boolean option, set to true to parse all elements marked @access private (see NewRender::$parsePrivate) boolean option, set to true to stop informative output while parsing (good for cron jobs) (see NewRender::$quietMode)
Package tests See parserDocBlock, parserInclude, parserPage, parserClass, parserDefine, parserFunction, parserMethod, parserVar Abstract Element
Class iHTMLConverter
[line 49]
Base class for all output converters. A Converter takes output from the Parser and converts it to template-friendly output. A converter for the standard phpDocumentor template, HTMLConverter, is provided with this release. Future releases will have support for other formats and templates, including
DocBook, XML, and possibly other HTML templates. The converter takes output directly from NewRender and using walk() it "walks" over an array of phpDocumentor elements, as represented by descendants of parserElement a converter must define the abstract function Convert (an example is HTMLConverter::Convert()), a function that takes a passed object and uses it to generate structures for an output template, or directly generates output. Since all elements have their DocBlocks linked directly, this allows for more logical parsing than earlier versions of phpDocumentor. A Converter is passed several data structures in its constructor, all of which are optional in output and may be handled in any way the converter would like. These structures are arrays: array of methods by class (see NewRender::$methods) array of variables by class (see NewRender::$vars) array of links to documented elements (see NewRender::$links) array of class parents by name (see NewRender::$classtree) array of class packages by classname (see NewRender::$classpackages) array of packages to document (see NewRender::$packageoutput) array of extended classes by parent classname (see NewRender::$class_children) array of all documented elements by name (see NewRender::$elements) array of all documented elements by name, split by package (see NewRender::$pkg_elements) boolean option, set to true to parse all elements marked @access private (see NewRender::$parsePrivate) boolean option, set to true to stop informative output while parsing (good for cron jobs) (see NewRender::$quietMode)
Package tests
Class iiparserBase
[line 8]
Package tests
always base
iiparserBase::$value mixed = false [line 20]
Abstract Element
string function iiparserBase::getType() [line 25] mixed function iiparserBase::getValue() [line 41] void function iiparserBase::setValue($value) [line 33] Function Parameters:
Class iNewRender
[line 66]
Package tests
set to the name of the package of the current class being parsed
iNewRender::$classpackages array = array() [line 153]
used in Converter::getClassPackage() to inherit package from parent classes. format: array(classname => array(array(package,subpackage), array(package1,subpackage1),.... If a name conflict exists between two packages, automatic inheritance will not work, and the packages will need to be documented separately.
set to the name of the subpackage of the current class being parsed
iNewRender::$classtree array = array() [line 140]
a tree of class inheritance by name. format: array(childname => parentname, rootname => 0, ... )
See Converter::generateClassTreeFromClass()
An array of extended classes by package and parent class array(packagename => array(parentclass => array(childclassname1, childclassname2,... ) ) )
Format:
iNewRender::$data
data contains parsed structures for the current page being parsed
See parserData
iNewRender::$elements mixed = array() [line 185] iNewRender::$event_handlers mixed = array( 'docblock' => 'handleDocBlock', 'page' => 'handlePage', 'class' => 'handleClass', 'define' => 'handleDefine', 'function' => 'handleFunction', 'method' => 'handleMethod', 'var' => 'handleVar', 'packagepage' => 'handlePackagePage', 'include' => 'handleInclude', ) [line 210]
See handleEvent(), handleDocBlock(), handlePage(), handleClass(), handleDefine(), handleFunction(), handleMethod(), handleVar(), handlePackagePage(), handleInclude()
the workhorse of linking. This array is an array of link objects of format: [package][subpackage][eltype][elname] = descendant of abstractLink eltype can be page|include|function|define|class|method|var if eltype is method or var, the array format is: [package][subpackage][eltype][class][elname]
array of methods by package, subpackage and class format: array(packagename => array(subpackagename => array(classname => array(methodname1 => parserMethod class, methodname2 => parserMethod class,...) ) ) ) )
See Converter
array of packages to parser and output documentation for, if not all packages should be documented Format: array(package1,package2,...) or false if not set Use this option to limit output similar to ignoring files. If you have some temporary files that you don't want to specify by name but don't want included in output, set a package name for all the elements in your project, and set packageoutput to that name. the default package will be ignored. Parsing speed does not improve. If you want to ignore files for speed reasons, use the ignore command-line option
See Io
set in phpdoc.inc the value of the parserprivate commandline option. to If this option is true, elements with an @access private tag will be parsed and displayed
iNewRender::$pkg_elements mixed = array() [line 187] iNewRender::$private_class mixed = false [line 116]
this variable is used to prevent parsing of private elements if $parsePrivate is false. it is also used by the packageoutput setting to prevent parsing of elements that aren't in the desired output packages
set in phpdoc.inc the value of the quitemode commandline option. to If this option is true, informative output while parsing will not be displayed (documentation is unaffected)
See setTargetDir()
array of class variables by package, subpackage and class format: array(packagename => array(subpackagename => array(classname => array(variablename1 => parserMethod class, variablename2 => parserMethod class,...) ) ) ) )
See Converter
Class iParser
[line 45]
Package tests
Class iparserElement
[line 59]
Package tests
Class kiddie_b587733
[line 25]
Package tests
Class mama
[line 8]
Package tests
Class metoo
[line 26]
Package tests
Class multipl
[line 18]
Package tests
Class parent_b587733
[line 6]
inherited functions with @access private should not be shown in inherited list of child
Package tests
Class priv1
[line 44]
Package tests
Class RecordWarning
[line 19]
Package tests
Class summary_form
[line 4]
Package tests
summary_form::$dp mixed = [line 6] void function summary_form::blah() [line 16] void function summary_form::get_header2($atate) [line 11] Function Parameters:
$atate
See blah()
Class test
[line 9]
I'm a odd test case the @ sign is my friend @ at teh beggining of a line
Package tests
Class test2
[line 19]
Class testarraybug
[line 10]
Package tests
testarraybug::$arrayType mixed = 'name should be arrayType' [line 12] testarraybug::$arrayType1 mixed = [line 17]
Class testClass
[line 8]
Package tests
Class testme
[line 13]
Package tests
testme::$me mixed = array('item1' => 2, # 'NOTME' => hahaha, // 'MENEITHER' => oops, 'item2' => 3) [line 17]
bug-541886.php
Test for bug #541886 Multiple @package or @subpackage tags causing a warning
Class test_541886
[line 20]
Test for bug #541886 Multiple @package or @subpackage tags causing a warning
Class notseen
[line 10]
Package tests Sub-Package notparsed
HighlightParserGetInlineTagsTests.php
Unit Tests for the HighlightParser->getInlineTags() method
Since 1.4.0a2
Since 1.4.0a2
Since 1.4.0a2
IntermediateParserAddPrivatePageTests.php
Unit Tests for the IntermediateParser->addPrivatePage() method
Since 1.4.0a2
Since 1.4.0a2
Since 1.4.0a2
ParserClassGetSourceLocationTests.php
Unit Tests for the ParserClass->getSourceLocation() method
Package tests Sub-Package PhpDocumentorUnitTests Author Chuck Burgess TODO research possibility of refactoring ParserClass->getSourceLocation() and ParserPage->getSourceLocation() into a common method... also, there might be more occurrences of similar getSourceLocation() methods in other classes. Since 1.4.0a1
Since 1.4.0a1
Since 1.4.0a1
TestCase
required by PHPUnit
Since 1.4.0a1
ParserPageGetSourceLocationTests.php
Unit Tests for the ParserPage->getSourceLocation() method
Package tests Sub-Package PhpDocumentorUnitTests Author Chuck Burgess TODO research possibility of refactoring ParserClass->getSourceLocation() and ParserPage->getSourceLocation() into a common method... also, there might be more occurrences of similar getSourceLocation() methods in other classes. Since 1.4.0a1
Since 1.4.0a1
Since 1.4.0a1
TestCase
required by PHPUnit
Since 1.4.0a1
phpDocumentorSetupCleanConverterNamePieceTests.php
Unit Tests for the phpDocumentor_setup->cleanConverterNamePiece() method
Since 1.3.2
Since 1.3.2
Since 1.3.2
phpDocumentorSetupDecideOnOrOffTests.php
Unit Tests for the phpDocumentor_setup->decideOnOrOff() method
Base directory of code Needed by some of the objects being tested in the suites.
Since 1.4.1
PHPUnit main() hack "Call class::main() if this source file is executed directly."
Since 1.3.2
Since 1.3.2
Since 1.3.2
Since 1.3.2
phpDocumentorTParserGetInlineTagsTests.php
Unit Tests for the phpDocumentorTParser->getInlineTags() method
Since 1.4.0a2
Since 1.4.0a2
Since 1.4.0a2
Class tests_HighlightParserGetInlineTagsTests
[line 60]
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.
Since 1.4.0a2
Access protected
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.
Shows correct behavior when called with no actual value and no $endinternal flag arg
Shows correct behavior when called with no actual value and a FALSE $endinternal flag arg
Shows correct behavior when called with no actual value and a TRUE $endinternal flag arg
Class tests_IntermediateParserAddPrivatePageTests
[line 60]
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.
Shows correct behavior for adding a private page object, when the privatepages array is completely empty
Shows correct behavior for adding a private page object, when the privatepages array already has an element
Class tests_ParserClassGetSourceLocationTests
[line 67]
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.
Shows correct behavior when sourceLocation is not set yet with pearize explicitly false
Shows correct behavior when sourceLocation is not set yet with no pearize value set
Shows correct behavior when sourceLocation is not set yet with pearize explicitly true
Shows correct behavior when sourceLocation is set to an absolute path that is not a "pear" location, with pearize explicitly false
Shows correct behavior when sourceLocation is set to an absolute path that is not a "pear" location, with no pearize value set
Shows correct behavior when sourceLocation is set to an absolute path that is not a "pear" location, with pearize explicitly true
Show correct behavior when sourceLocation is set to an absolute path that IS a "pear" location, with pearize explicitly false
Show correct behavior when sourceLocation is set to an absolute path that IS a "pear" location, with pearize not set
Show correct behavior when sourceLocation is set to an absolute path that IS a "pear" location, with pearize explicitly true
Class tests_ParserPageGetSourceLocationTests
[line 67]
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.
Shows correct behavior when sourceLocation is not set yet with pearize explicitly false
Shows correct behavior when sourceLocation is not set yet with no pearize value set
Shows correct behavior when sourceLocation is not set yet with pearize explicitly true
Shows correct behavior when sourceLocation is set to an absolute path that is not a "pear" location, with pearize explicitly false
Shows correct behavior when sourceLocation is set to an absolute path that is not a "pear" location, with no pearize value set
Shows correct behavior when sourceLocation is set to an absolute path that is not a "pear" location, with pearize explicitly true
TODO Revisit this test... I think it highlights a bug in the getSourceLocation method. Compare it with the same test in bug1574047.php against similar method parserClass>getSourceLocation(). Since 1.4.0a1 Access public
TODO Revisit this test... I think it highlights a bug in the getSourceLocation method. Compare it with the same test in bug1574047.php against similar method parserClass>getSourceLocation(). Since 1.4.0a1 Access public
TODO Revisit this test... I think it highlights a bug in the getSourceLocation method. Compare it with the same test in bug1574047.php against similar method parserClass>getSourceLocation(). Since 1.4.0a1 Access public
Show correct behavior when sourceLocation is set to an absolute path that IS a "pear" location, with pearize explicitly false
Show correct behavior when sourceLocation is set to an absolute path that IS a "pear" location, with pearize not set
Show correct behavior when sourceLocation is set to an absolute path that IS a "pear" location, with pearize explicitly true
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.
Since 1.3.2
Access protected
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.
Verify no up-to-parent pathing is allowed... the resulting converter names are generally invalid. This test uses one arg with value of "/var/log/HTML"
Verify no up-to-parent pathing is allowed... the resulting converter names are generally invalid. This test uses two args with value of "/var/log/HTML"
Verify no up-to-parent pathing is allowed... the resulting converter names are generally invalid. This test uses two args with value of "/var/log/frames"
Verify no up-to-parent pathing is allowed... the resulting converter names are generally invalid. This test uses two args with value of "/var/log/default"
Extreme example of messy input... the resulting converter names are generally invalid. This test uses two args with value of "..//.frames"
Extreme example of messy input... the resulting converter names are generally invalid. This test uses two arg with value of "/./default/.##/"
Extreme example of messy input... the resulting converter names are generally invalid. This test uses two arg with value of "//default//"
Extreme example of messy input... the resulting converter names are generally invalid. This test uses one arg with value of "H/.T./M##L"
void function
Extreme example of messy input... the resulting converter names are generally invalid. This test uses two args with value of "H/.T./M##L"
Extreme example of messy input... the resulting converter names are generally invalid. This test uses two args with value of "....frames"
Shows correct behavior for handling the perfect expected "default" secondary value when called with two args
Shows correct behavior for handling "DocBook/peardoc2" secondary value when called with two args
the
perfect
expected
Shows correct behavior for handling the perfect expected "frames" secondary value when called with two args
Shows correct behavior for handling the perfect expected "Smarty" secondary value when called with two args
Shows correct behavior for handling the perfect expected "default" tertiary value when called with two args
Shows correct behavior "DOM/default" tertiary value when called with two args
for
handling
the
perfect
expected
Shows correct behavior for handling the perfect expected "DOM/earthli" tertiary value when called with two args
Shows correct behavior for handling the perfect expected "DOM/l0l33t" tertiary value when called with two args
Shows correct behavior for "DOM/phpdoc.de" tertiary value when called with two args
handling
the
perfect
expected
Shows correct behavior for "DOM/phphtmllib" tertiary value when called with two args
handling
the
perfect
expected
Shows correct behavior for handling the perfect expected "earthli" tertiary value when called with two args
Shows correct behavior for handling the perfect expected "HandS" tertiary value when called with two args
Shows correct behavior for handling the perfect expected "l0l33t" tertiary value when called with two args
Shows correct behavior for handling the perfect expected "PEAR" tertiary value when called with two args
Shows correct behavior for handling the perfect expected "PHP" tertiary value when called with two args
Shows correct behavior for handling the perfect expected "phpdoc.de" tertiary value when called with two args
Shows correct behavior for handling the perfect expected "phphtmllib" tertiary value when called with two args
Shows correct behavior for handling the perfect expected "CHM" primary value when called with one arg
Shows correct behavior for handling the perfect expected "HTML" primary value when called with one arg
Shows correct behavior for handling the perfect expected "PDF" primary value when called with one arg
Shows correct behavior for handling the perfect expected "XML" primary value when called with one arg
Shows correct behavior for handling the perfect expected "CHM" primary value when called with two args
Shows correct behavior for handling the perfect expected "HTML" primary value when called with two args
Shows correct behavior for handling the perfect expected "PDF" primary value when called with two args
Since 1.3.2
Access public
Shows correct behavior for handling the perfect expected "XML" primary value when called with two args
Verify no up-to-parent pathing is allowed... the resulting converter names are generally invalid. This test uses one arg with value of "../../HTML"
Verify no up-to-parent pathing is allowed... the resulting converter names are generally invalid. This test uses two args with value of "../../HTML"
Verify no up-to-parent pathing is allowed... the resulting converter names are generally invalid. This test uses two args with value of "../../frames"
Verify no up-to-parent pathing is allowed... the resulting converter names are generally invalid. This test uses two args with value of "../../default"
Shows correct behavior for handling the perfect expected "b2evo.v-110" tertiary value (an example of a user-defined template not packaged with PhpDocumentor) when called with two args
Class tests_phpDocumentorSetupDecideOnOrOffTests
[line 60]
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.
Shows correct behavior for handling the perfect expected "off" value
Shows correct behavior for handling the perfect expected "on" value
Shows correct behavior for handling an odd "ash nazg durbatuluk" value
Class tests_phpDocumentorTParserGetInlineTagsTests
[line 60]
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.
void function
Shows correct behavior for handling an inline example tag e.g. {at-example path-tofile} There should be NO difference in results due to --parseprivate flag
Shows correct behavior for handling an inline example tag e.g. {at-example path-tofile} There should be NO difference in results due to --parseprivate flag
Shows correct behavior for handling an inline internal tag e.g. {at-internal blahblah-blah} There SHOULD be differences in results due to --parseprivate flag
Shows correct behavior for handling an inline internal tag e.g. {at-internal blahblah-blah} There SHOULD be differences in results due to --parseprivate flag This test demonstrates PEAR Bug #10871
Shows correct behavior for handling an inline link tag e.g. {at-link URL link-text} There should be NO difference in results due to --parseprivate flag
Shows correct behavior for handling an inline link tag e.g. {at-link URL link-text} There should be NO difference in results due to --parseprivate flag
Shows correct behavior for handling an inline source tag e.g. {at-source} There should be NO difference in results due to --parseprivate flag
Shows correct behavior for handling an inline source tag e.g. {at-source} There should be NO difference in results due to --parseprivate flag
Shows correct behavior for handling an inline tutorial tag e.g. {at-tutorial path-topkgfile} There should be NO difference in results due to --parseprivate flag
Shows correct behavior for handling an inline tutorial tag e.g. {at-tutorial path-topkgfile} There should be NO difference in results due to --parseprivate flag
Class bug_556894_base
[line 11]
Base Class
Class bug_556894_sub1
[line 32]
Class bug_556894_sub2
[line 42]
Plain.php
XML/Beautifier/Renderer/Plain.php
Class PHPDoc_XML_Beautifier_Renderer_Plain
[line 45]
Package XML_Beautifier Author Stephan Schmidt < [email protected]> TODO option to specify inline tags TODO automatically create <![CDATA[ ]]> sections TODO option to specify treatment of whitespac in data sections
Access public
actions.php
phpDocumentor :: docBuilder Web Interface PHP versions 4 and 5 Copyright (c) 2003-2006 Andrew Eddie, Greg Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Greg Beaver < [email protected]> Author Andrew Eddie Version CVS: $Id: actions.php 212211 2006-04-30 22:18:14Z cellog $ Copyright 2003-2006 Andrew Eddie, Greg Beaver License LGPL
builder.php
phpDocumentor :: docBuilder Web Interface Advanced Web Interface to phpDocumentor PHP versions 4 and 5 Copyright (c) 2003-2006 Andrew Eddie, Greg Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Greg Beaver < [email protected]> Author Andrew Eddie Version CVS: $Id: builder.php 212211 2006-04-30 22:18:14Z cellog $ Copyright 2003-2006 Andrew Eddie, Greg Beaver See phpdoc.php License LGPL Filesource Source Code for this file
phpdoc.inc
include_once "$root_dir/phpDocumentor/common.inc.php" [line 69]
config.php
phpDocumentor :: docBuilder Web Interface Advanced Web Interface to phpDocumentor PHP versions 4 and 5 Copyright (c) 2003-2006 Andrew Eddie, Greg Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Greg Beaver < [email protected]> Author Andrew Eddie Version CVS: $Id: config.php 234145 2007-04-19 20:20:57Z ashnazg $ Copyright 2003-2006 Andrew Eddie, Greg Beaver See phpdoc.php License LGPL Filesource Source Code for this file
utilities.php
phpDocumentor :: docBuilder Web Interface PHP versions 4 and 5 Copyright (c) 2003-2006 Andrew Eddie, Greg Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Greg Beaver < [email protected]> Author Andrew Eddie Version CVS: $Id: utilities.php 212211 2006-04-30 22:18:14Z cellog $ Copyright 2003-2006 Andrew Eddie, Greg Beaver License LGPL
$path &$node
void function htmlArraySelect(&$arr, $select_name, $select_attribs, $selected, $arr) [line 63] Function Parameters:
array $arr array of the key-text pairs string $select_name The name of the select box
string $select_attribs Additional attributes to insert into the html select tag string $selected The key value of the selected eleme &$arr
Returns a select box based on an key,value array where selected is based on key
include_once 'PhpDocumentor/HTML_TreeMenu-1.1.2/TreeMenu.php' [line 36]
$path &$node
void function showImage($src, [$wid = ''], [$hgt = ''], [$alt = '']) [line 48] Function Parameters:
string $src path to the source image int $wid width on the image [optional] int $hgt height on the image [optional] string $alt hover text for the image [optional]
$path &$node
$tree
top.php
phpDocumentor :: docBuilder Web Interface Advanced Web Interface to phpDocumentor PHP versions 4 and 5 Copyright (c) 2003-2006 Andrew Eddie, Greg Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Greg Beaver < [email protected]> Author Andrew Eddie Version CVS: $Id: top.php 212211 2006-04-30 22:18:14Z cellog $ Copyright 2003-2006 Andrew Eddie, Greg Beaver See phpdoc.php License LGPL Filesource Source Code for this file
new_phpdoc.php
Advanced Web Interface to phpDocumentor PHP versions 4 and 5
Package phpDocumentor Author Chuck Burgess < [email protected]> Author Joshua Eichorn < [email protected]> Author Juan Pablo Morales < [email protected]> Author Gregory Beaver < [email protected]> See phpdoc.php Link http://pear.php.net/package/PhpDocumentor Deprecated redirects automatically to docbuilder (see docbuilder/index.html) TODO CS cleanup - change package to PhpDocumentor License LGPL Filesource Source Code for this file
phpdoc.php
Original Web Interface to phpDocumentor PHP versions 4 and 5
Package phpDocumentor Author Chuck Burgess < [email protected]> Author Joshua Eichorn < [email protected]> Author Juan Pablo Morales < [email protected]> Author Gregory Beaver < [email protected]> Link http://pear.php.net/package/PhpDocumentor Deprecated redirects automatically to docbuilder (see docbuilder/index.html) TODO CS cleanup - change package to PhpDocumentor License LGPL Filesource Source Code for this file
Classes.inc
Intermediate class parsing structure. phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2001-2007 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Greg Beaver < [email protected]> Version CVS: $Id: Classes.inc 243933 2007-10-10 01:18:25Z ashnazg $ Copyright 2001-2007 Gregory Beaver See parserDocBlock, parserInclude, parserPage, parserClass See parserDefine, parserFunction, parserMethod, parserVar Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.0rc1 License LGPL Filesource Source Code for this file
clone.inc.php
Object clone method phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2001-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Greg Beaver < [email protected]> Version CVS: $Id: clone.inc.php 243202 2007-09-30 02:08:08Z ashnazg $ Copyright 2001-2006 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.0rc1 Filesource Source Code for this file License LGPL
clone5.inc.php
Object clone method phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2001-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Greg Beaver < [email protected]> Version CVS: $Id: clone5.inc.php 243202 2007-09-30 02:08:08Z ashnazg $ Copyright 2001-2006 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.0rc1 Filesource Source Code for this file License LGPL
common.inc.php
Common information needed by all portions of the application phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2001-2008 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Greg Beaver < [email protected]> Version CVS: $Id: common.inc.php 288074 2009-09-05 02:16:26Z ashnazg $ Copyright 2001-2008 Gregory Beaver See parserDocBlock, parserInclude, parserPage, parserClass See parserDefine, parserFunction, parserMethod, parserVar Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - rename constant to TOKENIZER_EXT Since 1.0rc1 License LGPL Filesource Source Code for this file
Debugging output
string $s string to display mixed $v unlimited number of variables to display with var_dump()
Returns a lower-cased version of get_class for PHP 5 get_class() returns case as declared in the file in PHP 5
string $filename full path to the ini file bool $process_sections add an associative index brackets]
Parse an .ini file Works like http://www.php.net/parse_ini_file, except it will take a section like: [MYVAR] value1 value2 value3 and return an associative array(MYVAR => array(value1, value2, value3))
PHPDOCUMENTOR_VER = "1.4.3" [line 49] PHPDOCUMENTOR_WEBSITE = "http://www.phpdoc.org" [line 53] PHPDOCUMENTOR_WINDOWS = substr(PHP_OS,0,3)=='WIN' [line 64] require_once $cloneClassDir.DIRECTORY_SEPARATOR.$cloneClassFile [line 81]
SMART_PATH_DELIMITER = DIRECTORY_SEPARATOR [line 56] tokenizer_ext = extension_loaded('tokenizer')&&version_compare(phpversion(),"4.3.0",">=") [line 58] _IN_PHP5 = phpversion()=='5.0.0RC1-dev'||phpversion()=='5.0.0RC2dev'||version_compare(phpversion(),'5.0.0','ge') [line 66]
EventStack.inc
An Event Stack for inter-program communication, particularly for parsing phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2000-2007 Joshua Eichorn LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Joshua Eichorn < [email protected]> Version CVS: $Id: EventStack.inc 243937 2007-10-10 02:27:42Z ashnazg $ Copyright 2000-2007 Joshua Eichorn Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 0.1 Filesource Source Code for this file License LGPL
IntermediateParser.inc
The phpDocumentor_IntermediateParser Class The Intermediary Data Parser (intermediate between Parse and Converter) phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Gregory Beaver < [email protected]> Version CVS: $Id: IntermediateParser.inc 247821 2007-12-09 06:11:35Z ashnazg $ Copyright 2002-2006 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.1 Filesource Source Code for this file License LGPL
Io.inc
File and input handling routines This class parses command-line options, and works with files to generate lists of files to parse based on the ignore/include options phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2000-2006 Joshua Eichorn, Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Joshua Eichorn < [email protected]> Author Gregory Beaver < [email protected]> Version CVS: $Id: Io.inc 286921 2009-08-08 05:01:24Z ashnazg $ Copyright 2000-2006 Joshua Eichorn, Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 0.1 Filesource Source Code for this file License LGPL
void function get_include_path() [line 987] void function Ioinc_mystrucsort($a, $b) [line 913] Function Parameters:
string $a
string $b
string $a string $b
array $struc struc is array('dir' => array of files in dir,'dir/subdir' => array of files in dir/subdir,...) array $dir array form of 'dir/subdir/subdir2' array('dir','subdir','subdir2') $contents
Recursively move contents of $struc into associative array The contents of $struc have many indexes like 'dir/subdir/subdir2'. converts them to array('dir' => array('subdir' => array('subdir2')))
This function
Usedby Io::getDirTree()
Recursively add all the subdirectories of $contents to $dir without erasing anything
in $dir
ParserDescCleanup.inc
All of the functions to clean up and handle the long description of a DocBlock are in this file. The primary functionality is based on Parser and WordParser, and modified to recognize only the tokens defined in the PHPDOCUMENTOR_PDP_* constants phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Parsers Author Gregory Beaver < [email protected]> Version CVS: $Id: ParserDescCleanup.inc 286923 2009-08-08 06:00:39Z ashnazg $ Copyright 2002-2006 Gregory Beaver See Parser, WordParser Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.2 License LGPL
when the << potential escape for tags is found in a desc parserDescParser token constants
when a simple list is found in a desc parserDescParser token constants like o item 2
o item 1
when the << potential escape for tags is found in a desc parserDescParser token constants
when a simple list is found in a desc parserDescParser token constants like o item 2
o item 1
phpdoc.inc
startup file phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2000-2007 Joshua Eichorn, Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Joshua Eichorn < [email protected]> Author Gregory Beaver < [email protected]> Version CVS: $Id: phpdoc.inc 243933 2007-10-10 01:18:25Z ashnazg $ Copyright 2000-2007 Joshua Eichorn, Gregory Beaver Link http://www.phpdoc.org Link http://pear.php.net/PhpDocumentor TODO CS cleanup - change package to PhpDocumentor Since 0.1 License LGPL Filesource Source Code for this file
60]
All command-line handling from previous version has moved to here Many settings also moved to phpDocumentor.ini
ProceduralPages.inc
Intermediate procedural page parsing structure. This structure parses defines, functions, and global variables by file, iterates over the elements to document conflicts. phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2008 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA and then
Package phpDocumentor Author Gregory Beaver < [email protected]> Version CVS: $Id: ProceduralPages.inc 253641 2008-02-24 02:35:44Z ashnazg $ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.1 License LGPL
Publisher.inc
a class for handling the publishing of data phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2000-2007 Kellin, Joshua Eichorn LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Kellin < [email protected]> Author Joshua Eichorn < [email protected]> Version CVS: $Id: Publisher.inc 244033 2007-10-11 03:30:34Z ashnazg $ Copyright 2000-2007 Kellin, Joshua Eichorn Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 0.1 License LGPL
Setup.inc.php
This was all in phpdoc.inc and now encapsulates the complexity , phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Author Gregory Beaver < [email protected]> Version CVS: $Id: Setup.inc.php 258122 2008-04-22 15:48:55Z ashnazg $ Copyright 2002-2006 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.2 License LGPL
Name $phpDocumentor_DefaultCategoryName
Name $phpDocumentor_DefaultPackageName
$_phpDocumentor_setting is either the value from the web interface, or is set up by Io::parseArgv()
void function checkForBugCondition($php_version, [$php_bug_number = 'none'], [$pear_bug_number = 'none']) [line 971] Function Parameters:
string $php_version the PHP version that contains the bug string $php_bug_number the PHP bug number (if any) string $pear_bug_number the PEAR bug number (if any)
Crash in case of known, dangerous bug condition Checks the PHP version that is executing PhpDocumentor, in case a known PHP/PEAR bug condition could be triggered by the PhpDocumentor execution.
boolean function decideOnOrOff([$value_to_guess = 'NO VALUE WAS PASSED']) [line 930] Function Parameters:
common settings
include_once "phpDocumentor/InlineTags.inc" 53] [line
$string
HighlightParserTests.php
Package phpDocumentor
IntermediateParserTests.php
Package phpDocumentor
ParserClassTests.php
Package phpDocumentor
ParserPageTests.php
Package phpDocumentor
phpDocumentorSetupTests.php
Package phpDocumentor
phpDocumentorTParserTests.php
Package phpDocumentor
Class bug_772441
[line 2]
Package phpDocumentor
Class Classes
[line 70]
Intermediate class parsing structure. The phpDocumentor_IntermediateParser class uses this class and its cousin, ProceduralPages to organize all parsed source code elements. Data is fed to each immediately after it is parsed, and at conversion time, everything is organized. The Classes class is responsible for all inheritance, including resolving name conflicts between classes, determining which classes extend other classes, and is responsible for all inheritance of documentation.
Package phpDocumentor Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2001-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org
While parsing, add a class to the list of parsed classes sets up the $classesbyfile, $classesbynamefile, $extendsbyfile, $classchildrenbyfile, $roots arrays, and sets $curclass
Uses Classes::addPackageToFile() - marks the current class's package as being present in a file
While parsing, add a variable to the list of parsed variables sets up the $constsbyfile array using $curfile and $curclass
While parsing, add a method to the list of parsed methods sets up the $methodsbyfile array using $curfile and $curclass
Mark a package as being used in a class 1 function addPackageToFile($package ) 2 { 3 if (!isset( $this -> revcpbf[$this -> curfile][ package $ ])) 4 $this -> classpackagebyfile[ $this -> curfile][] = $package ; 5 $this -> revcpbf[$this -> curfile][ package = 1; $ ] 6 }
Usedby Classes::addClass() - marks the current class's package as being present in a file
While parsing, add a variable to the list of parsed variables sets up the $varsbyfile array using $curfile and $curclass
Get the parserClass representation of a class from its name and file
Used by parserData::getClasses()to retrieve classes defined in file $path retrieves the array entry from $classesbyfile for $path
If a package contains two classes with the same name, this function finds that conflict Returns the $classconflicts entry for class $class, minus its own path
string $parclass name of parent class string $file file parent class is found in
Get all classes confirmed in parsing to be descended class $parclass in file $file
Find the parent class of a class in file $file uses 3 tests to find the parent classname:
1. 2. 3.
only one class with the parent classname more than one class, but only one in the same file as the child only one parent class in the same package as the child
boolean $all [since phpDocumentor 1.3.0RC6] determines whether to class trees that extend non-parsed classes
return
Get a list of all root classes indexed by package. Used to generate class trees by Converter
void function Classes::Inherit(&$render) [line 546] Function Parameters:
Main processing engine for setting up class inheritance. This function uses $roots to traverse the inheritance tree via processChild() and returns the data structures phpDocumentor_IntermediateParser needs to convert parsed data to output using phpDocumentor_IntermediateParser::Convert()
TODO CS Cleanup - rename to "inherit" for CamelCaps naming standard Uses Classes::processChild() - set up inheritance
Prepare to parse a new file sets $curfile to $file and $curclass to false (no class being parsed)
void function Classes::processChild(&$render, $class, $file, [$furb = false]) [line 690] Function Parameters:
phpDocumentor_IntermediateParser &$render the renderer object string $class class to process string $file name of file $class is located in boolean $furb flag used privately to control informational output while parsing (used when processing leftover classes in Inherit()
This function recursively climbs up the class tree, setting inherited information like package and adds the elements to phpDocumentor_IntermediateParser. Using structures defined in Classes, the function first sets package information, and then seeks out child classes. It uses 3 tests to determine whether a class is a child class. child class is in the same file as the parent class and extends parent class 2. child class is in a different file and specifies
1.
the parent's @package in its docblock child class is in a different file and is in a 3. different @package, with one possible parent class
Global Variable Used string $phpDocumentor_DefaultPackageName: default package, usually "default" Usedby Classes::Inherit() - set up inheritance
string $class child class to find parent class string $file file child class is located in
Find the parent class of $class, and set up structures to note this fact Modifies the parserClass element in $classesbyfile to use the parent's package, and inherit methods/vars
Uses Classes::getParentClass() - to find the parent class Uses $definitechild - if a match is made between a parent class and parameter $class in file $file, then definitechild is set here
Class EventStack
[line 52]
An event Stack
Package phpDocumentor Author Joshua Eichorn < [email protected]> Version Release: @VER@ Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor License LGPL
The stack
int function EventStack::getEvent() [line 94]
Class Io
[line 50]
Package phpDocumentor Author Gregory Beaver < [email protected]> Author Joshua Eichorn < [email protected]> Version $Id: Io.inc 286921 2009-08-08 05:01:24Z ashnazg $
Format: array(array(regexp-ready string to search for whole path, regexp-ready string to search for basename of ignore strings),...)
Holds all the options that are avaible to the cmd line interface and to the different web interfaces
Io::$valid_booleans array = array ( '', ' ', 'on', 'y', 'yes', 'true', '1', 'off', 'n', 'no', 'false', '0' ) [line 71]
A specific array of values that boolean-based arguments can understand, aided by the decideOnOrOff() helper method. Use lowercase letters always, to simplify string comparisons
creates an array $this->phpDocOptions and sets program options in it. Array is in the format of: [filename][tag][] = "f"; [filename][tag][] = "-file"; [filename][desc] "name of file to parse"
bool function Io::checkIgnore($file, $path, $ignore, [$ignore_no_ext = true], [$ignoresymlinks = false]) [line 717] Function Parameters:
string $file just the file name of the file or directory, this is the last dir string $path the path to consider (should be checked by and may be relative) array $ignore bool $ignore_no_ext bool $ignoresymlinks Ignore symlinks?
array function Io::dirList($orig_directory, [$hidden = false], [$ignore_symlinks = false], $directory) [line 377] Function Parameters:
string $directory full path to the directory you want the list of bool $hidden whether to list files that begin with . like .bash_history bool $ignore_symlinks whether to ignore symlinks $orig_directory
string $file a full path from the -f command-line parameter, with potential * and ? wildcards.
Take a filename with wildcards and return all files that match the wildcards
Retrieve common directory (case-insensitive in windows) takes the list of files, and returns the subdirectory they share in common, so in this list:
1 2 3 4 array( "/dir1/dir2/subdir/dir3/filename.ext" "/dir1/dir2/subdir/dir4/filename.ext" "/dir1/dir2/mydir/dir5/filename.ext"
, , );
void function Io::getDirTree($dir, $base_dir, [$ignore = array()], [$hidden = false], [$ignoresymlinks = false]) [line 564] Function Parameters:
string $dir directory string $base_dir base directory array $ignore array of ignored items boolean $hidden the "hidden" flag boolean $ignoresymlinks the "ignoresymlinks" flag
string $base base directory from getBase() array $filelist file list from dirList()
Retrieve tutorial subdirectories and their contents from the list of files to parse
string $filename
calls http://www.php.net/file_exists each value in include_path, for then calls http://www.php.net/is_readable when it finds the file
Global Variable Used array $argv: command-line arguments TODO replace with Console_* ?
Reads a file and returns it as a string Does basic error checking file extensions are set in phpdoc.inc
Global Variable Used array $_phpDocumentor_cvsphpfile_exts: PHP File extensions, used to validate that $path is a PHP File Global Variable Used array $_phpDocumentor_phpfile_exts: PHP File extensions in a CVS repository, used to validate that $path is a PHP File
array $dir array of filenames (full path) string $match search string with wildcards
Removes files from the $dir array that do not match the search string in $match
Class phpDocumentor_IntermediateParser
[line 60]
The phpDocumentor_IntermediateParser Class This class performs the work of organizing raw data from the parser in the format of descendants of the parserElement class. This is also where processing of package pages occurs, in phpDocumentor_IntermediateParser::handleClass() for class-level packages and phpDocumentor_IntermediateParser::handleDocBlock() for page-level packages. Most of the work of this parser goes to matching up DocBlocks with the elements that they are documenting. Since DocBlocks are passed before the element they document, the last DocBlock is stored in phpDocumentor_IntermediateParser::$last and then placed into the $docblock parameter of the parserElement descendant object.
Package phpDocumentor Author Gregory Beaver Version $Id: IntermediateParser.inc 247821 2007-12-09 06:11:35Z ashnazg $ Copyright 2002 Gregory Beaver
list of all packages encountered while documenting. Used in automatic linking. Converter::getLink() first checks if an ambiguous link is found in the current package. If not, it then checks in parent packages, and if still not found, uses this array to check in the rest of the packages before giving up
used to keep track of inheritance at the smartest level possible for a dumb computer
an array of template names indexed by converter name For example, if the default HTMLframesConverter is using the DOM/l0l33t template, the array will be
1 $converters['frames'] = 'DOM/l0l33t'
Name of the class currently being parsed. It is only used (and only valid) when phpDocumentor_IntermediateParser is parsing a class
$data contains parsed structures for the current page being parsed In version 1.1+, $data is only used to store the current page information. All handling of documented elements is handled by the ProceduralPages and Classes classes.
phpDocumentor_IntermediateParser::$db_template mixed = [line 295] phpDocumentor_IntermediateParser::$event_handlers mixed = array( 'docblock' => 'handleDocBlock', 'page' => 'handlePage', 'class' => 'handleClass', 'define' => 'handleDefine', 'function' => 'handleFunction', 'method' => 'handleMethod', 'var' => 'handleVar', 'const' => 'handleConst', 'packagepage' => 'handlePackagePage', 'include' => 'handleInclude', 'global' => 'handleGlobal', 'tutorial' => 'handleTutorial', ) [line 214]
phpDocumentor_IntermediateParser::handleTutorial() See phpDocumentor_IntermediateParser::handleDefine(), phpDocumentor_IntermediateParser::handleFunction(), phpDocumentor_IntermediateParser::handleMethod(), phpDocumentor_IntermediateParser::handleVar() See handleEvent(), phpDocumentor_IntermediateParser::handleDocBlock(), phpDocumentor_IntermediateParser::handlePage(), phpDocumentor_IntermediateParser::handleClass()
type of the last parser Element handled This is used in handleDocBlock to determine whether a DocBlock is a page-level DocBlock in conjunction with the parserData::$clean var. A page-level DocBlock is alwaysthe first DocBlock in a file, and must be followed by another DocBlock. The first test is handled by parserData::$clean, which is set to false on the first encounter of an element, and the second test is handled by this variable, which must be equal to "docblock"
See phpDocumentor_IntermediateParser::handleDocBlock()
Used to determine the category for tutorials. WARNING: If more than one category exists, the last category overwrite the previous and will raise a big warning
encountered will
array of packages to parser and output documentation for, if not all should be documented Format: array(package1,package2,...) or false if not set
packages
Use this option to limit output similar to ignoring files. If you have some temporary files that you don't want to specify by name but don't want included in output, set a package name for all the elements in your project, and set packageoutput to that name. the default package will be ignored. Parsing speed does not improve. If you want to ignore files for speed reasons, use the ignore command-line option
array of parsed package pages used by Convert() to convert all package pages into output
Keeps track of packages of classes that have parent classes in another package. Used in automatic linking. This array is updated by addPackageParent(), which is called in Classes::processChild() to keep track of classes that descend from classes in different packages. In other words, if class foo is in package one, and class bar is in package two, an entry $package_parents['two'] = 'one' will be made.
set in Setup.inc.php the value of the parseprivate commandline to option. If this option is true, elements with an @access private tag will be parsed and displayed
Put away a page that has been @ignored or @access private$parsePrivate if ! When a page has @access private in its DocBlock, it is placed here instead of in $pages, to allow for proper Class parsing. Since classes and pages are parsed as if they were separate, this array allows public classes on private pages to retrieve information needed about the page that holds the class and to addPageIfNecessary() to the $pages array
used to keep track of all elements in a procedural page. Handles name conflicts with elegance
Since 1.1
set in Setup.inc.php the value of the quitemode commandline option. to If this option is true, informative output while parsing will not be (documentation is unaffected)
displayed
See phpDocumentor_IntermediateParser::setTargetDir()
See phpDocumentor_IntermediateParser::setTemplateBase()
type of the current parser Element being handled This is used by HandleEvent() to set the $lasttype var, which is used to detect pagelevel DocBlocks
set
in Setup.inc.php to the value of the undocumentedElementWarnings commandline option. If this option is true, warnings about certain elements (classes, methods) that are not documented with DocBlocks will be shown while parsing, and will also be displayed in the errors.html page (other documentation is unaffected)
phpDocumentor_IntermediateParser::$uses mixed = array() [line 293] Constructor void function phpDocumentor_IntermediateParser::phpDocumentor_IntermediateParser([$title = 'Generated Documentation']) [line 326] Function Parameters:
string $output output format (HTML, PDF, XML). Must be all caps string $name Converter name (frames, for example, is the name of HTMLframesConverter) string $template template to use, should be a relative path to the
templates
Add a converter name to use to the list of converters Sets up the $converters array.
adds a processed descendant ofparserElement to the $pages array or $privatepages array This function expects the page to exist in either $pages or $privatepages. It calls the parserData::addElement() method to add $element to the page.
parserClass &$class
If the parent class of $class is in a different package, adds it to the $package_parents array
Replaces theparserPagerepresented by $this->pages[$path] with $page Called by addPageIfNecessary(), handleDocBlock() and ProceduralPages::setupPages(), this method first checks to see if the page has been added. If not, it assumes that the page has either been @ignored or set with @access private with --parseprivate off, and returns addPrivatePage(). Otherwise, it sets the
pages[$path] to be the parserPage $page and sets the package and subpackage to that of $page
See phpDocumentor_IntermediateParser::$pages
add a new parserPageto the $pages array if none is found This method is used when a page has been @ignored or marked with @access private, and a public class is in the page (a class with no @access private in its DocBlock). The method first creates a new page in the $pages array and then copies path information, and calls addPage() to set up packages
Adds a parserPage element to the parserData element in $this>privatepages[$path] Performs a similar function to addPage, but adds to the $privatePages array
See phpDocumentor_IntermediateParser::addPage()
Function Parameters:
parserElement $element descendant of parserElement string $path full path to the file
Add all the @uses tags from $element to the $uses array so that @usedby virtual tags can be added
Uses parserUsesTag::getSeeElement() - used to initialize $uses Uses parserUsesTag::getDescription() - used to initialize $uses
mixed $a mixed $b
does a natural case sort on two class elements (either parserClass parserMethod , or parserVar
See generateElementIndex()
$title $converter
Interface to the Converter This function simply passes $pages and package_pages to the walk() method, and
then calls the Output() method. Note that Output() is not required to do anything, and in fact doesn't in HTMLframesConverter.
mixed $a mixed $b
See generateElementIndex()
handles post-parsing of classes This function sets $data->clean to false to tell the phpDocumentor_IntermediateParser that a page-level DocBlock can't be found after this point on this page. It sets $cur_class to its name, and if an @ignore tag is found in the DocBlock, it sets $private_class to true, to prevent post-parsing of any of the class's vars or methods. Then it checks for the existence of a package page for the class's package
handles post-parsing of class constants This function aligns $data's $path var and packages to match the parent object
handles post-parsing of defines This function sets $data->clean to false to tell the phpDocumentor_IntermediateParser that a page-level DocBlock can't be found after this point on this page. It then sets the package to be the same as the page and adds itself to the ProceduralPages class
handles post-parsing of DocBlocks This function sets $last to the DocBlock represented by $data, to allow the next documentable element passed to phpDocumentor_IntermediateParser to link the DocBlock into its $docblock property. This function also checks for two special cases of DocBlocks: First DocBlock in the file contains a @package tag First DocBlock in the file is immediately followed by another DocBlock In both cases, the function extracts this tag and uses it as the page-level package. If the @package tag is in the DocBlock of an element (function, global variable, whatever) that isn't a page-level DocBlock, a warning will be raised to notify the author that a @package tag belongs in a page-level DocBlock.
1. 2.
New in version 1.2.2, if the first DocBlock in a file contains a @package tag, it is a pagelevel DocBlock. If the DocBlock is page-level, it is processed with _processPageLevelDocBlock Finally, the function replaces the old parserPage in parserData::$data->parent with the new one containing information from the DocBlock by calling addPage(), and checks for package-level docs.
integer $event event number from Parser.inc mixed $data if $event is PHPDOCUMENTOR_EVENT_NEWSTATE, $data is a PHP_DOC_EVENT_END_PAGE or STATE_END_CLASS, otherwise $data is either a parserDocBlock, parserPage or descendant of parserElement
called viaParser::parse()and Parser's inherited method Publisher::publishEvent() $event is one of the PHPDOC constants from Parser.inc. If it is not PHPDOCUMENTOR_EVENT_NEWSTATE, then a function name is retrieved from the $event_handlers array and called to handle the $data
Global Variable Used array $_phpDocumentor_setting$phpDocumentor_DefaultPackageName: we use 'sourcecode' to determine whether to highlight the source of the current file if it has no file-level docblock
handles post-parsing of functions This function sets $data->clean to false to tell the phpDocumentor_IntermediateParser that a page-level DocBlock can't be found after this
point on this page. It then sets the package to be the same as the page, aligns the docblock's @param, @global, and @staticvar tags with the information parsed from the function source code. If source code has been parsed by a {@source} tag, the source is added to its docblock, and then the parserFunction adds itself to the ProceduralPages class
handles post-parsing of global variables This function sets $data->clean to false to tell the phpDocumentor_IntermediateParser that a page-level DocBlock can't be found after this point on this page. It then sets the package to be the same as the page, and adds itself to the ProceduralPages class
handles post-parsing of include/require/include_once/require_once This function sets $data->clean to false to tell the phpDocumentor_IntermediateParser that a page-level DocBlock can't be found after this point on this page. It then sets the package to be the same as the page, and adds itself to the ProceduralPages class
handles post-parsing of class methods This function first aligns $data's path and package to match the parent object, and also aligns the docblock's @param, @global, and @staticvar tags with the information parsed from the method source code. It also checks to see if the method is a constructor and sets the $isConstructor flag. If source code has been parsed by a {@source} tag, the source is added to its docblock Finally, it adds the method to the Classes class.
handles post-parsing of procedural pages this event is called at the start of a new page, before the Parser knows whether the page will contain any procedural pages or not
handle post-parsing of Tutorials. This adds the parsed tutorial to the tutorial tree
Since 1.2 Uses $tutorials - sets the value of tutorials to parameter $data
handles post-parsing of class vars This function sets up a @var tag if none is found, and aligns $data's $path var and packages to match the parent object
$title
call this method once parsing has completed. This method calls the private methods fixClasses and fixProcPages, both of which adjust inheritance and package information based on complicated post-parsing rules described in ProceduralPages::setupPages() and Classes::Inherit(). Then, it sorts elements of the $pages array and calls Convert for each Converter in the $converters array
string $package package name of package file to parse string $path directory of file that contains package name
bool $parse
set display of elements marked with @access private If set to true, elements will be displayed
bool $quietMode
set parsing information output mode (quiet or verbose) If set to false, no parsing information (parsing /php/file/thisfile.php, Converting etc.) will be displayed. Useful for cron jobs
bool $undocumentedElementWarnings
show warnings for undocumented elements If set to false, no warnings will be shown for undocumented elements. Useful for identifying classes and methods that haven't yet been documented.
string $path full path of file template-ready $sourceloc source location Program_Root/dir/file.php
Guess the package/subpackage based on subdirectory if the --pear option A file in pear/dir/file.php will be in package "dir." A file in pear/dir/subdir/file.php will be in package "dir," subpackage "subdir."
Global Variable Used array $_phpDocumentor_setting: uses the 'pear' option to determine whether to guess based on subdirectory Tutorial -p, --pear
Class phpDocumentor_setup
[line 100]
Package phpDocumentor
Checks PHP version, makes sure it is 4.2.0+, and chooses the phpDocumentorTParser if version is 4.3.0+
Uses phpDocumentor_setup::parseIni()
$tagname $inline
$title
$flag
Usedby phpDocumentor_setup::phpDocumentor_setup()
$dirs
$files
$ig
void function phpDocumentor_setup::setJavadocDesc() [line 469] void function phpDocumentor_setup::setMemoryLimit() [line 417]
TODO recognize "K" and "G" in memory_limit settings, rather than just "M"
$po
$flag
$flag
$target
$dir
$ti
Function Parameters:
$flag
Class ProceduralPages
[line 58]
Intermediate procedural page parsing structure. This structure parses defines, functions, and global variables by file, iterates over the elements to document conflicts.
and then
Package phpDocumentor Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.1 License LGPL
file being parsed, used in every add function to match up elements with the file that contains them
Namespace conflicts within all documented packages of functions Format: array( functionname => array( full path, full path, ... ) )
array of parsed defines organized by the full path define. Format: array( full path => array( definename => parserDefine ) )
array of file names organized by defines that are in the file. This structure is designed to handle name conflicts. Two files can contain defines with the same name, and this array will record both filenames to help control namespace errors Format: array( definename => array( full path of file containing definename, full path of file 2 containing definename, ... ) )
Namespace conflicts within all documented packages of functions Format: array( functionname => array( full path,
array of parsed functions organized by the full path of the file that contains the function. Format: array( full path => array( functionname => parserFunction ) )
array of file names organized by functions that are in the file. This structure is designed to handle name conflicts. Two files can contain functions with the same name, and this array will record both filenames to help control namespace errors Format: array( functionname => array( full path of file containing functionname, full path of file 2 containing functionname, ... ) )
Namespace conflicts within all documented packages of functions Format: array( functionname => array( full path, full path, ... ) )
array of parsed global variables organized by the full path of the file that contains the global variable definition. Format: array( full path => array( globalname => parserGlobal ) )
array of file names organized by global variables that are in the file. This structure is designed to handle name conflicts. Two files can contain global variables with the same name, and this array will record both filenames to help control namespace errors Format: array( global variablename => array( full path of file containing global variablename, full path of file 2 containing global variablename, ... ) )
array of all procedural pages ordered by name that have been ignored via -po or @access private or @ignore Format: name => array( fullpath => parserPage, fullpath => parserPage2 [if there are name conflicts], ... ) )
array(
array of parsed includes organized by the full path of the file that contains the include. Format: array( full path => array( includename => parserInclude ) )
array of packages assigned to classes in a file, ordered by fullpath Format: array( fullpath => array( packagename => array( subpackagename => 1, subpackagename => 1, .. ), packagename2 => array(... ) ) )
Namespace conflicts within all documented pages Format: array( pagename => array( fullpath, fullpath, ... ) )
array of packages ordered by full path Format: array( fullpath => array(
packagename, subpackagename ) )
array of all procedural pages ordered by name Format: array( name => array( fullpath => parserPage, fullpath => parserPage2 [if there are name conflicts], ... ) )
array of all procedural page names ordered by full path to the file Format: array( fullpath => name )
string $file full path to the file that contains the class string $package package name string $subpackage subpackage name
string $path full path string $package the package name string $subpackage the subpackage name
Changes the package of the page represented by $path changes package in both the $pages array and the pagepackages array
TODO figure out what &$c is and update the param tag
string $path path to the file string $file the file name
string $path the path to look for string $infile the file to check
Used to align an element with the package of its parent page prior to Conversion.
void function ProceduralPages::setName($name) [line 421] Function Parameters:
Change a page's name from its file to alias $name This function is used to handle a @name tag in a page-level DocBlock
if there is one class package in a file, the parent path inherits the package if its package is default. helps with -po to avoid dumb bugs
Adjusts packages of all pages and removes name conflicts within a package Automatic linking requires that each linkable name have exactly one element associated with it. In other words, there cannot be two functions named foo() in the same package. This also adheres to php rules with one exception:
1 2 3 4 5 if ($test == 3) { define('whatever', 'this thing'); } else { define('whatever', 'this other thing'); }
phpDocumentor is not aware of conditional control structures because it would slow things down considerably. So, what phpDocumentor does is automatically ignore the second define and raise a warning. The warning can be eliminated with an @ignore tag on the second element like so:
1 2 3 4 5 6 7 8 if ($test == 3) { define('whatever', 'this thing'); } else { /** * @ignore */ define('whatever', 'this other thing'); }
If there are two files that contain the same procedural elements in the same package (for example, a common configuration file common.php), they will also be ignored as if they were in the same file. The reasoning behind this is simple. A package is an indivisible set of files and classes that a user will include in their code. Name conflicts must be avoided to allow successful execution. This function also plays the all-important role of calling phpDocumentor_IntermediateParser::addElementToPage() in order to add processed elements to their pages for Conversion.
Class Publisher
[line 54]
Package phpDocumentor Author Kellin < [email protected]> Author Joshua Eichorn < [email protected]> Version Release: @VER@ Copyright 2000-2007 Kellin, Joshua Eichorn Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor License LGPL
Publisher::$popEvent array = array() [line 67] Publisher::$pushEvent array = array() [line 66] Publisher::$subscriber array = array() [line 62]
integer $event see Parser.inc PARSER_EVENT_* constants mixed $data anything the subscribed event handler is expecting
Publish an event
void function Publisher::subscribe($event, &$object) [line 83] Function Parameters:
integer $event see Parser.inc PARSER_EVENT_* constants class &$object any class that has a HandleEvent() method like phpDocumentor_IntermediateParser::HandleEvent()
or
Classes::HandleEvent()
Adds a subscriber to the $subscriber array(). if $event is '*', the publisher will use $object as the default event handler
TODO CS Cleanup - there's no way I can get the &$object desc under 85 chars
Class tests_HighlightParserTests
[line 12]
Package phpDocumentor
Class tests_IntermediateParserTests
[line 12]
Package phpDocumentor
Class tests_ParserClassTests
[line 12]
Package phpDocumentor
Class tests_ParserPageTests
[line 12]
Package phpDocumentor
Class tests_phpDocumentorSetupTests
[line 13]
Package phpDocumentor
Class tests_phpDocumentorTParserTests
[line 12]
Package phpDocumentor
DescHTML.inc
All abstract representations of html tags in DocBlocks are handled by the classes in this file Before version 1.2, phpDocumentor simply passed html to converters, without much thought, except the adv_htmlentities() function was provided along with a list of allowed html. That list is no longer used, in favor of these classes. The PDF Converter output looked wretched in version 1.1.0 because line breaks in DocBlocks were honored. This meant that output often had just a few words on every other line! To fix this problem, DocBlock descriptions are now parsed using the ParserDescParser, and split into paragraphs. In addition, html in DocBlocks are parsed into these objects to allow for easy conversion in destination converters. This design also allows different conversion for different templates within a converter, which separates design from logic almost 100% phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2007 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package DescHTML Author Greg Beaver < [email protected]> Version CVS: $Id: DescHTML.inc 246329 2007-11-17 03:07:00Z ashnazg $ Copyright 2002-2007 Gregory Beaver See parserDocBlock, parserInclude, parserPage, parserClass See parserDefine, parserFunction, parserMethod, parserVar Link http://pear.php.net/PhpDocumentor
Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.2 License LGPL Filesource Source Code for this file
Class parserB
[line 161]
Package phpDocumentor Sub-Package DescHTML Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - rename class to ParserB Since 1.2 License LGPL
Class parserBr
[line 326]
Package phpDocumentor Sub-Package DescHTML Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - rename class to ParserBr Since 1.2 License LGPL
Class parserCode
[line 74]
Package phpDocumentor Sub-Package DescHTML Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - rename class to ParserCode Since 1.2 License LGPL
Class parserDescVar
[line 227]
Package phpDocumentor Sub-Package DescHTML Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - rename class to ParserDescVar Since 1.2 License LGPL
Class parserI
[line 194]
Package phpDocumentor Sub-Package DescHTML Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor
Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - rename class to ParserI Since 1.2 License LGPL
Class parserKbd
[line 293]
Package phpDocumentor Sub-Package DescHTML Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - rename class to ParserKbd Since 1.2 License LGPL
Class parserList
[line 359]
Package phpDocumentor Sub-Package DescHTML Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - rename class to ParserList Since 1.2 License LGPL
boolean = [line 364] Constructor void function parserList::parserList($numbered) [line 374] Function Parameters:
add a list
string function parserList::Convert(&$c) [line 413] Function Parameters:
TODO CS cleanup - rename method to convert() Uses Converter::ListItem() - enclose each item of the list Uses Converter::EncloseList() - enclose the list
Class parserPre
[line 127]
Package phpDocumentor Sub-Package DescHTML Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - rename class to ParserPre Since 1.2 License LGPL
Class parserSamp
[line 260]
Package phpDocumentor Sub-Package DescHTML Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - rename class to ParserSamp Since 1.2 License LGPL
DocBlockTags.inc
All abstract representations of DocBlock tags are defined by the classes in this file phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2008 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package DocBlockTags Author Greg Beaver < [email protected]> Version CVS: $Id: DocBlockTags.inc 287889 2009-08-30 07:27:39Z ashnazg $ Copyright 2002-2008 Gregory Beaver See parserDocBlock, parserInclude, parserPage, parserClass See parserDefine, parserFunction, parserMethod, parserVar Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since separate file since version 1.2 License LGPL Filesource Source Code for this file
Class parserAccessTag
Generated by phpDocumentor v1.4.3 http://www.phpdoc.org - http://pear.php.net/package/PhpDocumentor - http://www.sourceforge.net/projects/phpdocu
[line 253]
Package phpDocumentor Sub-Package DocBlockTags Tutorial @access Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
set to true if the returned tag has a value type of private, protected or public, false otherwise
tag name
Constructor void function parserAccessTag::parserAccessTag($value) [line 276] Function Parameters:
checks $value to make sure it is private, protected or public, otherwise it's not a valid @access tag
See parserAccessTag::$isvalid
Class parserExampleTag
[line 1180]
represents "@example"
Package phpDocumentor Sub-Package DocBlockTags Tutorial @example Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
always "example"
Constructor void function parserExampleTag::parserExampleTag($value, $current_path) [line 1203] Function Parameters:
parserStringWithInlineTags $value tag value string $current_path path of file containing tag
this @example
Reads and parses the example file indicated The example tag takes one parameter: the full path to a php file that should be parsed and included as an example.
TODO does this "x = y = z = false" still work as expected in PHP5? TODO CS cleanup - rename constant to TOKENIZER_EXT Uses phpDocumentorTWordParser::getFileSource() - uses to parse an example and retrieve all tokens by line number
TODO CS cleanup - rename to convertSource for camelCase rule TODO what's up with all the "return" statements? can they _all_ be removed? Uses parserFileSourceTag::writeSource() Uses phpDocumentor_HighlightParser - highlights source code
Class parserFileSourceTag
[line 1061]
represents "@filesource" Use this to create a link to a highlighted phpxref-style source file listing
Package phpDocumentor Sub-Package DocBlockTags Tutorial @filesource Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.2 License LGPL
Always "filesource"
parserFileSourceTag::$path string = [line 1075] parserFileSourceTag::$source array = [line 1071] Constructor void function parserFileSourceTag::parserFileSourceTag($filepath, $value) [line 1090] Function Parameters:
phpDocumentorTWordParser::getFileSource()
TODO CS cleanup - rename to convert for camelCase rule Uses parserFileSourceTag::ConvertSource() - generate source code and write it out
TODO CS cleanup - rename to convertSource for camelCase rule TODO what's up with all the "return" statements? can they _all_ be removed? Usedby parserFileSourceTag::Convert() - generate source code and write it out Uses parserFileSourceTag::writeSource() Uses phpDocumentor_HighlightParser - highlights source code
Uses Converter::getSourceLink()
Converter &$c the output converter string $source highlighted source code
Usedby parserExampleTag::ConvertSource() Usedby parserFileSourceTag::ConvertSource() Uses Converter::writeSource() - export highlighted file source
Class parserLicenseTag
[line 789]
represents the "@see" tag Link to a license, instead of including lines and lines of license information in every file
Package phpDocumentor Sub-Package DocBlockTags Tutorial @license Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
always 'license'
Constructor void function parserLicenseTag::parserLicenseTag($name, $link) [line 803] Function Parameters:
Class parserLinkTag
[line 657]
Generated by phpDocumentor v1.4.3 http://www.phpdoc.org - http://pear.php.net/package/PhpDocumentor - http://www.sourceforge.net/projects/phpdocu
Package phpDocumentor Sub-Package DocBlockTags Tutorial @link Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.0rc1 License LGPL
always 'link'
Constructor void function parserLinkTag::parserLinkTag($link) [line 672] Function Parameters:
Class parserMethodTag
[line 545]
Package phpDocumentor Sub-Package DocBlockTags Tutorial @method Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.4.0a1 License LGPL
always 'method'
parserMethodTag::$returnType string = 'void' [line 556]
Class parserNameTag
[line 203]
Package phpDocumentor Sub-Package DocBlockTags Tutorial @name Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
tag name
Constructor void function parserNameTag::parserNameTag($name, $value) [line 217] Function Parameters:
string $name tag name (not used) string $value tag value
Class parserParamTag
[line 606]
Package phpDocumentor Sub-Package DocBlockTags Tutorial @param Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
always 'param'
Class parserPropertyReadTag
[line 493]
Package phpDocumentor Sub-Package DocBlockTags Tutorial @property Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.4.0a1 License LGPL
always 'property-read'
Class parserPropertyTag
[line 450]
Package phpDocumentor Sub-Package DocBlockTags Tutorial @property Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.4.0a1 License LGPL
always 'property'
parserPropertyTag::$returnType string = 'mixed' [line 461]
string $returnType the tag value's datatype parserStringWithInlineTags $value the tag value
Class parserPropertyWriteTag
[line 519]
Package phpDocumentor Sub-Package DocBlockTags Tutorial @property Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.4.0a1 License LGPL
always 'property-write'
Class parserReturnTag
[line 341]
Package phpDocumentor Sub-Package DocBlockTags Tutorial @return Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.0rc1 License LGPL
contains a link to the documentation for a class passed as a type in @return, @var or @param Example:
1 2 3 4 5 class myclass { ... }
In this case, $converted_returnType will contain a link to myclass instead of the string 'myclass'
Var either the same as $returnType or a link to the docs for a class See parserReturnTag::$returnType
always 'return'
parserReturnTag::$returnType mixed = 'void' [line 351]
the
given
output
converter
(sets
up
the
See parserStringWithInlineTags::Convert(), parserReturnTag::$converted_returnType TODO CS cleanup - rename to convert for camelCase rule
Class parserSeeTag
[line 704]
Package phpDocumentor Sub-Package DocBlockTags Tutorial @see Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor
Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.0rc1 License LGPL
always 'see'
Constructor void function parserSeeTag::parserSeeTag($name) [line 717] Function Parameters:
Class parserStaticvarTag
[line 631]
Generated by phpDocumentor v1.4.3 http://www.phpdoc.org - http://pear.php.net/package/PhpDocumentor - http://www.sourceforge.net/projects/phpdocu
Package phpDocumentor Sub-Package DocBlockTags Tutorial @staticvar Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
always 'staticvar'
Class parserTag
[line 62]
used to represent standard tags like @access, etc. This class is aware of inline tags, and will automatically handle them using inherited functions
Package phpDocumentor Sub-Package DocBlockTags Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.0rc1 License LGPL
Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' always '_tag'
Constructor void function parserTag::parserTag($keyword, $value, [$noparse = false]) [line 86] Function Parameters:
string $keyword tag name parserStringWithInlineTags $value tag value boolean $noparse whether to parse the $value
Set up the tag 1 function parserTag($keyword $value, $noparse= false) , 2 { 3 $this -> keyword = $keyword ; 4 if (!$noparse { ) 5 $parser = new parserDescParser; 6 $parser -> subscribe('*', $this ); 7 $parser -> parse( value-> $ value, true, 'parserstringwithinlinetags'); 8 } else { 9 $this -> value =$value; 10 } 11 }
Perform the output conversion on this parserTag using theoutput converter that is passed in
See parserStringWithInlineTags::getString()
integer $a not used array $desc array of parserStringWithInlineTags the tag description
representing paragraphs in
Class parserTutorialTag
[line 995]
represents "@tutorial" This is exactly like @see except that it only links to tutorials
Package phpDocumentor Sub-Package DocBlockTags Tutorial phpDocumentor Tutorials Tutorial @tutorial Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.2 License LGPL
Always "tutorial"
string|bool function parserTutorialTag::Convert(&$converter) [line 1012] Function Parameters:
Class parserUsedByTag
[line 932]
This is a virtual tag, it is created by @uses to cross-reference the used element This is exactly like @uses.
Package phpDocumentor Sub-Package DocBlockTags Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.2 License LGPL
Always "usedby"
Constructor void function parserUsedByTag::parserUsedByTag($link, $description) [line 950] Function Parameters:
abstractLink $link link of element that uses this element string $description description of how the element is used
Class parserUsesTag
[line 838]
represents the "@uses" tag This is exactly like @see except that the element used has a @useby link to this element added to its docblock
Package phpDocumentor Sub-Package DocBlockTags Tutorial @uses Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.2 License LGPL
Always "uses"
Constructor void function parserUsesTag::parserUsesTag($seeel, $description) [line 857] Function Parameters:
Return a link to documentation for other element, and description of how it is used Works exactly like parent::Convert() except that it also includes a description of how the element used is used.
Class parserVarTag
[line 576]
Package phpDocumentor Sub-Package DocBlockTags Tutorial @var Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.0rc1 License LGPL
always 'var'
parserVarTag::$returnType string = 'mixed' [line 587]
Errors.inc
Error handling for phpDocumentor phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2001-2008 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Errors Author Greg Beaver < [email protected]> Version CVS: $Id: Errors.inc 253641 2008-02-24 02:35:44Z ashnazg $ Copyright 2001-2008 Gregory Beaver See parserDocBlock, parserInclude, parserPage, parserClass See parserDefine, parserFunction, parserMethod, parserVar Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 0.4 License LGPL Filesource Source Code for this file
Name $phpDocumentor_errors
$phpDocumentor_error_descrip array = array( PDERROR_UNTERMINATED_INLINE_TAG => 'Inline tag {@%s} in tag %s is unterminated, "%s"' , PDERROR_CLASS_EXISTS => 'Class %s already exists in package "%s"' , PDERROR_CONVERTER_NOT_FOUND => 'Converter %s specified by --output command-line option is not a class' , PDERROR_NO_CONVERTERS => 'No Converters have been specified by --output command-line option' , PDERROR_ACCESS_WRONG_PARAM => '@access was passed neither "public" nor "private." Was passed: "%s"' , PDERROR_MULTIPLE_ACCESS_TAGS => 'DocBlock has multiple @access tags, illegal. ' . 'ignoring additional tag "@access %s"' , PDERROR_MULTIPLE_RETURN_TAGS => 'DocBlock has multiple @return tags, illegal. ' . 'ignoring additional tag "@return %s %s"' , PDERROR_MULTIPLE_VAR_TAGS => 'DocBlock has multiple @var tags, illegal. ' . 'ignoring additional tag "@var %s %s"' , PDERROR_MULTIPLE_PACKAGE_TAGS => 'DocBlock has multiple @package tags, illegal. ' . 'ignoring additional tag "@package %s"' , PDERROR_MULTIPLE_SUBPACKAGE_TAGS => 'DocBlock has multiple @subpackage tags, illegal. ' . 'ignoring additional tag "@subpackage %s"' , PDERROR_ILLEGAL_PACKAGENAME => '@%s tag has illegal %s name "%s"' , PDERROR_OVERRIDDEN_PACKAGE_TAGS => '%s %s\'s DocBlock has @package tag, illegal. ' . 'ignoring tag "@package %s"' , PDERROR_OVERRIDDEN_SUBPACKAGE_TAGS => '"%s" %s\'s DocBlock has @subpackage tags, illegal. ' . 'ignoring tag "@subpackage %s"' , PDERROR_CLASS_CONFLICT => 'class "%s" has multiple declarations in package %s, ' . 'in file %s and file %s, documentation will have output errors!' ,
PDERROR_MULTIPLE_NAME_TAGS => 'DocBlock has multiple @name tags, illegal. ' . 'ignoring additional tag "@name %s"' , PDERROR_PACKAGEOUTPUT_DELETES_PARENT_FILE => '-po (packageoutput) option deletes parent file "%s" containing class' . ' "%s."' . "\n" . ' Try using --defaultpackagename (-dn) %s to ' . 'include the parent file in the same package as the class' , PDERROR_GLOBAL_NOT_FOUND => 'global variable %s specified in @global tag was never found' , PDERROR_MULTIPLE_GLOBAL_TAGS => '@global define tag already used for global variable "%s", ' . 'ignoring @global %s' , PDERROR_MALFORMED_GLOBAL_TAG => 'incorrect @global syntax. ' . 'Should be @global vartype $varname or @global vartype description' , PDERROR_UNKNOWN_COMMANDLINE => 'Unknown command-line option "%s" encountered, use phpdoc -h for help' , PDERROR_NEED_WHITESPACE => 'phpDocumentor programmer error - wordparser whitespace set to false ' . 'in handleDocBlock, notify developers. You should never see this error' , PDERROR_SOURCE_TAG_FUNCTION_NOT_FOUND => '{@source} tag used in a docblock that isn\'t preceding a function' , PDERROR_UNMATCHED_LIST_TAG => 'unmatched ol or ul tag in DocBlock, parsing will be incorrect' , PDERROR_CANT_NEST_IN_B => 'Can\'t nest a code, pre, ul, or ol tag in a b tag in ' . 'phpDocumentor DocBlock (%s tag nested)' , PDERROR_UNMATCHED_TUTORIAL_TAG => 'While parsing extended documentation, "%s" tag was matched ' . 'with "%s" endtag, missing endtag'."\ntag contents:\"%s\"" , PDERROR_CANT_HAVE_INLINE_IN_TAGNAME => 'Can\'t have an inline tag inside a package page XML tag!' , PDERROR_TUTORIAL_IS_OWN_CHILD => 'Tutorial %s lists itself as its own child in %s, illegal' , PDERROR_TUTORIAL_IS_OWN_GRANDPA => 'Tutorial %s\'s child %s lists %s as its child in %s, illegal' , PDERROR_PDFFUNCTION_NO_FUNC => 'Invalid pdffunction syntax: "<pdffunction: />", ' . 'should be "<pdffunction:functionname [arg="value"...]/>"' , PDERROR_PDF_TEMPVAR_DOESNT_EXIST => '<pdffunction:%s arg=%s /> called ' .
'but temporary variable "%s" doesn\'t exist' , PDERROR_UNTERMINATED_ATTRIB => 'Tutorial tag %s attribute %s is unterminated, current value "%s"' , PDERROR_NO_CONVERTER_HANDLER => 'Handler for element of type "%s" called, but %s is not a method of %s' , PDERROR_INLINETAG_IN_SEE => 'Inline tags are not allowed in a @see tag' , PDERROR_ID_MUST_BE_INLINE => '<%s id="%s"> must be <%s id="{@id %s}">' , PDERROR_INTERNAL_NOT_CLOSED => '{@internal was never terminated with }}' , PDERROR_CONVERTER_OVR_GFCT => 'Converter "%s" must override getFormattedClassTrees() but doesn\'t' , PDERROR_TEXT_OUTSIDE_LI => 'Text cannot be outside of li tag in a DocBlock list, ' . 'parsing will be incorrect' , PDERROR_UNCLOSED_TAG => 'Unclosed %s tag in DocBlock, parsing will be incorrect' , PDERROR_TAG_NOT_HANDLED => '"%s" tag is not available in PHP built without tokenizer support, tag ignored' , PDERROR_MALFORMED_TAG => '"%s" tag was used without any parameters, illegal' , PDERROR_MULTIPLE_CATEGORY_TAGS => 'package has multiple @category tags, ignoring "@category %s"' , PDERROR_TEMPLATEDIR_DOESNT_EXIST => 'template directory "%s" does not exist' , PDERROR_UNTERMINATED_ENTITY => 'entity &%s is unterminated' , PDERROR_FUNCTION_HAS_NONAME => 'function has no name (PHP error - test your file before parsing!)' , PDERROR_CANNOT_EXTEND_SELF => 'class %s cannot extend itself - TEST YOUR CODE BEFORE PARSING' , PDERROR_DUMB_USES => '@uses can only link to string data' , PDERROR_UL_IN_UL => 'ul/ol tags cannot be directly nested inside ul/ol, nest inside li' , PDERROR_INVALID_VALUES => 'command %s was passed "%s" but must be one of %s' , PDERROR_NESTED_INTERNAL =>
'{@internal}} cannot be nested inside {@internal}}' , PDERROR_DANGEROUS_PHP_BUG_EXISTS => 'Dangerous PHP Bug exists in PHP version %s that can be triggered ' . 'by this parse (see PHP Bug #%s and PEAR Bug #%s)' , PDERROR_LOOP_RECURSION_LIMIT_REACHED => 'An internal loop in PhpDocumentor has reached its preset ' . 'recursion limit, preventing a possible infinite loop condition.' ) [line 555]
Name $phpDocumentor_error_descrip
$phpDocumentor_warning_descrip array = array( PDERROR_MULTIPLE_PARENT => 'Class %s has multiple possible parents, package inheritance aborted' , PDERROR_PARENT_NOT_FOUND => 'Class %s parent %s not found' , PDERROR_INHERITANCE_CONFLICT => 'Class %s in file %s has multiple possible parents named %s. ' . 'Cannot resolve name conflict,' . "\n" . ' try ignoring a file that contains the conflicting parent class' , PDERROR_UNKNOWN_TAG => 'Unknown tag "@%s" used' , PDERROR_IGNORE_TAG_IGNORED => '@ignore tag used for %s element "%s" will be ignored' , PDERROR_ELEMENT_IGNORED => "\n" . 'duplicate %s element "%s" in file %s will be ignored.' . "\n" . 'Use an @ignore tag on the original ' . 'if you want this case to be documented.' , PDERROR_PARSEPRIVATE => "entire page %s ignored because of @access private." . "\n" . "Choose -pp to enable parsing of private elements" , PDERROR_CLASS_PARENT_NOT_FOUND => "class %s in package %s parent not found in @see parent::%s" , PDERROR_CLASS_NOT_IN_PACKAGE => "class %s was not found in package %s"
, PDERROR_DB_TEMPLATE_UNTERMINATED => 'docblock template never terminated with /**#@-*/' , PDERROR_PDF_METHOD_DOESNT_EXIST => '<pdffunction:%s /> called, but pdf method "%s" doesn\'t exist' , PDERROR_TUTORIAL_NOT_FOUND => "tutorial \"%s\" not found, does it exist?" , PDERROR_CHILD_TUTORIAL_NOT_FOUND => 'child tutorial "%s" listed in %s not found ' . 'in parent package "%s" subpackage "%s"' , PDERROR_TUTORIAL_SUBSECTION_NOT_FOUND => 'tutorial %s subsection "%s" doesn\'t exist, ' . 'but its title was asked for' , PDERROR_NO_PACKAGE_TAG => 'no @package tag was used in a DocBlock for %s %s' , PDERROR_PRIVATE_ASSUMED => '%s "%s" is assumed to be @access private because its name ' . 'starts with _, but has no @access tag' , PDERROR_EXAMPLE_NOT_FOUND => 'example file "%s" does not exist' , PDERROR_SOURCE_TAG_IGNORED => '{@source} can only be used in the long description, ' . 'not in the short description: "%s"' , PDERROR_PACKAGECAT_SET => 'package %s is already in category %s, ' . 'will now replace with category %s' , PDERROR_SOURCECODE_IGNORED => 'sourcecode command-line option is ignored ' . 'when your PHP build has no tokenizer support' , PDERROR_INHERITDOC_DONT_WORK_HERE => '{@inheritdoc} can only be used in the docblock of a child class' , PDERROR_EMPTY_EXAMPLE_TITLE => 'Example file found at "%s" has no title, using "%s"' , PDERROR_DOCBLOCK_CONFLICT => 'Page-level DocBlock precedes "%s %s", ' . 'use another DocBlock to document the source element' , PDERROR_NO_PAGE_LEVELDOCBLOCK => 'File "%s" has no page-level DocBlock, ' . 'use @package in the first DocBlock to create one' , PDERROR_DOCBLOCK_GOES_CLASS => 'DocBlock would be page-level, but precedes class "%s", ' . 'use another DocBlock to document the file' , PDERROR_NO_DOCBOOK_ID =>
'Tutorial section %s "%s" has no id="{@id subsection}" tag ' . '({@id} for refentry)' , PDERROR_BEAUTIFYING_FAILED => 'Beautifying failed: %s' , PDERROR_NOTODO_INCLUDE => '@todo on an include element is ignored (line %s, file %s)' , PDERROR_UNDOCUMENTED_ELEMENT => '%s "%s" has no %s-level DocBlock.' , PDERROR_MISSING_PROPERTY_TAG_NAME => '@%s magic tag does not have name, illegal. Ignoring tag "@%s %s %s"' , PDERROR_NAME_ALIAS_SAME_AS_TARGET => '@name value is the same as the filename it is supposed to alias' ) [line 433]
Name $phpDocumentor_warning_descrip
integer $num error number from Errors.inc string $data... up to 4 string parameters to sprintf() error number $num
add an Error
See ErrorTracker::addError() TODO CS Cleanup - do I need to add $data to the method signature?
integer $num error number from Errors.inc string $data... up to 4 string parameters to sprintf() error number $num
Global Variable Used ErrorTracker $phpDocumentor_errors: repository for all errors generated by phpDocumentor See ErrorTracker::addError() TODO CS Cleanup - do I need to add $data to the method signature?
integer $num warning number from Errors.inc string $data... up to 4 string parameters to sprintf() error number $num
add a Warning
Global Variable Used ErrorTracker $phpDocumentor_errors: repository for all errors generated by phpDocumentor See ErrorTracker::addWarning() TODO CS Cleanup - do I need to add $data to the method signature?
warning triggered when the arguments to @access are neither public nor private
PDERROR_BEAUTIFYING_FAILED = 66 [line 343]
warning triggered when an inline tag is found inside an xml tag name in a package page
warning triggered when another tag is nested in <b> (not allowed in phpDocumentor)
warning triggered when a tutorial's child in the .ini file doesn't exist in the package and subpackage of the parent
warning triggered when classes in the same package have the same name
PDERROR_CLASS_EXISTS = 4 [line 59]
warning triggered when inheritance could be from more than one class
PDERROR_CLASS_NOT_IN_PACKAGE = 30 [line 176]
warning triggered when a getClassByPackage is called and can't find the class
PDERROR_CLASS_PARENT_NOT_FOUND = 29 [line 172]
warning triggered when the PHP version being used has dangerous bug/behavior
PDERROR_DB_TEMPLATE_UNTERMINATED = 32 [line 186]
warning triggered when a docblock template is never turned off with /**#@-* / (no space)
warning triggered when the first docblock in a file with a @package tag precedes a class. In this case, the class gets the docblock.
PDERROR_DUMB_USES = 73 [line 388]
blah"
warning triggered when a duplicate element is encountered that will be ignored by the documentor
warning triggered when an example's path from @example /path/to/example.php is not found
warning triggered when an id attribute in a tutorial docbook tag is not an {@id} inline tag
warning triggered when an @ignore tag is used in a DocBlock preceding a method, variable, include, or global variable
warning triggered when inheritance could be from more than one class
PDERROR_INHERITDOC_DONT_WORK_HERE = 62 [line 327]
warning triggered when an example's path from @example /path/to/example.php is not found
warning triggered if a command line option does not have a valid value passed in
PDERROR_LOOP_RECURSION_LIMIT_REACHED = 82 [line 426]
warning triggered when the a loop recursion tripwire has been tripped
PDERROR_MALFORMED_GLOBAL_TAG = 23 [line 143]
warning triggered when any of {@property}}, {@property-read}}, {@property-write}}, or {@method}} tag does not have name
warning triggered when inheritance could be from more than one class
PDERROR_MULTIPLE_RETURN_TAGS = 10 [line 85]
warning triggered when the alias value in an page-level docblock's @name tag is the same value as the target filename is it supposed to alias
warning triggered when an example's path from @example /path/to/example.php is not found
warning triggered when there a @package tag is used in a function, define, method, var or include
warning triggered when there a @subpackage tag is used in a function, define, method, var or include
warning triggered when a package is already associated with a category, and a new association is found
warning triggered when a <pdffunction:funcname /> tag is used in the PDF Converter and no funcname is present (<pdffunction: />)
warning triggered when a <pdffunction:funcname /> tag is used in the PDF Converter and funcname is not a Cezpdf method
warning triggered when a <pdffunction:funcname arg=$tempvar/> tag is used in the PDF Converter and "tempvar" is not set from the return of a previous pdffunction tag
warning triggered when no @access private tag is used in a global variable/method/var with _ as first char in name and --pear was specified
warning triggered when a { @source } inline tag is used in a docblock not preceding a function
warning triggered when text in a docblock list is not contained in an <li> opening tag
warning triggered when a tutorial's child lists the parent tutorial as a child tutorial
warning triggered when a tutorial is referenced via @tutorial/{ @tutorial} and is not found
warning triggered when a subsection's title is asked for, but the subsection is not found
warning triggered when classes in the same package have the same name
PDERROR_UNMATCHED_LIST_TAG = 33 [line 190]
warning triggered when a subsection's title is asked for, but the subsection is not found
warning triggered when an {@inline tag} is not terminated (no } before the * / ending the comment)
Class ErrorTracker
[line 894]
Package phpDocumentor Sub-Package Errors Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2001-2008 Gregory Beaver See ErrorTracker::$errors, ErrorTracker::$warnings
Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor License LGPL
ErrorTracker::$curfile string = '' [line 909] ErrorTracker::$errors array = array() [line 900]
array ofRecordError s
ErrorTracker::$lasterror integer|false = false [line 919]
array ofRecordWarning s
void function ErrorTracker::addError($num, $data...) [line 993] Function Parameters:
integer $num error number from Errors.inc string $data... up to 4 string parameters to sprintf() error number $num
integer $num error number from Errors.inc string $data... up to 4 string parameters to sprintf() error number $num
add a new error to the $errorsarray and returns the error string
integer $num error number from Errors.inc string $data... up to 4 string parameters to sprintf() error number $num
integer $num parser-passed event (see PHPDOCUMENTOR_EVENT_NEWLINENUM, PHPDOCUMENTOR_EVENT_NEWFILE) mixed $data either a line number if $num is PHPDOCUMENTOR_EVENT_NEWLINENUM or a file name if $num is PHPDOCUMENTOR_EVENT_NEWFILE
This function subscribes to two events in the Parser in order to keep track of line number information and file name.
array function ErrorTracker::returnErrors() [line 1045]
Class RecordError
[line 843]
Package phpDocumentor Sub-Package Errors Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2001-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor License LGPL
Class RecordWarning
[line 746]
Package phpDocumentor Sub-Package Errors Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2001-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor License LGPL
error string
RecordWarning::$file
error number
See Errors.inc
string $file filename this error occurred in ($file) integer $linenum line number this error occurred on ($linenum) integer $num Error number defined in Errors.inc string $data... variable number of strings, up to 4,
Constructor
TODO CS Cleanup - do I need to add $data to the method signature? sprintf based on the error number
to
InlineTags.inc
All abstract representations of inline tags are in this file phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2008 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package InlineTags Author Gregory Beaver < [email protected]> Version CVS: $Id: InlineTags.inc 286921 2009-08-08 05:01:24Z ashnazg $ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since separate file since 1.2 Filesource Source Code for this file License LGPL
Class parserExampleInlineTag
[line 567]
Represents the example inline tag, used to display an example file docblock or tutorial
inside a
Package phpDocumentor Sub-Package InlineTags Tutorial inline {@example} Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver See parserStringWithInlineTags Link http://www.phpdoc.org Link http://pear.php.net/PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* TODO CS cleanup - change package to PhpDocumentor License LGPL
Constructor mixed function parserExampleInlineTag::parserExampleInlineTag($value, $current_path, [$isTutorial = false]) [line 582] Function Parameters:
string $value format "filepath[ start [end]]" where start and end are line numbers with the end line number optional string $current_path full path to the current file, used to check relative directory locations bool $isTutorial if true, then this is in a tutorial
constructor
Return the source for the example file, enclosed in a <programlisting> tag to use in a tutorial
void function parserExampleInlineTag::setSource($source, [$class = false]) [line 719] Function Parameters:
string|array $source source code string|bool $class class name if this is a method, if this is a method this will be true
Class parserIdInlineTag
[line 835]
Package phpDocumentor Sub-Package InlineTags Tutorial inline {@id} Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver See parserStringWithInlineTags Link http://www.phpdoc.org Link http://pear.php.net/PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* TODO CS cleanup - change package to PhpDocumentor License LGPL
section/subsection name
parserIdInlineTag::$inlinetype string = 'id' [line 841]
always 'id'
parserIdInlineTag::$package string = 'default' [line 846]
string $category category name string $package package name string $subpackage subpackage name string $tutorial tutorial name
constructor
string function parserIdInlineTag::Convert(&$c) [line 895] Function Parameters:
converter
TODO CS cleanup - rename to convert for camelCase rule Uses Converter::getTutorialId() - retrieve converter-specific ID
Class parserInheritdocInlineTag
[line 789]
Represents the inheritdoc inline tag, used by classes/methods/vars to inherit documentation from the parent class if possible
Package phpDocumentor Sub-Package InlineTags Tutorial inline {@inheritdoc} Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver See parserStringWithInlineTags Link http://www.phpdoc.org Link http://pear.php.net/PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* TODO CS cleanup - change package to PhpDocumentor License LGPL
always 'inheritdoc'
Constructor void function parserInheritdocInlineTag::parserInheritdocInlineTag() [line 800]
Class parserInlineTag
[line 61]
Package phpDocumentor Sub-Package InlineTags Tutorial phpDocumentor Inline tags Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver See parserStringWithInlineTags Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.0rc1 License LGPL
always "inlinetag"
string $type tag type (example: link) string $value tag value (example: what to link to)
See parserStringWithInlineTags::getString() See parserStringWithInlineTags::trimmedStrlen() Usedby parserStringWithInlineTags::getString() - removes inline tag length, as it is indeterminate until conversion.
Class parserLinkInlineTag
[line 142]
Package phpDocumentor Sub-Package InlineTags Tutorial inline {@link} Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver See parserStringWithInlineTags Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.0rc1 License LGPL
text to display in the link, can be different from the link for standard links like websites
string $link stored in $value, see parserBase::$value string $text see $linktext
Converter &$c the output converter string $value the tag value
Class parserSourceInlineTag
[line 377]
Package phpDocumentor Sub-Package InlineTags Tutorial inline {@source} Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver See parserStringWithInlineTags Link http://www.phpdoc.org Link http://pear.php.net/PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* TODO CS cleanup - change package to PhpDocumentor License LGPL
Var If '*' then the whole source will be used, otherwise numbers will be displayed
always 'source'
parserSourceInlineTag::$source string|array = false [line 401]
tokenized source organized by line numbers for php 4.3.0+, the old {@source} tag used a string
See parserSourceInlineTag::$end
string $value format "start [end]", where start and end are line numbers with the end line number optional
constructor
string function parserSourceInlineTag::arrayConvert(&$c) [line 497] Function Parameters:
Usedby parserSourceInlineTag::Convert() - in PHP 4.3.0+, this method is used to convert Uses phpDocumentor_HighlightParser - Parses the tokenized source
TODO CS cleanup - rename to convert for camelCase rule Uses parserSourceInlineTag::stringConvert() - in PHP 4.2.3-, this method is used to convert
string|array $source source code string|bool $class class name if this is a method, if this is a method this will be true
Deprecated in favor of PHP 4.3.0+ arrayConvert() Usedby parserSourceInlineTag::Convert() - in PHP 4.2.3-, this method is used to convert Uses Converter::unmangle() - remove the extraneous stuff from http://www.php.net/highlight_string
only used to determine blank lines. {@source} will not be blank, probably
Class parserTocInlineTag
Generated by phpDocumentor v1.4.3 http://www.phpdoc.org - http://pear.php.net/package/PhpDocumentor - http://www.sourceforge.net/projects/phpdocu
[line 923]
Package phpDocumentor Sub-Package InlineTags Tutorial inline {@toc} Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver See parserStringWithInlineTags Link http://www.phpdoc.org Link http://pear.php.net/PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* TODO CS cleanup - change package to PhpDocumentor License LGPL
always 'toc'
Constructor void function parserTocInlineTag::parserTocInlineTag() [line 956]
constructor
mixed function parserTocInlineTag::Convert(&$c) [line 1015] Function Parameters:
converter method array( 'tagname' => string name of tag, 'link' => tutorialLink to the tutorial, 'id' => converter specific tutorial ID from Converter::getTutorialId() 'title' => title of the tutorial) and returns the results as the table of contents
TODO CS cleanup - rename to convert for camelCase rule Uses Converter::getTutorialId() - retrieve the tutorial ID for Uses Converter::formatTutorialTOC() - passes an array of format:
array $toc format: array( array( 'tag' => parserXMLDocBookTag, 'id' => parserIdInlineTag, 'title' => title ), ... )
Class parserTutorialInlineTag
[line 278]
Package phpDocumentor Sub-Package InlineTags Tutorial inline {@tutorial} Author Gregory Beaver < [email protected]>
Version Release: @VER@ Copyright 2002-2008 Gregory Beaver See parserStringWithInlineTags Link http://www.phpdoc.org Link http://pear.php.net/PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* TODO CS cleanup - change package to PhpDocumentor License LGPL
string $link stored in $value, see parserBase::$value string $text see $linktext
constructor
mixed function parserTutorialInlineTag::Convert(&$c) [line 302] Function Parameters:
LinkClasses.inc
Linking to element documentation is performed by the classes in this file. abstractLink descendants contain enough information to differentiate every documentable element, and so can be converted to a link string by Converter::returnSee() phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2008 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Links Author Gregory Beaver < [email protected]> Version CVS: $Id: LinkClasses.inc 253641 2008-02-24 02:35:44Z ashnazg $ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.2.0 Filesource Source Code for this file License LGPL
Class abstractLink
[line 61]
Package phpDocumentor Sub-Package Links Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
abstractLink::$category string = '' [line 77] abstractLink::$fileAlias string = '' [line 70]
void function abstractLink::addLink($path, $fileAlias, $name, $package, $subpackage, [$category = false]) [line 94] Function Parameters:
string $path full path to file containing element string $fileAlias page name, as configured by Parser::parse string $name element name string $package package element is in string $subpackage subpackage element is in string $category optional category that documentation is in
Class classLink
[line 213]
class link
Package phpDocumentor Sub-Package Links Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
Class constLink
[line 307]
Package phpDocumentor Sub-Package Links Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
Class defineLink
[line 167]
define link
Package phpDocumentor Sub-Package Links Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
Class functionLink
[line 144]
function link
Package phpDocumentor Sub-Package Links Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
Class globalLink
[line 190]
Package phpDocumentor Sub-Package Links Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_*
License LGPL
Class methodLink
[line 236]
method link
Package phpDocumentor Sub-Package Links Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
methodLink::$class string = '' [line 245] methodLink::$type string = 'method' [line 241] void function methodLink::addLink($class, $path, $fileAlias, $name, $package, $subpackage, [$category = false]) [line 260] Function Parameters:
string $class class name string $path full path to file containing element string $fileAlias page name, as configured by Parser::parse string $name element name string $package package element is in string $subpackage subpackage element is in string $category optional category that documentation is in
Class pageLink
[line 121]
Package phpDocumentor Sub-Package Links Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
Class tutorialLink
[line 330]
tutorial link
Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
tutorialLink::$section string = '' [line 336] tutorialLink::$title string = false [line 337] tutorialLink::$type string = 'tutorial' [line 335] void function tutorialLink::addLink($section, $path, $name, $package, $subpackage, [$title = false], [$category = false]) [line 353] Function Parameters:
string $section section/subsection name string $path full path to file containing element string $name page name, as configured by Parser::parse string $package package element is in string $subpackage subpackage element is in string $title title of tutorial string $category optional category that documentation is in
Class varLink
[line 284]
Package phpDocumentor
Sub-Package Links Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
ParserData.inc
Parser Data Structures phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2008 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package ParserData Author Gregory Beaver < [email protected]> Version CVS: $Id: ParserData.inc 253814 2008-02-26 12:15:56Z ashnazg $ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.0rc1 License LGPL
Class parserBase
[line 710]
Package phpDocumentor Sub-Package ParserData Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Abstract Element Since 1.0rc1 License LGPL
Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah'... always base
Abstract Element
Class parserData
[line 363]
Contains an in-memory representation of all documentable elements ( parserPage , parserFunction, parserDefine, parserInclude, parserClass, parserMethod, parserVar) and their DocBlocks (parserDocBlock). This class works in coordination with phpDocumentor_IntermediateParser to take output from Parser::handleEvent() and create indexes, links, and other assorted things (all documented in phpDocumentor_IntermediateParser and Converter)
Package phpDocumentor Sub-Package ParserData Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.0rc1 License LGPL
used byphpDocumentor_IntermediateParser::handleDocBlock() to determine whether a docblock is a page-level docblock or not. $clean is true as long
as only 0 or 1 docblock has been parsed, and no element other than parserPage has been parsed
parserData::$tutorial parserTutorial|false = false [line 400] parserData::$type string = 'page' [line 438]
always 'page', used in element indexing and conversion functions found in Converter
parserElement &$element add a parsed element to the array, also sets $clean to false
$elements
parserElement &$element element to add a new link (descended from abstractLink) to the $links array string $classorpackage classname for elements that are classbased (this may be deprecated in the future, as the classname should be contained within the element. if $element is a page, this parameter is a package name string $subpackage subpackage name for page elements
adds a link
void function parserData::addTutorial($t, &$c) [line 499] Function Parameters:
returns a link
string function parserData::getName() [line 650]
If this file has a tutorial associated with it, returns a link to the tutorial.
boolean function parserData::hasClasses() [line 486]
See parserDocBlock
Class parserPage
[line 59]
Contains information about a PHP file, used to group procedural elements together.
Package phpDocumentor Sub-Package ParserData Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.0rc1
License LGPL
parserPage::$category string = 'default' [line 97] parserPage::$file string = '' [line 76]
not implemented in this version, will be used to link xml output pages
parserPage::$modDate string = '' [line 115]
not implemented yet file modification date, will be used for makefiles
original phpdoc-safe name (only letters, numbers and _) This fixes [ 1391432 ] Too many underscores in include links.
parserPage::$package string = 'default' [line 101] parserPage::$packageOutput mixed = false [line 132]
Used to limit output, contains contents of --packageoutput commandline. Does not increase parsing time. Use --ignore for that
parserPage::$parserVersion string = PHPDOCUMENTOR_VER [line 109] parserPage::$path string = '' [line 119]
See phpDocumentor_IntermediateParser::$packageoutput
Converter $c the output converter bool $pearize if this parameter is true, to the subdirectory of pear
TODO determine if the str_replace in the 'pear/' ELSE branch should be removed (see Documentation/tests/bug1574043.php). It does NOT exist in the similar function parserClass->getSourceLocation() in ParserElements.inc.
Sets the name to display in documentation (can be an alias set with @name)
void function parserPage::setName($name) [line 261] Function Parameters:
set by
See Parser::parse()
See phpDocumentor_IntermediateParser::$packageoutput
Sets the source code of the file for highlighting. PHP 4.3.0+ passes an array of tokenizer tokens by line number. PHP 4.2.3- passes a string to be passed to http://www.php.net/highlight_string
Class parserStringWithInlineTags
[line 776]
Used to represent strings that contain inline tags, so that they can be properly parsed at link time
Package phpDocumentor Sub-Package ParserData Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.0rc1 License LGPL
the
hassle
of
if
Function Parameters:
Converter &$converter the output converter bool $postprocess true if one needs to postprocess bool $trim false if the output should not be trimmed
Use to convert the string to a real string with all inline tags parsed and linked
return the string unconverted (all inline tags are taken out - this should only be used in pre-parsing to see if any other text is in the string)
Function Parameters:
Pass source code to any {@source} tags contained within the string conversion.
integer function parserStringWithInlineTags::trimmedStrlen() [line 868]
for later
equivalent to trim(strlen($string))
ParserDocBlock.inc
DocBlock Parser Classes phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package ParserDocBlock Author Gregory Beaver < [email protected]> Version CVS: $Id: ParserDocBlock.inc 287886 2009-08-30 05:31:05Z ashnazg $ Copyright 2002-2006 Gregory Beaver See Parser, WordParser Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.0rc1 License LGPL
Class parserDesc
[line 47]
Package phpDocumentor Sub-Package ParserDocBlock Author Greg Beaver < [email protected]> Version $Id: ParserDocBlock.inc 287886 2009-08-30 05:31:05Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.0rc1
the
hassle
of
if
mixed $stringOrClass like parserStringWithInlineTags::add(), this can be a string or parserInlineTag, but it can also be a parserStringWithInlineTags, and the contents will be merged
boolean function parserDesc::hasInheritDoc() [line 81] boolean function parserDesc::hasSource() [line 92] void function parserDesc::replaceInheritDoc($desc) [line 104] Function Parameters:
Class parserDocBlock
Generated by phpDocumentor v1.4.3 http://www.phpdoc.org - http://pear.php.net/package/PhpDocumentor - http://www.sourceforge.net/projects/phpdocu
[line 129]
Represents a docblock and its components, $desc, $sdesc $tags, and also , $params for functions
Package phpDocumentor Sub-Package ParserDocBlock Author Greg Beaver < [email protected]> Version $Id: ParserDocBlock.inc 287886 2009-08-30 05:31:05Z ashnazg $ Since 1.0rc1
parserDocBlock::$category string = [line 219] parserDocBlock::$desc parserDesc = false [line 134] parserDocBlock::$endlinenumber false|integer = false [line 158]
Since 1.2
Usedby parserDocBlock::setExplicitCategory()
parserDocBlock::$explicitpackage
Usedby parserDocBlock::setExplicitPackage()
array of global variable data. Format: array(index of global variable in @global tag list -OR- global variable name => array(datatype,parserStringWithInlineTags),...)
Since 1.2
array of param data. Format: array(index of param in function parameter list -OR- parameter name => parserStringWithInlineTags,...)
array of static variable data. Format: array(index of static variable in @global tag list -OR- static variable name => parserStaticvarTag,...)
parserDocBlock::$subpackage string = '' [line 223] parserDocBlock::$subpackagedescrip string = '' [line 243]
array ofparserTag s
parserDocBlock::$unknown_tags array = array() [line 168]
string $value contents of the tag string $path path to the file containing this tag
string $path full path to the file array $source tokenized source code, ordered by line number
Tutorial @filesource
string $type global type string $value description of how the global is used in the function
string $keyword tag name parserStringWithInlineTags $value the contents of the tag
Global Variable Used array $_phpDocumentor_setting: used to determine whether to add the @internal tag or not
string $link
mixed $value either a string or a parserStringWithInlineTags. Strips all inline tags and use the text as the package
string $paramVar if empty, param is indexed in the order received and set using changeParam() parserStringWithInlineTags $value $paramType
void function parserDocBlock::addProperty($tagName, $propertyName, $propertyType, $value) [line 1033] Function Parameters:
string $returnType the one-word name of the return type (mixed should be used if more than one type) parserStringWithInlineTags $value
string $staticvar if empty, staticvar is indexed in the order received and set using changeStatic() string $type data type parserStringWithInlineTags $descrip
Global Variable Used array $_phpDocumentor_setting: used to determine whether to add ignored tags, or not
adds an unknown tag to the $unknown_tags array for use by custom converters
void function parserDocBlock::addUses($seeel, $description) [line 1024] Function Parameters:
string $seeel @see-style text, used for Converter::getLink() parserStringWithInlineTags $description description of how the used element is used
Tutorial @uses
string $varType the one-word name of the variable type (mixed should be used if more than one type) parserStringWithInlineTags $value
Tells the DocBlock it can have a @filesource tag Only page-level DocBlocks may have a @filesource tag
Tells the DocBlock it can't have a @filesource tag Only page-level DocBlocks may have a @filesource tag
integer $index index of parameter in the $funcglobals array string $name name of the parameter to set in the $funcglobals array
integer $index index of parameter in the $params array string $name name of the parameter to set in the $params array string|null $type type of the parameter
integer $index index of parameter in the $statics array string $name name of the parameter to set in the $statics array
Converter &$converter takes $desc and converts it to a string and returns it if present, otherwise returns ''
string $keyword
Converter &$converter takes $sdesc and converts it to a string and returns it if present, otherwise returns ''
string function parserDocBlock::getType() [line 1141] boolean function parserDocBlock::hasInheritDoc() [line 453]
Wrapper forparserDesc::hasInheritDoc()
array function parserDocBlock::listParams() [line 1091] array function parserDocBlock::listProperties() [line 1109] void function parserDocBlock::listTags(0) [line 1125] Function Parameters:
Converter 0
void function parserDocBlock::overridePackage($category, $package, $subpackage, $elname, $type) [line 666] Function Parameters:
string $category string $package string $subpackage string $elname element name string $type element type (include, define, var, method, global, function, const)
set
the element's package to the passed values. Used in phpDocumentor_IntermediateParser to align package of elements inside a class or procedural page to the package of the class/procedural page
Parse out any html tags from doc comments, and make them into abstract structures
Uses parserDescParser::parse()
parserDesc $desc
Wrapper forparserDesc::replaceInheritDoc()
void function parserDocBlock::resetParams() [line 528] void function parserDocBlock::setDesc($desc) [line 438] Function Parameters:
integer $number
Used if this docblock has a @category tag. phpDocumentor will guess category for DocBlocks that don't have a @category tag
Uses parserDocBlock::$explicitcategory
Used if this docblock has a @package tag. phpDocumentor will guess package for DocBlocks that don't have a @package tag
Uses parserDocBlock::$explicitpackage
integer $number
Set the short description of the DocBlock Setting the short description is possible by passing in one of three parameters: another DocBlock's short description another DocBlock, the short description will be extracted a Zend Studio-compatible @desc tag
possible
string|array $source tokenized highlight-ready source code false|string $class name of class if this is a method source
Passes toparserStringWithInlineTags::setSource() After passing, it calls postProcess() to set up the new source
array $funcs
replaces nameless global variables in the $funcglobals array with their names
array $modifiers
array $params Format: array(parameter key => name[,1 => default value][,2 => type hint]),...)
replaces nameless parameters in the $params array with their names add @param tags for params in the function with no entry
array $funcs
ParserElements.inc
Parser Elements, all classes representing documentable elements phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package ParserElements Author Gregory Beaver < [email protected]> Version CVS: $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2006 Gregory Beaver See Parser, WordParser Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.1 License LGPL
Class parserClass
[line 682]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.0rc1
Helps maintain
See Classes::getParentClass()
See parserPage::$sourceLocation
Var either a link to the tutorial associated with this class, or false
the
hassle
of
if
string $implements
Converter &$c this function will not work before the Conversion stage of parsing
Converter &$c
Returns all classes in other packages that have the same name as this class
Usedby Converter::getFormattedConflicts()
Converter &$c this function will not work before the Conversion stage of parsing
Converter &$c this function will not work before the Conversion stage of parsing
$raw
See parserClass::$extends
array function parserClass::getImplements() [line 1387] array function parserClass::getInheritedConsts(&$c, [$override = false], [$consts = false]) [line 1225] Function Parameters:
Converter &$c this function will not work before the Conversion stage of parsing boolean $override determines whether overriden vars should be included in the list of inherited vars $consts
Converter &$c this function will not work before the Conversion stage of parsing boolean $override determines whether overriden methods should be included in the list of inherited methods
array function parserClass::getInheritedVars(&$c, [$override = true], [$vars = false]) [line 1149] Function Parameters:
Converter &$c this function will not work before the Conversion stage of parsing
boolean $override determines whether overriden vars should be included in the list of inherited vars $vars
mixed function parserClass::getLink($c, [$text = false], [$returnobj = false]) [line 789] Function Parameters:
Converter $c string $text text to display for the link or false for default text $returnobj
Converter &$c this function will not work before the Conversion stage of parsing string $name method name in this class boolean $inherited determines whether to search inherited methods as well
Converter &$c this function will not work before the Conversion stage of parsing
Converter &$c this function will not work before the Conversion stage of parsing
Converter &$c this function will not work before the Conversion stage of parsing
Converter &$c this function will not work before the Conversion stage of parsing
Usedby CHMdefaultConverter::generateFormattedClassTree() Usedby HTMLframesConverter::generateFormattedClassTree() Usedby HTMLSmartyConverter::generateFormattedClassTree() Usedby XMLDocBookConverter::generateFormattedClassTree() Usedby XMLDocBookpeardoc2Converter::generateFormattedClassTree()
See parserClass::$sourceLocation
Converter &$c this function will not work before the Conversion stage of parsing string $name var name in this class
Converter &$c this function will not work before the Conversion stage of parsing
Converter &$c this function will not work before the Conversion stage of parsing
Converter &$c this function will not work before the Conversion stage of parsing string $name class constant name
boolean function parserClass::hasMethod(&$c, $name, [$inherited = false]) [line 961] Function Parameters:
Converter &$c this function will not work before the Conversion stage of parsing string $name method name boolean $inherited determines whether to search inherited methods as well
Converter &$c this function will not work before the Conversion stage of parsing string $name var name
array $modifiers
string $extends
See parserClass::$extends
string $m
string $p parent class name string $f parent class file Classes &$c Classes object currently calling setParent
See Classes::setClassParent()
string $par parent class name (used by Classes::setClassParent() if parent class not found
string $sl
See parserClass::$sourceLocation
Class parserConst
[line 1578]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.2.4
the
hassle
of
if
string $class
Converter $c string $text text to display for the link or false for default text $returnobj
Class parserDefine
[line 1983]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.0rc1
the
hassle
of
if
Converter &$c
Returns all defines in other packages that have the same name as this define
Usedby Converter::getFormattedConflicts()
mixed function parserDefine::getLink($c, [$text = false], [$returnobj = false]) [line 1997] Function Parameters:
Converter $c string $text text to display for the link or false for default text
$returnobj
Class parserElement
[line 49]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Abstract Element Since 1.0rc1
parserElement::$endlinenumber
Since 1.2
Since 1.2
parserDocBlock $docblock
integer $l
string $file
integer $number
string $name
string $file
Class parserFunction
[line 321]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.0rc1
parameters parsed from function definition. param name may be null, in which case, updateParams() must be called from the Converter
Var Format: array(param name => default value parsed from function definition) See updateParams()
parserFunction::$returnsreference
Function returns a reference to an element, instead of a value set to true if function is declared as:
1 function & func(...
parserFunction::$source mixed = '' [line 358] parserFunction::$statics array = false [line 356]
Var Format: array(array('name' => staticvar1,'val' => '' or default val of staticvar1),...)
the
hassle
of
if
void function parserFunction::addParam($name, $value, [$has_default = true], [$typehint = null]) [line 366] Function Parameters:
string $name string $value default value parsed from function definition boolean $has_default indicates whether this parameter has a default value null|string $typehint class type hint
string|array $source
array $static Format: array(varname1, varname2,...) array $vals Format: array(default val of var 1, default val of var 2,...) if var 1 has no default, array(default val of var 2,...)
Converter &$c
Returns all functions in other packages that have the same name as this function
Usedby Converter::getFormattedConflicts()
and returns: string &func( $param1, [$param2 = 6], [$param3 = array('20',9 => "heroo")] )
$converter $paramtags
Like getFunctionCall(), but has no English or pre-determined formatting. Much more flexible.
See parserFunction::getFunctionCall()
mixed function parserFunction::getLink($c, [$text = false], [$returnobj = false]) [line 408] Function Parameters:
Converter $c string $text text to display for the link or false for default text $returnobj
string $name
boolean function parserFunction::getReturnsReference() [line 561] string|array function parserFunction::getSource() [line 397] boolean function parserFunction::hasSource() [line 388]
Determine whether the source code has been requested via {@source}
array function parserFunction::listGlobals() [line 515] array function parserFunction::listParams() [line 480] array function parserFunction::listStatics() [line 534] void function parserFunction::setReturnsReference() [line 553]
Class parserGlobal
[line 217]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.1
the
hassle
of
if
Converter &$c
Returns all global variables in other packages that have the same name as this global variable
Usedby Converter::getFormattedConflicts()
Converter &$converter
Retrieve converter-specific representation of the data type If the data type is a documented class name, then this function will return a Converter-specific link to that class's documentation, so users can click/browse to the documentation directly from the global variable declaration
mixed function parserGlobal::getLink(&$c, [$text = false], [$returnobj = false]) [line 237] Function Parameters:
Converter &$c string $text text to display for the link or false for default text $returnobj
string $type
Class parserInclude
[line 201]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.0rc1
the
hassle
of
if
Class parserMethod
[line 1628]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.0rc1
the
hassle
of
if
parserMethod::$_modifiers
mixed = array() [line 1641] Constructor void function parserMethod::parserMethod($class) [line 1646] Function Parameters:
string $class
void function parserMethod::addParam($name, $value, [$has_default = true], [$typehint = null]) [line 1657] Function Parameters:
string $name string $value default value parsed from function definition boolean $has_default indicates whether this parameter has a default value null|string $typehint class type hint
$isConstructor true is
See parserFunction::getFunctionCall()
Converter &$c
Usedby Converter::getFormattedMethodImplements()
$converter $paramtags
mixed function parserMethod::getLink($c, [$text = false], [$returnobj = false]) [line 1915] Function Parameters:
Converter $c string $text text to display for the link or false for default text $returnobj
Converter &$c
Converter &$c
Usedby Converter::getFormattedDescMethods()
Use this method to tell the parser that this method is the class constructor
void function parserMethod::setDestructor() [line 1935]
Use this method to tell the parser that this method is the class constructor
string function parserMethod::setModifiers($m) [line 1708] Function Parameters:
$m
Class parserPackagePage
[line 2027]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.0rc1
parserPackagePage::$package string = 'default' [line 2035] parserPackagePage::$type string = 'packagepage' [line 2033]
the
hassle
of
if
string $package
Converter &$c
Class parserTutorial
[line 2059]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.2 Usedby XMLPackagePageParser::parse() - using Publisher::PublishEvent(), a new tutorial is created from the file parsed, and passed to the Intermediate Parser
output from tutorialname.ext.ini an array generated by phpDocumentor_parse_ini_file() containing an index 'Linked Tutorials' with an array of tutorial names in the order they should appear. This is used to generate a linked list of tutorials like phpDocumentor tags
The documentable element this tutorial is linked to Can be a parserData, parserClass, or nothing for package/subpackage docs
Usedby parserTutorial::setNext() - creates a link to the documentation for the next tutorial
parserTutorial::$package string = 'default' [line 2067] parserTutorial::$parent tutorialLink = false [line 2119]
link to the parent tutorial in a document series, or false if none This is used to generate an "Up" or "Home" link like the php manual. The parent is defined as a tutorial that has a parenttutorialname.ext.ini file and is not contained by any other tutorial's tutorialname.ext.ini
Usedby parserTutorial::setParent() - creates a link to the documentation for the parent tutorial
Usedby parserTutorial::setPrev() - creates a link to the documentation for the previous tutorial
the
hassle
of
if
parserXMLDocBookTag $data top-level tag (<refentry> for 1.2.0) information $info about the tutorial file. Format: array('tutename' => tutorial name, 'path' => relative path of tutorial to tutorials/ directory 'ini' => contents of the tutorial .ini file, if any)
Converter &$c boolean $postprocess determines whether character data is postprocessed to be Converter-friendly or not.
string|tutorialLink function parserTutorial::getLink(&$c, [$pure = false], [$section = '']) [line 2278] Function Parameters:
Converter &$c boolean $pure if true, returns a tutorialLink instead of a string string $section section name to link to
Converter &$c
Converter &$c
Converter &$c
Converter &$c string $subsection which subsection to retrieve the title from, if any
Determine if this parserTutorial object is a child of another WARNING: This method can enter an infinite loop when run on PHP v5.2.1... see PHP Bug #40608 and PEAR Bug #10289
Function Parameters:
Uses parserTutorial::$next - creates a link to the documentation for the next tutorial
Uses parserTutorial::$parent - creates a link to the documentation for the parent tutorial
Uses parserTutorial::$prev - creates a link to the documentation for the previous tutorial
Class parserVar
[line 1415]
Package phpDocumentor Sub-Package ParserElements Author Greg Beaver < [email protected]> Version $Id: ParserElements.inc 248547 2007-12-19 02:16:49Z ashnazg $ Copyright 2002-2008 Gregory Beaver Since 1.0rc1
the
hassle
of
if
parserVar::$_modifiers array = [line 1425] Constructor void function parserVar::parserVar($class) [line 1430] Function Parameters:
string $class
mixed function parserVar::getLink($c, [$text = false], [$returnobj = false]) [line 1468] Function Parameters:
Converter $c string $text text to display for the link or false for default text $returnobj
Converter &$c
Converter &$c
Usedby Converter::getFormattedDescVars()
$m
Beautifier.php
XML/Beautifier.php Format XML files containing unknown entities (like all of peardoc) phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2004-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Parsers Author Greg Beaver < [email protected]> Version CVS: $Id: Beautifier.php 212211 2006-04-30 22:18:14Z cellog $ Copyright 2004-2006 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.3.0 Filesource Source Code for this file License LGPL
Tokenizer.php
XML/Beautifier.php Format XML files containing unknown entities (like all of peardoc) phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2004-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Parsers Author Greg Beaver < [email protected]> Version CVS: $Id: Tokenizer.php 238276 2007-06-22 14:58:30Z ashnazg $ Copyright 2004-2006 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 1.3.0 Filesource Source Code for this file License LGPL
starting state
PHPDOC_XMLTOKEN_EVENT_OPENTAG = 3 [line 696]
HighlightParser.inc
Source Code Highlighting The classes in this file are responsible for the dynamic @example, @filesource and {@source} tags output. Using the phpDocumentor_HighlightWordParser, the phpDocumentor_HighlightParser retrieves PHP tokens one by one from the array generated by phpDocumentorTWordParser source retrieval functions and then highlights them individually. It accomplishes this highlighting through the assistance of methods in the output Converter passed to its parse() method, and then returns the fully highlighted source as a string phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2008 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Parsers Tutorial @example, @filesource, inline {@source} Author Gregory Beaver < [email protected]> Version CVS: $Id: HighlightParser.inc 253641 2008-02-24 02:35:44Z ashnazg $ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.2.0beta3 Filesource Source Code for this file License LGPL
Parser.inc
Base parser for all parsers phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2000-2006 Joshua Eichorn, Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Parsers Author Joshua Eichorn < [email protected]> Author Gregory Beaver < [email protected]> Version CVS: $Id: Parser.inc 238276 2007-06-22 14:58:30Z ashnazg $ Copyright 2000-2006 Joshua Eichorn, Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org Since 0.1 License LGPL
used when encountering a /**#@-* / comment (no space) marking the end of using a docblock template
PARSER_EVENT_END_STATEMENT = 121 [line 189] PARSER_EVENT_EOFQUOTE = 122 [line 192]
while
parsing
an
used for the beginning of parsing, before first < ? php encountered
PARSER_EVENT_OUTPHP = 118 [line 175]
used when php code processor instruction (< ? php) is encountered in parsing
PARSER_EVENT_QUOTE = 101 [line 88]
used when parsing the value in a "static $var1 = x" declaration in a function
PARSER_EVENT_TAGS = 127 [line 217]
used to inform phpDocumentor_IntermediateParser that the current file has been completely parsed. Render then flushes all buffers for functions/classes/defines/includes on the current page
See phpDocumentor_IntermediateParser::HandleEvent()
published
to
Deprecated
used to tell Render that a class has been completely parsed, and to flush buffers
STATE_END_DOCBLOCK_TEMPLATE = 234 [line 254]
statement
of
an
phpDocumentorTParser.inc
tokenizer extension-based parser for PHP code phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2008 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Parsers Author Gregory Beaver < [email protected]> Version CVS: $Id: phpDocumentorTParser.inc 286921 2009-08-08 05:01:24Z ashnazg $ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.2 License LGPL
TutorialHighlightParser.inc
Source Code Highlighting The classes in this file are responsible for the dynamic @example, and <programlisting role="tutorial"> tags output. Using the WordParser, the phpDocumentor_TutorialHighlightParser retrieves PHP tokens one by one from the array generated by WordParser source retrieval functions and then highlights them individually. It accomplishes this highlighting through the assistance of methods in the output Converter passed to its parse() method, and then returns the fully highlighted source as a string phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2003-2007 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Parsers Tutorial @example, @filesource Author Gregory Beaver < [email protected]> Version CVS: $Id: TutorialHighlightParser.inc 246148 2007-11-14 01:57:04Z ashnazg $ Copyright 2003-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - PHPCS needs to ignore CVS Id length Since 1.3.0 License LGPL
starting state
TUTORIAL_EVENT_OPENTAG = 3 [line 553]
XMLpackagePageParser.inc
Parser for XML DocBook-based phpDocumentor tutorials phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2007 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Parsers Tutorial phpDocumentor Tutorials Author Gregory Beaver < [email protected]> Version CVS: $Id: XMLpackagePageParser.inc 246143 2007-11-14 01:31:24Z ashnazg $ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - PHPCS needs to ignore CVS Id length Since 1.2 License LGPL
Class Parser
[line 338]
PHP Parser for PHP 4.2.3This parser is slower than the tokenizer-based parser, and is deprecated.
Author Gregory Beaver < [email protected]> Version $Id: Parser.inc 238276 2007-06-22 14:58:30Z ashnazg $ Copyright 2000-2007 Kellin, Joshua Eichorn Deprecated in favor of phpDocumentorTParser
string $word
Tutorial @category
$word $pevent
this function checks whether parameter $word is a token for popping the current event off of the Event Stack.
mixed function Parser::checkEventPush($word, $pevent) [line 2590] Function Parameters:
$word $pevent
this function checks whether parameter $word is a token for pushing a new event onto the Event Stack.
void function Parser::configWordParser($e) [line 2957] Function Parameters:
tell the parser's WordParser $wp to set up tokens to parse words by. tokens are word separators. In English, a space or punctuation are examples of tokens. In PHP, a token can be a ;, a parenthesis, or even the word "function"
See WordParser
string $word
Handles all standard tags that only have a description Tag Handlers
string $word
Tutorial @example
Debugging function, takes an event number and attempts to return its name
void function Parser::globalTagHandler($word) [line 2062] Function Parameters:
string $word
Tutorial @global
string $word
Handles tags like '@filesource' that only work in PHP 4.3.0+ Tag Handlers
string $word
Tutorial @package
string $word
Tutorial @param
bool function Parser::parse(&$parse_data, $path, [$base = 0], [$packages = false], $parse_data) [line 509] Function Parameters:
string $parse_data string $path int $base number of directories to drop off the bottom when creating names using path &$parse_data $packages
Static Variable Used integer $endrecur: used for recursion limiting if a handler for an event is not found
string $word
string $word
Tutorial @return
string $word
Tutorial @staticvar
string $word
Tutorial @uses
string $word
Tutorial @var
Class parserDescParser
[line 298]
Package phpDocumentor Sub-Package Parsers Tutorial phpDocumentor Tutorial Author Greg Beaver < [email protected]> Version $Id: Parser.inc 238276 2007-06-22 14:58:30Z ashnazg $ Copyright 2000-2007 Kellin, Joshua Eichorn Since 1.2
sets $wp to be aObjectWordParser $wp is the word parser that retrieves tokens
This helper function extracts a simple list beginning with any of '.'#','+','0','1','0.','1.' and starts parsing it.
'o','-
$value
void function parserDescParser::parse(&$parse_data, [$sdesc = false], [$ind_type = 'parserDesc']) [line 363] Function Parameters:
array &$parse_data array of strings or parserInlineTags boolean $sdesc true if the description is a short description. (only 1 paragraph allowed in short desc) string $ind_type name of the class to instantiate for each paragraph. parserDesc for desc/sdesc, parserStringWithInlineTags for tag data
Static Variable Used integer $endrecur: used for recursion limiting if a handler for an event is not found Usedby parserDocBlock::postProcess()
Global Variable Used boolean 0: used to determine whether to slow things down or not by eliminating whitespace from comments See Publisher::$tokens, Publisher::$pushEvent, Publisher::$popEvent
Class phpDocumentorTParser
[line 56]
Package phpDocumentor Sub-Package Parsers Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
phpDocumentorTParser::$eventHandlers mixed = array( PARSER_EVENT_ARRAY => 'handleArray', PARSER_EVENT_VAR_ARRAY => 'handleArray', PARSER_EVENT_VAR_ARRAY_COMMENT => 'handleVarArrayComment', PARSER_EVENT_CLASS => 'handleClass', PARSER_EVENT_COMMENT => 'handleComment', PARSER_EVENT_DOCBLOCK_TEMPLATE => 'handleDocBlockTemplate', PARSER_EVENT_END_DOCBLOCK_TEMPLATE => 'handleEndDocBlockTemplate', PARSER_EVENT_LOGICBLOCK => 'handleLogicBlock', PARSER_EVENT_NOEVENTS => 'defaultHandler', PARSER_EVENT_OUTPHP => 'defaultHandler', PARSER_EVENT_DEFINE => 'handleDefine', PARSER_EVENT_DEFINE_PARAMS => 'handleDefineParams', PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS => 'handleDefineParamsParenthesis', PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS => 'handleIncludeParamsParenthesis', PARSER_EVENT_DOCBLOCK => 'handleDocBlock', PARSER_EVENT_TAGS => 'handleTags', PARSER_EVENT_DESC => 'handleDesc', PARSER_EVENT_DOCKEYWORD => 'handleTag', PARSER_EVENT_DOCKEYWORD_EMAIL => 'handleDockeywordEmail', PARSER_EVENT_EOFQUOTE => 'handleHereDoc', PARSER_EVENT_FUNCTION => 'handleFunction', PARSER_EVENT_FUNCTION_PARAMS => 'handleFunctionParams',
PARSER_EVENT_FUNCTION_PARAM_VAR => 'handleFunctionParams', PARSER_EVENT_FUNC_GLOBAL => 'handleFuncGlobal', PARSER_EVENT_DEFINE_GLOBAL => 'handleGlobal', PARSER_EVENT_GLOBAL_VALUE => 'handleGlobalValue', PARSER_EVENT_INLINE_DOCKEYWORD => 'handleInlineDockeyword', PARSER_EVENT_INCLUDE => 'handleInclude', PARSER_EVENT_INCLUDE_PARAMS => 'handleIncludeParams', PARSER_EVENT_QUOTE => 'handleQuote', PARSER_EVENT_PHPCODE => 'handlePhpCode', PARSER_EVENT_SINGLEQUOTE => 'handleSingleQuote', PARSER_EVENT_STATIC_VAR => 'handleStaticVar', PARSER_EVENT_STATIC_VAR_VALUE => 'handleStaticValue', PARSER_EVENT_VAR => 'handleVar', PARSER_EVENT_ACCESS_MODIFIER => 'handleAccessModifier', PARSER_EVENT_IMPLEMENTS => 'handleImplements', PARSER_EVENT_CLASS_CONSTANT => 'handleClassConstant', ) [line 147] phpDocumentorTParser::$inlineTagHandlers mixed = array( '*' => 'handleDefaultInlineTag', 'link' => 'handleLinkInlineTag', ) [line 188] phpDocumentorTParser::$source_location string = [line 146]
relative path of the parsed file from the base parse directory
Constructor void function phpDocumentorTParser::phpDocumentorTParser() [line 197]
Constructor
bool function phpDocumentorTParser::parse(&$parse_data, $path, [$base = 0], [$packages = false]) [line 225] Function Parameters:
string &$parse_data the parse data string $path the path int $base number of directories to drop off the bottom names using path bool $packages ???
when creating
Static Variable Used int $endrecur: used for recursion limiting event is not found
if a handler for an
Class phpDocumentor_HighlightParser
[line 226]
Package phpDocumentor Sub-Package Parsers Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change class name to PhpDocumentor_* TODO CS cleanup - change package to PhpDocumentor Since 1.2.0beta3 Usedby parserExampleInlineTag::arrayConvert() - Parses the tokenized source Usedby parserSourceInlineTag::arrayConvert() - Parses the tokenized source Usedby parserExampleTag::ConvertSource() - highlights source code Usedby parserFileSourceTag::ConvertSource() - highlights source code License LGPL
tokens
wraps the current line (via the converter) and resets it to empty
bool function phpDocumentor_HighlightParser::parse(&$parse_data, &$converter, [$inlinesourceparse = false], [$class = false], [$linenum = false], [$filesourcepath = false]) [line 406] Function Parameters:
array &$parse_data the parse data Converter &$converter the converter object bool $inlinesourceparse whether this data is from an inline {@source} tag string|false $class if a string, it is the name of the class whose method we are parsing containing a {@source} tag false|integer $linenum starting line number from {@source linenum} false|string $filesourcepath full path to file with @filesource tag, if this is a @filesource parse
Parse a new file The parse() method is a do...while() loop that retrieves tokens one by one from the $_event_stack, and uses the token event array set up by the class constructor to call event handlers. The event handlers each process the tokens passed to them, and use the _addoutput() method to append the processed tokens to the $_line variable. The word parser calls newLineNum() every time a line is reached. In addition, the event handlers use special linking functions _link() and its cousins (_classlink(), etc.) to create in-code hyperlinks to the documentation for source code elements that are in the source code.
Static Variable Used int $endrecur: used for recursion limiting if a handler for an event is not found TODO CS cleanup - rename tokenizer_ext constant to uppercase Uses phpDocumentor_HighlightParser::setupStates() - initialize parser state variables Uses phpDocumentor_HighlightParser::configWordParser() - pass $parse_data to prepare retrieval of tokens
bool $inlinesourceparse true if we are highlighting an inline {@source} tag's output false|string $class name of class we are going
to start from
Usedby phpDocumentor_HighlightParser::parse() - initialize parser state variables Uses $_wp - sets to a new phpDocumentor_HighlightWordParser
Class phpDocumentor_HighlightWordParser
[line 69]
Package phpDocumentor Sub-Package Parsers Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change class name to PhpDocumentor_* Since 1.2.0beta3 License LGPL
array|string $last_token token, or output from nextToken() bool $is_pos if true, backupPos interprets $last_token position in the internal token array of the last token
to be the
Retrieve the position of the next token that will be parsed in the internal token array
void function phpDocumentor_HighlightWordParser::setup(&$input, &$parser) [line 85] Function Parameters:
Class phpDocumentor_peardoc2_XML_Beautifier
[line 49]
This
but
uses
mixed function phpDocumentor_peardoc2_XML_Beautifier::formatFile($file, [$newFile = null], [$renderer = "Plain"]) [line 63] Function Parameters:
string $file filename mixed $newFile filename for beautified XML file (if none is given, the XML string will be returned.) if you want overwrite the original file, use XML_BEAUTIFIER_OVERWRITE string $renderer Renderer to use, default is the plain xml renderer
Throws PEAR_Error Access public Uses _loadRenderer() - to load the desired renderer
Class phpDocumentor_TutorialHighlightParser
[line 69]
Package phpDocumentor Sub-Package Parsers Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2003-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
string|array $word token value integer $pevent parser event from Parser.inc
This function checks whether parameter $word is a token for popping the current event off of the Event Stack.
string|array $word token value integer $pevent parser event from Parser.inc
This function checks whether parameter $word is a token for pushing a new event onto the Event Stack.
Tell the parser's WordParser $wp to set up tokens to parse words by. Tokens are word separators. In English, a space or punctuation are examples of tokens. In PHP, a token can be a ;, a parenthesis, or even the word "function"
bool function phpDocumentor_TutorialHighlightParser::parse($parse_data, &$converter, [$filesourcepath = false], [$linenum = false]) [line 166] Function Parameters:
string $parse_data blah Converter &$converter blah false|string $filesourcepath full path to file with @filesource tag, this is a @filesource parse false|integer $linenum starting line number from
if {@source linenum}
Parse a new file The parse() method is a do...while() loop that retrieves tokens one by one from the $_event_stack, and uses the token event array set up by the class constructor to call event handlers. The event handlers each process the tokens passed to them, and use the _addoutput() method to append the processed tokens to the $_line variable. The word parser calls newLineNum() every time a line is reached. In addition, the event handlers use special linking functions _link() and its cousins (_classlink(), etc.) to create in-code hyperlinks to the documentation for source code elements that are in the source code.
Static Variable Used integer $endrecur: used for recursion limiting if a handler for an event is not found TODO CS cleanup - unable to get function signature below 85char wide Uses phpDocumentor_TutorialHighlightParser::setupStates() - initialize parser state variables Uses phpDocumentor_TutorialHighlightParser::configWordParser() - pass $parse_data to prepare retrieval of tokens
bool|string $parsedata true if we are highlighting an inline {@source} tag's output, or the name of class we are going to start from
Usedby phpDocumentor_TutorialHighlightParser::parse() - initialize parser state variables Uses $_wp - sets to a new phpDocumentor_HighlightWordParser
Class phpDocumentor_XML_Beautifier_Tokenizer
[line 50]
phpDocumentor_XML_Beautifier_Tokenizer::$eventHandlers array = array( PHPDOC_XMLTOKEN_EVENT_NOEVENTS => 'normalHandler', PHPDOC_XMLTOKEN_EVENT_XML => 'parseXMLHandler', PHPDOC_XMLTOKEN_EVENT_PI => 'parsePiHandler', PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE => 'attrHandler', PHPDOC_XMLTOKEN_EVENT_OPENTAG => 'tagHandler', PHPDOC_XMLTOKEN_EVENT_IN_CDATA => 'realcdataHandler', PHPDOC_XMLTOKEN_EVENT_DEF => 'defHandler', PHPDOC_XMLTOKEN_EVENT_CLOSETAG => 'closetagHandler', PHPDOC_XMLTOKEN_EVENT_ENTITY => 'entityHandler', PHPDOC_XMLTOKEN_EVENT_COMMENT => 'commentHandler', PHPDOC_XMLTOKEN_EVENT_SINGLEQUOTE => 'stringHandler', PHPDOC_XMLTOKEN_EVENT_DOUBLEQUOTE => 'stringHandler', PHPDOC_XMLTOKEN_EVENT_CDATA => 'parseCdataHandler', ) [line 64] Constructor void function phpDocumentor_XML_Beautifier_Tokenizer::phpDocumentor_XML_Beautifier_Tokenizer() [line 570]
$word $pevent
this function checks whether parameter $word is a token for popping the current event off of the Event Stack.
mixed function phpDocumentor_XML_Beautifier_Tokenizer::checkEventPush($word, $pevent) [line 513] Function Parameters:
$word $pevent
this function checks whether parameter $word is a token for pushing a new event onto the Event Stack.
tell the parser's WordParser $wp to set up tokens to parse words by. tokens are word separators. In English, a space or punctuation are examples of tokens. In PHP, a token can be a ;, a parenthesis, or even the word "function"
$value
Access protected
Function Parameters:
Converter 1 false|string 2 full path to file with @filesource tag, if this false|integer 3 starting line number from {@source linenum} string $parse_data
is a @filesource parse
Parse a new file The parse() method is a do...while() loop that retrieves tokens one by one from the $_event_stack, and uses the token event array set up by the class constructor to call event handlers. The event handlers each process the tokens passed to them, and use the _addoutput() method to append the processed tokens to the $_line variable. The word parser calls newLineNum() every time a line is reached. In addition, the event handlers use special linking functions _link() and its cousins (_classlink(), etc.) to create in-code hyperlinks to the documentation for source code elements that are in the source code.
Static Variable Used integer $endrecur: used for recursion limiting if a handler for an event is not found Uses phpDocumentor_XML_Beautifier_Tokenizer::setupStates() - initialize parser state variables Uses phpDocumentor_XML_Beautifier_Tokenizer::configWordParser() - pass $parse_data to prepare retrieval of tokens
false|string 1 name of class we are going to start from boolean $parsedata true if we are highlighting an inline {@source} tag's
output
Class ppageParser
[line 3026]
Package phpDocumentor Sub-Package Parsers Tutorial phpDocumentor Tutorials Author Joshua Eichorn < [email protected]> Author Gregory Beaver < [email protected]> Version $Id: Parser.inc 238276 2007-06-22 14:58:30Z ashnazg $ Copyright 2000-2007 Kellin, Joshua Eichorn Deprecated in favor of tutorials
ppageParser::$package string = false [line 3029] ppageParser::$subpackage string = '' [line 3031] Constructor void function ppageParser::ppageParser() [line 3035]
handler for INLINE_DOCKEYWORD. this handler recognizes {@inline tags} like link, and parses them, replacing them directly in the text flow with their output.
mixed function ppageParser::parse(&$parse_data, $xml, [$package = 'default'], [$subpackage = ''], [$tutorial = ''], [$category = 'default'], [$path = ''], $parse_data) [line 3071] Function Parameters:
string $parse_data string $package int $subpackage &$parse_data $xml $tutorial $category $path
Class XMLPackagePageParser
[line 98]
Package phpDocumentor
Sub-Package Parsers Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.2 License LGPL
XMLPackagePageParser::$eventHandlers array = array( PHPDOCUMENTOR_PDP_EVENT_TAG => 'handleTag', PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES => 'handleAttributes', PHPDOCUMENTOR_PDP_EVENT_CDATA => 'handleCData', PARSER_EVENT_NOEVENTS => 'defaultHandler', PARSER_EVENT_COMMENTBLOCK => 'ignoreHandler', PARSER_EVENT_OUTPHP => 'ignoreHandler', PARSER_EVENT_QUOTE => 'handleQuote', PHPDOCUMENTOR_PDP_EVENT_ENTITY => 'handleEntity', ) [line 103] XMLPackagePageParser::$pars array = array() [line 117] XMLPackagePageParser::$refsect1id mixed = false [line 119] XMLPackagePageParser::$refsect2id mixed = false [line 120] XMLPackagePageParser::$refsect3id mixed = false [line 121] Constructor void function XMLPackagePageParser::XMLPackagePageParser() [line 138]
3 4
$this -> }
wp =new ObjectWordParser(true);
Uses ObjectWordParser
debugging function 1 function getParserEventName ($value) 2 { 3 $lookup= array( 4 PARSER_EVENT_NOEVENTS 5 => "PARSER_EVENT_NOEVENTS" , 6 PHPDOCUMENTOR_PDP_EVENT_TAG 7 => "PHPDOCUMENTOR_PDP_EVENT_TAG" , 8 PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES 9 => "PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES" 10 PHPDOCUMENTOR_PDP_EVENT_CDATA 11 => "PHPDOCUMENTOR_PDP_EVENT_CDATA" , 12 PHPDOCUMENTOR_PDP_EVENT_LIST 13 => "PHPDOCUMENTOR_PDP_EVENT_LIST" , 14 PARSER_EVENT_QUOTE 15 => "PARSER_EVENT_QUOTE" , 16 PHPDOCUMENTOR_PDP_EVENT_ENTITY 17 => "PHPDOCUMENTOR_PDP_EVENT_ENTITY" , 18 PHPDOCUMENTOR_PDP_EVENT_COMMENT 19 => "PHPDOCUMENTOR_PDP_EVENT_COMMENT" 20 PHPDOCUMENTOR_PDP_EVENT_PI 21 => "PHPDOCUMENTOR_PDP_EVENT_PI" , 22 ); 23 if (isset( $lookup [$value])) { 24 return$lookup [$value]; 25 } else { 26 return$value; 27 } 28 }
Static
string $parse_data the parse data array $tutorial for format, see Io::getTutorials()
Static Variable Used integer $endrecur: used for recursion limiting event is not found Uses parserTutorial - using Publisher::PublishEvent(), a new tutorial is created from the file parsed, and passed to the Intermediate Parser
if a handler for an
find_phpdoc.php
Utility file to locate phpDocumentor for a non-PEAR installation phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2007 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package setup Author Gregory Beaver < [email protected]> Version CVS: $Id: find_phpdoc.php 246330 2007-11-17 03:09:41Z ashnazg $ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change subpackage to Setup TODO CS cleanup - change package to PhpDocumentor Since 1.2 Filesource Source Code for this file License LGPL
Dummy value
PackagePageElements.inc
Data structures used in parsing XML DocBook-based tutorials Conversion of DocBook-based tutorials is performed using special Converter class methods. By default, these methods simply retrieve simple rules for replacement of tags and slight re-ordering from the options.ini file present for every template. In future versions, there may be utilization of xslt or other more powerful protocols. However, for most situations, the power of these classes will be more than sufficient to handle very complex documentation. Note that an entire tutorial is contained in a single parserXMLDocBookTag, matching the document model for DocBook. The top-level tag, <refentry>, contains every other tag and all text. phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2008 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Tutorial Tutorial phpDocumentor Tutorials Author Gregory Beaver < [email protected]> Version CVS: $Id: PackagePageElements.inc 253643 2008-02-24 04:27:54Z ashnazg $ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 1.2.0
License LGPL
Class parserCData
[line 72]
Represents <![CDATA[ ]]> sections. These sections are interpreted as plain text
Package phpDocumentor Sub-Package Tutorial Tutorial phpDocumentor Tutorials Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* License LGPL
TODO CS cleanup - rename to convert for camelCase rule Uses Converter::getCData() - convert contents to text
Class parserEntity
[line 479]
a standard entity like ” This class is designed to represent all DocBook entities.
Package phpDocumentor Sub-Package Tutorial Tutorial phpDocumentor Tutorials Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.2 License LGPL
TODO CS cleanup - rename to convert for camelCase rule Uses Converter::TranslateEntity() - convert contents to text
Class parserXMLDocBookTag
[line 122]
a standard XML DocBook Tag This class is designed to represent all DocBook tags. It is intelligent enough to understand the <title> tag, and also the <refname> tag for as title for <refentry>
Package phpDocumentor Sub-Package Tutorial Tutorial phpDocumentor Tutorials Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2008 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* TODO CS cleanup - rename to parserXmlDocBookTag for camelCase rule Since 1.2 License LGPL
Attributes from the XML tag Format: array(attrname => attrvalue, attrname => attrvalue,...)
parserXMLDocBookTag::$name
Add contents to this tag. There are four kinds of data in a DocBook tutorial: tags - normal tags like <refentry> entities - normal entities like ” <![CDATA[ - character data that should not be interpreted, like <programlisting> contents 4. text - normal non-markup text All four kinds of data are added here
1. 2. 3.
Add an xml tag attribute name="value" pair if the attribute is id, value must be a parserIdInlineTag
Uses Converter::TranslateTag() - Calls this to enclose the contents of the DocBook tag based on the values in template options.ini file
Retrieve the contents of a subsection This method uses the $_id members of nested docbook tags to retrieve the section defined by $subsection
false|integer $state either an index of the {@toc} tag in $this->value false, if the next index value of $this->value is needed
or
Retrieve either the table of contents index, or the location that the TOC will go
See parserXMLDocBookTag::setTOC()
Set the title of a DocBook tag section. For most DocBook tags, the title is represented with a <title></title> tag pair. The <refentry> top-level tag is a little different. Instead of using <title></title>, phpDocumentor uses the contents of the <refname> tag in the <refnamediv> tag
integer $state index of the TOC in $this->value parserTocInlineTag $val tag value
See parserXMLDocBookTag::addCData()
phpDocumentorTWordParser.inc
tokenizer extension-based lexer for PHP code phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2002-2006 Gregory Beaver LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package Parsers Author Gregory Beaver < [email protected]> Version CVS: $Id: phpDocumentorTWordParser.inc 287887 2009-08-30 06:10:55Z ashnazg $ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - PHPCS needs to ignore CVS Id length Since 1.2 License LGPL
WordParser.inc
a generic lexer phpDocumentor :: automatic documentation generator PHP versions 4 and 5 Copyright (c) 2000-2007 Joshua Eichorn LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Package phpDocumentor Sub-Package WordParsers Author Joshua Eichorn < [email protected]> Version CVS: $Id: WordParser.inc 246145 2007-11-14 01:37:03Z ashnazg $ Copyright 2000-2007 Joshua Eichorn Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor Since 0.1 License LGPL
Class ObjectWordParser
[line 130]
parserInlineTags
Package phpDocumentor Sub-Package WordParsers Author Greg Beaver < [email protected]> Version Release: @VER@ Copyright 2000-2007 Joshua Eichorn Since 1.2 Usedby XMLPackagePageParser::XMLPackagePageParser()
$casesensitive
void function ObjectWordParser::getWord() [line 166] boolean function ObjectWordParser::nextIsObjectOrNonNL() [line 281]
alternating text
Class phpDocumentorTWordParser
[line 59]
Like WordParser, but expects an array of tokens from the tokenizer instead of a string.
Package phpDocumentor Sub-Package WordParsers Author Gregory Beaver < [email protected]> Version Release: @VER@ Copyright 2002-2007 Gregory Beaver Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor TODO CS cleanup - change classname to PhpDocumentor_* Since 1.2 License LGPL
Wrapper foraddSource()used to retrieve the entire source code organized by line number in setup()
void function phpDocumentorTWordParser::addSource($word, [$file = false]) [line 300] Function Parameters:
array|string $word token to add bool $file true if this should be added
to $_file_source
Generate source token arrays organized by line number This code will split up tokens that contain "\n" and add them to the source code as separate tokens on different lines.
Uses _set_sars()
Static
if it is
Uses $_global_search
Usedby parserExampleTag::parserExampleTag() - uses to parse an example and retrieve all tokens by line number
Utility function to determine whether two tokens from the tokenizer are equal
Static
Class WordParser
[line 56]
Package phpDocumentor Sub-Package WordParsers Author Joshua Eichorn < [email protected]> Version Release: @VER@ Copyright 2000-2007 Joshua Eichorn See Parser Link http://pear.php.net/PhpDocumentor Link http://www.phpdoc.org TODO CS cleanup - change package to PhpDocumentor License LGPL
Backup to the previous token so that it can be retrieved again in a new context. Occasionally, a word will be passed to an event handler that should be handled by another event handler. This method allows that to happen.
Returns the current pointer position, or 1 character after the end of the word
string function WordParser::getSource() [line 149]
Retrieve a token from the token list The Parser class relies upon this method to retrieve the next token. The $wordseperators array is a collection of strings that delineate tokens for the current parser state. $wordseperators is set by the parser with a call to Parser::configWordParser() every time a new parser state is reached. For example, while parsing the source code for a class, the word
1 1 var global
is a token, and is not, but inside a function, the reverse is true. The parser state PARSER_STATE_CLASS has a token list that includes whitespace, code delimiters like ; and {}, and comment/DocBlock indicators If the whitespace option has been turned off using setWhitespace(), then no whitespace is returned with tokens {@ is of course the string containing the PHP code to be parsed, and $pos is the cursor, or current location within the parsed data. }}
Uses $wordseperators
Appendices
abstractLink
abstractLink classLink defineLink functionLink globalLink methodLink constLink varLink pageLink tutorialLink
bug_772441
bug_772441
Classes
Classes
ErrorTracker
ErrorTracker
EventStack
EventStack
Io
Io
parserBase
parserBase parserElement parserClass parserConst parserDefine parserFunction parserMethod parserGlobal parserInclude parserVar parserInlineTag parserIdInlineTag parserInheritdocInlineTag parserLinkInlineTag parserTutorialInlineTag parserSourceInlineTag parserExampleInlineTag parserTocInlineTag parserStringWithInlineTags parserB parserBr parserCData parserCode parserDesc parserDescVar parserI parserKbd
parserList parserPackagePage parserTutorial parserPre parserSamp parserTag parserAccessTag parserFileSourceTag parserExampleTag parserLinkTag parserLicenseTag parserSeeTag parserTutorialTag parserUsesTag parserUsedByTag
parserXMLDocBookTag
parserData
parserData
parserDocBlock
parserDocBlock
parserEntity
parserEntity
parserPage
parserPage
phpDocumentor_IntermediateParser
phpDocumentor_IntermediateParser
phpDocumentor_peardoc2_XML_Beautifier
XML_Beautifier phpDocumentor_peardoc2_XML_Beautifier
phpDocumentor_setup
phpDocumentor_setup
phpDocumentor_XML_Beautifier_Tokenizer
XML_Beautifier_Tokenizer phpDocumentor_XML_Beautifier_Tokenizer
ProceduralPages
ProceduralPages
Publisher
Publisher Parser parserDescParser PDFParser phpDocumentorTParser phpDocumentor_HighlightParser phpDocumentor_TutorialHighlightParser ppageParser XMLPackagePageParser
RecordWarning
RecordWarning RecordError
tests_HighlightParserTests
tests_HighlightParserTests
tests_IntermediateParserTests
tests_IntermediateParserTests
tests_ParserClassTests
tests_ParserClassTests
tests_ParserPageTests
tests_ParserPageTests
tests_phpDocumentorSetupTests
tests_phpDocumentorSetupTests
tests_phpDocumentorTParserTests
tests_phpDocumentorTParserTests
WordParser
WordParser ObjectWordParser phpDocumentorTWordParser phpDocumentor_HighlightWordParser
Package HTML_TreeMenu
HTML_TreeMenu
HTML_TreeMenu
HTML_TreeMenu_Presentation
HTML_TreeMenu_Presentation HTML_TreeMenu_DHTML HTML_TreeMenu_Listbox
HTML_TreeNode
HTML_TreeNode DirNode
Package tests
a
a
a
a
b553607_Parser
b553607_Parser
brokenlinkstovars
brokenlinkstovars
bug540341
bug540341
bug557861
bug557861
bug_489398
bug_489398
bug_556894_base
bug_556894_base bug_556894_sub1 bug_556894_sub2
childofpriv
priv childofpriv
ClubBase
PEAR ClubBase
ctest
ctest
few
few
functionincomment
functionincomment
iConverter
iConverter iHTMLConverter
iiparserBase
iiparserBase
iNewRender
iNewRender
iParser
iParser
iparserElement
iparserElement
mama
mama baby
metoo
metoo
multipl
multipl
notseen
notseen
parent_b587733
parent_b587733 kiddie_b587733
priv1
priv1
RecordWarning
RecordWarning
summary_form
summary_form
test
test
test2
test2
testarraybug
testarraybug
testClass
testClass
testme
testme
tests_HighlightParserGetInlineTagsTests
PHPUnit_Framework_TestCase tests_HighlightParserGetInlineTagsTests
tests_IntermediateParserAddPrivatePageTests
PHPUnit_Framework_TestCase tests_IntermediateParserAddPrivatePageTests
tests_ParserClassGetSourceLocationTests
PHPUnit_Framework_TestCase tests_ParserClassGetSourceLocationTests
tests_ParserPageGetSourceLocationTests
PHPUnit_Framework_TestCase tests_ParserPageGetSourceLocationTests
tests_phpDocumentorSetupCleanConverterNamePieceTests
PHPUnit_Framework_TestCase tests_phpDocumentorSetupCleanConverterNamePieceTests
tests_phpDocumentorSetupDecideOnOrOffTests
PHPUnit_Framework_TestCase tests_phpDocumentorSetupDecideOnOrOffTests
tests_phpDocumentorTParserGetInlineTagsTests
PHPUnit_Framework_TestCase tests_phpDocumentorTParserGetInlineTagsTests
test_541886
test_541886
Converter
Generated by phpDocumentor v1.4.3 http://www.phpdoc.org - http://pear.php.net/package/PhpDocumentor - http://www.sourceforge.net/projects/phpdocu
PDFParser
Parser (Different package) PDFParser
phpdocpdf
Cezpdf (Different package) phpdocpdf
Package XML_Beautifier
PHPDoc_XML_Beautifier_Renderer_Plain
XML_Beautifier_Renderer PHPDoc_XML_Beautifier_Renderer_Plain
Package Cpdf
Cpdf
Cpdf Cezpdf phpdocpdf
Package Smarty
Config_File
Config_File
Smarty
Smarty Smarty_Compiler
Appendix B README/CHANGELOG/INSTALL
README
$Id: README 242918 2007-09-26 02:57:11Z ashnazg $ ################################################################################ phpDocumentor ################################################################################ Installation ################################################################################ Installation for phpDocumentor is as simple as installing PHP and a web server. If you need help installing a webserver or php, refer to the documentation that comes with the webserver or with php. phpDocumentor also runs from the command-line, and only requires that PHP CLI version be installed. All users with PEAR should either install this version directly from the package.xml file included in the distribution, or install via "pear install PhpDocumentor." The command-line interface "phpdoc" will be in the path, you can use it immediately on both windows and unix. The web interface is in a subdirectory of your document root, be sure to "pear config-set data_dir /path/to/my/htdocs" prior to installation. To use phpDocumentor as a command-line tool in *nix-based systems, simply run the phpdoc script. In windows, run "c:\php\php.exe phpdoc" where C:\php is the path to the cli version of php. The phpdoc command-line interface will not run with the ISAPI module of PHP. To see the command line options, use phpdoc -h or read at the bottom of this README. There is a BASH shell script that you can put inside your project that can save time writing command-line options of phpdoc. Simply copy makedoc.sh to your project path and edit it. When you wish to rebuild the documentation, run it again. Note that .ini scripts are far easier to edit and are supported via "phpdoc -c file.ini" To use phpDocumentor's web interface, install the files into a subdirectory of your document root (read the webserver's documentation for more information if you don't understand how to install into a subdirectory of your document root). Then, browse to the web page as you would to any other web page. If you encounter problems, make sure that the web server has write access permissions to the output directory that you choose. Again, your web server documentation has detailed information on how to do this. The command-line interface will not have problems with access. If you need more detailed help, check out INSTALL. ################################################################################ Release Notes ################################################################################ Release notes for the newest version are in Release-@VER@.
@VER@ is out, a @STABILITY@ release. To learn how to write PHPDoc-style documentation, run phpDocumentor on itself, with ./phpdoc -c makedocs. Before you do, modify users/makedocs.ini to contain the proper path values. If you find a bug please post it at: http://pear.php.net/bugs/search.php?cmd=display&package_name%5B%5D=PhpDocumentor ################################################################################ General Notes ################################################################################ phpDocumentor is hosted at phpdoc.org, with downloads and mailing list through sourceforge.net, and primary support at PEAR. webpage: http://phpdoc.org/ documentation: http://phpdoc.org/manual.php mirror: http://phpdocu.sourceforge.net projectpage: http://www.phpdoc.org PEAR: http://pear.php.net/package/PhpDocumentor For a list of people who have helped work on this project please read the Authors file. phpDocumentor @VER@ is released under the LGPL version 2.1, text is in LICENSE. ################################################################################ Feature Notes ################################################################################ phpDocumentor is a JavaDoc-like automatic documentation generator for PHP, written in PHP. It is the most versatile tool for documenting PHP. For users new to phpDocumentor, phpDocumentor uses an event-driven parser and intermediary data structures that allow it to perform at a level other automatic documentors for PHP cannot achieve: --parsing any php file, with multiple classes and functions in the same file --fully compliant with even the most esoteric php syntax ($string = <<< EOF, for example) --ability to generate multiple output formats --extremely fast parsing --error/warnings by line number and file to allow for debugging of documentation tags --multiple output templates to easily customize the look of generated documentation --extensive documentation of the package, including a detailed specification for tags and templates --LGPL License New since version 1.3.0: --PHP 5 Parsing --hundreds of bugfixes from version 1.2.3 If something is missing from this list make sure sure to file a feature request at PEAR: http://pear.php.net/bugs/search.php?cmd=display&package_name%5B%5D=PhpDocumentor
If you want to help code that new feature and get it just right, please let us know. Any help is greatly appreciated, just contact the phpDocumentor team for information on getting started. phpDocumentor needs php 4.1.0 or greater, but you'll see the best performance in the newest version. The recommended version for phpDocumentor 1.3.0 and up is PHP 5.1.3 or newer. ################################################################################ Command Line notes ################################################################################ Read the documentation at http://www.phpdoc.org/docs for the most up-to-date command-line information. You can also generate documentation from the source using: phpdoc -c makedocs Run this command from the installation directory, and make sure you have full write and directory creation permissions or it will not work. Generated documentation is accessible via Documentation/new/index.html ################################################################################ If you run phpdoc and get : bash: ./phpdoc: No such file or directory Then you haven't installed the cgi version of php. Go to your php src dir and try make clean ./configure make make install phpdoc should work now. If you're using php 4.2.0 or higher you will want to use the cli version instead of the cgi. Checkout php.net for details on these changes
################################################################################ Web Interface notes ################################################################################ Put phpdoc.php together with the *.inc files someplace on your webserver. NEVER USE THE WEB INTERFACE ON A PRODUCTION WEBSERVER. Allowing your server to write files to disk is a serious security risk, and phpDocumentor is not designed to work on insecure systems. Setup php on a development machine that has a firewall or no internet connection, and run phpDocumentor from there. Make sure your webserver can write to wherever you specify as a target or you will get lots of errors. ################################################################################ Thanks ################################################################################ Thanks to Sam Blum for his assistance with @example and other enhancements. Thanks to William K. Hardeman for his HTML:Smarty:HandS design.
Thanks to Marco von Ballmoos for transforming the HTML:frames converter and templates into a magnificent work of art. Thanks to Andrew Eddie for docbuilder and the CHM Converter enhancements. Thanks to Darren Cook for suggesting exciting new features, and making sure that they worked when implemented. Thanks to Marko Kaening, Dan Convissor for policing the source and finding bugs that would have otherwise gone undetected. Thanks to Juan Pablo Morales for the web interface. Thanks to whoever sent me the patch to make phpDocumentor work better in NT... I have your diff and patched the program but i seem to have lost your name... if you send it to me i'll add it to the Authors file. Thanks to Florian Clever for the newest set of win32 patches... they seem to have fixed the last of the problems. Thanks to EVERYONE who has provided ideas and input, without you, phpDocumentor would be nothing. ################################################################################ ################################################################################ If you have any questions please try our mailing list at [email protected]. joshua eichorn [email protected] gregory beaver [email protected] chuck burgess [email protected]
ChangeLog
$Id: ChangeLog 229303 2007-02-07 20:06:44Z ashnazg $ See package.xml for changelogs for all releases. Release details are under the <package><changelog> section, in the various <release> tags. Specific changelog info for each release is under each <release><notes> tag. vim: set expandtab:
INSTALL
$Id: INSTALL 256227 2008-03-28 02:27:12Z ashnazg $ phpDocumentor Installation instructions ---------------------------------------
phpDocumentor is very easy to install. The hardest part is installing PHP and possibly a Web Server, if you plan to use the web interface phpdoc.php. To install phpDocumentor, use a compression program to decompress the contents to a directory, preserving internal directory structure of the archive. If you wish to use the web interface, you must unzip the archive into a subdirectory accessible by the web server. NOTE: There have been problems with the non GNU tar not being able to extracts some of the long directory paths properly. The simplest solution for BSD users is to download the zip version of phpDocumentor. PEAR installation ----------------This is by far the easiest way to install phpDocumentor. Included in this release is a package.xml file. If you plan to use the web interface, you must run this command prior to installation: pear config-set data_dir /path/to/public_html/pear The line above assumes that /path/to/public_html is the location of index.html if you browse to http://localhost/index.html To install or upgrade phpDocumentor, simply run pear upgrade PhpDocumentor To use the web interface, browse to http://localhost/pear/PhpDocumentor/index.html The cli interface is installed in the pear bin_dir, you can find this directory by running: pear config-show Command-line interface installation and usage instructions ---------------------------------------------------------To use phpDocumentor as a command-line interface, you need to install PHP version 4.1.0 or greater. *IMPORTANT* any version of PHP below 4.1.0 will not work with version 1.3.0 or later of phpDocumentor!!! To use the advanced tokenizer-based parser, you must have php 4.3.0 Windows ------You need the cli version of PHP (php-cli.exe or cli/php.exe in 4.3.0+). Either run phpDocumentor from the directory that PHP resides in, or put php.exe in your DOS PATH enviroment variable. The simplest usage of phpDocumentor is: C:\>php.exe "C:\Path\To\phpdoc" -t targetdir -o HTML:default:default -d parsedir where targetdir is the directory you wish phpDocumentor to create output, and parsedir is the directory you wish to parse. Unix ---Make sure that the cgi/cli version of PHP is in your path. The simplest usage of phpDocumentor is: phpdoc -t targetdir -o HTML:default:default -d parsedir
You can also use makedoc.sh. Simply copy it to your project path and edit it. When you wish to (re)build your project's documentation, simply run it.
Web interface installation and usage instructions ------------------------------------------------To use phpDocumentor as a web interface, you need to install a Web server and configure it, as well as install PHP version 4.1.0 or greater. Consult the documentation of your webserver and of PHP for installation support. Windows and Unix ---------------Open a web browser and browse to index.html at the location that you set up. Instructions are in the web interface. vim: set expandtab :
FAQ
################################################################################ phpDocumentor Frequently Asked Questions ################################################################################ Introduction ################################################################################ Before we start with questions and their answers, make sure to read the documentation *thoroughly* found at http://www.phpdoc.org/manual.php. The complexity of phpDocumentor can be a bit impenetrable until you understand the logic behind it. If you have read the documentation thoroughly, and have read this FAQ and you are still lost, please go directly to the bug database at http://sourceforge.net/tracker/?group_id=11194&atid=111194 and read through the open bugs. If you don't find the solution to your problem (or proof that it at least is not your fault), then go to the help forum and post a help message at http://sourceforge.net/forum/forum.php?forum_id=35065. ################################################################################ All Questions (Table of Contents) ################################################################################ Installation Q: There is no package.xml in the release, where is it? Documentation Errors Q: I keep getting an illegal package tag error for the first DocBlock in a file, isn't this a page-level DocBlock? Q: I keep getting a warning that there is no @package tag in file xxx.php, but there is a @package tag in the class definition, doesn't this apply to the file? Feature Requests Q: Can you implement the @example tag inline so that I can put PHP source code examples directly in DocBlocks? Crash/Segfaults
Q: phpDocumentor crashes if I use __FUNCTION__!!! ################################################################################ Installation ################################################################################ Q: There is no package.xml in the release, where is it? A: this problem occurs when one does the faulty steps of: $ tar xvf PhpDocumentor-1.3.1.tgz $ pear install package.xml instead, the user should simply run: $ pear install PhpDocumentor-1.3.1.tgz or, if the zlib extension is not enabled: $ gunzip PhpDocumentor-1.3.1.tgz $ pear install PhpDocumentor-1.3.1.tar ################################################################################ Documentation Errors ################################################################################ Q: I keep getting an illegal package tag error for the first DocBlock in a file, isn't this a page-level DocBlock? -----[[UPDATE]] ---VERSION 1.2.2 has a different page-level docblock recognition algorithm ---Now, the first docblock in a file is a page-level docblock if it contains ---a @package tag. --A: Please read the documentation very carefully. A page-level DocBlock does occur at the start of a file, but the first DocBlock is not always a page-level DocBlock! Why is this? Very often, you will want to document the entire page, or describe it (this page contains functions for blah), and also document the first item in a page separately. An example: <?php /** * This file contains all foobar functions and defines * @package mypackage */ /** * controls parsing of bar information */ define('parse_bar',true); ?> The page has its own information, and the define has its own information. An example of what not to do: <?php /** * This file contains all foobar functions and defines * @package mypackage
*/ define('parse_bar',true); ?> Here, the DocBlock belongs to the define and not to the page! phpDocumentor can successfully parse this DocBlock, but it will apply the comment to the documentation of define('parse_bar',true); and not to the page. Therefore, it warns you that your @package tag will be ignored because defines may not contain a @package tag. Q: I keep getting a warning that there is no @package tag in file xxx.php, but there is a @package tag in the class definition, doesn't this apply to the file? A: No. This example does not have a page-level DocBlock: <?php /** * This class is in package mypackage * @package mypackage */ class in_mypackage {...} ?> phpDocumentor therefore assumes the page-level package is the same as the class package, mypackage. This is fine in most cases, but if multiple classes are in the same file with different packages, as in: <?php /** * This class is in package mypackage * @package mypackage */ class in_mypackage {...} /** * This class is in package anotherpackage * @package anotherpackage */ class in_anotherpackage {...} ?> There is no way to determine which package the page should belong to, and phpDocumentor will automatically put it in the default package. This can cause incredible headaches debugging, and so we have added a warning in the 1.2.0 series that informs you if the package is inferred by phpDocumentor. To fix this warning, simply place a page-level DocBlock with a @package tag like: <?php /** * This file contains two packages * @package filepackage */ /** * This class is in package mypackage * @package mypackage */ class in_mypackage {...} /**
* This class is in package anotherpackage * @package anotherpackage */ class in_anotherpackage {...} ?> ################################################################################ Feature Requests ################################################################################ Q: Can you implement the @example tag inline so that I can put PHP source code examples directly in DocBlocks? A: This is implemented using the HTML <code></code> tags as in: /** * Short description * * Start of long description, here is a code example: * <code> * $my_phpcode = "easy to explain"; * </code> * More text * <code> * define('morecode',true); * </code> */ ################################################################################ Crash/Segfaults ################################################################################ Q: phpDocumentor crashes if I use __FUNCTION__!!! A: This is caused by a known bug in all PHP versions prior to 4.3.2. It was fixed in PHP 4.3.2RC1, you must upgrade to PHP 4.3.2 if you use __FUNCTION__ in code that you wish to document (sorry!) or apply the bugfix patch to the tokenizer extension and recompile php (see the php.internals archive at php.net for help)
Package phpDocumentor
elements.}}} 67 * 68 * @package Converters 69 * @abstract 70 * @author Greg Beaver <[email protected]> 71 * @since 1.0rc1 72 * @version $Id: Converter.inc 287891 2009-08-30 08:08:00Z ashnazg $ 73 */ 74 class Converter 75 { 76 /** 77 * This converter knows about the new root tree processing 78 * In order to fix PEAR Bug #6389 79 * @var boolean 80 */ 81 var $processSpecialRoots = false; 82 /** 83 * output format of this converter 84 * 85 * in Child converters, this will match the first part of the -o command-line 86 * as in -o HTML:frames:default "HTML" 87 * @tutorial phpDocumentor.howto.pkg#using.command-line.output 88 * @var string 89 */ 90 var $outputformat = 'Generic'; 91 /** 92 * package name currently being converted 93 * @var string 94 */ 95 var $package = 'default'; 96 /** 97 * subpackage name currently being converted 98 * @var string 99 */ 100 var $subpackage = ''; 101 /** 102 * set to a classname if currently parsing a class, false if not 103 * @var string|false 104 */ 105 var $class = false; 106 /**#@+ 107 * @access private 108 */ 109 /** 110 * the workhorse of linking. 111 * 112 * This array is an array of link objects of format: 113 * [package][subpackage][eltype][elname] = descendant of {@link abstractLink} 114 * eltype can be page|function|define|class|method|var 115 * if eltype is method or var, the array format is: 116 * [package][subpackage][eltype][class][elname] 117 * @var array 118 * @see functionLink, pageLink, classLink, defineLink, methodLink, varLink, globalLink 119 */ 120 var $links = array(); 121 122 /** 123 * the workhorse of linking, with allowance for support of multiple 124 * elements in different files. 125 * 126 * This array is an array of link objects of format: 127 * [package][subpackage][eltype][file][elname] = descendant of {@link abstractLink} 128 * eltype can be function|define|class|method|var 129 * if eltype is method or var, the array format is: 130 * [package][subpackage][eltype][file][class][elname] 131 * @var array 132 * @see functionLink, pageLink, classLink, defineLink, methodLink, varLink, globalLink 133 */ 134 var $linkswithfile = array(); 135 /**#@-*/ 136 /** 137 * set to value of -po commandline 138 * @tutorial phpDocumentor.howto.pkg#using.command-line.packageoutput 139 * @var mixed 140 */ 141 var $package_output; 142 143 /** 144 * name of current page being converted 145 * @var string
146 */ 147 var $page; 148 149 /** 150 * path of current page being converted 151 * @var string 152 */ 153 var $path; 154 155 /** 156 * template for the procedural page currently being processed 157 * @var Smarty 158 */ 159 var $page_data; 160 161 /** 162 * template for the class currently being processed 163 * @var Smarty 164 */ 165 var $class_data; 166 167 /** 168 * current procedural page being processed 169 * @var parserPage 170 */ 171 var $curpage; 172 /** 173 * alphabetical index of all elements sorted by package, subpackage, page, 174 * and class. 175 * @var array Format: array(package => array(subpackage => array('page'|'class' => array(path|classname => array(element, element,...))))) 176 * @uses $sort_absolutely_everything if true, then $package_elements is used, 177 * otherwise, the {@link ParserData::$classelements} and 178 * {@link ParserData::$pageelements} variables are used 179 */ 180 var $package_elements = array(); 181 /** 182 * alphabetical index of all elements 183 * 184 * @var array Format: array(first letter of element name => array( {@link parserElement} or {@link parserPage},...)) 185 * @see formatIndex(), HTMLframesConverter::formatIndex() 186 */ 187 var $elements = array(); 188 /** 189 * alphabetized index of procedural pages by package 190 * 191 * @see $leftindex 192 * @var array Format: array(package => array(subpackage => array( {@link pageLink} 1,{@link pageLink} 2,...) 193 */ 194 var $page_elements = array(); 195 /** 196 * alphabetized index of defines by package 197 * 198 * @see $leftindex 199 * @var array Format: array(package => array(subpackage => array( {@link defineLink} 1,{@link defineLink} 2,...) 200 */ 201 var $define_elements = array(); 202 /** 203 * alphabetized index of classes by package 204 * 205 * @see $leftindex 206 * @var array Format: array(package => array(subpackage => array( {@link classLink} 1,{@link classLink} 2,...) 207 */ 208 var $class_elements = array(); 209 /** 210 * alphabetized index of global variables by package 211 * 212 * @see $leftindex 213 * @var array Format: array(package => array(subpackage => array( {@link globalLink} 1,{@link globalLink} 2,...) 214 */ 215 var $global_elements = array(); 216 /** 217 * alphabetized index of functions by package 218 * 219 * @see $leftindex
220 * @var array Format: array(package => array(subpackage => array( {@link functionLink} 1,{@link functionLink} 2,...) 221 */ 222 var $function_elements = array(); 223 /** 224 * alphabetical index of all elements, indexed by package/subpackage 225 * 226 * @var array Format: array(first letter of element name => array( {@link parserElement} or {@link parserPage},...)) 227 * @see formatPkgIndex(), HTMLframesConverter::formatPkgIndex() 228 */ 229 var $pkg_elements = array(); 230 231 /** 232 * alphabetical index of all elements on a page by package/subpackage 233 * 234 * The page itself has a link under ###main 235 * @var array Format: array(package => array(subpackage => array(path => array({@link abstractLink} descendant 1, ...))) 236 * @see formatLeftIndex() 237 */ 238 var $page_contents = array(); 239 240 /** 241 * This determines whether the {@link $page_contents} array should be sorted by element type as well as alphabetically by name 242 * @see sortPageContentsByElementType() 243 * @var boolean 244 */ 245 var $sort_page_contents_by_type = false; 246 /** 247 * This is used if the content must be passed in the order it should be read, i.e. by package, procedural then classes 248 * 249 * This fixes bug 637921, and is used by {@link PDFdefaultConverter} 250 */ 251 var $sort_absolutely_everything = false; 252 /** 253 * alphabetical index of all methods and vars in a class by package/subpackage 254 * 255 * The class itself has a link under ###main 256 * @var array 257 * Format:<pre> 258 * array(package => 259 * array(subpackage => 260 * array(path => 261 * array(class => 262 * array({@link abstractLink} descendant 1, ... 263 * ) 264 * ) 265 * ) 266 * )</pre> 267 * @see formatLeftIndex() 268 */ 269 var $class_contents = array(); 270 /** 271 * controls processing of elements marked private with @access private 272 * 273 * defaults to false. Set with command-line --parseprivate or -pp 274 * @var bool 275 */ 276 var $parseprivate; 277 /** 278 * controls display of progress information while parsing. 279 * 280 * defaults to false. Set to true for cron jobs or other situations where no visual output is necessary 281 * @var bool 282 */ 283 var $quietmode; 284 285 /** 286 * directory that output is sent to. -t command-line sets this. 287 * @tutorial phpDocumentor.howto.pkg#using.command-line.target 288 */ 289 var $targetDir = ''; 290 291 /** 292 * Directory that the template is in, relative to phpDocumentor root directory 293 * @var string
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
*/ var $templateDir = ''; /** * Directory that the smarty templates are in * @var string */ var $smarty_dir = ''; /** * Name of the template, from last part of -o * @tutorial phpDocumentor.howto.pkg#using.command-line.output * @var string */ var $templateName = ''; /** * full path of the current file being converted */ var $curfile; /** * All class information, organized by path, and by package * @var Classes */ var $classes; /** * Flag used to help converters determine whether to do special source highlighting * @var boolean */ var $highlightingSource = false; /** * Hierarchy of packages * * Every package that contains classes may have parent or child classes * in other packages. In other words, this code is legal: * * <code> * /** * * @package one * * / * class one {} * * /** * * @package two * * / * class two extends one {} * </code> * * In this case, package one is a parent of package two * @var array * @see phpDocumentor_IntermediateParser::$package_parents */ var $package_parents; /** * Packages associated with categories * * Used by the XML:DocBook/peardoc2 converter, and available to others, to * group many packages into categories * @see phpDocumentor_IntermediateParser::$packagecategories * @var array */ var $packagecategories; /** * All packages encountered in parsing * @var array * @see phpDocumentor_IntermediateParser::$all_packages */ var $all_packages; /** * A list of files that have had source code generated * @var array */ var $sourcePaths = array();
374 /** 375 * Controls which of the one-element-only indexes are generated. 376 * 377 * Generation of these indexes for large packages is time-consuming. This is an optimization feature. An 378 * example of how to use this is in {@link HTMLframesConverter::$leftindex}, and in {@link HTMLframesConverter::formatLeftIndex()}. 379 * These indexes are intended for use as navigational aids through documentation, but can be used for anything by converters. 380 * @see $class_elements, $page_elements, $function_elements, $define_elements, $global_elements 381 * @see formatLeftIndex() 382 * @var array 383 */ 384 var $leftindex = array('classes' => true, 'pages' => true, 'functions' => true, 'defines' => true, 'globals' => true); 385 386 /** @access private */ 387 var $killclass = false; 388 /** 389 * @var string 390 * @see phpDocumentor_IntermediateParser::$title 391 */ 392 var $title = 'Generated Documentation'; 393 394 /** 395 * Options for each template, parsed from the options.ini file in the template base directory 396 * @tutorial phpDocumentor/tutorials.pkg#conversion.ppage 397 * @var array 398 */ 399 var $template_options; 400 401 /** 402 * Tutorials and Extended Documentation parsed from a tutorials/package[/subpackage] directory 403 * @tutorial tutorials.pkg 404 * @access private 405 */ 406 var $tutorials = array(); 407 408 /** 409 * tree-format structure of tutorials and their child tutorials, if any 410 * @var array 411 * @access private 412 */ 413 var $tutorial_tree = false; 414 415 /** 416 * list of tutorials that have already been processed. Used by @link _setupTutorialTree() 417 * @var array 418 * @access private 419 */ 420 var $processed_tutorials; 421 422 /** 423 * List of all @todo tags and a link to the element with the @todo 424 * 425 * Format: array(package => array(link to element, array(todo {@link parserTag},...)),...) 426 * @tutorial tags.todo.pkg 427 * @var array 428 */ 429 var $todoList = array(); 430 431 /** 432 * Directory where compiled templates go - will be deleted on exit 433 * 434 * @var string 435 * @access private 436 */ 437 var $_compiledDir = array(); 438 439 /** 440 * Initialize Converter data structures 441 * @param array {@link $all_packages} value 442 * @param array {@link $package_parents} value 443 * @param Classes {@link $classes} value 444 * @param ProceduralPages {@link $proceduralpages} value 445 * @param array {@link $package_output} value
446 * @param boolean {@link $parseprivate} value 447 * @param boolean {@link $quietmode} value 448 * @param string {@link $targetDir} value 449 * @param string {@link $templateDir} value 450 * @param string (@link $title} value 451 */ 452 function Converter(& $allp, & $packp, & $classes, & $procpages, $po, $pp, $qm, $targetDir, $template, $title) 453 { 454 $this-> all_packages = $allp; 455 $this-> package_parents = $packp; 456 $this-> package = $GLOBALS['phpDocumentor_DefaultPackageName']; 457 $this-> proceduralpages = & $procpages; 458 $this-> package_output = $po; 459 if (is_array($po)) 460 { 461 $a = $po[0]; 462 $this-> all_packages = array_flip($po); 463 $this-> all_packages[$a] = 1; 464 } 465 $this-> parseprivate = $pp; 466 $this-> quietmode = $qm; 467 $this-> classes = & $classes; 468 $this-> roots = $classes-> getRoots($this-> processSpecialRoots); 469 $this-> title = $title; 470 $this-> setTemplateDir($template); 471 $this-> setTargetdir($targetDir); 472 } 473 474 /** 475 * Called by IntermediateParser after creation 476 * @access private 477 */ 478 function setTutorials($tutorials) 479 { 480 $this-> tutorials = $tutorials; 481 } 482 483 /** 484 * @param pkg|cls|procthe tutorial type to search for 485 * @param tutorial name 486 * @param string package name 487 * @param string subpackage name, if any 488 * @return false|parserTutorialif the tutorial exists, return it 489 */ 490 function hasTutorial($type, $name, $package, $subpackage = '') 491 { 492 if (isset($this-> tutorials[$package][$subpackage][$type][$name . '.' . $type])) 493 return $this-> tutorials[$package][$subpackage][$type][$name . '.' . $type]; 494 return false; 495 } 496 497 /** 498 * Called by {@link walk()} while converting, when the last class element 499 * has been parsed. 500 * 501 * A Converter can use this method in any way it pleases. HTMLframesConverter 502 * uses it to complete the template for the class and to output its 503 * documentation 504 * @see HTMLframesConverter::endClass() 505 * @abstract 506 */ 507 function endClass() 508 { 509 } 510 511 /** 512 * Called by {@link walk()} while converting, when the last procedural page 513 * element has been parsed. 514 * 515 * A Converter can use this method in any way it pleases. HTMLframesConverter 516 * uses it to complete the template for the procedural page and to output its 517 * documentation 518 * @see HTMLframesConverter::endClass() 519 * @abstract 520 */ 521 function endPage() 522 { 523 } 524
525 /** 526 * Called by {@link walk()} while converting. 527 * 528 * This method is intended to be the place that {@link $pkg_elements} is 529 * formatted for output. 530 * @see HTMLframesConverter::formatPkgIndex() 531 * @abstract 532 */ 533 function formatPkgIndex() 534 { 535 } 536 537 /** 538 * Called by {@link walk()} while converting. 539 * 540 * This method is intended to be the place that {@link $elements} is 541 * formatted for output. 542 * @see HTMLframesConverter::formatIndex() 543 * @abstract 544 */ 545 function formatIndex() 546 { 547 } 548 549 /** 550 * Called by {@link walk()} while converting. 551 * 552 * This method is intended to be the place that any of 553 * {@link $class_elements, $function_elements, $page_elements}, 554 * {@link $define_elements}, and {@link $global_elements} is formatted for 555 * output, depending on the value of {@link $leftindex} 556 * @see HTMLframesConverter::formatLeftIndex() 557 * @abstract 558 */ 559 function formatLeftIndex() 560 { 561 } 562 563 /** 564 * Called by {@link parserSourceInlineTag::stringConvert()} to allow 565 * converters to format the source code the way they'd like. 566 * 567 * default returns it unchanged (html with xhtml tags) 568 * @param string output from highlight_string() - use this function to 569 * reformat the returned data for Converter-specific output 570 * @return string 571 * @deprecated in favor of tokenizer-based highlighting. This will be 572 * removed for 2.0 573 */ 574 function unmangle($sourcecode) 575 { 576 return $sourcecode; 577 } 578 579 /** 580 * Initialize highlight caching 581 */ 582 function startHighlight() 583 { 584 $this-> _highlightCache = array(false, false); 585 $this-> _appendHighlight = ''; 586 } 587 588 function getHighlightState() 589 { 590 return $this-> _highlightCache; 591 } 592 593 function _setHighlightCache($type, $token) 594 { 595 $test = ($this-> _highlightCache[0] === $type && $this-> _highlightCache[1] == $token); 596 if (!$test) { 597 $this-> _appendHighlight = $this-> flushHighlightCache(); 598 } else { 599 $this-> _appendHighlight = ''; 600 } 601 $this-> _highlightCache = array($type, $token); 602 return $test; 603 }
604 605 /** 606 * Return the close text for the current token 607 * @return string 608 */ 609 function flushHighlightCache() 610 { 611 $hc = $this-> _highlightCache; 612 $this-> _highlightCache = array(false, false); 613 if ($hc[0]) { 614 if (!isset($this-> template_options[$hc[0]]['/'.$hc[1]])) { 615 return ''; 616 } 617 return $this-> template_options[$hc[0]]['/'.$hc[1]]; 618 } 619 return ''; 620 } 621 622 /** 623 * Used to allow converters to format the source code the way they'd like. 624 * 625 * default returns it unchanged. Mainly used by the {@link HighlightParser} 626 * {@internal 627 * The method takes information from options.ini, the template options 628 * file, specifically the [highlightSourceTokens] and [highlightSource] 629 * sections, and uses them to enclose tokens. 630 * 631 * {@source } } 632 * @param integer token value from {@link PHP_MANUAL#tokenizer tokenizer constants} 633 * @param string contents of token 634 * @param boolean whether the contents are preformatted or need modification 635 * @return string 636 */ 637 function highlightSource($token, $word, $preformatted = false) 638 { 639 if ($token !== false) 640 { 641 if (!$preformatted) $word = $this-> postProcess($word); 642 if (isset($this-> template_options['highlightSourceTokens'][token_name($token)])) 643 { 644 if ($this-> _setHighlightCache('highlightSourceTokens', token_name($token))) { 645 return $word; 646 } 647 $e = $this-> _appendHighlight; 648 return $e . $this> template_options['highlightSourceTokens'][token_name($token)] . $word; 649 } else 650 { 651 $this-> _setHighlightCache(false, false); 652 $e = $this-> _appendHighlight; 653 return $e . $word; 654 } 655 } else 656 { 657 if (isset($this-> template_options['highlightSource'][$word])) 658 { 659 $newword = ($preformatted ? $word : $this-> postProcess($word)); 660 if ($this-> _setHighlightCache('highlightSource', $word)) { 661 return $newword; 662 } 663 $e = $this-> _appendHighlight; 664 return $e . $this-> template_options['highlightSource'][$word] . $newword; 665 } else 666 { 667 $this-> _setHighlightCache(false, false); 668 $e = $this-> _appendHighlight; 669 return $e . ($preformatted ? $word : $this-> postProcess($word)); 670 } 671 } 672 } 673 674 /** 675 * Used to allow converters to format the source code of DocBlocks the way 676 * they'd like. 677 * 678 * default returns it unchanged. Mainly used by the {@link HighlightParser} 679 * {@internal 680 * The method takes information from options.ini, the template options 681 * file, specifically the [highlightDocBlockSourceTokens] section, and uses 682 * it to enclose tokens.
683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 $word; 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 $word; 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760
* * {@source } } * @param string name of docblock token type * @param string contents of token * @param boolean whether the contents are preformatted or need modification * @return string */ function highlightDocBlockSource($token, $word, $preformatted = false) { if (empty($word)) { $this-> _setHighlightCache(false, false); $e = $this-> _appendHighlight; return $e . $word; } if (isset($this-> template_options['highlightDocBlockSourceTokens'][$token])) { if (!$preformatted) $word = $this-> postProcess($word); if ($this-> _setHighlightCache('highlightDocBlockSourceTokens', $token)) { return $word; } $e = $this-> _appendHighlight; return $e . $this-> template_options['highlightDocBlockSourceTokens'][$token] . } else { $this-> _setHighlightCache(false, false); $e = $this-> _appendHighlight; return $e . ($preformatted ? $word : $this-> } } /** * Used to allow converters to format the source code of Tutorial XML the way * they'd like. * * default returns it unchanged. Mainly used by the {@link HighlightParser} * {@internal * The method takes information from options.ini, the template options * file, specifically the [highlightDocBlockSourceTokens] section, and uses * it to enclose tokens. * * {@source } } * @param string name of docblock token type * @param string contents of token * @param boolean whether the contents are preformatted or need modification * @return string */ function highlightTutorialSource($token, $word, $preformatted = false) { if (empty($word)) { $this-> _setHighlightCache(false, false); $e = $this-> _appendHighlight; return $e . $word; } if (isset($this-> template_options['highlightTutorialSourceTokens'][$token])) { if (!$preformatted) $word = $this-> postProcess($word); if ($this-> _setHighlightCache('highlightTutorialSourceTokens', $token)) { return $word; } $e = $this-> _appendHighlight; return $e . $this-> template_options['highlightTutorialSourceTokens'][$token] . } else { $this-> _setHighlightCache(false, false); $e = $this-> _appendHighlight; return $e . ($preformatted ? $word : $this-> } } /** * Called by {@link parserReturnTag::Convert()} to allow converters to * change type names to desired formatting * * Used by {@link XMLDocBookConverter::type_adjust()} to change true and * false to the peardoc2 values * @param string * @return string */ function type_adjust($typename) {
postProcess($word));
postProcess($word));
761 return $typename; 762 } 763 764 /** 765 * Used to convert the {@}example} inline tag in a docblock. 766 * 767 * By default, this just wraps ProgramExample 768 * @see XMLDocBookpeardoc2Converter::exampleProgramExample 769 * @param string 770 * @param boolean true if this is to highlight a tutorial <programlisting> 771 * @return string 772 */ 773 function exampleProgramExample($example, $tutorial = false, $inlinesourceparse = null/*false*/, 774 $class = null/*false*/, $linenum = null/*false*/, $filesourcepath = null/*false*/) 775 { 776 return $this-> ProgramExample($example, $tutorial, $inlinesourceparse, $class, $linenum, $filesourcepath); 777 } 778 779 /** 780 * Used to convert the <<code>> tag in a docblock 781 * @param string 782 * @param boolean true if this is to highlight a tutorial <programlisting> 783 * @return string 784 */ 785 function ProgramExample($example, $tutorial = false, $inlinesourceparse = null/*false*/, 786 $class = null/*false*/, $linenum = null/*false*/, $filesourcepath = null/*false*/) 787 { 788 $this-> highlightingSource = true; 789 if (tokenizer_ext) 790 { 791 $e = $example; 792 if (!is_array($example)) 793 { 794 $obj = new phpDocumentorTWordParser; 795 $obj-> setup($example); 796 $e = $obj-> getFileSource(); 797 $bOpenTagFound = false; 798 foreach ($e as $ke => $ee) 799 { 800 foreach ($ee as $kee => $eee) 801 { 802 if ((int) $e[$ke][$kee][0] == T_OPEN_TAG) 803 { 804 $bOpenTagFound = true; 805 } 806 } 807 } 808 if (!$bOpenTagFound) { 809 $example = "<?php\n" .$example; 810 $obj-> setup($example); 811 $e = $obj-> getFileSource(); 812 unset($e[0]); 813 $e = array_values($e); 814 } 815 unset($obj); 816 } 817 $saveclass = $this-> class; 818 $parser = new phpDocumentor_HighlightParser; 819 if (!isset($inlinesourceparse)) 820 { 821 $example = $parser-> parse($e, $this, true); // force php mode 822 } else 823 { 824 if (isset($filesourcepath)) 825 { 826 $example = $parser-> parse($e, $this, $inlinesourceparse, $class, $linenum, $filesourcepath); 827 } elseif (isset($linenum)) 828 { 829 $example = $parser-> parse($e, $this, $inlinesourceparse, $class, $linenum); 830 } elseif (isset($class)) 831 { 832 $example = $parser-> parse($e, $this, $inlinesourceparse, $class); 833 } else 834 {
835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914
$example = $parser-> }
} $this-> class = $saveclass; } else { $example = $this-> postProcess($example); } $this-> highlightingSource = false; if ($tutorial) { return $example; } if (!isset($this-> template_options['desctranslate'])) return $example; if (!isset($this-> template_options['desctranslate']['code'])) return $example; $example = $this-> template_options['desctranslate']['code'] . $example; if (!isset($this-> template_options['desctranslate']['/code'])) return $example; return $example . $this-> template_options['desctranslate']['/code']; } /** * @param string */ function TutorialExample($example) { $this-> highlightingSource = true; $parse = new phpDocumentor_TutorialHighlightParser; $x = $parse-> parse($example, $this); $this-> highlightingSource = false; return $x; } /** * Used to convert the contents of <<li>> in a docblock * @param string * @return string */ function ListItem($item) { if (!isset($this-> template_options['desctranslate'])) return $item; if (!isset($this-> template_options['desctranslate']['li'])) return $item; $item = $this-> template_options['desctranslate']['li'] . $item; if (!isset($this-> template_options['desctranslate']['/li'])) return $item; return $item . $this-> template_options['desctranslate']['/li']; } /** * Used to convert the contents of <<ol>> or <<ul>> in a docblock * @param string * @return string */ function EncloseList($list,$ordered) { $listname = ($ordered ? 'ol' : 'ul'); if (!isset($this-> template_options['desctranslate'])) return $list; if (!isset($this-> template_options['desctranslate'][$listname])) return $list; $list = $this-> template_options['desctranslate'][$listname] . $list; if (!isset($this-> template_options['desctranslate']['/'.$listname])) return $list; return $list . $this-> template_options['desctranslate']['/'.$listname]; } /** * Used to convert the contents of <<pre>> in a docblock * @param string * @return string */ function PreserveWhiteSpace($string) { if (!isset($this-> template_options['desctranslate'])) return $string; if (!isset($this-> template_options['desctranslate']['pre'])) return $string; $string = $this-> template_options['desctranslate']['pre'] . $string; if (!isset($this-> template_options['desctranslate']['/pre'])) return $string; return $string . $this-> template_options['desctranslate']['/pre']; } /** * Used to enclose a paragraph in a docblock * @param string
915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994
* @return string */ function EncloseParagraph($para) { if (!isset($this-> template_options['desctranslate'])) return $para; if (!isset($this-> template_options['desctranslate']['p'])) return $para; $para = $this-> template_options['desctranslate']['p'] . $para; if (!isset($this-> template_options['desctranslate']['/p'])) return $para; return $para . $this-> template_options['desctranslate']['/p']; } /** * Used to convert the contents of <<b>> in a docblock * @param string * @return string */ function Bolden($para) { if (!isset($this-> template_options['desctranslate'])) return $para; if (!isset($this-> template_options['desctranslate']['b'])) return $para; $para = $this-> template_options['desctranslate']['b'] . $para; if (!isset($this-> template_options['desctranslate']['/b'])) return $para; return $para . $this-> template_options['desctranslate']['/b']; } /** * Used to convert the contents of <<i>> in a docblock * @param string * @return string */ function Italicize($para) { if (!isset($this-> template_options['desctranslate'])) return $para; if (!isset($this-> template_options['desctranslate']['i'])) return $para; $para = $this-> template_options['desctranslate']['i'] . $para; if (!isset($this-> template_options['desctranslate']['/i'])) return $para; return $para . $this-> template_options['desctranslate']['/i']; } /** * Used to convert the contents of <<var>> in a docblock * @param string * @return string */ function Varize($para) { if (!isset($this-> template_options['desctranslate'])) return $para; if (!isset($this-> template_options['desctranslate']['var'])) return $para; $para = $this-> template_options['desctranslate']['var'] . $para; if (!isset($this-> template_options['desctranslate']['/var'])) return $para; return $para . $this-> template_options['desctranslate']['/var']; } /** * Used to convert the contents of <<kbd>> in a docblock * @param string * @return string */ function Kbdize($para) { if (!isset($this-> template_options['desctranslate'])) return $para; if (!isset($this-> template_options['desctranslate']['kbd'])) return $para; $para = $this-> template_options['desctranslate']['kbd'] . $para; if (!isset($this-> template_options['desctranslate']['/kbd'])) return $para; return $para . $this-> template_options['desctranslate']['/kbd']; } /** * Used to convert the contents of <<samp>> in a docblock * @param string * @return string */ function Sampize($para) { if (!isset($this-> template_options['desctranslate'])) return $para; if (!isset($this-> template_options['desctranslate']['samp'])) return $para; $para = $this-> template_options['desctranslate']['samp'] . $para; if (!isset($this-> template_options['desctranslate']['/samp'])) return $para; return $para . $this-> template_options['desctranslate']['/samp']; }
995 996 /** 997 * Used to convert <<br>> in a docblock 998 * @param string 999 * @return string 1000 */ 1001 function Br($para) 1002 { 1003 if (!isset($this-> template_options['desctranslate'])) return $para; 1004 if (!isset($this-> template_options['desctranslate']['br'])) return $para; 1005 $para = $this-> template_options['desctranslate']['br'] . $para; 1006 return $para; 1007 } 1008 1009 /** 1010 * This version does nothing 1011 * 1012 * Perform necessary post-processing of string data. For example, the HTML 1013 * Converters should escape < and > to become < and > 1014 * @return string 1015 */ 1016 function postProcess($text) 1017 { 1018 return $text; 1019 } 1020 1021 /** 1022 * Creates a table of contents for a {@}toc} inline tag in a tutorial 1023 * 1024 * This function should return a formatted table of contents. By default, it 1025 * does nothing, it is up to the converter to format the TOC 1026 * @abstract 1027 * @return string table of contents formatted for use in the current output format 1028 * @param array format: array(array('tagname' => section, 'link' => returnsee link, 'id' => anchor name, 'title' => from title tag),...) 1029 */ 1030 function formatTutorialTOC($toc) 1031 { 1032 return ''; 1033 } 1034 1035 /** 1036 * Write out the formatted source code for a php file 1037 * 1038 * This function provides the primary functionality for the 1039 * {@tutorial tags.filesource.pkg} tag. 1040 * @param string full path to the file 1041 * @param string fully highlighted/linked source code of the file 1042 * @abstract 1043 */ 1044 function writeSource($filepath, $source) 1045 { 1046 debug($source); 1047 return; 1048 } 1049 1050 /** 1051 * Write out the formatted source code for an example php file 1052 * 1053 * This function provides the primary functionality for the 1054 * {@tutorial tags.example.pkg} tag. 1055 * @param string example title 1056 * @param string example filename (no path) 1057 * @param string fully highlighted/linked source code of the file 1058 * @abstract 1059 */ 1060 function writeExample($title, $path, $source) 1061 { 1062 return; 1063 } 1064 1065 /** Translate the path info into a unique file name for the highlighted 1066 * source code. 1067 * @param string $pathinfo 1068 * @return string 1069 */ 1070 function getFileSourceName($path) 1071 { 1072 global $_phpDocumentor_options; 1073 $pathinfo = $this-> proceduralpages-> getPathInfo($path, $this);
1074 $pathinfo['source_loc'] = str_replace($_phpDocumentor_options['Program_Root'].'/','',$pathinfo['source_loc']); 1075 $pathinfo['source_loc'] = str_replace('/','_',$pathinfo['source_loc']); 1076 return " fsource_{$pathinfo['package']}_{$pathinfo['subpackage']}_{$pathinfo['source_loc']}" 1077 } 1078 1079 /** Return the fixed path to the source-code file folder. 1080 * @param string $base Path is relative to this folder 1081 * @return string 1082 */ 1083 function getFileSourcePath($base) 1084 { 1085 if (substr($base, strlen($base) - 1) != PATH_DELIMITER) { 1086 $base .= PATH_DELIMITER; 1087 } 1088 return $base . '__filesource'; 1089 } 1090 1091 /** Return the path to the current 1092 * @param string $pathinfo 1093 * @return string 1094 */ 1095 function getCurrentPageURL() 1096 { 1097 return '{$srcdir}' . PATH_DELIMITER . $this-> page_dir; 1098 } 1099 1100 /** 1101 * @return string an output-format dependent link to phpxref-style highlighted 1102 * source code 1103 * @abstract 1104 */ 1105 function getSourceLink($path) 1106 { 1107 return ''; 1108 } 1109 1110 /** 1111 * @return string Link to the current page being parsed. 1112 * Should return {@link $curname} and a converter-specific extension. 1113 * @abstract 1114 */ 1115 function getCurrentPageLink() 1116 { 1117 } 1118 1119 /** 1120 * Return a line of highlighted source code with formatted line number 1121 * 1122 * If the $path is a full path, then an anchor to the line number will be 1123 * added as well 1124 * @param integer line number 1125 * @param string highlighted source code line 1126 * @param false|stringfull path to @filesource file this line is a part of, 1127 * if this is a single line from a complete file. 1128 * @return string formatted source code line with line number 1129 */ 1130 function sourceLine($linenumber, $line, $path = false) 1131 { 1132 if ($path) 1133 { 1134 return $this-> getSourceAnchor($path, $linenumber) . 1135 $this-> Br(sprintf('%6u',$linenumber).str_replace("\n" ,'',$line)); 1136 } else 1137 { 1138 return $this-> Br(sprintf('%6u',$linenumber).str_replace("\n" ,'',$line)); 1139 } 1140 } 1141 1142 /** 1143 * Determine whether an element's file has generated source code, used for 1144 * linking to line numbers of source. 1145 * 1146 * Wrapper for {@link $sourcePaths} in this version 1147 * 1148 * {@internal since file paths get stored with most/all slashes 1149 * set to forward slash '/', we need to doublecheck that
1150 * we're not given a backslashed path to search for... 1151 * if we are, it's likely that it was originally stored 1152 * with a forward slash. Further, I'm not convinced it's safe 1153 * to just check the {@link PHPDOCUMENTOR_WINDOWS} flag, so I'm checking 1154 * specifically for backslashes intead.}}} 1155 * 1156 * @param string full path to the source code file 1157 * @return boolean 1158 */ 1159 function hasSourceCode($path) 1160 { 1161 return isset($this-> sourcePaths[$path]); 1162 if (strpos($path, '\\') > 1) { 1163 $modifiedPath = str_replace('\\', '/', $path); 1164 return isset($this-> sourcePaths[$modifiedPath]); 1165 } else { 1166 return isset($this-> sourcePaths[$path]); 1167 } 1168 } 1169 1170 /** 1171 * Mark a file as having had source code highlighted 1172 * @param string full path of source file 1173 */ 1174 function setSourcePaths($path) 1175 { 1176 $this-> sourcePaths[$path] = true; 1177 } 1178 1179 /** 1180 * Used to translate an XML DocBook entity like ” from a tutorial by 1181 * reading the options.ini file for the template. 1182 * @param string entity name 1183 */ 1184 function TranslateEntity($name) 1185 { 1186 if (!isset($this-> template_options['ppage'])) 1187 { 1188 if (!$this-> template_options['preservedocbooktags']) 1189 return ''; 1190 else 1191 return '&' .$name.';'; 1192 } 1193 if (isset($this-> template_options['ppage']['&' .$name.';'])) 1194 { 1195 return $this-> template_options['ppage']['&' .$name.';']; 1196 } else 1197 { 1198 if (!$this-> template_options['preservedocbooktags']) 1199 return ''; 1200 else 1201 return '&' .$name.';'; 1202 } 1203 } 1204 1205 /** 1206 * Used to translate an XML DocBook tag from a tutorial by reading the 1207 * options.ini file for the template. 1208 * @param string tag name 1209 * @param string any attributes Format: array(name => value) 1210 * @param string the tag contents, if any 1211 * @param string the tag contents, if any, unpost-processed 1212 * @return string 1213 */ 1214 function TranslateTag($name,$attr,$cdata,$unconvertedcdata) 1215 { 1216 if (!isset($this-> template_options['ppage'])) 1217 { 1218 if (!$this-> template_options['preservedocbooktags']) 1219 return $cdata; 1220 else 1221 return '<' .$name.$this> AttrToString($name,$attr,true).'>' .$cdata.'</' .$name.'>' ."\n" ; 1222 } 1223 // make sure this template transforms the tag into something 1224 if (isset($this-> template_options['ppage'][$name])) 1225 { 1226 // test for global attribute transforms like $attr$role = class, changing 1227 // all role="*" attributes to class="*" in html, for example 1228 foreach($attr as $att => $val)
1229 { 1230 if (isset($this-> template_options['$attr$'.$att])) 1231 { 1232 $new = ''; 1233 if (!isset($this-> template_options['$attr$'.$att]['close'])) 1234 { 1235 $new .= '<' .$this-> template_options['$attr$'.$att]['open']; 1236 if (isset($this-> template_options['$attr$'.$att]['cdata!'])) 1237 { 1238 if (isset($this-> template_options['$attr$'.$att]['separateall'])) 1239 $new .= $this-> template_options['$attr$'.$att]['separator']; 1240 else 1241 $new .= ' '; 1242 $new .= $this-> template_options['$attr$'.$att]['$'.$att]; 1243 $new .= $this-> template_options['$attr$'.$att]['separator']; 1244 if ($this-> template_options['$attr$'.$att]['quotevalues']) $val = '"' .$val.'"' ; 1245 $new .= $val.'>' ; 1246 } else 1247 { 1248 $new .= '>' .$val; 1249 } 1250 $new .= '</' .$this> template_options['$attr$'.$att]['open'].'>' ; 1251 } else 1252 { 1253 $new .= $this-> template_options['$attr$'.$att]['open'] . $val . $this-> template_options['$attr$'.$att]['close']; 1254 } 1255 unset($attr[$att]); 1256 $cdata = $new . $cdata; 1257 } 1258 } 1259 1260 if (!isset($this-> template_options['ppage']['/'.$name])) 1261 {// if the close tag isn't specified, we put opening and closing tags around it, with translated attributes 1262 if (isset($this-> template_options['ppage'][$name.'/'])) 1263 $cdata = '<' .$this-> template_options['ppage'][$name].$this> AttrToString($name,$attr).'/>' . $cdata; 1264 else 1265 $cdata = '<' .$this-> template_options['ppage'][$name].$this> AttrToString($name,$attr).'>' . $cdata . 1266 '</' .$this-> template_options['ppage'][$name].'>' ; 1267 } else 1268 { // if close tag is specified, use the open and close as literal 1269 if ($name == 'programlisting' && isset( $attr['role']) && 1270 ($attr['role'] == 'php' || $attr['role'] == 'tutorial' || $attr['role'] == 'html')) 1271 { // highlight PHP source 1272 // var_dump($unconvertedcdata, $cdata);exit; 1273 if ($attr['role'] == 'php') { 1274 $cdata = $this-> ProgramExample($unconvertedcdata, true); 1275 } elseif ($attr['role'] == 'tutorial') { 1276 $cdata = $this-> TutorialExample($unconvertedcdata); 1277 } elseif ($attr['role'] == 'html') { 1278 $cdata = $unconvertedcdata; 1279 } 1280 } else 1281 {// normal case below 1282 $cdata = $this-> template_options['ppage'][$name].$this> AttrToString($name,$attr). $cdata .$this-> template_options['ppage']['/'.$name]; 1283 } 1284 } 1285 return $cdata; 1286 } else 1287 { 1288 if ($this-> template_options['preservedocbooktags']) 1289 { 1290 return '<' .$name.$this-> AttrToString($name,$attr,true).'>' . $cdata . 1291 '</' .$name.'>' ."\n" ; 1292 } else 1293 { 1294 return $cdata; 1295 } 1296 } 1297 } 1298 1299 /** 1300 * Convert the attribute of a Tutorial docbook tag's attribute list
1301 * to a string based on the template options.ini 1302 * @param string tag name 1303 * @param attribute array 1304 * @param boolean if true, returns attrname="value"... 1305 * @return string 1306 */ 1307 function AttrToString($tag,$attr,$unmodified = false) 1308 { 1309 $ret = ''; 1310 if ($unmodified) 1311 { 1312 $ret = ' '; 1313 foreach($attr as $n => $v) 1314 { 1315 $ret .= $n.' = "' .$v.'"' ; 1316 } 1317 return $ret; 1318 } 1319 // no_attr tells us to ignore all attributes 1320 if (isset($this-> template_options['no_attr'])) return $ret; 1321 // tagname! tells us to ignore all attributes for this tag 1322 if (isset($this-> template_options['ppage'][$tag.'!'])) return $ret; 1323 if (count($attr)) $ret = ' '; 1324 // pass 1, check to see if any attributes add together 1325 $same = array(); 1326 foreach($attr as $n => $v) 1327 { 1328 if (isset($this-> template_options['ppage'][$tag.'->' .$n])) 1329 { 1330 $same[$this-> template_options['ppage'][$tag.'->' .$n]][] = $n; 1331 } 1332 } 1333 foreach($attr as $n => $v) 1334 { 1335 if (isset($this-> template_options['ppage'][$tag.'->' .$n])) 1336 { 1337 if (count($same[$this-> template_options['ppage'][$tag.'->' .$n]]) == 1) 1338 { // only 1 attribute translated for this one 1339 // this is useful for equivalent value names 1340 if (isset($this-> template_options['ppage'][$tag.'->' .$n.'+'.$v])) $v = $this-> template_options['ppage'][$tag.'->' .$n.'+'.$v]; 1341 } else 1342 { // more than 1 attribute combines to make the new attribute 1343 $teststrtemp = array(); 1344 foreach($same[$this-> template_options['ppage'][$tag.'->' .$n]] as $oldattr) 1345 { 1346 $teststrtemp[] = $oldattr.'+'.$attr[$oldattr]; 1347 } 1348 $teststrs = array(); 1349 $num = count($same[$this-> template_options['ppage'][$tag.'->' .$n]]); 1350 for($i=0;$i< $num;$i++) 1351 { 1352 $started = false; 1353 $a = ''; 1354 for($j=$i;!$started || $j != $i;$j = ($j + $i) % $num) 1355 { 1356 if (!empty($a)) $a .= '|'; 1357 $a .= $teststrtemp[$j]; 1358 } 1359 $teststrs[$i] = $a; 1360 } 1361 $done = false; 1362 foreach($teststrs as $test) 1363 { 1364 if ($done) break; 1365 if (isset($this-> template_options['ppage'][$tag.'->' .$test])) 1366 { 1367 $done = true; 1368 $v = $this-> template_options['ppage'][$tag.'->' .$test]; 1369 } 1370 } 1371 } 1372 $ret .= $this-> template_options['ppage'][$tag.'->' .$n].' = "' .$v.'"' ; 1373 } else 1374 { 1375 if (!isset($this-> template_options['ppage'][$tag.'!'.$n])) 1376 { 1377 if (isset($this-> template_options['ppage']['$attr$'.$n]))
1378 "' 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456
template_options['ppage']['$attr$'.$n].' = .$v.'"' ;
/** * Convert the title of a Tutorial docbook tag section * to a string based on the template options.ini * @param string tag name * @param array * @param string title text * @param string * @return string */ function ConvertTitle($tag,$attr,$title,$cdata) { if (!isset($this-> template_options[$tag.'_title'])) return array($attr,$cdata); if (isset($this-> template_options[$tag.'_title']['tag_attr'])) { $attr[$this-> template_options[$tag.'_title']['tag_attr']] = urlencode($cdata); $cdata = ''; } elseif(isset($this-> template_options[$tag.'_title']['cdata_start'])) { $cdata = $this-> template_options[$tag.'_title']['open'] . $title . $this-> template_options[$tag.'_title']['close'] . $cdata; } else $cdata = $title.$cdata; return array($attr,$cdata); } /** * Return a converter-specific id to distinguish tutorials and their * sections * * Used by {@}id} * @return string */ function getTutorialId($package,$subpackage,$tutorial,$id) { return $package.$subpackage.$tutorial.$id; } /** * Create the {@link $elements, $pkg_elements} and {@link $links} arrays * @access private * @todo version 2.0 - faulty package_output logic should be removed * * in this version, if the parent file isn't in the package, all * the procedural elements are simply shunted to another package! */ function _createPkgElements(& $pages) { if (empty($this-> elements)) { $this-> elements = array(); $this-> pkg_elements = array(); $this-> links = array(); phpDocumentor_out('Building indexes...'); flush(); foreach($pages as $j => $flub) { $this-> package = $pages[$j]-> parent-> package; $this-> subpackage = $pages[$j]-> parent-> subpackage; $this-> class = false; $this-> curfile = $pages[$j]-> parent-> getFile(); $this-> curname = $this-> getPageName($pages[$j]-> parent); $this-> curpath = $pages[$j]-> parent-> getPath(); $use = true; if ($this-> package_output) { if (in_array($this-> package,$this-> package_output)) { $this-> addElement($pages[$j]-> parent,$pages[$j]); } else { if (count($pages[$j]-> classelements))
1457 { 1458 list(,$pages[$j]-> parent-> package) = each($this> package_output); 1459 reset($this-> package_output); 1460 $pages[$j]-> parent-> subpackage = ''; 1461 $this-> addElement($pages[$j]-> parent,$pages[$j]); 1462 } else 1463 { 1464 unset($pages[$j]); 1465 continue; 1466 } 1467 } 1468 } else 1469 { 1470 $this-> addElement($pages[$j]-> parent,$pages[$j]); 1471 } 1472 if ($use) 1473 for($i=0; $i< count($pages[$j]-> elements); $i++) 1474 { 1475 $pages[$j]-> elements[$i]-> docblock-> package = $this-> package; 1476 $pages[$j]-> elements[$i]-> docblock-> subpackage = $this> subpackage; 1477 $this-> proceduralpages-> replaceElement($pages[$j]-> elements[$i]); 1478 $this-> addElement($pages[$j]-> elements[$i]); 1479 } 1480 for($i=0; $i< count($pages[$j]-> classelements); $i++) 1481 { 1482 if ($this-> class) 1483 { 1484 if ($pages[$j]-> classelements[$i]-> type == 'class') 1485 { 1486 if ($this-> checkKillClass($pages[$j]-> classelements[$i]> getName(),$pages[$j]-> classelements[$i]-> getPath())) continue; 1487 $this-> package = $pages[$j]-> classelements[$i]-> docblock> package; 1488 if ($this-> package_output) if (!in_array($this-> package,$this> package_output)) continue; 1489 $this-> subpackage = $pages[$j]-> classelements[$i]> docblock-> subpackage; 1490 $this-> class = $pages[$j]-> classelements[$i]-> name; 1491 } else 1492 { 1493 if ($this-> killclass) continue; 1494 // force all contained elements to have parent package/subpackage 1495 $pages[$j]-> classelements[$i]-> docblock-> package = $this> package; 1496 $pages[$j]-> classelements[$i]-> docblock-> subpackage = $this-> subpackage; 1497 } 1498 } 1499 if ($pages[$j]-> classelements[$i]-> type == 'class') 1500 { 1501 if ($this-> checkKillClass($pages[$j]-> classelements[$i]> getName(),$pages[$j]-> classelements[$i]-> getPath())) continue; 1502 $this-> package = $pages[$j]-> classelements[$i]-> docblock> package; 1503 if ($this-> package_output) if (!in_array($this-> package,$this> package_output)) continue; 1504 $this-> subpackage = $pages[$j]-> classelements[$i]-> docblock> subpackage; 1505 $this-> class = $pages[$j]-> classelements[$i]-> name; 1506 } 1507 if (!$this-> killclass) $this-> addElement($pages[$j]> classelements[$i]); 1508 } 1509 } 1510 phpDocumentor_out("done\n" ); 1511 flush(); 1512 } 1513 $this-> sortIndexes(); 1514 $this-> sortTodos(); 1515 if ($this-> sort_page_contents_by_type) $this> sortPageContentsByElementType($pages); 1516 } 1517 1518 /** 1519 * Process the {@link $tutorials} array 1520 * 1521 * Using the tutorialname.ext.ini files, this method sets up tutorial 1522 * hierarchy. There is some minimal error checking to make sure that no
1523 * tutorial links to itself, even two levels deep as in tute->next->tute. 1524 * 1525 * If all tests pass, it creates the hierarchy 1526 * @uses generateTutorialOrder() 1527 * @uses _setupTutorialTree() 1528 * @access private 1529 */ 1530 function _processTutorials() 1531 { 1532 $parents = $all = array(); 1533 foreach($this-> tutorials as $package => $els) 1534 { 1535 if ($this-> package_output) 1536 { 1537 if (!in_array($package,$this-> package_output)) 1538 { 1539 unset($this-> tutorials[$package]); 1540 continue; 1541 } 1542 } 1543 if (!isset($this-> pkg_elements[$package])) 1544 { 1545 unset($this-> tutorials[$package]); 1546 continue; 1547 } 1548 foreach($els as $subpackage => $els2) 1549 { 1550 foreach($els2 as $type => $tutorials) 1551 { 1552 foreach($tutorials as $tutorial) 1553 { 1554 if ($tutorial-> ini) 1555 { 1556 if (isset($tutorial-> ini['Linked Tutorials'])) 1557 { 1558 foreach($tutorial-> ini['Linked Tutorials'] as $child) 1559 { 1560 $sub = (empty($tutorial-> subpackage) ? '' : $tutorial> subpackage . '/'); 1561 $kid = $tutorial-> package . '/' . $sub . $child . '.' . $tutorial-> tutorial_type; 1562 // parent includes self as a linked tutorial? 1563 $kidlink = $this> getTutorialLink($kid,false,false,array($tutorial-> package)); 1564 if (is_object($kidlink) && $this> returnSee($kidlink) == $tutorial-> getLink($this)) 1565 { // bad! 1566 addErrorDie(PDERROR_TUTORIAL_IS_OWN_CHILD,$tutorial> name,$tutorial-> name.'.ini'); 1567 } 1568 } 1569 $parents[] = $tutorial; 1570 } 1571 } 1572 $all[$package][$subpackage][$type][] = $tutorial; 1573 } 1574 } 1575 } 1576 } 1577 // loop error-checking, use this to eliminate possibility of accidentally linking to a parent as a child 1578 $testlinks = array(); 1579 foreach($parents as $parent) 1580 { 1581 $testlinks[$parent-> name]['links'][] = $parent-> getLink($this); 1582 $testlinks[$parent-> name]['name'][$parent-> getLink($this)] = $parent-> name; 1583 } 1584 // generate the order of tutorials, and link them together 1585 foreach($parents as $parent) 1586 { 1587 foreach($parent-> ini['Linked Tutorials'] as $child) 1588 { 1589 $sub = (empty($parent-> subpackage) ? '' : $parent-> subpackage . '/'); 1590 $kid = $parent-> package . '/' . $sub . $child . '.' . $parent> tutorial_type; 1591 // child tutorials must be in the same package AND subpackage 1592 // AND have the same extension as the parent, makes things clearer for both ends 1593 if (in_array($this-> returnSee($this> getTutorialLink($kid,false,false,array($parent-> package))),$testlinks[$parent> name]['links']))
1594 addErrorDie(PDERROR_TUTORIAL_IS_OWN_GRANDPA,$testlinks[$parent> name][$this-> returnSee($this-> getTutorialLink($kid,false,false,array($parent> package)))],$kid-> name,$testlinks[$parent-> name][$this-> returnSee($this> getTutorialLink($kid,false,false,array($parent-> package)))],$kid-> name.'.ini'); 1595 if ($this-> returnSee($this> getTutorialLink($kid,false,false,array($parent-> package))) == $kid) 1596 { 1597 addWarning(PDERROR_CHILD_TUTORIAL_NOT_FOUND, $child . '.' . $parent> tutorial_type, $parent-> name .'.ini',$parent-> package, $parent-> subpackage); 1598 } 1599 } 1600 } 1601 $new = $tree = $roots = array(); 1602 // build a list of all 'root' tutorials (tutorials without parents). 1603 foreach($parents as $i => $parent) 1604 { 1605 if (! $parent-> isChildOf($parents)) { 1606 $roots[] = $parent; 1607 } 1608 } 1609 $parents = $roots; 1610 // add the parents and all child tutorials in order to the list of tutorials to process 1611 foreach($parents as $parent) 1612 { 1613 $this-> generateTutorialOrder($parent,$all,$new); 1614 } 1615 if (count($all)) 1616 { 1617 // add the leftover tutorials 1618 foreach($all as $package => $els) 1619 { 1620 foreach($els as $subpackage => $els2) 1621 { 1622 foreach($els2 as $type => $tutorials) 1623 { 1624 foreach($tutorials as $tutorial) 1625 { 1626 $new[$package][$subpackage][$type][] = $tutorial; 1627 } 1628 } 1629 } 1630 } 1631 } 1632 // remove the old, unprocessed tutorials, and set it up with the next code 1633 $this-> tutorials = array(); 1634 // reset integrity of the tutorial list 1635 $prev = false; 1636 uksort($new, 'tutorialcmp'); 1637 // debug($this->vardump_tree($new));exit; 1638 foreach($new as $package => $els) 1639 { 1640 foreach($els as $subpackage => $els2) 1641 { 1642 foreach($els2 as $type => $tutorials) 1643 { 1644 foreach($tutorials as $tutorial) 1645 { 1646 if ($prev) 1647 { 1648 $this> tutorials[$prevpackage][$prevsubpackage][$prevtype][$prevname]-> setNext($tutorial,$this); 1649 $tutorial-> setPrev($prev,$this); 1650 } 1651 $this-> tutorials[$package][$subpackage][$type][$tutorial-> name] = $tutorial; 1652 $prev = $tutorial-> getLink($this,true); 1653 $prevpackage = $package; 1654 $prevsubpackage = $subpackage; 1655 $prevtype = $type; 1656 $prevname = $tutorial-> name; 1657 } 1658 } 1659 } 1660 } 1661 $this-> tutorial_tree = $this-> _setupTutorialTree(); 1662 return $new; 1663 } 1664 1665 /** 1666 * called by {@link phpDocumentor_IntermediateParser::Convert()} to traverse
1667 * the array of pages and their elements, converting them to the output format 1668 * 1669 * The walk() method should be flexible enough such that it never needs 1670 * modification. walk() sets up all of the indexes, and sorts everything in 1671 * logical alphabetical order. It then passes each element individually to 1672 * {@link Convert()}, which then passes to the Convert*() methods. A child 1673 * Converter need not override any of these unless special functionality must 1674 * be added. see {@tutorial Converters/template.vars.cls} for details. 1675 * {@internal 1676 * walk() first creates all of the indexes {@link $elements, $pkg_elements} 1677 * and the left indexes specified by {@link $leftindexes}, 1678 * and then sorts them by calling {@link sortIndexes()}. 1679 * 1680 * Next, it converts all README/CHANGELOG/INSTALL-style files, using 1681 * {@link Convert_RIC}. 1682 * 1683 * After this, it 1684 * passes all package-level docs to Convert(). Then, it calls the index 1685 * sorting functions {@link formatPkgIndex(), formatIndex()} and 1686 * {@link formatLeftIndex()}. 1687 * 1688 * Finally, it converts each procedural page in alphabetical order. This 1689 * stage passes elements from the physical file to Convert() in alphabetical 1690 * order. First, procedural page elements {@link parserDefine, parserInclude} 1691 * {@link parserGlobal}, and {@link parserFunction} are passed to Convert(). 1692 * 1693 * Then, class elements are passed in this order: {@link parserClass}, then 1694 * all of the {@link parserVar}s in the class and all of the 1695 * {@link parserMethod}s in the class. Classes are in alphabetical order, 1696 * and both vars and methods are in alphabetical order. 1697 * 1698 * Finally, {@link ConvertErrorLog()} is called and the data walk is complete.}}} 1699 * @param array Format: array(fullpath => {@link parserData} structure with full {@link parserData::$elements} 1700 * and {@link parserData::$class_elements}. 1701 * @param array Format: array({@link parserPackagePage} 1, {@link parserPackagePage} 2,...) 1702 * @uses Converter::_createPkgElements() sets up {@link $elements} and 1703 * {@link $pkg_elements} array, as well as {@link $links} 1704 */ 1705 function walk(& $pages,& $package_pages) 1706 { 1707 if (empty($pages)) 1708 { 1709 die("<b>ERROR</b>: nothing parsed" ); 1710 } 1711 $this-> _createPkgElements($pages); 1712 if (count($this-> ric)) 1713 { 1714 phpDocumentor_out("Converting README/INSTALL/CHANGELOG contents...\n" ); 1715 flush(); 1716 foreach($this-> ric as $name => $contents) 1717 { 1718 phpDocumentor_out(" $name..." ); 1719 flush(); 1720 $this-> Convert_RIC($name,$contents); 1721 } 1722 phpDocumentor_out("\ndone\n" ); 1723 flush(); 1724 } 1725 foreach($package_pages as $i => $perp) 1726 { 1727 if ($this-> package_output) 1728 { 1729 if (!in_array($package_pages[$i]-> package,$this-> package_output)) continue; 1730 } 1731 phpDocumentor_out('Converting package page for package '.$package_pages[$i]> package.'... '); 1732 flush(); 1733 $this-> package = $package_pages[$i]-> package; 1734 $this-> subpackage = ''; 1735 $this-> class = false; 1736 $this-> Convert($package_pages[$i]); 1737 phpDocumentor_out("done\n" ); 1738 flush(); 1739 } 1740 phpDocumentor_out("Converting tutorials/extended docs\n" ); 1741 flush(); 1742 // get tutorials into the order they will display, and set next/prev links 1743 $new = $this-> _processTutorials();
1744 foreach($this-> tutorials as $package => $els) 1745 { 1746 foreach($els as $subpackage => $els2) 1747 { 1748 foreach($els2 as $type => $tutorials) 1749 { 1750 foreach($tutorials as $tutorial) 1751 { 1752 switch ($type) 1753 { 1754 case 'pkg' : 1755 $a = ''; 1756 if ($tutorial-> ini) 1757 $a .= 'Top-level '; 1758 if (!empty($tutorial-> subpackage)) 1759 $a .= 'Sub-'; 1760 $ptext = " Converting ${a}Package-level tutorial " .$tutorial-> name.'...'; 1761 break; 1762 case 'cls' : 1763 $a = ''; 1764 if ($tutorial-> ini) 1765 $a .= 'Top-level '; 1766 $ptext = " Converting ${a}Class-level tutorial " . $tutorial-> name ." and associating..." ; 1767 $link = Converter::getClassLink(str_replace('.cls','',$tutorial> name), $tutorial-> package); 1768 if (is_object($link)) 1769 { 1770 if ($this-> sort_absolutely_everything) 1771 { 1772 $addend = 'unsuccessful '; 1773 if (isset($this-> package_elements[$tutorial> package][$tutorial-> subpackage]['class'][$link-> name])) 1774 { 1775 $this-> package_elements[$tutorial> package][$tutorial-> subpackage]['class'][$link-> name][0]-> addTutorial($tutorial,$this); 1776 $addend = 'success '; 1777 } 1778 } else 1779 { 1780 $addend = 'unsuccessful '; 1781 if (!isset($this-> classes> killclass[str_replace('.cls','',$tutorial-> name)]) && !isset( $this-> classes> killclass[str_replace('.cls','',$tutorial-> name)][$tutorial-> path])) 1782 { 1783 foreach($pages as $j => $inf) 1784 { 1785 foreach($inf-> classelements as $i => $class) 1786 { 1787 if ($class-> type == 'class' && $class-> name == str_replace('.cls','',$tutorial-> name) && $class-> path == $link> path) 1788 { 1789 $pages[$j]-> classelements[$i]> addTutorial($tutorial,$this); 1790 $addend = 'success '; 1791 } 1792 } 1793 } 1794 } 1795 } 1796 $ptext .= $addend; 1797 } else $ptext .= "unsuccessful " ; 1798 break; 1799 case 'proc' : 1800 $a = ''; 1801 if ($tutorial-> ini) 1802 $a .= 'Top-level '; 1803 $ptext = " Converting ${a}Procedural-level tutorial " .$tutorial-> name." and associating..." ; 1804 $link = Converter::getPageLink(str_replace('.proc','',$tutorial> name), $tutorial-> package); 1805 if (is_object($link)) 1806 { 1807 $addend = 'unsuccessful '; 1808 if ($this-> sort_absolutely_everything) 1809 { 1810 if (isset($this-> package_elements[$tutorial-
> package][$tutorial-> subpackage]['page'][$link-> path])) 1811 { 1812 $this-> package_elements[$tutorial> package][$tutorial-> subpackage]['page'][$link-> path][0]-> addTutorial($tutorial,$this); 1813 $addend = "success " ; 1814 } 1815 } else 1816 { 1817 foreach($pages as $j => $info) 1818 { 1819 if ($j == $link-> path) 1820 { 1821 $pages[$j]-> addTutorial($tutorial,$this); 1822 $addend = "success " ; 1823 } 1824 } 1825 } 1826 $ptext .= $addend; 1827 } else $ptext .= "unsuccessful " ; 1828 break; 1829 } 1830 phpDocumentor_out($ptext); 1831 flush(); 1832 $this-> package = $tutorial-> package; 1833 $this-> subpackage = $tutorial-> subpackage; 1834 $this-> Convert($tutorial); 1835 phpDocumentor_out("done\n" ); 1836 flush(); 1837 } 1838 } 1839 } 1840 } 1841 phpDocumentor_out("Formatting Package Indexes..." ); 1842 flush(); 1843 $this-> formatPkgIndex(); 1844 phpDocumentor_out("done\n" ); 1845 flush(); 1846 phpDocumentor_out("Formatting Index..." ); 1847 flush(); 1848 $this-> formatIndex(); 1849 phpDocumentor_out("done\n\n" ); 1850 flush(); 1851 phpDocumentor_out("Formatting Left Quick Index..." ); 1852 flush(); 1853 $this-> formatLeftIndex(); 1854 phpDocumentor_out("done\n\n" ); 1855 flush(); 1856 if ($this-> sort_absolutely_everything) return $this-> walk_everything(); 1857 foreach($pages as $j => $flub) 1858 { 1859 phpDocumentor_out('Converting '.$pages[$j]-> parent-> getPath()); 1860 flush(); 1861 $this-> package = $pages[$j]-> parent-> package; 1862 $this-> subpackage = $pages[$j]-> parent-> subpackage; 1863 $this-> class = false; 1864 $this-> curfile = $pages[$j]-> parent-> getFile(); 1865 $this-> curname = $this-> getPageName($pages[$j]-> parent); 1866 $this-> curpath = $pages[$j]-> parent-> getPath(); 1867 $use = true; 1868 if ($this-> package_output) 1869 { 1870 if (in_array($this-> package,$this-> package_output)) 1871 { 1872 $this-> Convert($pages[$j]); 1873 } else 1874 { 1875 $use = false; 1876 } 1877 } else 1878 { 1879 $this-> Convert($pages[$j]); 1880 } 1881 phpDocumentor_out(" Procedural Page Elements..." ); 1882 flush(); 1883 if ($use) 1884 for($i=0; $i< count($pages[$j]-> elements); $i++) 1885 { 1886 $a = $pages[$j]-> elements[$i]-> docblock-> getKeyword('access'); 1887 if (is_object($a)) $a = $a-> getString(); 1888 if (!$this-> parseprivate && ( $a == 'private'))
1889 continue; 1890 // phpDocumentor_out(" ".$pages[$j]->elements[$i]>name."\n"); 1891 $pages[$j]-> elements[$i]-> docblock-> package = $this-> package; 1892 $pages[$j]-> elements[$i]-> docblock-> subpackage = $this-> subpackage; 1893 $this-> Convert($pages[$j]-> elements[$i]); 1894 } 1895 phpDocumentor_out(" Classes..." ); 1896 $this-> class = false; 1897 flush(); 1898 for($i=0; $i< count($pages[$j]-> classelements); $i++) 1899 { 1900 if ($this-> class) 1901 { 1902 if ($pages[$j]-> classelements[$i]-> type == 'class') 1903 { 1904 if (!$this-> killclass) $this-> endClass(); 1905 $this-> killclass = false; 1906 if ($this-> checkKillClass($pages[$j]-> classelements[$i]> getName(),$pages[$j]-> classelements[$i]-> getPath())) continue; 1907 $this-> package = $pages[$j]-> classelements[$i]-> docblock> package; 1908 if ($this-> package_output) if (!in_array($this-> package,$this> package_output)) continue; 1909 $this-> subpackage = $pages[$j]-> classelements[$i]-> docblock> subpackage; 1910 $this-> class = $pages[$j]-> classelements[$i]-> name; 1911 } else 1912 { 1913 $a = $pages[$j]-> classelements[$i]-> docblock> getKeyword('access'); 1914 if (is_object($a)) $a = $a-> getString(); 1915 if (!$this-> parseprivate && ( $a == 'private')) 1916 continue; 1917 if ($this-> killclass) continue; 1918 // force all contained elements to have parent package/subpackage 1919 $pages[$j]-> classelements[$i]-> docblock-> package = $this> package; 1920 $pages[$j]-> classelements[$i]-> docblock-> subpackage = $this> subpackage; 1921 } 1922 } 1923 if ($pages[$j]-> classelements[$i]-> type == 'class') 1924 { 1925 $this-> killclass = false; 1926 if ($this-> checkKillClass($pages[$j]-> classelements[$i]> getName(),$pages[$j]-> classelements[$i]-> getPath())) continue; 1927 $this-> package = $pages[$j]-> classelements[$i]-> docblock> package; 1928 if ($this-> package_output) if (!in_array($this-> package,$this> package_output)) continue; 1929 $this-> subpackage = $pages[$j]-> classelements[$i]-> docblock> subpackage; 1930 $this-> class = $pages[$j]-> classelements[$i]-> name; 1931 } 1932 if ($this-> killclass) continue; 1933 // phpDocumentor_out(" ".$pages[$j]->classelements[$i]>name."\n"); 1934 $this-> Convert($pages[$j]-> classelements[$i]); 1935 } 1936 if (count($pages[$j]-> classelements) && ! $this-> killclass) $this> endClass(); 1937 phpDocumentor_out(" done\n" ); 1938 flush(); 1939 $this-> endPage(); 1940 } 1941 phpDocumentor_out("\nConverting @todo List..." ); 1942 flush(); 1943 if (count($this-> todoList)) 1944 { 1945 $this-> ConvertTodoList(); 1946 } 1947 phpDocumentor_out("done\n" ); 1948 flush(); 1949 phpDocumentor_out("\nConverting Error Log..." ); 1950 flush(); 1951 $this-> ConvertErrorLog(); 1952 phpDocumentor_out("done\n" ); 1953 flush(); 1954 }
1955 1956 1957 /** 1958 * Get a tree structure representing the hierarchy of tutorials 1959 * 1960 * Returns an array in format: 1961 * <pre> 1962 * array('tutorial' => {@link parserTutorial}, 1963 * 'kids' => array( // child tutorials 1964 * array('tutorial' => child {@link parserTutorial}, 1965 * 'kids' => array(...) 1966 * ) 1967 * ) 1968 * ) 1969 * </pre> 1970 * @param parserTutorial|array 1971 * @tutorial tutorials.pkg 1972 * @return array 1973 */ 1974 function getTutorialTree($tutorial) 1975 { 1976 if (is_object($tutorial)) 1977 { 1978 $path = $this-> _tutorial_path($tutorial,$tutorial,$tutorial); 1979 if (isset($this-> tutorial_tree[$path])) { 1980 $tutorial = $this-> tutorial_tree[$path]; 1981 } else { 1982 return false; 1983 } 1984 } 1985 $tree = array(); 1986 if (isset($tutorial['tutorial'])) 1987 { 1988 $tree['tutorial'] = $tutorial['tutorial']; 1989 if (isset($tutorial['child'])) 1990 { 1991 foreach($tutorial['child'] as $a => $b) 1992 { 1993 $btut = $b['tutorial']; 1994 $res = array( 1995 'tutorial' => $this-> tutorials 1996 [$btut-> package][$btut-> subpackage] 1997 [$btut-> tutorial_type][$btut-> name] 1998 ); 1999 if (isset($b['child'])) 2000 { 2001 $tempres = Converter::getTutorialTree($b); 2002 $res['kids'] = $tempres['kids']; 2003 } 2004 $tree['kids'][] = $res; 2005 } 2006 } 2007 } 2008 return $tree; 2009 } 2010 2011 /** 2012 * Remove tutorials one by one from $all, and transfer them into $new in the 2013 * order they should be parsed 2014 * @param parserTutorial 2015 * @param array 2016 * @param array 2017 * @access private 2018 */ 2019 function generateTutorialOrder($parent,& $all,& $new) 2020 { 2021 // remove from the list of tutorials to process 2022 foreach($all[$parent-> package][$parent-> subpackage][$parent-> tutorial_type] as $ind => $t) 2023 { 2024 if ($t-> name == $parent-> name) { 2025 unset($all[$parent-> package][$parent-> subpackage][$parent> tutorial_type][$ind]); 2026 } 2027 } 2028 // add to the new ordered list of tutorials 2029 $x = & $new[$parent-> package][$parent-> subpackage][$parent-> tutorial_type]; 2030 if (!is_object($x[count($x) - 1]) || $x[count($x) - 1]-> name != $parent-> name) 2031 { // only add if the parent isn't also a child 2032 $new[$parent-> package][$parent-> subpackage][$parent-> tutorial_type][] =
$parent; 2033 // add a new branch to the tree 2034 } 2035 // process all child tutorials, and insert them in order 2036 // debug("processing parent ".$parent->name); 2037 if ($parent-> ini) 2038 { 2039 foreach($parent-> ini['Linked Tutorials'] as $child) 2040 { 2041 $sub = (empty($parent-> subpackage) ? '' : $parent-> subpackage . '/'); 2042 $kid = $parent-> package . '/' . $sub . $child . '.' . $parent> tutorial_type; 2043 $_klink = $this-> getTutorialLink($kid,false,false,array($parent> package)); 2044 if (is_object($_klink)) { 2045 $klink = $this-> returnSee($_klink); 2046 } else { 2047 $klink = false; 2048 } 2049 // remove the child from the list of remaining tutorials 2050 foreach($all[$parent-> package][$parent-> subpackage][$parent> tutorial_type] as $ind => $tute) 2051 { 2052 if ($klink && $tute-> getLink($this) == $klink) 2053 { 2054 // set up parent, next and prev links 2055 $tute-> setParent($parent, $this); 2056 // remove the child from the list of tutorials to process 2057 foreach($all[$parent-> package][$parent-> subpackage][$parent> tutorial_type] as $ind => $t) 2058 { 2059 if ($t-> name == $tute-> name) 2060 unset($all[$parent-> package][$parent-> subpackage][$parent> tutorial_type][$ind]); 2061 } 2062 // add to the new ordered list of tutorials 2063 $new[$parent-> package][$parent-> subpackage][$parent> tutorial_type][] = $tute; 2064 if ($tute-> ini) 2065 { 2066 // add all the child's child tutorials to the list 2067 $this-> generateTutorialOrder($tute,$all,$new); 2068 } 2069 } 2070 } 2071 } 2072 } 2073 return; 2074 } 2075 2076 /** Returns the path to this tutorial as a string 2077 * @param parserTutorial $pkg 2078 * @param parserTutorial $subpkg 2079 * @param parserTutorial $namepkg 2080 * @return string */ 2081 function _tutorial_path($pkg, $subpkg = 0, $namepkg = 0) 2082 { 2083 if (!$subpkg) { 2084 $subpkg = $pkg; 2085 } 2086 if (!$namepkg) { 2087 $namepkg = $pkg; 2088 } 2089 $subpackagename = ($subpkg-> subpackage ? '/' . $subpkg-> subpackage : ''); 2090 return $pkg-> package . $subpackagename . '/' . $namepkg-> name; 2091 } 2092 2093 2094 /** 2095 * Creates a tree structure of tutorials 2096 * 2097 * Format: 2098 * <pre> 2099 * array('package/subpackage/tutorial1.ext' => 2100 * array('tutorial' => {@link parserTutorial}, 2101 * 'child' => 2102 * array('package/subpackage/child1tutorial.ext' => ..., 2103 * 'package/subpackage/child2tutorial.ext' => ..., 2104 * ... 2105 * )
2106 * 'package/subpackage/tutorial2.ext' => ..., 2107 * ... 2108 * ) 2109 * </pre> 2110 * @return array the tutorial tree 2111 * @access private 2112 */ 2113 function _setupTutorialTree($parent = false) 2114 { 2115 if (! isset($this-> processed_tutorials)) { 2116 $this-> processed_tutorials = array(); 2117 } 2118 $tree = array(); 2119 if (!$parent) 2120 { 2121 foreach($this-> tutorials as $package => $s) 2122 { 2123 foreach($s as $subpackage => $t) 2124 { 2125 foreach($t as $type => $n) 2126 { 2127 foreach($n as $name => $tutorial) 2128 { 2129 if ($tutorial-> parent) { 2130 continue; 2131 } 2132 2133 $child_path = $this> _tutorial_path($tutorial,$tutorial,$tutorial); 2134 if (isset($this-> processed_tutorials[$child_path])) { 2135 continue; 2136 } 2137 $this-> processed_tutorials[$child_path] = $tutorial; 2138 //debug("parent ".$tutorial->name); 2139 $ret = $this-> _setupTutorialTree($tutorial); 2140 if (!count($tree)) { 2141 $tree = $ret; 2142 } else { 2143 $tree = array_merge($tree,$ret); 2144 } 2145 } 2146 } 2147 } 2148 } 2149 return $tree; 2150 } 2151 $parent_path = $this-> _tutorial_path($parent); 2152 $tree[$parent_path]['tutorial'] = $parent; 2153 // process all child tutorials, and insert them in order 2154 if ($parent-> ini) 2155 { 2156 foreach($parent-> ini['Linked Tutorials'] as $child) 2157 { 2158 if (isset($this-> tutorials[$parent-> package][$parent-> subpackage] 2159 [$parent-> tutorial_type][$child . '.' . 2160 $parent-> tutorial_type])) { 2161 // remove the child from the list of remaining tutorials 2162 $tute = $this-> tutorials[$parent-> package][$parent-> subpackage] 2163 [$parent-> tutorial_type][$child . '.' . 2164 $parent-> tutorial_type]; 2165 } else { 2166 $tute = false; 2167 } 2168 2169 if (!$tute) { 2170 continue; 2171 } 2172 $child_path = $this-> _tutorial_path($parent,$parent,$tute); 2173 if (isset($this-> processed_tutorials[$child_path])) { 2174 continue; 2175 } 2176 $this-> processed_tutorials[$child_path] = $tute; 2177 if ($tute-> name != $child . '.' . $parent-> tutorial_type) { 2178 continue; 2179 } 2180 //echo "Adding [$child_path] to [$parent_path]<br>"; 2181 $tree[$parent_path]['child'][$this> _tutorial_path($parent,$parent,$tute)]['tutorial'] 2182 = $tute; 2183 if (!$tute-> ini) {
2184 continue; 2185 } 2186 // add all the child's child tutorials to the list 2187 if (!isset($tree[$parent_path]['child'])) { 2188 $tree[$parent_path]['child'] = $this-> _setupTutorialTree($tute); 2189 } else { 2190 $tree[$parent_path]['child'] = array_merge($tree[$parent_path]['child'], 2191 $this-> _setupTutorialTree($tute)); 2192 } 2193 } 2194 } 2195 return $tree; 2196 } 2197 2198 /** 2199 * Debugging function for dumping {@link $tutorial_tree} 2200 * @return string 2201 */ 2202 function vardump_tree($tree,$indent='') 2203 { 2204 if (phpDocumentor_get_class($tree) == 'parsertutorial') return $tree-> name.' extends '.($tree-> parent? $tree-> parent-> name : 'nothing'); 2205 $a = ''; 2206 foreach($tree as $ind => $stuff) 2207 { 2208 $x = $this-> vardump_tree($stuff," $indent " ); 2209 $a .= $indent.'['.$ind." => \n " .$indent.$x."]\n" ; 2210 } 2211 return substr($a,0,strlen($a) - 1); 2212 } 2213 2214 /** 2215 * @access private 2216 */ 2217 function sort_package_elements($a,$b) 2218 { 2219 if (($a-> type == $b-> type) && (isset( $a-> isConstructor) && $a> isConstructor)) return -1; 2220 if (($a-> type == $b-> type) && (isset( $b-> isConstructor) && $b> isConstructor)) return 1; 2221 if ($a-> type == $b-> type) return strnatcasecmp($a-> name,$b-> name); 2222 if ($a-> type == 'class') return -1; 2223 if ($b-> type == 'class') return 1; 2224 if ($a-> type == 'const') return -1; 2225 if ($b-> type == 'const') return 1; 2226 if ($a-> type == 'var') return -1; 2227 if ($b-> type == 'var') return 1; 2228 if ($a-> type == 'page') return -1; 2229 if ($b-> type == 'page') return 1; 2230 if ($a-> type == 'include') return -1; 2231 if ($b-> type == 'include') return 1; 2232 if ($a-> type == 'define') return -1; 2233 if ($b-> type == 'define') return 1; 2234 if ($a-> type == 'global') return -1; 2235 if ($b-> type == 'global') return 1; 2236 if ($a-> type == 'function') return -1; 2237 if ($b-> type == 'function') return 1; 2238 } 2239 2240 /** 2241 * @access private 2242 */ 2243 function defpackagesort($a,$b) 2244 { 2245 if ($a == $GLOBALS['phpDocumentor_DefaultPackageName']) return -1; 2246 if ($b == $GLOBALS['phpDocumentor_DefaultPackageName']) return 0; 2247 return strnatcasecmp($a,$b); 2248 } 2249 2250 /** 2251 * @access private 2252 */ 2253 function Pc_sort($a,$b) 2254 { 2255 return strnatcasecmp(key($a),key($b)); 2256 } 2257 2258 /** 2259 * walk over elements by package rather than page 2260 *
2261 * This method is designed for converters like the PDF converter that need 2262 * everything passed in alphabetical order by package/subpackage and by 2263 * procedural and then class information 2264 * @see PDFdefaultConverter 2265 * @see walk() 2266 */ 2267 function walk_everything() 2268 { 2269 global $hooser; 2270 $hooser = false; 2271 uksort($this-> package_elements,array($this,'defpackagesort')); 2272 foreach($this-> package_elements as $package => $r) 2273 { 2274 if ($this-> package_output) 2275 { 2276 if (!in_array($this-> package,$this-> package_output)) 2277 { 2278 unset($this-> package_elements[$package]); 2279 continue; 2280 } 2281 } 2282 uksort($this-> package_elements[$package],'strnatcasecmp'); 2283 } 2284 foreach($this-> package_elements as $package => $r) 2285 { 2286 foreach($this-> package_elements[$package] as $subpackage => $r) 2287 { 2288 if (isset($r['page'])) 2289 { 2290 uksort($r['page'],'strnatcasecmp'); 2291 foreach($r['page'] as $page => $oo) 2292 { 2293 usort($this> package_elements[$package][$subpackage]['page'][$page],array($this,'sort_package_elements')); 2294 } 2295 } 2296 if (isset($r['class'])) 2297 { 2298 uksort($r['class'],'strnatcasecmp'); 2299 foreach($r['class'] as $page => $oo) 2300 { 2301 usort($r['class'][$page],array($this,'sort_package_elements')); 2302 } 2303 } 2304 $this-> package_elements[$package][$subpackage] = $r; 2305 } 2306 } 2307 foreach($this-> package_elements as $package => $s) 2308 { 2309 $notyet = false; 2310 foreach($s as $subpackage => $r) 2311 { 2312 $this-> package = $package; 2313 $this-> subpackage = $subpackage; 2314 if (isset($r['page'])) 2315 { 2316 $this-> class = false; 2317 foreach($r['page'] as $page => $elements) 2318 { 2319 if (is_array($elements)) 2320 { 2321 foreach($elements as $element) 2322 { 2323 if ($element-> type == 'page') 2324 { 2325 phpDocumentor_out('Converting '.$element-> parent> getPath()); 2326 flush(); 2327 $this-> curfile = $element-> parent-> getFile(); 2328 $this-> curname = $this-> getPageName($element> parent); 2329 $this-> curpath = $element-> parent-> getPath(); 2330 $notyet = true; 2331 } else 2332 { 2333 // force all contained elements to have parent package/subpackage 2334 $element-> docblock-> package = $this-> package; 2335 $element-> docblock-> subpackage = $this-> subpackage; 2336 $a = $element-> docblock-> getKeyword('access');
2337 if (is_object($a)) $a = $a-> getString(); 2338 if (!$this-> parseprivate && ( $a == 'private')) 2339 continue; 2340 } 2341 if ($notyet) 2342 { 2343 phpDocumentor_out(" Procedural Page Elements..." ); 2344 flush(); 2345 $notyet = false; 2346 } 2347 $this-> Convert($element); 2348 } 2349 } 2350 $this-> endPage(); 2351 phpDocumentor_out("done\n" ); 2352 flush(); 2353 } 2354 } 2355 $start_classes = true; 2356 if (isset($r['class'])) 2357 { 2358 foreach($r['class'] as $class => $elements) 2359 { 2360 foreach($elements as $element) 2361 { 2362 if ($element-> type == 'class') 2363 { 2364 if (!$start_classes) 2365 { 2366 if (count($elements) && ! $this-> killclass) $this> endClass(); 2367 phpDocumentor_out("done\n" ); 2368 flush(); 2369 } 2370 $start_classes = false; 2371 $this-> class = $element-> getName(); 2372 $this-> killclass = false; 2373 if ($this-> checkKillClass($element-> getName(),$element> getPath())) continue; 2374 if (!$this-> killclass) 2375 { 2376 phpDocumentor_out('Converting '.$this> class."..." ); 2377 flush(); 2378 $notyet = true; 2379 } 2380 } else 2381 { 2382 if ($notyet) 2383 { 2384 phpDocumentor_out("Variables/methods/Class constants...\n" ); 2385 flush(); 2386 $notyet = false; 2387 } 2388 $a = $element-> docblock-> getKeyword('access'); 2389 if (is_object($a)) $a = $a-> getString(); 2390 if (!$this-> parseprivate && ( $a == 'private')) 2391 continue; 2392 if ($this-> killclass) continue; 2393 // force all contained elements to have parent package/subpackage 2394 $element-> docblock-> package = $this-> package; 2395 $element-> docblock-> subpackage = $this-> subpackage; 2396 } 2397 if ($this-> killclass) continue; 2398 $this-> Convert($element); 2399 } 2400 } 2401 if (count($elements) && ! $this-> killclass) $this-> endClass(); 2402 phpDocumentor_out("done\n" ); 2403 flush(); 2404 } // if isset($r['class']) 2405 } // foreach($s 2406 } // foreach($this->package_elements) 2407 phpDocumentor_out("\nConverting @todo List..." ); 2408 flush(); 2409 if (count($this-> todoList)) 2410 { 2411 $this-> ConvertTodoList();
2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491
} phpDocumentor_out("done\n" ); flush(); phpDocumentor_out("\nConverting Error Log..." flush(); $this-> ConvertErrorLog(); phpDocumentor_out("done\n" ); flush(); } /** * Convert the phpDocumentor parsing/conversion error log * @abstract */ function ConvertErrorLog() { } /** * Convert the list of all @todo tags * @abstract */ function ConvertTodoList() { }
);
/** * Sorts the @todo list - do not override or modify this function * @access private * @uses _sortTodos passed to {@link usort()} to sort the todo list */ function sortTodos() { phpDocumentor_out("\nSorting @todo list..." ); flush(); foreach($this-> todoList as $package => $r) { usort($this-> todoList[$package], array('Converter', '_sortTodoPackage')); foreach ($r as $a => $sub) { if (is_array($this-> todoList[$package][$a][1])) { usort($this-> todoList[$package][$a][1],array('Converter', '_sortTodos')); } } } phpDocumentor_out("done\n" ); } /** @access private */ function _sortTodoPackage($a, $b) { return strnatcasecmp($a[0]-> } /** @access private */ function _sortTodos($a, $b) { if (!is_object($a)) { var_dump($a); } return strnatcasecmp($a-> }
name, $b[0]->
name);
getString(), $b->
getString());
/** * Sorts all indexes - do not override or modify this function * @uses $leftindex based on the value of leftindex, sorts link arrays * @uses $class_elements sorts with {@link compareLink} * @uses $page_elements sorts with {@link compareLink} * @uses $define_elements sorts with {@link compareLink} * @uses $global_elements sorts with {@link compareLink} * @uses $function_elements sorts with {@link compareLink} * @uses $elements sorts with {@link elementCmp} * @uses $pkg_elements sorts with {@link elementCmp} after sorting by * package/subpackage alphabetically * @access private */ function sortIndexes() { phpDocumentor_out("\nSorting Indexes..." ); flush(); uksort($this-> elements,'strnatcasecmp'); if ($this-> leftindex['classes'])
2492 { 2493 foreach($this-> class_elements as $package => $o1) 2494 { 2495 foreach($o1 as $subpackage => $links) 2496 { 2497 usort($this> class_elements[$package][$subpackage],array($this,'compareLink')); 2498 } 2499 } 2500 } 2501 if ($this-> leftindex['pages']) 2502 { 2503 foreach($this-> page_elements as $package => $o1) 2504 { 2505 uksort($this-> page_elements[$package],'strnatcasecmp'); 2506 foreach($o1 as $subpackage => $links) 2507 { 2508 usort($this> page_elements[$package][$subpackage],array($this,'compareLink')); 2509 } 2510 } 2511 } 2512 if ($this-> leftindex['defines']) 2513 { 2514 foreach($this-> define_elements as $package => $o1) 2515 { 2516 uksort($this-> define_elements[$package],'strnatcasecmp'); 2517 foreach($o1 as $subpackage => $links) 2518 { 2519 usort($this> define_elements[$package][$subpackage],array($this,'compareLink')); 2520 } 2521 } 2522 } 2523 if ($this-> leftindex['globals']) 2524 { 2525 foreach($this-> global_elements as $package => $o1) 2526 { 2527 uksort($this-> global_elements[$package],'strnatcasecmp'); 2528 foreach($o1 as $subpackage => $links) 2529 { 2530 usort($this> global_elements[$package][$subpackage],array($this,'compareLink')); 2531 } 2532 } 2533 } 2534 if ($this-> leftindex['functions']) 2535 { 2536 foreach($this-> function_elements as $package => $o1) 2537 { 2538 uksort($this-> function_elements[$package],'strnatcasecmp'); 2539 foreach($o1 as $subpackage => $links) 2540 { 2541 usort($this> function_elements[$package][$subpackage],array($this,'compareLink')); 2542 } 2543 } 2544 } 2545 foreach($this-> elements as $letter => $nothuing) 2546 { 2547 uasort($this-> elements[$letter],array($this,"elementCmp" )); 2548 } 2549 foreach($this-> pkg_elements as $package => $els) 2550 { 2551 uksort($this-> pkg_elements[$package],'strnatcasecmp'); 2552 foreach($this-> pkg_elements[$package] as $subpackage => $els) 2553 { 2554 if (empty($els)) continue; 2555 uksort($this-> pkg_elements[$package][$subpackage],'strnatcasecmp'); 2556 foreach($els as $letter => $yuh) 2557 { 2558 usort($this> pkg_elements[$package][$subpackage][$letter],array($this,"elementCmp" )); 2559 } 2560 } 2561 } 2562 phpDocumentor_out("done\n" ); 2563 flush(); 2564 } 2565
2566 /** 2567 * sorts {@link $page_contents} by element type as well as alphabetically 2568 * @see $sort_page_contents_by_element_type 2569 */ 2570 function sortPageContentsByElementType(& $pages) 2571 { 2572 foreach($this-> page_contents as $package => $els) 2573 { 2574 foreach($this-> page_contents[$package] as $subpackage => $els) 2575 { 2576 if (empty($els)) continue; 2577 foreach($this-> page_contents[$package][$subpackage] as $path => $stuff) 2578 { 2579 if (!count($pages[$path]-> elements)) continue; 2580 usort($pages[$path]-> elements,array($this,'eltypecmp')); 2581 usort($this> page_contents[$package][$subpackage][$path],array($this,'eltypecmp')); 2582 if (isset($this-> page_contents[$package][$subpackage][$path][0])) 2583 $this-> page_contents[$package][$subpackage][$path]['###main'] = $this> page_contents[$package][$subpackage][$path][0]; 2584 unset($this-> page_contents[$package][$subpackage][$path][0]); 2585 } 2586 } 2587 } 2588 } 2589 2590 /** 2591 * @access private 2592 * @see Converter::sortIndexes() 2593 */ 2594 function compareLink($a, $b) 2595 { 2596 return strnatcasecmp($a-> name,$b-> name); 2597 } 2598 2599 /** 2600 * @access private 2601 * @see Converter::sortPageContentsByElementType() 2602 */ 2603 function eltypecmp($a, $b) 2604 { 2605 if ($a-> type == 'page') return -1; 2606 if ($b-> type == 'page') return 1; 2607 return strnatcasecmp($a-> type.$a-> name,$b-> type.$b-> name); 2608 } 2609 2610 /** 2611 * does a nat case sort on the specified second level value of the array 2612 * 2613 * @param mixed $a 2614 * @param mixed $b 2615 * @return int 2616 * @access private 2617 */ 2618 function elementCmp ($a, $b) 2619 { 2620 return strnatcasecmp($a-> getName(), $b-> getName()); 2621 } 2622 2623 /** 2624 * Used to stop conversion of @ignored or private @access classes 2625 * @uses $killclass sets killclass based on the value of {@link Classes::$killclass} 2626 * and {@link $package_output} 2627 * @access private 2628 */ 2629 function checkKillClass($class, $path) 2630 { 2631 $this-> killclass = false; 2632 if (isset($this-> classes-> killclass[$class]) && isset( $this-> classes> killclass[$class][$path])) $this-> killclass = true; 2633 if ($this-> package_output) 2634 { 2635 $a = $this-> classes-> getClass($class, $path); 2636 if (!in_array($a-> docblock-> package,$this-> package_output)) $this> killclass = true; 2637 } 2638 if (PHPDOCUMENTOR_DEBUG && $this-> killclass) debug(" $class $path killed" ); 2639 return $this-> killclass; 2640 }
2641 2642 /** 2643 * @param abstractLink descendant of abstractLink 2644 * @param array|parserTaglist of @todos|@todo tag 2645 * @access private 2646 */ 2647 function addTodoLink($link, $todos) 2648 { 2649 $this-> todoList[$link-> package][] = array($link, $todos); 2650 } 2651 2652 /** 2653 * Adds all elements to the {@link $elements, $pkg_elements, $links}, 2654 * {@link $linkswithfile} and left indexes - Do not modify or override 2655 * @access private 2656 * @param parserBase any documentable element descendant of parserBase 2657 * except parserTutorial 2658 * @param false|parserPageonly used to add a {@link parserPage} if the 2659 * $element passed is a parserPage 2660 * @staticvar string path of current page, used for {@link $page_contents} setup 2661 */ 2662 function addElement(& $element,$pageel=false) 2663 { 2664 static $curpath = ''; 2665 if ($this-> package_output) 2666 { 2667 if (!in_array($this-> package, $this-> package_output)) return; 2668 } 2669 if ($pageel && phpDocumentor_get_class($pageel) == 'parserdata') 2670 { 2671 if (isset($pageel-> docblock) && phpDocumentor_get_class($pageel> docblock) == 'parserdocblock') 2672 { 2673 $a = $pageel-> docblock-> getKeyword('todo'); 2674 if ($a) 2675 { 2676 $this-> addTodoLink($this-> addLink($element),$a); 2677 } 2678 } 2679 } 2680 if (isset($element-> docblock)) 2681 { 2682 $a = $element-> docblock-> getKeyword('access'); 2683 if (is_object($a)) $a = $a-> getString(); 2684 if (!$this-> parseprivate && ( $a == 'private')) 2685 return; 2686 $a = $element-> docblock-> getKeyword('todo'); 2687 if ($a) 2688 { 2689 if ($element-> type != 'include') { 2690 $this-> addTodoLink($this-> addLink($element),$a); 2691 } else { 2692 addWarning(PDERROR_NOTODO_INCLUDE, $element-> getLineNumber(), 2693 $element-> getPath()); 2694 } 2695 } 2696 } 2697 $startPositionOfElementName = 0; // which character of the element name actually starts its textual name 2698 switch($element-> type) 2699 { 2700 case 'page' : 2701 if ($this-> sort_absolutely_everything) 2702 { 2703 $this-> package_elements[$element-> package][$element> subpackage]['page'][$element-> getPath()][] = $pageel; 2704 } 2705 $link = $this-> addLink($element); 2706 $curpath = $element-> getPath(); 2707 if ($this-> leftindex['pages']) 2708 $this-> page_elements[$element-> package][$element-> subpackage][] = $link; 2709 $this-> page_contents[$element-> package][$element> subpackage][$curpath]['###main'] = $link; 2710 break; 2711 case 'class' : 2712 if ($this-> sort_absolutely_everything) 2713 { 2714 $this-> package_elements[$element-> docblock-> package][$element> docblock-> subpackage]['class'][$this-> class][] = $element;
2715 2716 2717 2718 > docblock-> 2719 > docblock-> 2720 2721 2722 2723 2724 > docblock-> 2725 2726 2727 2728 2729 2730 2731 > docblock-> 2732 2733 2734 2735 > docblock-> 2736 > docblock-> 2737 2738 2739 2740 2741 > docblock-> 2742 2743 2744 2745 2746 > docblock-> 2747 > docblock-> 2748 2749 2750 2751 2752 > docblock-> 2753 2754 2755 2756 > docblock-> 2757 2758 2759 2760 2761 > docblock-> 2762 2763 2764 > docblock-> 2765 2766 2767 2768 2769 > docblock-> 2770 2771 2772 > docblock-> 2773 2774 2775 2776 2777 > docblock-> 2778
} $link = $this-> addLink($element); if ($this-> leftindex['classes']) $this-> class_elements[$element-> docblock-> package][$elementsubpackage][] = $link; $this-> class_contents[$element-> docblock-> package][$elementsubpackage][$this-> class]['###main'] = $link; break; case 'include' : if ($this-> sort_absolutely_everything) { $this-> package_elements[$element-> docblock-> package][$elementsubpackage]['page'][$curpath][] = $element; } $link = $this-> addLink($element); break; case 'define' : if ($this-> sort_absolutely_everything) { $this-> package_elements[$element-> docblock-> package][$elementsubpackage]['page'][$curpath][] = $element; } $link = $this-> addLink($element); if ($this-> leftindex['defines']) $this-> define_elements[$element-> docblock-> package][$elementsubpackage][] = $link; $this-> page_contents[$element-> docblock-> package][$elementsubpackage][$curpath][] = $link; break; case 'global' : if ($this-> sort_absolutely_everything) { $this-> package_elements[$element-> docblock-> package][$elementsubpackage]['page'][$curpath][] = $element; } $link = $this-> addLink($element); $startPositionOfElementName = 1; // lose the leading "$" character if ($this-> leftindex['globals']) $this-> global_elements[$element-> docblock-> package][$elementsubpackage][] = $link; $this-> page_contents[$element-> docblock-> package][$elementsubpackage][$curpath][] = $link; break; case 'var' : if ($this-> sort_absolutely_everything) { $this-> package_elements[$element-> docblock-> package][$elementsubpackage]['class'][$this-> class][] = $element; } $link = $this-> addLink($element); $startPositionOfElementName = 1; // lose the leading "$" character $this-> class_contents[$element-> docblock-> package][$elementsubpackage][$this-> class][] = $link; break; case 'const' : if ($this-> sort_absolutely_everything) { $this-> package_elements[$element-> docblock-> package][$elementsubpackage]['class'][$this-> class][] = $element; } $link = $this-> addLink($element); $this-> class_contents[$element-> docblock-> package][$elementsubpackage][$this-> class][] = $link; break; case 'method' : if ($this-> sort_absolutely_everything) { $this-> package_elements[$element-> docblock-> package][$elementsubpackage]['class'][$this-> class][] = $element; } $link = $this-> addLink($element); $this-> class_contents[$element-> docblock-> package][$elementsubpackage][$this-> class][] = $link; break; case 'function' : if ($this-> sort_absolutely_everything) { $this-> package_elements[$element-> docblock-> package][$elementsubpackage]['page'][$curpath][] = $element; }
2779 $link = $this-> addLink($element); 2780 if ($this-> leftindex['functions']) 2781 $this-> function_elements[$element-> docblock-> package][$element> docblock-> subpackage][] = $link; 2782 $this-> page_contents[$element-> docblock-> package][$element> docblock-> subpackage][$curpath][] = $link; 2783 break; 2784 default : 2785 break; 2786 } 2787 if ($element-> getType() != 'include') 2788 { 2789 if ($element-> getType() == 'var' || $element-> getType() == 'method'|| $element-> getType() == 'const') 2790 { 2791 $this-> links[$this-> package][$this-> subpackage][$element> getType()][$element-> class][$element-> getName()] = $link; 2792 $this-> linkswithfile[$this-> package][$this-> subpackage][$element> getType()][$element-> getPath()][$element-> class][$element-> getName()] = $link; 2793 } else 2794 { 2795 if ($element-> type == 'page') 2796 { 2797 $this-> links[$this-> package][$this-> subpackage][$element> getType()][$element-> getFile()] = $link; 2798 $this-> linkswithfile[$this-> package][$this-> subpackage][$element> getType()][$element-> getPath()][$element-> getFile()] = $link; 2799 } else 2800 { 2801 $this-> links[$this-> package][$this-> subpackage][$element> getType()][$element-> getName()] = $link; 2802 $this-> linkswithfile[$this-> package][$this-> subpackage][$element> getType()][$element-> getPath()][$element-> getName()] = $link; 2803 } 2804 } 2805 } 2806 if ($element-> type == 'page') 2807 { 2808 $this-> elements[substr(strtolower($element> getFile()),$startPositionOfElementName,1)][] = $element; 2809 $this-> pkg_elements[$this-> package][$this> subpackage][substr(strtolower($element-> getFile()),$startPositionOfElementName,1)][] = $element; 2810 } else 2811 { 2812 $this-> elements[substr(strtolower($element> getName()),$startPositionOfElementName,1)][] = $element; 2813 $this-> pkg_elements[$this-> package][$this> subpackage][substr(strtolower($element-> getName()),$startPositionOfElementName,1)][] = $element; 2814 } 2815 } 2816 2817 /** 2818 * returns an abstract link to element. Do not modify or override 2819 * 2820 * This method should only be called in process of Conversion, unless 2821 * $element is a parserPage, or $page is set to true, and $element is 2822 * not a parserPage 2823 * @return abstractLink abstractLink descendant 2824 * @access private 2825 * @param parserElement element to add a new link (descended from 2826 * {@link abstractLink})to the {@link $links} array 2827 * @param string classname for elements that are class-based (this may be 2828 * deprecated in the future, as the classname 2829 * should be contained within the element. if $element is a 2830 * page, this parameter is a package name 2831 * @param string subpackage name for page elements 2832 */ 2833 function addLink(& $element,$page = false) 2834 { 2835 if ($page) 2836 { 2837 // create a fake parserPage to extract the fileAlias for this link 2838 $fakepage = new parserPage; 2839 $fakepage-> setPath($element-> getPath()); 2840 $fakepage-> setFile(basename($element-> getPath())); 2841 $this-> curname = $this-> getPageName($fakepage); 2842 } 2843 switch($element-> type)
2844 { 2845 case 'function': 2846 $x = new functionLink; 2847 $x-> addLink($element-> getPath(), $this-> curname, $element-> name, $element-> docblock-> package, $element-> docblock-> subpackage, $element-> docblock> category); 2848 return $x; 2849 break; 2850 case 'define': 2851 $x = new defineLink; 2852 $x-> addLink($element-> getPath(), $this-> curname, $element-> name, $element-> docblock-> package, $element-> docblock-> subpackage, $element-> docblock> category); 2853 return $x; 2854 break; 2855 case 'global': 2856 $x = new globalLink; 2857 $x-> addLink($element-> getPath(), $this-> curname, $element-> name, $element-> docblock-> package, $element-> docblock-> subpackage, $element-> docblock> category); 2858 return $x; 2859 break; 2860 case 'class': 2861 $x = new classLink; 2862 $x-> addLink($element-> getPath(), $this-> curname, $element-> name, $element-> docblock-> package, $element-> docblock-> subpackage, $element-> docblock> category); 2863 return $x; 2864 break; 2865 case 'method': 2866 $x = new methodLink; 2867 $x-> addLink($this-> class, $element-> getPath(), $this-> curname, $element-> name, $element-> docblock-> package, $element-> docblock-> subpackage, $element> docblock-> category); 2868 return $x; 2869 break; 2870 case 'var': 2871 $x = new varLink; 2872 $x-> addLink($this-> class, $element-> getPath(), $this-> curname, $element-> name, $element-> docblock-> package, $element-> docblock-> subpackage, $element> docblock-> category); 2873 return $x; 2874 break; 2875 case 'const': 2876 $x = new constLink; 2877 $x-> addLink($this-> class, $element-> getPath(), $this-> curname, $element-> name, $element-> docblock-> package, $element-> docblock-> subpackage, $element> docblock-> category); 2878 return $x; 2879 break; 2880 case 'page': 2881 $x = new pageLink; 2882 $x-> addLink($element-> getPath(),$this-> getPageName($element),$element> file,$element-> package, $element-> subpackage, $element-> category); 2883 return $x; 2884 break; 2885 } 2886 } 2887 2888 /** 2889 * Return a tree of all classes that extend this class 2890 * 2891 * The data structure returned is designed for a non-recursive algorithm, 2892 * and is somewhat complex. 2893 * In most cases, the array returned is: 2894 * 2895 * <pre> 2896 * array('#root' => 2897 * array('link' => {@link classLink} to $class, 2898 * 'parent' => false, 2899 * 'children' => array(array('class' => 'childclass1', 2900 * 'package' => 'child1package'), 2901 * array('class' => 'childclass2', 2902 * 'package' => 'child2package'),... 2903 * ) 2904 * ), 2905 * 'child1package#childclass1' => 2906 * array('link' => {@link classLink} to childclass1, 2907 * 'parent' => '#root', 2908 * 'children' => array(array('class' => 'kidclass',
2909 * 'package' => 'kidpackage'),... 2910 * ) 2911 * ), 2912 * 'kidpackage#kidclass' => 2913 * array('link' => {@link classLink} to kidclass, 2914 * 'parent' => 'child1package#childclass1', 2915 * 'children' => array() // no children 2916 * ), 2917 * .... 2918 * ) 2919 *</pre> 2920 * 2921 * To describe this format using language, every class in the tree has an 2922 * entry in the first level of the array. The index for all child 2923 * classes that extend the root class is childpackage#childclassname. 2924 * Each entry in the array has 3 elements: link, parent, and children. 2925 * <ul> 2926 * <li>link - a {@link classLink} to the current class</li> 2927 * <li>parent - a {@link classLink} to the class's parent, or false (except for one special case described below)</li> 2928 * <li>children - an array of arrays, each entry has a 'class' and 'package' index to the child class, 2929 * used to find the entry in the big array</li> 2930 * </ul> 2931 * 2932 * special cases are when the #root class has a parent in another package, 2933 * or when the #root class extends a class not found 2934 * by phpDocumentor. In the first case, parent will be a 2935 * classLink to the parent class. In the second, parent will be the 2936 * extends clause, as in: 2937 * <code> 2938 * class X extends Y 2939 * { 2940 * ... 2941 * } 2942 * </code> 2943 * in this case, the #root entry will be array('link' => classLink to X, 'parent' => 'Y', children => array(...)) 2944 * 2945 * The fastest way to design a method to process the array returned 2946 * is to copy HTMLframesConverter::getRootTree() into 2947 * your converter and to modify the html to whatever output format you are going to use 2948 * @see HTMLframesConverter::getRootTree() 2949 * @param string class name 2950 * @param string 2951 * @param string 2952 * @return array Format: see docs 2953 */ 2954 function getSortedClassTreeFromClass($class,$package,$subpackage) 2955 { 2956 $my_tree = array(); 2957 $root = $this-> classes-> getClassByPackage($class,$package); 2958 if (!$root) return false; 2959 $class_children = $this-> classes-> getDefiniteChildren($class,$root-> curfile); 2960 if (!$class_children) 2961 { 2962 // special case: parent class is found, but is not part of this package, class has no children 2963 if (is_array($root-> parent)) 2964 { 2965 $x = $root-> getParent($this); 2966 if ($x-> docblock-> package != $package) 2967 { 2968 $v = Converter::getClassLink($root-> getName(),$package,$root> getPath()); 2969 return array('#root' => array( 'link' => $v,'parent' => Converter::getClassLink($x-> getName(),$x-> docblock-> package,$x-> getPath()), 'children' => array())); 2970 } 2971 } else 2972 { // class has normal situation, no children 2973 if (is_string($root-> getParent($this))) 2974 return array('#root' => array( 'link' => Converter::getClassLink($root> getName(),$package,$root-> getPath()), 'parent' => $root-> getExtends(),'children' => array())); 2975 else 2976 return array('#root' => array( 'link' => Converter::getClassLink($root> getName(),$package,$root-> getPath()), 'parent' => false, 'children' => array())); 2977 } 2978 }
2979 // special case: parent class is found, but is not part of this package, class has children 2980 if (is_array($root-> parent)) 2981 { 2982 $x = $root-> getParent($this); 2983 if ($x-> docblock-> package != $package) 2984 { 2985 $v = Converter::getClassLink($root-> getName(),$package,$root-> getPath()); 2986 $my_tree = array('#root' => array( 'link' => $v, 'parent' => Converter::getClassLink($x-> getName(),$x-> docblock-> package,$x-> getPath()), 'children' => array())); 2987 } else 2988 { 2989 } 2990 } else 2991 $my_tree = array('#root' => array( 'link' => Converter::getClassLink($root> getName(),$package,$root-> getPath()), 'parent' => false, 'children' => array())); 2992 // location of tree walker 2993 $cur = '#root'; 2994 $lastcur = array(array(false,0)); 2995 $childpos = 0; 2996 if (isset($class_children)) 2997 { 2998 do 2999 { 3000 if (!$class_children) 3001 { 3002 list($cur, $childpos) = array_pop($lastcur); 3003 if (isset($my_tree[$cur]['children'][$childpos + 1])) 3004 { 3005 array_push($lastcur, array($cur, $childpos + 1)); 3006 $par = $cur; 3007 $cur = $my_tree[$cur]['children'][$childpos + 1]; 3008 $x = $this-> classes> getClassByPackage($cur['class'],$cur['package']); 3009 $childpos = 0; 3010 $cur = $cur['package'] . '#' . $cur['class']; 3011 $my_tree[$cur]['link'] = Converter::getClassLink($x-> getName(),$x> docblock-> package,$x-> getPath()); 3012 $my_tree[$cur]['parent'] = $par; 3013 $my_tree[$cur]['children'] = array(); 3014 $class_children = $this-> classes-> getDefiniteChildren($x> getName(), $x-> curfile); 3015 continue; 3016 } else 3017 { 3018 $class_children = false; 3019 continue; 3020 } 3021 } 3022 foreach($class_children as $chileclass => $chilefile) 3023 { 3024 $ch = $this-> classes-> getClass($chileclass,$chilefile); 3025 $my_tree[$cur]['children'][] = array('class' => $ch-> getName(), 'package' => $ch-> docblock-> package); 3026 } 3027 usort($my_tree[$cur]['children'],'rootcmp'); 3028 if (isset($my_tree[$cur]['children'][$childpos])) 3029 { 3030 array_push($lastcur, array($cur, $childpos)); 3031 $par = $cur; 3032 $cur = $my_tree[$cur]['children'][$childpos]; 3033 $x = $this-> classes-> getClassByPackage($cur['class'],$cur['package']); 3034 $cur = $cur['package'] . '#' . $cur['class']; 3035 $my_tree[$cur]['link'] = Converter::getClassLink($x-> getName(),$x> docblock-> package,$x-> getPath()); 3036 $my_tree[$cur]['parent'] = $par; 3037 $my_tree[$cur]['children'] = array(); 3038 $childpos = 0; 3039 $class_children = $this-> classes-> getDefiniteChildren($x> getName(), $x-> curfile); 3040 } else 3041 { 3042 list($cur, $childpos) = array_pop($lastcur); 3043 } 3044 } while ($cur); 3045 } 3046 return $my_tree; 3047 } 3048
3049 /** 3050 * do not override 3051 * @return bool true if a link to this class exists in package $package and subpackage $subpackage 3052 * @param string $expr class name 3053 * @param string $package package to search in 3054 * @param string $subpackage subpackage to search in 3055 * @access private 3056 */ 3057 function isLinkedClass($expr,$package,$subpackage,$file=false) 3058 { 3059 if ($file) 3060 return isset($this-> linkswithfile[$package][$subpackage]['class'][$file][$expr]); 3061 return isset($this-> links[$package][$subpackage]['class'][$expr]); 3062 } 3063 3064 /** 3065 * do not override 3066 * @return bool true if a link to this function exists in package $package and subpackage $subpackage 3067 * @param string $expr function name 3068 * @param string $package package to search in 3069 * @param string $subpackage subpackage to search in 3070 * @access private 3071 */ 3072 function isLinkedFunction($expr,$package,$subpackage,$file=false) 3073 { 3074 if ($file) 3075 return isset($this-> linkswithfile[$package][$subpackage]['function'][$file][$expr]); 3076 return isset($this-> links[$package][$subpackage]['function'][$expr]); 3077 } 3078 3079 /** 3080 * do not override 3081 * @return bool true if a link to this define exists in package $package and subpackage $subpackage 3082 * @param string $expr define name 3083 * @param string $package package to search in 3084 * @param string $subpackage subpackage to search in 3085 * @access private 3086 */ 3087 function isLinkedDefine($expr,$package,$subpackage,$file=false) 3088 { 3089 if ($file) 3090 return isset($this-> linkswithfile[$package][$subpackage]['define'][$file][$expr]); 3091 return isset($this-> links[$package][$subpackage]['define'][$expr]); 3092 } 3093 3094 /** 3095 * do not override 3096 * @return bool true if a link to this define exists in package $package and subpackage $subpackage 3097 * @param string $expr define name 3098 * @param string $package package to search in 3099 * @param string $subpackage subpackage to search in 3100 * @access private 3101 */ 3102 function isLinkedGlobal($expr,$package,$subpackage,$file=false) 3103 { 3104 if ($file) 3105 return isset($this-> linkswithfile[$package][$subpackage]['global'][$file][$expr]); 3106 return isset($this-> links[$package][$subpackage]['global'][$expr]); 3107 } 3108 3109 /** 3110 * do not override 3111 * @return bool true if a link to this procedural page exists in package $package and subpackage $subpackage 3112 * @param string $expr procedural page name 3113 * @param string $package package to search in 3114 * @param string $subpackage subpackage to search in 3115 * @access private 3116 */ 3117 function isLinkedPage($expr,$package,$subpackage,$path=false) 3118 { 3119 if ($path) 3120 return isset($this-> linkswithfile[$package][$subpackage]['page'][$path][$expr]); 3121 return isset($this-> links[$package][$subpackage]['page'][$expr]); 3122 } 3123
3124 /** 3125 * do not override 3126 * @return bool true if a link to this method exists in package $package, subpackage $subpackage and class $class 3127 * @param string $expr method name 3128 * @param string $class class name 3129 * @param string $package package to search in 3130 * @param string $subpackage subpackage to search in 3131 * @access private 3132 */ 3133 function isLinkedMethod($expr,$package,$subpackage,$class,$file=false) 3134 { 3135 if ($file) 3136 return isset($this> linkswithfile[$package][$subpackage]['method'][$file][$class][$expr]); 3137 return isset($this-> links[$package][$subpackage]['method'][$class][$expr]); 3138 } 3139 3140 /** 3141 * do not override 3142 * @return bool true if a link to this method exists in package $package, subpackage $subpackage and class $class 3143 * @param string $expr var name 3144 * @param string $class class name 3145 * @param string $package package to search in 3146 * @param string $subpackage subpackage to search in 3147 * @access private 3148 */ 3149 function isLinkedVar($expr,$package,$subpackage,$class,$file=false) 3150 { 3151 if ($file) 3152 return isset($this> linkswithfile[$package][$subpackage]['var'][$file][$class][$expr]); 3153 return isset($this-> links[$package][$subpackage]['var'][$class][$expr]); 3154 } 3155 3156 /** 3157 * do not override 3158 * @return bool true if a link to this method exists in package $package, subpackage $subpackage and class $class 3159 * @param string $expr constant name 3160 * @param string $class class name 3161 * @param string $package package to search in 3162 * @param string $subpackage subpackage to search in 3163 * @access private 3164 */ 3165 function isLinkedConst($expr,$package,$subpackage,$class,$file=false) 3166 { 3167 if ($file) 3168 return isset($this> linkswithfile[$package][$subpackage]['const'][$file][$class][$expr]); 3169 return isset($this-> links[$package][$subpackage]['const'][$class][$expr]); 3170 } 3171 3172 /** 3173 * return false or a {@link classLink} to $expr 3174 * @param string $expr class name 3175 * @param string $package package name 3176 * @return mixed returns a {@link classLink} or false if the element is not found in package $package 3177 * @see classLink 3178 */ 3179 function getClassLink($expr,$package,$file=false, $text = false) 3180 { 3181 if (!isset($this-> links[$package])) return false; 3182 foreach($this-> links[$package] as $subpackage => $notused) 3183 { 3184 if ($this-> isLinkedClass($expr,$package,$subpackage,$file)) 3185 { 3186 if ($file) 3187 { 3188 return $this> linkswithfile[$package][$subpackage]['class'][$file][$expr]; 3189 } 3190 return $this-> links[$package][$subpackage]['class'][$expr]; 3191 } 3192 } 3193 return false; 3194 } 3195
3196 /** 3197 * return false or a {@link functionLink} to $expr 3198 * @param string $expr function name 3199 * @param string $package package name 3200 * @return mixed returns a {@link functionLink} or false if the element is not found in package $package 3201 * @see functionLink 3202 */ 3203 function getFunctionLink($expr,$package,$file=false, $text = false) 3204 { 3205 if (!isset($this-> links[$package])) return false; 3206 foreach($this-> links[$package] as $subpackage => $notused) 3207 { 3208 if ($this-> isLinkedFunction($expr,$package,$subpackage,$file)) 3209 { 3210 if ($file) 3211 { 3212 return $this> linkswithfile[$package][$subpackage]['function'][$file][$expr]; 3213 } 3214 return $this-> links[$package][$subpackage]['function'][$expr]; 3215 } 3216 } 3217 return false; 3218 } 3219 3220 /** 3221 * return false or a {@link defineLink} to $expr 3222 * @param string $expr constant name 3223 * @param string $package package name 3224 * @return mixed returns a {@link defineLink} or false if the element is not found in package $package 3225 * @see defineLink 3226 */ 3227 function getDefineLink($expr,$package,$file=false, $text = false) 3228 { 3229 if (!isset($this-> links[$package])) return false; 3230 foreach($this-> links[$package] as $subpackage => $notused) 3231 { 3232 if ($this-> isLinkedDefine($expr,$package,$subpackage,$file)) 3233 { 3234 if ($file) 3235 { 3236 return $this> linkswithfile[$package][$subpackage]['define'][$file][$expr]; 3237 } 3238 return $this-> links[$package][$subpackage]['define'][$expr]; 3239 } 3240 } 3241 return false; 3242 } 3243 3244 /** 3245 * return false or a {@link globalLink} to $expr 3246 * @param string $expr global variable name (with leading $) 3247 * @param string $package package name 3248 * @return mixed returns a {@link defineLink} or false if the element is not found in package $package 3249 * @see defineLink 3250 */ 3251 function getGlobalLink($expr,$package,$file=false, $text = false) 3252 { 3253 if (!isset($this-> links[$package])) return false; 3254 foreach($this-> links[$package] as $subpackage => $notused) 3255 { 3256 if ($this-> isLinkedGlobal($expr,$package,$subpackage,$file)) 3257 { 3258 if ($file) 3259 { 3260 return $this> linkswithfile[$package][$subpackage]['global'][$file][$expr]; 3261 } 3262 return $this-> links[$package][$subpackage]['global'][$expr]; 3263 } 3264 } 3265 return false; 3266 } 3267 3268 /** 3269 * return false or a {@link pageLink} to $expr
3270 * @param string $expr procedural page name 3271 * @param string $package package name 3272 * @return mixed returns a {@link pageLink} or false if the element is not found in package $package 3273 * @see pageLink 3274 */ 3275 function getPageLink($expr,$package,$path = false, $text = false, $packages = false) 3276 { 3277 if (!isset($this-> links[$package])) return false; 3278 foreach($this-> links[$package] as $subpackage => $notused) 3279 { 3280 if ($this-> isLinkedPage($expr,$package,$subpackage,$path)) 3281 { 3282 if ($path) 3283 { 3284 return $this-> linkswithfile[$package][$subpackage]['page'][$path][$expr]; 3285 } 3286 return $this-> links[$package][$subpackage]['page'][$expr]; 3287 } 3288 } 3289 return false; 3290 } 3291 3292 /** 3293 * return false or a {@link methodLink} to $expr in $class 3294 * @param string $expr method name 3295 * @param string $class class name 3296 * @param string $package package name 3297 * @return mixed returns a {@link methodLink} or false if the element is not found in package $package, class $class 3298 * @see methodLink 3299 */ 3300 function getMethodLink($expr,$class,$package,$file=false, $text = false) 3301 { 3302 $expr = trim($expr); 3303 $class = trim($class); 3304 if (!isset($this-> links[$package])) return false; 3305 foreach($this-> links[$package] as $subpackage => $notused) 3306 { 3307 if ($this-> isLinkedMethod($expr,$package,$subpackage,$class,$file)) 3308 { 3309 if ($file) 3310 { 3311 return $this> linkswithfile[$package][$subpackage]['method'][$file][$class][$expr]; 3312 } 3313 return $this-> links[$package][$subpackage]['method'][$class][$expr]; 3314 } 3315 } 3316 return false; 3317 } 3318 3319 /** 3320 * return false or a {@link varLink} to $expr in $class 3321 * @param string $expr var name 3322 * @param string $class class name 3323 * @param string $package package name 3324 * @return mixed returns a {@link varLink} or false if the element is not found in package $package, class $class 3325 * @see varLink 3326 */ 3327 function getVarLink($expr,$class,$package,$file=false, $text = false) 3328 { 3329 $expr = trim($expr); 3330 $class = trim($class); 3331 if (!isset($this-> links[$package])) return false; 3332 foreach($this-> links[$package] as $subpackage => $notused) 3333 { 3334 if ($this-> isLinkedVar($expr,$package,$subpackage,$class,$file)) 3335 { 3336 if ($file) 3337 { 3338 return $this> linkswithfile[$package][$subpackage]['var'][$file][$class][$expr]; 3339 } 3340 return $this-> links[$package][$subpackage]['var'][$class][$expr]; 3341 } 3342 } 3343 return false; 3344 }
3345 3346 /** 3347 * return false or a {@link constLink} to $expr in $class 3348 * @param string $expr constant name 3349 * @param string $class class name 3350 * @param string $package package name 3351 * @return mixed returns a {@link varLink} or false if the element is not found in package $package, class $class 3352 * @see constLink 3353 */ 3354 function getConstLink($expr,$class,$package,$file=false, $text = false) 3355 { 3356 $expr = trim($expr); 3357 $class = trim($class); 3358 if (!isset($this-> links[$package])) return false; 3359 foreach($this-> links[$package] as $subpackage => $notused) 3360 { 3361 if ($this-> isLinkedConst($expr,$package,$subpackage,$class,$file)) 3362 { 3363 if ($file) 3364 { 3365 return $this> linkswithfile[$package][$subpackage]['const'][$file][$class][$expr]; 3366 } 3367 return $this-> links[$package][$subpackage]['const'][$class][$expr]; 3368 } 3369 } 3370 return false; 3371 } 3372 3373 /** 3374 * The meat of the @tutorial tag and inline {@}tutorial} tag 3375 * 3376 * Take a string and return an abstract link to the tutorial it represents. 3377 * Since tutorial naming literally works like the underlying filesystem, the 3378 * way to reference the tutorial is similar. Tutorials are located in a 3379 * subdirectory of any directory parsed, which is named 'tutorials/' (we 3380 * try to make things simple when we can :). They are further organized by 3381 * package and subpackage as: 3382 * 3383 * tutorials/package/subpackage 3384 * 3385 * and the files are named *.cls, *.pkg, or *.proc, and so a link to a tutorial 3386 * named file.cls can be referenced (depending on context) as any of: 3387 * 3388 * <code> 3389 * * @tutorial package/subpackage/file.cls 3390 * * @tutorial package/file.cls 3391 * * @tutorial file.cls 3392 * </code> 3393 * 3394 * The first case will only be needed if file.cls exists in both the current 3395 * package, in anotherpackage/file.cls and in anotherpackage/subpackage/file.cls 3396 * and you wish to reference the one in anotherpackage/subpackage. 3397 * The second case is only needed if you wish to reference file.cls in another 3398 * package and it is unique in that package. the third will link to the first 3399 * file.cls it finds using this search method: 3400 * 3401 * <ol> 3402 * <li>current package/subpackage</li> 3403 * <li>all other subpackages of current package</li> 3404 * <li>parent package, if this package has classes that extend classes in 3405 * another package</li> 3406 * <li>all other packages</li> 3407 * </ol> 3408 * @return tutorialLink|stringreturns either a link, or the original text, if not found 3409 * @param string the original expression 3410 * @param string package to look in first 3411 * @param string subpackage to look in first 3412 * @param array array of package names to search in if not found in parent packages. 3413 * This is used to limit the search, phpDocumentor automatically searches 3414 * all packages 3415 * @since 1.2 3416 */ 3417 function getTutorialLink($expr, $package = false, $subpackage = false, $packages = false) 3418 { 3419 // is $expr a comma-delimited list? 3420 if (strpos($expr,',')) 3421 { 3422 $a = explode(',',$expr);
3423 $b = array(); 3424 for($i=0;$i< count($a);$i++) 3425 { 3426 // if so return each component with a link 3427 $b[] = Converter::getTutorialLink(trim($a[$i])); 3428 } 3429 return $b; 3430 } 3431 $subsection = ''; 3432 if (strpos($expr,'#')) 3433 { 3434 $a = explode('#',$expr); 3435 $org = $expr; 3436 $expr = $a[0]; 3437 $subsection = $a[1]; 3438 } 3439 if (strpos($expr,'/')) 3440 { 3441 $a = explode('/',$expr); 3442 if (count($a) == 3) 3443 { 3444 return Converter::getTutorialLink($a[2],$a[0],$a[1],array()); 3445 } 3446 if (count($a) == 2) 3447 { 3448 return Converter::getTutorialLink($a[1],$a[0],false,array()); 3449 } 3450 } 3451 if (!$package) $package = $this-> package; 3452 if (!$subpackage) $subpackage = $this-> subpackage; 3453 if (!isset($this-> all_packages[$package])) return $expr; 3454 elseif (isset($packages[$package])) unset($packages[$package]); 3455 $ext = pathinfo($expr, PATHINFO_EXTENSION); 3456 if (isset($this-> tutorials[$package][$subpackage][$ext][$expr])) 3457 { 3458 $a = $this-> tutorials[$package][$subpackage][$ext][$expr]; 3459 $link = new tutorialLink; 3460 $link-> addLink($subsection,$a-> path,$a-> name,$a-> package,$a> subpackage,$a-> getTitle($this,$subsection)); 3461 return $link; 3462 } 3463 do 3464 { 3465 if (!is_array($packages)) 3466 { 3467 $packages = $this-> all_packages; 3468 if (isset($packages[$package])) unset($packages[$package]); 3469 } 3470 if (isset($this-> tutorials[$package])) 3471 { 3472 if (isset($this-> tutorials[$package][$subpackage][$ext][$expr])) 3473 { 3474 $a = $this-> tutorials[$package][$subpackage][$ext][$expr]; 3475 $link = new tutorialLink; 3476 $link-> addLink($subsection,$a-> path,$a-> name,$a-> package,$a> subpackage,$a-> getTitle($this)); 3477 return $link; 3478 } else 3479 { 3480 foreach($this-> tutorials[$package] as $subpackage => $stuff) 3481 { 3482 if (isset($stuff[$ext][$expr])) 3483 { 3484 $a = $stuff[$ext][$expr]; 3485 $link = new tutorialLink; 3486 $link-> addLink($subsection,$a-> path,$a-> name,$a> package,$a-> subpackage,$a-> getTitle($this)); 3487 return $link; 3488 } 3489 } 3490 } 3491 } 3492 // try other packages 3493 // look in parent package first, if found 3494 if (isset($this-> package_parents[$package])) 3495 { 3496 $p1 = $package; 3497 $package = $this-> package_parents[$package]; 3498 } else 3499 {
3500 // no parent package, so start with the first one that's left 3501 list($package,) = @each($packages); 3502 } 3503 if ($package) 3504 { 3505 if (isset($packages[$package])) unset($packages[$package]); 3506 } 3507 } while (count($packages) || $package); 3508 addWarning(PDERROR_TUTORIAL_NOT_FOUND,$expr); 3509 return $expr; 3510 } 3511 3512 /** 3513 * The meat of the @see tag and inline {@}link} tag 3514 * 3515 * $expr is a string with many allowable formats: 3516 * <ol> 3517 * <li>proceduralpagename.ext</li> 3518 * <li>constant_name</li> 3519 * <li>classname::function()</li> 3520 * <li>classname::constantname</li> (new 1.2.4) 3521 * <li>classname::$variablename</li> 3522 * <li>classname</li> 3523 * <li>object classname</li> 3524 * <li>function functionname()</li> 3525 * <li>global $globalvarname</li> 3526 * <li>packagename#expr where expr is any of the above</li> 3527 * </ol> 3528 * 3529 * New in version 1.1, you can explicitly specify a package to link to that 3530 * is different from the current package. Use the # operator 3531 * to specify a new package, as in tests#bug-540368.php (which should appear 3532 * as a link like: " {@link tests#bug-540368.php}"). This 3533 * example links to the procedural page bug-540368.php in package 3534 * tests. Also, the "function" operator is now used to specifically 3535 * link to a function instead of a method in the current class. 3536 * 3537 * <code> 3538 * class myclass 3539 * { 3540 * // from inside the class definition, use "function conflict()" to refer to procedural function "conflict()" 3541 * function conflict() 3542 * { 3543 * } 3544 * } 3545 * 3546 * function conflict() 3547 * { 3548 * } 3549 * </code> 3550 * 3551 * If classname:: is not present, and the see tag is in a documentation 3552 * block within a class, then the function uses the classname to 3553 * search for $expr as a function or variable within classname, or any of its parent classes. 3554 * given an $expr without '$', '::' or '()' getLink first searches for 3555 * classes, procedural pages, constants, global variables, and then searches for 3556 * methods and variables within the default class, and finally for any function 3557 * 3558 * @param string $expr expression to search for a link 3559 * @param string $package package to start searching in 3560 * @param array $packages list of all packages to search in 3561 * @return mixed getLink returns a descendant of {@link abstractLink} if it finds a link, otherwise it returns a string 3562 * @see getPageLink(), getDefineLink(), getVarLink(), getFunctionLink(), getClassLink() 3563 * @see pageLink, functionLink, defineLink, classLink, methodLink, varLink 3564 */ 3565 function & getLink($expr, $package = false, $packages = false) 3566 { 3567 // is $expr a comma-delimited list? 3568 if (strpos($expr,',')) 3569 { 3570 $a = explode(',',$expr); 3571 $b = array(); 3572 for($i=0;$i< count($a);$i++) 3573 { 3574 // if so return each component with a link 3575 $b[] = Converter::getLink(trim($a[$i])); 3576 }
3577 return $b; 3578 } 3579 if (strpos($expr,'#')) 3580 { 3581 $a = explode('#',$expr); 3582 if (count($a) == 2) 3583 { // can have exactly 1 package override, otherwise it's ignored 3584 // feature 564991, link to php manual 3585 if ($a[0] == 'PHP_MANUAL') { 3586 $s = 'http://www.php.net/'.$a[1]; 3587 return $s; 3588 } 3589 $s = & Converter::getLink($a[1],$a[0],array()); 3590 return $s; 3591 } 3592 } 3593 $a = & $this-> _getLink($expr, $package, $packages); 3594 return $a; 3595 } 3596 3597 /** 3598 * @access private 3599 */ 3600 function & _getLink($expr, $package = false, $packages = false) 3601 { 3602 if (!$package) $package = $this-> package; 3603 // 3604 if (!isset($this-> all_packages[$package])) return $expr; 3605 elseif (isset($packages[$package])) unset($packages[$package]); 3606 $links = & $this-> links; 3607 $class = $this-> class; 3608 if (strpos($expr,'function ') === 0) 3609 { // asking for a function, not a method 3610 if ($test = Converter::getFunctionLink(str_replace('function ','',str_replace('()','',$expr)), $package)) return $test; 3611 else return $expr; 3612 } 3613 if (strpos($expr,'global ') === 0) 3614 { // asking for a global variable 3615 if ($test = Converter::getGlobalLink(str_replace('global ','',$expr), $package)) return $test; 3616 else return $expr; 3617 } 3618 if (strpos($expr,'object ') === 0) 3619 { // asking for a class 3620 if ($test = Converter::getClassLink(str_replace('object ','',$expr), $package)) return $test; 3621 else return $expr; 3622 } 3623 if (strpos($expr,'constant ') === 0) 3624 { // asking for a class 3625 if ($test = Converter::getDefineLink(str_replace('constant ','',$expr), $package)) return $test; 3626 else return $expr; 3627 } 3628 // are we in a class? 3629 if ($class) 3630 { 3631 // is $expr simply a word? see if it is the class 3632 if (trim($expr) == $class) 3633 { 3634 if ($test = Converter::getClassLink(trim(str_replace('object ','',$expr)),$package)) return $test; 3635 } 3636 // if not, check to see if it is a method or variable of this class tree 3637 if (!strpos($expr,'::')) 3638 { 3639 // if get is neither get() nor $get, assume get is a function, add () to make get() 3640 if (strpos($expr,'$') !== 0 && ! strpos($expr,'()')) //$get = $get.'()'; 3641 { 3642 if ($a = $this-> getLinkMethod($expr,$class,$package)) return $a; 3643 if ($a = $this-> getLinkConst($expr,$class,$package)) return $a; 3644 if ($a = $this-> getLinkVar('$'.$expr,$class,$package)) return $a; 3645 } 3646 if (strpos($expr,'()')) if ($a = $this> getLinkMethod($expr,$class,$package)) return $a; 3647 if (is_numeric(strpos($expr,'$'))) if ($a = $this> getLinkVar($expr,$class,$package)) return $a; 3648 }
3649 } 3650 if ($test = Converter::getClassLink(trim(str_replace('object ','',$expr)),$package)) return $test; 3651 if ($test = Converter::getPageLink(trim($expr),$package)) return $test; 3652 if ($test = Converter::getDefineLink(trim($expr),$package)) return $test; 3653 if ($test = Converter::getGlobalLink(trim($expr),$package)) return $test; 3654 // if (strpos($expr,'.')) 3655 // package specified 3656 3657 if (!is_array($packages)) 3658 { 3659 $packages = $this-> all_packages; 3660 } 3661 do 3662 { 3663 if (isset($packages[$package])) unset($packages[$package]); 3664 if ($test = Converter::getClassLink(str_replace('object ','',$expr),$package)) return $test; 3665 if ($test = Converter::getPageLink($expr,$package)) return $test; 3666 if ($test = Converter::getDefineLink($expr,$package)) return $test; 3667 if ($test = Converter::getGlobalLink($expr,$package)) return $test; 3668 // is $expr in class::method() or class::$variable format? 3669 if (strpos($expr,'function ') === 0) 3670 { // asking for a function, not a method 3671 if ($test = Converter::getFunctionLink(str_replace('function','',str_replace('()','',$expr)), $package)) return $test; 3672 else return $expr; 3673 } 3674 $test = $this-> _getDoubleColon($expr, $package, $packages, $class, $links); 3675 if (!is_string($test)) return $test; 3676 if (strpos($test, 'parent::') === 0) return $test; 3677 // $expr does not have :: 3678 if (is_numeric(@strpos('$',$expr))) 3679 { 3680 // default to current class, whose name is contained in $this->render>parent 3681 if ($test = Converter::getVarLink($expr, $class, $package)) return $test; 3682 } 3683 // $expr is a function? (non-method) 3684 if (@strpos($expr,'()')) 3685 { 3686 // otherwise, see if it is a method 3687 if ($class) 3688 { 3689 if ($test = Converter::getMethodLink(str_replace('()','',$expr), $class, $package)) return $test; 3690 } 3691 // extract the function name, use it to retrieve the file that the function is in 3692 // $page = $this->func_page[str_replace('function ','',str_replace('()','',$expr))]; 3693 // return the link 3694 if ($test = Converter::getFunctionLink(str_replace('function ','',str_replace('()','',$expr)), $package)) return $test; 3695 } 3696 // $expr is just a word. First, test to see if it is a function of the current package 3697 if ($test = Converter::getFunctionLink(str_replace('function ','',str_replace('()','',$expr)), $package)) return $test; 3698 // try other packages 3699 // look in parent package first, if found 3700 if (isset($this-> package_parents[$package]) && in_array($this> package_parents[$package], $packages)) 3701 { 3702 $p1 = $package; 3703 $package = $this-> package_parents[$package]; 3704 if ($package) 3705 { 3706 if (isset($packages[$package])) unset($packages[$package]); 3707 } 3708 continue; 3709 } 3710 // no parent package, so start with the first one that's left 3711 $package = @array_shift(@array_keys($packages)); 3712 if ($package && isset( $packages[$package])) 3713 { 3714 unset($packages[$package]); 3715 } 3716 } while (count($packages) || $package);
3717 $funcs = get_defined_functions(); 3718 // feature 564991, link to php manual 3719 if (in_array(str_replace(array('(',')'),array('',''),$expr),$funcs['internal'])) 3720 { 3721 $return = 'http://www.php.net/'.str_replace(array('(',')'),array('',''),$expr); 3722 return $return; 3723 } 3724 // no links found 3725 return $expr; 3726 } 3727 3728 /** 3729 * Split up getLink to make it easier to debug 3730 * @access private 3731 */ 3732 function _getDoubleColon(& $expr, & $package, & $packages, $class, $links) 3733 { 3734 if (@strpos($expr,'::')) 3735 { 3736 $class_method = explode('::',$expr); 3737 if ($class_method[0] == 'parent') 3738 { 3739 // can only have parent in the same package as the class! subtle bug 3740 $package = $this-> package; 3741 $packages = array(); 3742 $cl = $this-> classes-> getClassByPackage($class,$package); 3743 if (!$cl) 3744 { // this is possible if an example file has parent::method() 3745 return $expr; 3746 } 3747 $par = $cl-> getParent($this); 3748 $phpparent = false; 3749 if (is_object($par)) 3750 { 3751 $package = $par-> docblock-> package; 3752 $phpparent = $par-> getName(); 3753 } else 3754 { 3755 addWarning(PDERROR_CLASS_PARENT_NOT_FOUND,$class,$package,$class_method[1]); 3756 return $expr; 3757 } 3758 if ($phpparent) $class_method[0] = $phpparent; 3759 } 3760 if (strpos($class_method[1],'()')) 3761 { 3762 // strip everything but the function name, return a link 3763 if ($test = Converter::getMethodLink(str_replace('()','',$class_method[1]), $class_method[0], $package)) return $test; 3764 } 3765 if ($test = Converter::getVarLink($class_method[1], $class_method[0], $package)) return $test; 3766 if ($test = Converter::getConstLink($class_method[1], $class_method[0], $package)) return $test; 3767 } 3768 return $expr; 3769 } 3770 3771 /** 3772 * cycle through parent classes to retrieve a link to a method 3773 * do not use or override, used by getLink 3774 * @access private 3775 */ 3776 function & getLinkMethod($expr, $class, $package) 3777 { 3778 $links = & $this-> links; 3779 do 3780 { 3781 // is $expr in class::method() or class::$variable format? 3782 if (@strpos($expr,'::')) 3783 { 3784 $class_method = explode('::',$expr); 3785 if ($class_method[0] == 'parent') 3786 { 3787 $cl = $this-> classes-> getClassByPackage($class,$package); 3788 $par = $cl-> getParent($this); 3789 $phpparent = false; 3790 if (is_object($par)) 3791 { 3792 $package = $par-> docblock-> package; 3793 $phpparent = $par-> getName();
3794 } else addWarning(PDERROR_CLASSPARENT_NOTFOUND,$class,$package,$class_method[1]); 3795 if ($phpparent) $class_method[0] = $phpparent; 3796 } else 3797 { 3798 $cl = $this-> classes-> getClassByPackage($class,$package); 3799 } 3800 if (strpos($class_method[1],'()')) 3801 { 3802 // strip everything but the function name, return a link 3803 if ($test = Converter::getMethodLink(str_replace('function ','',str_replace('()','',$class_method[1])), $class_method[0], $package)) return $test; 3804 } 3805 } 3806 if ($test = Converter::getMethodLink(str_replace('()','',$expr), $class, $package)) return $test; 3807 $cl = $this-> classes-> getClassByPackage($class,$package); 3808 if ($cl) 3809 { 3810 $par = $cl-> getParent($this); 3811 if (is_object($par)) 3812 { 3813 $package = $par-> docblock-> package; 3814 $class = $par-> getName(); 3815 } else $class = $par; 3816 } else $class = false; 3817 } while ($class); 3818 // no links found 3819 $flag = false; 3820 return $flag; 3821 } 3822 3823 /** 3824 * cycle through parent classes to retrieve a link to a var 3825 * do not use or override, used by getLink 3826 * @access private 3827 */ 3828 function & getLinkVar($expr, $class, $package) 3829 { 3830 $links = & $this-> links; 3831 do 3832 { 3833 // is $expr in class::method() or class::$variable format? 3834 if (@strpos($expr,'::')) 3835 { 3836 $class_method = explode('::',$expr); 3837 if ($class_method[0] == 'parent') 3838 { 3839 $cl = $this-> classes-> getClassByPackage($class,$package); 3840 $phpparent = false; 3841 $par = $cl-> getParent($this); 3842 if (is_object($par)) 3843 { 3844 $package = $par-> docblock-> package; 3845 $phpparent = $par-> getName(); 3846 } else addWarning(PDERROR_CLASSPARENT_NOTFOUND,$class,$package,$class_method[1]); 3847 if ($phpparent) $class_method[0] = $phpparent; 3848 } else 3849 { 3850 $cl = $this-> classes-> getClassByPackage($class,$package); 3851 } 3852 if ($test = Converter::getVarLink($class_method[1], $class_method[0], $package)) return $test; 3853 if ($test = Converter::getVarLink('$'.$class_method[1], $class_method[0], $package)) return $test; 3854 } 3855 if ($test = Converter::getVarLink($expr, $class, $package)) return $test; 3856 if ($test = Converter::getVarLink('$'.$expr, $class, $package)) return $test; 3857 $cl = $this-> classes-> getClassByPackage($class,$package); 3858 if ($cl) 3859 { 3860 $par = $cl-> getParent($this); 3861 if (is_object($par)) 3862 { 3863 $package = $par-> docblock-> package; 3864 $class = $par-> getName(); 3865 } else $class = $par; 3866 } else $class = false; 3867 } while ($class);
3868 // no links found 3869 $class = false; 3870 return $class; 3871 } 3872 3873 /** 3874 * cycle through parent classes to retrieve a link to a class constant 3875 * do not use or override, used by getLink 3876 * @access private 3877 * @since 1.2.4 3878 */ 3879 function & getLinkConst($expr, $class, $package) 3880 { 3881 $links = & $this-> links; 3882 do 3883 { 3884 // is $expr in class::method() or class::$variable format? 3885 if (@strpos($expr,'::')) 3886 { 3887 $class_method = explode('::',$expr); 3888 if ($class_method[0] == 'parent') 3889 { 3890 $cl = $this-> classes-> getClassByPackage($class,$package); 3891 $phpparent = false; 3892 $par = $cl-> getParent($this); 3893 if (is_object($par)) 3894 { 3895 $package = $par-> docblock-> package; 3896 $phpparent = $par-> getName(); 3897 } else addWarning(PDERROR_CLASSPARENT_NOTFOUND,$class,$package,$class_method[1]); 3898 if ($phpparent) $class_method[0] = $phpparent; 3899 } else 3900 { 3901 $cl = $this-> classes-> getClassByPackage($class,$package); 3902 } 3903 if ($test = Converter::getConstLink($class_method[1], $class_method[0], $package)) return $test; 3904 } 3905 if ($test = Converter::getConstLink($expr, $class, $package)) return $test; 3906 $cl = $this-> classes-> getClassByPackage($class,$package); 3907 if ($cl) 3908 { 3909 $par = $cl-> getParent($this); 3910 if (is_object($par)) 3911 { 3912 $package = $par-> docblock-> package; 3913 $class = $par-> getName(); 3914 } else $class = $par; 3915 } else $class = false; 3916 } while ($class); 3917 // no links found 3918 $flag = false; 3919 return $flag; 3920 } 3921 3922 /** 3923 * take URL $link and text $text and return a link in the format needed for the Converter 3924 * @param string URL 3925 * @param string text to display 3926 * @return string link to $link 3927 * @abstract 3928 */ 3929 function returnLink($link,$text) 3930 { 3931 } 3932 3933 /** 3934 * take {@link abstractLink} descendant and text $eltext and return a link 3935 * in the format needed for the Converter 3936 * @param abstractLink 3937 * @param string 3938 * @return string link to $element 3939 * @abstract 3940 */ 3941 function returnSee(& $link, $eltext = false) 3942 { 3943 } 3944 3945 /**
3946 * take {@link abstractLink} descendant and text $eltext and return a 3947 * unique ID in the format needed for the Converter 3948 * @param abstractLink 3949 * @return string unique identifier of $element 3950 * @abstract 3951 */ 3952 function getId(& $link) 3953 { 3954 } 3955 3956 /** 3957 * Convert README/INSTALL/CHANGELOG file contents to output format 3958 * @param README|INSTALL|CHANGELOG 3959 * @param string contents of the file 3960 * @abstract 3961 */ 3962 function Convert_RIC($name, $contents) 3963 { 3964 } 3965 3966 /** 3967 * Convert all elements to output format 3968 * 3969 * This will call ConvertXxx where Xxx is {@link ucfirst}($element->type). 3970 * It is expected that a child converter defines a handler for every 3971 * element type, even if that handler does nothing. phpDocumentor will 3972 * terminate with an error if a handler doesn't exist. 3973 * {@internal 3974 * Since 1.2.0 beta 3, this function has been moved from child converters 3975 * to the parent, because it doesn't really make sense to put it in the 3976 * child converter, and we can add error handling. 3977 * 3978 * {@source } } 3979 * @throws {@link PDERROR_NO_CONVERT_HANDLER} 3980 * @param mixed {@link parserElement} descendant or {@link parserPackagePage} or {@link parserData} 3981 */ 3982 function Convert(& $element) 3983 { 3984 $handler = 'convert'.ucfirst($element-> type); 3985 if (method_exists($this,$handler)) 3986 { 3987 $this-> $handler($element); 3988 } else 3989 { 3990 addErrorDie(PDERROR_NO_CONVERTER_HANDLER,$element> type,$handler,phpDocumentor_get_class($this)); 3991 } 3992 } 3993 /**#@+ 3994 * Conversion Handlers 3995 * 3996 * All of the convert* handlers set up template variables for the Smarty 3997 * template.{@internal In addition, the {@link newSmarty()} method is 3998 * called to retrieve the global Smarty template}} 3999 */ 4000 /** 4001 * Default Tutorial Handler 4002 * 4003 * Sets up the tutorial template, and its prev/next/parent links 4004 * {@internal 4005 * Retrieves the title using {@link parserTutorial::getTitle()} and uses the 4006 * {@link parserTutorial::prev, parserTutorial::next, parserTutorial::parent} 4007 * links to set up those links.}}} 4008 * @param parserTutorial 4009 */ 4010 function & convertTutorial(& $element) 4011 { 4012 $this-> package = $element-> package; 4013 $this-> subpackage = $element-> subpackage; 4014 $x = $element-> Convert($this); 4015 $template = & $this-> newSmarty(); 4016 $template-> assign('contents',$x); 4017 $template-> assign('title',$element-> getTitle($this)); 4018 $template-> assign('nav',$element-> parent || $element-> prev || $element> next); 4019 if ($element-> parent) 4020 { 4021 $template-> assign('up',$this-> getId($element-> parent)); 4022 $template-> assign('uptitle',$element-> parent-> title);
4023 } 4024 if ($element-> prev) 4025 { 4026 $template-> assign('prev',$this-> getId($element-> prev)); 4027 $template-> assign('prevtitle',$element-> prev-> title); 4028 } 4029 if ($element-> next) 4030 { 4031 $template-> assign('next',$this-> getId($element-> next)); 4032 $template-> assign('nexttitle',$element-> next-> title); 4033 } 4034 return $template; 4035 } 4036 /** 4037 * Default Class Handler 4038 * 4039 * Sets up the class template. 4040 * {@internal special methods 4041 * {@link generateChildClassList(), generateFormattedClassTree()}, 4042 * {@link getFormattedConflicts, getFormattedInheritedMethods}, 4043 * and {@link getFormattedInheritedVars} are called to complete vital 4044 * template setup.}}} 4045 */ 4046 function convertClass(& $element) 4047 { 4048 $this-> class = $element-> getName(); 4049 $this-> class_data = & $this-> newSmarty(); 4050 $this-> class_data-> assign("class_name" ,$element-> getName()); 4051 $this-> class_data-> assign("vars" ,array()); 4052 $this-> class_data-> assign("methods" ,array()); 4053 $this-> class_data-> assign("consts" ,array()); 4054 $this-> class_data-> assign("is_interface" , $element-> isInterface()); 4055 $this-> class_data-> assign("implements" , $this> getFormattedImplements($element)); 4056 $this-> class_data-> assign("package" ,$element-> docblock-> package); 4057 $this-> class_data-> assign("line_number" ,$element-> getLineNumber()); 4058 $this-> class_data-> assign("source_location" ,$element> getSourceLocation($this)); 4059 $this-> class_data-> assign("page_link" ,$this> getCurrentPageLink()); 4060 $docblock = $this-> prepareDocBlock($element, false); 4061 $this-> class_data-> assign("sdesc" ,$docblock['sdesc']); 4062 $this-> class_data-> assign("desc" ,$docblock['desc']); 4063 $this-> class_data-> assign("access" , $docblock['access']); 4064 $this-> class_data-> assign("abstract" , $docblock['abstract']); 4065 $this-> class_data-> assign("tags" ,$docblock['tags']); 4066 $this-> class_data-> assign("api_tags" ,$docblock['api_tags']); 4067 $this-> class_data-> assign("info_tags" ,$docblock['info_tags']); 4068 $this-> class_data-> assign("utags" ,$docblock['utags']); 4069 $this-> class_data-> assign( "prop_tags" , $docblock['property_tags'] ); 4070 if ($this-> hasSourceCode($element-> getPath())) { 4071 $this-> class_data-> assign("class_slink" ,$this> getSourceAnchor($element-> getPath(),$element-> getLineNumber(),$element> getLineNumber(),true)); 4072 } 4073 4074 else 4075 $this-> class_data-> assign("class_slink" ,false); 4076 $this-> class_data-> assign("children" , $this> generateChildClassList($element)); 4077 $this-> class_data-> assign("class_tree" , $this> generateFormattedClassTree($element)); 4078 $this-> class_data-> assign("conflicts" , $this> getFormattedConflicts($element,"classes" )); 4079 $inherited_methods = $this-> getFormattedInheritedMethods($element); 4080 if (!empty($inherited_methods)) 4081 { 4082 $this-> class_data-> assign("imethods" ,$inherited_methods); 4083 } else 4084 { 4085 $this-> class_data-> assign("imethods" ,false); 4086 } 4087 $inherited_vars = $this-> getFormattedInheritedVars($element); 4088 if (!empty($inherited_vars)) 4089 { 4090 $this-> class_data-> assign("ivars" ,$inherited_vars); 4091 } else 4092 { 4093 $this-> class_data-> assign("ivars" ,false); 4094 }
4095 $inherited_consts = $this-> getFormattedInheritedConsts($element); 4096 if (!empty($inherited_consts)) 4097 { 4098 $this-> class_data-> assign("iconsts" ,$inherited_consts); 4099 } else 4100 { 4101 $this-> class_data-> assign("iconsts" ,false); 4102 } 4103 } 4104 4105 4106 /** 4107 * Converts method for template output 4108 * 4109 * This function must be called by a child converter with any extra 4110 * template variables needed in the parameter $addition 4111 * @param parserMethod 4112 */ 4113 function convertMethod(& $element, $additions = array()) 4114 { 4115 $fname = $element-> getName(); 4116 $docblock = $this-> prepareDocBlock($element); 4117 $returntype = 'void'; 4118 if ($element-> isConstructor) $returntype = $element-> class; 4119 if ($element-> docblock-> return) 4120 { 4121 $a = $element-> docblock-> return-> Convert($this); 4122 $returntype = $element-> docblock-> return-> converted_returnType; 4123 } 4124 $params = $param_i = array(); 4125 if (count($element-> docblock-> params)) 4126 foreach($element-> docblock-> params as $param => $val) 4127 { 4128 $a = $val-> Convert($this); 4129 $params[] = $param_i[$param] = array("var" => $param,"datatype" => $val-> converted_returnType,"data" => $a); 4130 } 4131 4132 if ($element-> docblock-> hasaccess) { 4133 $acc = $docblock['access']; 4134 } else { 4135 $acc = 'public'; 4136 } 4137 4138 if ($this-> hasSourceCode($element-> getPath())) 4139 $additions["slink" ] = $this-> getSourceAnchor($element> getPath(),$element-> getLineNumber(),$element-> getLineNumber(),true); 4140 $this-> class_data-> append('methods',array_merge( 4141 array('sdesc' => $docblock['sdesc'], 4142 'desc' => $docblock['desc'], 4143 'static' => $docblock['static'], 4144 'abstract' => $docblock['abstract'], 4145 'tags' => $docblock['tags'], 4146 'api_tags' => $docblock['api_tags'], 4147 'see_tags' => $docblock['see_tags'], 4148 'info_tags_sorted' => $docblock['info_tags_sorted'], 4149 'info_tags' => $docblock['info_tags'], 4150 'utags' => $docblock['utags'], 4151 'constructor' => $element> isConstructor, 4152 'access' => $acc, 4153 'function_name' => $fname, 4154 'function_return' => $returntype, 4155 'function_call' => $element> getFunctionCall(), 4156 'ifunction_call' => $element> getIntricateFunctionCall($this, $param_i), 4157 'descmethod' => $this> getFormattedDescMethods($element), 4158 'method_overrides' => $this> getFormattedOverrides($element), 4159 'method_implements' => $this> getFormattedMethodImplements($element), 4160 'line_number' => $element> getLineNumber(), 4161 'id' => $this-> getId($element), 4162 'params' => $params), 4163 $additions)); 4164 }
4165 4166 /** 4167 * Converts class variables for template output. 4168 * 4169 * This function must be called by a child converter with any extra 4170 * template variables needed in the parameter $addition 4171 * @param parserVar 4172 */ 4173 function convertVar(& $element, $additions = array()) 4174 { 4175 $docblock = $this-> prepareDocBlock($element); 4176 $b = 'mixed'; 4177 4178 if ($element-> docblock-> hasaccess) 4179 $acc = $element-> docblock-> tags['access'][0]-> value; 4180 else 4181 $acc = 'public'; 4182 4183 if ($element-> docblock-> var) 4184 { 4185 $b = $element-> docblock-> var-> converted_returnType; 4186 } 4187 if ($this-> hasSourceCode($element-> getPath())) 4188 $additions["slink" ] = $this-> getSourceAnchor($element> getPath(),$element-> getLineNumber(),$element-> getLineNumber(),true); 4189 $this-> class_data-> append('vars',array_merge( 4190 array('sdesc' => $docblock['sdesc'], 4191 'desc' => $docblock['desc'], 4192 'static' => $docblock['static'], 4193 'abstract' => $docblock['abstract'], 4194 'utags' => $docblock['utags'], 4195 'tags' => $docblock['tags'], 4196 'api_tags' => $docblock['api_tags'], 4197 'info_tags' => $docblock['info_tags'], 4198 'var_name' => $element-> getName(), 4199 'has_default' => strlen($element> getValue()), 4200 'var_default' => $this> postProcess($element-> getValue()), 4201 'var_type' => $b, 4202 'access' => $acc, 4203 'line_number' => $element> getLineNumber(), 4204 'descvar' => $this> getFormattedDescVars($element), 4205 'var_overrides' => $this> getFormattedOverrides($element), 4206 'id' => $this-> getId($element)), 4207 $additions)); 4208 } 4209 4210 /** 4211 * Converts class constants for template output. 4212 * 4213 * This function must be called by a child converter with any extra 4214 * template variables needed in the parameter $addition 4215 * @param parserConst 4216 */ 4217 function convertConst(& $element, $additions = array()) 4218 { 4219 $docblock = $this-> prepareDocBlock($element); 4220 4221 if ($element-> docblock-> hasaccess) 4222 $acc = $element-> docblock-> tags['access'][0]-> value; 4223 else 4224 $acc = 'public'; 4225 4226 if ($this-> hasSourceCode($element-> getPath())) 4227 $additions["slink" ] = $this-> getSourceAnchor($element> getPath(),$element-> getLineNumber(),$element-> getLineNumber(),true); 4228 $this-> class_data-> append('consts',array_merge( 4229 array('sdesc' => $docblock['sdesc'], 4230 'desc' => $docblock['desc'], 4231 'access' => $docblock['access'], 4232 'abstract' => $docblock['abstract'], 4233 'utags' => $docblock['utags'], 4234 'tags' => $docblock['tags'], 4235 'api_tags' => $docblock['api_tags'], 4236 'info_tags' => $docblock['info_tags'], 4237 'const_name' => $element-> getName(),
4238 'const_value' => $this> postProcess($element-> getValue()), 4239 'access' => $acc, 4240 'line_number' => $element> getLineNumber(), 4241 'id' => $this-> getId($element)), 4242 $additions)); 4243 } 4244 4245 /** 4246 * Default Page Handler 4247 * 4248 * {@internal In addition to setting up the smarty template with {@link newSmarty()}, 4249 * this class uses {@link getSourceLocation()} and {@link getClassesOnPage()} 4250 * to set template variables. Also used is {@link getPageName()}, to get 4251 * a Converter-specific name for the page.}}} 4252 * @param parserPage 4253 */ 4254 function convertPage(& $element) 4255 { 4256 $this-> page_data = & $this-> newSmarty(true); 4257 $this-> page = $this-> getPageName($element-> parent); 4258 $this-> path = $element-> parent-> getPath(); 4259 $this-> curpage = & $element-> parent; 4260 $this-> page_data-> assign("source_location" ,$element-> parent> getSourceLocation($this)); 4261 $this-> page_data-> assign("functions" ,array()); 4262 $this-> page_data-> assign("includes" ,array()); 4263 $this-> page_data-> assign("defines" ,array()); 4264 $this-> page_data-> assign("globals" ,array()); 4265 $this-> page_data-> assign("classes" ,$this> getClassesOnPage($element)); 4266 $this-> page_data-> assign("hasclasses" ,$element-> hasClasses()); 4267 $this-> page_data-> assign("hasinterfaces" ,$element-> hasInterfaces()); 4268 $this-> page_data-> assign("name" , $element-> parent-> getFile()); 4269 if ($t = $element-> getTutorial()) 4270 { 4271 $this-> page_data-> assign("tutorial" ,$this-> returnSee($t)); 4272 } else 4273 { 4274 $this-> page_data-> assign("tutorial" ,false); 4275 } 4276 if ($element-> docblock) 4277 { 4278 $docblock = $this-> prepareDocBlock($element, false); 4279 $this-> page_data-> assign("sdesc" ,$docblock['sdesc']); 4280 $this-> page_data-> assign("desc" ,$docblock['desc']); 4281 $this-> page_data-> assign("tags" ,$docblock['tags']); 4282 $this-> page_data-> assign("api_tags" ,$docblock['api_tags']); 4283 $this-> page_data-> assign("info_tags" ,$docblock['info_tags']); 4284 $this-> page_data-> assign("utags" ,$docblock['utags']); 4285 } 4286 } 4287 4288 /** 4289 * Converts global variables for template output 4290 * 4291 * This function must be called by a child converter with any extra 4292 * template variables needed in the parameter $addition 4293 * {@internal 4294 * In addition to using {@link prepareDocBlock()}, this method also 4295 * uses utility functions {@link getGlobalValue(), getFormattedConflicts()}}}} 4296 * @param parserGlobal 4297 * @uses postProcess() on global_value template value, makes it displayable 4298 * @param array any additional template variables should be in this array 4299 */ 4300 function convertGlobal(& $element, $addition = array()) 4301 { 4302 $docblock = $this-> prepareDocBlock($element); 4303 $value = $this-> getGlobalValue($element-> getValue()); 4304 if ($this-> hasSourceCode($element-> getPath())) 4305 $addition["slink" ] = $this-> getSourceAnchor($element> getPath(),$element-> getLineNumber(),$element-> getLineNumber(),true); 4306 $this-> page_data-> append('globals',array_merge( 4307 array('sdesc' => $docblock['sdesc'], 4308 'desc' => $docblock['desc'], 4309 'tags' => $docblock['tags'], 4310 'api_tags' => $docblock['api_tags'], 4311 'info_tags' => $docblock['info_tags'], 4312 'utags' => $docblock['utags'],
4313 'global_name' => $element> getName(), 4314 'global_type' => $element> getDataType($this), 4315 'global_value' => $value, 4316 'line_number' => $element> getLineNumber(), 4317 'global_conflicts' => $this> getFormattedConflicts($element,"global variables" ), 4318 'id' => $this-> getId($element)), 4319 $addition)); 4320 } 4321 4322 /** 4323 * Converts defines for template output 4324 * 4325 * This function must be called by a child converter with any extra 4326 * template variables needed in the parameter $addition 4327 * {@internal 4328 * In addition to using {@link prepareDocBlock()}, this method also 4329 * uses utility functions {@link getGlobalValue(), getFormattedConflicts()}}}} 4330 * @param parserDefine 4331 * @uses postProcess() on define_value template value, makes it displayable 4332 * @param array any additional template variables should be in this array 4333 */ 4334 function convertDefine(& $element, $addition = array()) 4335 { 4336 $docblock = $this-> prepareDocBlock($element); 4337 if ($this-> hasSourceCode($element-> getPath())) 4338 $addition["slink" ] = $this-> getSourceAnchor($element> getPath(),$element-> getLineNumber(),$element-> getLineNumber(),true); 4339 $this-> page_data-> append('defines',array_merge( 4340 array('sdesc' => $docblock['sdesc'], 4341 'desc' => $docblock['desc'], 4342 'tags' => $docblock['tags'], 4343 'api_tags' => $docblock['api_tags'], 4344 'info_tags' => $docblock['info_tags'], 4345 'utags' => $docblock['utags'], 4346 'define_name' => $element> getName(), 4347 'line_number' => $element> getLineNumber(), 4348 'define_value' => $this> postProcess($element-> getValue()), 4349 'define_conflicts' => $this> getFormattedConflicts($element,"defines" ), 4350 'id' => $this-> getId($element)), 4351 $addition)); 4352 } 4353 4354 4355 /** 4356 * Converts includes for template output 4357 * 4358 * This function must be called by a child converter with any extra 4359 * template variables needed in the parameter $addition 4360 * @see prepareDocBlock() 4361 * @param parserInclude 4362 */ 4363 function convertInclude(& $element, $addition = array()) 4364 { 4365 $docblock = $this-> prepareDocBlock($element); 4366 $per = $this-> getIncludeValue($element-> getValue(), $element-> getPath()); 4367 4368 if ($this-> hasSourceCode($element-> getPath())) 4369 $addition["slink" ] = $this-> getSourceAnchor($element> getPath(),$element-> getLineNumber(),$element-> getLineNumber(),true); 4370 $this-> page_data-> append('includes',array_merge( 4371 array('sdesc' => $docblock['sdesc'], 4372 'desc' => $docblock['desc'], 4373 'tags' => $docblock['tags'], 4374 'api_tags' => $docblock['api_tags'], 4375 'info_tags' => $docblock['info_tags'], 4376 'utags' => $docblock['utags'], 4377 'include_name' => $element> getName(), 4378 'line_number' => $element> getLineNumber(), 4379 'include_value' => $per), 4380 $addition));
4381 } 4382 4383 /** 4384 * Converts function for template output 4385 * 4386 * This function must be called by a child converter with any extra 4387 * template variables needed in the parameter $addition 4388 * @see prepareDocBlock() 4389 * @param parserFunction 4390 */ 4391 function convertFunction(& $element, $addition = array()) 4392 { 4393 $docblock = $this-> prepareDocBlock($element); 4394 $fname = $element-> getName(); 4395 $params = $param_i = array(); 4396 if (count($element-> docblock-> params)) 4397 foreach($element-> docblock-> params as $param => $val) 4398 { 4399 $a = $val-> Convert($this); 4400 $params[] = $param_i[$param] = array("var" => $param,"datatype" => $val-> converted_returnType,"data" => $a); 4401 } 4402 $returntype = 'void'; 4403 if ($element-> docblock-> return) 4404 { 4405 $a = $element-> docblock-> return-> Convert($this); 4406 $returntype = $element-> docblock-> return-> converted_returnType; 4407 } 4408 4409 if ($this-> hasSourceCode($element-> getPath())) 4410 $addition["slink" ] = $this-> getSourceAnchor($element> getPath(),$element-> getLineNumber(),$element-> getLineNumber(),true); 4411 $this-> page_data-> append('functions',array_merge( 4412 array('sdesc' => $docblock['sdesc'], 4413 'desc' => $docblock['desc'], 4414 'tags' => $docblock['tags'], 4415 'api_tags' => $docblock['api_tags'], 4416 'info_tags' => $docblock['info_tags'], 4417 'utags' => $docblock['utags'], 4418 'function_name' => $fname, 4419 'function_return' => $returntype, 4420 'function_conflicts' => $this> getFormattedConflicts($element,"functions" ), 4421 'ifunction_call' => $element> getIntricateFunctionCall($this, $param_i), 4422 'function_call' => $element> getFunctionCall(), 4423 'line_number' => $element> getLineNumber(), 4424 'id' => $this-> getId($element), 4425 'params' => $params), 4426 $addition)); 4427 } 4428 /**#@-*/ 4429 4430 /** 4431 * convert the element's DocBlock for output 4432 * 4433 * This function converts all tags and descriptions for output 4434 * @param mixed any descendant of {@link parserElement}, or {@link parserData} 4435 * @param array used to translate tagnames into other tags 4436 * @param boolean set to false for pages and classes, the only elements allowed to specify @package 4437 * @return array 4438 * 4439 * Format: 4440 * <pre> 4441 * array('sdesc' => DocBlock summary 4442 * 'desc' => DocBlock detailed description 4443 * 'tags' => array('keyword' => tagname, 'data' => tag description) 4444 * known tags 4445 * 'api_tags' => array('keyword' => tagname, 'data' => tag description) 4446 * known api documentation tags 4447 * 'info_tags' => array('keyword' => tagname, 'data' => tag description) 4448 * known informational tags 4449 * [ 'utags' => array('keyword' => tagname, 'data' => tag description 4450 * unknown tags ] 4451 * [ 'vartype' => type from @var/@return tag ] 4452 * [ 'var_descrip' => description from @var/@return tag ] 4453 * )
4454 * </pre> 4455 */ 4456 function prepareDocBlock(& $element, $names = array(),$nopackage = true) 4457 { 4458 $tagses = $element-> docblock-> listTags(); 4459 $tags = $ret = $api_tags = $info_tags = array(); 4460 $api_tags_arr = array("abstract" , "access" , "deprecated" , "example" , "filesource" , 4461 "global" , "internal" , "name" , "return" , "see" , 4462 "property" , "property-read" , "propertywrite" , "method" , 4463 "staticvar" , "usedby" , "uses" , "var" ); 4464 if (!$nopackage) 4465 { 4466 $tags[] = array('keyword' => 'package','data' => $element-> docblock> package); 4467 if (!empty($element-> docblock-> subpackage)) $tags[] = array('keyword' => 'subpackage','data' => $element-> docblock-> subpackage); 4468 } 4469 if ($element-> docblock-> var) 4470 { 4471 $a = $element-> docblock-> var-> Convert($this); 4472 $ret['vartype'] = $element-> docblock-> var-> converted_returnType; 4473 if (!empty($a)) 4474 { 4475 $tags[] = array('keyword' => 'var', 'data' => $a); 4476 $ret["var_descrip" ] = $a; 4477 } 4478 } 4479 if ($element-> docblock-> return) 4480 { 4481 $a = $element-> docblock-> return-> Convert($this); 4482 $ret['vartype'] = $element-> docblock-> return-> converted_returnType; 4483 if (!empty($a)) 4484 { 4485 $tags[] = $api_tags[] = array('keyword' => 'return', 'data' => $a); 4486 $ret["var_descrip" ] = $a; 4487 } 4488 } 4489 if ($element-> docblock-> funcglobals) 4490 foreach($element-> docblock-> funcglobals as $global => $val) 4491 { 4492 if ($a = $this-> getGlobalLink($global,$element-> docblock-> package)) 4493 { 4494 $global = $a; 4495 } 4496 $b = Converter::getLink($val[0]); 4497 if (is_object($b) && phpDocumentor_get_class($b) == 'classlink') 4498 { 4499 $val[0] = $this-> returnSee($b); 4500 } 4501 $tags[] = $api_tags[] = array('keyword' => 'global','data' => $val[0].' '.$global.': '.$val[1]-> Convert($this)); 4502 } 4503 if ($element-> docblock-> statics) 4504 foreach($element-> docblock-> statics as $static => $val) 4505 { 4506 $a = $val-> Convert($this); 4507 $tags[] = $api_tags[] = array('keyword' => 'staticvar','data' => $val> converted_returnType.' '.$static.': '.$a); 4508 } 4509 $property_tags = array(); 4510 foreach ( $element-> docblock-> properties as $prop_name => $val ) 4511 { 4512 $a = $val-> Convert( $this ); 4513 if ( !empty( $a ) ) 4514 { 4515 $tags[] = $api_tags[] = array( 'keyword' => $val-> keyword , 4516 'data' => $val-> converted_returnType . ' ' . $prop_name . ': ' . $a ); 4517 $prop['prop_name'] = $prop_name; 4518 $prop['access'] = $val-> keyword == 'property-read' ? 'read' : 4519 ( $val-> keyword == 'property-write' ? 'write' : 'read/write' ); 4520 $prop['prop_type'] = $val-> converted_returnType; 4521 $prop['sdesc'] = $a; 4522 $property_tags[ $prop_name ] = $prop; 4523 }
4524 } 4525 ksort( $property_tags, SORT_STRING ); 4526 $property_tags = array_values( $property_tags ); 4527 $info_tags_sorted = array(); 4528 $ret['static'] = false; 4529 foreach($tagses as $tag) 4530 { 4531 if (isset($names[$tag-> keyword])) $tag-> keyword = $names[$tag-> keyword]; 4532 if ($tag-> keyword == 'static') { 4533 $ret['static'] = true; 4534 continue; 4535 } 4536 if ($tag-> keyword) 4537 $tags[] = array("keyword" => $tag-> keyword,"data" => $tag-> Convert($this)); 4538 if (in_array($tag-> keyword, $api_tags_arr)) { 4539 $api_tags[] = array("keyword" => $tag-> keyword,"data" => $tag-> Convert($this)); 4540 } else { 4541 $info_tags[] = array("keyword" => $tag> keyword,"data" => $tag-> Convert($this)); 4542 @list( $className, $desc ) = explode( " " , $tag-> Convert($this), 2 ); 4543 $info_tags_sorted[ $tag-> keyword ][] = array( 'keyword' => $className, 'data' => $desc ); 4544 } 4545 } 4546 $utags = array(); 4547 foreach($element-> docblock-> unknown_tags as $keyword => $tag) 4548 { 4549 foreach($tag as $t) 4550 $utags[] = array('keyword' => $keyword, 'data' => $t-> Convert($this)); 4551 } 4552 $ret['abstract'] = false; 4553 $ret['access'] = 'public'; 4554 $see_tags = array(); 4555 foreach($tags as $tag) 4556 { 4557 if ($tag['keyword'] == 'access') { 4558 $ret['access'] = $tag['data']; 4559 } 4560 if ($tag['keyword'] == 'abstract') { 4561 $ret['abstract'] = true; 4562 } 4563 if ($tag['keyword'] == 'see' || $tag['keyword'] == 'uses' || 4564 $tag['keyword'] == 'usedby') { 4565 $see_tags[] = $tag['data']; 4566 } 4567 } 4568 $ret['sdesc'] = $element-> docblock-> getSDesc($this); 4569 $ret['desc'] = $element-> docblock-> getDesc($this); 4570 $ret['tags'] = $tags; 4571 $ret['see_tags'] = $see_tags; 4572 $ret['info_tags_sorted'] = $info_tags_sorted; 4573 $ret['api_tags'] = $api_tags; 4574 $ret['info_tags'] = $info_tags; 4575 $ret['utags'] = $utags; 4576 $ret['property_tags'] = $property_tags; 4577 return $ret; 4578 } 4579 4580 /** 4581 * gets a list of all classes declared on a procedural page represented by 4582 * $element, a {@link parserData} class 4583 * @param parserData &$element 4584 * @return array links to each classes documentation 4585 * 4586 * Format: 4587 * <pre> 4588 * array('name' => class name, 4589 * 'sdesc' => summary of the class 4590 * 'link' => link to the class's documentation) 4591 * </pre> 4592 */ 4593 function getClassesOnPage(& $element) 4594 { 4595 global $_phpDocumentor_setting; 4596 $a = $element-> getClasses($this); 4597 $classes = array(); 4598 foreach($a as $package => $clas)
4599 { 4600 if (!empty($_phpDocumentor_setting['packageoutput'])) 4601 { 4602 $packages = explode(',',$_phpDocumentor_setting['packageoutput']); 4603 if (!in_array($package, $packages)) continue; 4604 } 4605 for($i=0; $i< count($clas); $i++) 4606 { 4607 if ($this-> parseprivate || ! ($clas[$i]-> docblock && $clas[$i]> docblock-> hasaccess && $clas[$i]-> docblock-> tags['access'][0]-> value == 'private')) 4608 { 4609 $sdesc = ''; 4610 $r = array(); 4611 $sdesc = $clas[$i]-> docblock-> getSDesc($this); 4612 if ($clas[$i]-> docblock-> hasaccess) 4613 $r['access'] = $clas[$i]-> docblock> tags['access'][0]-> value; 4614 else 4615 $r['access'] = 'public'; 4616 if (isset ($clas[$i]-> docblock-> tags['abstract'])) 4617 $r['abstract'] = TRUE; 4618 else 4619 $r['abstract'] = FALSE; 4620 $r['name'] = $clas[$i]-> getName(); 4621 $r['sdesc'] = $sdesc; 4622 $r['link'] = $this-> getClassLink($clas[$i]> getName(),$package,$clas[$i]-> getPath()); 4623 $classes[] = $r; 4624 } 4625 } 4626 } 4627 return $classes; 4628 } 4629 4630 /** 4631 * returns an array containing the class inheritance tree from the root 4632 * object to the class. 4633 * 4634 * This method must be overridden, or phpDocumentor will halt with a fatal 4635 * error 4636 * @return string Converter-specific class tree for an individual class 4637 * @param parserClass class variable 4638 * @abstract 4639 */ 4640 4641 function generateFormattedClassTree($class) 4642 { 4643 addErrorDie(PDERROR_CONVERTER_OVR_GFCT,phpDocumentor_get_class($this)); 4644 } 4645 4646 /** 4647 * returns an array containing the class inheritance tree from the root 4648 * object to the class. 4649 * 4650 * This method must be overridden, or phpDocumentor will halt with a fatal 4651 * error 4652 * @return string Converter-specific class tree for an individual class 4653 * @param parserClass class variable 4654 * @abstract 4655 */ 4656 4657 function getFormattedImplements($el) 4658 { 4659 $ret = array(); 4660 foreach ($el-> getImplements() as $interface) 4661 { 4662 $link = $this-> getLink($interface); 4663 if ($link && is_object($link)) { 4664 $ret[] = $this-> returnSee($link); 4665 } else { 4666 if (class_exists('ReflectionClass')) { 4667 if (interface_exists($interface)) { 4668 $inter = new ReflectionClass($interface); 4669 if ($inter-> isInternal()) { 4670 $ret[] = $interface . ' (internal interface)'; 4671 } else { 4672 $ret[] = $interface; 4673 } 4674 }
4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754
} else { $ret[] = $interface; } } } return $ret; } /** * @param mixed {@link parserClass, parserFunction, parserDefine} or * {@link parserGlobal} * @param string type to display. either 'class','function','define' * or 'global variable' * @return array links to conflicting elements, or empty array * @uses parserClass::getConflicts() * @uses parserFunction::getConflicts() * @uses parserDefine::getConflicts() * @uses parserGlobal::getConflicts() */ function getFormattedConflicts(& $element,$type) { $conflicts = $element-> getConflicts($this); $r = array(); if (!$conflicts) return false; foreach($conflicts as $package => $class) { $r[] = $class-> getLink($this,$class-> docblock-> package); } if (!empty($r)) $r = array('conflicttype' => $type, 'conflicts' => return $r; } /** * Get a list of methods in child classes that override this method * @return array empty array or array(array('link'=>link to method, * 'sdesc'=>short description of the method),...) * @uses parserMethod::getOverridingMethods() * @param parserMethod */ function getFormattedDescMethods(& $element) { $meths = $element-> getOverridingMethods($this); $r = array(); for($i=0; $i< count($meths); $i++) { $ms = array(); $ms['link'] = $meths[$i]-> getLink($this); $ms['sdesc'] = $meths[$i]-> docblock-> getSDesc($this); $r[] = $ms; } return $r; } /** * Get a list of vars in child classes that override this var * @return array empty array or array('link'=>link to var, * 'sdesc'=>short description of the method * @uses parserVar::getOverridingVars() * @param parserVar */ function getFormattedDescVars(& $element) { $vars = $element-> getOverridingVars($this); $r = array(); for($i=0; $i< count($vars); $i++) { $vs = array(); $vs['link'] = $vars[$i]-> getLink($this); $vs['sdesc'] = $vars[$i]-> docblock-> getSDesc($this); $r[] = $vs; } return $r; } /** * Get the method this method overrides, if any * @return array|falsearray('link'=>link to overridden method, * 'sdesc'=>short description * @see parserMethod::getOverrides() * @param parserMethod
$r);
4755 */ 4756 function getFormattedOverrides(& $element) 4757 { 4758 $ovr = $element-> getOverrides($this); 4759 if (!$ovr) return false; 4760 $sdesc = $ovr-> docblock-> getSDesc($this); 4761 $name = method_exists($ovr, 'getFunctionCall') ? $ovr-> getFunctionCall() : $ovr> getName(); 4762 $link = ($link = $ovr-> getLink($this)) ? $link : $ovr-> getClass() . '::' . $name; 4763 return array('link' => $link,'sdesc' => $sdesc); 4764 } 4765 4766 /** 4767 * Get the method this method(s) implemented from an interface, if any 4768 * @return array|falsearray('link'=>link to implemented method, 4769 * 'sdesc'=>short description 4770 * @uses parserMethod::getImplements() 4771 * @param parserMethod 4772 */ 4773 function getFormattedMethodImplements(& $element) 4774 { 4775 $ovr = $element-> getImplements($this); 4776 if (!$ovr) return false; 4777 $ret = array(); 4778 foreach ($ovr as $impl) { 4779 $sdesc = $impl-> docblock-> getSDesc($this); 4780 $name = $impl-> getName(); 4781 $link = ($link = $impl-> getLink($this)) ? $link : $impl-> getClass() . '::' . $name; 4782 $ret[] = array('link' => $link,'sdesc' => $sdesc); 4783 } 4784 return $ret; 4785 } 4786 4787 /** 4788 * returns a list of child classes 4789 * 4790 * @param parserClass class variable 4791 * @uses parserClass::getChildClassList() 4792 */ 4793 4794 function generateChildClassList($class) 4795 { 4796 $kids = $class-> getChildClassList($this); 4797 $list = array(); 4798 if (count($kids)) 4799 { 4800 for($i=0; $i< count($kids); $i++) 4801 { 4802 $lt['link'] = $kids[$i]-> getLink($this); 4803 $lt['sdesc'] = $kids[$i]-> docblock-> getSDesc($this); 4804 4805 if ($kids[$i]-> docblock-> hasaccess) 4806 $lt['access'] = $kids[$i]-> docblock> tags['access'][0]-> value; 4807 else 4808 $lt['access'] = 'public'; 4809 4810 $lt['abstract'] = isset ($kids[$i]-> docblock> tags['abstract'][0]); 4811 4812 $list[] = $lt; 4813 } 4814 } else return false; 4815 return $list; 4816 } 4817 4818 /** 4819 * Return template-enabled list of inherited variables 4820 * 4821 * uses parserVar helper function getInheritedVars and generates a 4822 * template-enabled list using getClassLink() 4823 * @param parserVar $child class var 4824 * @see getClassLink(), parserVar::getInheritedVars() 4825 * @return array Format: 4826 * <pre> 4827 * array( 4828 * array('parent_class' => link to parent class's documentation, 4829 * 'ivars' => 4830 * array(
4831 * array('name' => inherited variable name, 4832 * 'link' => link to inherited variable's documentation, 4833 * 'default' => default value of inherited variable, 4834 * 'sdesc' => summary of inherited variable), 4835 * ...), 4836 * ...) 4837 * </pre> 4838 */ 4839 4840 function getFormattedInheritedVars($child) 4841 { 4842 $package = $child-> docblock-> package; 4843 $subpackage = $child-> docblock-> subpackage; 4844 $ivars = $child-> getInheritedVars($this); 4845 $results = array(); 4846 if (!count($ivars)) return $results; 4847 foreach($ivars as $parent => $vars) 4848 { 4849 $file = $vars['file']; 4850 $vars = $vars['vars']; 4851 $par = $this-> classes-> getClass($parent,$file); 4852 if ($par) { 4853 $package = $par-> docblock-> package; 4854 } 4855 usort($vars,array($this,"sortVar" )); 4856 $result['parent_class'] = $this-> getClassLink($parent, $package); 4857 if (!$result['parent_class']) { 4858 $result['parent_class'] = $parent . ' (Internal Class)'; 4859 } 4860 foreach($vars as $var) 4861 { 4862 $info = array(); 4863 4864 if ($var-> docblock-> hasaccess) { 4865 $info['access'] = $var-> docblock-> tags['access'][0]-> value; 4866 } else { 4867 $info['access'] = 'public'; 4868 } 4869 4870 $info['abstract'] = isset ($var-> docblock-> tags['abstract'][0]); 4871 4872 $info['name'] = $var-> getName(); 4873 $info['link'] = $var-> getLink($this); 4874 if (!$info['link']) { 4875 $info['link'] = $info['name']; 4876 } 4877 $info['default'] = $this-> postProcess($var-> getValue()); 4878 if ($var-> docblock) 4879 $info['sdesc'] = $var-> docblock-> getSDesc($this); 4880 $result["ivars" ][] = $info; 4881 } 4882 $results[] = $result; 4883 $result = array(); 4884 } 4885 return $results; 4886 } 4887 4888 /** 4889 * Return template-enabled list of inherited methods 4890 * 4891 * uses parserMethod helper function getInheritedMethods and generates a 4892 * template-enabled list using getClassLink() 4893 * @param parserMethod $child class method 4894 * @see getClassLink(), parserMethod::getInheritedMethods() 4895 * @return array Format: 4896 * <pre> 4897 * array( 4898 * array('parent_class' => link to parent class's documentation, 4899 * 'ivars' => 4900 * array( 4901 * array('name' => inherited variable name, 4902 * 'link' => link to inherited variable's documentation, 4903 * 'function_call' => {@link parserMethod::getIntricateFunctionCall()} 4904 * returned array, 4905 * 'sdesc' => summary of inherited variable), 4906 * ...), 4907 * ...) 4908 * </pre> 4909 */
4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 => 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988
function getFormattedInheritedMethods($child) { $package = $child-> docblock-> package; $subpackage = $child-> docblock-> subpackage; $imethods = $child-> getInheritedMethods($this); $results = array(); if (!count($imethods)) return $results; foreach($imethods as $parent => $methods) { $file = $methods['file']; $methods = $methods['methods']; $par = $this-> classes-> getClass($parent,$file); if ($par) { $package = $par-> docblock-> package; } usort($methods,array($this,"sortMethod" )); $result['parent_class'] = $this-> getClassLink($parent,$package); if (!$result['parent_class']) { $result['parent_class'] = $parent . ' (Internal Class)'; } foreach($methods as $method) { $info = array(); if ($method-> docblock-> hasaccess) { $info['access'] = $method-> docblock-> tags['access'][0]-> value; } else { $info['access'] = 'public'; } $info['abstract'] = isset ($method-> docblock-> tags['abstract'][0]); if ($method-> isConstructor) $info['constructor'] = 1; $returntype = 'void'; if ($method-> isConstructor) { $returntype = $method-> getClass(); } if ($method-> docblock-> return) { $a = $method-> docblock-> return-> Convert($this); $returntype = $method-> docblock-> return-> converted_returnType; } $info['function_return'] = $returntype; $info['static'] = isset ($method-> docblock-> tags['static'][0]); $info['link'] = $method-> getLink($this); if (!$info['link']) { $info['link'] = $method-> getFunctionCall(); } $info['name'] = $method-> getName(); if ($method-> docblock) $info['sdesc'] = $method-> docblock-> getSDesc($this); $params = array(); if (count($method-> docblock-> params)) foreach($method-> docblock-> params as $param => $val) { $a = $val-> Convert($this); $params[$param] = array("var" => $param,"datatype" converted_returnType,"data" => $a); } $info['function_call'] = $method-> getIntricateFunctionCall($this,$params); $result["imethods" ][] = $info; } $results[] = $result; $result = array(); } return $results; } /** * Return template-enabled list of inherited class constants * * uses parserConst helper function getInheritedConsts and generates a * template-enabled list using getClassLink() * @param parserConst $child class constant * @see getClassLink(), parserMethod::getInheritedConsts() * @return array Format: * <pre> * array( * array('parent_class' => link to parent class's documentation, * 'ivars' =>
$val->
4989 * array( 4990 * array('name' => inherited constant name, 4991 * 'link' => link to inherited constant's documentation, 4992 * 'value' => constant value, 4993 * 'sdesc' => summary of inherited constant), 4994 * ...), 4995 * ...) 4996 * </pre> 4997 */ 4998 4999 function getFormattedInheritedConsts($child) 5000 { 5001 $package = $child-> docblock-> package; 5002 $subpackage = $child-> docblock-> subpackage; 5003 $ivars = $child-> getInheritedConsts($this); 5004 $results = array(); 5005 if (!count($ivars)) return $results; 5006 foreach($ivars as $parent => $vars) 5007 { 5008 $file = $vars['file']; 5009 $vars = $vars['consts']; 5010 $par = $this-> classes-> getClass($parent,$file); 5011 if ($par) { 5012 $package = $par-> docblock-> package; 5013 } 5014 usort($vars,array($this,"sortVar" )); 5015 $result['parent_class'] = $this-> getClassLink($parent,$package); 5016 if (!$result['parent_class']) { 5017 $result['parent_class'] = $parent . ' (Internal Class)'; 5018 } 5019 foreach($vars as $var) 5020 { 5021 $info = array(); 5022 5023 if ($var-> docblock-> hasaccess) { 5024 $info['access'] = $var-> docblock-> tags['access'][0]-> value; 5025 } else { 5026 $info['access'] = 'public'; 5027 } 5028 $info['name'] = $var-> getName(); 5029 $info['link'] = $var-> getLink($this); 5030 if (!$info['link']) { 5031 $info['link'] = $info['name'] . ' = ' . $var-> getValue(); 5032 } 5033 $info['value'] = $this-> postProcess($var-> getValue()); 5034 if ($var-> docblock) 5035 $info['sdesc'] = $var-> docblock-> getSDesc($this); 5036 $result["iconsts" ][] = $info; 5037 } 5038 $results[] = $result; 5039 $result = array(); 5040 } 5041 return $results; 5042 } 5043 5044 /** 5045 * Return a Smarty template object to operate with 5046 * 5047 * This returns a Smarty template with pre-initialized variables for use. 5048 * If the method "SmartyInit()" exists, it is called. 5049 * @return Smarty 5050 */ 5051 function & newSmarty() 5052 { 5053 $templ = new Smarty; 5054 $templ-> use_sub_dirs = false; 5055 $templ-> template_dir = realpath($this-> smarty_dir . PATH_DELIMITER . 'templates'); 5056 $templatename = get_class($this) . $this-> templateName; 5057 if (!file_exists($this-> targetDir . DIRECTORY_SEPARATOR . md5($templatename))) { 5058 // we'll delete this on finishing conversion 5059 $this-> _compiledDir[$this-> targetDir . DIRECTORY_SEPARATOR . md5($templatename)] = 1; 5060 mkdir($this-> targetDir . DIRECTORY_SEPARATOR . md5($templatename),0775); 5061 } 5062 $templ-> compile_dir = realpath($this-> targetDir . PATH_DELIMITER . md5($templatename)); 5063 $templ-> config_dir = realpath($this-> smarty_dir . PATH_DELIMITER . 'configs'); 5064 $templ-> assign("date" ,date("r" ,time())); 5065 $templ-> assign("maintitle" ,$this-> title); 5066 $templ-> assign("package" ,$this-> package);
5067 $templ-> assign("phpdocversion" ,PHPDOCUMENTOR_VER); 5068 $templ-> assign("phpdocwebsite" ,PHPDOCUMENTOR_WEBSITE); 5069 $templ-> assign("subpackage" ,$this-> subpackage); 5070 if (method_exists($this,'SmartyInit')) return $this-> SmartyInit($templ); 5071 return $templ; 5072 } 5073 5074 /** 5075 * Finish up parsing/cleanup directories 5076 */ 5077 function cleanup() 5078 { 5079 foreach ($this-> _compiledDir as $dir => $one) { 5080 $this-> _rmdir($dir); 5081 } 5082 } 5083 5084 /** 5085 * Completely remove a directory and its contents 5086 * 5087 * @param string $directory 5088 */ 5089 function _rmdir($directory) 5090 { 5091 $handle = @opendir($directory); 5092 if ($handle) { 5093 while (false !== ($file = readdir($handle))) { 5094 if ($file == '.' || $file == '..') { 5095 continue; 5096 } 5097 if (is_dir($directory . DIRECTORY_SEPARATOR . $file)) { 5098 $this-> _rmdir($directory . DIRECTORY_SEPARATOR . $file); 5099 } 5100 @unlink($directory . DIRECTORY_SEPARATOR . $file); 5101 } 5102 closedir($handle); 5103 @rmdir($directory); 5104 } 5105 } 5106 5107 /** 5108 * do all necessary output 5109 * @see Converter 5110 * @abstract 5111 */ 5112 function Output($title) 5113 { 5114 phpDocumentor_out("WARNING: Generic Converter::Output was used, no output will be generated" ); 5115 } 5116 5117 /** 5118 * Set the template directory with a different template base directory 5119 * @tutorial phpDocumentor.howto.pkg#using.command-line.templatebase 5120 * @param string template base directory 5121 * @param string template name 5122 */ 5123 function setTemplateBase($base, $dir) 5124 { 5125 // remove trailing /'s from the base path, if any 5126 $base = str_replace('\\','/',$base); 5127 while ($base{strlen($base) - 1} == '/') $base = substr($base,0,strlen($base) - 1); 5128 $this-> templateName = substr($dir,0,strlen($dir) - 1); 5129 $this-> templateDir = $base . "/Converters/" . $this-> outputformat . "/" . $this-> name . "/templates/" . $dir; 5130 if (!is_dir($this-> templateDir)) 5131 { 5132 addErrorDie(PDERROR_TEMPLATEDIR_DOESNT_EXIST, $this-> templateDir); 5133 } 5134 5135 $this-> smarty_dir = $this-> templateDir; 5136 if (file_exists($this-> templateDir . PATH_DELIMITER . 'options.ini')) 5137 { 5138 // retrieve template options, allow array creation 5139 $this-> template_options = phpDocumentor_parse_ini_file($this-> templateDir . PATH_DELIMITER . 'options.ini',true); 5140 } 5141 } 5142 5143 /**
5144 * sets the template directory based on the {@link $outputformat} and {@link $name} 5145 * Also sets {@link $templateName} to the $dir parameter 5146 * @param string subdirectory 5147 */ 5148 function setTemplateDir($dir) 5149 { 5150 if ('@DATA-DIR@' != '@'.'DATA-DIR@') { 5151 $templateBase = str_replace('\\', '/', '@DATA-DIR@/PhpDocumentor/phpDocumentor'); 5152 } else { 5153 $templateBase = str_replace('\\','/',$GLOBALS['_phpDocumentor_install_dir']) . '/phpDocumentor'; 5154 } 5155 $this-> setTemplateBase($templateBase, $dir); 5156 } 5157 5158 /** 5159 * Get the absolute path to the converter's base directory 5160 * @return string 5161 */ 5162 function getConverterDir() 5163 { 5164 if ('@DATA-DIR@' != '@' . 'DATA-DIR@') { 5165 return str_replace('\\', '/', "@DATADIR@/PhpDocumentor/phpDocumentor/Converters/" ) . $this-> outputformat . "/" . $this> name; 5166 } else { 5167 return str_replace('\\','/',$GLOBALS['_phpDocumentor_install_dir']) ."/phpDocumentor/Converters/" . $this-> outputformat . "/" . $this-> name; 5168 } 5169 } 5170 5171 /** 5172 * Parse a global variable's default value for class initialization. 5173 * 5174 * If a global variable's default value is "new class" as in: 5175 * <code> 5176 * $globalvar = new Parser 5177 * </code> 5178 * This method will document it not as "new Parser" but instead as 5179 * "new {@link Parser}". For examples, see {@link phpdoc.inc}. 5180 * Many global variables are classes, and phpDocumentor links to their 5181 * documentation 5182 * @return string default global variable value with link to class if 5183 * it's "new Class" 5184 * @param string default value of a global variable. 5185 */ 5186 function getGlobalValue($value) 5187 { 5188 if (strpos($value,'new') === 0) 5189 { 5190 preg_match('/new([^(]*)((?:.|\r|\n)*)/',$value,$newval); 5191 if (isset($newval[1])) 5192 { 5193 $a = Converter::getLink(trim($newval[1])); 5194 if (!isset($newval[2])) $newval[2] = ''; 5195 if ($a && phpDocumentor_get_class($a) == 'classlink') $value = 'new '.$this-> returnSee($a) . 5196 $this-> postProcess($newval[2]); 5197 } 5198 return $value; 5199 } 5200 return $this-> postProcess($value); 5201 } 5202 5203 /** 5204 * Parse an include's file to see if it is a file documented in this project 5205 * 5206 * Although not very smart yet, this method will try to look for the 5207 * included file file.ext: 5208 * 5209 * <code> 5210 * include ("file.ext"); 5211 * </code> 5212 * 5213 * If it finds it, it will return a link to the file's documentation. As of 5214 * 1.2.0rc1, phpDocumentor is smarty enough to find these cases: 5215 * <ul> 5216 * <li>absolute path to file</li> 5217 * <li>./file.ext or ../file.ext</li> 5218 * <li>relpath/to/file.ext if relpath is a subdirectory of the base parse
5219 * directory</li> 5220 * </ul> 5221 * For examples, see {@link Setup.inc.php} includes. 5222 * Every include auto-links to the documentation for the file that is included 5223 * @return string included file with link to docs for file, if found 5224 * @param string file included by include statement. 5225 * @param string path of file that has the include statement 5226 */ 5227 function getIncludeValue($value, $ipath) 5228 { 5229 preg_match('/"([^"\']*\.[^"\']*)"/' ,$value,$match); 5230 if (!isset($match[1])) 5231 preg_match('/\'([^"\']*\.[^"\']*)\'/' ,$value,$match); 5232 if (isset($match[1])) 5233 { 5234 $fancy_per = $this-> proceduralpages-> pathMatchesParsedFile($match[1],$ipath); 5235 if ($fancy_per) 5236 { 5237 $link = $this-> addLink($fancy_per); 5238 if (is_object($link) && phpDocumentor_get_class($link) == 'pagelink' && 5239 isset($this-> all_packages[$link-> package])) 5240 { 5241 $value = $this-> returnSee($link,$value); 5242 } 5243 } else 5244 { 5245 $per = Converter::getLink($match[1]); 5246 if (is_object($per) && phpDocumentor_get_class($per) == 'pagelink') 5247 $value = $this-> returnSee($per); 5248 } 5249 } 5250 return $value; 5251 } 5252 5253 /** 5254 * Recursively creates all subdirectories that don't exist in the $dir path 5255 * @param string $dir 5256 */ 5257 function createParentDir($dir) 5258 { 5259 if (empty($dir)) return; 5260 $tmp = explode(SMART_PATH_DELIMITER,$dir); 5261 array_pop($tmp); 5262 $parent = implode(SMART_PATH_DELIMITER,$tmp); 5263 if ($parent != '' && ! file_exists($parent)) 5264 { 5265 $test = @mkdir($parent,0775); 5266 if (!$test) 5267 { 5268 $this-> createParentDir($parent); 5269 $test = @mkdir($parent,0775); 5270 phpDocumentor_out(" Creating Parent Directory $parent\n" ); 5271 } else 5272 { 5273 phpDocumentor_out(" Creating Parent Directory $parent\n" ); 5274 } 5275 } 5276 } 5277 5278 /** 5279 * Sets the output directory for generated documentation 5280 * 5281 * As of 1.3.0RC6, this also sets the compiled templates directory inside 5282 * the target directory 5283 * @param string $dir the output directory 5284 */ 5285 function setTargetDir($dir) 5286 { 5287 if (strlen($dir) > 0) 5288 { 5289 $this-> targetDir = $dir; 5290 // if directory does exist create it, this should have more error checking in the future 5291 if (!file_exists($dir)) 5292 { 5293 $tmp = str_replace(array("/" ,"\\" ),SMART_PATH_DELIMITER,$dir); 5294 if (substr($tmp,-1) == SMART_PATH_DELIMITER) 5295 {
5296 $tmp = substr($tmp,0,(strlen($tmp)-1)); 5297 } 5298 $this-> createParentDir($tmp); 5299 phpDocumentor_out(" Creating Directory $dir\n" ); 5300 mkdir($dir,0775); 5301 } elseif (!is_dir($dir)) 5302 { 5303 echo " Output path: '$dir' is not a directory\n" ; 5304 die(); 5305 } 5306 } else { 5307 echo "a target directory must be specified\n try phpdoc -h\n" ; 5308 die(); 5309 } 5310 } 5311 5312 /** 5313 * Writes a file to target dir 5314 * @param string 5315 * @param string 5316 * @param boolean true if the data is binary and not text 5317 */ 5318 function writeFile($file,$data,$binary = false) 5319 { 5320 if (!file_exists($this-> targetDir)) 5321 { 5322 mkdir($this-> targetDir,0775); 5323 } 5324 $string = ''; 5325 if ($binary) $string = 'binary file '; 5326 phpDocumentor_out(" Writing $string" .$this-> targetDir . PATH_DELIMITER . $file . "\n" ); 5327 flush(); 5328 $write = 'w'; 5329 if ($binary) $write = 'wb'; 5330 $fp = fopen($this-> targetDir . PATH_DELIMITER . $file,$write); 5331 set_file_buffer( $fp, 0 ); 5332 fwrite($fp,$data,strlen($data)); 5333 fclose($fp); 5334 } 5335 5336 /** 5337 * Copies a file from the template directory to the target directory 5338 * thanks to Robert Hoffmann for this fix 5339 * @param string 5340 */ 5341 function copyFile($file, $subdir = '') 5342 { 5343 if (!file_exists($this-> targetDir)) 5344 { 5345 mkdir($this-> targetDir,0775); 5346 } 5347 copy($this-> templateDir . $subdir . PATH_DELIMITER . $file, $this-> targetDir . PATH_DELIMITER . $file); 5348 } 5349 5350 /** 5351 * Return parserStringWithInlineTags::Convert() cache state 5352 * @see parserStringWithInlineTags::Convert() 5353 * @abstract 5354 */ 5355 function getState() 5356 { 5357 return true; 5358 } 5359 5360 /** 5361 * Compare parserStringWithInlineTags::Convert() cache state to $state 5362 * @param mixed 5363 * @see parserStringWithInlineTags::Convert() 5364 * @abstract 5365 */ 5366 function checkState($state) 5367 { 5368 return true; 5369 } 5370 5371 } 5372 5373 /**
5374 * @access private 5375 * @see Converter::getSortedClassTreeFromClass() 5376 */ 5377 function rootcmp($a, $b) 5378 { 5379 return strnatcasecmp($a['class'],$b['class']); 5380 } 5381 5382 /** 5383 * @access private 5384 * @global string used to make the first tutorials converted the default package tutorials 5385 */ 5386 function tutorialcmp($a, $b) 5387 { 5388 global $phpDocumentor_DefaultPackageName; 5389 if ($a == $phpDocumentor_DefaultPackageName) return -1; 5390 if ($b == $phpDocumentor_DefaultPackageName) return 1; 5391 return strnatcasecmp($a, $b); 5392 } 5393 5394 /** 5395 * smart htmlentities, doesn't entity the allowed tags list 5396 * Since version 1.1, this function uses htmlspecialchars instead of 5397 * htmlentities, for international support 5398 * This function has been replaced by functionality in {@link ParserDescCleanup.inc} 5399 * @param string $s 5400 * @return string browser-displayable page 5401 * @deprecated As of v1.2, No longer needed, as valid tags are parsed out of the source, 5402 * and everything else is {@link Converter::postProcess()} handled 5403 */ 5404 function adv_htmlentities($s) 5405 { 5406 return; 5407 global $phpDocumentor___html,$_phpDocumentor_html_allowed; 5408 $result = htmlspecialchars($s); 5409 $entities = array_flip(get_html_translation_table(HTML_SPECIALCHARS)); 5410 $result = strtr($result,$phpDocumentor___html); 5411 $matches = array(); 5412 preg_match_all('/(<img.*>)/U' ,$result,$matches); 5413 for($i=0;$i< count($matches[1]);$i++) 5414 { 5415 $result = str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(get_html_translation_table(HTML_SPECIALCH ARS))),$result); 5416 } 5417 preg_match_all('/(<font.*>)/U' ,$result,$matches); 5418 for($i=0;$i< count($matches[1]);$i++) 5419 { 5420 $result = str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(get_html_translation_table(HTML_SPECIALCH ARS))),$result); 5421 } 5422 preg_match_all('/(<ol.*>)/U' ,$result,$matches); 5423 for($i=0;$i< count($matches[1]);$i++) 5424 { 5425 $result = str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(get_html_translation_table(HTML_SPECIALCH ARS))),$result); 5426 } 5427 preg_match_all('/(<ul.*>)/U' ,$result,$matches); 5428 for($i=0;$i< count($matches[1]);$i++) 5429 { 5430 $result = str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(get_html_translation_table(HTML_SPECIALCH ARS))),$result); 5431 } 5432 preg_match_all('/(<li.*>)/U' ,$result,$matches); 5433 for($i=0;$i< count($matches[1]);$i++) 5434 { 5435 $result = str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(get_html_translation_table(HTML_SPECIALCH ARS))),$result); 5436 } 5437 preg_match_all('/(<a .*>)/U' ,$result,$matches); 5438 for($i=0;$i< count($matches[1]);$i++) 5439 { 5440 $result = str_replace($matches[1][$i],strtr($matches[1][$i],array_flip(get_html_translation_table(HTML_SPECIALCH ARS))),$result); 5441 }
5442 return $result; 5443 } 5444 5445 /** 5446 * Used solely for setting up the @uses list 5447 * @package ignore 5448 * @ignore 5449 */ 5450 class __dummyConverter extends Converter 5451 { 5452 function setTemplateDir(){} 5453 function setTargetDir(){} 5454 function getPageName(& $element) 5455 { 5456 if (phpDocumentor_get_class($element) == 'parserpage') return '_'.$element> getName(); 5457 return '_'.$element-> parent-> getName(); 5458 } 5459 } 5460 ?>
67 var $name = 'default'; 68 /** 69 * indexes of elements by package that need to be generated 70 * @var array 71 */ 72 var $leftindex = array('classes' => true, 'pages' => true, 'functions' => true, 'defines' => false, 'globals' => false); 73 74 /** 75 * output directory for the current procedural page being processed 76 * @var string 77 */ 78 var $page_dir; 79 80 /** 81 * target directory passed on the command-line. 82 * {@link $targetDir} is malleable, always adding package/ and package/subpackage/ subdirectories onto it. 83 * @var string 84 */ 85 var $base_dir; 86 87 /** 88 * output directory for the current class being processed 89 * @var string 90 */ 91 var $class_dir; 92 93 /** 94 * array of converted package page names. 95 * Used to link to the package page in the left index 96 * @var array Format: array(package => 1) 97 */ 98 var $package_pages = array(); 99 100 /** 101 * controls formatting of parser informative output 102 * 103 * Converter prints: 104 * "Converting /path/to/file.php... Procedural Page Elements... Classes..." 105 * Since CHMdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there 106 * is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that 107 * and is purely cosmetic 108 * @var boolean 109 */ 110 var $juststarted = false; 111 112 /** 113 * contains all of the template procedural page element loop data needed for the current template 114 * @var array 115 */ 116 var $current; 117 118 /** 119 * contains all of the template class element loop data needed for the current template 120 * @var array 121 */ 122 var $currentclass; 123 var $wrote = false; 124 var $ric_set = array(); 125 /** 126 * Table of Contents entry for index.hhk 127 * @var array 128 */ 129 var $KLinks = array(); 130 131 /** 132 * sets {@link $base_dir} to $targetDir 133 * @see Converter() 134 */ 135 function CHMdefaultConverter(& $allp, & $packp, & $classes, & $procpages, $po, $pp, $qm, $targetDir, $templateDir, $title) 136 { 137 Converter::Converter($allp, $packp, $classes, $procpages,$po, $pp, $qm, $targetDir, $templateDir, $title); 138 $this-> base_dir = $targetDir; 139 }
140 141 /** 142 * @deprecated in favor of PHP 4.3.0+ tokenizer-based source highlighting 143 */ 144 function unmangle($sourcecode) 145 { 146 $sourcecode = str_replace('<code>' ,'<pre>' ,$sourcecode); 147 $sourcecode = str_replace('</code>' ,'</pre>' ,$sourcecode); 148 $sourcecode = str_replace('<br />' ,"\n" ,$sourcecode); 149 $sourcecode = str_replace(' ' ,' ',$sourcecode); 150 $sourcecode = str_replace('<' ,'<' ,$sourcecode); 151 $sourcecode = str_replace('>' ,'>' ,$sourcecode); 152 $sourcecode = str_replace('&' ,'&' ,$sourcecode); 153 return $sourcecode; 154 } 155 156 /** 157 * @param string full path to the source file 158 * @param string fully highlighted source code 159 */ 160 function writeSource($path, $value) 161 { 162 $templ = & $this-> newSmarty(); 163 $pathinfo = $this-> proceduralpages-> getPathInfo($path, $this); 164 $templ-> assign('source',$value); 165 $templ-> assign('package',$pathinfo['package']); 166 $templ-> assign('subpackage',$pathinfo['subpackage']); 167 $templ-> assign('name',$pathinfo['name']); 168 $templ-> assign('source_loc',$pathinfo['source_loc']); 169 $templ-> assign('docs',$pathinfo['docs']); 170 $templ-> assign("subdir" ,'../'); 171 $templ-> register_outputfilter('CHMdefault_outputfilter'); 172 $this-> setTargetDir($this-> getFileSourcePath($this-> base_dir)); 173 $this-> addSourceTOC($pathinfo['name'],$this> getFileSourceName($path),$pathinfo['package'],$pathinfo['subpackage'], true); 174 phpDocumentor_out("\n" ); 175 $this-> setSourcePaths($path); 176 $this-> writefile($this-> getFileSourceName($path).'.html',$templ> fetch('filesource.tpl')); 177 } 178 179 function writeExample($title, $path, $source) 180 { 181 $templ = & $this-> newSmarty(); 182 $templ-> assign('source',$source); 183 if (empty($title)) 184 { 185 $title = 'example'; 186 addWarning(PDERROR_EMPTY_EXAMPLE_TITLE, $path, $title); 187 } 188 $templ-> assign('title',$title); 189 $templ-> assign('file',$path); 190 $templ-> assign("subdir" ,'../'); 191 $templ-> register_outputfilter('CHMdefault_outputfilter'); 192 $pathinfo = $this-> proceduralpages-> getPathInfo($path, $this); 193 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . '__examplesource'); 194 $this> addSourceTOC($title,'exsource_'.$path,$pathinfo['package'],$pathinfo['subpackage'], false); 195 phpDocumentor_out("\n" ); 196 $this-> writefile('exsource_'.$path.'.html',$templ-> fetch('examplesource.tpl')); 197 } 198 199 function getExampleLink($path, $title) 200 { 201 return $this-> returnLink('{$subdir}__examplesource' . PATH_DELIMITER . 'exsource_'.$path.'.html',$title); 202 } 203 204 function getSourceLink($path) 205 { 206 return $this-> returnLink('{$subdir}__filesource/' . 207 $this-> getFileSourceName($path).'.html','Source Code for this file'); 208 } 209 210 /** 211 * Retrieve a Converter-specific anchor to a segment of a source code file 212 * parsed via a {@tutorial tags.filesource.pkg} tag. 213 * @param string full path to source file 214 * @param string name of anchor 215 * @param string link text, if this is a link
216 * @param boolean returns either a link or a destination based on this 217 * parameter 218 * @return string link to an anchor, or the anchor 219 */ 220 function getSourceAnchor($sourcefile,$anchor,$text = '',$link = false) 221 { 222 if ($link) { 223 return $this-> returnLink('{$subdir}__filesource/' . 224 $this-> getFileSourceName($sourcefile) . '.html#a' . $anchor, $text); 225 } else { 226 return '<a name="a' .$anchor.'"></a>' ; 227 } 228 } 229 230 231 /** 232 * Return a line of highlighted source code with formatted line number 233 * 234 * If the $path is a full path, then an anchor to the line number will be 235 * added as well 236 * @param integer line number 237 * @param string highlighted source code line 238 * @param false|stringfull path to @filesource file this line is a part of, 239 * if this is a single line from a complete file. 240 * @return string formatted source code line with line number 241 */ 242 function sourceLine($linenumber, $line, $path = false) 243 { 244 $extra = ''; 245 if (strlen(str_replace("\n" , '', $line)) == 0) { 246 $extra = ' ' ; 247 } 248 if ($path) 249 { 250 return '<li><div class="src-line">' . $this> getSourceAnchor($path, $linenumber) . 251 str_replace("\n" ,'',$line) . $extra . 252 "</div></li>\n" ; 253 } else 254 { 255 return '<li><div class="src-line">' . str_replace("\n" ,'',$line) . 256 " $extra</div></li>\n " ; 257 } 258 } 259 260 /** 261 * Used to convert the <<code>> tag in a docblock 262 * @param string 263 * @param boolean 264 * @return string 265 */ 266 function ProgramExample($example, $tutorial = false, $inlinesourceparse = null/*false*/, 267 $class = null/*false*/, $linenum = null/*false*/, $filesourcepath = null/*false*/) 268 { 269 return $this-> PreserveWhiteSpace(parent::ProgramExample($example, $tutorial, $inlinesourceparse, $class, $linenum, $filesourcepath)); 270 } 271 272 /** 273 * @param string 274 */ 275 function TutorialExample($example) 276 { 277 $trans = $this-> template_options['desctranslate']; 278 $this-> template_options['desctranslate'] = array(); 279 $example = '<ol>' . parent::TutorialExample($example) 280 .'</ol>' ; 281 $this-> template_options['desctranslate'] = $trans; 282 if (!isset($this-> template_options['desctranslate'])) return $example; 283 if (!isset($this-> template_options['desctranslate']['code'])) return $example; 284 $example = $this-> template_options['desctranslate']['code'] . $example; 285 if (!isset($this-> template_options['desctranslate']['/code'])) return $example; 286 return $example . $this-> template_options['desctranslate']['/code']; 287 } 288 289 function getCurrentPageLink() 290 { 291 return $this-> curname . '.html';
292 } 293 294 /** 295 * Uses htmlspecialchars() on the input 296 */ 297 function postProcess($text) 298 { 299 if ($this-> highlightingSource) { 300 return str_replace(array(' ',"\t" ), array(' ' , ' ' ), 301 htmlspecialchars($text)); 302 } 303 return htmlspecialchars($text); 304 } 305 306 /** 307 * Use the template tutorial_toc.tpl to generate a table of contents for HTML 308 * @return string table of contents formatted for use in the current output format 309 * @param array format: array(array('tagname' => section, 'link' => returnsee link, 'id' => anchor name, 'title' => from title tag),...) 310 */ 311 function formatTutorialTOC($toc) 312 { 313 $template = & $this-> newSmarty(); 314 $template-> assign('toc',$toc); 315 return $template-> fetch('tutorial_toc.tpl'); 316 } 317 318 function & SmartyInit(& $templ) 319 { 320 if (!isset($this-> package_index)) 321 foreach($this-> all_packages as $key => $val) 322 { 323 if (isset($this-> pkg_elements[$key])) 324 { 325 if (!isset($start)) $start = $key; 326 $this-> package_index[] = array('link' => " li_$key.html" , 'title' => $key); 327 } 328 } 329 $templ-> assign("packageindex" ,$this-> package_index); 330 $templ-> assign("subdir" ,''); 331 return $templ; 332 } 333 334 335 /** 336 * Writes out the template file of {@link $class_data} and unsets the template to save memory 337 * @see registerCurrentClass() 338 * @see parent::endClass() 339 */ 340 function endClass() 341 { 342 $a = '../'; 343 if (!empty($this-> subpackage)) $a .= '../'; 344 if ($this-> juststarted) 345 { 346 $this-> juststarted = false; 347 phpDocumentor_out("\n" ); 348 flush(); 349 } 350 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> class_dir); 351 $this-> class_data-> assign("subdir" ,$a); 352 $this-> class_data-> register_outputfilter('CHMdefault_outputfilter'); 353 $this-> addTOC($this-> class,$this-> class,$this-> package,$this> subpackage, true); 354 $this-> writefile($this-> class . '.html',$this-> class_data> fetch('class.tpl')); 355 unset($this-> class_data); 356 } 357 358 /** 359 * Writes out the template file of {@link $page_data} and unsets the template to save memory 360 * @see registerCurrent() 361 * @see parent::endPage() 362 */ 363 function endPage() 364 { 365 $this-> package = $this-> curpage-> package;
366 $this-> subpackage = $this-> curpage-> subpackage; 367 $a = '../'; 368 if (!empty($this-> subpackage)) $a .= '../'; 369 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> page_dir); 370 $this-> page_data-> assign("package" ,$this-> package); 371 $this-> page_data-> assign("subdir" ,$a); 372 $this-> page_data-> register_outputfilter('CHMdefault_outputfilter'); 373 $this-> addTOC($this-> curpage-> file,$this-> page,$this-> package,$this> subpackage); 374 $this-> writefile($this-> page . '.html',$this-> page_data-> fetch('page.tpl')); 375 unset($this-> page_data); 376 } 377 378 /** 379 * @param string 380 * @param string 381 * @return string <a href="'.$link.'">'.$text.'</a> 382 */ 383 function returnLink($link,$text) 384 { 385 return '<a href="' .$link.'">' .$text.'</a>' ; 386 } 387 388 /** 389 * CHMdefaultConverter chooses to format both package indexes and the complete index here 390 * 391 * This function formats output for the elementindex.html and pkgelementindex.html template files. It then 392 * writes them to the target directory 393 * @see generateElementIndex(), generatePkgElementIndex() 394 */ 395 function formatPkgIndex() 396 { 397 list($package_indexes,$packages,$mletters) = $this-> generatePkgElementIndexes(); 398 for($i=0;$i< count($package_indexes);$i++) 399 { 400 $template = & $this-> newSmarty(); 401 $this-> package = $package_indexes[$i]['package']; 402 $this-> subpackage = ''; 403 $template-> assign("index" ,$package_indexes[$i]['pindex']); 404 $template-> assign("package" ,$package_indexes[$i]['package']); 405 $template> assign("letters" ,$mletters[$package_indexes[$i]['package']]); 406 $template-> assign("title" ,"Package " .$package_indexes[$i]['package']." Element Index" ); 407 $template-> assign("subdir" ,'../'); 408 $template-> register_outputfilter('CHMdefault_outputfilter'); 409 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $package_indexes[$i]['package']); 410 $this-> addTOC($package_indexes[$i]['package']." Alphabetical Index" ,'elementindex_'.$package_indexes[$i]['package'],$package_indexes[$i]['package'],''); 411 $this> writefile('elementindex_'.$package_indexes[$i]['package'].'.html',$template> fetch('pkgelementindex.tpl')); 412 } 413 phpDocumentor_out("\n" ); 414 flush(); 415 } 416 417 /** 418 * CHMdefaultConverter uses this function to format template index.html and packages.html 419 * 420 * This function generates the package list from {@link $all_packages}, eliminating any 421 * packages that don't have any entries in their package index (no files at all, due to @ignore 422 * or other factors). Then it uses the default package name as the first package index to display. 423 * It sets the right pane to be either a blank file with instructions on making packagelevel docs, 424 * or the package-level docs for the default package. 425 * @global string Used to set the starting package to display 426 */ 427 function formatIndex() 428 { 429 global $phpDocumentor_DefaultPackageName; 430 list($elindex,$mletters) = $this-> generateElementIndex(); 431 $template = & $this-> newSmarty(); 432 $template-> assign("index" ,$elindex); 433 $template-> assign("letters" ,$mletters); 434 $template-> assign("title" ,"Element Index" );
435 $template-> assign("date" ,date("r" ,time())); 436 $template-> register_outputfilter('CHMdefault_outputfilter'); 437 phpDocumentor_out("\n" ); 438 flush(); 439 $this-> setTargetDir($this-> base_dir); 440 $this-> addTOC("Alphabetical Index Of All Elements" ,'elementindex',"Index" ,''); 441 $this-> writefile('elementindex.html',$template-> fetch('elementindex.tpl')); 442 usort($this-> package_index,"CHMdefault_pindexcmp" ); 443 $index = & $this-> newSmarty(); 444 foreach($this-> all_packages as $key => $val) 445 { 446 if (isset($this-> pkg_elements[$key])) 447 { 448 if (!isset($start)) $start = $key; 449 if (!isset($this-> package_pages[$key])) $this-> writeNewPPage($key); 450 } 451 } 452 $this-> setTargetDir($this-> base_dir); 453 // Created index.html 454 if (isset($this-> pkg_elements[$phpDocumentor_DefaultPackageName])) $start = $phpDocumentor_DefaultPackageName; 455 $this-> package = $start; 456 $this-> subpackage = ''; 457 $setalready = false; 458 if (isset($this-> tutorials[$start]['']['pkg'])) 459 { 460 foreach($this-> tutorials[$start]['']['pkg'] as $tute) 461 { 462 if ($tute-> name == $start . '.pkg') 463 { 464 $setalready = true; 465 $this-> addTOC("Start page" ,$start.'/tutorial_'.$tute> name,"Index" ,''); 466 } 467 } 468 } 469 if (!$setalready) 470 { 471 if (isset($this-> package_pages[$start])) 472 { 473 $this-> addTOC("Start page" ,'package_'.$start,"Index" ,''); 474 } 475 else 476 { 477 $index-> assign("blank" ,"blank" ); 478 $blank = & $this-> newSmarty(); 479 $blank-> assign('package',$phpDocumentor_DefaultPackageName); 480 $this-> addTOC("Start page" ,'blank',"Index" ,''); 481 $this-> writefile("blank.html" ,$blank-> fetch('blank.tpl')); 482 Converter::writefile('index.html',$blank-> fetch('tutorial.tpl')); 483 } 484 } 485 phpDocumentor_out("\n" ); 486 flush(); 487 488 unset($index); 489 } 490 491 function writeNewPPage($key) 492 { 493 return; 494 $template = & $this-> newSmarty(); 495 $this-> package = $key; 496 $this-> subpackage = ''; 497 $template-> assign("date" ,date("r" ,time())); 498 $template-> assign("title" ,$this-> title); 499 $template-> assign("package" ,$key); 500 $template-> register_outputfilter('CHMdefault_outputfilter'); 501 phpDocumentor_out("\n" ); 502 flush(); 503 $this-> setTargetDir($this-> base_dir); 504 505 $this-> addTOC(" $key Index" ," li_$key" ,$key,''); 506 $this-> writefile(" li_$key.html" ,$template-> fetch('index.tpl')); 507 unset($template); 508 } 509 510 /**
511 * Generate indexes for li_package.html and classtree output files 512 * 513 * This function generates the li_package.html files from the template file left.html. It does this by 514 * iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve 515 * the pre-sorted {@link abstractLink} descendants needed for index generation. Conversion of these links to 516 * text is done by {@link returnSee()}. The {@link $local} parameter is set to false to ensure that paths are correct. 517 * 518 * Then it uses {@link generateFormattedClassTrees()} to create class trees from the template file classtrees.html. Output 519 * filename is classtrees_packagename.html. This function also unsets {@link $elements} and {@link $pkg_elements} to free 520 * up the considerable memory these two class vars use 521 * @see $page_elements, $class_elements, $function_elements 522 */ 523 function formatLeftIndex() 524 { 525 phpDocumentor_out("\n" ); 526 flush(); 527 $this-> setTargetDir($this-> base_dir); 528 if (0)//!isset($this->left)) 529 { 530 debug("Nothing parsed, check the command-line" ); 531 die(); 532 } 533 foreach($this-> all_packages as $package => $rest) 534 { 535 if (!isset($this-> pkg_elements[$package])) continue; 536 537 // Create class tree page 538 $template = & $this-> newSmarty(); 539 $template-> assign("classtrees" ,$this> generateFormattedClassTrees($package)); 540 $template-> assign("package" ,$package); 541 $template-> assign("date" ,date("r" ,time())); 542 $template-> register_outputfilter('CHMdefault_outputfilter'); 543 $this-> addTOC(" $package Class Trees" ," classtrees_$package" ,$package,''); 544 $this-> writefile(" classtrees_$package.html" ,$template> fetch('classtrees.tpl')); 545 phpDocumentor_out("\n" ); 546 flush(); 547 } 548 // free up considerable memory 549 unset($this-> elements); 550 unset($this-> pkg_elements); 551 } 552 553 /** 554 * This function takes an {@link abstractLink} descendant and returns an html link 555 * 556 * @param abstractLink a descendant of abstractlink should be passed, and never text 557 * @param string text to display in the link 558 * @param boolean this parameter is not used, and is deprecated 559 * @param boolean determines whether the returned text is enclosed in an <a> tag 560 */ 561 function returnSee(& $element, $eltext = false, $with_a = true) 562 { 563 if (!$element) return false; 564 if (!$with_a) return $this-> getId($element, false); 565 if (!$eltext) 566 { 567 $eltext = ''; 568 switch($element-> type) 569 { 570 case 'tutorial' : 571 $eltext = strip_tags($element-> title); 572 break; 573 case 'method' : 574 case 'var' : 575 case 'const' : 576 $eltext .= $element-> class.'::'; 577 case 'page' : 578 case 'define' : 579 case 'class' : 580 case 'function' : 581 case 'global' :
582 default : 583 $eltext .= $element-> name; 584 if ($element-> type == 'function' || $element-> type == 'method') $eltext .= '()'; 585 break; 586 } 587 } 588 return '<a href="' .$this-> getId($element).'">' .$eltext.'</a>' ; 589 } 590 591 function getId($element, $fullpath = true) 592 { 593 if (phpDocumentor_get_class($element) == 'parserdata') 594 { 595 $element = $this-> addLink($element-> parent); 596 $elp = $element-> parent; 597 } elseif (is_a($element, 'parserbase')) 598 { 599 $elp = $element; 600 $element = $this-> addLink($element); 601 } 602 $c = ''; 603 if (!empty($element-> subpackage)) 604 { 605 $c = '/'.$element-> subpackage; 606 } 607 $b = '{$subdir}'; 608 switch ($element-> type) 609 { 610 case 'page' : 611 if ($fullpath) 612 return $b.$element-> package.$c.'/'.$element-> fileAlias.'.html'; 613 return 'top'; 614 break; 615 case 'define' : 616 case 'global' : 617 case 'function' : 618 if ($fullpath) 619 return $b.$element-> package.$c.'/'.$element-> fileAlias.'.html#'.$element> type.$element-> name; 620 return $element-> type.$element-> name; 621 break; 622 case 'class' : 623 if ($fullpath) 624 return $b.$element-> package.$c.'/'.$element-> name.'.html'; 625 return 'top'; 626 break; 627 case 'method' : 628 case 'var' : 629 case 'const' : 630 if ($fullpath) 631 return $b.$element-> package.$c.'/'.$element-> class.'.html#'.$element> type.$element-> name; 632 return $element-> type.$element-> name; 633 break; 634 case 'tutorial' : 635 $d = ''; 636 if ($element-> section) 637 { 638 $d = '#'.$element-> section; 639 } 640 return $b.$element-> package.$c.'/tutorial_'.$element-> name.'.html'.$d; 641 } 642 } 643 644 function ConvertTodoList() 645 { 646 $todolist = array(); 647 foreach($this-> todoList as $package => $alltodos) 648 { 649 foreach($alltodos as $todos) 650 { 651 $converted = array(); 652 $converted['link'] = $this-> returnSee($todos[0]); 653 if (!is_array($todos[1])) 654 { 655 $converted['todos'][] = $todos[1]-> Convert($this); 656 } else 657 { 658 foreach($todos[1] as $todo)
659 { 660 $converted['todos'][] = $todo-> Convert($this); 661 } 662 } 663 $todolist[$package][] = $converted; 664 } 665 } 666 $templ = & $this-> newSmarty(); 667 $templ-> assign('todos',$todolist); 668 $templ-> register_outputfilter('CHMdefault_outputfilter'); 669 $this-> setTargetDir($this-> base_dir); 670 $this-> addTOC('Todo List','todolist','Index','',false,true); 671 $this-> addKLink('Todo List', 'todolist', '', 'Development'); 672 $this-> writefile('todolist.html',$templ-> fetch('todolist.tpl')); 673 } 674 675 /** 676 * Convert README/INSTALL/CHANGELOG file contents to output format 677 * @param README|INSTALL|CHANGELOG 678 * @param string contents of the file 679 */ 680 function Convert_RIC($name, $contents) 681 { 682 $template = & $this-> newSmarty(); 683 $template-> assign('contents',$contents); 684 $template-> assign('name',$name); 685 $this-> setTargetDir($this-> base_dir); 686 $this-> addTOC($name,'ric_'.$name,'Index','',false,true); 687 $this-> addKLink($name, 'ric_'.$name, '', 'Development'); 688 $this-> writefile('ric_'.$name . '.html',$template-> fetch('ric.tpl')); 689 $this-> ric_set[$name] = true; 690 } 691 692 /** 693 * Create errors.html template file output 694 * 695 * This method takes all parsing errors and warnings and spits them out ordered by file and line number. 696 * @global ErrorTracker We'll be using it's output facility 697 */ 698 function ConvertErrorLog() 699 { 700 global $phpDocumentor_errors; 701 $allfiles = array(); 702 $files = array(); 703 $warnings = $phpDocumentor_errors-> returnWarnings(); 704 $errors = $phpDocumentor_errors-> returnErrors(); 705 $template = & $this-> newSmarty(); 706 foreach($warnings as $warning) 707 { 708 $file = '##none'; 709 $linenum = 'Warning'; 710 if ($warning-> file) 711 { 712 $file = $warning-> file; 713 $allfiles[$file] = 1; 714 $linenum .= ' on line '.$warning-> linenum; 715 } 716 $files[$file]['warnings'][] = array('name' => $linenum, 'listing' => $warning> data); 717 } 718 foreach($errors as $error) 719 { 720 $file = '##none'; 721 $linenum = 'Error'; 722 if ($error-> file) 723 { 724 $file = $error-> file; 725 $allfiles[$file] = 1; 726 $linenum .= ' on line '.$error-> linenum; 727 } 728 $files[$file]['errors'][] = array('name' => $linenum, 'listing' => $error> data); 729 } 730 $i=1; 731 $af = array(); 732 foreach($allfiles as $file => $num) 733 { 734 $af[$i++] = $file; 735 }
736 $allfiles = $af; 737 usort($allfiles,'strnatcasecmp'); 738 $allfiles[0] = "Post-parsing" ; 739 foreach($allfiles as $i => $a) 740 { 741 $allfiles[$i] = array('file' => $a); 742 } 743 $out = array(); 744 foreach($files as $file => $data) 745 { 746 if ($file == '##none') $file = 'Post-parsing'; 747 $out[$file] = $data; 748 } 749 $template-> assign("files" ,$allfiles); 750 $template-> assign("all" ,$out); 751 $template-> assign("title" ,"phpDocumentor Parser Errors and Warnings" ); 752 $this-> setTargetDir($this-> base_dir); 753 $this-> writefile("errors.html" ,$template-> fetch('errors.tpl')); 754 unset($template); 755 phpDocumentor_out("\n\nTo view errors and warnings, look at " .$this> base_dir. PATH_DELIMITER . "errors.html\n" ); 756 flush(); 757 } 758 759 function getCData($value) 760 { 761 return '<pre>' .htmlentities($value).'</pre>' ; 762 } 763 764 function getTutorialId($package,$subpackage,$tutorial,$id) 765 { 766 return $id; 767 } 768 769 /** 770 * Converts package page and sets its package as used in {@link $package_pages} 771 * @param parserPackagePage 772 */ 773 function convertPackagepage(& $element) 774 { 775 phpDocumentor_out("\n" ); 776 flush(); 777 $this-> package = $element-> package; 778 $this-> subpackage = ''; 779 $contents = $element-> Convert($this); 780 $this-> package_pages[$element-> package] = str_replace('{$subdir}','../',$contents); 781 phpDocumentor_out("\n" ); 782 flush(); 783 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $element-> package); 784 $this-> addTOC($element-> package." Tutorial" ,'package_'.$element> package,$element-> package,''); 785 $this-> writeFile('package_'.$element> package.'.html',str_replace('{$subdir}','../',$contents)); 786 $this-> setTargetDir($this-> base_dir); 787 Converter::writefile('index.html',str_replace('{$subdir}','',$contents)); 788 $this-> addKLink($element-> package." Tutorial" , 'package_'.$element> package, '', 'Tutorials'); 789 } 790 791 /** 792 * @param parserTutorial 793 */ 794 function convertTutorial(& $element) 795 { 796 phpDocumentor_out("\n" ); 797 flush(); 798 $template = & parent::convertTutorial($element); 799 $a = '../'; 800 if ($element-> subpackage) $a .= '../'; 801 $template-> assign('subdir',$a); 802 $template-> register_outputfilter('CHMdefault_outputfilter'); 803 $contents = $template-> fetch('tutorial.tpl'); 804 if ($element-> package == $GLOBALS['phpDocumentor_DefaultPackageName'] && empty($element-> subpackage) && ( $element-> name == $element-> package . '.pkg')) 805 { 806 $template-> assign('subdir',''); 807 $this-> setTargetDir($this-> base_dir); 808 Converter::writefile('index.html',$template-> fetch('tutorial.tpl'));
809 } 810 $a = ''; 811 if ($element-> subpackage) $a = PATH_DELIMITER . $element-> subpackage; 812 phpDocumentor_out("\n" ); 813 flush(); 814 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $element-> package . $a); 815 $this-> addTOC($a = strip_tags($element-> getTitle($this)), 'tutorial_'.$element> name, 816 $element-> package, $element-> subpackage, false, true); 817 $this-> writeFile('tutorial_'.$element-> name.'.html',$contents); 818 $this-> addKLink($element-> getTitle($this), $element-> package . $a . PATH_DELIMITER . 'tutorial_'.$element-> name, 819 '', 'Tutorials'); 820 } 821 822 /** 823 * Converts class for template output 824 * @see prepareDocBlock(), generateChildClassList(), generateFormattedClassTree(), getFormattedConflicts() 825 * @see getFormattedInheritedMethods(), getFormattedInheritedVars() 826 * @param parserClass 827 */ 828 function convertClass(& $element) 829 { 830 parent::convertClass($element); 831 $this-> class_dir = $element-> docblock-> package; 832 if (!empty($element-> docblock-> subpackage)) $this-> class_dir .= PATH_DELIMITER . $element-> docblock-> subpackage; 833 $a = '../'; 834 if ($element-> docblock-> subpackage != '') $a = " ../$a" ; 835 836 $this-> class_data-> assign('subdir',$a); 837 $this-> class_data-> assign("title" ,"Docs For Class " . $element-> getName()); 838 $this-> class_data-> assign("page" ,$element-> getName() . '.html'); 839 $this-> addKLink($element-> name, $this-> class_dir . PATH_DELIMITER . $this> class, '', 'Classes'); 840 } 841 842 843 /** 844 * Converts class variables for template output 845 * @see prepareDocBlock(), getFormattedConflicts() 846 * @param parserDefine 847 */ 848 function convertVar(& $element) 849 { 850 parent::convertVar($element, array('var_dest' => $this-> getId($element,false))); 851 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> class_dir); 852 $this-> addKLink($element-> name, $this-> class_dir . PATH_DELIMITER .$this> class, $this-> getId($element,false), $element-> class.' Properties'); 853 } 854 855 /** 856 * Converts class constants for template output 857 * @see prepareDocBlock(), getFormattedConflicts() 858 * @param parserDefine 859 */ 860 function convertConst(& $element) 861 { 862 parent::convertConst($element, array('const_dest' => $this> getId($element,false))); 863 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> class_dir); 864 $this-> addKLink($element-> name, $this-> class_dir . PATH_DELIMITER .$this> class, $this-> getId($element,false), $element-> class.' Constants'); 865 } 866 867 /** 868 * Converts class methods for template output 869 * @see prepareDocBlock(), getFormattedConflicts() 870 * @param parserDefine 871 */ 872 function convertMethod(& $element) 873 { 874 parent::convertMethod($element, array('method_dest' => $this> getId($element,false))); 875 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> class_dir); 876 $this-> addKLink($element-> name, $this-> class_dir . PATH_DELIMITER .$this> class, $this-> getId($element,false), $element-> class.' Methods'); 877 }
878 879 /** 880 * Converts function for template output 881 * @see prepareDocBlock(), parserFunction::getFunctionCall(), getFormattedConflicts() 882 * @param parserFunction 883 */ 884 function convertFunction(& $element) 885 { 886 $funcloc = $this-> getId($this-> addLink($element)); 887 parent::convertFunction($element,array('function_dest' => $this> getId($element,false))); 888 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> page_dir); 889 $this-> addKLink($element-> name, $this-> page_dir . PATH_DELIMITER . $this> page, $this-> getId($element,false), 'Functions'); 890 } 891 892 /** 893 * Converts include elements for template output 894 * @see prepareDocBlock() 895 * @param parserInclude 896 */ 897 function convertInclude(& $element) 898 { 899 parent::convertInclude($element, array('include_file' => '_'.strtr($element> getValue(),array('"' => '', "'" => '','.' => '_')))); 900 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> page_dir); 901 $this-> addKLink(str_replace('"' , '', $element-> getValue()), $this> page_dir . PATH_DELIMITER . $this-> page, '', ucfirst($element-> name)); 902 } 903 904 /** 905 * Converts defines for template output 906 * @see prepareDocBlock(), getFormattedConflicts() 907 * @param parserDefine 908 */ 909 function convertDefine(& $element) 910 { 911 parent::convertDefine($element, array('define_link' => $this> getId($element,false))); 912 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> page_dir); 913 $this-> addKLink($element-> name, $this-> page_dir . PATH_DELIMITER . $this> page, $this-> getId($element,false), 'Constants'); 914 } 915 916 /** 917 * Converts global variables for template output 918 * @param parserGlobal 919 */ 920 function convertGlobal(& $element) 921 { 922 parent::convertGlobal($element, array('global_link' => $this> getId($element,false))); 923 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> page_dir); 924 $this-> addKLink($element-> name, $this-> page_dir . PATH_DELIMITER . $this> page, $this-> getId($element,false), 'Global Variables'); 925 } 926 927 /** 928 * converts procedural pages for template output 929 * @see prepareDocBlock(), getClassesOnPage() 930 * @param parserData 931 */ 932 function convertPage(& $element) 933 { 934 parent::convertPage($element); 935 $this-> juststarted = true; 936 $this-> page_dir = $element-> parent-> package; 937 if (!empty($element-> parent-> subpackage)) $this-> page_dir .= PATH_DELIMITER . $element-> parent-> subpackage; 938 // registering stuff on the template 939 $this-> page_data-> assign("page" ,$this-> getPageName($element) . '.html'); 940 $this-> page_data-> assign("title" ,"Docs for page " .$element> parent-> getFile()); 941 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> page_dir); 942 $this-> addKLink($element-> parent-> file, $this-> page_dir . PATH_DELIMITER . $this-> page, '', 'Files'); 943 } 944 945 function getPageName(& $element)
946 { 947 if (phpDocumentor_get_class($element) == 'parserpage') return '_'.$element> getName(); 948 return '_'.$element-> parent-> getName(); 949 } 950 951 /** 952 * returns an array containing the class inheritance tree from the root object to the class 953 * 954 * @param parserClass class variable 955 * @return array Format: array(root,child,child,child,...,$class) 956 * @uses parserClass::getParentClassTree() 957 */ 958 959 function generateFormattedClassTree($class) 960 { 961 $tree = $class-> getParentClassTree($this); 962 $out = ''; 963 if (count($tree) - 1) 964 { 965 $result = array($class-> getName()); 966 $parent = $tree[$class-> getName()]; 967 $distance[] = ''; 968 while ($parent) 969 { 970 $x = $parent; 971 if (is_object($parent)) 972 { 973 $subpackage = $parent-> docblock-> subpackage; 974 $package = $parent-> docblock-> package; 975 $x = $parent; 976 $x = $parent-> getLink($this); 977 if (!$x) $x = $parent-> getName(); 978 } 979 $result[] = 980 $x; 981 $distance[] = 982 "\n%s|\n" . 983 "%s--" ; 984 if (is_object($parent)) 985 $parent = $tree[$parent-> getName()]; 986 elseif (isset($tree[$parent])) 987 $parent = $tree[$parent]; 988 } 989 $nbsp = ' '; 990 for($i=count($result) - 1;$i>= 0;$i--) 991 { 992 $my_nbsp = ''; 993 for($j=0;$j< count($result) - $i;$j++) $my_nbsp .= $nbsp; 994 $distance[$i] = sprintf($distance[$i],$my_nbsp,$my_nbsp); 995 } 996 return array('classes'=> array_reverse($result),'distance'=> array_reverse($distance)); 997 } else 998 { 999 return array('classes'=> $class-> getName(),'distance'=>array( '')); 1000 } 1001 } 1002 1003 /** @access private */ 1004 function sortVar($a, $b) 1005 { 1006 return strnatcasecmp($a-> getName(),$b-> getName()); 1007 } 1008 1009 /** @access private */ 1010 function sortMethod($a, $b) 1011 { 1012 if ($a-> isConstructor) return -1; 1013 if ($b-> isConstructor) return 1; 1014 return strnatcasecmp($a-> getName(),$b-> getName()); 1015 } 1016 1017 /** 1018 * returns a template-enabled array of class trees 1019 * 1020 * @param string $package package to generate a class tree for 1021 * @see $roots, HTMLConverter::getRootTree() 1022 */ 1023 function generateFormattedClassTrees($package)
1024 { 1025 if (!isset($this-> roots['normal'][$package]) && 1026 !isset($this-> roots['special'][$package])) { 1027 return array(); 1028 } 1029 $trees = array(); 1030 if (isset($this-> roots['normal'][$package])) { 1031 $roots = $this-> roots['normal'][$package]; 1032 for($i=0;$i< count($roots);$i++) 1033 { 1034 $root = $this-> classes-> getClassByPackage($roots[$i], $package); 1035 if ($root && $root-> isInterface()) { 1036 continue; 1037 } 1038 $trees[] = array('class' => $roots[$i],'class_tree' => "<ul>\n" .$this-> getRootTree($this> getSortedClassTreeFromClass($roots[$i],$package,''),$package)."</ul>\n" ); 1039 } 1040 } 1041 if (isset($this-> roots['special'][$package])) { 1042 $roots = $this-> roots['special'][$package]; 1043 foreach ($roots as $parent => $classes) { 1044 $thistree = ''; 1045 foreach ($classes as $classinfo) { 1046 $root = $this-> classes-> getClassByPackage($classinfo, $package); 1047 if ($root && $root-> isInterface()) { 1048 continue; 1049 } 1050 $thistree .= 1051 $this-> getRootTree( 1052 $this-> getSortedClassTreeFromClass( 1053 $classinfo, 1054 $package, 1055 ''), 1056 $package, 1057 true); 1058 } 1059 if (!$thistree) { 1060 continue; 1061 } 1062 $trees[] = array( 1063 'class' => $parent, 1064 'class_tree' => "<ul>\n" . $thistree . "</ul>\n" 1065 ); 1066 } 1067 } 1068 return $trees; 1069 } 1070 1071 /** 1072 * returns a template-enabled array of interface inheritance trees 1073 * 1074 * @param string $package package to generate a class tree for 1075 * @see $roots, HTMLConverter::getRootTree() 1076 */ 1077 function generateFormattedInterfaceTrees($package) 1078 { 1079 if (!isset($this-> roots['normal'][$package]) && 1080 !isset($this-> roots['special'][$package])) { 1081 return array(); 1082 } 1083 $trees = array(); 1084 if (isset($this-> roots['normal'][$package])) { 1085 $roots = $this-> roots['normal'][$package]; 1086 for($i=0;$i< count($roots);$i++) 1087 { 1088 $root = $this-> classes-> getClassByPackage($roots[$i], $package); 1089 if ($root && ! $root-> isInterface()) { 1090 continue; 1091 } 1092 $trees[] = array('class' => $roots[$i],'class_tree' => "<ul>\n" .$this-> getRootTree($this> getSortedClassTreeFromClass($roots[$i],$package,''),$package)."</ul>\n" ); 1093 } 1094 } 1095 if (isset($this-> roots['special'][$package])) { 1096 $roots = $this-> roots['special'][$package]; 1097 foreach ($roots as $parent => $classes) { 1098 $thistree = '';
1099 foreach ($classes as $classinfo) { 1100 $root = $this-> classes-> getClassByPackage($classinfo, $package); 1101 if ($root && ! $root-> isInterface()) { 1102 continue; 1103 } 1104 $thistree .= 1105 $this-> getRootTree( 1106 $this-> getSortedClassTreeFromClass( 1107 $classinfo, 1108 $package, 1109 ''), 1110 $package, 1111 true); 1112 } 1113 if (!$thistree) { 1114 continue; 1115 } 1116 $trees[] = array( 1117 'class' => $parent, 1118 'class_tree' => "<ul>\n" . $thistree . "</ul>\n" 1119 ); 1120 } 1121 } 1122 return $trees; 1123 } 1124 1125 /** 1126 * return formatted class tree for the Class Trees page 1127 * 1128 * @param array $tree output from {@link getSortedClassTreeFromClass()} 1129 * @param string $package package 1130 * @param boolean $nounknownparent if true, an object's parent will not be checked 1131 * @see Classes::$definitechild, generateFormattedClassTrees() 1132 * @return string 1133 */ 1134 function getRootTree($tree, $package, $noparent = false) 1135 { 1136 if (!$tree) return ''; 1137 $my_tree = ''; 1138 $cur = '#root'; 1139 $lastcur = array(false); 1140 $kids = array(); 1141 $dopar = false; 1142 if (!$noparent && $tree[$cur]['parent']) 1143 { 1144 $dopar = true; 1145 if (!is_object($tree[$cur]['parent'])) 1146 { 1147 // debug("parent ".$tree[$cur]['parent']." not found"); 1148 $my_tree .= '<li>' . $tree[$cur]['parent'] .'<ul>' ; 1149 } 1150 else 1151 { 1152 // debug("parent ".$this>returnSee($tree[$cur]['parent'])." in other package"); 1153 $my_tree .= '<li>' . $this-> returnSee($tree[$cur]['parent']); 1154 if ($tree[$cur]['parent']-> package != $package) $my_tree .= ' <b>(Different package)</b><ul>' ; 1155 } 1156 } 1157 do 1158 { 1159 // fancy_debug($cur,$lastcur,$kids); 1160 if (count($tree[$cur]['children'])) 1161 { 1162 // debug("$cur has children"); 1163 if (!isset($kids[$cur])) 1164 { 1165 // debug("set $cur kids"); 1166 $kids[$cur] = 1; 1167 $my_tree .= '<li>' .$this-> returnSee($tree[$cur]['link']); 1168 $my_tree .= '<ul>' ."\n" ; 1169 } 1170 array_push($lastcur,$cur); 1171 list(,$cur) = each($tree[$cur]['children']); 1172 // var_dump('listed',$cur); 1173 if ($cur) 1174 { 1175 $cur = $cur['package'] . '#' . $cur['class'];
1176 // debug("set cur to child $cur"); 1177 // $my_tree .= '<li>'.$this->returnSee($tree[$cur]['link']); 1178 continue; 1179 } else 1180 { 1181 // debug("end of children for $cur"); 1182 $cur = array_pop($lastcur); 1183 $cur = array_pop($lastcur); 1184 $my_tree .= '</ul></li>' ."\n" ; 1185 if ($dopar && ( $cur == '#root' || !$cur)) $my_tree .= '</ul></li>' ; 1186 } 1187 } else 1188 { 1189 // debug("$cur has no children"); 1190 $my_tree .= '<li>' .$this> returnSee($tree[$cur]['link'])."</li>" ; 1191 if ($dopar && $cur == '#root') $my_tree .= '</ul></li>' ; 1192 $cur = array_pop($lastcur); 1193 } 1194 } while ($cur); 1195 return $my_tree; 1196 } 1197 /** 1198 * Generate indexing information for given element 1199 * 1200 * @param parserElement descendant of parserElement 1201 * @see generateElementIndex() 1202 * @return array 1203 */ 1204 function getIndexInformation($elt) 1205 { 1206 $Result['type'] = $elt-> type; 1207 $Result['file_name'] = $elt-> file; 1208 $Result['path'] = $elt-> getPath(); 1209 1210 if (isset($elt-> docblock)) 1211 { 1212 $Result['description'] = $elt-> docblock-> getSDesc($this); 1213 1214 if ($elt-> docblock-> hasaccess) 1215 $Result['access'] = $elt-> docblock-> tags['access'][0]> value; 1216 else 1217 $Result['access'] = 'public'; 1218 1219 $Result['abstract'] = isset ($elt-> docblock> tags['abstract'][0]); 1220 } 1221 else 1222 $Result['description'] = ''; 1223 1224 $aa = $Result['description']; 1225 if (!empty($aa)) $aa = " <br> $aa" ; 1226 1227 switch($elt-> type) 1228 { 1229 case 'class': 1230 $Result['name'] = $elt-> getName(); 1231 $Result['title'] = 'Class'; 1232 $Result['link'] = $this-> getClassLink($elt-> getName(), 1233 $elt-> docblock-> package, 1234 $elt-> getPath(), 1235 $elt-> getName()); 1236 $Result['listing'] = 'in file '.$elt-> file.', class '.$Result['link']." $aa" ; 1237 break; 1238 case 'define': 1239 $Result['name'] = $elt-> getName(); 1240 $Result['title'] = 'Constant'; 1241 $Result['link'] = $this-> getDefineLink($elt-> getName(), 1242 $elt-> docblock> package, 1243 $elt-> getPath(), 1244 $elt-> getName()); 1245 $Result['listing'] = 'in file '.$elt-> file.', constant '.$Result['link']." $aa" ; 1246 break; 1247 case 'global':
1248 $Result['name'] = $elt-> getName(); 1249 $Result['title'] = 'Global'; 1250 $Result['link'] = $this-> getGlobalLink($elt-> getName(), 1251 $elt-> docblock> package, 1252 $elt-> getPath(), 1253 $elt-> getName()); 1254 $Result['listing'] = 'in file '.$elt-> file.', global variable '.$Result['link']." $aa" ; 1255 break; 1256 case 'function': 1257 $Result['name'] = $elt-> getName(); 1258 $Result['title'] = 'Function'; 1259 $Result['link'] = $this-> getFunctionLink($elt-> getName(), 1260 $elt-> docblock> package, 1261 $elt-> getPath(), 1262 $elt-> getName().'()'); 1263 $Result['listing'] = 'in file '.$elt-> file.', function '.$Result['link']." $aa" ; 1264 break; 1265 case 'method': 1266 $Result['name'] = $elt-> getName(); 1267 $Result['title'] = 'Method'; 1268 $Result['link'] = $this-> getMethodLink($elt-> getName(), 1269 $elt-> class, 1270 $elt-> docblock> package, 1271 $elt-> getPath(), 1272 $elt-> class.'::'.$elt> getName().'()' 1273 ); 1274 if ($elt-> isConstructor) $Result['constructor'] = 1; 1275 $Result['listing'] = 'in file '.$elt-> file.', method '.$Result['link']." $aa" ; 1276 break; 1277 case 'var': 1278 $Result['name'] = $elt-> getName(); 1279 $Result['title'] = 'Variable'; 1280 $Result['link'] = $this-> getVarLink($elt-> getName(), 1281 $elt-> class, 1282 $elt-> docblock-> package, 1283 $elt-> getPath(), 1284 $elt-> class.'::'.$elt> getName()); 1285 $Result['listing'] = 'in file '.$elt-> file.', variable '.$Result['link']." $aa" ; 1286 break; 1287 case 'const': 1288 $Result['name'] = $elt-> getName(); 1289 $Result['title'] = 'Variable'; 1290 $Result['link'] = $this-> getConstLink($elt-> getName(), 1291 $elt-> class, 1292 $elt-> docblock-> package, 1293 $elt-> getPath(), 1294 $elt-> class.'::'.$elt> getName()); 1295 $Result['listing'] = 'in file '.$elt-> file.', class constant '.$Result['link']." $aa" ; 1296 break; 1297 case 'page': 1298 $Result['name'] = $elt-> getFile(); 1299 $Result['title'] = 'Page'; 1300 $Result['link'] = $this-> getPageLink($elt-> getFile(), 1301 $elt-> package, 1302 $elt-> getPath(), 1303 $elt-> getFile()); 1304 $Result['listing'] = 'procedural page '.$Result['link']; 1305 break; 1306 case 'include': 1307 $Result['name'] = $elt-> getName(); 1308 $Result['title'] = 'Include'; 1309 $Result['link'] = $elt-> getValue(); 1310 $Result['listing'] = 'include '.$Result['name']; 1311 break; 1312 } 1313 1314 return $Result; 1315 }
1316 /** 1317 * Generate alphabetical index of all elements 1318 * 1319 * @see $elements, walk() 1320 */ 1321 function generateElementIndex() 1322 { 1323 $elementindex = array(); 1324 $letters = array(); 1325 $used = array(); 1326 foreach($this-> elements as $letter => $nutoh) 1327 { 1328 foreach($this-> elements[$letter] as $i => $yuh) 1329 { 1330 if ($this-> elements[$letter][$i]-> type != 'include') 1331 { 1332 if (!isset($used[$letter])) 1333 { 1334 $letters[]['letter'] = $letter; 1335 $elindex['letter'] = $letter; 1336 $used[$letter] = 1; 1337 } 1338 1339 $elindex['index'][] = $this-> getIndexInformation($this> elements[$letter][$i]); 1340 } 1341 } 1342 if (isset($elindex['index'])) 1343 { 1344 $elementindex[] = $elindex; 1345 } else 1346 { 1347 unset($letters[count($letters) - 1]); 1348 } 1349 $elindex = array(); 1350 } 1351 return array($elementindex,$letters); 1352 } 1353 1354 function setTemplateDir($dir) 1355 { 1356 Converter::setTemplateDir($dir); 1357 $this-> smarty_dir = $this-> templateDir; 1358 } 1359 1360 function copyMediaRecursively($media,$targetdir,$subdir = '') 1361 { 1362 $versionControlDirectories = array ('CVS', 'media/CVS', 'media\\CVS', '.svn', 'media/.svn', 'media\\.svn'); 1363 if (!is_array($media)) { 1364 return; 1365 } 1366 foreach($media as $dir => $files) 1367 { 1368 if ($dir === '/') 1369 { 1370 $this-> copyMediaRecursively($files,$targetdir); 1371 } else 1372 { 1373 if (!is_numeric($dir)) 1374 { 1375 if (in_array($dir, $versionControlDirectories)) 1376 { 1377 // skip it entirely 1378 } 1379 else 1380 { 1381 // create the subdir 1382 phpDocumentor_out(" creating $targetdir" . PATH_DELIMITER . " $dir\n" ); 1383 Converter::setTargetDir($targetdir . PATH_DELIMITER . $dir); 1384 if (!empty($subdir)) 1385 { 1386 $subdir .= PATH_DELIMITER; 1387 } 1388 $this> copyMediaRecursively($files," $targetdir/$dir" ,$subdir . $dir); 1389 } 1390 } 1391 else
1392 { 1393 // copy the file 1394 phpDocumentor_out(" copying $targetdir" . PATH_DELIMITER . $files['file']."\n" ); 1395 $this-> copyFile($files['file'],$subdir); 1396 } 1397 } 1398 } 1399 } 1400 1401 /** 1402 * calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied 1403 * @see Converter::setTargetDir() 1404 */ 1405 function setTargetDir($dir) 1406 { 1407 Converter::setTargetDir($dir); 1408 if ($this-> wrote) return; 1409 $this-> wrote = true; 1410 $template_images = array(); 1411 $stylesheets = array(); 1412 $tdir = $dir; 1413 $dir = $this-> templateDir; 1414 $this-> templateDir = $this-> templateDir.'templates/'; 1415 $info = new Io; 1416 $this-> copyMediaRecursively($info-> getDirTree($this-> templateDir.'media',$this> templateDir),$tdir); 1417 } 1418 1419 /** 1420 * Generate alphabetical index of all elements by package and subpackage 1421 * 1422 * @param string $package name of a package 1423 * @see $pkg_elements, walk(), generatePkgElementIndexes() 1424 */ 1425 function generatePkgElementIndex($package) 1426 { 1427 // var_dump($this->pkg_elements[$package]); 1428 $elementindex = array(); 1429 $letters = array(); 1430 $letterind = array(); 1431 $used = array(); 1432 $subp = ''; 1433 foreach($this-> pkg_elements[$package] as $subpackage => $els) 1434 { 1435 if (empty($els)) continue; 1436 if (!empty($subpackage)) $subp = " (<b>subpackage:</b> $subpackage)" ; else $subp = ''; 1437 foreach($els as $letter => $yuh) 1438 { 1439 foreach($els[$letter] as $i => $yuh) 1440 { 1441 if ($els[$letter][$i]-> type != 'include') 1442 { 1443 if (!isset($used[$letter])) 1444 { 1445 $letters[]['letter'] = $letter; 1446 $letterind[$letter] = count($letters) - 1; 1447 $used[$letter] = 1; 1448 } 1449 $elindex[$letter]['letter'] = $letter; 1450 1451 $elindex[$letter]['index'][] = $this> getIndexInformation($els[$letter][$i]); 1452 } 1453 } 1454 } 1455 } 1456 ksort($elindex); 1457 usort($letters,'CHMdefault_lettersort'); 1458 if (isset($elindex)) 1459 { 1460 while(list($letter,$tempel) = each($elindex)) 1461 { 1462 if (!isset($tempel)) 1463 { 1464 unset($letters[$letterind[$tempel['letter']]]); 1465 } else 1466 $elementindex[] = $tempel;
1467 } 1468 } else $letters = array(); 1469 return array($elementindex,$letters); 1470 } 1471 1472 /** 1473 * 1474 * @see generatePkgElementIndex() 1475 */ 1476 function generatePkgElementIndexes() 1477 { 1478 $packages = array(); 1479 $package_names = array(); 1480 $pkg = array(); 1481 $letters = array(); 1482 foreach($this-> pkg_elements as $package => $trash) 1483 { 1484 $pkgs['package'] = $package; 1485 $pkg['package'] = $package; 1486 list($pkg['pindex'],$letters[$package]) = $this> generatePkgElementIndex($package); 1487 if (count($pkg['pindex'])) 1488 { 1489 $packages[] = $pkg; 1490 $package_names[] = $pkgs; 1491 } 1492 unset($pkgs); 1493 unset($pkg); 1494 } 1495 foreach($packages as $i => $package) 1496 { 1497 $pnames = array(); 1498 for($j=0;$j< count($package_names);$j++) 1499 { 1500 if ($package_names[$j]['package'] != $package['package']) $pnames[] = $package_names[$j]; 1501 } 1502 $packages[$i]['packageindexes'] = $pnames; 1503 } 1504 return array($packages,$package_names,$letters); 1505 } 1506 1507 /** 1508 * @param string name of class 1509 * @param string package name 1510 * @param string full path to look in (used in index generation) 1511 * @param boolean deprecated 1512 * @param boolean return just the URL, or enclose it in an html a tag 1513 * @return mixed false if not found, or an html a link to the class's documentation 1514 * @see parent::getClassLink() 1515 */ 1516 function getClassLink($expr,$package, $file = false,$text = false, $with_a = true) 1517 { 1518 $a = Converter::getClassLink($expr,$package,$file); 1519 if (!$a) return false; 1520 return $this-> returnSee($a, $text, $with_a); 1521 } 1522 1523 /** 1524 * @param string name of function 1525 * @param string package name 1526 * @param string full path to look in (used in index generation) 1527 * @param boolean deprecated 1528 * @param boolean return just the URL, or enclose it in an html a tag 1529 * @return mixed false if not found, or an html a link to the function's documentation 1530 * @see parent::getFunctionLink() 1531 */ 1532 function getFunctionLink($expr,$package, $file = false,$text = false) 1533 { 1534 $a = Converter::getFunctionLink($expr,$package,$file); 1535 if (!$a) return false; 1536 return $this-> returnSee($a, $text); 1537 } 1538 1539 /** 1540 * @param string name of define 1541 * @param string package name 1542 * @param string full path to look in (used in index generation) 1543 * @param boolean deprecated 1544 * @param boolean return just the URL, or enclose it in an html a tag
1545 * @return mixed false if not found, or an html a link to the define's documentation 1546 * @see parent::getDefineLink() 1547 */ 1548 function getDefineLink($expr,$package, $file = false,$text = false) 1549 { 1550 $a = Converter::getDefineLink($expr,$package,$file); 1551 if (!$a) return false; 1552 return $this-> returnSee($a, $text); 1553 } 1554 1555 /** 1556 * @param string name of global variable 1557 * @param string package name 1558 * @param string full path to look in (used in index generation) 1559 * @param boolean deprecated 1560 * @param boolean return just the URL, or enclose it in an html a tag 1561 * @return mixed false if not found, or an html a link to the global variable's documentation 1562 * @see parent::getGlobalLink() 1563 */ 1564 function getGlobalLink($expr,$package, $file = false,$text = false) 1565 { 1566 $a = Converter::getGlobalLink($expr,$package,$file); 1567 if (!$a) return false; 1568 return $this-> returnSee($a, $text); 1569 } 1570 1571 /** 1572 * @param string name of procedural page 1573 * @param string package name 1574 * @param string full path to look in (used in index generation) 1575 * @param boolean deprecated 1576 * @param boolean return just the URL, or enclose it in an html a tag 1577 * @return mixed false if not found, or an html a link to the procedural page's documentation 1578 * @see parent::getPageLink() 1579 */ 1580 function getPageLink($expr,$package, $path = false,$text = false) 1581 { 1582 $a = Converter::getPageLink($expr,$package,$path); 1583 if (!$a) return false; 1584 return $this-> returnSee($a, $text); 1585 } 1586 1587 /** 1588 * @param string name of method 1589 * @param string class containing method 1590 * @param string package name 1591 * @param string full path to look in (used in index generation) 1592 * @param boolean deprecated 1593 * @param boolean return just the URL, or enclose it in an html a tag 1594 * @return mixed false if not found, or an html a link to the method's documentation 1595 * @see parent::getMethodLink() 1596 */ 1597 function getMethodLink($expr,$class,$package, $file = false,$text = false) 1598 { 1599 $a = Converter::getMethodLink($expr,$class,$package,$file); 1600 if (!$a) return false; 1601 return $this-> returnSee($a, $text); 1602 } 1603 1604 /** 1605 * @param string name of var 1606 * @param string class containing var 1607 * @param string package name 1608 * @param string full path to look in (used in index generation) 1609 * @param boolean deprecated 1610 * @param boolean return just the URL, or enclose it in an html a tag 1611 * @return mixed false if not found, or an html a link to the var's documentation 1612 * @see parent::getVarLink() 1613 */ 1614 function getVarLink($expr,$class,$package, $file = false,$text = false) 1615 { 1616 $a = Converter::getVarLink($expr,$class,$package,$file); 1617 if (!$a) return false; 1618 return $this-> returnSee($a, $text); 1619 } 1620 1621 /** 1622 * @param string name of class constant
1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702
* @param string class containing class constant * @param string package name * @param string full path to look in (used in index generation) * @param boolean deprecated * @param boolean return just the URL, or enclose it in an html a tag * @return mixed false if not found, or an html a link to the var's documentation * @see parent::getVarLink() */ function getConstLink($expr,$class,$package, $file = false,$text = false) { $a = Converter::getConstLink($expr,$class,$package,$file); if (!$a) return false; return $this-> returnSee($a, $text); } /** * does a nat case sort on the specified second level value of the array * * @param mixed $a * @param mixed $b * @return int */ function rcNatCmp ($a, $b) { $aa = strtoupper($a[$this-> rcnatcmpkey]); $bb = strtoupper($b[$this-> rcnatcmpkey]); return strnatcasecmp($aa, $bb); } /** * does a nat case sort on the specified second level value of the array. * this one puts constructors first * * @param mixed $a * @param mixed $b * @return int */ function rcNatCmp1 ($a, $b) { $aa = strtoupper($a[$this-> rcnatcmpkey]); $bb = strtoupper($b[$this-> rcnatcmpkey]); if (strpos($aa,'CONSTRUCTOR') === 0) { return -1; } if (strpos($bb,'CONSTRUCTOR') === 0) { return 1; } if (strpos($aa,strtoupper($this-> class)) === 0) { return -1; } if (strpos($bb,strtoupper($this-> class)) === 0) { return -1; } return strnatcasecmp($aa, $bb); } /** * Write a file to disk, and add it to the {@link $hhp_files} list of files * to include in the generated CHM * * {@source } */ function writefile($file,$contents) { $this-> addHHP($this-> targetDir . PATH_DELIMITER . $file); Converter::writefile($file,$contents); } /** * @uses $hhp_files creates the array by adding parameter $file */ function addHHP($file) { $file = str_replace($this-> base_dir . PATH_DELIMITER, '', $file);
1703 $file = str_replace('\\',PATH_DELIMITER,$file); 1704 $file = str_replace('//',PATH_DELIMITER,$file); 1705 $file = str_replace(PATH_DELIMITER,'\\',$file); 1706 $this-> hhp_files[]['name'] = $file; 1707 } 1708 1709 function generateTOC() 1710 { 1711 $comppack = ''; 1712 $templ = & $this-> newSmarty(); 1713 foreach($this-> TOC as $package => $TOC1) 1714 { 1715 $comp_subs = ''; 1716 $comp_subs1 = false; 1717 foreach($TOC1 as $subpackage => $types) 1718 { 1719 $comp_types = ''; 1720 foreach($types as $type => $files) 1721 { 1722 $comp = ''; 1723 $templ1 = & $this-> newSmarty(); 1724 $templ1-> assign('entry', array()); 1725 foreach($files as $file) 1726 { 1727 // use book icon for classes 1728 if ($type == 'Classes') { 1729 $templ1-> append('entry', array('paramname' => $file[0],'outputfile' => $file[1],'isclass' => 1)); 1730 } else { 1731 $templ1-> append('entry', array('paramname' => $file[0],'outputfile' => $file[1])); 1732 } 1733 } 1734 $templ = & $this-> newSmarty(); 1735 $templ-> assign('tocsubentries',$templ1-> fetch('tocentry.tpl')); 1736 $templ-> assign('entry', array(array('paramname' => $type))); 1737 $comp_types .= $templ-> fetch('tocentry.tpl'); 1738 } 1739 if (!empty($subpackage)) 1740 { 1741 $templ = & $this-> newSmarty(); 1742 $templ-> assign('tocsubentries',$comp_types); 1743 $templ-> assign('entry', array(array('paramname' => $subpackage))); 1744 $comp_subs .= $templ-> fetch('tocentry.tpl'); 1745 } else 1746 { 1747 $comp_subs1 = $comp_types; 1748 } 1749 } 1750 if ($comp_subs1) 1751 $templ-> assign('tocsubentries',$comp_subs1); 1752 if (!empty($comp_subs)) 1753 $templ-> assign('entry', array(array('paramname' => $package, 'tocsubentries' => $comp_subs))); 1754 else 1755 $templ-> assign('entry', array(array('paramname' => $package))); 1756 $comppack .= $templ-> fetch('tocentry.tpl'); 1757 } 1758 return $comppack; 1759 } 1760 1761 function addSourceTOC($name, $file, $package, $subpackage, $source = false) 1762 { 1763 $file = str_replace($this-> base_dir . PATH_DELIMITER, '', $this-> targetDir) 1764 . PATH_DELIMITER . $file . '.html'; 1765 $file = str_replace('\\',PATH_DELIMITER,$file); 1766 $file = str_replace('//',PATH_DELIMITER,$file); 1767 $file = str_replace(PATH_DELIMITER,'\\',$file); 1768 $sub = $source ? 'Source Code' : 'Examples'; 1769 $this-> TOC[$package][$subpackage][$sub][] = array($name, $file); 1770 } 1771 1772 function addTOC($name,$file,$package,$subpackage,$class = false,$tutorial = false) 1773 { 1774 $file = str_replace($this-> base_dir . PATH_DELIMITER, '', $this-> targetDir . PATH_DELIMITER) 1775 . $file . '.html'; 1776 $file = str_replace('\\',PATH_DELIMITER,$file); 1777 $file = str_replace('//',PATH_DELIMITER,$file); 1778 $file = str_replace(PATH_DELIMITER,'\\',$file);
1779 $file = str_replace($this-> base_dir . '\\', '', $file); 1780 $sub = $class ? 'Classes' : 'Files'; 1781 if ($tutorial) $sub = 'Manual'; 1782 $this-> TOC[$package][$subpackage][$sub][] = array($name,$file); 1783 } 1784 1785 /** 1786 * Add an item to the index.hhk file 1787 * @param string $name index entry name 1788 * @param string $file filename containing index 1789 * @param string $bookmark html anchor of location in file, if any 1790 * @param string $group group this entry with a string 1791 * @uses $KLinks tracks the index 1792 * @author Andrew Eddie <[email protected]> 1793 */ 1794 function addKLink($name, $file, $bookmark='', $group='') 1795 { 1796 $file = $file . '.html'; 1797 $file = str_replace('\\',PATH_DELIMITER,$file); 1798 $file = str_replace('//',PATH_DELIMITER,$file); 1799 $file = str_replace(PATH_DELIMITER,'\\',$file); 1800 // debug("added $name, $file, $bookmark, $group "); 1801 $link = $file; 1802 $link .= $bookmark ? " #$bookmark" :''; 1803 if ($group) { 1804 $this-> KLinks[$group]['grouplink'] = $file; 1805 $this-> KLinks[$group][] = array($name,$link); 1806 } 1807 $this-> KLinks[] = array($name,$link); 1808 } 1809 1810 /** 1811 * Get the table of contents for index.hhk 1812 * @return string contents of tocentry.tpl generated from $KLinks 1813 * @author Andrew Eddie <[email protected]> 1814 */ 1815 function generateKLinks() 1816 { 1817 $templ = & $this-> newSmarty(); 1818 $templ-> assign('entry', array()); 1819 foreach($this-> KLinks as $group=> $link) 1820 { 1821 if (isset($link['grouplink'])) { 1822 $templg = & $this-> newSmarty(); 1823 $templg-> assign('entry', array()); 1824 foreach($link as $k=> $sublink) 1825 { 1826 if ($k != 'grouplink') { 1827 $templg-> append('entry', array('paramname' => $sublink[0],'outputfile' => $sublink[1])); 1828 } 1829 } 1830 $templ-> append('entry', array('paramname' => $group, 'outputfile' => $link['grouplink'], 'tocsubentries' => $templg-> fetch('tocentry.tpl') )); 1831 } else { 1832 $templ-> append('entry', array('paramname' => $link[0],'outputfile' => $link[1])); 1833 } 1834 } 1835 return $templ-> fetch('tocentry.tpl'); 1836 } 1837 1838 /** 1839 * Create the phpdoc.hhp, contents.hhc files needed by MS HTML Help Compiler 1840 * to create a CHM file 1841 * 1842 * The output function generates the table of contents (contents.hhc) 1843 * and file list (phpdoc.hhp) files used to create a .CHM by the 1844 * free MS HTML Help compiler. 1845 * {@internal 1846 * Using {@link $hhp_files}, a list of all separate .html files 1847 * is created in CHM format, and written to phpdoc.hhp. This list was 1848 * generated by {@link writefile}. 1849 * 1850 * Next, a call to the table of contents: 1851 * 1852 * {@source 12 2} 1853 * 1854 * finishes things off}}} 1855 * @todo use to directly call html help compiler hhc.exe
1856 * @link http://www.microsoft.com/downloads/release.asp?releaseid=33071 1857 * @uses generateTOC() assigns to the toc template variable 1858 */ 1859 function Output() 1860 { 1861 $templ = & $this-> newSmarty(); 1862 $templ-> assign('files',$this-> hhp_files); 1863 $this-> setTargetDir($this-> base_dir); 1864 Converter::writefile('phpdoc.hhp',$templ-> fetch('hhp.tpl')); 1865 $templ = & $this-> newSmarty(); 1866 $templ-> assign('toc',$this-> generateTOC()); 1867 Converter::writefile('contents.hhc',$templ-> fetch('contents.hhc.tpl')); 1868 $templ-> assign('klinks',$this-> generateKLinks()); 1869 Converter::writefile('index.hhk',$templ-> fetch('index.hhk.tpl')); 1870 phpDocumentor_out("NOTE: to create the documentation.chm file, you must now run Microsoft Help Workshop on phpdoc.hhp\n" ); 1871 phpDocumentor_out("To get the free Microsoft Help Workshop, browse to: http://go.microsoft.com/fwlink/?LinkId=14188\n" ); 1872 flush(); 1873 } 1874 } 1875 1876 /** 1877 * @access private 1878 * @global string name of the package to set as the first package 1879 */ 1880 function CHMdefault_pindexcmp($a, $b) 1881 { 1882 global $phpDocumentor_DefaultPackageName; 1883 if ($a['title'] == $phpDocumentor_DefaultPackageName) return -1; 1884 if ($b['title'] == $phpDocumentor_DefaultPackageName) return 1; 1885 return strnatcasecmp($a['title'],$b['title']); 1886 } 1887 1888 /** @access private */ 1889 function CHMdefault_lettersort($a, $b) 1890 { 1891 return strnatcasecmp($a['letter'],$b['letter']); 1892 } 1893 1894 /** @access private */ 1895 function CHMdefault_outputfilter($src, & $smarty) 1896 { 1897 return str_replace('{$subdir}',$smarty-> _tpl_vars['subdir'],$src); 1898 } 1899 ?>
65 */ 66 var $sort_page_contents_by_type = true; 67 /** @var string */ 68 var $outputformat = 'HTML'; 69 /** @var string */ 70 var $name = 'frames'; 71 /** 72 * indexes of elements by package that need to be generated 73 * @var array 74 */ 75 var $leftindex = array('classes' => true, 'pages' => true, 'functions' => true, 'defines' => false, 'globals' => false); 76 77 /** 78 * output directory for the current procedural page being processed 79 * @var string 80 */ 81 var $page_dir; 82 83 /** 84 * target directory passed on the command-line. 85 * {@link $targetDir} is malleable, always adding package/ and package/subpackage/ subdirectories onto it. 86 * @var string 87 */ 88 var $base_dir; 89 90 /** 91 * output directory for the current class being processed 92 * @var string 93 */ 94 var $class_dir; 95 96 /** 97 * array of converted package page names. 98 * Used to link to the package page in the left index 99 * @var array Format: array(package => 1) 100 */ 101 var $package_pages = array(); 102 103 /** 104 * controls formatting of parser informative output 105 * 106 * Converter prints: 107 * "Converting /path/to/file.php... Procedural Page Elements... Classes..." 108 * Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there 109 * is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that 110 * and is purely cosmetic 111 * @var boolean 112 */ 113 var $juststarted = false; 114 115 /** 116 * contains all of the template procedural page element loop data needed for the current template 117 * @var array 118 */ 119 var $current; 120 121 /** 122 * contains all of the template class element loop data needed for the current template 123 * @var array 124 */ 125 var $currentclass; 126 var $wrote = false; 127 var $ric_set = array(); 128 129 /** 130 * sets {@link $base_dir} to $targetDir 131 * @see Converter() 132 */ 133 function HTMLframesConverter(& $allp, & $packp, & $classes, & $procpages, $po, $pp, $qm, $targetDir, $templateDir, $title) 134 { 135 Converter::Converter($allp, $packp, $classes, $procpages,$po, $pp, $qm, $targetDir, $templateDir, $title); 136 $this-> base_dir = $targetDir; 137 }
138 139 /** 140 * @deprecated in favor of PHP 4.3.0+ tokenizer-based source highlighting 141 */ 142 function unmangle($sourcecode) 143 { 144 $sourcecode = str_replace('<code>' ,'<pre>' ,$sourcecode); 145 $sourcecode = str_replace('</code>' ,'</pre>' ,$sourcecode); 146 $sourcecode = str_replace('<br />' ,"\n" ,$sourcecode); 147 $sourcecode = str_replace(' ' ,' ',$sourcecode); 148 $sourcecode = str_replace('<' ,'<' ,$sourcecode); 149 $sourcecode = str_replace('>' ,'>' ,$sourcecode); 150 $sourcecode = str_replace('&' ,'&' ,$sourcecode); 151 return $sourcecode; 152 } 153 154 /** 155 * @param string full path to the source file 156 * @param string fully highlighted source code 157 */ 158 function writeSource($path, $value) 159 { 160 $templ = & $this-> newSmarty(); 161 $pathinfo = $this-> proceduralpages-> getPathInfo($path, $this); 162 $templ-> assign('source',$value); 163 $templ-> assign('package',$pathinfo['package']); 164 $templ-> assign('subpackage',$pathinfo['subpackage']); 165 $templ-> assign('name',$pathinfo['name']); 166 $templ-> assign('source_loc',$pathinfo['source_loc']); 167 $templ-> assign('docs',$pathinfo['docs']); 168 $templ-> assign("subdir" ,'../'); 169 $templ-> register_outputfilter('HTMLframes_outputfilter'); 170 $this-> setTargetDir($this-> getFileSourcePath($this-> base_dir)); 171 phpDocumentor_out("\n" ); 172 $this-> setSourcePaths($path); 173 $this-> writefile($this-> getFileSourceName($path).'.html',$templ> fetch('filesource.tpl')); 174 } 175 176 function writeExample($title, $path, $source) 177 { 178 $templ = & $this-> newSmarty(); 179 $templ-> assign('source',$source); 180 if (empty($title)) 181 { 182 $title = 'example'; 183 addWarning(PDERROR_EMPTY_EXAMPLE_TITLE, $path, $title); 184 } 185 $templ-> assign('title',$title); 186 $templ-> assign('file',$path); 187 $templ-> assign("subdir" ,'../'); 188 $templ-> register_outputfilter('HTMLframes_outputfilter'); 189 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . '__examplesource'); 190 phpDocumentor_out("\n" ); 191 $this-> writefile('exsource_'.$path.'.html',$templ-> fetch('examplesource.tpl')); 192 } 193 194 function getExampleLink($path, $title) 195 { 196 return $this-> returnLink('{$subdir}__examplesource' . PATH_DELIMITER . 'exsource_'.$path.'.html',$title); 197 } 198 199 function getSourceLink($path) 200 { 201 return $this-> returnLink('{$subdir}__filesource/' . 202 $this-> getFileSourceName($path).'.html','Source Code for this file'); 203 } 204 205 /** 206 * Retrieve a Converter-specific anchor to a segment of a source code file 207 * parsed via a {@tutorial tags.filesource.pkg} tag. 208 * @param string full path to source file 209 * @param string name of anchor 210 * @param string link text, if this is a link 211 * @param boolean returns either a link or a destination based on this 212 * parameter 213 * @return string link to an anchor, or the anchor 214 */ 215 function getSourceAnchor($sourcefile,$anchor,$text = '',$link = false)
216 { 217 if ($link) { 218 return $this-> returnLink('{$subdir}__filesource/' . 219 $this-> getFileSourceName($sourcefile) . '.html#a' . $anchor, $text); 220 } else { 221 return '<a name="a' .$anchor.'"></a>' ; 222 } 223 } 224 225 /** 226 * Return a line of highlighted source code with formatted line number 227 * 228 * If the $path is a full path, then an anchor to the line number will be 229 * added as well 230 * @param integer line number 231 * @param string highlighted source code line 232 * @param false|stringfull path to @filesource file this line is a part of, 233 * if this is a single line from a complete file. 234 * @return string formatted source code line with line number 235 */ 236 function sourceLine($linenumber, $line, $path = false) 237 { 238 $extra = ''; 239 if (strlen(str_replace("\n" , '', $line)) == 0) { 240 $extra = ' ' ; 241 } 242 if ($path) 243 { 244 return '<li><div class="src-line">' . $this> getSourceAnchor($path, $linenumber) . 245 str_replace("\n" ,'',$line) . $extra . 246 "</div></li>\n" ; 247 } else 248 { 249 return '<li><div class="src-line">' . str_replace("\n" ,'',$line) . 250 " $extra</div></li>\n " ; 251 } 252 } 253 254 /** 255 * Used to convert the <<code>> tag in a docblock 256 * @param string 257 * @param boolean 258 * @return string 259 */ 260 function ProgramExample($example, $tutorial = false, $inlinesourceparse = null/*false*/, 261 $class = null/*false*/, $linenum = null/*false*/, $filesourcepath = null/*false*/) 262 { 263 return '<div class="src-code"><ol>' . parent::ProgramExample($example, $tutorial, $inlinesourceparse, $class, $linenum, $filesourcepath) 264 .'</ol></div>' ; 265 } 266 267 /** 268 * @param string 269 */ 270 function TutorialExample($example) 271 { 272 $trans = $this-> template_options['desctranslate']; 273 $this-> template_options['desctranslate'] = array(); 274 $example = '<ol>' . parent::TutorialExample($example) 275 .'</ol>' ; 276 $this-> template_options['desctranslate'] = $trans; 277 if (!isset($this-> template_options['desctranslate'])) return $example; 278 if (!isset($this-> template_options['desctranslate']['code'])) return $example; 279 $example = $this-> template_options['desctranslate']['code'] . $example; 280 if (!isset($this-> template_options['desctranslate']['/code'])) return $example; 281 return $example . $this-> template_options['desctranslate']['/code']; 282 } 283 284 function getCurrentPageLink() 285 { 286 return $this-> curname . '.html'; 287 } 288 289 /** 290 * Uses htmlspecialchars() on the input 291 */
292 function postProcess($text) 293 { 294 if ($this-> highlightingSource) { 295 return str_replace(array(' ',"\t" ), array(' ' , ' ' ), 296 htmlspecialchars($text)); 297 } 298 return htmlspecialchars($text); 299 } 300 301 /** 302 * Use the template tutorial_toc.tpl to generate a table of contents for HTML 303 * @return string table of contents formatted for use in the current output format 304 * @param array format: array(array('tagname' => section, 'link' => returnsee link, 'id' => anchor name, 'title' => from title tag),...) 305 */ 306 function formatTutorialTOC($toc) 307 { 308 $template = & $this-> newSmarty(); 309 $template-> assign('toc',$toc); 310 return $template-> fetch('tutorial_toc.tpl'); 311 } 312 313 function & SmartyInit(& $templ) 314 { 315 if (!isset($this-> package_index)) 316 foreach($this-> all_packages as $key => $val) 317 { 318 if (isset($this-> pkg_elements[$key])) 319 { 320 if (!isset($start)) $start = $key; 321 $this-> package_index[] = array('link' => " li_$key.html" , 'title' => $key); 322 } 323 } 324 $templ-> assign("packageindex" ,$this-> package_index); 325 $templ-> assign("subdir" ,''); 326 return $templ; 327 } 328 329 /** 330 * Writes out the template file of {@link $class_data} and unsets the template to save memory 331 * @see registerCurrentClass() 332 * @see parent::endClass() 333 */ 334 function endClass() 335 { 336 $a = '../'; 337 if (!empty($this-> subpackage)) $a .= '../'; 338 if ($this-> juststarted) 339 { 340 $this-> juststarted = false; 341 phpDocumentor_out("\n" ); 342 flush(); 343 } 344 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> class_dir); 345 $this-> class_data-> assign("subdir" ,$a); 346 $this-> class_data-> register_outputfilter('HTMLframes_outputfilter'); 347 $this-> writefile($this-> class . '.html',$this-> class_data> fetch('class.tpl')); 348 unset($this-> class_data); 349 } 350 351 /** 352 * Writes out the template file of {@link $page_data} and unsets the template to save memory 353 * @see registerCurrent() 354 * @see parent::endPage() 355 */ 356 function endPage() 357 { 358 $this-> package = $this-> curpage-> package; 359 $this-> subpackage = $this-> curpage-> subpackage; 360 $a = '../'; 361 if (!empty($this-> subpackage)) $a .= '../'; 362 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> page_dir); 363 $this-> page_data-> assign("package" ,$this-> package); 364 $this-> page_data-> assign("subdir" ,$a); 365 $this-> page_data-> register_outputfilter('HTMLframes_outputfilter'); 366 $this-> writefile($this-> page . '.html',$this-> page_data-> fetch('page.tpl'));
367 unset($this-> page_data); 368 } 369 370 /** 371 * @param string 372 * @param string 373 * @return string <a href="'.$link.'">'.$text.'</a> 374 */ 375 function returnLink($link,$text) 376 { 377 return '<a href="' .$link.'">' .$text.'</a>' ; 378 } 379 380 function makeLeft() 381 { 382 foreach($this-> page_elements as $package => $o1) 383 { 384 foreach($o1 as $subpackage => $links) 385 { 386 for($i=0;$i< count($links);$i++) 387 { 388 $left[$package][$subpackage]['files'][] = 389 array("link" => $this-> getId($links[$i]), "title" => $links[$i]-> name); 390 } 391 } 392 } 393 $interfaces = $classes = false; 394 foreach($this-> class_elements as $package => $o1) 395 { 396 foreach($o1 as $subpackage => $links) 397 { 398 for($i=0;$i< count($links);$i++) 399 { 400 $class = $this-> classes-> getClassByPackage($links[$i]-> name, $links[$i]-> package); 401 $isinterface = $isclass = false; 402 if ($class-> isInterface()) { 403 $isinterface = true; 404 $interfaces = true; 405 } else { 406 $isclass = true; 407 $classes = true; 408 } 409 if ($class && isset( $class-> docblock) && $class> docblock-> hasaccess) { 410 $left[$package][$subpackage]['classes'][] = 411 array("link" => $this-> getId($links[$i]), 412 "title" => $links[$i]-> name, 413 'is_interface' => $isinterface, 414 'is_class' => $isclass, 415 "access" => $class-> docblock> tags['access'][0]-> value, 416 "abstract" => isset ( $class-> docblock> tags['abstract'][0])); 417 } else { 418 $left[$package][$subpackage]['classes'][] = 419 array("link" => $this-> getId($links[$i]), 420 "title" => $links[$i]-> name, 421 'is_interface' => $isinterface, 422 'is_class' => $isclass, 423 "access" => 'public', 424 "abstract" => isset ( $class-> docblock> tags['abstract'][0])); 425 } 426 } 427 } 428 } 429 foreach($this-> function_elements as $package => $o1) 430 { 431 foreach($o1 as $subpackage => $links) 432 { 433 for($i=0;$i< count($links);$i++) 434 { 435 $left[$package][$subpackage]['functions'][] = 436 array("link" => $this-> getId($links[$i]), "title" => $links[$i]-> name); 437 } 438 } 439 }
440 $ret = array(); 441 foreach($left as $package => $r) 442 { 443 $pd = 'blank'; 444 if (isset($this-> package_pages[$package])) $pd = $package.'/package_'.$package.'.html'; 445 if (!isset($r[''])) 446 { 447 $pt = false; 448 $ptnoa = false; 449 $ptt = $package; 450 if ($t = $this-> hasTutorial('pkg',$package,$package,'')) 451 { 452 $pt = $t-> getLink($this); 453 $ptnoa = $this-> getId($t-> getLink($this,true)); 454 $ptt = $t-> getTitle($this); 455 } 456 $tutes = array(); 457 foreach($this-> tutorial_tree as $root => $tr) 458 { 459 if ($tr['tutorial']-> package == $package && $tr['tutorial']> subpackage == '') { 460 $tutes[$tr['tutorial']-> tutorial_type][] = 461 $this-> getTutorialTree($tr['tutorial']); 462 } 463 } 464 if (isset($this-> childless_tutorials[$package][$subpackage])) 465 { 466 foreach($this-> childless_tutorials[$package][$subpackage] as $ext => $other) 467 { 468 foreach($other as $tutorial) 469 { 470 $tutes[$tutorial-> tutorial_type][] = $this> getTutorialTree($tutorial); 471 } 472 } 473 } 474 $ret[$package][] = 475 array( 476 'package' => $package, 477 'subpackage' => '', 478 'packagedoc' => $pd, 479 'packagetutorial' => $pt, 480 'packagetutorialnoa' => $ptnoa, 481 'packagetutorialtitle' => $ptt, 482 'files' => array(), 483 'functions' => array(), 484 'classes' => array(), 485 'tutorials' => $tutes, 486 ); 487 } 488 foreach($r as $subpackage => $info) 489 { 490 $my = array(); 491 $my['package'] = $package; 492 if (isset($this-> package_pages[$package])) 493 $my['packagedoc'] = $pd; 494 else 495 $my['packagedoc'] = 'blank'; 496 $my['subpackage'] = $subpackage; 497 if (empty($subpackage)) 498 { 499 if ($t = $this-> hasTutorial('pkg',$package,$package,$subpackage)) 500 { 501 $my['packagetutorial'] = $t-> getLink($this); 502 $my['packagetutorialnoa'] = $this-> getId($t-> getLink($this,true)); 503 $my['packagetutorialtitle'] = $t-> getTitle($this); 504 } else 505 { 506 $my['packagetutorial'] = '<a href="blank.html">No Package-Level Tutorial</a>' ; 507 $my['packagetutorialnoa'] = 'blank.html'; 508 $my['packagetutorialtitle'] = $package; 509 } 510 } else 511 { 512 if ($t = $this-> hasTutorial('pkg',$subpackage,$package,$subpackage)) 513 { 514 $my['subpackagetutorial'] = $this-> returnSee($this-
> getTutorialLink($t)); 515 $my['subpackagetutorialnoa'] = $this-> getId($t> getLink($this,true)); 516 $my['subpackagetutorialtitle'] = $t-> getTitle($this); 517 } else 518 { 519 $my['subpackagetutorial'] = false; 520 $my['subpackagetutorialnoa'] = false; 521 $my['subpackagetutorialtitle'] = $subpackage; 522 } 523 } 524 $tutes = array(); 525 foreach($this-> tutorial_tree as $root => $tr) 526 { 527 if ($tr['tutorial']-> package == $package && $tr['tutorial']> subpackage == $subpackage) 528 { 529 $tutes[$tr['tutorial']-> tutorial_type][] = $this> getTutorialTree($tr['tutorial']); 530 } 531 } 532 $my['tutorials'] = $tutes; 533 $my['files'] = $my['classes'] = $my['functions'] = array(); 534 if (isset($info['files'])) 535 $my['files'] = $info['files']; 536 if (isset($info['classes'])) 537 $my['classes'] = $info['classes']; 538 $my['hasclasses'] = $classes; 539 $my['hasinterfaces'] = $interfaces; 540 if (isset($info['functions'])) 541 $my['functions'] = $info['functions']; 542 $ret[$package][] = $my; 543 } 544 } 545 return $ret; 546 } 547 548 function getTutorialTree($tutorial,$k = false) 549 { 550 $ret = ''; 551 if (is_object($tutorial)) $tree = parent::getTutorialTree($tutorial); else $tree = $tutorial; 552 // debug($this->vardump_tree($tree));exit; 553 if (!$tree) 554 { 555 $template = & $this-> newSmarty(); 556 $template-> assign('subtree',false); 557 $template-> assign('name',str_replace('.','',$tutorial-> name)); 558 $template-> assign('parent',false); 559 $template-> assign('haskids',false); 560 $template-> assign('kids',''); 561 $link = new tutorialLink; 562 $t = $tutorial; 563 $link-> addLink('',$t-> path,$t-> name,$t-> package,$t-> subpackage,$t> getTitle($this)); 564 $main = array('link' => $this-> getId($link), 'title' => $link-> title); 565 $template-> assign('main',$main); 566 return $template-> fetch('tutorial_tree.tpl'); 567 } 568 if (isset($tree['kids'])) 569 { 570 foreach($tree['kids'] as $subtree) 571 { 572 $ret .= $this-> getTutorialTree($subtree, true); 573 } 574 } 575 $template = & $this-> newSmarty(); 576 $template-> assign('subtree',$k); 577 $template-> assign('name',str_replace('.','',$tree['tutorial']-> name)); 578 $template-> assign('parent',($k ? str_replace('.','',$tree['tutorial']-> parent> name) : false)); 579 $template-> assign('haskids',strlen($ret)); 580 $template-> assign('kids',$ret); 581 $link = new tutorialLink; 582 $t = $tree['tutorial']; 583 $link-> addLink('',$t-> path,$t-> name,$t-> package,$t-> subpackage,$t> getTitle($this)); 584 $main = array('link' => $this-> getId($link), 'title' => $link-> title); 585 $template-> assign('main',$main); 586 $ret = $template-> fetch('tutorial_tree.tpl');
587 return $ret; 588 } 589 590 /** 591 * HTMLdefaultConverter chooses to format both package indexes and the complete index here 592 * 593 * This function formats output for the elementindex.html and pkgelementindex.html template files. It then 594 * writes them to the target directory 595 * @see generateElementIndex(), generatePkgElementIndex() 596 */ 597 function formatPkgIndex() 598 { 599 list($package_indexes,$packages,$mletters) = $this-> generatePkgElementIndexes(); 600 for($i=0;$i< count($package_indexes);$i++) 601 { 602 $template = & $this-> newSmarty(); 603 $this-> package = $package_indexes[$i]['package']; 604 $this-> subpackage = ''; 605 $template-> assign("index" ,$package_indexes[$i]['pindex']); 606 $template-> assign("package" ,$package_indexes[$i]['package']); 607 $template> assign("letters" ,$mletters[$package_indexes[$i]['package']]); 608 $template-> register_outputfilter('HTMLframes_outputfilter'); 609 $this-> setTargetDir($this-> base_dir); 610 $this> writefile('elementindex_'.$package_indexes[$i]['package'].'.html',$template> fetch('pkgelementindex.tpl')); 611 } 612 phpDocumentor_out("\n" ); 613 flush(); 614 } 615 616 /** 617 * HTMLdefaultConverter uses this function to format template index.html and packages.html 618 * 619 * This function generates the package list from {@link $all_packages}, eliminating any 620 * packages that don't have any entries in their package index (no files at all, due to @ignore 621 * or other factors). Then it uses the default package name as the first package index to display. 622 * It sets the right pane to be either a blank file with instructions on making packagelevel docs, 623 * or the package-level docs for the default package. 624 * @global string Used to set the starting package to display 625 */ 626 function formatIndex() 627 { 628 global $phpDocumentor_DefaultPackageName; 629 list($elindex,$mletters) = $this-> generateElementIndex(); 630 $template = & $this-> newSmarty(); 631 $template-> assign("index" ,$elindex); 632 $template-> assign("letters" ,$mletters); 633 $template-> register_outputfilter('HTMLframes_outputfilter'); 634 phpDocumentor_out("\n" ); 635 flush(); 636 $this-> setTargetDir($this-> base_dir); 637 $this-> writefile('elementindex.html',$template-> fetch('elementindex.tpl')); 638 usort($this-> package_index,"HTMLframes_pindexcmp" ); 639 $index = & $this-> newSmarty(); 640 foreach($this-> all_packages as $key => $val) 641 { 642 if (isset($this-> pkg_elements[$key])) 643 { 644 if (!isset($start)) $start = $key; 645 if (!isset($this-> package_pages[$key])) $this-> writeNewPPage($key); 646 } 647 } 648 // Created index.html 649 if (isset($this-> pkg_elements[$phpDocumentor_DefaultPackageName])) $start = $phpDocumentor_DefaultPackageName; 650 $this-> package = $start; 651 $this-> subpackage = ''; 652 $index-> assign("package_count" ,count($this-> pkg_elements)); 653 if (count($this-> ric_set)) 654 $index-> assign("package_count" ,2); 655 $index-> assign("date" ,date("r" ,time())); 656 $index-> assign("title" ,$this-> title); 657 $index-> assign("start" ," li_$start.html" ); 658 $index-> register_outputfilter('HTMLframes_outputfilter');
659 if (isset($this-> tutorials[$start]['']['pkg'][$start . '.pkg'])) 660 { 661 $index-> assign("blank" ,$start.'/tutorial_'.$start.'.pkg'); 662 } elseif (isset($this-> package_pages[$start])) 663 { 664 $index-> assign("blank" ,$start.'/package_'.$start); 665 } 666 else 667 { 668 $index-> assign("blank" ,"blank" ); 669 $blank = & $this-> newSmarty(); 670 $blank-> assign('package',$this-> package); 671 $this-> setTargetDir($this-> base_dir); 672 $this-> writefile("blank.html" ,$blank-> fetch('blank.tpl')); 673 } 674 phpDocumentor_out("\n" ); 675 flush(); 676 $this-> setTargetDir($this-> base_dir); 677 $this-> writefile("index.html" ,$index-> fetch('index.tpl')); 678 679 // Create package index 680 $package = & $this-> newSmarty(); 681 $package-> assign('ric',array()); 682 if (isset($this-> ric_set)) 683 { 684 foreach($this-> ric_set as $name => $u) 685 { 686 $package-> append('ric',array('file' => 'ric_'.$name.'.html','name' => $name)); 687 } 688 } 689 $package-> assign("packages" ,$this-> package_index); 690 $package-> register_outputfilter('HTMLframes_outputfilter'); 691 $this-> writefile("packages.html" ,$package-> fetch('top_frame.tpl')); 692 unset($index); 693 } 694 695 function writeNewPPage($key) 696 { 697 return; 698 $template = & $this-> newSmarty(); 699 $this-> package = $key; 700 $this-> subpackage = ''; 701 $template-> assign("date" ,date("r" ,time())); 702 $template-> assign("title" ,$this-> title); 703 $template-> assign("package" ,$key); 704 $template-> register_outputfilter('HTMLframes_outputfilter'); 705 phpDocumentor_out("\n" ); 706 flush(); 707 $this-> setTargetDir($this-> base_dir); 708 709 $this-> writefile(" li_$key.html" ,$template-> fetch('index.tpl')); 710 unset($template); 711 } 712 713 /** 714 * Generate indexes for li_package.html and classtree output files 715 * 716 * This function generates the li_package.html files from the template file left.html. It does this by 717 * iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve 718 * the pre-sorted {@link abstractLink} descendants needed for index generation. Conversion of these links to 719 * text is done by {@link returnSee()}. The {@link $local} parameter is set to false to ensure that paths are correct. 720 * 721 * Then it uses {@link generateFormattedClassTrees()} to create class trees from the template file classtrees.html. Output 722 * filename is classtrees_packagename.html. This function also unsets {@link $elements} and {@link $pkg_elements} to free 723 * up the considerable memory these two class vars use 724 * @see $page_elements, $class_elements, $function_elements 725 */ 726 function formatLeftIndex() 727 { 728 phpDocumentor_out("\n" ); 729 flush(); 730 $this-> setTargetDir($this-> base_dir); 731 if (0)//!isset($this->left))
732 { 733 debug("Nothing parsed, check the command-line" ); 734 die(); 735 } 736 $x = $this-> makeLeft(); 737 foreach($this-> all_packages as $package => $rest) 738 { 739 if (!isset($this-> pkg_elements[$package])) continue; 740 $template = & $this-> newSmarty(); 741 $template-> assign("info" ,$x[$package]); 742 $template-> assign('package',$package); 743 $template-> assign("hastutorials" ,isset($this-> tutorials[$package])); 744 $template-> assign('hastodos',count($this-> todoList)); 745 $template-> assign('todolink','todolist.html'); 746 $template-> assign("classtreepage" ," classtrees_$package" ); 747 $template-> assign("elementindex" ," elementindex_$package" ); 748 $template-> register_outputfilter('HTMLframes_outputfilter'); 749 if (isset($this-> package_pages[$package])) 750 { 751 $template-> assign("packagedoc" ,$package.'/package_' . $package . '.html'); 752 } else 753 { 754 $template-> assign("packagedoc" ,false); 755 } 756 $this-> writefile(" li_$package.html" ,$template> fetch('left_frame.tpl')); 757 758 // Create class tree page 759 $template = & $this-> newSmarty(); 760 $template-> assign("classtrees" ,$this> generateFormattedClassTrees($package)); 761 $template-> assign("interfaces" ,$this> generateFormattedInterfaceTrees($package)); 762 $template-> assign("package" ,$package); 763 $template-> register_outputfilter('HTMLframes_outputfilter'); 764 $this-> writefile(" classtrees_$package.html" ,$template> fetch('classtrees.tpl')); 765 phpDocumentor_out("\n" ); 766 flush(); 767 } 768 // free up considerable memory 769 unset($this-> elements); 770 unset($this-> pkg_elements); 771 } 772 773 /** 774 * This function takes an {@link abstractLink} descendant and returns an html link 775 * 776 * @param abstractLink a descendant of abstractlink should be passed, and never text 777 * @param string text to display in the link 778 * @param boolean this parameter is not used, and is deprecated 779 * @param boolean determines whether the returned text is enclosed in an <a> tag 780 */ 781 function returnSee(& $element, $eltext = false, $with_a = true) 782 { 783 if (!is_object($element) || !$element) return false; 784 if (!$with_a) return $this-> getId($element, false); 785 if (!$eltext) 786 { 787 $eltext = ''; 788 switch($element-> type) 789 { 790 case 'tutorial' : 791 $eltext = strip_tags($element-> title); 792 break; 793 case 'method' : 794 case 'var' : 795 case 'const' : 796 $eltext .= $element-> class.'::'; 797 case 'page' : 798 case 'define' : 799 case 'class' : 800 case 'function' : 801 case 'global' : 802 default : 803 $eltext .= $element-> name; 804 if ($element-> type == 'function' || $element-> type == 'method') $eltext .= '()'; 805 break;
806 } 807 } 808 return '<a href="' .$this-> getId($element).'">' .$eltext.'</a>' 809 } 810 811 function getId($element, $fullpath = true) 812 { 813 if (phpDocumentor_get_class($element) == 'parserdata') 814 { 815 $element = $this-> addLink($element-> parent); 816 $elp = $element-> parent; 817 } elseif (is_a($element, 'parserbase')) 818 { 819 $elp = $element; 820 $element = $this-> addLink($element); 821 } 822 $c = ''; 823 if (!empty($element-> subpackage)) 824 { 825 $c = '/'.$element-> subpackage; 826 } 827 $b = '{$subdir}'; 828 switch ($element-> type) 829 { 830 case 'page' : 831 if ($fullpath) 832 return $b.$element-> package.$c.'/'.$element-> fileAlias.'.html'; 833 return 'top'; 834 break; 835 case 'define' : 836 case 'global' : 837 case 'function' : 838 if ($fullpath) 839 return $b.$element-> package.$c.'/'.$element-> fileAlias.'.html#'.$element> type.$element-> name; 840 return $element-> type.$element-> name; 841 break; 842 case 'class' : 843 if ($fullpath) 844 return $b.$element-> package.$c.'/'.$element-> name.'.html'; 845 return 'top'; 846 break; 847 case 'method' : 848 case 'var' : 849 case 'const' : 850 if ($fullpath) 851 return $b.$element-> package.$c.'/'.$element-> class.'.html#'.$element> type.$element-> name; 852 return $element-> type.$element-> name; 853 break; 854 case 'tutorial' : 855 $d = ''; 856 if ($element-> section) 857 { 858 $d = '#'.$element-> section; 859 } 860 return $b.$element-> package.$c.'/tutorial_'.$element-> name.'.html'.$d; 861 } 862 } 863 864 /** 865 * Convert README/INSTALL/CHANGELOG file contents to output format 866 * @param README|INSTALL|CHANGELOG 867 * @param string contents of the file 868 */ 869 function Convert_RIC($name, $contents) 870 { 871 $template = & $this-> newSmarty(); 872 $template-> assign('contents',$contents); 873 $template-> assign('name',$name); 874 $this-> setTargetDir($this-> base_dir); 875 $this-> writefile('ric_'.$name . '.html',$template-> fetch('ric.tpl')); 876 $this-> ric_set[$name] = true; 877 } 878 879 function ConvertTodoList() 880 { 881 $todolist = array(); 882 foreach($this-> todoList as $package => $alltodos) 883 {
884 foreach($alltodos as $todos) 885 { 886 $converted = array(); 887 $converted['link'] = $this-> returnSee($todos[0]); 888 if (!is_array($todos[1])) 889 { 890 $converted['todos'][] = $todos[1]-> Convert($this); 891 } else 892 { 893 foreach($todos[1] as $todo) 894 { 895 $converted['todos'][] = $todo-> Convert($this); 896 } 897 } 898 $todolist[$package][] = $converted; 899 } 900 } 901 $templ = & $this-> newSmarty(); 902 $templ-> assign('todos',$todolist); 903 $templ-> register_outputfilter('HTMLframes_outputfilter'); 904 $this-> setTargetDir($this-> base_dir); 905 $this-> writefile('todolist.html',$templ-> fetch('todolist.tpl')); 906 } 907 908 /** 909 * Create errors.html template file output 910 * 911 * This method takes all parsing errors and warnings and spits them out ordered by file and line number. 912 * @global ErrorTracker We'll be using it's output facility 913 */ 914 function ConvertErrorLog() 915 { 916 global $phpDocumentor_errors; 917 $allfiles = array(); 918 $files = array(); 919 $warnings = $phpDocumentor_errors-> returnWarnings(); 920 $errors = $phpDocumentor_errors-> returnErrors(); 921 $template = & $this-> newSmarty(); 922 foreach($warnings as $warning) 923 { 924 $file = '##none'; 925 $linenum = 'Warning'; 926 if ($warning-> file) 927 { 928 $file = $warning-> file; 929 $allfiles[$file] = 1; 930 $linenum .= ' on line '.$warning-> linenum; 931 } 932 $files[$file]['warnings'][] = array('name' => $linenum, 'listing' => $warning> data); 933 } 934 foreach($errors as $error) 935 { 936 $file = '##none'; 937 $linenum = 'Error'; 938 if ($error-> file) 939 { 940 $file = $error-> file; 941 $allfiles[$file] = 1; 942 $linenum .= ' on line '.$error-> linenum; 943 } 944 $files[$file]['errors'][] = array('name' => $linenum, 'listing' => $error> data); 945 } 946 $i=1; 947 $af = array(); 948 foreach($allfiles as $file => $num) 949 { 950 $af[$i++] = $file; 951 } 952 $allfiles = $af; 953 usort($allfiles,'strnatcasecmp'); 954 $allfiles[0] = "Post-parsing" ; 955 foreach($allfiles as $i => $a) 956 { 957 $allfiles[$i] = array('file' => $a); 958 } 959 $out = array(); 960 foreach($files as $file => $data)
961 { 962 if ($file == '##none') $file = 'Post-parsing'; 963 $out[$file] = $data; 964 } 965 $template-> assign("files" ,$allfiles); 966 $template-> assign("all" ,$out); 967 $template-> assign("title" ,"phpDocumentor Parser Errors and Warnings" ); 968 $this-> setTargetDir($this-> base_dir); 969 $this-> writefile("errors.html" ,$template-> fetch('errors.tpl')); 970 unset($template); 971 phpDocumentor_out("\n\nTo view errors and warnings, look at " .$this> base_dir. PATH_DELIMITER . "errors.html\n" ); 972 flush(); 973 } 974 975 function getTutorialId($package,$subpackage,$tutorial,$id) 976 { 977 return $id; 978 } 979 980 function getCData($value) 981 { 982 return '<pre>' .htmlentities($value).'</pre>' ; 983 } 984 985 /** 986 * Converts package page and sets its package as used in {@link $package_pages} 987 * @param parserPackagePage 988 */ 989 function convertPackagepage(& $element) 990 { 991 phpDocumentor_out("\n" ); 992 flush(); 993 $this-> package = $element-> package; 994 $this-> subpackage = ''; 995 $contents = $element-> Convert($this); 996 $this-> package_pages[$element-> package] = str_replace('{$subdir}','../',$contents); 997 phpDocumentor_out("\n" ); 998 flush(); 999 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $element-> package); 1000 $this-> writeFile('package_'.$element> package.'.html',str_replace('{$subdir}','../',$contents)); 1001 } 1002 1003 /** 1004 * @param parserTutorial 1005 */ 1006 function convertTutorial(& $element) 1007 { 1008 phpDocumentor_out("\n" ); 1009 flush(); 1010 $template = & parent::convertTutorial($element); 1011 $a = '../'; 1012 if ($element-> subpackage) $a .= '../'; 1013 $template-> assign('subdir',$a); 1014 $template-> register_outputfilter('HTMLframes_outputfilter'); 1015 $contents = $template-> fetch('tutorial.tpl'); 1016 $a = ''; 1017 if ($element-> subpackage) $a = PATH_DELIMITER . $element-> subpackage; 1018 phpDocumentor_out("\n" ); 1019 flush(); 1020 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $element-> package . $a); 1021 $this-> writeFile('tutorial_'.$element-> name.'.html',$contents); 1022 } 1023 1024 /** 1025 * Converts class for template output 1026 * @see prepareDocBlock(), generateChildClassList(), generateFormattedClassTree(), getFormattedConflicts() 1027 * @see getFormattedInheritedMethods(), getFormattedInheritedVars() 1028 * @param parserClass 1029 */ 1030 function convertClass(& $element) 1031 { 1032 parent::convertClass($element); 1033 $this-> class_dir = $element-> docblock-> package; 1034 if (!empty($element-> docblock-> subpackage)) $this-> class_dir .= PATH_DELIMITER . $element-> docblock-> subpackage;
1035 $a = '../'; 1036 if ($element-> docblock-> subpackage != '') $a = " ../$a" ; 1037 1038 $this-> class_data-> assign('subdir',$a); 1039 $this-> class_data-> assign("title" ,"Docs For Class " . $element-> getName()); 1040 $this-> class_data-> assign("page" ,$element-> getName() . '.html'); 1041 } 1042 1043 /** 1044 * Converts class variables for template output 1045 * @see prepareDocBlock(), getFormattedConflicts() 1046 * @param parserDefine 1047 */ 1048 function convertVar(& $element) 1049 { 1050 parent::convertVar($element, array('var_dest' => $this-> getId($element,false))); 1051 } 1052 1053 /** 1054 * Converts class variables for template output 1055 * @see prepareDocBlock(), getFormattedConflicts() 1056 * @param parserDefine 1057 */ 1058 function convertConst(& $element) 1059 { 1060 parent::convertConst($element, array('const_dest' => $this> getId($element,false))); 1061 } 1062 1063 /** 1064 * Converts class methods for template output 1065 * @see prepareDocBlock(), getFormattedConflicts() 1066 * @param parserDefine 1067 */ 1068 function convertMethod(& $element) 1069 { 1070 parent::convertMethod($element, array('method_dest' => $this> getId($element,false))); 1071 } 1072 1073 /** 1074 * Converts function for template output 1075 * @see prepareDocBlock(), parserFunction::getFunctionCall(), getFormattedConflicts() 1076 * @param parserFunction 1077 */ 1078 function convertFunction(& $element) 1079 { 1080 $funcloc = $this-> getId($this-> addLink($element)); 1081 parent::convertFunction($element,array('function_dest' => $this> getId($element,false))); 1082 } 1083 1084 /** 1085 * Converts include elements for template output 1086 * @see prepareDocBlock() 1087 * @param parserInclude 1088 */ 1089 function convertInclude(& $element) 1090 { 1091 parent::convertInclude($element, array('include_file' => '_'.strtr($element> getValue(),array('"' => '', "'" => '','.' => '_')))); 1092 } 1093 1094 /** 1095 * Converts defines for template output 1096 * @see prepareDocBlock(), getFormattedConflicts() 1097 * @param parserDefine 1098 */ 1099 function convertDefine(& $element) 1100 { 1101 parent::convertDefine($element, array('define_link' => $this> getId($element,false))); 1102 } 1103 1104 /** 1105 * Converts global variables for template output 1106 * @param parserGlobal 1107 */ 1108 function convertGlobal(& $element)
1109 { 1110 parent::convertGlobal($element, array('global_link' => $this> getId($element,false))); 1111 } 1112 1113 /** 1114 * converts procedural pages for template output 1115 * @see prepareDocBlock(), getClassesOnPage() 1116 * @param parserData 1117 */ 1118 function convertPage(& $element) 1119 { 1120 parent::convertPage($element); 1121 $this-> juststarted = true; 1122 $this-> page_dir = $element-> parent-> package; 1123 if (!empty($element-> parent-> subpackage)) $this-> page_dir .= PATH_DELIMITER . $element-> parent-> subpackage; 1124 // registering stuff on the template 1125 $this-> page_data-> assign("page" ,$this-> getPageName($element) . '.html'); 1126 $this-> page_data-> assign("title" ,"Docs for page " .$element> parent-> getFile()); 1127 } 1128 1129 function getPageName(& $element) 1130 { 1131 if (phpDocumentor_get_class($element) == 'parserpage') return '_'.$element> getName(); 1132 return '_'.$element-> parent-> getName(); 1133 } 1134 1135 /** 1136 * returns an array containing the class inheritance tree from the root object to the class 1137 * 1138 * @param parserClass class variable 1139 * @return array Format: array(root,child,child,child,...,$class) 1140 * @uses parserClass::getParentClassTree() 1141 */ 1142 1143 function generateFormattedClassTree($class) 1144 { 1145 $tree = $class-> getParentClassTree($this); 1146 $out = ''; 1147 if (count($tree) - 1) 1148 { 1149 $result = array($class-> getName()); 1150 $parent = $tree[$class-> getName()]; 1151 $distance[] = ''; 1152 while ($parent) 1153 { 1154 $x = $parent; 1155 if (is_object($parent)) 1156 { 1157 $subpackage = $parent-> docblock-> subpackage; 1158 $package = $parent-> docblock-> package; 1159 $x = $parent; 1160 $x = $parent-> getLink($this); 1161 if (!$x) $x = $parent-> getName(); 1162 } 1163 $result[] = 1164 $x; 1165 $distance[] = 1166 "\n%s|\n" . 1167 "%s--" ; 1168 if (is_object($parent)) 1169 $parent = $tree[$parent-> getName()]; 1170 elseif (isset($tree[$parent])) 1171 $parent = $tree[$parent]; 1172 } 1173 $nbsp = ' '; 1174 for($i=count($result) - 1;$i>= 0;$i--) 1175 { 1176 $my_nbsp = ''; 1177 for($j=0;$j< count($result) - $i;$j++) $my_nbsp .= $nbsp; 1178 $distance[$i] = sprintf($distance[$i],$my_nbsp,$my_nbsp); 1179 } 1180 return array('classes'=> array_reverse($result),'distance'=> array_reverse($distance)); 1181 } else 1182 {
1183 return array('classes'=> $class-> getName(),'distance'=>array( '')); 1184 } 1185 } 1186 1187 /** @access private */ 1188 function sortVar($a, $b) 1189 { 1190 return strnatcasecmp($a-> getName(),$b-> getName()); 1191 } 1192 1193 /** @access private */ 1194 function sortMethod($a, $b) 1195 { 1196 if ($a-> isConstructor) return -1; 1197 if ($b-> isConstructor) return 1; 1198 return strnatcasecmp($a-> getName(),$b-> getName()); 1199 } 1200 1201 /** 1202 * returns a template-enabled array of class trees 1203 * 1204 * @param string $package package to generate a class tree for 1205 * @see $roots, HTMLConverter::getRootTree() 1206 */ 1207 function generateFormattedClassTrees($package) 1208 { 1209 if (!isset($this-> roots['normal'][$package]) && 1210 !isset($this-> roots['special'][$package])) { 1211 return array(); 1212 } 1213 $trees = array(); 1214 if (isset($this-> roots['normal'][$package])) { 1215 $roots = $this-> roots['normal'][$package]; 1216 for($i=0;$i< count($roots);$i++) 1217 { 1218 $root = $this-> classes-> getClassByPackage($roots[$i], $package); 1219 if ($root && $root-> isInterface()) { 1220 continue; 1221 } 1222 $trees[] = array('class' => $roots[$i],'class_tree' => "<ul>\n" .$this-> getRootTree($this> getSortedClassTreeFromClass($roots[$i],$package,''),$package)."</ul>\n" ); 1223 } 1224 } 1225 if (isset($this-> roots['special'][$package])) { 1226 $roots = $this-> roots['special'][$package]; 1227 foreach ($roots as $parent => $classes) { 1228 $thistree = ''; 1229 foreach ($classes as $classinfo) { 1230 $root = $this-> classes-> getClassByPackage($classinfo, $package); 1231 if ($root && $root-> isInterface()) { 1232 continue; 1233 } 1234 $thistree .= 1235 $this-> getRootTree( 1236 $this-> getSortedClassTreeFromClass( 1237 $classinfo, 1238 $package, 1239 ''), 1240 $package, 1241 true); 1242 } 1243 if (!$thistree) { 1244 continue; 1245 } 1246 $trees[] = array( 1247 'class' => $parent, 1248 'class_tree' => "<ul>\n" . $thistree . "</ul>\n" 1249 ); 1250 } 1251 } 1252 return $trees; 1253 } 1254 1255 /** 1256 * returns a template-enabled array of interface inheritance trees 1257 * 1258 * @param string $package package to generate a class tree for 1259 * @see $roots, HTMLConverter::getRootTree()
1260 */ 1261 function generateFormattedInterfaceTrees($package) 1262 { 1263 if (!isset($this-> roots['normal'][$package]) && 1264 !isset($this-> roots['special'][$package])) { 1265 return array(); 1266 } 1267 $trees = array(); 1268 if (isset($this-> roots['normal'][$package])) { 1269 $roots = $this-> roots['normal'][$package]; 1270 for($i=0;$i< count($roots);$i++) 1271 { 1272 $root = $this-> classes-> getClassByPackage($roots[$i], $package); 1273 if ($root && ! $root-> isInterface()) { 1274 continue; 1275 } 1276 $trees[] = array('class' => $roots[$i],'class_tree' => "<ul>\n" .$this-> getRootTree($this> getSortedClassTreeFromClass($roots[$i],$package,''),$package)."</ul>\n" ); 1277 } 1278 } 1279 if (isset($this-> roots['special'][$package])) { 1280 $roots = $this-> roots['special'][$package]; 1281 foreach ($roots as $parent => $classes) { 1282 $thistree = ''; 1283 foreach ($classes as $classinfo) { 1284 $root = $this-> classes-> getClassByPackage($classinfo, $package); 1285 if ($root && ! $root-> isInterface()) { 1286 continue; 1287 } 1288 $thistree .= 1289 $this-> getRootTree( 1290 $this-> getSortedClassTreeFromClass( 1291 $classinfo, 1292 $package, 1293 ''), 1294 $package, 1295 true); 1296 } 1297 if (!$thistree) { 1298 continue; 1299 } 1300 $trees[] = array( 1301 'class' => $parent, 1302 'class_tree' => "<ul>\n" . $thistree . "</ul>\n" 1303 ); 1304 } 1305 } 1306 return $trees; 1307 } 1308 1309 /** 1310 * return formatted class tree for the Class Trees page 1311 * 1312 * @param array $tree output from {@link getSortedClassTreeFromClass()} 1313 * @param string $package package 1314 * @param boolean $nounknownparent if true, an object's parent will not be checked 1315 * @see Classes::$definitechild, generateFormattedClassTrees() 1316 * @return string 1317 */ 1318 function getRootTree($tree, $package, $noparent = false) 1319 { 1320 if (!$tree) return ''; 1321 $my_tree = ''; 1322 $cur = '#root'; 1323 $lastcur = array(false); 1324 $kids = array(); 1325 $dopar = false; 1326 if (!$noparent && $tree[$cur]['parent']) 1327 { 1328 $dopar = true; 1329 if (!is_object($tree[$cur]['parent'])) 1330 { 1331 // debug("parent ".$tree[$cur]['parent']." not found"); 1332 $my_tree .= '<li>' . $tree[$cur]['parent'] .'<ul>' ; 1333 } 1334 else 1335 { 1336 // debug("parent ".$this-
>returnSee($tree[$cur]['parent'])." in other package"); 1337 $root = $this-> classes-> getClassByPackage($tree[$cur]['parent']-> name, 1338 $package); 1339 $my_tree .= '<li>' . $this-> returnSee($tree[$cur]['parent']); 1340 if ($tree[$cur]['parent']-> package != $package) $my_tree .= ' <b>(Different package)</b><ul>' ; 1341 } 1342 } 1343 do 1344 { 1345 // fancy_debug($cur,$lastcur,$kids); 1346 if (count($tree[$cur]['children'])) 1347 { 1348 // debug("$cur has children"); 1349 if (!isset($kids[$cur])) 1350 { 1351 // debug("set $cur kids"); 1352 $kids[$cur] = 1; 1353 $root = $this-> classes-> getClassByPackage( 1354 $tree[$cur]['link']-> name, 1355 $tree[$cur]['link']-> package); 1356 if ($implements = $root-> getImplements()) { 1357 $my_tree .= '<li>' .$this-> returnSee($tree[$cur]['link']) . 1358 ' (implements '; 1359 foreach ($implements as $i => $interface) { 1360 if ($i && $i != count($implements) - 1) $my_tree .= ', '; 1361 if ($link = $this-> getLink('object ' . $interface)) { 1362 $my_tree .= $this-> returnSee($link); 1363 } else { 1364 $my_tree .= $interface; 1365 } 1366 } 1367 $my_tree .= ')'; 1368 } else { 1369 $my_tree .= '<li>' .$this-> returnSee($tree[$cur]['link']); 1370 } 1371 $my_tree .= '<ul>' ."\n" ; 1372 } 1373 array_push($lastcur,$cur); 1374 list(,$cur) = each($tree[$cur]['children']); 1375 // var_dump('listed',$cur); 1376 if ($cur) 1377 { 1378 $cur = $cur['package'] . '#' . $cur['class']; 1379 // debug("set cur to child $cur"); 1380 // $my_tree .= '<li>'.$this->returnSee($tree[$cur]['link']); 1381 continue; 1382 } else 1383 { 1384 // debug("end of children for $cur"); 1385 $cur = array_pop($lastcur); 1386 $cur = array_pop($lastcur); 1387 $my_tree .= '</ul></li>' ."\n" ; 1388 if ($dopar && ( $cur == '#root' || !$cur)) $my_tree .= '</ul></li>' ; 1389 } 1390 } else 1391 { 1392 // debug("$cur has no children"); 1393 $my_tree .= '<li>' .$this> returnSee($tree[$cur]['link'])."</li>" ; 1394 if ($dopar && $cur == '#root') $my_tree .= '</ul></li>' ; 1395 $cur = array_pop($lastcur); 1396 } 1397 } while ($cur); 1398 return $my_tree; 1399 } 1400 1401 /** 1402 * Generate indexing information for given element 1403 * 1404 * @param parserElement descendant of parserElement 1405 * @see generateElementIndex() 1406 * @return array 1407 */ 1408 function getIndexInformation($elt) 1409 { 1410 $Result['type'] = $elt-> type; 1411 $Result['file_name'] = $elt-> file; 1412 $Result['path'] = $elt-> getPath();
1413 1414 if (isset($elt-> docblock)) 1415 { 1416 $Result['description'] = $elt-> docblock-> getSDesc($this); 1417 1418 if ($elt-> docblock-> hasaccess) 1419 $Result['access'] = $elt-> docblock-> tags['access'][0]> value; 1420 else 1421 $Result['access'] = 'public'; 1422 1423 $Result['abstract'] = isset ($elt-> docblock-> tags['abstract'][0]); 1424 } 1425 else 1426 $Result['description'] = ''; 1427 1428 $aa = $Result['description']; 1429 if (!empty($aa)) $aa = " <br> $aa" ; 1430 1431 switch($elt-> type) 1432 { 1433 case 'class': 1434 $Result['name'] = $elt-> getName(); 1435 $Result['title'] = 'Class'; 1436 $Result['link'] = $this-> getClassLink($elt-> getName(), 1437 $elt-> docblock-> package, 1438 $elt-> getPath(), 1439 $elt-> getName()); 1440 $Result['listing'] = 'in file '.$elt-> file.', class '.$Result['link']." $aa" ; 1441 break; 1442 case 'define': 1443 $Result['name'] = $elt-> getName(); 1444 $Result['title'] = 'Constant'; 1445 $Result['link'] = $this-> getDefineLink($elt-> getName(), 1446 $elt-> docblock-> package, 1447 $elt-> getPath(), 1448 $elt-> getName()); 1449 $Result['listing'] = 'in file '.$elt-> file.', constant '.$Result['link']." $aa" ; 1450 break; 1451 case 'global': 1452 $Result['name'] = $elt-> getName(); 1453 $Result['title'] = 'Global'; 1454 $Result['link'] = $this-> getGlobalLink($elt-> getName(), 1455 $elt-> docblock-> package, 1456 $elt-> getPath(), 1457 $elt-> getName()); 1458 $Result['listing'] = 'in file '.$elt-> file.', global variable '.$Result['link']." $aa" ; 1459 break; 1460 case 'function': 1461 $Result['name'] = $elt-> getName(); 1462 $Result['title'] = 'Function'; 1463 $Result['link'] = $this-> getFunctionLink($elt-> getName(), 1464 $elt-> docblock-> package, 1465 $elt-> getPath(), 1466 $elt-> getName().'()'); 1467 $Result['listing'] = 'in file '.$elt-> file.', function '.$Result['link']." $aa" ; 1468 break; 1469 case 'method': 1470 $Result['name'] = $elt-> getName(); 1471 $Result['title'] = 'Method'; 1472 $Result['link'] = $this-> getMethodLink($elt-> getName(), 1473 $elt-> class, 1474 $elt-> docblock-> package, 1475 $elt-> getPath(), 1476 $elt-> class.'::'.$elt> getName().'()' 1477 ); 1478 if ($elt-> isConstructor) $Result['constructor'] = 1; 1479 $Result['listing'] = 'in file '.$elt-> file.', method '.$Result['link']." $aa" ; 1480 break; 1481 case 'var': 1482 $Result['name'] = $elt-> getName(); 1483 $Result['title'] = 'Variable';
1484 $Result['link'] = $this-> getVarLink($elt-> getName(), 1485 $elt-> class, 1486 $elt-> docblock-> package, 1487 $elt-> getPath(), 1488 $elt-> class.'::'.$elt> getName()); 1489 $Result['listing'] = 'in file '.$elt-> file.', variable '.$Result['link']." $aa" ; 1490 break; 1491 case 'const': 1492 $Result['name'] = $elt-> getName(); 1493 $Result['title'] = 'Class Constant'; 1494 $Result['link'] = $this-> getConstLink($elt-> getName(), 1495 $elt-> class, 1496 $elt-> docblock-> package, 1497 $elt-> getPath(), 1498 $elt-> class.'::'.$elt> getName()); 1499 $Result['listing'] = 'in file '.$elt-> file.', class constant '.$Result['link']." $aa" ; 1500 break; 1501 case 'page': 1502 $Result['name'] = $elt-> getFile(); 1503 $Result['title'] = 'Page'; 1504 $Result['link'] = $this-> getPageLink($elt-> getFile(), 1505 $elt-> package, 1506 $elt-> getPath(), 1507 $elt-> getFile()); 1508 $Result['listing'] = 'procedural page '.$Result['link']; 1509 break; 1510 case 'include': 1511 $Result['name'] = $elt-> getName(); 1512 $Result['title'] = 'Include'; 1513 $Result['link'] = $elt-> getValue(); 1514 $Result['listing'] = 'include '.$Result['name']; 1515 break; 1516 } 1517 1518 return $Result; 1519 } 1520 /** 1521 * Generate alphabetical index of all elements 1522 * 1523 * @see $elements, walk() 1524 */ 1525 function generateElementIndex() 1526 { 1527 $elementindex = array(); 1528 $letters = array(); 1529 $used = array(); 1530 foreach($this-> elements as $letter => $nutoh) 1531 { 1532 foreach($this-> elements[$letter] as $i => $yuh) 1533 { 1534 if ($this-> elements[$letter][$i]-> type != 'include') 1535 { 1536 if (!isset($used[$letter])) 1537 { 1538 $letters[]['letter'] = $letter; 1539 $elindex['letter'] = $letter; 1540 $used[$letter] = 1; 1541 } 1542 1543 $elindex['index'][] = $this-> getIndexInformation($this> elements[$letter][$i]); 1544 } 1545 } 1546 if (isset($elindex['index'])) 1547 { 1548 $elementindex[] = $elindex; 1549 } else 1550 { 1551 unset($letters[count($letters) - 1]); 1552 } 1553 $elindex = array(); 1554 } 1555 return array($elementindex,$letters); 1556 } 1557 1558 function copyMediaRecursively($media,$targetdir,$subdir = '')
1559 { 1560 $versionControlDirectories = array ('CVS', 'media/CVS', 'media\\CVS', '.svn', 'media/.svn', 'media\\.svn'); 1561 if (!is_array($media)) { 1562 return; 1563 } 1564 foreach($media as $dir => $files) 1565 { 1566 if ($dir === '/') 1567 { 1568 $this-> copyMediaRecursively($files,$targetdir); 1569 } else 1570 { 1571 if (!is_numeric($dir)) 1572 { 1573 if (in_array($dir, $versionControlDirectories)) 1574 { 1575 // skip it entirely 1576 } 1577 else 1578 { 1579 // create the subdir 1580 phpDocumentor_out(" creating $targetdir" . PATH_DELIMITER . " $dir\n" ); 1581 Converter::setTargetDir($targetdir . PATH_DELIMITER . $dir); 1582 if (!empty($subdir)) 1583 { 1584 $subdir .= PATH_DELIMITER; 1585 } 1586 $this> copyMediaRecursively($files," $targetdir/$dir" ,$subdir . $dir); 1587 } 1588 } 1589 else 1590 { 1591 // copy the file 1592 phpDocumentor_out(" copying $targetdir" . PATH_DELIMITER . $files['file']."\n" ); 1593 $this-> copyFile($files['file'],$subdir); 1594 } 1595 } 1596 } 1597 } 1598 1599 /** 1600 * calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied 1601 * @see Converter::setTargetDir() 1602 */ 1603 function setTargetDir($dir) 1604 { 1605 Converter::setTargetDir($dir); 1606 if ($this-> wrote) return; 1607 $this-> wrote = true; 1608 $template_images = array(); 1609 $stylesheets = array(); 1610 $tdir = $dir; 1611 $dir = $this-> templateDir; 1612 $this-> templateDir = $this-> templateDir.'templates/'; 1613 $info = new Io; 1614 $this-> copyMediaRecursively($info-> getDirTree($this-> templateDir.'media',$this> templateDir),$tdir); 1615 } 1616 1617 /** 1618 * Generate alphabetical index of all elements by package and subpackage 1619 * 1620 * @param string $package name of a package 1621 * @see $pkg_elements, walk(), generatePkgElementIndexes() 1622 */ 1623 function generatePkgElementIndex($package) 1624 { 1625 // var_dump($this->pkg_elements[$package]); 1626 $elementindex = array(); 1627 $letters = array(); 1628 $letterind = array(); 1629 $used = array(); 1630 $subp = ''; 1631 foreach($this-> pkg_elements[$package] as $subpackage => $els) 1632 {
1633 if (empty($els)) continue; 1634 if (!empty($subpackage)) $subp = " (<b>subpackage:</b> $subpackage)" ; else $subp = ''; 1635 foreach($els as $letter => $yuh) 1636 { 1637 foreach($els[$letter] as $i => $yuh) 1638 { 1639 if ($els[$letter][$i]-> type != 'include') 1640 { 1641 if (!isset($used[$letter])) 1642 { 1643 $letters[]['letter'] = $letter; 1644 $letterind[$letter] = count($letters) - 1; 1645 $used[$letter] = 1; 1646 } 1647 $elindex[$letter]['letter'] = $letter; 1648 1649 $elindex[$letter]['index'][] = $this> getIndexInformation($els[$letter][$i]); 1650 } 1651 } 1652 } 1653 } 1654 ksort($elindex); 1655 usort($letters,'HTMLframes_lettersort'); 1656 if (isset($elindex)) 1657 { 1658 while(list($letter,$tempel) = each($elindex)) 1659 { 1660 if (!isset($tempel)) 1661 { 1662 unset($letters[$letterind[$tempel['letter']]]); 1663 } else 1664 $elementindex[] = $tempel; 1665 } 1666 } else $letters = array(); 1667 return array($elementindex,$letters); 1668 } 1669 1670 /** 1671 * 1672 * @see generatePkgElementIndex() 1673 */ 1674 function generatePkgElementIndexes() 1675 { 1676 $packages = array(); 1677 $package_names = array(); 1678 $pkg = array(); 1679 $letters = array(); 1680 foreach($this-> pkg_elements as $package => $trash) 1681 { 1682 $pkgs['package'] = $package; 1683 $pkg['package'] = $package; 1684 list($pkg['pindex'],$letters[$package]) = $this> generatePkgElementIndex($package); 1685 if (count($pkg['pindex'])) 1686 { 1687 $packages[] = $pkg; 1688 $package_names[] = $pkgs; 1689 } 1690 unset($pkgs); 1691 unset($pkg); 1692 } 1693 foreach($packages as $i => $package) 1694 { 1695 $pnames = array(); 1696 for($j=0;$j< count($package_names);$j++) 1697 { 1698 if ($package_names[$j]['package'] != $package['package']) $pnames[] = $package_names[$j]; 1699 } 1700 $packages[$i]['packageindexes'] = $pnames; 1701 } 1702 return array($packages,$package_names,$letters); 1703 } 1704 1705 /** 1706 * @param string name of class 1707 * @param string package name 1708 * @param string full path to look in (used in index generation)
1709 * @param boolean deprecated 1710 * @param boolean return just the URL, or enclose it in an html a tag 1711 * @return mixed false if not found, or an html a link to the class's documentation 1712 * @see parent::getClassLink() 1713 */ 1714 function getClassLink($expr,$package, $file = false,$text = false, $with_a = true) 1715 { 1716 $a = Converter::getClassLink($expr,$package,$file); 1717 if (!$a) return false; 1718 return $this-> returnSee($a, $text, $with_a); 1719 } 1720 1721 /** 1722 * @param string name of function 1723 * @param string package name 1724 * @param string full path to look in (used in index generation) 1725 * @param boolean deprecated 1726 * @param boolean return just the URL, or enclose it in an html a tag 1727 * @return mixed false if not found, or an html a link to the function's documentation 1728 * @see parent::getFunctionLink() 1729 */ 1730 function getFunctionLink($expr,$package, $file = false,$text = false) 1731 { 1732 $a = Converter::getFunctionLink($expr,$package,$file); 1733 if (!$a) return false; 1734 return $this-> returnSee($a, $text); 1735 } 1736 1737 /** 1738 * @param string name of define 1739 * @param string package name 1740 * @param string full path to look in (used in index generation) 1741 * @param boolean deprecated 1742 * @param boolean return just the URL, or enclose it in an html a tag 1743 * @return mixed false if not found, or an html a link to the define's documentation 1744 * @see parent::getDefineLink() 1745 */ 1746 function getDefineLink($expr,$package, $file = false,$text = false) 1747 { 1748 $a = Converter::getDefineLink($expr,$package,$file); 1749 if (!$a) return false; 1750 return $this-> returnSee($a, $text); 1751 } 1752 1753 /** 1754 * @param string name of global variable 1755 * @param string package name 1756 * @param string full path to look in (used in index generation) 1757 * @param boolean deprecated 1758 * @param boolean return just the URL, or enclose it in an html a tag 1759 * @return mixed false if not found, or an html a link to the global variable's documentation 1760 * @see parent::getGlobalLink() 1761 */ 1762 function getGlobalLink($expr,$package, $file = false,$text = false) 1763 { 1764 $a = Converter::getGlobalLink($expr,$package,$file); 1765 if (!$a) return false; 1766 return $this-> returnSee($a, $text); 1767 } 1768 1769 /** 1770 * @param string name of procedural page 1771 * @param string package name 1772 * @param string full path to look in (used in index generation) 1773 * @param boolean deprecated 1774 * @param boolean return just the URL, or enclose it in an html a tag 1775 * @return mixed false if not found, or an html a link to the procedural page's documentation 1776 * @see parent::getPageLink() 1777 */ 1778 function getPageLink($expr,$package, $path = false,$text = false) 1779 { 1780 $a = Converter::getPageLink($expr,$package,$path); 1781 if (!$a) return false; 1782 return $this-> returnSee($a, $text); 1783 } 1784 1785 /** 1786 * @param string name of method
1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866
* @param string class containing method * @param string package name * @param string full path to look in (used in index generation) * @param boolean deprecated * @param boolean return just the URL, or enclose it in an html a tag * @return mixed false if not found, or an html a link to the method's documentation * @see parent::getMethodLink() */ function getMethodLink($expr,$class,$package, $file = false,$text = false) { $a = Converter::getMethodLink($expr,$class,$package,$file); if (!$a) return false; return $this-> returnSee($a, $text); } /** * @param string name of var * @param string class containing var * @param string package name * @param string full path to look in (used in index generation) * @param boolean deprecated * @param boolean return just the URL, or enclose it in an html a tag * @return mixed false if not found, or an html a link to the var's documentation * @see parent::getVarLink() */ function getVarLink($expr,$class,$package, $file = false,$text = false) { $a = Converter::getVarLink($expr,$class,$package,$file); if (!$a) return false; return $this-> returnSee($a, $text); } /** * @param string name of class constant * @param string class containing class constant * @param string package name * @param string full path to look in (used in index generation) * @param boolean deprecated * @param boolean return just the URL, or enclose it in an html a tag * @return mixed false if not found, or an html a link to the var's documentation * @see parent::getVarLink() */ function getConstLink($expr,$class,$package, $file = false,$text = false) { $a = Converter::getConstLink($expr,$class,$package,$file); if (!$a) return false; return $this-> returnSee($a, $text); } /** * does a nat case sort on the specified second level value of the array * * @param mixed $a * @param mixed $b * @return int */ function rcNatCmp ($a, $b) { $aa = strtoupper($a[$this-> rcnatcmpkey]); $bb = strtoupper($b[$this-> rcnatcmpkey]); return strnatcasecmp($aa, $bb); } /** * does a nat case sort on the specified second level value of the array. * this one puts constructors first * * @param mixed $a * @param mixed $b * @return int */ function rcNatCmp1 ($a, $b) { $aa = strtoupper($a[$this-> rcnatcmpkey]); $bb = strtoupper($b[$this-> rcnatcmpkey]); if (strpos($aa,'CONSTRUCTOR') === 0) { return -1;
1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914
} if (strpos($bb,'CONSTRUCTOR') === 0) { return 1; } if (strpos($aa,strtoupper($this-> class)) === 0) { return -1; } if (strpos($bb,strtoupper($this-> class)) === 0) { return -1; } return strnatcasecmp($aa, $bb); } /** * This function is not used by HTMLdefaultConverter, but is required by Converter */ function Output() { } } /** * @access private * @global string name of the package to set as the first package */ function HTMLframes_pindexcmp($a, $b) { global $phpDocumentor_DefaultPackageName; if ($a['title'] == $phpDocumentor_DefaultPackageName) return -1; if ($b['title'] == $phpDocumentor_DefaultPackageName) return 1; return strnatcasecmp($a['title'],$b['title']); } /** @access private */ function HTMLframes_lettersort($a, $b) { return strnatcasecmp($a['letter'],$b['letter']); } /** @access private */ function HTMLframes_outputfilter($src, & $smarty) { return str_replace('{$subdir}',$smarty-> _tpl_vars['subdir'],$src); } ?>
65 * @var boolean 66 */ 67 var $sort_page_contents_by_type = true; 68 /** @var string */ 69 var $outputformat = 'HTML'; 70 /** @var string */ 71 var $name = 'Smarty'; 72 /** 73 * indexes of elements by package that need to be generated 74 * @var array 75 */ 76 var $leftindex = array('classes' => true, 'pages' => true, 'functions' => true, 'defines' => false, 'globals' => false); 77 78 /** 79 * output directory for the current procedural page being processed 80 * @var string 81 */ 82 var $page_dir; 83 84 /** 85 * target directory passed on the command-line. 86 * {@link $targetDir} is malleable, always adding package/ and package/subpackage/ subdirectories onto it. 87 * @var string 88 */ 89 var $base_dir; 90 91 /** 92 * output directory for the current class being processed 93 * @var string 94 */ 95 var $class_dir; 96 97 /** 98 * array of converted package page names. 99 * Used to link to the package page in the left index 100 * @var array Format: array(package => 1) 101 */ 102 var $package_pages = array(); 103 104 /** 105 * controls formatting of parser informative output 106 * 107 * Converter prints: 108 * "Converting /path/to/file.php... Procedural Page Elements... Classes..." 109 * Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there 110 * is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that 111 * and is purely cosmetic 112 * @var boolean 113 */ 114 var $juststarted = false; 115 116 /** 117 * contains all of the template procedural page element loop data needed for the current template 118 * @var array 119 */ 120 var $current; 121 122 /** 123 * contains all of the template class element loop data needed for the current template 124 * @var array 125 */ 126 var $currentclass; 127 var $wrote = false; 128 var $ric_set = array(); 129 130 /** 131 * sets {@link $base_dir} to $targetDir 132 * @see Converter() 133 */ 134 135 /**#@+ 136 * @access private 137 */ 138 var $_classleft_cache = false; 139 var $_classcontents_cache = false;
140 var $_pagecontents_cache = false; 141 var $_pageleft_cache = false; 142 var $_done_package_index = false; 143 var $_ric_done = false; 144 var $_wrote_tdir = false; 145 var $ric_contents = array(); 146 /**#@-*/ 147 148 function HTMLSmartyConverter(& $allp, & $packp, & $classes, & $procpages, $po, $pp, $qm, $targetDir, $templateDir, $title) 149 { 150 Converter::Converter($allp, $packp, $classes, $procpages,$po, $pp, $qm, $targetDir, $templateDir, $title); 151 $this-> base_dir = $targetDir; 152 } 153 154 function writeSource($path, $value) 155 { 156 $templ = & $this-> newSmarty(); 157 $pathinfo = $this-> proceduralpages-> getPathInfo($path, $this); 158 $templ-> assign('source',$value); 159 $templ-> assign('package',$pathinfo['package']); 160 $templ-> assign('subpackage',$pathinfo['subpackage']); 161 $templ-> assign('name',$pathinfo['name']); 162 $templ-> assign('source_loc',$pathinfo['source_loc']); 163 $templ-> assign('docs',$pathinfo['docs']); 164 $templ-> assign("subdir" ,'../'); 165 $templ-> register_outputfilter('HTMLSmarty_outputfilter'); 166 $this-> setTargetDir($this-> getFileSourcePath($this-> base_dir)); 167 phpDocumentor_out("\n" ); 168 $this-> setSourcePaths($path); 169 $this-> writefile($this-> getFileSourceName($path).'.html',$templ> fetch('filesource.tpl')); 170 } 171 172 function writeExample($title, $path, $source) 173 { 174 $templ = & $this-> newSmarty(); 175 $templ-> assign('source',$source); 176 if (empty($title)) 177 { 178 $title = 'example'; 179 addWarning(PDERROR_EMPTY_EXAMPLE_TITLE, $path, $title); 180 } 181 $templ-> assign('title',$title); 182 $templ-> assign('file',$path); 183 $templ-> assign("subdir" ,'../'); 184 $templ-> register_outputfilter('HTMLSmarty_outputfilter'); 185 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . '__examplesource'); 186 phpDocumentor_out("\n" ); 187 $this-> writefile('exsource_'.$path.'.html',$templ-> fetch('examplesource.tpl')); 188 } 189 190 function getExampleLink($path, $title) 191 { 192 return $this-> returnLink('{$subdir}__examplesource' . PATH_DELIMITER . 'exsource_'.$path.'.html',$title); 193 } 194 195 function getSourceLink($path) 196 { 197 return $this-> returnLink('{$subdir}__filesource/' . 198 $this-> getFileSourceName($path).'.html','Source Code for this file'); 199 } 200 201 /** 202 * Retrieve a Converter-specific anchor to a segment of a source code file 203 * parsed via a {@tutorial tags.filesource.pkg} tag. 204 * @param string full path to source file 205 * @param string name of anchor 206 * @param string link text, if this is a link 207 * @param boolean returns either a link or a destination based on this 208 * parameter 209 * @return string link to an anchor, or the anchor 210 */ 211 function getSourceAnchor($sourcefile,$anchor,$text = '',$link = false) 212 { 213 if ($link) { 214 return $this-> returnLink('{$subdir}__filesource/' . 215 $this-> getFileSourceName($sourcefile) . '.html#a' . $anchor, $text);
216 } else { 217 return '<a name="a' .$anchor.'"></a>' ; 218 } 219 } 220 221 /** 222 * Return a line of highlighted source code with formatted line number 223 * 224 * If the $path is a full path, then an anchor to the line number will be 225 * added as well 226 * @param integer line number 227 * @param string highlighted source code line 228 * @param false|stringfull path to @filesource file this line is a part of, 229 * if this is a single line from a complete file. 230 * @return string formatted source code line with line number 231 */ 232 function sourceLine($linenumber, $line, $path = false) 233 { 234 $extra = ''; 235 if (strlen(str_replace("\n" , '', $line)) == 0) { 236 $extra = ' ' ; 237 } 238 if ($path) 239 { 240 return '<li><div class="src-line">' . $this> getSourceAnchor($path, $linenumber) . 241 str_replace("\n" ,'',$line) . $extra . 242 "</div></li>\n" ; 243 } else 244 { 245 return '<li><div class="src-line">' . str_replace("\n" ,'',$line) . " $extra</div></li>\n " ; 246 } 247 } 248 249 /** 250 * Used to convert the <<code>> tag in a docblock 251 * @param string 252 * @param boolean 253 * @return string 254 */ 255 function ProgramExample($example, $tutorial = false, $inlinesourceparse = null/*false*/, 256 $class = null/*false*/, $linenum = null/*false*/, $filesourcepath = null/*false*/) 257 { 258 $trans = $this-> template_options['desctranslate']; 259 $this-> template_options['desctranslate'] = array(); 260 $example = '<ol>' . parent::ProgramExample($example, $tutorial, $inlinesourceparse, $class, $linenum, $filesourcepath) 261 .'</ol>' ; 262 $this-> template_options['desctranslate'] = $trans; 263 if (!isset($this-> template_options['desctranslate'])) return $example; 264 if (!isset($this-> template_options['desctranslate']['code'])) return $example; 265 $example = $this-> template_options['desctranslate']['code'] . $example; 266 if (!isset($this-> template_options['desctranslate']['/code'])) return $example; 267 return $example . $this-> template_options['desctranslate']['/code']; 268 } 269 270 /** 271 * @param string 272 */ 273 function TutorialExample($example) 274 { 275 $trans = $this-> template_options['desctranslate']; 276 $this-> template_options['desctranslate'] = array(); 277 $example = '<ol>' . parent::TutorialExample($example) 278 .'</ol>' ; 279 $this-> template_options['desctranslate'] = $trans; 280 if (!isset($this-> template_options['desctranslate'])) return $example; 281 if (!isset($this-> template_options['desctranslate']['code'])) return $example; 282 $example = $this-> template_options['desctranslate']['code'] . $example; 283 if (!isset($this-> template_options['desctranslate']['/code'])) return $example; 284 return $example . $this-> template_options['desctranslate']['/code']; 285 } 286 287 function getCurrentPageLink() 288 { 289 return $this-> curname . '.html'; 290 } 291
292 function unmangle($sourcecode) 293 { 294 $sourcecode = str_replace(' ' ,' ',$sourcecode); 295 $sourcecode = str_replace('&' ,'&' ,$sourcecode); 296 $sourcecode = str_replace('<br />' ,"<br>" ,$sourcecode); 297 $sourcecode = str_replace('<code>' ,'<pre>' ,$sourcecode); 298 $sourcecode = str_replace('</code>' ,'</pre>' ,$sourcecode); 299 $sourcecode = str_replace('<' ,'<' ,$sourcecode); 300 $sourcecode = str_replace('>' ,'>' ,$sourcecode); 301 return $sourcecode; 302 } 303 304 /** 305 * Uses htmlspecialchars() on the input 306 */ 307 function postProcess($text) 308 { 309 if ($this-> highlightingSource) { 310 return str_replace(array(' ',"\t" ), array(' ' , ' ' ), 311 htmlspecialchars($text)); 312 } 313 return htmlspecialchars($text); 314 } 315 316 /** 317 * Use the template tutorial_toc.tpl to generate a table of contents for HTML 318 * @return string table of contents formatted for use in the current output format 319 * @param array format: array(array('tagname' => section, 'link' => returnsee link, 'id' => anchor name, 'title' => from title tag),...) 320 */ 321 function formatTutorialTOC($toc) 322 { 323 $template = & $this-> newSmarty(); 324 $template-> assign('toc',$toc); 325 return $template-> fetch('tutorial_toc.tpl'); 326 } 327 328 function & SmartyInit(& $templ) 329 { 330 $this-> makeLeft(); 331 $templ-> assign("ric" ,$this-> ric_set); 332 $templ-> assign("packageindex" ,$this-> package_index); 333 $templ-> assign('hastodos',count($this-> todoList)); 334 $templ-> assign('todolink','todolist.html'); 335 $templ-> assign("subdir" ,''); 336 return $templ; 337 } 338 339 /** 340 * Writes out the template file of {@link $class_data} and unsets the template to save memory 341 * @see registerCurrentClass() 342 * @see parent::endClass() 343 */ 344 function endClass() 345 { 346 $a = '../'; 347 if (!empty($this-> subpackage)) $a .= '../'; 348 if ($this-> juststarted) 349 { 350 $this-> juststarted = false; 351 phpDocumentor_out("\n" ); 352 flush(); 353 } 354 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> class_dir); 355 $classleft = $this-> getClassLeft(); 356 $this-> class_data-> assign("compiledfileindex" ,$this-> getPageLeft()); 357 $this-> class_data-> assign("compiledclassindex" ,$classleft['class']); 358 $this-> class_data> assign("compiledinterfaceindex" ,$classleft['interface']); 359 $this-> class_data-> assign("tutorials" ,$this-> getTutorialList()); 360 $this-> class_data-> assign("contents" ,$this-> getClassContents()); 361 $this-> class_data-> assign("packageindex" ,$this-> package_index); 362 $this-> class_data-> assign("package" ,$this-> package); 363 $this-> class_data-> assign("subdir" ,$a); 364 $this-> class_data-> register_outputfilter('HTMLSmarty_outputfilter'); 365 $this-> writefile($this-> class . '.html',$this-> class_data> fetch('class.tpl')); 366 unset($this-> class_data);
367 } 368 369 function getTutorialList() 370 { 371 static $cache = false; 372 if ($cache) 373 { 374 if (isset($cache[$this-> package])) return $cache[$this-> package]; 375 } 376 $package = $this-> package; 377 if (!isset($this-> tutorials[$package])) return false; 378 foreach($this-> tutorials[$package] as $subpackage => $blah) 379 { 380 $subpackages[] = $subpackage; 381 } 382 $tutes = array(); 383 foreach($subpackages as $subpackage) 384 { 385 if (isset($this-> tutorial_tree) && is_array($this-> tutorial_tree)) 386 foreach($this-> tutorial_tree as $root => $tr) 387 { 388 if ($tr['tutorial']-> package == $package && $tr['tutorial']> subpackage == $subpackage) 389 $tutes[$tr['tutorial']-> tutorial_type][] = $this> getTutorialTree($tr['tutorial']); 390 } 391 } 392 $cache[$this-> package] = $tutes; 393 return $tutes; 394 } 395 396 function getTutorialTree($tutorial,$k = false) 397 { 398 $ret = ''; 399 if (is_object($tutorial)) $tree = parent::getTutorialTree($tutorial); else $tree = $tutorial; 400 if (!$tree) 401 { 402 $template = & $this-> newSmarty(); 403 $template-> assign('subtree',false); 404 $template-> assign('name',str_replace('.','',$tutorial-> name)); 405 $template-> assign('parent',false); 406 $template-> assign('haskids',false); 407 $template-> assign('kids',''); 408 $link = new tutorialLink; 409 $t = $tutorial; 410 $link-> addLink('',$t-> path,$t-> name,$t-> package,$t-> subpackage,$t> getTitle($this)); 411 $main = array('link' => $this-> getId($link), 'title' => $link-> title); 412 $template-> assign('main',$main); 413 return $template-> fetch('tutorial_tree.tpl'); 414 } 415 if (isset($tree['kids'])) 416 { 417 foreach($tree['kids'] as $subtree) 418 { 419 $ret .= $this-> getTutorialTree($subtree, true); 420 } 421 } 422 $template = & $this-> newSmarty(); 423 $template-> assign('subtree',$k); 424 $template-> assign('name',str_replace('.','',$tree['tutorial']-> name)); 425 $template-> assign('parent',($k ? str_replace('.','',$tree['tutorial']-> parent> name) : false)); 426 $template-> assign('haskids',strlen($ret)); 427 $template-> assign('kids',$ret); 428 $link = new tutorialLink; 429 $t = $tree['tutorial']; 430 $link-> addLink('',$t-> path,$t-> name,$t-> package,$t-> subpackage,$t> getTitle($this)); 431 $main = array('link' => $this-> getId($link), 'title' => $link-> title); 432 $template-> assign('main',$main); 433 return $template-> fetch('tutorial_tree.tpl'); 434 } 435 436 function getClassLeft() 437 { 438 if ($this-> _classleft_cache) 439 { 440 if (isset($this-> _classleft_cache[$this-> package][$this-> subpackage]))
return $this-> _classleft_cache[$this-> package][$this-> subpackage]; 441 } 442 $arr = $classarr = $interfacearr = array(); 443 if (isset($this-> left['#class'][$this-> package])) 444 foreach($this-> left['#class'][$this-> package] as $subpackage => $pages) 445 { 446 for ($i = 0; $i < count($pages); $i++) { 447 if ($pages[$i]['is_interface']) { 448 $interfacearr[$subpackage][] = $pages[$i]; 449 } else { 450 $classarr[$subpackage][] = $pages[$i]; 451 } 452 } 453 } 454 $templ = & $this-> newSmarty(); 455 $templ-> assign('classleftindex',$classarr); 456 $classarr = $templ-> fetch('classleft.tpl'); 457 $this-> _classleft_cache[$this-> package][$this-> subpackage]['class'] = $classarr; 458 $templ = & $this-> newSmarty(); 459 $templ-> assign('classleftindex',$interfacearr); 460 $interfacearr = $templ-> fetch('classleft.tpl'); 461 $this-> _classleft_cache[$this-> package][$this-> subpackage]['interface'] = 462 $interfacearr; 463 return $this-> _classleft_cache[$this-> package][$this-> subpackage]; 464 } 465 466 function getClassContents() 467 { 468 if ($this-> _classcontents_cache) 469 { 470 if (isset($this-> _classcontents_cache[$this-> package][$this> subpackage][$this-> class])) return $this-> _classcontents_cache[$this-> package][$this> subpackage][$this-> class]; 471 } 472 $arr = array(); 473 foreach($this-> class_contents[$this-> package][$this-> subpackage][$this> class] as $i => $link) 474 { 475 if (is_object($link)) 476 $arr[$link-> type][] = $this-> returnSee($link,$link-> name); 477 } 478 $this-> _classcontents_cache[$this-> package][$this-> subpackage][$this> class] = $arr; 479 return $arr; 480 } 481 482 function getPageContents() 483 { 484 if (!isset($this-> path)) $this-> path = '#####'; 485 if ($this-> _pagecontents_cache) 486 { 487 if (isset($this-> _pagecontents_cache[$this-> package][$this> subpackage][$this-> path])) return $this-> _pagecontents_cache[$this-> package][$this> subpackage][$this-> path]; 488 } 489 $arr = array(); 490 foreach($this-> page_contents[$this-> curpage-> package][$this-> curpage> subpackage] as $i => $link) 491 { 492 if (is_object($link)) 493 $arr[$link-> type][$i] = $this-> returnSee($link); 494 } 495 $this-> _pagecontents_cache[$this-> package][$this-> subpackage][$this-> path] = $arr; 496 return $arr; 497 } 498 499 function getPageLeft() 500 { 501 if ($this-> _pageleft_cache) 502 { 503 if (isset($this-> _pageleft_cache[$this-> package][$this-> subpackage])) return $this-> _pageleft_cache[$this-> package][$this-> subpackage]; 504 } 505 $arr = array(); 506 if (isset($this-> left[$this-> package])) 507 foreach($this-> left[$this-> package] as $subpackage => $pages) 508 { 509 $arr[$subpackage] = $pages;
510 } 511 $templ = & $this-> newSmarty(); 512 $templ-> assign('fileleftindex',$arr); 513 $arr = $templ-> fetch('fileleft.tpl'); 514 $this-> _pageleft_cache[$this-> package][$this-> subpackage] = $arr; 515 return $arr; 516 } 517 518 /** 519 * Writes out the template file of {@link $page_data} and unsets the template to save memory 520 * @see registerCurrent() 521 * @see parent::endPage() 522 */ 523 function endPage() 524 { 525 $this-> package = $this-> curpage-> package; 526 $this-> subpackage = $this-> curpage-> subpackage; 527 $a = '../'; 528 if (!empty($this-> subpackage)) $a .= '../'; 529 $classleft = $this-> getClassLeft(); 530 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $this-> page_dir); 531 $this-> page_data-> assign("contents" ,$this-> getPageContents()); 532 $this-> page_data-> assign("compiledfileindex" ,$this-> getPageLeft()); 533 $this-> page_data-> assign("compiledclassindex" ,$classleft['class']); 534 $this-> page_data> assign("compiledinterfaceindex" ,$classleft['interface']); 535 $this-> page_data-> assign("tutorials" ,$this-> getTutorialList()); 536 $this-> page_data-> assign("packageindex" ,$this-> package_index); 537 $this-> page_data-> assign("package" ,$this-> package); 538 $this-> page_data-> assign("subdir" ,$a); 539 $this-> page_data-> register_outputfilter('HTMLSmarty_outputfilter'); 540 $this-> writefile($this-> page . '.html',$this-> page_data-> fetch('page.tpl')); 541 unset($this-> page_data); 542 } 543 544 /** 545 * @param string 546 * @param string 547 * @return string <a href="'.$link.'">'.$text.'</a> 548 */ 549 function returnLink($link,$text) 550 { 551 return '<a href="' .$link.'">' .$text.'</a>' ; 552 } 553 554 function makeLeft() 555 { 556 if ($this-> _done_package_index) return; 557 $this-> _done_package_index = true; 558 if (!isset($this-> package_index)) 559 foreach($this-> all_packages as $key => $val) 560 { 561 if (isset($this-> pkg_elements[$key])) 562 { 563 if (!isset($start)) $start = $key; 564 $this-> package_index[] = array('link' => " li_$key.html" , 'title' => $key); 565 } 566 } 567 foreach($this-> page_elements as $package => $o1) 568 { 569 foreach($o1 as $subpackage => $links) 570 { 571 for($i=0;$i< count($links);$i++) 572 { 573 $this-> left[$package][$subpackage][] = 574 array("link" => $this-> getId($links[$i]), "title" => $links[$i]-> name); 575 } 576 } 577 } 578 foreach($this-> class_elements as $package => $o1) 579 { 580 foreach($o1 as $subpackage => $links) 581 { 582 for($i=0;$i< count($links);$i++) 583 { 584 $isinterface = false; 585 if ($links[$i]-> type == 'class') { 586 $class = $this-> classes-> getClass($links[$i]-> name,
587 $links[$i]-> path); 588 if ($class) { 589 $isinterface = $class-> isInterface(); 590 } 591 } 592 $this-> left['#class'][$package][$subpackage][] = 593 array("link" => $this-> getId($links[$i]), "title" => $links[$i]-> name, 'is_interface' => $isinterface); 594 } 595 } 596 } 597 } 598 599 /** 600 * HTMLdefaultConverter chooses to format both package indexes and the complete index here 601 * 602 * This function formats output for the elementindex.html and pkgelementindex.html template files. It then 603 * writes them to the target directory 604 * @see generateElementIndex(), generatePkgElementIndex() 605 */ 606 function formatPkgIndex() 607 { 608 list($package_indexes,$packages,$mletters) = $this-> generatePkgElementIndexes(); 609 for($i=0;$i< count($package_indexes);$i++) 610 { 611 $template = & $this-> newSmarty(); 612 $this-> package = $package_indexes[$i]['package']; 613 $this-> subpackage = ''; 614 $classleft = $this-> getClassLeft(); 615 $template-> assign("compiledfileindex" ,$this-> getPageLeft()); 616 $template-> assign("compiledclassindex" ,$classleft['class']); 617 $template-> assign("compiledinterfaceindex" ,$classleft['interface']); 618 $template-> assign("tutorials" ,$this-> getTutorialList()); 619 $template-> assign("index" ,$package_indexes[$i]['pindex']); 620 $template-> assign("package" ,$package_indexes[$i]['package']); 621 $template> assign("letters" ,$mletters[$package_indexes[$i]['package']]); 622 $template-> assign("title" ,"Package " .$package_indexes[$i]['package']." Element Index" ); 623 $template-> assign("date" ,date("r" ,time())); 624 $template-> register_outputfilter('HTMLSmarty_outputfilter'); 625 $this-> setTargetDir($this-> base_dir); 626 $this> writefile('elementindex_'.$package_indexes[$i]['package'].'.html',$template> fetch('pkgelementindex.tpl')); 627 } 628 phpDocumentor_out("\n" ); 629 flush(); 630 } 631 632 /** 633 * HTMLdefaultConverter uses this function to format template index.html and packages.html 634 * 635 * This function generates the package list from {@link $all_packages}, eliminating any 636 * packages that don't have any entries in their package index (no files at all, due to @ignore 637 * or other factors). Then it uses the default package name as the first package index to display. 638 * It sets the right pane to be either a blank file with instructions on making packagelevel docs, 639 * or the package-level docs for the default package. 640 * @global string Used to set the starting package to display 641 */ 642 function formatIndex() 643 { 644 global $phpDocumentor_DefaultPackageName; 645 if (!isset($this-> package_index)) 646 { 647 debug("\nERROR: Nothing parsed, check the command-line" ); 648 die(); 649 } 650 list($elindex,$mletters) = $this-> generateElementIndex(); 651 $template = & $this-> newSmarty(); 652 $template-> assign("index" ,$elindex); 653 $template-> assign("letters" ,$mletters); 654 $template-> assign("title" ,"Element Index" ); 655 $template-> assign("package" , false); 656 $template-> assign("date" ,date("r" ,time())); 657 phpDocumentor_out("\n" );
658 flush(); 659 $this-> setTargetDir($this-> base_dir); 660 $template-> register_outputfilter('HTMLSmarty_outputfilter'); 661 $this-> writefile('elementindex.html',$template-> fetch('elementindex.tpl')); 662 usort($this-> package_index,"HTMLSmarty_pindexcmp" ); 663 $index = & $this-> newSmarty(); 664 foreach($this-> all_packages as $key => $val) 665 { 666 if (isset($this-> pkg_elements[$key])) 667 { 668 if (!isset($start)) $start = $key; 669 if (!isset($this-> package_pages[$key])) $this-> writeNewPPage($key); 670 } 671 } 672 // Created index.html 673 $start = $phpDocumentor_DefaultPackageName; 674 if (!isset($this-> pkg_elements[$key])) 675 { 676 // if there are no elements, use a random package as the default 677 $a = array_keys($this-> pkg_elements); 678 $start = array_shift($a); 679 } 680 $this-> package = $start; 681 $this-> subpackage = ''; 682 $classleft = $this-> getClassLeft(); 683 $index-> assign("compiledfileindex" ,$this-> getPageLeft()); 684 $index-> assign("compiledclassindex" ,$classleft['class']); 685 $index-> assign("compiledinterfaceindex" ,$classleft['interface']); 686 $index-> assign('hastodos',count($this-> todoList)); 687 $index-> assign('todolink','todolist.html'); 688 $index-> assign("tutorials" ,$this-> getTutorialList()); 689 $index-> assign("date" ,date("r" ,time())); 690 $index-> assign("package" ,$this-> package); 691 $index-> assign("title" ,$this-> title); 692 $index-> assign("start" ," li_$start.html" ); 693 if (isset($this-> package_pages[$start])) 694 { 695 $index-> assign("contents" ,$this-> package_pages[$start]); 696 } 697 $index-> register_outputfilter('HTMLSmarty_outputfilter'); 698 phpDocumentor_out("\n" ); 699 flush(); 700 $this-> setTargetDir($this-> base_dir); 701 $this-> writefile("index.html" ,$index-> fetch('index.tpl')); 702 unset($index); 703 704 } 705 706 function writeNewPPage($key) 707 { 708 $template = & $this-> newSmarty(); 709 $this-> package = $key; 710 $this-> subpackage = ''; 711 $classleft = $this-> getClassLeft(); 712 $template-> assign("compiledfileindex" ,$this-> getPageLeft()); 713 $template-> assign("compiledclassindex" ,$classleft['class']); 714 $template-> assign("compiledinterfaceindex" ,$classleft['interface']); 715 $template-> assign("tutorials" ,$this-> getTutorialList()); 716 $template-> assign("date" ,date("r" ,time())); 717 $template-> assign("title" ,$this-> title); 718 $template-> assign("package" ,$key); 719 $template-> register_outputfilter('HTMLSmarty_outputfilter'); 720 phpDocumentor_out("\n" ); 721 flush(); 722 $this-> setTargetDir($this-> base_dir); 723 $this-> writefile(" li_$key.html" ,$template-> fetch('index.tpl')); 724 unset($template); 725 } 726 727 /** 728 * Generate indexes for li_package.html and classtree output files 729 * 730 * This function generates the li_package.html files from the template file left.html. It does this by 731 * iterating through each of the $page_elements, $class_elements and $function_elements arrays to retrieve 732 * the pre-sorted {@link abstractLink} descendants needed for index generation. Conversion of these links to 733 * text is done by {@link returnSee()}. 734 *
735 * Then it uses {@link generateFormattedClassTrees()} to create class trees from the template file classtrees.html. Output 736 * filename is classtrees_packagename.html. This function also unsets {@link $elements} and {@link $pkg_elements} to free 737 * up the considerable memory these two class vars use 738 * @see $page_elements, $class_elements, $function_elements 739 */ 740 function formatLeftIndex() 741 { 742 phpDocumentor_out("\n" ); 743 flush(); 744 $this-> setTargetDir($this-> base_dir); 745 if (!isset($this-> left)) 746 { 747 debug("Nothing parsed, check the command-line" ); 748 die(); 749 } 750 foreach($this-> all_packages as $package => $rest) 751 { 752 if (!isset($this-> pkg_elements[$package])) continue; 753 // Create class tree page 754 $template = & $this-> newSmarty(); 755 $classleft = $this-> getClassLeft(); 756 $template-> assign("compiledfileindex" ,$this-> getPageLeft()); 757 $template-> assign("compiledclassindex" ,$classleft['class']); 758 $template-> assign("compiledinterfaceindex" ,$classleft['interface']); 759 $template-> assign("classtrees" ,$this> generateFormattedClassTrees($package)); 760 $template-> assign("interfaces" ,$this> generateFormattedInterfaceTrees($package)); 761 $template-> assign("package" ,$package); 762 $template-> assign("date" ,date("r" ,time())); 763 $template-> assign("title" ," Class Trees for Package $package" ); 764 $template-> register_outputfilter('HTMLSmarty_outputfilter'); 765 $this-> writefile(" classtrees_$package.html" ,$template> fetch('classtrees.tpl')); 766 phpDocumentor_out("\n" ); 767 flush(); 768 } 769 $this-> writeRIC(); 770 // free up considerable memory 771 unset($this-> elements); 772 unset($this-> pkg_elements); 773 } 774 775 776 /** 777 * This function takes an {@link abstractLink} descendant and returns an html link 778 * 779 * @param abstractLink a descendant of abstractlink should be passed, and never text 780 * @param string text to display in the link 781 * @param boolean this parameter is not used, and is deprecated 782 * @param boolean determines whether the returned text is enclosed in an <a> tag 783 */ 784 function returnSee(& $element, $eltext = false, $with_a = true) 785 { 786 if (!is_object($element) || !$element) return false; 787 if (!$with_a) return $this-> getId($element, false); 788 if (!$eltext) 789 { 790 $eltext = ''; 791 switch($element-> type) 792 { 793 case 'tutorial' : 794 $eltext = strip_tags($element-> title); 795 break; 796 case 'method' : 797 case 'var' : 798 case 'const' : 799 $eltext .= $element-> class.'::'; 800 case 'page' : 801 case 'define' : 802 case 'class' : 803 case 'function' : 804 case 'global' : 805 default : 806 $eltext .= $element-> name; 807 if ($element-> type == 'function' || $element-> type == 'method') $eltext .= '()';
808 break; 809 } 810 } 811 return '<a href="' .$this-> getId($element).'">' .$eltext.'</a>' 812 } 813 814 function getId($element, $fullpath = true) 815 { 816 if (phpDocumentor_get_class($element) == 'parserdata') 817 { 818 $element = $this-> addLink($element-> parent); 819 $elp = $element-> parent; 820 } elseif (is_a($element, 'parserbase')) 821 { 822 $elp = $element; 823 $element = $this-> addLink($element); 824 } 825 $c = ''; 826 if (!empty($element-> subpackage)) 827 { 828 $c = '/'.$element-> subpackage; 829 } 830 $b = '{$subdir}'; 831 switch ($element-> type) 832 { 833 case 'page' : 834 if ($fullpath) 835 return $b.$element-> package.$c.'/'.$element-> fileAlias.'.html'; 836 return 'top'; 837 break; 838 case 'define' : 839 case 'global' : 840 case 'function' : 841 if ($fullpath) 842 return $b.$element-> package.$c.'/'.$element-> fileAlias.'.html#'.$element> type.$element-> name; 843 return $element-> type.$element-> name; 844 break; 845 case 'class' : 846 if ($fullpath) 847 return $b.$element-> package.$c.'/'.$element-> name.'.html'; 848 return 'top'; 849 break; 850 case 'method' : 851 case 'var' : 852 case 'const' : 853 if ($fullpath) 854 return $b.$element-> package.$c.'/'.$element-> class.'.html#'.$element> type.$element-> name; 855 return $element-> type.$element-> name; 856 break; 857 case 'tutorial' : 858 $d = ''; 859 if ($element-> section) 860 { 861 $d = '#'.$element-> section; 862 } 863 return $b.$element-> package.$c.'/tutorial_'.$element-> name.'.html'.$d; 864 } 865 } 866 867 /** 868 * Convert README/INSTALL/CHANGELOG file contents to output format 869 * @param README|INSTALL|CHANGELOG 870 * @param string contents of the file 871 */ 872 function Convert_RIC($name, $contents) 873 { 874 $this-> ric_contents[$name] = $contents; 875 $this-> ric_set[] = array('file' => 'ric_'.$name . '.html','name' => $name); 876 } 877 878 function writeRIC() 879 { 880 if ($this-> _ric_done) return; 881 $this-> _ric_done = true; 882 foreach($this-> ric_contents as $name => $contents) 883 { 884 $template = & $this-> newSmarty(); 885 $template-> assign('contents',$contents);
886 $template-> assign('name',$name); 887 $template-> assign('title',$name); 888 $this-> setTargetDir($this-> base_dir); 889 $this-> writefile('ric_'.$name . '.html',$template-> fetch('ric.tpl')); 890 } 891 } 892 893 function ConvertTodoList() 894 { 895 $todolist = array(); 896 foreach($this-> todoList as $package => $alltodos) 897 { 898 foreach($alltodos as $todos) 899 { 900 $converted = array(); 901 $converted['link'] = $this-> returnSee($todos[0]); 902 if (!is_array($todos[1])) 903 { 904 $converted['todos'][] = $todos[1]-> Convert($this); 905 } else 906 { 907 foreach($todos[1] as $todo) 908 { 909 $converted['todos'][] = $todo-> Convert($this); 910 } 911 } 912 $todolist[$package][] = $converted; 913 } 914 } 915 $templ = & $this-> newSmarty(); 916 $templ-> assign('todos',$todolist); 917 $templ-> register_outputfilter('HTMLSmarty_outputfilter'); 918 $this-> setTargetDir($this-> base_dir); 919 $this-> writefile('todolist.html',$templ-> fetch('todolist.tpl')); 920 } 921 922 /** 923 * Create errors.html template file output 924 * 925 * This method takes all parsing errors and warnings and spits them out ordered by file and line number. 926 * @global ErrorTracker We'll be using it's output facility 927 */ 928 function ConvertErrorLog() 929 { 930 global $phpDocumentor_errors; 931 $allfiles = array(); 932 $files = array(); 933 $warnings = $phpDocumentor_errors-> returnWarnings(); 934 $errors = $phpDocumentor_errors-> returnErrors(); 935 $template = & $this-> newSmarty(); 936 foreach($warnings as $warning) 937 { 938 $file = '##none'; 939 $linenum = 'Warning'; 940 if ($warning-> file) 941 { 942 $file = $warning-> file; 943 $allfiles[$file] = 1; 944 $linenum .= ' on line '.$warning-> linenum; 945 } 946 $files[$file]['warnings'][] = array('name' => $linenum, 'listing' => $warning> data); 947 } 948 foreach($errors as $error) 949 { 950 $file = '##none'; 951 $linenum = 'Error'; 952 if ($error-> file) 953 { 954 $file = $error-> file; 955 $allfiles[$file] = 1; 956 $linenum .= ' on line '.$error-> linenum; 957 } 958 $files[$file]['errors'][] = array('name' => $linenum, 'listing' => $error> data); 959 } 960 $i=1; 961 $af = array(); 962 foreach($allfiles as $file => $num)
963 { 964 $af[$i++] = $file; 965 } 966 $allfiles = $af; 967 usort($allfiles,'strnatcasecmp'); 968 $allfiles[0] = "Post-parsing" ; 969 foreach($allfiles as $i => $a) 970 { 971 $allfiles[$i] = array('file' => $a); 972 } 973 $out = array(); 974 foreach($files as $file => $data) 975 { 976 if ($file == '##none') $file = 'Post-parsing'; 977 $out[$file] = $data; 978 } 979 $template-> assign("files" ,$allfiles); 980 $template-> assign("all" ,$out); 981 $template-> assign("title" ,"phpDocumentor Parser Errors and Warnings" ); 982 $template-> register_outputfilter('HTMLSmarty_outputfilter'); 983 $this-> setTargetDir($this-> base_dir); 984 $this-> writefile("errors.html" ,$template-> fetch('errors.tpl')); 985 unset($template); 986 phpDocumentor_out("\n\nTo view errors and warnings, look at " .$this> base_dir. PATH_DELIMITER . "errors.html\n" ); 987 flush(); 988 } 989 990 function getCData($value) 991 { 992 return '<pre>' .htmlentities($value).'</pre>' ; 993 } 994 995 function getTutorialId($package,$subpackage,$tutorial,$id) 996 { 997 return $id; 998 } 999 1000 /** 1001 * Converts package page and sets its package as used in {@link $package_pages} 1002 * @param parserPackagePage 1003 */ 1004 function convertPackagepage(& $element) 1005 { 1006 phpDocumentor_out("\n" ); 1007 flush(); 1008 $template = & $this-> newSmarty(); 1009 $this-> package = $element-> package; 1010 $this-> subpackage = ''; 1011 $classleft = $this-> getClassLeft(); 1012 $template-> assign("compiledfileindex" ,$this-> getPageLeft()); 1013 $template-> assign("compiledclassindex" ,$classleft['class']); 1014 $template-> assign("compiledinterfaceindex" ,$classleft['interface']); 1015 $template-> assign("tutorials" ,$this-> getTutorialList()); 1016 $template-> assign("date" ,date("r" ,time())); 1017 $template-> assign("title" ,$this-> title); 1018 $template-> assign("package" ,$element-> package); 1019 $x = $element-> Convert($this); 1020 $x = substr($x,strpos($x,'<body' )); 1021 $template-> assign("contents" ,trim(substr($x,strpos($x,'>' ) + 1))); 1022 $this-> package_pages[$element-> package] = trim(substr($x,strpos($x,'>' ) + 1)); 1023 $template-> register_outputfilter('HTMLSmarty_outputfilter'); 1024 phpDocumentor_out("\n" ); 1025 flush(); 1026 $this-> setTargetDir($this-> base_dir); 1027 $this-> writefile("li_" .$element-> package.".html" ,$template> fetch('index.tpl')); 1028 unset($template); 1029 } 1030 1031 /** 1032 * @param parserTutorial 1033 */ 1034 function convertTutorial(& $element) 1035 { 1036 phpDocumentor_out("\n" ); 1037 flush(); 1038 $template = & parent::convertTutorial($element); 1039 $this-> package = $element-> package;
1040 $this-> subpackage = $element-> subpackage; 1041 $classleft = $this-> getClassLeft(); 1042 $template-> assign("compiledfileindex" ,$this-> getPageLeft()); 1043 $template-> assign("compiledclassindex" ,$classleft['class']); 1044 $template-> assign("compiledinterfaceindex" ,$classleft['interface']); 1045 $template-> assign("tutorials" ,$this-> getTutorialList()); 1046 $template-> assign("title" ,strip_tags($element-> getTitle($this))); 1047 $contents = $element-> Convert($this); 1048 if ($element-> name == $this-> package . '.pkg') 1049 { 1050 $this-> package_pages[$element-> package] = $contents; 1051 } 1052 $a = '../'; 1053 if (!empty($element-> subpackage)) $a .= $a; 1054 $template-> assign("subdir" ,$a); 1055 $a = ''; 1056 if ($element-> subpackage) $a = PATH_DELIMITER . $element-> subpackage; 1057 $template-> register_outputfilter('HTMLSmarty_outputfilter'); 1058 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $element-> package . $a); 1059 $this-> writeFile('tutorial_'.$element-> name.'.html',$template> fetch('tutorial.tpl')); 1060 if ($element-> name == $element-> package . '.pkg') 1061 { 1062 phpDocumentor_out("\n" ); 1063 flush(); 1064 // package-level docs 1065 $this-> setTargetDir($this-> base_dir); 1066 $template-> assign("subdir" ,''); 1067 $this-> writeFile('li_'.$element-> package.'.html',$template> fetch('tutorial.tpl')); 1068 } 1069 unset($template); 1070 } 1071 1072 /** 1073 * Converts class for template output 1074 * @see prepareDocBlock(), generateChildClassList(), generateFormattedClassTree(), getFormattedConflicts() 1075 * @see getFormattedInheritedMethods(), getFormattedInheritedVars() 1076 * @param parserClass 1077 */ 1078 function convertClass(& $element) 1079 { 1080 parent::convertClass($element); 1081 $this-> class_dir = $element-> docblock-> package; 1082 if (!empty($element-> docblock-> subpackage)) $this-> class_dir .= PATH_DELIMITER . $element-> docblock-> subpackage; 1083 $a = '../classtrees_'; 1084 if ($element-> docblock-> subpackage != '') $a = " ../$a" ; 1085 1086 $this-> class_data-> assign('subdir',$a); 1087 $this-> class_data-> assign("title" ,"Docs For Class " . $element-> getName()); 1088 $this-> class_data-> assign("page" ,$element-> getName() . '.html'); 1089 } 1090 1091 /** 1092 * Converts class variables for template output 1093 * @see prepareDocBlock(), getFormattedConflicts() 1094 * @param parserDefine 1095 */ 1096 function convertVar(& $element) 1097 { 1098 parent::convertVar($element, array('var_dest' => $this-> getId($element,false))); 1099 } 1100 1101 /** 1102 * Converts class variables for template output 1103 * @see prepareDocBlock(), getFormattedConflicts() 1104 * @param parserDefine 1105 */ 1106 function convertConst(& $element) 1107 { 1108 parent::convertConst($element, array('const_dest' => $this> getId($element,false))); 1109 } 1110 1111 /** 1112 * Converts class methods for template output 1113 * @see prepareDocBlock(), getFormattedConflicts()
1114 * @param parserDefine 1115 */ 1116 function convertMethod(& $element) 1117 { 1118 parent::convertMethod($element, array('method_dest' => $this> getId($element,false))); 1119 } 1120 1121 /** 1122 * Converts function for template output 1123 * @see prepareDocBlock(), parserFunction::getFunctionCall(), getFormattedConflicts() 1124 * @param parserFunction 1125 */ 1126 function convertFunction(& $element) 1127 { 1128 $funcloc = $this-> getId($this-> addLink($element)); 1129 parent::convertFunction($element,array('function_dest' => $this> getId($element,false))); 1130 } 1131 1132 /** 1133 * Converts include elements for template output 1134 * @see prepareDocBlock() 1135 * @param parserInclude 1136 */ 1137 function convertInclude(& $element) 1138 { 1139 parent::convertInclude($element, array('include_file' => '_'.strtr($element> getValue(),array('"' => '', "'" => '','.' => '_')))); 1140 } 1141 1142 /** 1143 * Converts defines for template output 1144 * @see prepareDocBlock(), getFormattedConflicts() 1145 * @param parserDefine 1146 */ 1147 function convertDefine(& $element) 1148 { 1149 parent::convertDefine($element, array('define_link' => $this> getId($element,false))); 1150 } 1151 1152 /** 1153 * Converts global variables for template output 1154 * @param parserGlobal 1155 * @see prepareDocBlock(), getFormattedConflicts() 1156 */ 1157 function convertGlobal(& $element) 1158 { 1159 parent::convertGlobal($element, array('global_link' => $this> getId($element,false))); 1160 } 1161 1162 /** 1163 * converts procedural pages for template output 1164 * @see prepareDocBlock(), getClassesOnPage() 1165 * @param parserData 1166 */ 1167 function convertPage(& $element) 1168 { 1169 parent::convertPage($element); 1170 $this-> juststarted = true; 1171 $this-> page_dir = $element-> parent-> package; 1172 if (!empty($element-> parent-> subpackage)) $this-> page_dir .= PATH_DELIMITER . $element-> parent-> subpackage; 1173 // registering stuff on the template 1174 $a = '../'; 1175 if (!empty($element-> docblock-> subpackage)) $a = $a . $a; 1176 $this-> page_data-> assign('subdir',$a); 1177 $this-> page_data-> assign("page" ,$this-> getPageName($element) . '.html'); 1178 $this-> page_data-> assign("title" ,"Docs for page " .$element> parent-> getFile()); 1179 } 1180 1181 function getPageName(& $element) 1182 { 1183 if (phpDocumentor_get_class($element) == 'parserpage') return '_'.$element> getName(); 1184 return '_'.$element-> parent-> getName();
1185 } 1186 1187 /** 1188 * returns an array containing the class inheritance tree from the root object to the class 1189 * 1190 * @param parserClass class variable 1191 * @return array Format: array(root,child,child,child,...,$class) 1192 * @uses parserClass::getParentClassTree() 1193 */ 1194 1195 function generateFormattedClassTree($class) 1196 { 1197 $tree = $class-> getParentClassTree($this); 1198 $out = ''; 1199 if (count($tree) - 1) 1200 { 1201 $result = array($class-> getName()); 1202 $parent = $tree[$class-> getName()]; 1203 $distance[] = ''; 1204 while ($parent) 1205 { 1206 $x = $parent; 1207 if (is_object($parent)) 1208 { 1209 $subpackage = $parent-> docblock-> subpackage; 1210 $package = $parent-> docblock-> package; 1211 $x = $parent; 1212 $x = $parent-> getLink($this); 1213 if (!$x) $x = $parent-> getName(); 1214 } 1215 $result[] = 1216 $x; 1217 $distance[] = 1218 "\n%s|\n" . 1219 "%s--" ; 1220 if (is_object($parent)) 1221 $parent = $tree[$parent-> getName()]; 1222 elseif (isset($tree[$parent])) 1223 $parent = $tree[$parent]; 1224 } 1225 $nbsp = ' '; 1226 for($i=count($result) - 1;$i>= 0;$i--) 1227 { 1228 $my_nbsp = ''; 1229 for($j=0;$j< count($result) - $i;$j++) $my_nbsp .= $nbsp; 1230 $distance[$i] = sprintf($distance[$i],$my_nbsp,$my_nbsp); 1231 } 1232 return array('classes'=> array_reverse($result),'distance'=> array_reverse($distance)); 1233 } else 1234 { 1235 return array('classes'=> $class-> getName(),'distance'=>array( '')); 1236 } 1237 } 1238 1239 /** @access private */ 1240 function sortVar($a, $b) 1241 { 1242 return strnatcasecmp($a-> getName(),$b-> getName()); 1243 } 1244 1245 /** @access private */ 1246 function sortMethod($a, $b) 1247 { 1248 if ($a-> isConstructor) return -1; 1249 if ($b-> isConstructor) return 1; 1250 return strnatcasecmp($a-> getName(),$b-> getName()); 1251 } 1252 1253 /** 1254 * returns a template-enabled array of class trees 1255 * 1256 * @param string $package package to generate a class tree for 1257 * @see $roots, HTMLConverter::getRootTree() 1258 */ 1259 function generateFormattedClassTrees($package) 1260 { 1261 if (!isset($this-> roots['normal'][$package]) && 1262 !isset($this-> roots['special'][$package])) { 1263 return array();
1264 } 1265 $trees = array(); 1266 if (isset($this-> roots['normal'][$package])) { 1267 $roots = $this-> roots['normal'][$package]; 1268 for($i=0;$i< count($roots);$i++) 1269 { 1270 $root = $this-> classes-> getClassByPackage($roots[$i], $package); 1271 if ($root && $root-> isInterface()) { 1272 continue; 1273 } 1274 $trees[] = array('class' => $roots[$i],'class_tree' => "<ul>\n" .$this-> getRootTree($this> getSortedClassTreeFromClass($roots[$i],$package,''),$package)."</ul>\n" ); 1275 } 1276 } 1277 if (isset($this-> roots['special'][$package])) { 1278 $roots = $this-> roots['special'][$package]; 1279 foreach ($roots as $parent => $classes) { 1280 $thistree = ''; 1281 foreach ($classes as $classinfo) { 1282 $root = $this-> classes-> getClassByPackage($classinfo, $package); 1283 if ($root && $root-> isInterface()) { 1284 continue; 1285 } 1286 $thistree .= 1287 $this-> getRootTree( 1288 $this-> getSortedClassTreeFromClass( 1289 $classinfo, 1290 $package, 1291 ''), 1292 $package, 1293 true); 1294 } 1295 if (!$thistree) { 1296 continue; 1297 } 1298 $trees[] = array( 1299 'class' => $parent, 1300 'class_tree' => "<ul>\n" . $thistree . "</ul>\n" 1301 ); 1302 } 1303 } 1304 return $trees; 1305 } 1306 1307 /** 1308 * returns a template-enabled array of interface inheritance trees 1309 * 1310 * @param string $package package to generate a class tree for 1311 * @see $roots, HTMLConverter::getRootTree() 1312 */ 1313 function generateFormattedInterfaceTrees($package) 1314 { 1315 if (!isset($this-> roots['normal'][$package]) && 1316 !isset($this-> roots['special'][$package])) { 1317 return array(); 1318 } 1319 $trees = array(); 1320 if (isset($this-> roots['normal'][$package])) { 1321 $roots = $this-> roots['normal'][$package]; 1322 for($i=0;$i< count($roots);$i++) 1323 { 1324 $root = $this-> classes-> getClassByPackage($roots[$i], $package); 1325 if ($root && ! $root-> isInterface()) { 1326 continue; 1327 } 1328 $trees[] = array('class' => $roots[$i],'class_tree' => "<ul>\n" .$this-> getRootTree($this> getSortedClassTreeFromClass($roots[$i],$package,''),$package)."</ul>\n" ); 1329 } 1330 } 1331 if (isset($this-> roots['special'][$package])) { 1332 $roots = $this-> roots['special'][$package]; 1333 foreach ($roots as $parent => $classes) { 1334 $thistree = ''; 1335 foreach ($classes as $classinfo) { 1336 $root = $this-> classes-> getClassByPackage($classinfo, $package); 1337 if ($root && ! $root-> isInterface()) { 1338 continue;
1339 } 1340 $thistree .= 1341 $this-> getRootTree( 1342 $this-> getSortedClassTreeFromClass( 1343 $classinfo, 1344 $package, 1345 ''), 1346 $package, 1347 true); 1348 } 1349 if (!$thistree) { 1350 continue; 1351 } 1352 $trees[] = array( 1353 'class' => $parent, 1354 'class_tree' => "<ul>\n" . $thistree . "</ul>\n" 1355 ); 1356 } 1357 } 1358 return $trees; 1359 } 1360 1361 /** 1362 * return formatted class tree for the Class Trees page 1363 * 1364 * @param array $tree output from {@link getSortedClassTreeFromClass()} 1365 * @param string $package package 1366 * @param boolean $nounknownparent if true, an object's parent will not be checked 1367 * @see Classes::$definitechild, generateFormattedClassTrees() 1368 * @return string 1369 */ 1370 function getRootTree($tree, $package, $noparent = false) 1371 { 1372 if (!$tree) return ''; 1373 $my_tree = ''; 1374 $cur = '#root'; 1375 $lastcur = array(false); 1376 $kids = array(); 1377 $dopar = false; 1378 if (!$noparent && $tree[$cur]['parent']) 1379 { 1380 $dopar = true; 1381 if (!is_object($tree[$cur]['parent'])) 1382 { 1383 // debug("parent ".$tree[$cur]['parent']." not found"); 1384 $my_tree .= '<li>' . $tree[$cur]['parent'] .'<ul>' ; 1385 } 1386 else 1387 { 1388 // debug("parent ".$this>returnSee($tree[$cur]['parent'])." in other package"); 1389 $root = $this-> classes-> getClassByPackage($tree[$cur]['parent']-> name, 1390 $package); 1391 $my_tree .= '<li>' . $this-> returnSee($tree[$cur]['parent']); 1392 if ($tree[$cur]['parent']-> package != $package) $my_tree .= ' <b>(Different package)</b><ul>' ; 1393 } 1394 } 1395 do 1396 { 1397 // fancy_debug($cur,$lastcur,$kids); 1398 if (count($tree[$cur]['children'])) 1399 { 1400 // debug("$cur has children"); 1401 if (!isset($kids[$cur])) 1402 { 1403 // debug("set $cur kids"); 1404 $kids[$cur] = 1; 1405 $root = $this-> classes-> getClassByPackage( 1406 $tree[$cur]['link']-> name, 1407 $tree[$cur]['link']-> package); 1408 if ($implements = $root-> getImplements()) { 1409 $my_tree .= '<li>' .$this-> returnSee($tree[$cur]['link']) . 1410 ' (implements '; 1411 foreach ($implements as $i => $interface) { 1412 if ($i && $i != count($implements) - 1) $my_tree .= ', '; 1413 if ($link = $this-> getLink('object ' . $interface)) { 1414 $my_tree .= $this-> returnSee($link); 1415 } else {
1416 $my_tree .= $interface; 1417 } 1418 } 1419 $my_tree .= ')'; 1420 } else { 1421 $my_tree .= '<li>' .$this-> returnSee($tree[$cur]['link']); 1422 } 1423 $my_tree .= '<ul>' ."\n" ; 1424 } 1425 array_push($lastcur,$cur); 1426 list(,$cur) = each($tree[$cur]['children']); 1427 // var_dump('listed',$cur); 1428 if ($cur) 1429 { 1430 $cur = $cur['package'] . '#' . $cur['class']; 1431 // debug("set cur to child $cur"); 1432 // $my_tree .= '<li>'.$this->returnSee($tree[$cur]['link']); 1433 continue; 1434 } else 1435 { 1436 // debug("end of children for $cur"); 1437 $cur = array_pop($lastcur); 1438 $cur = array_pop($lastcur); 1439 $my_tree .= '</ul></li>' ."\n" ; 1440 if ($dopar && ( $cur == '#root' || !$cur)) $my_tree .= '</ul></li>' ; 1441 } 1442 } else 1443 { 1444 // debug("$cur has no children"); 1445 $my_tree .= '<li>' .$this> returnSee($tree[$cur]['link'])."</li>" ; 1446 if ($dopar && $cur == '#root') $my_tree .= '</ul></li>' ; 1447 $cur = array_pop($lastcur); 1448 } 1449 } while ($cur); 1450 return $my_tree; 1451 } 1452 1453 /** 1454 * Generate indexing information for given element 1455 * 1456 * @param parserElement descendant of parserElement 1457 * @see generateElementIndex() 1458 * @return array 1459 */ 1460 function getIndexInformation($elt) 1461 { 1462 $Result['type'] = $elt-> type; 1463 $Result['file_name'] = $elt-> file; 1464 $Result['path'] = $elt-> getPath(); 1465 1466 if (isset($elt-> docblock)) 1467 { 1468 $Result['description'] = $elt-> docblock-> getSDesc($this); 1469 1470 if ($elt-> docblock-> hasaccess) 1471 $Result['access'] = $elt-> docblock-> tags['access'][0]> value; 1472 else 1473 $Result['access'] = 'public'; 1474 1475 $Result['abstract'] = isset ($elt-> docblock-> tags['abstract'][0]); 1476 } 1477 else 1478 $Result['description'] = ''; 1479 1480 $aa = $Result['description']; 1481 if (!empty($aa)) $aa = " <br> $aa" ; 1482 1483 switch($elt-> type) 1484 { 1485 case 'class': 1486 $Result['name'] = $elt-> getName(); 1487 $Result['title'] = 'Class'; 1488 $Result['link'] = $this-> getClassLink($elt-> getName(), 1489 $elt-> docblock-> package, 1490 $elt-> getPath(), 1491 $elt-> getName());
1492 $Result['listing'] = 'in file '.$elt-> file.', class '.$Result['link']." $aa" ; 1493 break; 1494 case 'define': 1495 $Result['name'] = $elt-> getName(); 1496 $Result['title'] = 'Constant'; 1497 $Result['link'] = $this-> getDefineLink($elt-> getName(), 1498 $elt-> docblock-> package, 1499 $elt-> getPath(), 1500 $elt-> getName()); 1501 $Result['listing'] = 'in file '.$elt-> file.', constant '.$Result['link']." $aa" ; 1502 break; 1503 case 'global': 1504 $Result['name'] = $elt-> getName(); 1505 $Result['title'] = 'Global'; 1506 $Result['link'] = $this-> getGlobalLink($elt-> getName(), 1507 $elt-> docblock-> package, 1508 $elt-> getPath(), 1509 $elt-> getName()); 1510 $Result['listing'] = 'in file '.$elt-> file.', global variable '.$Result['link']." $aa" ; 1511 break; 1512 case 'function': 1513 $Result['name'] = $elt-> getName(); 1514 $Result['title'] = 'Function'; 1515 $Result['link'] = $this-> getFunctionLink($elt-> getName(), 1516 $elt-> docblock-> package, 1517 $elt-> getPath(), 1518 $elt-> getName().'()'); 1519 $Result['listing'] = 'in file '.$elt-> file.', function '.$Result['link']." $aa" ; 1520 break; 1521 case 'method': 1522 $Result['name'] = $elt-> getName(); 1523 $Result['title'] = 'Method'; 1524 $Result['link'] = $this-> getMethodLink($elt-> getName(), 1525 $elt-> class, 1526 $elt-> docblock-> package, 1527 $elt-> getPath(), 1528 $elt-> class.'::'.$elt> getName().'()' 1529 ); 1530 if ($elt-> isConstructor) $Result['constructor'] = 1; 1531 $Result['listing'] = 'in file '.$elt-> file.', method '.$Result['link']." $aa" ; 1532 break; 1533 case 'var': 1534 $Result['name'] = $elt-> getName(); 1535 $Result['title'] = 'Variable'; 1536 $Result['link'] = $this-> getVarLink($elt-> getName(), 1537 $elt-> class, 1538 $elt-> docblock-> package, 1539 $elt-> getPath(), 1540 $elt-> class.'::'.$elt> getName()); 1541 $Result['listing'] = 'in file '.$elt-> file.', variable '.$Result['link']." $aa" ; 1542 break; 1543 case 'const': 1544 $Result['name'] = $elt-> getName(); 1545 $Result['title'] = 'Variable'; 1546 $Result['link'] = $this-> getConstLink($elt-> getName(), 1547 $elt-> class, 1548 $elt-> docblock-> package, 1549 $elt-> getPath(), 1550 $elt-> class.'::'.$elt> getName()); 1551 $Result['listing'] = 'in file '.$elt-> file.', class constant '.$Result['link']." $aa" ; 1552 break; 1553 case 'page': 1554 $Result['name'] = $elt-> getFile(); 1555 $Result['title'] = 'Page'; 1556 $Result['link'] = $this-> getPageLink($elt-> getFile(), 1557 $elt-> package, 1558 $elt-> getPath(), 1559 $elt-> getFile()); 1560 $Result['listing'] = 'procedural page '.$Result['link'];
1561 break; 1562 case 'include': 1563 $Result['name'] = $elt-> getName(); 1564 $Result['title'] = 'Include'; 1565 $Result['link'] = $elt-> getValue(); 1566 $Result['listing'] = 'include '.$Result['name']; 1567 break; 1568 } 1569 1570 return $Result; 1571 } 1572 1573 /** 1574 * Generate alphabetical index of all elements 1575 * 1576 * @see $elements, walk() 1577 */ 1578 function generateElementIndex() 1579 { 1580 $elementindex = array(); 1581 $letters = array(); 1582 $used = array(); 1583 foreach($this-> elements as $letter => $nutoh) 1584 { 1585 foreach($this-> elements[$letter] as $i => $yuh) 1586 { 1587 if ($this-> elements[$letter][$i]-> type != 'include') 1588 { 1589 if (!isset($used[$letter])) 1590 { 1591 $letters[]['letter'] = $letter; 1592 $elindex['letter'] = $letter; 1593 $used[$letter] = 1; 1594 } 1595 1596 $elindex['index'][] = $this-> getIndexInformation($this> elements[$letter][$i]); 1597 } 1598 } 1599 if (isset($elindex['index'])) 1600 { 1601 $elementindex[] = $elindex; 1602 } else 1603 { 1604 unset($letters[count($letters) - 1]); 1605 } 1606 $elindex = array(); 1607 } 1608 return array($elementindex,$letters); 1609 } 1610 1611 function copyMediaRecursively($media,$targetdir,$subdir = '') 1612 { 1613 $versionControlDirectories = array ('CVS', 'media/CVS', 'media\\CVS', '.svn', 'media/.svn', 'media\\.svn'); 1614 if (!is_array($media)) { 1615 return; 1616 } 1617 foreach($media as $dir => $files) 1618 { 1619 if ($dir === '/') 1620 { 1621 $this-> copyMediaRecursively($files,$targetdir); 1622 } else 1623 { 1624 if (!is_numeric($dir)) 1625 { 1626 if (in_array($dir, $versionControlDirectories)) 1627 { 1628 // skip it entirely 1629 } 1630 else 1631 { 1632 // create the subdir 1633 phpDocumentor_out(" creating $targetdir" . PATH_DELIMITER . " $dir\n" ); 1634 Converter::setTargetDir($targetdir . PATH_DELIMITER . $dir); 1635 if (!empty($subdir)) 1636 { 1637 $subdir .= PATH_DELIMITER;
1638 } 1639 $this> copyMediaRecursively($files," $targetdir/$dir" ,$subdir . $dir); 1640 } 1641 } 1642 else 1643 { 1644 // copy the file 1645 phpDocumentor_out(" copying $targetdir" . PATH_DELIMITER . $files['file']."\n" ); 1646 $this-> copyFile($files['file'],$subdir); 1647 } 1648 } 1649 } 1650 } 1651 1652 /** 1653 * calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied 1654 * @see Converter::setTargetDir() 1655 */ 1656 function setTargetDir($dir) 1657 { 1658 Converter::setTargetDir($dir); 1659 if ($this-> _wrote_tdir) return; 1660 $this-> _wrote_tdir = true; 1661 $template_images = array(); 1662 $stylesheets = array(); 1663 $tdir = $dir; 1664 $dir = $this-> templateDir; 1665 $this-> templateDir = $this-> templateDir.'templates/'; 1666 $info = new Io; 1667 $this-> copyMediaRecursively($info-> getDirTree($this-> templateDir.'media',$this> templateDir),$tdir); 1668 } 1669 1670 /** 1671 * Generate alphabetical index of all elements by package and subpackage 1672 * 1673 * @param string $package name of a package 1674 * @see $pkg_elements, walk(), generatePkgElementIndexes() 1675 */ 1676 function generatePkgElementIndex($package) 1677 { 1678 $elementindex = array(); 1679 $letters = array(); 1680 $letterind = array(); 1681 $used = array(); 1682 $subp = ''; 1683 foreach($this-> pkg_elements[$package] as $subpackage => $els) 1684 { 1685 if (empty($els)) continue; 1686 if (!empty($subpackage)) $subp = " (<b>subpackage:</b> $subpackage)" ; else $subp = ''; 1687 foreach($els as $letter => $yuh) 1688 { 1689 foreach($els[$letter] as $i => $yuh) 1690 { 1691 if ($els[$letter][$i]-> type != 'include') 1692 { 1693 if (!isset($used[$letter])) 1694 { 1695 $letters[]['letter'] = $letter; 1696 $letterind[$letter] = count($letters) - 1; 1697 $used[$letter] = 1; 1698 } 1699 $elindex[$letter]['letter'] = $letter; 1700 1701 $elindex[$letter]['index'][] = $this> getIndexInformation($els[$letter][$i]); 1702 } 1703 } 1704 } 1705 } 1706 ksort($elindex); 1707 usort($letters,'HTMLSmarty_lettersort'); 1708 if (isset($elindex)) 1709 { 1710 while(list($letter,$tempel) = each($elindex)) 1711 {
1712 if (!isset($tempel)) 1713 { 1714 unset($letters[$letterind[$tempel['letter']]]); 1715 } else 1716 $elementindex[] = $tempel; 1717 } 1718 } else $letters = array(); 1719 return array($elementindex,$letters); 1720 } 1721 1722 /** 1723 * 1724 * @see generatePkgElementIndex() 1725 */ 1726 function generatePkgElementIndexes() 1727 { 1728 $packages = array(); 1729 $package_names = array(); 1730 $pkg = array(); 1731 $letters = array(); 1732 foreach($this-> pkg_elements as $package => $trash) 1733 { 1734 $pkgs['package'] = $package; 1735 $pkg['package'] = $package; 1736 list($pkg['pindex'],$letters[$package]) = $this> generatePkgElementIndex($package); 1737 if (count($pkg['pindex'])) 1738 { 1739 $packages[] = $pkg; 1740 $package_names[] = $pkgs; 1741 } 1742 unset($pkgs); 1743 unset($pkg); 1744 } 1745 foreach($packages as $i => $package) 1746 { 1747 $pnames = array(); 1748 for($j=0;$j< count($package_names);$j++) 1749 { 1750 if ($package_names[$j]['package'] != $package['package']) $pnames[] = $package_names[$j]; 1751 } 1752 $packages[$i]['packageindexes'] = $pnames; 1753 } 1754 return array($packages,$package_names,$letters); 1755 } 1756 1757 /** 1758 * @param string name of class 1759 * @param string package name 1760 * @param string full path to look in (used in index generation) 1761 * @param boolean deprecated 1762 * @param boolean return just the URL, or enclose it in an html a tag 1763 * @return mixed false if not found, or an html a link to the class's documentation 1764 * @see parent::getClassLink() 1765 */ 1766 function getClassLink($expr,$package, $file = false,$text = false, $with_a = true) 1767 { 1768 $a = Converter::getClassLink($expr,$package,$file); 1769 if (!$a) return false; 1770 return $this-> returnSee($a, $text, $with_a); 1771 } 1772 1773 /** 1774 * @param string name of function 1775 * @param string package name 1776 * @param string full path to look in (used in index generation) 1777 * @param boolean deprecated 1778 * @param boolean return just the URL, or enclose it in an html a tag 1779 * @return mixed false if not found, or an html a link to the function's documentation 1780 * @see parent::getFunctionLink() 1781 */ 1782 function getFunctionLink($expr,$package, $file = false,$text = false) 1783 { 1784 $a = Converter::getFunctionLink($expr,$package,$file); 1785 if (!$a) return false; 1786 return $this-> returnSee($a, $text); 1787 } 1788 1789 /**
1790 * @param string name of define 1791 * @param string package name 1792 * @param string full path to look in (used in index generation) 1793 * @param boolean deprecated 1794 * @param boolean return just the URL, or enclose it in an html a tag 1795 * @return mixed false if not found, or an html a link to the define's documentation 1796 * @see parent::getDefineLink() 1797 */ 1798 function getDefineLink($expr,$package, $file = false,$text = false) 1799 { 1800 $a = Converter::getDefineLink($expr,$package,$file); 1801 if (!$a) return false; 1802 return $this-> returnSee($a, $text); 1803 } 1804 1805 /** 1806 * @param string name of global variable 1807 * @param string package name 1808 * @param string full path to look in (used in index generation) 1809 * @param boolean deprecated 1810 * @param boolean return just the URL, or enclose it in an html a tag 1811 * @return mixed false if not found, or an html a link to the global variable's documentation 1812 * @see parent::getGlobalLink() 1813 */ 1814 function getGlobalLink($expr,$package, $file = false,$text = false) 1815 { 1816 $a = Converter::getGlobalLink($expr,$package,$file); 1817 if (!$a) return false; 1818 return $this-> returnSee($a, $text); 1819 } 1820 1821 /** 1822 * @param string name of procedural page 1823 * @param string package name 1824 * @param string full path to look in (used in index generation) 1825 * @param boolean deprecated 1826 * @param boolean return just the URL, or enclose it in an html a tag 1827 * @return mixed false if not found, or an html a link to the procedural page's documentation 1828 * @see parent::getPageLink() 1829 */ 1830 function getPageLink($expr,$package, $path = false,$text = false) 1831 { 1832 $a = Converter::getPageLink($expr,$package,$path); 1833 if (!$a) return false; 1834 return $this-> returnSee($a, $text); 1835 } 1836 1837 /** 1838 * @param string name of method 1839 * @param string class containing method 1840 * @param string package name 1841 * @param string full path to look in (used in index generation) 1842 * @param boolean deprecated 1843 * @param boolean return just the URL, or enclose it in an html a tag 1844 * @return mixed false if not found, or an html a link to the method's documentation 1845 * @see parent::getMethodLink() 1846 */ 1847 function getMethodLink($expr,$class,$package, $file = false,$text = false) 1848 { 1849 $a = Converter::getMethodLink($expr,$class,$package,$file); 1850 if (!$a) return false; 1851 return $this-> returnSee($a, $text); 1852 } 1853 1854 /** 1855 * @param string name of var 1856 * @param string class containing var 1857 * @param string package name 1858 * @param string full path to look in (used in index generation) 1859 * @param boolean deprecated 1860 * @param boolean return just the URL, or enclose it in an html a tag 1861 * @return mixed false if not found, or an html a link to the var's documentation 1862 * @see parent::getVarLink() 1863 */ 1864 function getVarLink($expr,$class,$package, $file = false,$text = false) 1865 { 1866 $a = Converter::getVarLink($expr,$class,$package,$file); 1867 if (!$a) return false;
1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947
return $this-> }
returnSee($a, $text);
/** * @param string name of class constant * @param string class containing class constant * @param string package name * @param string full path to look in (used in index generation) * @param boolean deprecated * @param boolean return just the URL, or enclose it in an html a tag * @return mixed false if not found, or an html a link to the var's documentation * @see parent::getVarLink() */ function getConstLink($expr,$class,$package, $file = false,$text = false) { $a = Converter::getConstLink($expr,$class,$package,$file); if (!$a) return false; return $this-> returnSee($a, $text); } /** * does a nat case sort on the specified second level value of the array * * @param mixed $a * @param mixed $b * @return int */ function rcNatCmp ($a, $b) { $aa = strtoupper($a[$this-> rcnatcmpkey]); $bb = strtoupper($b[$this-> rcnatcmpkey]); return strnatcasecmp($aa, $bb); } /** * does a nat case sort on the specified second level value of the array. * this one puts constructors first * * @param mixed $a * @param mixed $b * @return int */ function rcNatCmp1 ($a, $b) { $aa = strtoupper($a[$this-> rcnatcmpkey]); $bb = strtoupper($b[$this-> rcnatcmpkey]); if (strpos($aa,'CONSTRUCTOR') === 0) { return -1; } if (strpos($bb,'CONSTRUCTOR') === 0) { return 1; } if (strpos($aa,strtoupper($this-> class)) === 0) { return -1; } if (strpos($bb,strtoupper($this-> class)) === 0) { return -1; } return strnatcasecmp($aa, $bb); } /** * This function is not used by HTMLdefaultConverter, but is required by Converter */ function Output() { } } /** * @access private * @global string name of the package to set as the first package */ function HTMLSmarty_pindexcmp($a, $b)
1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966
{ global $phpDocumentor_DefaultPackageName; if ($a['title'] == $phpDocumentor_DefaultPackageName) return -1; if ($b['title'] == $phpDocumentor_DefaultPackageName) return 1; return strnatcasecmp($a['title'],$b['title']); } /** @access private */ function HTMLSmarty_lettersort($a, $b) { return strnatcasecmp($a['letter'],$b['letter']); } /** @access private */ function HTMLSmarty_outputfilter($src, & $smarty) { return str_replace('{$subdir}',$smarty-> _tpl_vars['subdir'],$src); } ?>
68 69 /** 70 * This really should be in the parent class 71 */ 72 function getColor() 73 { 74 return $this-> currentColour; 75 } 76 77 function setColorArray($color) 78 { 79 $this-> setColor($color['r'], $color['g'], $color['b']); 80 } 81 82 /** 83 * Extract Pdfphp-format color from html-format color 84 * @return array 85 * @access private 86 */ 87 function _extractColor($htmlcolor) 88 { 89 preg_match('/#([a-fA-F0-9][a-fA-F0-9])([a-fA-F0-9][a-fA-F0-9])([a-fA-F0-9][a-fA-F09])/', $htmlcolor, $color); 90 if (count($color) != 4) 91 { 92 return false; 93 } 94 $red = hexdec($color[1]) / hexdec('FF'); 95 $green = hexdec($color[2]) / hexdec('FF'); 96 $blue = hexdec($color[3]) / hexdec('FF'); 97 return array('r' => $red, 'g' => $green, 'b' => $blue); 98 } 99 100 function validHTMLColor($color) 101 { 102 return $this-> _extractColor($htmlcolor); 103 } 104 105 function setHTMLColor($color) 106 { 107 fancy_debug('toplevel setting to', $color); 108 $this-> setColor($color['r'], $color['g'], $color['b']); 109 } 110 111 function textcolor($info) 112 { 113 if ($info['status'] == 'start') 114 { 115 array_push($this-> _colorStack, $this-> getColor()); 116 $color = $this-> _extractColor($info['p']); 117 if ($color) 118 { 119 // fancy_debug('set color to ',$info['p'],$color, $this->_colorStack); 120 $this-> setColorArray($color); 121 } else 122 { 123 array_pop($this-> _colorStack); 124 } 125 } elseif ($info['status'] == 'end') 126 { 127 // debug('unsetting'); 128 $this-> setColorArray(array_pop($this-> _colorStack)); 129 } 130 } 131 132 function rf($info) 133 { 134 $tmp = $info['p']; 135 $lvl = $tmp[0]; 136 $lbl = rawurldecode(substr($tmp,1)); 137 $num=$this-> ezWhatPageNumber($this-> ezGetCurrentPageNumber()); 138 $this-> reportContents[] = array($lbl,$num,$lvl ); 139 $this-> addDestination('toc'.(count($this-> reportContents)1),'FitH',$info['y']+$info['height']); 140 } 141 142 function index($info) 143 { 144 $res = explode('|||',rawurldecode($info['p'])); 145 $name = $res[0];
146 147 148 149 > 150 151 152 153 154 155 156 157 158 159 160 161 > > 162 163 164 165 166 167 168 the 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
$descrip = $res[1]; $letter = $name[0]; if ($letter == '$') $letter = $name[1]; $this-> indexContents[strtoupper($letter)][] = array($name,$descrip,$thisezWhatPageNumber($this-> ezGetCurrentPageNumber()),count($this-> reportContents) - 1); } function IndexLetter($info) { $letter = $info['p']; $this-> transaction('start'); $ok=0; while (!$ok){ $thisPageNum = $this-> ezPageCount; $this-> saveState(); $this-> setColor(0.9,0.9,0.9); $this-> filledRectangle($this-> ez['leftMargin'],$this-> y-$thisgetFontHeight(18)+$this-> getFontDecender(18),$this-> ez['pageWidth']-$thisez['leftMargin']-$this-> ez['rightMargin'],$this-> getFontHeight(18)); $this-> restoreState(); $this-> _ezText($letter,18,array('justification'=> 'left')); if ($this-> ezPageCount==$thisPageNum){ $this-> transaction('commit'); $ok=1; } else { // then we have moved onto a new page, bad bad, as the background colour will be on old one $this-> transaction('rewind'); $this-> ezNewPage(); } } } function dots($info) { // draw a dotted line over to the right and put on a page number $tmp = $info['p']; $lvl = $tmp[0]; $lbl = substr($tmp,1); $xpos = 520; switch($lvl) { case '1': $size=16; $thick=1; break; case '2': $size=14; $thick=1; break; case '3': $size=12; $thick=1; break; case '4': $size=11; $thick=1; break; } $adjust = if ($size $this-> $this-> $this-> $this-> $this-> } /** * @uses PDFParser extracts all meta-tags and processes text for output */ function ezText($text,$size=0,$options=array(),$test=0) { $text = str_replace("\t" ," " ,$text); // paragraph breaks $text = str_replace("<##P##>" ,"\n " ,$text); $text = str_replace("<<c:i" ,'< <c:i' ,$text); $text = str_replace("ilink>>" ,"ilink> >" ,$text); 0; != 16) $adjust = 1; saveState(); setLineStyle($thick,'round','',array(0,10)); line($xpos - (5*$adjust),$info['y'],$info['x']+5,$info['y']); restoreState(); addText($xpos - (5*$adjust)+5,$info['y'],$size,$lbl);
222 $this-> _save .= $text; 223 } 224 225 function setupTOC() 226 { 227 $parser = new PDFParser; 228 $parser-> parse($this-> _save,$this-> font_dir,$this); 229 $this-> _save = ''; 230 } 231 232 function ezOutput($debug = false, $template) 233 { 234 if ($debug) return $this-> _save; 235 $this-> setupTOC(); 236 if ($template) 237 { 238 uksort($this-> indexContents,'strnatcasecmp'); 239 $xpos = 520; 240 $z = 0; 241 foreach($this-> indexContents as $letter => $contents) 242 { 243 if ($z++/50 == 0) {phpDocumentor_out('.');flush();} 244 uksort($this-> indexContents[$letter],array($this> converter,'mystrnatcasecmp')); 245 } 246 $template-> assign('indexcontents',$this-> indexContents); 247 $this-> ezText($template-> fetch('index.tpl')); 248 $this-> setupTOC(); 249 } 250 return parent::ezOutput(); 251 } 252 253 function _ezText($text,$size=0,$options=array(),$test=0) 254 { 255 return parent::ezText($text,$size,$options,$test); 256 } 257 258 function getYPlusOffset($offset) 259 { 260 return $this-> y + $offset; 261 } 262 263 function addMessage($message) 264 { 265 return parent::addMessage($message); 266 phpDocumentor_out($message."\n" ); 267 flush(); 268 } 269 270 function ezProcessText($text){ 271 // this function will intially be used to implement underlining support, but could be used for a range of other 272 // purposes 273 $text = parent::ezProcessText($text); 274 $text = str_replace(array('<UL>' ,'</UL>' ,'<LI>' ,'</LI>' ,'<OL>' ,'</OL>' ,'&l t;/ol>' ,'<blockquote>' ,'</blockquote>' ), 275 array('<ul>' ,'</ul>' ,'<li>' ,'</li>' ,'<ol>' ,'</ul>' ,'</ul>' ,& quot;<C:indent:20>\n" ,"<C:indent:-20>" ),$text); 276 // $text = str_replace("<ul>\n","<ul>",$text); 277 $text = preg_replace("/\n+\s*(<ul>|<ol>)/" , "\n\\1" , $text); 278 // some problemos fixed here - hack 279 $text = preg_replace('/<text [^]]+>/' , '', $text); 280 $text = str_replace("<li>\n" ,"<li>" ,$text); 281 $text = preg_replace("/\n+\s*<li>/" , "<li>" , $text); 282 $text = str_replace("<mybr>" ,"\n" ,$text); 283 $text = str_replace('</li></ul>' ,'</ul>' ,$text); 284 $text = preg_replace("/^\n(\d+\s+.*)/" , '\\1', $text); 285 $search = array('<ul>' ,'</ul>' ,'<ol>' ,'<li>' ,'</li>' ); 286 $replace = array("<C:indent:20>\n" ,"\n<C:indent:20>" ,"\n<C:indent:20:ordered>\n" ,'<C:bullet>' ,"\n" ); 287 $text = str_replace($search,$replace,$text); 288 $text = preg_replace("/([^\n])<C:bullet/" , "\\1\n<C:bullet" , $text); 289 if (false) { 290 $fp = @fopen("C:/Documents and Settings/Owner/Desktop/pdfsourceorig.txt" ,'a'); 291 if ($fp) 292 {
293 fwrite($fp, $text); 294 fclose($fp); 295 } 296 } 297 return $text; 298 } 299 300 function indent($info) 301 { 302 $stuff = explode(':', $info['p']); 303 $margin = $stuff[0]; 304 if (count($stuff) - 1) 305 { 306 $this-> listType = 'ordered'; 307 $this-> listIndex = 1; 308 } else 309 { 310 if ($margin > 0) 311 { 312 $this-> listIndex = 1; 313 } 314 $this-> listType = 'unordered'; 315 } 316 $this-> ez['leftMargin'] += $margin; 317 } 318 319 /** 320 * @author Murray Shields 321 */ 322 function bullet($Data) 323 { 324 if ($this-> listType == 'ordered') 325 { 326 return $this-> orderedBullet($Data); 327 } 328 $D = abs($Data["decender" ]); 329 $X = $Data["x" ] - ($D * 2) - 10; 330 $Y = $Data["y" ] + ($D * 1.5); 331 $this-> setLineStyle($D, "butt" , "miter" , array()); 332 $this-> setColor(0,0,0); 333 $this-> ellipse($X, $Y, 1); 334 } 335 336 function orderedBullet($info) 337 { 338 $this-> addText($info['x']-20, $info['y']-1, 10, $this-> listIndex++ . '.'); 339 } 340 341 function ezNewPage($debug=false) 342 { 343 parent::ezNewPage(); 344 if (!$this-> set_pageNumbering) 345 { 346 $template = $this-> converter-> newSmarty(); 347 $parser = new PDFParser; 348 $parser-> parse($template-> fetch('pagenumbering.tpl'),$this> font_dir,$this); 349 } 350 $this-> set_pageNumbering = true; 351 } 352 } 353 ?>
68 class PDFParser extends Parser 69 { 70 /** 71 * Mapping of event constants to events handler function names 72 * @var array 73 * @access private 74 */ 75 var $eventHandlers 76 = array( 77 PHPDOCUMENTOR_PDF_EVENT_TEXT => 'handleText', 78 PHPDOCUMENTOR_PDF_EVENT_FONT => 'handleFont', 79 PHPDOCUMENTOR_PDF_EVENT_NEWPAGE => 'handleNewPage', 80 PARSER_EVENT_QUOTE => 'handleQuote', 81 PARSER_EVENT_NOEVENTS => 'defaultHandler', 82 PHPDOCUMENTOR_PDF_EVENT_CONTENT => 'handleContent', 83 PHPDOCUMENTOR_PDF_EVENT_PDFFUNCTION => 'handlePDFfunction', 84 ); 85 86 /** 87 * Sets up the wordparser for this class 88 */ 89 function PDFParser() 90 { 91 $this-> wp = new WordParser; 92 $this-> setupStates(); 93 } 94 /** 95 * Parse text for PDFParser XML tags, and add the text to the PDF file 96 * 97 * @param string text to parse for PDFParser XML tags 98 * @param string full path to the font directory 99 * @param phpdocpdf 100 * @param boolean determines whether output is saved in a variable or 101 * added directly to the output 102 * @staticvar integer used for recursion limiting if a handler for an event is not found 103 * @return bool 104 */ 105 function parse ($parse_data,$fontdir,& $pdf,$debug=false) 106 { 107 static $endrecur = 0; 108 $this-> _debug = $debug; 109 110 // initialize variables so E_ALL error_reporting doesn't complain 111 $pevent = 0; 112 $word = 0; 113 $this-> p_vars['event_stack'] = new EventStack; 114 $this-> p_flags['reset_quote_data'] = true; 115 $this-> p_vars['options'] = false; 116 $this-> p_vars['font_dir'] = $fontdir; 117 $this-> p_vars['text_size'] = false; 118 $this-> p_vars['pdf'] = & $pdf; 119 120 $this-> wp-> setup($parse_data); 121 $this-> wp-> setWhitespace(true); 122 123 do 124 { 125 $lpevent = $pevent; 126 $pevent = $this-> p_vars['event_stack']-> getEvent(); 127 if ($lpevent != $pevent) 128 { 129 $this-> p_vars['last_pevent'] = $lpevent; 130 } 131 132 if ($this-> p_vars['last_pevent'] != $pevent) 133 { 134 // its a new event so the word parser needs to be reconfigured 135 $this-> configWordParser($pevent); 136 } 137 138 139 $this-> p_vars['last_word'] = $word; 140 $word = $this-> wp-> getWord(); 141 142 if (PHPDOCUMENTOR_DEBUG == true) 143 { 144 echo "----------------\n" ; 145 echo "LAST: |" . $this-> p_vars['last_word'] . "|\n" ; 146 // echo "INDEX: ".$this->p_vars['curpar']."\n";
147 echo "PEVENT: " . $this-> getParserEventName($pevent) . "\n" ; 148 echo "LASTPEVENT: " . $this-> getParserEventName($this> p_vars['last_pevent']) . "\n" ; 149 echo $this-> wp-> getPos() . " WORD: |" .$word."|\n\n" ; 150 } 151 if (isset($this-> eventHandlers[$pevent])) 152 { 153 $handle = $this-> eventHandlers[$pevent]; 154 $this-> $handle($word, $pevent); 155 } else 156 { 157 debug('WARNING: possible error, no ParserPDFParser handler for event number '.$pevent); 158 if ($endrecur++ == 25) 159 { 160 die("FATAL ERROR, recursion limit reached" ); 161 } 162 } 163 } while (!($word === false)); 164 if (false) { 165 $fp = fopen("C:/Documents and Settings/Owner/Desktop/pdfsource.txt" , "a" ); 166 fwrite($fp, $this-> wp-> data); 167 fclose($fp); 168 } 169 } 170 171 /**#@+ 172 * Event Handlers 173 * @param string token 174 * @param integer event constant 175 * @access private 176 */ 177 function defaultHandler($word, $pevent) 178 { 179 if ($this-> checkEventPush($word, $pevent)) return; 180 } 181 182 /** 183 * Handles <newpage /> 184 * @tutorial ParserPDF.cls#tags.newpage 185 */ 186 function handleNewPage($word, $pevent) 187 { 188 $this-> p_vars['event_stack']-> popEvent(); 189 $this-> p_vars['pdf']-> ezNewPage($this-> _debug); 190 } 191 192 /** 193 * Handles <text></text> 194 * @tutorial ParserPDF.cls#tags.text 195 */ 196 function handleText($word, $pevent) 197 { 198 $e = $this-> checkEventPush($word, $pevent); 199 $e1 = $this-> checkEventPop($word, $pevent); 200 if ($e == PARSER_EVENT_QUOTE) return; 201 if ($e1) 202 { 203 $this-> p_flags['textcolor'] = false; 204 if (($a = $this-> p_vars['savecolor']) != $this-> p_vars['pdf']-> getColor()) 205 { 206 $this-> p_vars['pdf']-> setColor($a['r'],$a['g'],$a['b']); 207 } 208 } 209 if ($this-> p_vars['last_word'] == '<text' ) 210 { 211 // set up flags 212 $this-> p_flags['paramval'] = false; 213 $this-> p_flags['textcolor'] = false; 214 $this-> p_vars['curparam'] = false; 215 $this-> p_vars['savecolor'] = $this-> p_vars['pdf']-> getColor(); 216 $this-> p_vars['options'] = array(); 217 unset($this-> p_vars['quote_data']); 218 } 219 if (!$this-> p_flags['paramval']) 220 { 221 if ($e || $e1) return; 222 if ($word == '=')
223 { 224 // debug('set paramval '.$this->p_vars['curparam']); 225 $this-> p_flags['paramval'] = true; 226 return; 227 } 228 $this-> p_vars['curparam'] = trim($word); 229 } else 230 { 231 if ($this-> p_vars['last_pevent'] == PARSER_EVENT_QUOTE) 232 { 233 if ($this-> p_vars['curparam'] == 'size') 234 { 235 $this-> p_vars['text_size'] = (int)$this-> p_vars['quote_data']; 236 $this-> p_flags['paramval'] = false; 237 $this-> p_vars['curparam'] = false; 238 if (!$e && ! $e1) 239 { 240 $this-> p_vars['curparam'] = trim($word); 241 } 242 unset($this-> p_vars['quote_data']); 243 } elseif ($this-> p_vars['curparam'] == 'color') 244 { 245 if ($a = $this-> p_vars['pdf']-> validHTMLColor($this> p_vars['quote_data'])) 246 { 247 $this-> p_flags['textcolor'] = true; 248 $this-> p_vars['pdf']-> setHTMLColor($a); 249 } 250 } else 251 { 252 if ($this-> p_vars['quote_data'] === (string)(int)$this> p_vars['quote_data']) $this-> p_vars['quote_data'] = (int)$this-> p_vars['quote_data']; 253 // debug('added '.$this->p_vars['curparam'].' = '.$this>p_vars['quote_data']); 254 $this-> p_vars['options'][$this-> p_vars['curparam']] = $this> p_vars['quote_data']; 255 $this-> p_flags['paramval'] = false; 256 $this-> p_vars['curparam'] = false; 257 if (!$e && ! $e1) 258 { 259 $this-> p_vars['curparam'] = trim($word); 260 } 261 unset($this-> p_vars['quote_data']); 262 } 263 } 264 } 265 } 266 267 /** 268 * handles <font></font> 269 * @tutorial ParserPDF.cls#tags.font 270 */ 271 function handleFont($word, $pevent) 272 { 273 $e = $this-> checkEventPush($word, $pevent); 274 $e1 = $this-> checkEventPop($word, $pevent); 275 if ($e == PARSER_EVENT_QUOTE) return; 276 if ($this-> p_vars['last_word'] == '<font' ) 277 { 278 // set up flags 279 $this-> p_flags['paramval'] = false; 280 $this-> p_vars['curparam'] = false; 281 unset($this-> p_vars['quote_data']); 282 } 283 if (!$this-> p_flags['paramval']) 284 { 285 if ($e || $e1) return; 286 if ($word == '=') 287 { 288 //debug('set paramval '.$this->p_vars['curparam']); 289 $this-> p_flags['paramval'] = true; 290 return; 291 } 292 $this-> p_vars['curparam'] = trim($word); 293 } else 294 { 295 if ($this-> p_vars['last_pevent'] == PARSER_EVENT_QUOTE) 296 { 297 if ($this-> p_vars['curparam'] == 'face') 298 {
299 //debug('set face to '.$this->p_vars['font_dir'] . $this>p_vars['quote_data'] . '.afm'); 300 $this-> p_vars['pdf']-> selectFont($this-> p_vars['font_dir'] . $this> p_vars['quote_data'] . '.afm'); 301 $this-> p_flags['paramval'] = false; 302 $this-> p_vars['curparam'] = false; 303 unset($this-> p_vars['quote_data']); 304 } 305 } 306 } 307 } 308 309 /** 310 * handles <pdffunction> 311 * @tutorial ParserPDF.cls#tags.pdffunction 312 */ 313 function handlePDFFunction($word, $pevent) 314 { 315 $e = $this-> checkEventPush($word, $pevent); 316 $e1 = $this-> checkEventPop($word, $pevent); 317 if ($e == PARSER_EVENT_QUOTE) return; 318 if ($this-> p_vars['last_word'] == '<pdffunction:' ) 319 { 320 // set up flags 321 $this-> p_flags['paramval'] = $this-> p_flags['curparam'] = false; 322 $this-> p_flags['returnval'] = false; 323 $this-> p_vars['funcname'] = trim($word); 324 // debug("funcname is $word"); 325 $this-> p_vars['options'] = array(); 326 unset($this-> p_vars['quote_data']); 327 if ($e1) addErrorDie(PDERROR_PDFFUNCTION_NO_FUNC); 328 } 329 if (!$this-> p_flags['paramval']) 330 { 331 if ($e1) 332 { // call function, no parameters 333 $func = $this-> p_vars['funcname']; 334 if (!$func) addErrorDie(PDERROR_PDFFUNCTION_NO_FUNC); 335 if (method_exists($this-> p_vars['pdf'],$func)) 336 { 337 if (count($this-> p_vars['options'])) 338 { 339 // fancy_debug("calling function $func",$this>p_vars['options']); 340 $a = call_user_func_array(array(& $this-> p_vars['pdf'],$func), $this-> p_vars['options']); 341 } else 342 { 343 // debug("calling function $func"); 344 $a = $this-> p_vars['pdf']-> $func(); 345 } 346 if ($this-> p_flags['returnval']) 347 { 348 // debug("setting returnvar ".$this>p_vars['return_varname']); 349 $this-> tempvars[$this-> p_vars['return_varname']] = $a; 350 } 351 } else 352 { 353 addWarning(PDERROR_PDF_METHOD_DOESNT_EXIST,$func); 354 } 355 return; 356 } 357 if ($e) return; 358 if ($word == '=') 359 { 360 // debug('set paramval '.$this->p_vars['curparam']); 361 $this-> p_flags['paramval'] = true; 362 return; 363 } 364 $this-> p_vars['curparam'] = trim($word); 365 } else 366 { 367 if ($this-> p_vars['last_word'] == '=') 368 { // check to see if we should use a tempvar from a previous return 369 if (substr(trim($word),0,1) == '$') 370 { 371 if (substr(trim($word),0,7) == '$this->' ) 372 { // this is a pdf var 373 $a = substr(trim($word),7);
374 $a = $this-> p_vars['pdf']-> $a; 375 // debug("set option to $word"); 376 $this-> p_vars['options'][] = $a; 377 $this-> p_flags['paramval'] = false; 378 unset($this-> p_vars['quote_data']); 379 } else 380 { // this is a tempvar 381 if (!isset($this-> tempvars[substr(trim($word),1)])) 382 { 383 addErrorDie(PDERROR_PDF_TEMPVAR_DOESNT_EXIST,$this> p_vars['funcname'],trim($word),trim($word)); 384 } 385 $a = $this-> tempvars[substr(trim($word),1)]; 386 // debug("set option to $word"); 387 $this-> p_vars['options'][] = $a; 388 $this-> p_flags['paramval'] = false; 389 unset($this-> p_vars['quote_data']); 390 } 391 } 392 } else 393 { 394 if ($this-> p_vars['last_pevent'] == PARSER_EVENT_QUOTE) 395 { 396 if ($this-> p_vars['quote_data'] === (string)(int)$this> p_vars['quote_data']) 397 { 398 $this-> p_vars['quote_data'] = (int)$this-> p_vars['quote_data']; 399 } 400 if ($this-> p_vars['curparam'] == 'return') 401 { 402 // debug("param is return"); 403 $this-> p_vars['return_varname'] = $this-> p_vars['quote_data']; 404 $this-> p_flags['returnval'] = true; 405 } else 406 { 407 // fancy_debug("set option to arg",$this>p_vars['quote_data']); 408 $this-> p_vars['options'][] = $this-> p_vars['quote_data']; 409 } 410 $this-> p_flags['paramval'] = false; 411 unset($this-> p_vars['quote_data']); 412 } 413 } 414 if ($e1) 415 { // call function, with parameters 416 $func = $this-> p_vars['funcname']; 417 if (method_exists($this-> p_vars['pdf'],$func)) 418 { 419 if (count($this-> p_vars['options'])) 420 { 421 // fancy_debug("calling function $func",$this>p_vars['options']); 422 if ($func == 'ezImage') { 423 // set padding to 5, width to 0, resize to none 424 $this-> p_vars['options'][] = 5; 425 $this-> p_vars['options'][] = 0; 426 $this-> p_vars['options'][] = 'none'; 427 } 428 $a = call_user_func_array(array(& $this-> p_vars['pdf'],$func), $this-> p_vars['options']); 429 } else 430 { 431 // debug("calling function $func"); 432 $a = $this-> p_vars['pdf']-> $func(); 433 } 434 if ($this-> p_flags['returnval']) 435 { 436 // debug("setting returnvar ".$this>p_vars['return_varname']); 437 $this-> tempvars[$this-> p_vars['return_varname']] = $a; 438 } 439 } else 440 { 441 addWarning(PDERROR_PDF_METHOD_DOESNT_EXIST,$func); 442 } 443 } 444 } 445 } 446 447 /**
448 * Adds content to the <text> tag 449 */ 450 function handleContent($word, $pevent) 451 { 452 if ($e = $this-> checkEventPush($word, $pevent)) 453 { 454 if ($e == PHPDOCUMENTOR_PDF_EVENT_FONT) 455 { // flush content 456 if (!isset($this-> p_vars['content'])) return; 457 $this-> p_vars['pdf']-> _ezText($this-> p_vars['content'],$this> p_vars['text_size'],$this-> p_vars['options']); 458 unset($this-> p_vars['content']); 459 } 460 return; 461 } 462 if ($this-> checkEventPop($word, $pevent)) 463 { 464 $this-> wp-> backupPos($word); 465 if (!isset($this-> p_vars['content'])) return; 466 $this-> p_vars['pdf']-> _ezText($this-> p_vars['content'],$this> p_vars['text_size'],$this-> p_vars['options']); 467 unset($this-> p_vars['content']); 468 } else 469 { 470 if (!isset($this-> p_vars['content'])) $this-> p_vars['content'] = ''; 471 if (isset($this-> p_vars['quote_data'])) 472 { 473 $this-> p_vars['content'] .= $this-> p_vars['quote_data']; 474 unset($this-> p_vars['quote_data']); 475 } 476 $this-> p_vars['content'] .= $word; 477 } 478 } 479 /**#@-*/ 480 /** 481 * setup the parser tokens, and the pushEvent/popEvent arrays 482 * @see $tokens, $pushEvent, $popEvent 483 */ 484 485 function setupStates() 486 { 487 $this-> tokens[STATE_NOEVENTS] = array("<text" ,"<font" ,"<newpage />" ,"<newpage/>" ,'<pdffunction:' ,'"' ); 488 $this-> tokens[PHPDOCUMENTOR_PDF_STATE_TEXT] = array(">" ,"=" ,'"' ,"</text>" ); 489 $this-> tokens[PHPDOCUMENTOR_PDF_STATE_FONT] = array("/>" ,"=" ,'"' ); 490 $this-> tokens[PHPDOCUMENTOR_PDF_STATE_CONTENT] = array("<font" ,'<pdffunction:' ,"</text>" ); 491 $this-> tokens[PHPDOCUMENTOR_PDF_STATE_PDFFUNCTION] = array('"' ,"/>" ,"=" ," " ); 492 $this-> tokens[STATE_QUOTE] = array("\\\"" ,"\\\\" ,"\"" ); 493 $this-> tokens[STATE_ESCAPE] = false;// this tells the word parser to just cycle 494 495 // For each event word to event mapings 496 $this-> pushEvent[PARSER_EVENT_QUOTE] = 497 array( 498 "\\" => PARSER_EVENT_ESCAPE 499 ); 500 $this-> popEvent[PARSER_EVENT_QUOTE] = array("\"" ); 501 ########################## 502 $this-> pushEvent[PARSER_EVENT_NOEVENTS] = 503 array( 504 "<text" => PHPDOCUMENTOR_PDF_EVENT_TEXT, 505 "<font" => PHPDOCUMENTOR_PDF_EVENT_FONT, 506 "<newpage />" => PHPDOCUMENTOR_PDF_EVENT_NEWPAGE, 507 "<newpage/>" => PHPDOCUMENTOR_PDF_EVENT_NEWPAGE, 508 "<pdffunction:" => PHPDOCUMENTOR_PDF_EVENT_PDFFUNCTION, 509 '"' => PARSER_EVENT_QUOTE, 510 ); 511 ########################## 512 $this-> pushEvent[PHPDOCUMENTOR_PDF_EVENT_TEXT] = 513 array( 514 '"' => PARSER_EVENT_QUOTE, 515 '>' => PHPDOCUMENTOR_PDF_EVENT_CONTENT, 516 ); 517
518 $this-> popEvent[PHPDOCUMENTOR_PDF_EVENT_TEXT] = array("</text>" 519 ########################## 520 $this-> pushEvent[PHPDOCUMENTOR_PDF_EVENT_FONT] = 521 array( 522 '"' => PARSER_EVENT_QUOTE, 523 ); 524 525 $this-> popEvent[PHPDOCUMENTOR_PDF_EVENT_FONT] = array("/>" ); 526 ########################## 527 $this-> pushEvent[PHPDOCUMENTOR_PDF_EVENT_PDFFUNCTION] = 528 array( 529 '"' => PARSER_EVENT_QUOTE, 530 ); 531 532 $this-> popEvent[PHPDOCUMENTOR_PDF_EVENT_PDFFUNCTION] = array("/>" 533 ########################## 534 $this-> pushEvent[PHPDOCUMENTOR_PDF_EVENT_CONTENT] = 535 array( 536 "<font" => PHPDOCUMENTOR_PDF_EVENT_FONT, 537 "<newpage />" => PHPDOCUMENTOR_PDF_EVENT_NEWPAGE, 538 "<newpage/>" => PHPDOCUMENTOR_PDF_EVENT_NEWPAGE, 539 "<pdffunction:" => PHPDOCUMENTOR_PDF_EVENT_PDFFUNCTION, 540 ); 541 542 $this-> popEvent[PHPDOCUMENTOR_PDF_EVENT_CONTENT] = array("</text>" 543 } 544 545 /** 546 * Return the name of the parser event 547 * @param integer 548 */ 549 function getParserEventName ($value) 550 { 551 $lookup = array( 552 PARSER_EVENT_NOEVENTS => "PARSER_EVENT_NOEVENTS" , 553 PARSER_EVENT_QUOTE => "PARSER_EVENT_QUOTE" , 554 PHPDOCUMENTOR_PDF_EVENT_TEXT => "PHPDOCUMENTOR_PDF_EVENT_TEXT" 555 PHPDOCUMENTOR_PDF_EVENT_CONTENT => "PHPDOCUMENTOR_PDF_EVENT_CONTENT" , 556 PHPDOCUMENTOR_PDF_EVENT_FONT => "PHPDOCUMENTOR_PDF_EVENT_FONT" 557 PHPDOCUMENTOR_PDF_EVENT_PDFFUNCTION => "PHPDOCUMENTOR_PDF_EVENT_PDFFUNCTION" , 558 ); 559 if (isset($lookup[$value])) 560 return $lookup[$value]; 561 else return $value; 562 } 563 } 564 ?>
);
);
);
, ,
66 /** @var string always PDF */ 67 var $outputformat = 'PDF'; 68 /** @var string always default */ 69 var $name = 'default'; 70 var $curpagepackage = false; 71 var $curclasspackage = false; 72 var $smarty_dir; 73 /** 74 * @var Cezpdf 75 */ 76 var $pdf = false; 77 var $ric_set = array(); 78 /** 79 * Source files for appendix C are stored here 80 * 81 * Format: array(array(package => packagename, code => array(highlightedsource code 1, ...))) 82 * @var array 83 */ 84 var $_sourcecode; 85 /** 86 * @see Converter::Converter() 87 */ 88 function PDFdefaultConverter(& $allp, & $packp, & $classes, & $procpages, $po, $pp, $qm, $targetDir, $templateDir, $title) 89 { 90 Converter::Converter($allp, $packp, $classes, $procpages, $po, $pp, $qm, $targetDir, $templateDir, $title); 91 $this-> pdf =& new phpdocpdf($this, $this-> getConverterDir() . PATH_DELIMITER .'templates/fonts/','letter'); 92 $this-> pdf-> selectFont($this-> getConverterDir() . PATH_DELIMITER .'templates/fonts/Helvetica.afm'); 93 // put a line top and bottom on all the pages 94 $this-> pdf-> ezSetMargins(50,70,50,50); 95 $template = & $this-> newSmarty(); 96 $this-> pdf-> ezText($template-> fetch('footer.tpl')); 97 $template-> assign('title',$title); 98 if (file_exists($this-> templateDir . 'templates' . PATH_DELIMITER . 'media'. PATH_DELIMITER .'logo.jpg')) 99 { 100 $template-> assign('logo',$this-> templateDir . 'templates' . PATH_DELIMITER . 'media'. PATH_DELIMITER .'logo.jpg'); 101 } 102 $this-> pdf-> ezText($template-> fetch('title_page.tpl')); 103 unset($template); 104 } 105 106 function writeSource($path, $value) 107 { 108 $templ = & $this-> newSmarty(); 109 $pathinfo = $this-> proceduralpages-> getPathInfo($path, $this); 110 $templ-> assign('source',$value); 111 $templ-> assign('package',$pathinfo['package']); 112 $templ-> assign('subpackage',$pathinfo['subpackage']); 113 $templ-> assign('name',$pathinfo['name']); 114 $templ-> assign('source_loc',$pathinfo['source_loc']); 115 $templ-> assign('docs',$pathinfo['docs']); 116 $templ-> assign('dest', $this-> getFileSourceName($path)); 117 $this-> setSourcePaths($path); 118 $this-> _sourcecode[$pathinfo['package']][] = $templ-> fetch('filesource.tpl'); 119 } 120 121 function postProcess($text) 122 { 123 return htmlspecialchars($text); 124 } 125 126 function writeExample($title, $path, $source) 127 { 128 $templ = & $this-> newSmarty(); 129 $templ-> assign('source',$source); 130 if (empty($title)) 131 { 132 $title = 'example'; 133 addWarning(PDERROR_EMPTY_EXAMPLE_TITLE, $path, $title); 134 } 135 $templ-> assign('title',$title); 136 $templ-> assign('file',$path); 137 $this-> pdf-> ezText($templ-> fetch('examplesource.tpl')); 138 }
139 140 function getExampleLink($path, $title) 141 { 142 return ''; 143 return $this-> returnLink('{$subdir}__examplesource' . PATH_DELIMITER . 'exsource_'.$path.'.html',$title); 144 } 145 146 function getSourceLink($path) 147 { 148 // var_dump(htmlentities('<c:ilink:'.$this->getFileSourceName($path).'>Source Code for this file</c:ilink>')); 149 return '<c:ilink:' .$this-> getFileSourceName($path).'>Source Code for this file</c:ilink>' ; 150 } 151 152 function getFileSourceName($path, $anchor = '') 153 { 154 return urlencode($anchor . parent::getFileSourceName($path)); 155 } 156 157 /** 158 * Retrieve a Converter-specific anchor to a segment of a source code file 159 * parsed via a {@tutorial tags.filesource.pkg} tag. 160 * @param string full path to source file 161 * @param string name of anchor 162 * @param string link text, if this is a link 163 * @param boolean returns either a link or a destination based on this 164 * parameter 165 * @return string link to an anchor, or the anchor 166 */ 167 function getSourceAnchor($sourcefile,$anchor,$text = '',$link = false) 168 { 169 if ($link) 170 { 171 return '<c:ilink:' . $this-> getFileSourceName($sourcefile, $anchor). '>' . $text . '</c:ilink>' ; 172 } else 173 { 174 return '</text><pdffunction:addDestination arg="' .$this> getFileSourceName($sourcefile, $anchor).'" arg="FitH" arg=$this->y /><text size="8">' ; 175 } 176 } 177 178 /** 179 * Returns a bookmark using Cezpdf 009 180 * 181 * @param abstractLink a descendant of abstractlink should be passed, and never text 182 * @param string text to display in the link 183 */ 184 function returnSee(& $element, $eltext = false) 185 { 186 if (!$element) return false; 187 if (!$eltext) 188 { 189 $eltext = ''; 190 switch($element-> type) 191 { 192 case 'tutorial' : 193 $eltext = $element-> title; 194 break; 195 case 'method' : 196 case 'var' : 197 case 'const' : 198 $eltext .= $element-> class.'::'; 199 case 'page' : 200 case 'define' : 201 case 'class' : 202 case 'function' : 203 case 'global' : 204 default : 205 $eltext .= $element-> name; 206 if ($element-> type == 'function' || $element-> type == 'method') $eltext .= '()'; 207 break; 208 } 209 } 210 switch ($element-> type) 211 {
212 case 'tutorial' : 213 return '<c:ilink:' .urlencode($element-> type.$element-> package.$element> subpackage.$element-> name.$element-> section).'>' .$eltext.'</c:ilink>' ; 214 case 'page' : 215 return '<c:ilink:' .urlencode($element-> type.$element-> package.$element> path).'>' .$eltext.'</c:ilink>' ; 216 case 'define' : 217 case 'global' : 218 case 'class' : 219 case 'function' : 220 return '<c:ilink:' .urlencode($element-> type.$element-> package.$element> name).'>' .$eltext.'</c:ilink>' ; 221 case 'method' : 222 case 'var' : 223 case 'const' : 224 return '<c:ilink:' .urlencode($element-> type.$element-> package.$element> class.'::'.$element-> name).'>' .$eltext.'</c:ilink>' ; 225 } 226 return $element; 227 } 228 229 /** 230 * @param string 231 * @param string 232 * @return string <c:alink:$link>$text</c:alink> 233 */ 234 function returnLink($link,$text) 235 { 236 return " <c:alink: $link> $text</c:alink> " ; 237 } 238 239 /** 240 * Convert README/INSTALL/CHANGELOG file contents to output format 241 * @param README|INSTALL|CHANGELOG 242 * @param string contents of the file 243 */ 244 function Convert_RIC($name, $contents) 245 { 246 $this-> ric_set[$name] = $contents; 247 } 248 249 function convertDocBlock(& $element) 250 { 251 if (!$element-> docblock) return; 252 $template = & $this-> newSmarty(); 253 254 $nopackage = true; 255 if ($element-> type == 'page' || $element-> type == 'class') $nopackage = false; 256 $tagses = $element-> docblock-> listTags(); 257 $tags = array(); 258 $names = array('staticvar' => 'Static Variable','deprec' => 'Deprecated','abstract' => 'Abstract Element','todo' => 'TODO'); 259 if (!$nopackage) 260 { 261 $tags[] = array('keyword' => 'Package','data' => $element-> docblock> package); 262 if (!empty($element-> docblock-> subpackage)) $tags[] = array('keyword' => 'Sub-Package','data' => $element-> docblock-> subpackage); 263 } 264 if ($element-> docblock-> var) 265 { 266 $a = $element-> docblock-> var-> Convert($this); 267 if (!empty($a)) 268 $tags[] = array('keyword' => 'Var', 'data' => $a); 269 } 270 if ($element-> docblock-> funcglobals) 271 foreach($element-> docblock-> funcglobals as $global => $val) 272 { 273 if ($a = $this-> getGlobalLink($global,$element-> docblock-> package)) 274 { 275 $global = $a; 276 } 277 $b = Converter::getLink($val[0]); 278 if (is_object($b) && phpDocumentor_get_class($b) == 'classlink') 279 { 280 $val[0] = $this-> returnSee($b); 281 } 282 $tags[] = array('keyword' => 'Global Variable Used','data' => $val[0].' '.$global.': '.$val[1]-> Convert($this)); 283 }
284 285 286 287 288 > 289 290 291 292 293 294 > 295 296 297 298 299 > 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 > 319 320 321 > 322 323 324 325 > 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 > 343 344 345 346 347 348 349 350 351 352 353 354 355 356
if ($element-> docblock-> statics) foreach($element-> docblock-> statics as $static => $val) { $a = $val-> Convert($this); $tags[] = array('keyword' => 'Static Variable Used','data' => $valconverted_returnType.' '.$static.': '.$a); } if ($element-> docblock-> properties) foreach($element-> docblock-> properties as $property => $val) { $a = $val-> Convert($this); $tags[] = array('keyword' => ucfirst($val-> keyword),'data' => $valconverted_returnType.' '.$property.': '.$a); } foreach($tagses as $tag) { if (isset($names[$tag-> keyword])) $tag-> keyword = $names[$tag-> keyword]; $tags[] = array("keyword" => ucfirst($tagkeyword),"data" => $tag-> Convert($this)); } $utags = array(); foreach($element-> docblock-> unknown_tags as $keyword => $t) { foreach($t as $tag) $utags[] = array('keyword' => $keyword, 'data' => $tag-> Convert($this)); } if ($element-> type == 'packagepage') return; $sdesc = $element-> docblock-> getSDesc($this); $desc = $element-> docblock-> getDesc($this); $template-> assign('utags',$utags); $template-> assign('tags',$tags); $template-> assign('sdesc',$sdesc); $template-> assign('desc',$desc); if (false) // $element->type != 'page') { if ($element-> type != 'var' && $element-> type != 'method') { $this-> pdf-> addDestination(urlencode($element-> type.$elementdocblock-> package.$element-> name),'FitH',$this-> pdf-> y); } else { $this-> pdf-> addDestination(urlencode($element-> type.$elementdocblock-> package.$element-> class.'::'.$element-> name),'FitH',$this-> pdf-> y); } } elseif (false) { $this-> pdf-> addDestination(urlencode('page'.$element-> parentpackage.$element-> parent-> getPath()),'FitH',$this-> pdf-> y); } $this-> convertParams($element); $this-> pdf-> ezText($template-> fetch('docblock.tpl')); } function convertParams(& $element) { if ($element-> type != 'function' && $element-> type != 'method') return; if (count($element-> docblock-> params)) { $template = & $this-> newSmarty(); $params = array(); if (count($element-> docblock-> params)) foreach($element-> docblock-> params as $param => $val) { $a = $val-> Convert($this); $params[] = array("name" => $param,"type" => $valconverted_returnType,"description" => $a); } $template-> assign('params',$params); $this-> pdf-> ezText($template-> fetch('params.tpl')); } } function convertGlobal(& $element) { $sdesc = ''; if ($element-> docblock-> sdesc) { $sdesc = $element-> docblock-> sdesc-> } $template = & $this-> newSmarty();
Convert($this);
357 $template-> assign('linenumber',$element-> getLineNumber()); 358 if ($this-> hasSourceCode($element-> getPath())) 359 $template-> assign('slink',$this-> getSourceAnchor($element-> getPath(),$element> getLineNumber(),$element-> getLineNumber(),true)); 360 else 361 $template-> assign('slink', false); 362 $template-> assign('dest', urlencode($element-> type.$element-> docblock> package.$element-> name)); 363 $template-> assign('type',$element-> getDataType($this)); 364 $template-> assign('name',$element-> name); 365 $template-> assign('value',$this-> getGlobalValue($element-> getValue())); 366 $template-> assign('sdesc',$sdesc); 367 $this-> pdf-> ezText($template-> fetch('global.tpl')); 368 $this-> convertDocBlock($element); 369 } 370 371 function getGlobalValue($value) 372 { 373 return parent::getGlobalValue(htmlspecialchars($value)); 374 } 375 376 function convertMethod(& $element) 377 { 378 $sdesc = ''; 379 if ($element-> docblock-> sdesc) 380 { 381 $sdesc = $element-> docblock-> sdesc-> Convert($this); 382 } 383 $params = array(); 384 if (count($element-> docblock-> params)) 385 foreach($element-> docblock-> params as $param => $val) 386 { 387 $a = $val-> Convert($this); 388 $params[$param] = array("var" => $param,"datatype" => $val-> converted_returnType,"data" => $a); 389 } 390 if ($element-> docblock-> return) 391 { 392 if (!$element-> docblock-> return-> returnType) $element-> docblock> return-> returnType = 'void'; 393 } 394 $template = & $this-> newSmarty(); 395 $template-> assign('class',$this-> class); 396 $template-> assign('constructor',$element-> isConstructor); 397 $template-> assign('dest', urlencode($element-> type.$element-> docblock> package.$element-> class.'::'.$element-> name)); 398 $template-> assign('linenumber',$element-> getLineNumber()); 399 if ($this-> hasSourceCode($element-> getPath())) 400 $template-> assign('slink',$this-> getSourceAnchor($element-> getPath(),$element> getLineNumber(),$element-> getLineNumber(),true)); 401 else 402 $template-> assign('slink',false); 403 $ret = 'void'; 404 if ($element-> docblock-> return) 405 { 406 $ret = $element-> docblock-> return-> returnType; 407 } 408 $template-> assign('return',$ret); 409 $template-> assign('functioncall',$element-> getFunctionCall()); 410 $template-> assign('intricatefunctioncall',$element> getIntricateFunctionCall($this,$params)); 411 $template-> assign('sdesc',$sdesc); 412 $this-> pdf-> ezText($template-> fetch('method.tpl')); 413 $this-> convertDocBlock($element); 414 } 415 416 function convertVar(& $element) 417 { 418 $sdesc = ''; 419 if ($element-> docblock-> sdesc) 420 { 421 $sdesc = $element-> docblock-> sdesc-> Convert($this); 422 } 423 $template = & $this-> newSmarty(); 424 $template-> assign('class',$this-> class); 425 $template-> assign('linenumber',$element-> getLineNumber()); 426 if ($this-> hasSourceCode($element-> getPath())) 427 $template-> assign('slink',$this-> getSourceAnchor($element-> getPath(),$element> getLineNumber(),$element-> getLineNumber(),true)); 428 else
429 430 431 432 > 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 > 451 452 453 454 > 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 > 470 471 472 473 > 474 475 476 477 478 479 480 481 > 482 483 484 485 > 486 487 488 489 490 491 492 493 494 495 496 497 498 499 > 500
$template-> assign('slink',false); $template-> assign('type',$element-> docblock-> var-> returnType); $template-> assign('name',$element-> name); $template-> assign('dest', urlencode($element-> type.$element-> docblockpackage.$element-> class.'::'.$element-> name)); $template-> assign('value',$element-> value); $template-> assign('sdesc',$sdesc); $this-> pdf-> ezText($template-> fetch('var.tpl')); $this-> convertDocBlock($element); } function convertConst(& $element) { $sdesc = ''; if ($element-> docblock-> sdesc) { $sdesc = $element-> docblock-> sdesc-> Convert($this); } $template = & $this-> newSmarty(); $template-> assign('class',$this-> class); $template-> assign('linenumber',$element-> getLineNumber()); if ($this-> hasSourceCode($element-> getPath())) $template-> assign('slink',$this-> getSourceAnchor($element-> getPath(),$elementgetLineNumber(),$element-> getLineNumber(),true)); else $template-> assign('slink',false); $template-> assign('name',$element-> name); $template-> assign('dest', urlencode($element-> type.$element-> docblockpackage.$element-> class.'::'.$element-> name)); $template-> assign('value',$element-> value); $template-> assign('sdesc',$sdesc); $this-> pdf-> ezText($template-> fetch('const.tpl')); $this-> convertDocBlock($element); } function convertClass(& $element) { $template = & $this-> newSmarty(); if ($this-> curclasspackage != $element-> docblock-> package) { $template-> assign('includeheader',true); if (isset($this-> package_pages[$element-> docblock-> package])) { $template-> assign('ppage',$this-> package_pages[$element-> docblockpackage]); $template-> assign('isclass',true); unset($this-> package_pages[$element-> docblock-> package]); } $template-> assign('classeslink',rawurlencode("Package " .$elementdocblock-> package." Classes" )); } $sdesc = ''; if ($element-> docblock-> sdesc) { $sdesc = $element-> docblock-> sdesc-> Convert($this); } $this-> curclasspackage = $element-> docblock-> package; $template-> assign('dest', urlencode($element-> type.$element-> docblockpackage.$element-> name)); $template-> assign('package',$element-> docblock-> package); $template-> assign('linenumber',$element-> getLineNumber()); if ($this-> hasSourceCode($element-> getPath())) $template-> assign('slink',$this-> getSourceAnchor($element-> getPath(),$elementgetLineNumber(),$element-> getLineNumber(),true)); else $template-> assign('slink',false); $template-> assign('name',$element-> name); $template-> assign('sdesc',$sdesc); $this-> pdf-> ezText($template-> fetch('class.tpl')); $this-> convertDocBlock($element); } function convertInclude(& $element) { $template = & $this-> newSmarty(); $template-> assign('linenumber',$element-> getLineNumber()); if ($this-> hasSourceCode($element-> getPath())) $template-> assign('slink',$this-> getSourceAnchor($element-> getLineNumber(),$element-> getLineNumber(),true)); else
getPath(),$element-
501 $template-> assign('slink',false); 502 $template-> assign('name',$element-> name); 503 $template-> assign('value',$this-> getIncludeValue($element-> getValue(), $element-> getPath())); 504 $this-> pdf-> ezText($template-> fetch('include.tpl')); 505 $this-> convertDocBlock($element); 506 } 507 508 function convertFunction(& $element) 509 { 510 $sdesc = ''; 511 if ($element-> docblock-> sdesc) 512 { 513 $sdesc = $element-> docblock-> sdesc-> Convert($this); 514 } 515 $params = array(); 516 if (count($element-> docblock-> params)) 517 foreach($element-> docblock-> params as $param => $val) 518 { 519 $a = $val-> Convert($this); 520 $params[$param] = array("var" => $param,"datatype" => $val-> converted_returnType,"data" => $a); 521 } 522 if (!$element-> docblock-> return) 523 { 524 $element-> docblock-> return-> returnType = 'void'; 525 } 526 $template = & $this-> newSmarty(); 527 $template-> assign('dest', urlencode($element-> type.$element-> docblock> package.$element-> name)); 528 $template-> assign('linenumber',$element-> getLineNumber()); 529 if ($this-> hasSourceCode($element-> getPath())) 530 $template-> assign('slink',$this-> getSourceAnchor($element-> getPath(),$element> getLineNumber(),$element-> getLineNumber(),true)); 531 else 532 $template-> assign('slink',false); 533 $template-> assign('return',$element-> docblock-> return-> returnType); 534 $template-> assign('functioncall',$element-> getFunctionCall()); 535 $template-> assign('intricatefunctioncall',$element> getIntricateFunctionCall($this,$params)); 536 $template-> assign('sdesc',$sdesc); 537 $this-> pdf-> ezText($template-> fetch('function.tpl')); 538 $this-> convertDocBlock($element); 539 } 540 541 function convertDefine(& $element) 542 { 543 $sdesc = ''; 544 if ($element-> docblock-> sdesc) 545 { 546 $sdesc = $element-> docblock-> sdesc-> Convert($this); 547 } 548 $template = & $this-> newSmarty(); 549 $template-> assign('linenumber',$element-> getLineNumber()); 550 if ($this-> hasSourceCode($element-> getPath())) 551 $template-> assign('slink',$this-> getSourceAnchor($element-> getPath(),$element> getLineNumber(),$element-> getLineNumber(),true)); 552 else 553 $template-> assign('slink',false); 554 $template-> assign('name',$element-> name); 555 $template-> assign('dest', urlencode($element-> type.$element-> docblock> package.$element-> name)); 556 $template-> assign('value',$element-> value); 557 $template-> assign('sdesc',$sdesc); 558 $this-> pdf-> ezText($template-> fetch('define.tpl')); 559 $this-> convertDocBlock($element); 560 } 561 562 function convertPage(& $element) 563 { 564 $template = & $this-> newSmarty(); 565 $template-> assign('includeheader',false); 566 $sdesc = ''; 567 if ($element-> docblock-> sdesc) 568 { 569 $sdesc = $element-> docblock-> sdesc-> Convert($this); 570 } 571 if (count($element-> elements) || ($sdesc) || count($element-> docblock-> tags)) 572 { 573 if ($this-> curpagepackage != $element-> parent-> package)
574 { 575 $template-> assign('includeheader',true); 576 if (isset($this-> package_pages[$element-> parent-> package])) 577 { 578 $template-> assign('ppage',$this-> package_pages[$element-> parent> package]); 579 unset($this-> package_pages[$element-> parent-> package]); 580 } 581 } 582 $this-> curpagepackage = $element-> parent-> package; 583 $template-> assign('dest', urlencode('page'.$element-> parent> package.$element-> parent-> getPath())); 584 $template-> assign('sdesc',$sdesc); 585 $template-> assign('package',$element-> parent-> package); 586 $template-> assign('name',$element-> parent-> file); 587 $this-> pdf-> ezText($template-> fetch('page.tpl')); 588 $this-> convertDocBlock($element); 589 } 590 } 591 592 593 /** 594 * Used to translate an XML DocBook tag from a tutorial by reading the 595 * options.ini file for the template. 596 * @param string tag name 597 * @param string any attributes Format: array(name => value) 598 * @param string the tag contents, if any 599 * @param string the tag contents, if any, unpost-processed 600 * @return string 601 */ 602 function TranslateTag($name,$attr,$cdata,$unconvertedcdata) 603 { 604 if ($name == 'example' && @ $attr['role'] == 'html') 605 { 606 $cdata = htmlspecialchars($cdata); 607 $unconvertedcdata = htmlspecialchars($unconvertedcdata); 608 } 609 if ($name == 'programlisting' && @ $attr['role'] == 'php') 610 { 611 $unconvertedcdata = strtr($unconvertedcdata, array_flip(get_html_translation_table(HTML_SPECIALCHARS))); 612 $a = parent::TranslateTag($name, $attr, $cdata, $unconvertedcdata); 613 // var_dump(htmlspecialchars($cdata), htmlspecialchars($unconvertedcdata), htmlspecialchars($a)); 614 return $a; 615 } 616 return parent::TranslateTag($name, $attr, $cdata, $unconvertedcdata); 617 } 618 619 function getPageName(& $element) 620 { 621 if (phpDocumentor_get_class($element) == 'parserpage') return $element-> getName(); 622 return $element-> parent-> getName(); 623 } 624 625 function getTutorialId($package,$subpackage,$tutorial,$id) 626 { 627 return 'tutorial'.$package.$subpackage.$tutorial.$id; 628 } 629 630 function getCData($value) 631 { 632 return str_replace(array('<c:' ,'<C:' ),array("<c:" ,"<C:" ),$value); 633 } 634 635 /** 636 * @deprecated html package pages just don't work with PDF, use {@tutorial tutorials.pkg} 637 */ 638 function convertPackagepage(& $element) 639 { 640 $x = $element-> Convert($this); 641 $x = substr($x,strpos($x,'<body' )); 642 $this-> package_pages[$element-> package] = trim(substr($x,strpos($x,'>' ) + 1,strpos($x,'</body>' ) - 6)); 643 } 644 645 function convertTutorial(& $element) 646 { 647 $x = $element-> Convert($this, true);
648 $template = & $this-> newSmarty(); 649 $template-> assign('package',$element-> package); 650 $template-> assign('subpackage',$element-> subpackage); 651 $template-> assign('contents',$x); 652 $template-> assign('title',$element-> getTitle($this)); 653 $template-> assign('child',$element-> parent); 654 if (isset($element-> parent-> parent)) $template-> assign('hasparent',$element> parent-> parent); 655 $template-> assign('element',$element); 656 $this-> pdf-> ezText($template-> fetch('tutorial.tpl')); 657 } 658 659 /** 660 * returns a template-enabled array of class trees 661 * 662 * @param string $package package to generate a class tree for 663 * @see $roots, getRootTree() 664 */ 665 function generateFormattedClassTrees($package) 666 { 667 if (!isset($this-> roots[$package])) return array(); 668 $roots = $trees = array(); 669 $roots = $this-> roots[$package]; 670 for($i=0;$i< count($roots);$i++) 671 { 672 $trees[] = array('class' => $roots[$i],'class_tree' => "<ul>\n" .$this-> getRootTree($this> getSortedClassTreeFromClass($roots[$i],$package,''),$package)."</ul>\n" ); 673 } 674 return $trees; 675 } 676 677 /** 678 * return formatted class tree for the Class Trees page 679 * 680 * @param array $tree output from {@link getSortedClassTreeFromClass()} 681 * @see Classes::$definitechild, generateFormattedClassTrees() 682 * @return string 683 */ 684 function getRootTree($tree,$package) 685 { 686 if (!$tree) return ''; 687 $my_tree = ''; 688 $cur = '#root'; 689 $lastcur = array(false); 690 $kids = array(); 691 $dopar = false; 692 if ($tree[$cur]['parent']) 693 { 694 $dopar = true; 695 if (!is_object($tree[$cur]['parent'])) 696 { 697 // debug("parent ".$tree[$cur]['parent']." not found"); 698 $my_tree .= '<li>' . $tree[$cur]['parent'] .'<ul>' ; 699 } 700 else 701 { 702 // debug("parent ".$this->returnSee($tree[$cur]['parent'], false, false)." in other package"); 703 $my_tree .= '<li>' . $this-> returnSee($tree[$cur]['parent'], false, false); 704 if ($tree[$cur]['parent']-> package != $package) $my_tree .= ' <b>(Different package)</b><ul>' ; 705 } 706 } 707 do 708 { 709 // fancy_debug($cur,$lastcur,$kids); 710 if (count($tree[$cur]['children'])) 711 { 712 // debug("$cur has children"); 713 if (!isset($kids[$cur])) 714 { 715 // debug("set $cur kids"); 716 $kids[$cur] = 1; 717 $my_tree .= '<li>' .$this-> returnSee($tree[$cur]['link'], false, false); 718 $my_tree .= '<ul>' ."\n" ; 719 } 720 array_push($lastcur,$cur);
721 list(,$cur) = each($tree[$cur]['children']); 722 // var_dump('listed',$cur); 723 if ($cur) 724 { 725 $cur = $cur['package'] . '#' . $cur['class']; 726 // debug("set cur to child $cur"); 727 // $my_tree .= '<li>'.$this->returnSee($tree[$cur]['link'], false, false); 728 continue; 729 } else 730 { 731 // debug("end of children for $cur"); 732 $cur = array_pop($lastcur); 733 $cur = array_pop($lastcur); 734 $my_tree .= '</ul></li>' ."\n" ; 735 if ($dopar && ( $cur == '#root' || !$cur)) $my_tree .= '</ul></li>' ; 736 } 737 } else 738 { 739 // debug("$cur has no children"); 740 $my_tree .= '<li>' .$this-> returnSee($tree[$cur]['link'], false, false)."</li>" ; 741 if ($dopar && $cur == '#root') $my_tree .= '</ul></li>' 742 $cur = array_pop($lastcur); 743 } 744 } while ($cur); 745 return $my_tree; 746 } 747 748 /** 749 * calls {@link Cezpdf::ezOutput()} and writes documentation.pdf to targetDir 750 */ 751 function Output($title = 'Generated Documentation') 752 { 753 phpDocumentor_out("Generating PDF file.." ); 754 flush(); 755 $template = & $this-> newSmarty(); 756 $this-> pdf-> ezText($template-> fetch('appendix_title_page.tpl')); 757 $trees = array(); 758 foreach($this-> all_packages as $package => $rest) 759 { 760 if (!isset($this-> pkg_elements[$package])) continue; 761 $a = array(); 762 phpDocumentor_out('.'); 763 flush(); 764 $a['package'] = $package; 765 $a["trees" ] = $this-> generateFormattedClassTrees($package); 766 $trees[] = $a; 767 } 768 $template-> assign('trees',$trees); 769 $this-> pdf-> ezText($template-> fetch('classtree.tpl')); 770 phpDocumentor_out('.'); 771 if (count($this-> ric_set)) 772 $this-> pdf-> ezText($template-> fetch('ric_title_page.tpl')); 773 foreach($this-> ric_set as $name => $contents) 774 { 775 $template-> assign('contents',$contents); 776 $template-> assign('name',$name); 777 $this-> pdf-> ezText($template-> fetch('ric.tpl')); 778 } 779 if (count($this-> _sourcecode)) 780 { 781 $this-> pdf-> ezText($template-> fetch('source_title_page.tpl')); 782 $template-> assign('source',$this-> _sourcecode); 783 $this-> pdf-> ezText($template-> fetch('source_loop.tpl')); 784 } 785 flush(); 786 if (count($this-> todoList)) 787 { 788 $todolist = array(); 789 foreach($this-> todoList as $package => $alltodos) 790 { 791 foreach($alltodos as $todos) 792 { 793 $converted = array(); 794 $converted['link'] = $this-> returnSee($todos[0]); 795 if (!is_array($todos[1])) 796 { 797 $converted['todos'][] = $todos[1]-> Convert($this);
798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877
Convert($this);
$this-> pdf-> ezText($template-> fetch('todolist.tpl')); } if (false) { $fp = @fopen("C:/Documents and Settings/Owner/Desktop/pdfsourceorig.txt" if ($fp) { $a = $this-> pdf-> ezOutput(true); // debug fwrite($fp, $a, strlen($a)); fclose($fp); } } $this-> pdf-> setupTOC(); $template-> assign('contents',$this-> pdf-> reportContents); $this-> pdf-> ezText($template-> fetch('toc.tpl')); $x = $this-> pdf-> ezOutput(false, $template); phpDocumentor_out("done\n" ); flush(); $this-> writeFile("documentation.pdf" , $x, true); } function mystrnatcasecmp($a,$b) { return strnatcasecmp($a[0],$b[0]); } /** * @param string name of class * @param string package name * @param string full path to look in (used in index generation) * @return mixed false if not found, or an html a link to the class's documentation * @see parent::getClassLink() */ function getClassLink($expr,$package, $file = false,$text = false) { $a = Converter::getClassLink($expr,$package,$file); if (!$a) return false; return $this-> returnSee($a, $text); }
,'w');
/** * @param string name of function * @param string package name * @param string full path to look in (used in index generation) * @param boolean deprecated * @return mixed false if not found, or an html a link to the function's documentation * @see parent::getFunctionLink() */ function getFunctionLink($expr,$package, $file = false,$text = false) { $a = Converter::getFunctionLink($expr,$package,$file); if (!$a) return false; return $this-> returnSee($a, $text); } /** * @param string name of define * @param string package name * @param string full path to look in (used in index generation) * @param boolean deprecated * @return mixed false if not found, or an html a link to the define's documentation * @see parent::getDefineLink() */ function getDefineLink($expr,$package, $file = false,$text = false) { $a = Converter::getDefineLink($expr,$package,$file); if (!$a) return false; return $this-> returnSee($a, $text);
878 } 879 880 /** 881 * @param string name of global variable 882 * @param string package name 883 * @param string full path to look in (used in index generation) 884 * @param boolean deprecated 885 * @return mixed false if not found, or an html a link to the global variable's documentation 886 * @see parent::getGlobalLink() 887 */ 888 function getGlobalLink($expr,$package, $file = false,$text = false) 889 { 890 $a = Converter::getGlobalLink($expr,$package,$file); 891 if (!$a) return false; 892 return $this-> returnSee($a, $text); 893 } 894 895 /** 896 * @param string name of procedural page 897 * @param string package name 898 * @param string full path to look in (used in index generation) 899 * @param boolean deprecated 900 * @return mixed false if not found, or an html a link to the procedural page's documentation 901 * @see parent::getPageLink() 902 */ 903 function getPageLink($expr,$package, $path = false,$text = false) 904 { 905 $a = Converter::getPageLink($expr,$package,$path); 906 if (!$a) return false; 907 return $this-> returnSee($a, $text); 908 } 909 910 /** 911 * @param string name of method 912 * @param string class containing method 913 * @param string package name 914 * @param string full path to look in (used in index generation) 915 * @param boolean deprecated 916 * @return mixed false if not found, or an html a link to the method's documentation 917 * @see parent::getMethodLink() 918 */ 919 function getMethodLink($expr,$class,$package, $file = false,$text = false) 920 { 921 $a = Converter::getMethodLink($expr,$class,$package,$file); 922 if (!$a) return false; 923 return $this-> returnSee($a, $text); 924 } 925 926 /** 927 * @param string name of var 928 * @param string class containing var 929 * @param string package name 930 * @param string full path to look in (used in index generation) 931 * @param boolean deprecated 932 * @param boolean return just the URL, or enclose it in an html a tag 933 * @return mixed false if not found, or an html a link to the var's documentation 934 * @see parent::getVarLink() 935 */ 936 function getVarLink($expr,$class,$package, $file = false,$text = false) 937 { 938 $a = Converter::getVarLink($expr,$class,$package,$file); 939 if (!$a) return false; 940 return $this-> returnSee($a, $text); 941 } 942 943 /** 944 * @param string name of class constant 945 * @param string class containing class constant 946 * @param string package name 947 * @param string full path to look in (used in index generation) 948 * @param boolean deprecated 949 * @param boolean return just the URL, or enclose it in an html a tag 950 * @return mixed false if not found, or an html a link to the var's documentation 951 * @see parent::getConstLink() 952 */ 953 function getConstLink($expr,$class,$package, $file = false,$text = false) 954 { 955 $a = Converter::getConstLink($expr,$class,$package,$file);
956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981
if (!$a) return false; return $this-> returnSee($a, $text); } function setTemplateDir($dir) { Converter::setTemplateDir($dir); $this-> smarty_dir = $this-> templateDir; } /** @return 1 always the same */ function getState() { return 1; } /** * @see parent::unmangle() */ function unmangle($notused,$source) { $source = str_replace("\n","<mybr>",$source); return $source; }
// } ?>
65 var $processSpecialRoots = true; 66 /** 67 * XMLDocBookConverter wants elements sorted by type as well as alphabetically 68 * @see Converter::$sort_page_contents_by_type 69 * @var boolean 70 */ 71 var $sort_page_contents_by_type = true; 72 /** @var string */ 73 var $outputformat = 'XML'; 74 /** @var string */ 75 var $name = 'DocBook/peardoc2'; 76 /** 77 * indexes of elements by package that need to be generated 78 * @var array 79 */ 80 var $leftindex = array('classes' => true, 'pages' => false, 'functions' => false, 'defines' => true, 'globals' => true); 81 /** 82 * whether a @see is going to be in the {@link $base_dir}, or in a package/subpackage subdirectory of $base_dir 83 * @var boolean 84 */ 85 var $local = true; 86 87 /** 88 * name of current page being converted 89 * @var string 90 */ 91 var $page; 92 93 /** 94 * path of current page being converted 95 * @var string 96 */ 97 var $path; 98 99 /** 100 * name of current class being converted 101 * @var string 102 */ 103 var $class; 104 105 /** 106 * template for the procedural page currently being processed 107 * @var Template 108 */ 109 var $page_data; 110 111 /** 112 * output directory for the current procedural page being processed 113 * @var string 114 */ 115 var $page_dir; 116 117 /** 118 * Constants, used for constants.tpl 119 * @var array 120 */ 121 var $_peardoc2_constants = false; 122 123 /** 124 * Global Variables, used for globals.tpl 125 * @var array 126 */ 127 var $_peardoc2_globals = false; 128 129 /** 130 * target directory passed on the command-line. 131 * {@link $targetDir} is malleable, always adding package/ and package/subpackage/ subdirectories onto it. 132 * @var string 133 */ 134 var $base_dir; 135 136 /** 137 * output directory for the current class being processed 138 * @var string 139 */ 140 var $class_dir; 141
142 /** 143 * template for the class currently being processed 144 * @var Template 145 */ 146 var $class_data; 147 148 /** 149 * array of converted package page names. 150 * Used to link to the package page in the left index 151 * @var array Format: array(package => 1) 152 */ 153 var $package_pages = array(); 154 155 /** 156 * Contents of the packagename.xml file are stored in this template variable 157 * @var Smarty 158 */ 159 var $packagexml; 160 /** 161 * controls formatting of parser informative output 162 * 163 * Converter prints: 164 * "Converting /path/to/file.php... Procedural Page Elements... Classes..." 165 * Since HTMLdefaultConverter outputs files while converting, it needs to send a \n to start a new line. However, if there 166 * is more than one class, output is messy, with multiple \n's just between class file output. This variable prevents that 167 * and is purely cosmetic 168 * @var boolean 169 */ 170 var $juststarted = false; 171 172 /** 173 * contains all of the template procedural page element loop data needed for the current template 174 * @var array 175 */ 176 var $current; 177 178 /** 179 * contains all of the template class element loop data needed for the current template 180 * @var array 181 */ 182 var $currentclass; 183 184 /** 185 * Pass elements by package, simplifies generation of package.xml/category.xml 186 */ 187 var $sort_absolutely_everything = true; 188 /** 189 * template options. Currently only 1 recognized option usepear 190 * 191 * usepear tells the getLink() function to return a package link to PEAR and PEAR_ERROR if possible, and to link directly 192 * to the fully-delimited link package#class.method or package#file.method in PEAR style, if possible, even if the 193 * package is not parsed. This will allow parsing of separate PEAR packages without parsing the entire thing at once! 194 * @var array 195 */ 196 var $template_options = array('usepear' => false); 197 198 var $function_data = array(); 199 var $method_data = array(); 200 var $_write_constants_xml = array(); 201 var $_write_globals_xml = array(); 202 var $sourceloc = ''; 203 /** 204 * peardoc2 Category 205 * @var string 206 */ 207 var $category; 208 /** 209 * Used to re-format output so that it's easy for translators to handle 210 * 211 * @var XML_Beautifier|false 212 * @access private 213 */ 214 var $_beautifier = false; 215
216 /** 217 * sets {@link $base_dir} to $targetDir 218 * @see Converter() 219 */ 220 function XMLDocBookpeardoc2Converter(& $allp, & $packp, & $classes, & $procpages, $po, $pp, $qm, $targetDir, $templateDir, $title) 221 { 222 if (!class_exists('XML_Beautifier')) { 223 @include_once 'XML/Beautifier.php'; 224 } 225 Converter::Converter($allp, $packp, $classes, $procpages,$po, $pp, $qm, $targetDir, $templateDir, $title); 226 if (class_exists('XML_Beautifier')) { 227 require_once 'phpDocumentor/Converters/XML/DocBook/peardoc2/Beautifier.php'; 228 $this-> _beautifier = new phpDocumentor_peardoc2_XML_Beautifier; 229 $this-> _beautifier-> setOption('indent', ' '); 230 } 231 $this-> base_dir = $targetDir; 232 } 233 234 /** 235 * do that stuff in $template_options 236 */ 237 function & getLink($expr, $package = false, $packages = false) 238 { 239 return Converter::getLink($expr, $package, $packages); 240 } 241 242 function unmangle($s,$sourcecode) 243 { 244 return '<programlisting role="php"><![CDATA[ 245 '.$sourcecode.']]></programlisting>' ; 246 } 247 248 /** 249 * Writes a file to target dir, beautify any .xml files first 250 * @param string filename 251 * @param string file contents 252 * @param boolean true if the data is binary and not text 253 */ 254 function writeFile($file,$data,$binary = false) 255 { 256 if ($this-> _beautifier && substr($file, -4) == '.xml') { 257 $ret = $this-> _beautifier-> formatString($data); 258 if (PEAR::isError($ret)) { 259 addWarning(PDERROR_BEAUTIFYING_FAILED, $ret-> getMessage()); 260 $ret = $data; 261 } 262 $data = $ret; 263 } 264 return parent::writeFile($file, $data, $binary); 265 } 266 267 /** 268 * Used to convert the {@}example} inline tag in a docblock. 269 * 270 * By default, this just wraps ProgramExample 271 * @see XMLDocBookpeardoc2Converter::exampleProgramExample 272 * @param string 273 * @param boolean true if this is to highlight a tutorial <programlisting> 274 * @return string 275 */ 276 function exampleProgramExample($example, $tutorial = false, $inlinesourceparse = null/*false*/, 277 $class = null/*false*/, $linenum = null/*false*/, $filesourcepath = null/*false*/) 278 { 279 return '<example><title>Example</title><programlisting role="php"><![CDATA[' . 280 $example . ']]></programlisting></example>' ; 281 $this-> ProgramExample($example, $tutorial, $inlinesourceparse, $class, $linenum, $filesourcepath) 282 . '</example>' ; 283 } 284 285 function writeExample($title, $path, $source) 286 { 287 $this-> _save_example = array($title, $source); 288 } 289
290 function getExampleLink($unused, $title) 291 { 292 $source = $this-> _save_example[1]; 293 return '<para><example><title>' . $title . '</title>' . $source . '</example></para>' ; 294 } 295 296 function type_adjust($typename) 297 { 298 if (isset($this-> template_options['typechanging'][trim($typename)])) 299 return $this-> template_options['typechanging'][trim($typename)]; 300 $a = $this-> getLink($typename); 301 if (is_object($a)) 302 { 303 if (phpDocumentor_get_class($a) == 'classlink') 304 return '<classname>' .$typename.'</classname>' ; 305 if (phpDocumentor_get_class($a) == 'functionlink' || phpDocumentor_get_class($a) == 'methodlink') 306 return '<function>' .$typename.'</function>' ; 307 if (phpDocumentor_get_class($a) == 'definelink') 308 return '<constant>' .$typename.'</constant>' ; 309 if (phpDocumentor_get_class($a) == 'varlink') 310 return '<varname>' .$typename.'</varname>' ; 311 } 312 return $typename; 313 } 314 315 /** 316 * Writes out the template file of {@link $class_data} and unsets the template to save memory 317 * @see registerCurrentClass() 318 * @see parent::endClass() 319 * @todo move class summary into an array to be written out at the end 320 * of parsing each package 321 */ 322 function endClass() 323 { 324 $a = '../'; 325 if (!empty($this-> subpackage)) $a .= '../'; 326 if ($this-> juststarted) 327 { 328 $this-> juststarted = false; 329 phpDocumentor_out("\n" ); 330 flush(); 331 } 332 foreach($this-> method_data as $func) 333 { 334 $func[0]-> assign("phpdocversion" ,PHPDOCUMENTOR_VER); 335 $func[0]-> assign("phpdocwebsite" ,PHPDOCUMENTOR_WEBSITE); 336 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . strtolower($this> category) . PATH_DELIMITER . strtolower($this-> class_dir . PATH_DELIMITER . str_replace(array('_','.'),array('-','--'),$this-> class))); 337 $this-> writefile(strtolower($func[1] ). '.xml','<!-- $' . "Revision$ ->\n" . $func[0]-> fetch('method.tpl')); 338 } 339 // code below is in packagename.xml handling, see Output() 340 /* $this->setTargetDir($this->base_dir . PATH_DELIMITER . strtolower($this>category) . PATH_DELIMITER . strtolower($this->class_dir)); 341 $this->writefile(str_replace(array('_','.'),array('-','--'),strtolower($this>class)) . '.xml',$this->class_data->fetch('class.tpl'));*/ 342 unset($this-> class_data); 343 } 344 345 function addSummaryToPackageXml($template_output) 346 { 347 $this-> packagexml-> append('ids',$template_output); 348 } 349 350 /** 351 * @param parserClass|false$element is false if this is the end of all conversion 352 */ 353 function flushPackageXml($element) 354 { 355 if (isset($this-> packagexml)) 356 { 357 if (!$element || $element-> docblock-> package != $this-> package) // finished with package 358 { 359 if (isset($this-> _write_constants_xml[$this-> category][$this> package]) &&
360 $this-> _write_constants_xml[$this-> category][$this-> package]) 361 { 362 $this-> packagexml-> append('ids', 363 '&package.' . 364 strtolower($this-> category.'.' . 365 str_replace(array('_','.'),array('-','--'),$this> package).'.constants;')); 366 $this-> _write_constants_xml[$this-> category][$this-> package] = false; 367 } 368 if (isset($this-> _write_globals_xml[$this-> category][$this-> package]) && 369 $this-> _write_globals_xml[$this-> category][$this-> package]) 370 { 371 $this-> packagexml-> append('ids', 372 '&package.' .strtolower($this-> category.'.' . 373 str_replace(array('_','.'),array('-','--'),$this> package).'.globals;')); 374 $this-> _write_globals_xml[$this-> category][$this-> package] = false; 375 } 376 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . strtolower($this> category)); 377 $this-> writefile(str_replace('_','-',strtolower($this-> package)).'.xml', 378 '<!-- $' . "Revision$ -->\n" . $this-> packagexml> fetch('package.tpl')); 379 $this-> packagexml-> clear_all_assign(); 380 if ($element) { 381 $this-> packagexml-> assign('package',$element-> docblock> package); 382 $this-> packagexml-> assign('ids',array()); 383 $this-> packagexml-> assign('id',$this-> getId($element, true)); 384 } 385 } 386 } else 387 { 388 $this-> packagexml = $this-> newSmarty(); 389 $this-> packagexml-> assign('package',$element-> docblock-> package); 390 $this-> packagexml-> assign('ids',array()); 391 $this-> packagexml-> assign('id',$this-> getId($element, true)); 392 } 393 } 394 395 /** 396 * @param string 397 * @param string 398 * @return string <ulink url="'.$link.'">'.$text.'</ulink> 399 */ 400 function returnLink($link,$text) 401 { 402 return '<ulink url="' .$link.'">' .$text.'</ulink>' ; 403 } 404 405 function makeLeft() 406 { 407 } 408 409 /** 410 * Does nothing 411 */ 412 function formatPkgIndex() 413 { 414 } 415 416 /** 417 * Does nothing 418 */ 419 function formatIndex() 420 { 421 } 422 423 /** 424 * Does nothing 425 */ 426 function writeNewPPage($key) 427 { 428 } 429 430 /** 431 * Does nothing 432 */
433 function writeSource() 434 { 435 } 436 437 /** 438 * Creates package/lang/categoryname/packagename.xml for each package 439 */ 440 function formatLeftIndex() 441 { 442 $this-> makeLeft(); 443 } 444 445 /** 446 * This function takes an {@link abstractLink} descendant and returns an html link 447 * 448 * @param abstractLink a descendant of abstractlink should be passed, and never text 449 * @param string text to display in the link 450 * @param boolean this parameter is not used, and is deprecated 451 * @param boolean determines whether the returned text is enclosed in an <link> tag 452 */ 453 function returnSee(& $element, $eltext = false, $local = true, $with_a = true) 454 { 455 if (!$element) return false; 456 if (!$eltext) 457 { 458 $eltext = ''; 459 switch($element-> type) 460 { 461 case 'tutorial' : 462 $eltext = $element-> title; 463 break; 464 case 'class' : 465 $eltext = '<classname>' .$element-> name.'</classname>' ; 466 break; 467 case 'method' : 468 $eltext .= '<function>' ; 469 case 'var' : 470 if ($element-> type == 'var') $eltext .= '<varname>' ; 471 $eltext .= $element-> class.'::'; 472 case 'page' : 473 case 'define' : 474 if ($element-> type == 'define') 475 $eltext .= '<constant>' ; 476 case 'function' : 477 if ($element-> type == 'function') 478 $eltext .= '<function>' ; 479 case 'global' : 480 default : 481 $eltext .= $element-> name; 482 if ($element-> type == 'function' || $element-> type == 'method') $eltext .= '</function>' ; 483 if ($element-> type == 'var') $eltext .= '</varname>' ; 484 if ($element-> type == 'define') $eltext .= '</constant>' ; 485 break; 486 } 487 } elseif (!is_object($element)) { 488 return false; 489 } elseif ($element-> type == 'method') 490 { 491 $eltext = str_replace($element-> name . '()', $element-> name, $eltext); 492 } 493 494 if ($element-> type == 'page' || $element-> type == 'function' || $element-> type == 'var') 495 { // we ignore all procedural pages, instead, constant, function and 496 // global variable pages are output 497 return $eltext; 498 } 499 if ($element-> type == 'class') 500 { 501 return '<link linkend="' .$this-> getId($element).'summary">' .$eltext.'</link>' ; 502 } 503 return '<link linkend="' .$this> getId($element).'">' .$eltext.'</link>' ; 504 } 505 506 /** 507 * Get the id value needed to allow linking 508 * @param mixed descendant of parserElement or parserData/parserPage
509 * @param boolean true to return the id for the package page 510 * @see parserElement, parserData, parserPage 511 * @return string the id value for this element type 512 */ 513 function getId(& $el, $returnpackage = false) 514 { 515 if (phpDocumentor_get_class($el) == 'parserdata') 516 { 517 $element = $this-> addLink($el-> parent); 518 $elp = $el-> parent; 519 } elseif (!is_a($el,'abstractlink')) 520 { 521 $elp = $el; 522 $element = $this-> addLink($el); 523 } else $element = $el; 524 $a = ''; 525 if (!empty($element-> subpackage)) 526 { 527 $a = str_replace(array('_','.'),array('-','--'),$element-> subpackage).'.'; 528 } 529 if ($returnpackage) return 'package.'.strtolower($element> category.'.'.str_replace(array('_','.'),array('-','--'),$element-> package)); 530 switch ($element-> type) 531 { 532 case 'page' : 533 return 'package.'.strtolower($element> category.'.'.str_replace(array('_','.'),array('-','--'),$element-> package).'.'.$a.$element> fileAlias); 534 break; 535 case 'define' : 536 return 'package.'.strtolower($element> category.'.'.str_replace(array('_','.'),array('-','--'),$element> package).'.constants.details.'.$element-> fileAlias); 537 break; 538 case 'global' : 539 return 'package.'.strtolower($element> category.'.'.str_replace(array('_','.'),array('-','--'),$element> package).'.globals.details.'.$element-> fileAlias); 540 break; 541 case 'class' : 542 return 'package.'.strtolower($element> category.'.'.str_replace(array('_','.'),array('-','--'),$element> package).'.'.$a.str_replace(array('_','.'),array('-','--'),$element-> name)); 543 break; 544 case 'function' : 545 return 'package.'.strtolower($element> category.'.'.str_replace(array('_','.'),array('-','--'),$element-> package).'.'.$a.$element> fileAlias.'.'.str_replace('_','-',$element-> name)); 546 break; 547 case 'method' : 548 return 'package.'.strtolower($element> category.'.'.str_replace(array('_','.'),array('-','--'),$element> package).'.'.$a.str_replace(array('_','.'),array('-','--'),$element> class).'.'.str_replace('_','-',$element-> name)); 549 break; 550 case 'var' : 551 return 'package.'.strtolower($element> category.'.'.str_replace(array('_','.'),array('-','--'),$element> package).'.'.$a.str_replace(array('_','.'),array('-','--'),$element-> class).'summary.vars.'.str_replace(array('$','_'),array('var--','-'),$element-> name)); 552 break; 553 case 'tutorial' : 554 return 'package.'.strtolower($element> category.'.'.str_replace(array('_','.'),array('-','--'),$element> package).'.'.$a.str_replace(array('_','.'),array('-','--'),$element-> name)).'-tutorial'; 555 break; 556 } 557 } 558 559 /** 560 * Create errors.html template file output 561 * 562 * This method takes all parsing errors and warnings and spits them out ordered by file and line number. 563 * @global ErrorTracker We'll be using it's output facility 564 */ 565 function ConvertErrorLog() 566 { 567 global $phpDocumentor_errors; 568 $allfiles = array();
569 $files = array(); 570 $warnings = $phpDocumentor_errors-> returnWarnings(); 571 $errors = $phpDocumentor_errors-> returnErrors(); 572 $template = & $this-> newSmarty(); 573 foreach($warnings as $warning) 574 { 575 $file = '##none'; 576 $linenum = 'Warning'; 577 if ($warning-> file) 578 { 579 $file = $warning-> file; 580 $allfiles[$file] = 1; 581 $linenum .= ' on line '.$warning-> linenum; 582 } 583 $files[$file]['warnings'][] = array('name' => $linenum, 'listing' => $warning> data); 584 } 585 foreach($errors as $error) 586 { 587 $file = '##none'; 588 $linenum = 'Error'; 589 if ($error-> file) 590 { 591 $file = $error-> file; 592 $allfiles[$file] = 1; 593 $linenum .= ' on line '.$error-> linenum; 594 } 595 $files[$file]['errors'][] = array('name' => $linenum, 'listing' => $error> data); 596 } 597 $i=1; 598 $af = array(); 599 foreach($allfiles as $file => $num) 600 { 601 $af[$i++] = $file; 602 } 603 $allfiles = $af; 604 usort($allfiles,'strnatcasecmp'); 605 $allfiles[0] = "Post-parsing" ; 606 foreach($allfiles as $i => $a) 607 { 608 $allfiles[$i] = array('file' => $a); 609 } 610 $out = array(); 611 foreach($files as $file => $data) 612 { 613 if ($file == '##none') $file = 'Post-parsing'; 614 $out[$file] = $data; 615 } 616 $template-> assign("files" ,$allfiles); 617 $template-> assign("all" ,$out); 618 $template-> assign("title" ,"phpDocumentor Parser Errors and Warnings" ); 619 $this-> setTargetDir($this-> base_dir); 620 $this-> writefile("errors.html" ,$template-> fetch('errors.tpl')); 621 unset($template); 622 phpDocumentor_out("\n\nTo view errors and warnings, look at " .$this> base_dir. PATH_DELIMITER . "errors.html\n" ); 623 flush(); 624 } 625 626 function postProcess($text) 627 { 628 return str_replace("'" , ''' , htmlentities($text)); 629 } 630 631 function prepareDocBlock(& $element, $nopackage = true) 632 { 633 $a = new parserStringWithInlineTags; 634 $a-> add('no exceptions thrown'); 635 if (!$element-> docblock-> getKeyword('throws')) $element-> docblock> addKeyword('throws',$a); 636 $tags = parent::prepareDocBlock($element, 637 array('staticvar' => 'note','deprec' => 'deprecated', 638 'abstract' => 'abstract','TODO' => 'note', 'link' => 'see', 639 'uses' => 'see', 'usedby' => 'see', 'tutorial' => 'see', 640 'return' => 'returns', 'access' => false), $nopackage); 641 $ret = array(); 642 foreach($tags['tags'] as $tag) 643 {
644 if ($tag['keyword'] == 'return') 645 { 646 // hack because stupid Converter isn't doing its job 647 $tag['keyword'] = 'returns'; 648 } 649 $ret[$tag['keyword']][] = $tag; 650 } 651 $tags['tags'] = $ret; 652 $tags['sdesc'] = $this-> wordwrap($tags['sdesc']); 653 return $tags; 654 } 655 656 function getTutorialId($package,$subpackage,$tutorial,$id,$category) 657 { 658 $subpackage = (empty($subpackage) ? '' : '.'.$subpackage); 659 $id = (empty($id) ? '' : '.'.$id); 660 return 'package.'.strtolower($category.'.'.$package.$subpackage.str_replace(array('_','.'),array('-','-'),$tutorial).$id); 661 } 662 663 664 /** 665 * Retrieve a Converter-specific anchor to a segment of a source code file 666 * parsed via a {@tutorial tags.filesource.pkg} tag. 667 * 668 * NOTE: unused 669 * @param string full path to source file 670 * @param string name of anchor 671 * @param string link text, if this is a link 672 * @param boolean returns either a link or a destination based on this 673 * parameter 674 * @return string link to an anchor, or the anchor 675 */ 676 function getSourceAnchor($sourcefile,$anchor,$text = '',$link = false) 677 { 678 return ''; 679 } 680 681 function Br($input) 682 { 683 return " $input\n" ; 684 } 685 686 function getCData($value) 687 { 688 return '<![CDATA[' .$value.']]>' ; 689 } 690 691 function ProgramExample($listing, $tutorial = false, $inlinesourceparse = null/*false*/, 692 $class = null/*false*/, $linenum = null/*false*/, $filesourcepath = null/*false*/, $origsource = null) 693 { 694 if ($origsource !== null) { 695 $listing = $origsource; 696 } 697 if (!tokenizer_ext) 698 { 699 $listing = $this-> getCData($listing); 700 } 701 return '<programlisting role="php">' . $this-> getCData($listing) . '</programlisting>' ; 702 } 703 704 /** 705 * Does nothing - use tutorials for DocBook 706 * @param parserPackagePage 707 */ 708 function convertPackagePage(& $element) 709 { 710 } 711 712 /** 713 * Convert tutorials for output 714 * @param parserTutorial 715 */ 716 function convertTutorial(& $element) 717 { 718 $template = & parent::convertTutorial($element); 719 phpDocumentor_out("\n" );
720 flush(); 721 $x = $element-> Convert($this,false); 722 if ($element-> ini) 723 { // add child tutorial list to the tutorial through a slight hack :) 724 $subtutorials = ''; 725 $b = ''; 726 if (!empty($element-> subpackage)) $b = '.'.$element-> subpackage; 727 foreach($element-> ini['Linked Tutorials'] as $child) 728 { 729 $subtutorials .= ' &' .$element-> category.'.'.$element> package.$b.'.'.str_replace(array('_','.'),array('-','--'),$child).'-'.$element> tutorial_type."-tutorial;\n" ; 730 } 731 $x = str_replace('</refsect1></refentry>' ,'</refsect1> 732 <refsect1> 733 <title>Related Docs</title> 734 <para> 735 '.$subtutorials. 736 ' </para> 737 </refsect1></refentry>' ,$x); 738 } 739 $template-> assign('contents',$x); 740 $contents = $template-> fetch('tutorial.tpl'); 741 $a = ''; 742 if ($element-> subpackage) $a = PATH_DELIMITER . $element-> subpackage; 743 phpDocumentor_out("\n" ); 744 flush(); 745 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . str_replace(array('_','.'),array('-','--'),strtolower($element-> category)) 746 . PATH_DELIMITER . strtolower(str_replace(array('_','.'),array('-','--'),$element> package) . $a)); 747 $this-> writeFile(str_replace(array('_','.'),array('-','--'),strtolower($element> name)).'-tutorial.xml', 748 '<!-- $' . "Revision$ -->\n" . $contents); 749 } 750 751 /** 752 * Does nothing in this converter 753 * @param parserVar 754 */ 755 function convertVar(& $element) 756 { 757 return; 758 $docblock = $this-> prepareDocBlock($element); 759 $b = 'mixed'; 760 if ($element-> docblock-> var) 761 { 762 $b = $element-> docblock-> var-> converted_returnType; 763 } 764 // var_dump($this->getFormattedOverrides($element)); 765 if (isset($this-> template_options['separatepage']) && $this> template_options['separatepage']) 766 $this-> class_summary-> append('vars',array('sdesc' => $docblock['sdesc'], 767 'desc' => $docblock['desc'], 768 'tags' => $docblock['tags'], 769 'var_name' => $this-> type_adjust($element> getName()), 770 'var_default' => htmlspecialchars($element> getValue()), 771 'var_type' => $b, 772 'var_overrides' => $this> getFormattedOverrides($element), 773 'line_number' => $element-> getLineNumber(), 774 'id' => $this-> getId($element))); 775 else 776 $this-> class_data-> append('vars',array('sdesc' => $docblock['sdesc'], 777 'desc' => $docblock['desc'], 778 'tags' => $docblock['tags'], 779 'var_name' => $this-> type_adjust($element> getName()), 780 'var_default' => htmlspecialchars($element> getValue()), 781 'var_type' => $b, 782 'var_overrides' => $this> getFormattedOverrides($element), 783 'line_number' => $element-> getLineNumber(), 784 'id' => $this-> getId($element))); 785 } 786 787 /**
788 * Converts class for template output 789 * @param parserClass 790 * @uses flushPackageXml() creates packagename.xml file when all classes in 791 * a package have been converted 792 */ 793 function convertClass(& $element) 794 { 795 $this-> flushPackageXml($element); 796 parent::convertClass($element); 797 $docblock = $this-> prepareDocBlock($element); 798 $this-> method_data = array(); 799 $this-> class_dir = str_replace(array('_','.'),array('-','--'),$element-> docblock> package); 800 $this-> package = $element-> docblock-> package; 801 $this-> category = strtolower($element-> docblock-> category); 802 if (!empty($element-> docblock-> subpackage)) $this-> class_dir .= PATH_DELIMITER . $element-> docblock-> subpackage; 803 $docblock = $this-> prepareDocBlock($element,false); 804 $this-> class_data-> assign("sdesc" ,$docblock['sdesc']); 805 $this-> class_data-> assign("desc" ,$docblock['desc']); 806 $this-> class_data-> assign("tags" ,$docblock['tags']); 807 808 $this-> class_data-> assign("source_location" ,$element> getSourceLocation($this,$this-> template_options['usepear'])); 809 $this-> class_data-> assign("id" ,$this-> getId($element)); 810 $this-> class_data-> assign("method_ids" ,array()); 811 $this-> left[$this-> package][] = array('link' => $this-> getId($element).'summary'); 812 if ($t = $element-> getTutorial()) 813 { 814 $this-> class_data-> append("method_ids" ,$this-> getId($t)); 815 } 816 817 if (isset($this-> template_options['separatepage']) && $this> template_options['separatepage']) 818 { 819 $this-> class_summary = & $this-> newSmarty(true); 820 if ($t = $element-> getTutorial()) 821 { 822 $this-> class_summary-> assign("tutorial" ,$this> returnSee($t)); 823 } 824 825 $this-> class_summary-> assign("class_name" ,$this> type_adjust($element-> getName())); 826 $this-> class_summary-> assign("sdesc" ,$docblock['sdesc']); 827 $this-> class_summary-> assign("desc" ,$docblock['desc']); 828 $this-> class_summary-> assign("tags" ,$docblock['tags']); 829 $this-> class_summary-> assign("vars" ,array()); 830 $this-> class_summary-> assign("methods" ,array()); 831 $this-> class_summary-> assign("package" ,$element-> docblock> package); 832 833 $this-> class_summary-> assign("children" , $this> generateChildClassList($element)); 834 $this-> class_summary-> assign("class_tree" , $this> generateFormattedClassTree($element)); 835 $this-> class_summary-> assign("conflicts" , $this> getFormattedConflicts($element,"classes" )); 836 837 $this-> class_summary-> assign("source_location" ,$element> getSourceLocation($this,$this-> template_options['usepear'])); 838 $this-> class_summary-> assign("id" ,$this-> getId($element).'summary'); 839 $this-> class_data-> append("method_ids" ,$this> getId($element).'.'.strtolower(str_replace('_','-',$element-> getName())).'-summary'); 840 $inherited_methods = $this-> getFormattedInheritedMethods($element); 841 if (!empty($inherited_methods)) 842 { 843 $this-> class_summary-> assign("imethods" ,$inherited_methods); 844 } 845 $inherited_vars = $this-> getFormattedInheritedVars($element); 846 // variables are irrelevant in peardoc2 847 if (false)//!empty($inherited_vars)) 848 { 849 $this-> class_summary-> assign("ivars" ,$inherited_vars); 850 } 851 $this-> addSummaryToPackageXml($this-> class_summary> fetch('class_summary.tpl')); 852 }
853 $this-> sourceloc = $element-> getSourceLocation($this,$this> template_options['usepear']); 854 } 855 856 /** 857 * Converts method for template output 858 * @see prepareDocBlock(), parserMethod::getFunctionCall(), getFormattedDescMethods(), getFormattedOverrides() 859 * @param parserMethod 860 */ 861 function convertMethod(& $element) 862 { 863 $docblock = $this-> prepareDocBlock($element); 864 $returntype = 'void'; 865 if ($element-> docblock-> return) 866 { 867 $a = $element-> docblock-> return-> Convert($this); 868 $returntype = $element-> docblock-> return-> converted_returnType; 869 if ($returntype != $element-> docblock-> return-> returnType) 870 { 871 $returntype = " <replaceable> $returntype</replaceable> " ; 872 } 873 } 874 $params = array(); 875 if (count($element-> docblock-> params)) 876 foreach($element-> docblock-> params as $param => $val) 877 { 878 $a = $val-> Convert($this); 879 $b = explode(' ',$a); 880 $c = ''; 881 foreach($b as $blah) { 882 if (!empty($c)) { 883 $c .= ' '; 884 } 885 $c .= str_replace(array('true', 'false', 'null'), array('&true;' , '&false;' , '&null;' ), $blah); 886 } 887 $params[$param] = array("var" => $param,"datatype" => str_replace(array('true', 'false', 'null'), array('&true;' , '&false;' , '&null;' ), 888 $val-> returnType), "cdatatype" => $val> converted_returnType,"data" => $this-> wordwrap($c)); 889 } 890 891 $call = $element-> getIntricateFunctionCall($this, $params); 892 if (isset($call['params'])) 893 { 894 foreach($call['params'] as $i => $param) 895 { 896 if (!is_string($call['params'][$i]['default'])) 897 { 898 continue; 899 } 900 $call['params'][$i]['default'] = str_replace(array('true', 'false', 'null'), array('&true;' , '&false;' , '&null;' ), $param['default']); 901 } 902 } 903 $this-> packagexml-> append('ids','&' .$this-> getId($element).';'); 904 $this-> class_data-> append('method_ids',$this-> getId($element)); 905 $this-> class_summary-> append('methods',array('id' => $this-> getId($element), 906 'sdesc' => $docblock['sdesc'], 907 'desc' => $docblock['desc'], 908 'tags' => $docblock['tags'], 909 'is_constructor' => $element> isConstructor, 910 'function_name' => $element-> getName(), 911 'function_return' => $returntype, 912 'function_call' => $call, 913 'descmethod' => $this> getFormattedDescMethods($element), 914 'method_overrides' => $this> getFormattedOverrides($element), 915 'line_number' => $element> getLineNumber(), 916 'params' => $params)); 917 $this-> method_data[$i = count($this-> method_data) - 1][0] = & $this> newSmarty(true); 918 $this-> method_data[$i][1] = str_replace(array('_','.'),array('-','--'),$element> getName()); 919 $this-> method_data[$i][0]-> assign('class',$this-> class); 920 $this-> method_data[$i][0]-> assign('source_location',$this-> returnSee($this-
> getLink(basename($this-> curpage-> getFile())),$this-> sourceloc)); 921 $this-> method_data[$i][0]-> assign('sdesc',$docblock['sdesc']); 922 $this-> method_data[$i][0]-> assign('desc',$docblock['desc']); 923 $this-> method_data[$i][0]-> assign('tags',$docblock['tags']); 924 $this-> method_data[$i][0]-> assign('function_name',$element-> getName()); 925 $this-> method_data[$i][0]-> assign('function_return',$returntype); 926 $this-> method_data[$i][0]-> assign('function_call',$call); 927 $this-> method_data[$i][0]-> assign('descmethod',$this> getFormattedDescMethods($element)); 928 $this-> method_data[$i][0]-> assign('method_overrides',$this> getFormattedOverrides($element)); 929 $this-> method_data[$i][0]-> assign('params',$params); 930 $this-> method_data[$i][0]-> assign('id',$this-> getId($element)); 931 } 932 933 /** 934 * Converts function for template output - does nothing in peardoc2! 935 * @param parserFunction 936 */ 937 function convertFunction(& $element) 938 { 939 /* parent::convertFunction($element); 940 $docblock = $this->prepareDocBlock($element); 941 $fname = $element->getName(); 942 $params = array(); 943 if (count($element->docblock->params)) 944 foreach($element->docblock->params as $param => $val) 945 { 946 $a = $val->Convert($this); 947 $params[$param] = array("var" => $param,"datatype" => $val->converted_returnType,"data" => $a); 948 } 949 $returntype = 'void'; 950 if ($element->docblock->return) 951 { 952 $a = $element->docblock->return->Convert($this); 953 $returntype = $element->docblock->return->converted_returnType; 954 } 955 956 $this->page_data->append("function_ids",$this->getId($element)); 957 $this->page_summary->append("function_ids",$this->getId($element)); 958 $this->page_summary->append('functions',array('id' => $this>getId($element), 959 'sdesc' => $docblock['sdesc'], 960 'desc' => $docblock['desc'], 961 'tags' => $docblock['tags'], 962 'function_name' => $element->getName(), 963 'line_number' => $element>getLineNumber(), 964 'function_return' => $returntype, 965 'function_call' => $element>getIntricateFunctionCall($this,$params), 966 'function_conflicts' => $this>getFormattedConflicts($element,'functions'), 967 'params' => $params)); 968 $this->function_data[$i = count($this->function_data) - 1][0] = $this>newSmarty(true); 969 $this->function_data[$i][1] = $element->getName(); 970 $this->function_data[$i][0]->assign('sdesc',$docblock['sdesc']); 971 $this->function_data[$i][0]->assign('desc',$docblock['desc']); 972 $this->function_data[$i][0]->assign('tags',$docblock['tags']); 973 $this->function_data[$i][0]->assign('function_name',$fname); 974 $this->function_data[$i][0]->assign('line_number',$element->getLineNumber()); 975 $this->function_data[$i][0]->assign('function_return',$returntype); 976 $this->function_data[$i][0]->assign('function_call',$element>getIntricateFunctionCall($this,$params)); 977 $this->function_data[$i][0]->assign('function_conflicts',$this>getFormattedConflicts($element,"functions")); 978 $this->function_data[$i][0]->assign('params',$params); 979 $this->function_data[$i][0]->assign('source_location',$this->returnSee($this>getLink(basename($this->curpage->getFile())),$this->sourceloc)); 980 $this->function_data[$i][0]->assign('id',$this->getId($element));*/ 981 } 982 983 /** 984 * Converts include elements for template output 985 * 986 * Completely ignored by this converter 987 * @param parserInclude 988 */
989 function convertInclude(& $element) 990 { 991 /* parent::convertInclude($element, array('include_file' => '-'.strtr($element>getValue(),array('"' => '', "'" => '','.' => '-')))); 992 $docblock = $this->prepareDocBlock($element); 993 $per = $this->getIncludeValue($element->getValue(), $element->getPath()); 994 $this->page_summary->append('includes',array('sdesc' => $docblock['sdesc'], 995 'desc' => $docblock['desc'], 996 'tags' => $docblock['tags'], 997 'utags' => $docblock['utags'], 998 'include_name' => $element>getName(), 999 'include_value' => $per, 1000 'line_number' => $element>getLineNumber(), 1001 'include_file' => '-'.strtr($element>getValue(),array('"' => '', "'" => '','.' => '-'))));*/ 1002 } 1003 1004 /** 1005 * Converts defines for template output 1006 * @see prepareDocBlock(), getFormattedConflicts() 1007 * @param parserDefine 1008 */ 1009 function convertDefine(& $element) 1010 { 1011 $docblock = $this-> prepareDocBlock($element); 1012 $this-> _appendDefines(array('sdesc' => $docblock['sdesc'], 1013 'desc' => $docblock['desc'], 1014 'tags' => $docblock['tags'], 1015 'name' => $this-> postProcess($element> getName()), 1016 'value' => $this-> postProcess($element> getValue()), 1017 'conflicts' => $this> getFormattedConflicts($element,"defines" ), 1018 'line_number' => $element-> getLineNumber(), 1019 'id' => $this-> getId($element))); 1020 } 1021 1022 /** 1023 * Append the constant information to the Smarty information 1024 * 1025 * Uses category, package, and current file to organize constants defined 1026 * in a package for the constants.xml output file 1027 * @param array 1028 * @uses $_peardoc2_constants appends $define to them 1029 * @access private 1030 */ 1031 function _appendDefines($define) 1032 { 1033 if (!isset($this-> _peardoc2_constants[$this-> category][$this-> package][$this> sourceloc])) 1034 { 1035 $this-> _peardoc2_constants[$this-> category][$this-> package][$this> sourceloc]['name'] = 1036 $this-> sourceloc; 1037 $this-> _peardoc2_constants[$this-> category][$this-> package][$this> sourceloc]['page'] = 1038 $this-> page; 1039 } 1040 $this-> _write_constants_xml[$this-> category][$this-> package] = true; 1041 $this-> _peardoc2_constants[$this-> category][$this-> package][$this> sourceloc]['defines'][] = $define; 1042 } 1043 1044 /** 1045 * Converts global variables for template output 1046 * @param parserGlobal 1047 * @see prepareDocBlock(), getFormattedConflicts() 1048 */ 1049 function convertGlobal(& $element) 1050 { 1051 $docblock = $this-> prepareDocBlock($element); 1052 $value = $this-> getGlobalValue($element-> getValue()); 1053 if ($value == $element-> getValue()) 1054 { 1055 $value = $this-> ProgramExample($value); 1056 } else 1057 {
1058 $value = $this-> getGlobalValue('<![CDATA[' .$element-> getValue() . ']]>' ); 1059 } 1060 $this-> _appendGlobals(array('sdesc' => $docblock['sdesc'], 1061 'desc' => $docblock['desc'], 1062 'tags' => $docblock['tags'], 1063 'name' => $this-> postProcess($element> getName()), 1064 'link' => $element-> getName(), 1065 'value' => $value, 1066 'type' => $element-> getDataType($this), 1067 'line_number' => $element-> getLineNumber(), 1068 'conflicts' => $this> getFormattedConflicts($element,"global variables" ), 1069 'id' => $this-> getId($element))); 1070 } 1071 1072 /** 1073 * Append the global variable information to the Smarty information 1074 * 1075 * Uses category, package, and current file to organize globals defined 1076 * in a package for the globals.xml output file 1077 * @param array 1078 * @uses $_peardoc2_globals appends $global to them 1079 * @access private 1080 */ 1081 function _appendGlobals($global) 1082 { 1083 if (!isset($this-> _peardoc2_globals[$this-> category][$this-> package][$this> sourceloc])) 1084 { 1085 $this-> _peardoc2_globals[$this-> category][$this-> package][$this> sourceloc]['name'] = 1086 $this-> sourceloc; 1087 $this-> _peardoc2_globals[$this-> category][$this-> package][$this> sourceloc]['page'] = 1088 $this-> page; 1089 } 1090 $this-> _write_globals_xml[$this-> category][$this-> package] = true; 1091 $this-> _peardoc2_globals[$this-> category][$this-> package][$this> sourceloc]['globals'][] = $global; 1092 } 1093 1094 /** 1095 * converts procedural pages for template output 1096 * @see prepareDocBlock(), getClassesOnPage() 1097 * @param parserData 1098 */ 1099 function convertPage(& $element) 1100 { 1101 parent::convertPage($element); 1102 $this-> juststarted = true; 1103 $this-> page_dir = $element-> parent-> package; 1104 $this-> page = $this-> getPageName($element-> parent); 1105 $this-> category = strtolower($element-> parent-> category); 1106 $this-> sourceloc = $element-> parent-> getSourceLocation($this,true); 1107 if (!empty($element-> parent-> subpackage)) $this-> page_dir .= PATH_DELIMITER . $element-> parent-> subpackage; 1108 // registering stuff on the template 1109 } 1110 1111 function getPageName(& $element) 1112 { 1113 return str_replace(array('/','_','.'),array('-','-','---'),$element> getSourceLocation($this,true)); 1114 } 1115 1116 /** 1117 * returns an array containing the class inheritance tree from the root object to the class 1118 * 1119 * @param parserClass class variable 1120 * @return array Format: array(root,child,child,child,...,$class) 1121 * @uses parserClass::getParentClassTree() 1122 */ 1123 1124 function generateFormattedClassTree($class) 1125 { 1126 $tree = $class-> getParentClassTree($this); 1127 $out = ''; 1128 if (count($tree) - 1)
1129 { 1130 $result = array($class-> getName()); 1131 $parent = $tree[$class-> getName()]; 1132 while ($parent) 1133 { 1134 if (is_string($parent)) { 1135 $result[] = $parent; 1136 break; 1137 } 1138 $subpackage = $parent-> docblock-> subpackage; 1139 $package = $parent-> docblock-> package; 1140 $x = $parent; 1141 if (is_object($parent)) 1142 $x = $parent-> getLink($this); 1143 if (!$x) $x = $parent-> getName(); 1144 $result[] = 1145 $x; 1146 if (is_object($parent)) 1147 $parent = $tree[$parent-> getName()]; 1148 elseif (isset($tree[$parent])) 1149 $parent = $tree[$parent]; 1150 } 1151 return array_reverse($result); 1152 } else 1153 { 1154 return array($class-> getName()); 1155 } 1156 } 1157 1158 /** 1159 * returns a list of child classes 1160 * 1161 * @param parserClass class variable 1162 * @uses parserClass::getChildClassList() 1163 */ 1164 1165 function generateChildClassList($class) 1166 { 1167 $kids = $class-> getChildClassList($this); 1168 $list = array(); 1169 if (count($kids)) 1170 { 1171 for($i=0; $i< count($kids); $i++) 1172 { 1173 $lt['link'] = '<link linkend="' .$this-> getId($kids[$i]) . 'summary">' . $kids[$i]-> getName().'</link>' ; 1174 $lt['sdesc'] = $kids[$i]-> docblock-> getSDesc($this); 1175 $list[] = $lt; 1176 } 1177 } else return false; 1178 return $list; 1179 } 1180 1181 /** @access private */ 1182 function sortVar($a, $b) 1183 { 1184 return strnatcasecmp($a-> getName(),$b-> getName()); 1185 } 1186 1187 /** @access private */ 1188 function sortMethod($a, $b) 1189 { 1190 if ($a-> isConstructor) return -1; 1191 if ($b-> isConstructor) return 1; 1192 return strnatcasecmp($a-> getName(),$b-> getName()); 1193 } 1194 1195 /** 1196 * returns a template-enabled array of class trees 1197 * 1198 * @param string $package package to generate a class tree for 1199 * @see $roots, HTMLConverter::getRootTree() 1200 */ 1201 function generateFormattedClassTrees($package) 1202 { 1203 if (!isset($this-> roots['normal'][$package]) && 1204 !isset($this-> roots['special'][$package])) { 1205 return array(); 1206 } 1207 $trees = array();
1208 if (isset($this-> roots['normal'][$package])) { 1209 $roots = $this-> roots['normal'][$package]; 1210 for($i=0;$i< count($roots);$i++) 1211 { 1212 $root = $this-> classes-> getClassByPackage($roots[$i], $package); 1213 if ($root && $root-> isInterface()) { 1214 continue; 1215 } 1216 $trees[] = array('class' => $roots[$i],'class_tree' => "<ul>\n" .$this-> getRootTree($this> getSortedClassTreeFromClass($roots[$i],$package,''),$package)."</ul>\n" ); 1217 } 1218 } 1219 if (isset($this-> roots['special'][$package])) { 1220 $roots = $this-> roots['special'][$package]; 1221 foreach ($roots as $parent => $classes) { 1222 $thistree = ''; 1223 foreach ($classes as $classinfo) { 1224 $root = $this-> classes-> getClassByPackage($classinfo, $package); 1225 if ($root && $root-> isInterface()) { 1226 continue; 1227 } 1228 $thistree .= 1229 $this-> getRootTree( 1230 $this-> getSortedClassTreeFromClass( 1231 $classinfo, 1232 $package, 1233 ''), 1234 $package, 1235 true); 1236 } 1237 if (!$thistree) { 1238 continue; 1239 } 1240 $trees[] = array( 1241 'class' => $parent, 1242 'class_tree' => "<ul>\n" . $thistree . "</ul>\n" 1243 ); 1244 } 1245 } 1246 return $trees; 1247 } 1248 1249 /** 1250 * returns a template-enabled array of interface inheritance trees 1251 * 1252 * @param string $package package to generate a class tree for 1253 * @see $roots, HTMLConverter::getRootTree() 1254 */ 1255 function generateFormattedInterfaceTrees($package) 1256 { 1257 if (!isset($this-> roots['normal'][$package]) && 1258 !isset($this-> roots['special'][$package])) { 1259 return array(); 1260 } 1261 $trees = array(); 1262 if (isset($this-> roots['normal'][$package])) { 1263 $roots = $this-> roots['normal'][$package]; 1264 for($i=0;$i< count($roots);$i++) 1265 { 1266 $root = $this-> classes-> getClassByPackage($roots[$i], $package); 1267 if ($root && ! $root-> isInterface()) { 1268 continue; 1269 } 1270 $trees[] = array('class' => $roots[$i],'class_tree' => "<ul>\n" .$this-> getRootTree($this> getSortedClassTreeFromClass($roots[$i],$package,''),$package)."</ul>\n" ); 1271 } 1272 } 1273 if (isset($this-> roots['special'][$package])) { 1274 $roots = $this-> roots['special'][$package]; 1275 foreach ($roots as $parent => $classes) { 1276 $thistree = ''; 1277 foreach ($classes as $classinfo) { 1278 $root = $this-> classes-> getClassByPackage($classinfo, $package); 1279 if ($root && ! $root-> isInterface()) { 1280 continue; 1281 } 1282 $thistree .=
1283 $this-> getRootTree( 1284 $this-> getSortedClassTreeFromClass( 1285 $classinfo, 1286 $package, 1287 ''), 1288 $package, 1289 true); 1290 } 1291 if (!$thistree) { 1292 continue; 1293 } 1294 $trees[] = array( 1295 'class' => $parent, 1296 'class_tree' => "<ul>\n" . $thistree . "</ul>\n" 1297 ); 1298 } 1299 } 1300 return $trees; 1301 } 1302 1303 /** 1304 * return formatted class tree for the Class Trees page 1305 * 1306 * @param array $tree output from {@link getSortedClassTreeFromClass()} 1307 * @param string $package package 1308 * @param boolean $nounknownparent if true, an object's parent will not be checked 1309 * @see Classes::$definitechild, generateFormattedClassTrees() 1310 * @return string 1311 */ 1312 function getRootTree($tree, $package, $noparent = false) 1313 { 1314 if (!$tree) return ''; 1315 $my_tree = ''; 1316 $cur = '#root'; 1317 $lastcur = array(false); 1318 $kids = array(); 1319 $dopar = false; 1320 if (!$noparent && $tree[$cur]['parent']) 1321 { 1322 $dopar = true; 1323 if (!is_object($tree[$cur]['parent'])) 1324 { 1325 // debug("parent ".$tree[$cur]['parent']." not found"); 1326 $my_tree .= '<listitem>' . $tree[$cur]['parent'] .'<itemizedlist>' 1327 } 1328 else 1329 { 1330 // debug("parent ".$this->returnSee($tree[$cur]['parent'], false, false)." in other package"); 1331 $my_tree .= '<listitem>' . $this-> returnSee($tree[$cur]['parent'], false, false); 1332 if ($tree[$cur]['parent']-> package != $package) $my_tree .= ' <emphasis>(Different package)</emphasis><itemizedlist>' ; 1333 } 1334 } 1335 do 1336 { 1337 // fancy_debug($cur,$lastcur,$kids); 1338 if (count($tree[$cur]['children'])) 1339 { 1340 // debug("$cur has children"); 1341 if (!isset($kids[$cur])) 1342 { 1343 // debug("set $cur kids"); 1344 $kids[$cur] = 1; 1345 $my_tree .= '<listitem>' .$this-> returnSee($tree[$cur]['link'], false, false); 1346 $my_tree .= '<itemizedlist>' ."\n" ; 1347 } 1348 array_push($lastcur,$cur); 1349 list(,$cur) = each($tree[$cur]['children']); 1350 // var_dump('listed',$cur); 1351 if ($cur) 1352 { 1353 $cur = $cur['package'] . '#' . $cur['class']; 1354 // debug("set cur to child $cur"); 1355 // $my_tree .= '<li>'.$this->returnSee($tree[$cur]['link'], false, false); 1356 continue;
1357 } else 1358 { 1359 // debug("end of children for $cur"); 1360 $cur = array_pop($lastcur); 1361 $cur = array_pop($lastcur); 1362 $my_tree .= '</itemizedlist></listitem>' ."\n" ; 1363 if ($dopar && ( $cur == '#root' || !$cur)) $my_tree .= '</itemizedlist></listitem>' ; 1364 } 1365 } else 1366 { 1367 // debug("$cur has no children"); 1368 $my_tree .= '<listitem>' .$this-> returnSee($tree[$cur]['link'], false, false)."</listitem>" ; 1369 if ($dopar && $cur == '#root') $my_tree .= '</itemizedlist></listitem>' ; 1370 $cur = array_pop($lastcur); 1371 } 1372 } while ($cur); 1373 return $my_tree; 1374 } 1375 /** 1376 * does nothing 1377 */ 1378 function generateElementIndex() 1379 { 1380 } 1381 1382 function setTemplateDir($dir) 1383 { 1384 Converter::setTemplateDir($dir); 1385 $this-> smarty_dir = $this-> templateDir; 1386 } 1387 1388 /** 1389 * Generate alphabetical index of all elements by package and subpackage 1390 * 1391 * @param string $package name of a package 1392 * @see $pkg_elements, walk(), generatePkgElementIndexes() 1393 */ 1394 function generatePkgElementIndex($package) 1395 { 1396 } 1397 1398 /** 1399 * 1400 * @see generatePkgElementIndex() 1401 */ 1402 function generatePkgElementIndexes() 1403 { 1404 } 1405 1406 /** 1407 * @param string name of class 1408 * @param string package name 1409 * @param string full path to look in (used in index generation) 1410 * @param boolean deprecated 1411 * @param boolean return just the URL, or enclose it in an html a tag 1412 * @return mixed false if not found, or an html a link to the class's documentation 1413 * @see parent::getClassLink() 1414 */ 1415 function getClassLink($expr,$package, $file = false,$text = false, $local = true, $with_a = true) 1416 { 1417 $a = Converter::getClassLink($expr,$package,$file); 1418 if (!$a) return false; 1419 return $this-> returnSee($a, $text, $local, $with_a); 1420 } 1421 1422 /** 1423 * @param string name of function 1424 * @param string package name 1425 * @param string full path to look in (used in index generation) 1426 * @param boolean deprecated 1427 * @param boolean return just the URL, or enclose it in an html a tag 1428 * @return mixed false if not found, or an html a link to the function's documentation 1429 * @see parent::getFunctionLink() 1430 */ 1431 function getFunctionLink($expr,$package, $file = false,$text = false, $local = true) 1432 {
1433 $a = Converter::getFunctionLink($expr,$package,$file); 1434 if (!$a) return false; 1435 return $this-> returnSee($a, $text, $local); 1436 } 1437 1438 /** 1439 * @param string name of define 1440 * @param string package name 1441 * @param string full path to look in (used in index generation) 1442 * @param boolean deprecated 1443 * @param boolean return just the URL, or enclose it in an html a tag 1444 * @return mixed false if not found, or an html a link to the define's documentation 1445 * @see parent::getDefineLink() 1446 */ 1447 function getDefineLink($expr,$package, $file = false,$text = false, $local = true) 1448 { 1449 $a = Converter::getDefineLink($expr,$package,$file); 1450 if (!$a) return false; 1451 return $this-> returnSee($a, $text, $local); 1452 } 1453 1454 /** 1455 * @param string name of global variable 1456 * @param string package name 1457 * @param string full path to look in (used in index generation) 1458 * @param boolean deprecated 1459 * @param boolean return just the URL, or enclose it in an html a tag 1460 * @return mixed false if not found, or an html a link to the global variable's documentation 1461 * @see parent::getGlobalLink() 1462 */ 1463 function getGlobalLink($expr,$package, $file = false,$text = false, $local = true) 1464 { 1465 $a = Converter::getGlobalLink($expr,$package,$file); 1466 if (!$a) return false; 1467 return $this-> returnSee($a, $text, $local); 1468 } 1469 1470 /** 1471 * @param string name of procedural page 1472 * @param string package name 1473 * @param string full path to look in (used in index generation) 1474 * @param boolean deprecated 1475 * @param boolean return just the URL, or enclose it in an html a tag 1476 * @return mixed false if not found, or an html a link to the procedural page's documentation 1477 * @see parent::getPageLink() 1478 */ 1479 function getPageLink($expr,$package, $path = false,$text = false, $local = true) 1480 { 1481 $a = Converter::getPageLink($expr,$package,$path); 1482 if (!$a) return false; 1483 return $this-> returnSee($a, $text, $local); 1484 } 1485 1486 /** 1487 * @param string name of method 1488 * @param string class containing method 1489 * @param string package name 1490 * @param string full path to look in (used in index generation) 1491 * @param boolean deprecated 1492 * @param boolean return just the URL, or enclose it in an html a tag 1493 * @return mixed false if not found, or an html a link to the method's documentation 1494 * @see parent::getMethodLink() 1495 */ 1496 function getMethodLink($expr,$class,$package, $file = false,$text = false, $local = true) 1497 { 1498 $a = Converter::getMethodLink($expr,$class,$package,$file); 1499 if (!$a) return false; 1500 return $this-> returnSee($a, $text, $local); 1501 } 1502 1503 /** 1504 * @param string name of var 1505 * @param string class containing var 1506 * @param string package name 1507 * @param string full path to look in (used in index generation) 1508 * @param boolean deprecated 1509 * @param boolean return just the URL, or enclose it in an html a tag 1510 * @return mixed false if not found, or an html a link to the var's documentation
1511 * @see parent::getVarLink() 1512 */ 1513 function getVarLink($expr,$class,$package, $file = false,$text = false, $local = true) 1514 { 1515 $a = Converter::getVarLink($expr,$class,$package,$file); 1516 if (!$a) return false; 1517 return $this-> returnSee($a, $text, $local); 1518 } 1519 1520 /** 1521 * does a nat case sort on the specified second level value of the array 1522 * 1523 * @param mixed $a 1524 * @param mixed $b 1525 * @return int 1526 */ 1527 function rcNatCmp ($a, $b) 1528 { 1529 $aa = strtoupper($a[$this-> rcnatcmpkey]); 1530 $bb = strtoupper($b[$this-> rcnatcmpkey]); 1531 1532 return strnatcasecmp($aa, $bb); 1533 } 1534 1535 /** 1536 * does a nat case sort on the specified second level value of the array. 1537 * this one puts constructors first 1538 * 1539 * @param mixed $a 1540 * @param mixed $b 1541 * @return int 1542 */ 1543 function rcNatCmp1 ($a, $b) 1544 { 1545 $aa = strtoupper($a[$this-> rcnatcmpkey]); 1546 $bb = strtoupper($b[$this-> rcnatcmpkey]); 1547 1548 if (strpos($aa,'CONSTRUCTOR') === 0) 1549 { 1550 return -1; 1551 } 1552 if (strpos($bb,'CONSTRUCTOR') === 0) 1553 { 1554 return 1; 1555 } 1556 if (strpos($aa,strtoupper($this-> class)) === 0) 1557 { 1558 return -1; 1559 } 1560 if (strpos($bb,strtoupper($this-> class)) === 0) 1561 { 1562 return -1; 1563 } 1564 return strnatcasecmp($aa, $bb); 1565 } 1566 1567 function wordwrap($string) 1568 { 1569 return wordwrap($string); 1570 } 1571 1572 /** 1573 * Generate the constants.xml, packagename.xml, and globals.xml files 1574 */ 1575 function Output() 1576 { 1577 $this-> flushPackageXml(false); 1578 $templ = & $this-> newSmarty(); 1579 $categories = array(); 1580 $packages = array_flip($this-> all_packages); 1581 foreach($this-> packagecategories as $package => $category) 1582 { 1583 $categories[$category]['package.'.$category.'.'.str_replace('_','',strtolower($package ))] = 1; 1584 if (isset($packages[$package])) unset($packages[$package]); 1585 } 1586 $category = $GLOBALS['phpDocumentor_DefaultCategoryName']; 1587 foreach($packages as $package) 1588 { 1589 $categories[$category]['package.'.$category.'.'.str_replace('_','-
',strtolower($package ))] = 1; 1590 } 1591 foreach($categories as $category => $ids) 1592 { 1593 $templ-> assign('id','package.'.$category); 1594 $templ-> assign('ids',array()); 1595 $templ-> assign('category',$category); 1596 $this-> setTargetDir($this-> base_dir); 1597 if (file_exists($this-> base_dir . PATH_DELIMITER . strtolower($category ) . '.xml')) 1598 { 1599 $contents = @file($this-> base_dir . PATH_DELIMITER . strtolower($category ) . '.xml'); 1600 if (is_array($contents)) 1601 { 1602 $found = false; 1603 foreach($contents as $i => $line) 1604 { 1605 $line = trim($line); 1606 if (strlen($line) && $line{0} == '&' ) 1607 { 1608 $found = $i; 1609 if (in_array(str_replace(array ('&' , ';'), array ('', ''), trim($line )), array_keys($ids ))) 1610 { 1611 unset($ids[str_replace(array('&' , ';'), array('', ''), trim($line))]); 1612 } 1613 } 1614 if ($found !== false && (! strlen($line) || $line{0} != '&' )) 1615 { 1616 break; 1617 } 1618 } 1619 $newids = array(); 1620 foreach($ids as $id => $unll) 1621 { 1622 $newids[] = ' &' . $id . ";\n" ; 1623 } 1624 $newcontents = array_merge(array_slice($contents, 0, $i), $newids); 1625 $newcontents = array_merge($newcontents, array_slice($contents, $i)); 1626 } 1627 $categorycontents = implode($newcontents, ''); 1628 } else 1629 { 1630 foreach($ids as $id => $unll) 1631 { 1632 if (!in_array($id, $templ-> _tpl_vars['ids'])) 1633 { 1634 $templ-> append('ids',$id); 1635 } 1636 } 1637 $categorycontents = '<!-- $' . "Revision$ -->\n" . $templ> fetch('category.tpl'); 1638 } 1639 $this-> writefile(strtolower($category) . '.xml', 1640 $categorycontents); 1641 phpDocumentor_out("\n" ); 1642 flush(); 1643 } 1644 $my = & $this-> newSmarty(); 1645 if ($this-> _peardoc2_constants) 1646 { 1647 foreach($this-> _peardoc2_constants as $category => $r) 1648 { 1649 foreach($r as $package => $s) 1650 { 1651 $my-> assign('id','package.'.strtolower($category.'.'.str_replace('_','',strtolower($package ))).'.constants'); 1652 $my-> assign('package',$package); 1653 $defines = array(); 1654 foreach($s as $file => $t) 1655 { 1656 $arr = array(); 1657 $arr['name'] = $file; 1658 $arr['page'] = strtolower($t['page']); 1659 $arr['defines'] = $t['defines']; 1660 $defines[] = $arr; 1661 } 1662 $my-> assign('defines',$defines);
1663 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $category 1664 . PATH_DELIMITER . strtolower(str_replace('_','-',strtolower($package )))); 1665 $this-> writefile('constants.xml', 1666 '<!-- $' . "Revision$ -->\n" . $my> fetch('constants.tpl')); 1667 $my-> clear_all_assign(); 1668 } 1669 } 1670 $this-> _peardoc2_constants = false; 1671 } 1672 if ($this-> _peardoc2_globals) 1673 { 1674 foreach($this-> _peardoc2_globals as $category => $r) 1675 { 1676 foreach($r as $package => $s) 1677 { 1678 $my-> assign('id','package.'.strtolower($category.'.'.str_replace('_','',strtolower($package ))).'.globals'); 1679 $my-> assign('package',$package); 1680 $defines = array(); 1681 foreach($s as $file => $t) 1682 { 1683 $arr = array(); 1684 $arr['name'] = $file; 1685 $arr['page'] = strtolower($t['page']); 1686 $arr['globals'] = $t['globals']; 1687 $defines[] = $arr; 1688 } 1689 $my-> assign('globals',$defines); 1690 $this-> setTargetDir($this-> base_dir . PATH_DELIMITER . $category 1691 . PATH_DELIMITER . strtolower(str_replace('_','-',strtolower($package )))); 1692 $this-> writefile('globals.xml', 1693 '<!-- $' . "Revision$ -->\n" . $my> fetch('globals.tpl')); 1694 $my-> clear_all_assign(); 1695 } 1696 } 1697 $this-> _peardoc2_globals = false; 1698 } 1699 } 1700 } 1701 ?>
Package phpDocumentor
65 66 define(PHPDOC_WEBROOT_DIR, dirname(dirname(__FILE__))); 67 /** 68 * common file information 69 */ 70 include_once(PHPDOC_WEBROOT_DIR . "/phpDocumentor/common.inc.php" ); 71 include_once(PHPDOC_WEBROOT_DIR . "/HTML_TreeMenu-1.1.2/TreeMenu.php" ); 72 include_once(PHPDOC_WEBROOT_DIR . "/docbuilder/includes/utilities.php" ); 73 74 // set up include path so we can find all files, no matter what 75 $GLOBALS['_phpDocumentor_install_dir'] = dirname(dirname( realpath( __FILE__ ) )); 76 // add my directory to the include path, and make it first, should fix any errors 77 if (substr(PHP_OS, 0, 3) == 'WIN') { 78 ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].';'.ini_get('include_path')); 79 } else { 80 ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].':'.ini_get('include_path')); 81 } 82 83 // find the .ini directory by parsing phpDocumentor.ini and extracting _phpDocumentor_options[userdir] 84 $ini = phpDocumentor_parse_ini_file($_phpDocumentor_install_dir . PATH_DELIMITER . 'phpDocumentor.ini', true); 85 if (isset($ini['_phpDocumentor_options']['userdir'])) { 86 $configdir = $ini['_phpDocumentor_options']['userdir']; 87 } else { 88 $configdir = $_phpDocumentor_install_dir . '/user'; 89 } 90 } 91 92 // allow the user to change this at runtime 93 if (!empty( $_REQUEST['altuserdir'] )) { 94 $configdir = $_REQUEST['altuserdir']; 95 } 96 ?> 97 <html> 98 <head> 99 <title> 100 File browser 101 </title> 102 <style type="text/css"> 103 body, td, th, select, input { 104 font-family: verdana,sans-serif; 105 font-size: 9pt; 106 } 107 .text { 108 font-family: verdana,sans-serif; 109 font-size: 9pt; 110 border: solid 1px #000000; 111 } 112 .button { 113 border: solid 1px #000000; 114 } 115 .small { 116 font-size: 7pt; 117 } 118 </style> 119 120 <script src="../HTML_TreeMenu-1.1.2/TreeMenu.js" language="JavaScript" type="text/javascript"></script> 121 122 <?php 123 set_time_limit(0); // six minute timeout 124 ini_set("memory_limit" ,"256M" ); 125 126 /** 127 * Directory Node 128 * @package HTML_TreeMenu 129 */ 130 class DirNode extends HTML_TreeNode 131 { 132 /** 133 * full path to this node 134 * @var string 135 */ 136 var $path; 137 138 function DirNode($text = false, $link = false, $icon = false, $path, $events = array()) 139 {
140 $this-> path = $path; 141 $options = array(); 142 if ($text) $options['text'] = $text; 143 if ($link) $options['link'] = $link; 144 if ($icon) $options['icon'] = $icon; 145 HTML_TreeNode::HTML_TreeNode($options,$events); 146 } 147 } 148 149 150 $menu = new HTML_TreeMenu(); 151 $filename = ''; 152 if (isset($_GET) && isset( $_GET['fileName'])) { 153 $filename = $_GET['fileName']; 154 } 155 $filename = realpath($filename); 156 $pd = (substr(PHP_OS, 0, 3) == 'WIN') ? '\\' : '/'; 157 $test = ($pd == '/') ? '/' : 'C:\\'; 158 if (empty($filename) || ($filename == $test)) { 159 $filename = ($pd == '/') ? '/' : 'C:\\'; 160 $node = false; 161 getDir($filename,$node); 162 } else { 163 flush(); 164 // if ($pd != '/') $pd = $pd.$pd; 165 $anode = false; 166 switchDirTree($filename,$anode); 167 // recurseDir($filename,$anode); 168 $node = new HTML_TreeNode(array('text' => "Click to view " .addslashes($filename),'link' => "" ,'icon' => 'branchtop.gif')); 169 $node-> addItem($anode); 170 }; 171 $menu-> addItem($node); 172 if ('@WEB-DIR@' != '@'.'WEB-DIR@') 173 { 174 $DHTMLmenu = & new HTML_TreeMenu_DHTML($menu, 175 array('images' => '../HTML_TreeMenu-1.1.2/images')); 176 } else { 177 $DHTMLmenu = & new HTML_TreeMenu_DHTML($menu, 178 array('images' => str_replace('/docbuilder/file_dialog.php','',$_SERVER['PHP_SELF']) . 179 '/HTML_TreeMenu-1.1.2/images')); 180 } 181 ?> 182 <script type="text/javascript" language="Javascript"> 183 /** 184 Creates some global variables 185 */ 186 function initializate() { 187 // 188 //The "platform independent" newLine 189 // 190 //Taken from http://developer.netscape.com/docs/manuals/communicator/jsref/brow1.htm#1010426 191 if (navigator.appVersion.lastIndexOf( 'Win' ) != -1) { 192 $pathdelim="\\"; 193 $newLine="\r\n"; 194 } else { 195 $newLine="\n"; 196 $pathdelim="/"; 197 } 198 /* for($a=0;$a<document.dataForm.elements.length;$a++) { 199 alert("The name is '"+document.dataForm.elements[$a].name+"' "+$a); 200 } 201 */ 202 } 203 /** Sets the contents of the help box, and submits the form 204 */ 205 function setHelp( $str ) { 206 document.helpForm.fileName.value = $str; 207 document.helpForm.submit(); 208 } 209 210 /** Sets the contents of the help box only 211 */ 212 function setHelpVal( $str ) { 213 document.helpForm.fileName.value = $str; 214 } 215 /**Takes a given string and leaves it ready to add a new string 216 That is, puts the comma and the new line if needed 217 */
218 function prepareString($myString) { 219 //First verify that a comma is not at the end 220 if($myString.lastIndexOf(",") >= $myString.length-2) { 221 //We have a comma at the end 222 return $myString; 223 } 224 if($myString.length > 0) { 225 $myString+=","+$newLine; 226 } 227 return $myString; 228 } 229 230 231 function myReplace($string,$text,$by) { 232 // Replaces text with by in string 233 var $strLength = $string.length, $txtLength = $text.length; 234 if (($strLength == 0) || ($txtLength == 0)) return $string; 235 236 var $i = $string.indexOf($text); 237 if ((!$i) && ($text != $string.substring(0,$txtLength))) return $string; 238 if ($i == -1) return $string; 239 240 var $newstr = $string.substring(0,$i) + $by; 241 242 if ($i+$txtLength < $strLength) 243 $newstr += myReplace($string.substring($i+$txtLength,$strLength),$text,$by); 244 245 return $newstr; 246 } 247 </script> 248 249 </head> 250 251 <body bgcolor="#ffffff" onload="javascript:initializate()"> 252 <strong>Directory Browser</strong> 253 254 <table cellpadding="1" cellspacing="1" border="0" width="100%"> 255 256 <form name="helpForm" action="<?php print $_SERVER['PHP_SELF']; ?>" method="get" enctype="multipart/form-data"> 257 <tr> 258 <td colspan="2" width="100%"> 259 Use this to find directories and files which can be used below: 260 </td> 261 </tr> 262 <tr> 263 <td align="right"> 264 <a href="javascript:document.helpForm.submit();" title="browse tree"> 265 <?php 266 echo showImage( 'images/rc-gui-install-24.png', '24', '24' ); 267 ?> 268 </a> 269 </td> 270 <td> 271 <input size="60" type="text" name="fileName" value="<?php print $filename;?>" class="text" /> 272 </td> 273 </tr> 274 <tr> 275 <td> 276 <input type="submit" name="helpdata" value="close" class="button" onclick="window.close();" /> 277 </td> 278 <td align="right"> 279 <input type="submit" name="helpdata" value="accept" class="button" onclick="opener.setFile(document.helpForm.fileName.value);window.close();" /> 280 </td> 281 </tr> 282 <tr> 283 <td colspan="2"> 284 <div id='menuLayer'></div> 285 <?php $DHTMLmenu-> printMenu(); ?> 286 </td> 287 </tr> 288 </form> 289 290 </table>
</body> </html>
Package phpDocumentor
67 * common file information 68 */ 69 include_once(" $root_dir/phpDocumentor/common.inc.php" ); 70 // add my directory to the include path, and make it first, should fix any errors 71 if (substr(PHP_OS, 0, 3) == 'WIN') 72 { 73 ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].';'.ini_get('include_path')); 74 } else { 75 ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].':'.ini_get('include_path')); 76 } 77 // find the .ini directory by parsing phpDocumentor.ini and extracting _phpDocumentor_options[userdir] 78 $ini = phpDocumentor_parse_ini_file($_phpDocumentor_install_dir . PATH_DELIMITER . 'phpDocumentor.ini', true); 79 if (isset($ini['_phpDocumentor_options']['userdir'])) 80 { 81 $configdir = $ini['_phpDocumentor_options']['userdir']; 82 } else { 83 $configdir = $_phpDocumentor_install_dir . '/user'; 84 } 85 } 86 87 88 89 // allow the user to change this at runtime 90 if (!empty($_REQUEST['altuserdir'])) $configdir = $_REQUEST['altuserdir']; 91 ?> 92 <html> 93 <head> 94 <title> 95 output: docbuilder - phpDocumentor v<?php print PHPDOCUMENTOR_VER; ?> doc generation information 96 </title> 97 <style type="text/css"> 98 body, td, th { 99 font-family: verdana,sans-serif; 100 font-size: 8pt; 101 } 102 </style> 103 104 </head> 105 <body bgcolor="#e0e0e0" text="#000000" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"> 106 107 <?php 108 // Find out if we are submitting and if we are, send it 109 // This code originally by Joshua Eichorn on phpdoc.php 110 // 111 if (isset($_GET['dataform']) && empty( $_REQUEST['altuserdir'])) { 112 foreach ($_GET as $k=> $v) { 113 if (strpos( $k, 'setting_' ) === 0) { 114 $_GET['setting'][substr( $k, 8 )] = $v; 115 } 116 } 117 118 echo "<strong>Parsing Files ...</strong>" ; 119 flush(); 120 echo "<pre>\n" ; 121 /** phpdoc.inc */ 122 include(" $root_dir/phpDocumentor/phpdoc.inc" ); 123 echo "</pre>\n" ; 124 echo "<h1>Operation Completed!!</h1>" ; 125 } else { 126 echo "whoops!" ; 127 } 128 ?>
67 $GLOBALS['_phpDocumentor_install_dir'] = dirname(dirname( realpath( __FILE__ ) )); 68 // add my directory to the include path, and make it first, should fix any errors 69 if (substr(PHP_OS, 0, 3) == 'WIN') { 70 ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].';'.ini_get('include_path')); 71 } else { 72 ini_set('include_path',$GLOBALS['_phpDocumentor_install_dir'].':'.ini_get('include_path')); 73 } 74 75 /** 76 * common file information 77 */ 78 include_once(" $root_dir/phpDocumentor/common.inc.php" ); 79 include_once(" $root_dir/docbuilder/includes/utilities.php" ); 80 81 // find the .ini directory by parsing phpDocumentor.ini and extracting _phpDocumentor_options[userdir] 82 $ini = phpDocumentor_parse_ini_file($_phpDocumentor_install_dir . PATH_DELIMITER . 'phpDocumentor.ini', true); 83 if (isset($ini['_phpDocumentor_options']['userdir'])) { 84 $configdir = $ini['_phpDocumentor_options']['userdir']; 85 } else { 86 $configdir = $_phpDocumentor_install_dir . '/user'; 87 } 88 } 89 90 // allow the user to change this at runtime 91 if (!empty( $_REQUEST['altuserdir'] )) { 92 $configdir = $_REQUEST['altuserdir']; 93 } 94 95 // assign the available converters 96 $converters = array( 97 "HTML:frames:default" => 'HTML:frames:default', 98 "HTML:frames:earthli" => 'HTML:frames:earthli', 99 "HTML:frames:l0l33t" => 'HTML:frames:l0l33t', 100 "HTML:frames:phpdoc.de" => 'HTML:frames:phpdoc.de', 101 "HTML:frames:phphtmllib" => 'HTML:frames:phphtmllib', 102 "HTML:frames:phpedit" => 'HTML:frames:phpedit', 103 "HTML:frames:DOM/default" => 'HTML:frames:DOM/default', 104 "HTML:frames:DOM/earthli" => 'HTML:frames:DOM/earthli', 105 "HTML:frames:DOM/l0l33t" => 'HTML:frames:DOM/l0l33t', 106 "HTML:frames:DOM/phpdoc.de" => 'HTML:frames:DOM/phpdoc.de', 107 "HTML:frames:DOM/phphtmllib" => 'HTML:frames:DOM/phphtmllib', 108 "HTML:Smarty:default" => 'HTML:Smarty:default', 109 "HTML:Smarty:HandS" => 'HTML:Smarty:HandS', 110 "HTML:Smarty:PHP" => 'HTML:Smarty:PHP', 111 "PDF:default:default" => 'PDF:default:default', 112 "CHM:default:default" => 'CHM:default:default', 113 "XML:DocBook/peardoc2:default" => 'XML:DocBook/peardoc2:default' 114 ); 115 116 // compile a list of available screen shots 117 $convScreenShots = array(); 118 119 if ($dir = opendir($path)) { 120 while (($file = readdir( $dir )) !== false) { 121 if ($file != '.' && $file != '..') { 122 if (!is_dir( $path . $file )) { 123 if (strpos( $file, 'ss_' ) === 0) { 124 $key = substr( $file, 3 ); 125 $key = str_replace( '_', ':', $key ); 126 $key = str_replace( '-', '/', $key ); 127 $key = str_replace( '.png', '', $key ); 128 $convScreenShots[$key] = $file; 129 } 130 } 131 } 132 } 133 } 134 135 ?> 136 <html> 137 <head> 138 <title> 139 Form to submit to phpDocumentor v<?php print PHPDOCUMENTOR_VER; ?> 140 </title> 141 <style type="text/css"> 142 body, td, th {
143 font-family: verdana,sans-serif; 144 font-size: 9pt; 145 } 146 .text { 147 font-family: verdana,sans-serif; 148 font-size: 9pt; 149 border: solid 1px #000000; 150 } 151 .small { 152 font-size: 7pt; 153 } 154 </style> 155 156 <script src="includes/tabpane.js" language="JavaScript" type="text/javascript"></script> 157 <link id="webfx-tab-style-sheet" type="text/css" rel="stylesheet" href="includes/tab.webfx.css" /> 158 159 <script type="text/javascript" language="Javascript"> 160 /** 161 Creates some global variables 162 */ 163 function initializate() { 164 // 165 //The "platform independent" newLine 166 // 167 //Taken from http://developer.netscape.com/docs/manuals/communicator/jsref/brow1.htm#1010426 168 if (navigator.appVersion.lastIndexOf('Win') != -1) { 169 $pathdelim="\\"; 170 $newLine="\r\n"; 171 } else { 172 $newLine="\n"; 173 $pathdelim="/"; 174 } 175 } 176 177 /**Adds the contents of the help box as a directory 178 */ 179 function addDirectory($object) { 180 //$a = document.helpForm.fileName.value; 181 $a = parent.ActionFrame.document.actionFrm.fileName.value; 182 $a = myReplace( $a, '\\\\', '\\' ); 183 if ($a[$a.length - 1] == $pathdelim) { 184 $a = $a.substring(0, $a.length - 1); 185 } 186 if ($a.lastIndexOf('.') > 0) { 187 $a = $a.substring(0,$a.lastIndexOf($pathdelim)); 188 } 189 $object.value = prepareString($object.value)+$a; 190 } 191 /**Adds the contents of the converter box to the converters list 192 */ 193 function addConverter($object) { 194 $object.value = prepareString($object.value)+document.dataForm.ConverterSetting.value; 195 } 196 /**Replaces the converters list with the contents of the converter box 197 */ 198 function replaceConverter($object) { 199 $object.value = document.dataForm.ConverterSetting.value; 200 } 201 /**Adds the contents of the help box as a file to the given control 202 */ 203 function addFile($object) { 204 //$a = document.helpForm.fileName.value; 205 $a = parent.ActionFrame.document.actionFrm.fileName.value; 206 $a = myReplace($a,'\\\\','\\'); 207 $object.value = prepareString($object.value)+$a; 208 } 209 /**Takes a given string and leaves it ready to add a new string 210 That is, puts the comma and the new line if needed 211 */ 212 function prepareString($myString) { 213 //First verify that a comma is not at the end 214 if($myString.lastIndexOf(",") >= $myString.length-2) { 215 //We have a comma at the end 216 return $myString; 217 } 218 if($myString.length > 0) { 219 $myString+=","+$newLine; 220 }
221 return $myString; 222 } 223 /**Do the validation needed before sending the from and return a truth value indicating if the form can be sent 224 */ 225 function validate() { 226 //Take out all newLines and change them by nothing 227 //This could be done by using javascript function's replacebut that was implemented only until Navigator 4.0 and so it is better to use more backward compatible functions like substr 228 document.dataForm.elements[0].value= stripNewLines(document.dataForm.elements[0].value); 229 document.dataForm.elements[1].value= stripNewLines(document.dataForm.elements[1].value); 230 document.dataForm.elements[2].value= stripNewLines(document.dataForm.elements[2].value); 231 document.dataForm.elements[3].value= stripNewLines(document.dataForm.elements[3].value); 232 document.dataForm.elements[4].value= stripNewLines(document.dataForm.elements[4].value); 233 document.dataForm.elements[5].value= stripNewLines(document.dataForm.elements[5].value); 234 document.dataForm.elements[6].value= stripNewLines(document.dataForm.elements[6].value); 235 document.dataForm.elements[7].value= stripNewLines(document.dataForm.elements[7].value); 236 //By returning true we are allowing the form to be submitted 237 return true; 238 } 239 /**Takes a string and removes all the ocurrences of new lines 240 Could have been implemented a lot easier with replace but it's not very backwards compatible 241 */ 242 function stripNewLines( $myString ) { 243 return myReplace($myString,$newLine,''); 244 } 245 246 function myReplace($string,$text,$by) { 247 // Replaces text with by in string 248 var $strLength = $string.length, $txtLength = $text.length; 249 if (($strLength == 0) || ($txtLength == 0)) { 250 return $string; 251 } 252 var $i = $string.indexOf($text); 253 if ((!$i) && ($text != $string.substring(0,$txtLength))) { 254 return $string; 255 } 256 if ($i == -1) { 257 return $string; 258 } 259 var $newstr = $string.substring(0,$i) + $by; 260 if ($i+$txtLength < $strLength) { 261 $newstr += myReplace($string.substring($i+$txtLength,$strLength),$text,$by); 262 } 263 return $newstr; 264 } 265 266 var screenShots = new Array(); 267 <?php 268 $temp = array(); 269 foreach ($converters as $k=> $v) { 270 if (array_key_exists( $k, $convScreenShots )) { 271 echo " \nscreenShots['$k'] = '{$convScreenShots[$k]}'" ; 272 } else { 273 echo " \nscreenShots['$k'] = ''" ; 274 } 275 } 276 ?> 277 278 279 /** Swaps the converted screen shot image 280 */ 281 function swapImage( key ) { 282 document.screenshot.src = 'images/' + screenShots[key]; 283 } 284 285 </script> 286 287 </head> 288 289 <body bgcolor="#ffffff" onload="javascript:initializate()" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"> 290 291 <!-- onsubmit="return validate()" --> 292 293 <form name="dataForm" action="builder.php" method="get" target="OutputFrame"> 294 295 <div class="tab-pane" id="tabPane1">
296 <script type="text/javascript"> 297 var tp1 = new WebFXTabPane( document.getElementById( "tabPane1" )); 298 </script> 299 <div class="tab-page" id="tab_intro"> 300 <h2 class="tab">Introduction</h2> 301 Welcome to <b>docBuilder</b>. 302 <p>This is the new web-interface for running, in our opinion, the best in-code documentation compiler there is: <b>phpDocumentor</b>.</p> 303 <p>What's new in this release? Heaps of things, but here are the headlines:</p> 304 <ul> 305 <li>Much greater support for PEAR on both windows and linux</li> 306 <li>CHM, PDF and XML:DocBook/peardoc2 converters are all stable!</li> 307 <li>New tokenizer-based parser is literally twice as fast as the old parser (requires PHP 4.3.0+)</li> 308 <li>New external user-level manual parsing and generation allows crosslinking between API docs and DocBook-format tutorials/manuals!</li> 309 <li>Color syntax source highlighting and cross-referencing with documentation of source code in HTML, CHM and PDF with customizable templating</li> 310 <li>New Configuration files simplify repetitive and complex documentation tasks</li> 311 <li>Brand new extensive manual - which can be generated directly from the source using makedocs.ini!</li> 312 <li>Many improvements to in-code API documentation including new tags, and better handling of in-code html tags</li> 313 <li>New XML:DocBook/peardoc converter makes generating PEAR manual formats easy for PEAR developers along with the --pear command-line switch</li> 314 <li>Many new HTML templates, all of them beautiful thanks to Marco von Ballmoos</li> 315 <li>A brand new web interface thanks to Andrew Eddie!</li> 316 </ul> 317 </div> 318 319 <div class="tab-page" id="tab_config"> 320 <h2 class="tab">Config</h2> 321 <table cellspacing="0" cellpadding="3" border="0"> 322 <tr> 323 <td colspan="2"><b>Use a pre-created config file for form values.</b></td> 324 </tr> 325 <tr> 326 <td nowrap="nowrap"> 327 <b>change config directory:</b> 328 </td> 329 <td width="100%"> 330 <input size="20" type="text" name="altuserdir" value="" /><input type="SUBMIT" value="Change" name="submitButton" onclick="document.dataForm.target='DataFrame'; document.dataForm.action = 'config.php';document.dataForm.submit();"> 331 <?php 332 if (!empty($_REQUEST['altuserdir'])) { 333 print '<br><i>changed to <b>"' .$_REQUEST['altuserdir'].'"</b></i>' ; 334 } 335 ?> 336 </td> 337 </tr> 338 <tr> 339 <td nowrap="nowrap"> 340 <b>Choose a config:</b> 341 </td> 342 <td> 343 344 <select name="setting_useconfig"> 345 <option value="" <?php if (empty($_REQUEST['altuserdir'])) print 'selected'; ?>>don't use config file</option> 346 <?php 347 $dirs = array(); 348 $dirs = phpDocumentor_ConfigFileList($configdir); 349 $path = ''; 350 $sel = ' selected'; 351 if (!empty($_REQUEST['altuserdir'])) $path = $configdir . PATH_DELIMITER; 352 else $sel = ''; 353 foreach($dirs as $configfile) 354 { 355 print '<option value="' .$path.$configfile.'"' .$sel.'>' .$configfile.".ini</option>\n" ; 356 $sel = ''; 357 } 358 ?>
359 </select> 360 <input type="SUBMIT" value="Go" name="submitButton"> 361 </td> 362 </tr> 363 <tr> 364 <td colspan="2"> 365 Normally, phpDocumentor uses the form values from this form to set up parsing. In version 1.2, phpDocumentor allows you to "save" form values in configuration files so that you can replicate common complicated documentation tasks with only one time. Just choose a config file below or create a new one and refresh this page to choose it. 366 </td> 367 </tr> 368 </table> 369 </div> 370 371 <div class="tab-page" id="tab_files"> 372 <h2 class="tab">Files</h2> 373 <table cellspacing="0" cellpadding="3" border="0"> 374 <tr> 375 <td align="right" valign="top" nowrap="nowrap"> 376 <b>Files<br />to parse</b> 377 <br /> 378 <a href="javascript:addFile(document.dataForm.setting_filename)" title="Add the file in the help box"> 379 <?php 380 echo showImage( 'images/rc-gui-install-24.png', '24', '24' ); 381 ?></a> 382 </td> 383 <td valign="top"> 384 <textarea rows="5" cols="60" name="setting_filename" class="text"></textarea> 385 </td> 386 <td valign="top" class="small"> 387 This is a group of comma-separated names of php files or tutorials that will be processed by phpDocumentor. 388 </td> 389 </tr> 390 <tr> 391 <td align="right" valign="top" nowrap="nowrap"> 392 <b>Directory<br />to parse</b> 393 <br /> 394 <a href="javascript:addFile(document.dataForm.setting_directory)" title="Add the file in the help box"> 395 <?php 396 echo showImage( 'images/rc-gui-install-24.png', '24', '24' ); 397 ?></a> 398 </td> 399 <td valign="top"> 400 <textarea rows="5" cols="60" name="setting_directory" class="text" title=""></textarea> 401 </td> 402 <td valign="top" class="small"> 403 This is a group of comma-separated directories where php files or tutorials are found that will be processed by phpDocumentor. phpDocumentor automatically parses subdirectories 404 </td> 405 </tr> 406 <tr> 407 <td align="right" valign="top" nowrap="nowrap"> 408 <b>Files<br />to ignore</b> 409 <br /> 410 <a href="javascript:addFile(document.dataForm.setting_ignore)" title="Add the file in the help box"> 411 <?php 412 echo showImage( 'images/rc-gui-install-24.png', '24', '24' ); 413 ?></a> 414 </td> 415 <td valign="top"> 416 <textarea rows="5" cols="60" class="text" name="setting_ignore"></textarea> 417 </td> 418 <td valign="top" class="small"> 419 A list of files (full path or filename), and patterns to ignore. Patterns may use wildcards * and ?. To ignore all subdirectories named "test" for example, using "test/" To ignore all files and directories with test in their name use "*test*" 420 </td> 421 </tr> 422 <tr> 423 <td align="right" valign="top" nowrap="nowrap"> 424 <b>Packages<br />to parse</b>
425 </td> 426 <td valign="top"> 427 <textarea rows="4" cols="60" class="text" name="setting_packageoutput"></textarea> 428 </td> 429 <td valign="top" class="small"> 430 The parameter packages is a group of comma separated names of abstract packages that will be processed by phpDocumentor. All package names must be separated by commas. 431 </td> 432 </tr> 433 </table> 434 </div> 435 436 437 <div class="tab-page" id="tab_output"> 438 <h2 class="tab">Output</h2> 439 <table cellspacing="0" cellpadding="3" border="0"> 440 <tr> 441 <td align="right" valign="top" nowrap="nowrap"> 442 <b>Target</b> 443 <br /> 444 <a href="javascript:addFile(document.dataForm.setting_target)" title="Add the file in the help box"> 445 <?php 446 echo showImage( 'images/rc-gui-install-24.png', '24', '24' ); 447 ?></a> 448 </td> 449 <td valign="top"> 450 <input type="text" name="setting_target" size="60" class="text" /> 451 </td> 452 <td valign="top" class="small"> 453 Target is the directory where the output produced by phpDocumentor will reside. 454 </td> 455 </tr> 456 <tr> 457 <td align="right" valign="top" nowrap="nowrap"> 458 <b>Output<br />Format</b> 459 </td> 460 <td valign="top"> 461 <textarea cols="60" rows="3" name="setting_output" class="text">HTML:Smarty:default</textarea> 462 <br /> 463 Output type:Converter name:template name 464 <br /> 465 <?php 466 echo htmlArraySelect( $converters, 'ConverterSetting', 'size="1" class="text" onchange="swapImage(this.options[this.options.selectedIndex].value);"' , 'HTML:Smarty:default' ); 467 ?> 468 <br /> 469 <a href="javascript:addConverter(document.dataForm.setting_output)"> 470 Add the converter in the help box 471 </a> 472 <br /> 473 <br /> 474 <img name="screenshot" src="images/ss_HTML_Smarty_default.png" width="200" height="200" border="2" alt="Screen Shot"> 475 </td> 476 <td valign="top" class="small"> 477 Outputformat may be HTML, XML, PDF, or CHM (case-sensitive) in version 1.2. 478 <br />There is only one Converter for both CHM and PDF:<br /><i>default</i>. 479 <br />There are 2 HTML Converters:<br /><i>frames</i> or <i>Smarty</i>. 480 <br /><b>frames templates</b> may be any of: 481 <br /> 482 <i>default, earthli, l0l33t, phpdoc.de, phphtmllib, phpedit, DOM/default, DOM/earthli, DOM/l0l33t, DOM/phphtmllib, or DOM/phpdoc.de</i>. 483 <br /> 484 <b>Smarty templates</b> may be any of: 485 <br /> 486 <i>default, HandS, or PHP</i> 487 <br /> 488 <strong>XML:DocBook/peardoc2:default</strong> is the only choice for XML in 1.2.2 489 </td>
490 </tr> 491 </table> 492 </div> 493 494 <div class="tab-page" id="tab_options"> 495 <h2 class="tab">Options</h2> 496 <table cellspacing="0" cellpadding="3" border="0"> 497 <tr> 498 <td align="right" nowrap="nowrap"> 499 <b>Generated Documentation Title</b> 500 </td> 501 <td> 502 <input type="text" name="setting_title" size="40" value="Generated Documentation" class="text"> 503 </td> 504 <td class="small"> 505 Choose a title for the generated documentation 506 </td> 507 </tr> 508 <tr> 509 <td nowrap="nowrap"> 510 <b>Default Package Name</b> 511 </td> 512 <td> 513 <input type="TEXT" name="setting_defaultpackagename" size="40" value="default" class="text" /> 514 </td> 515 <td class="small"> 516 Choose a name for the default package 517 </td> 518 </tr> 519 <tr> 520 <td nowrap="nowrap"> 521 <b>Default Category Name</b> 522 </td> 523 <td> 524 <input type="TEXT" name="setting_defaultcategoryname" size="40" value="default" class="text" /> 525 </td> 526 <td class="small"> 527 Choose a name for the default category. This is only used by the peardoc2 converter 528 </td> 529 </tr> 530 <tr> 531 <td nowrap="nowrap"> 532 <b>Custom Tags</b> 533 </td> 534 <td> 535 <input type="text" name="setting_customtags" size="40" class="text" /> 536 </td> 537 <td class="small"> 538 Custom Tags is a comma-separated list of tags you want phpDocumentor to include as valid tags in this parse. An example would be 'value, size' to allow @value and @size tags. 539 </td> 540 </tr> 541 <tr> 542 <td nowrap="nowrap"> 543 <b>Parse @access private and @internal/{@internal}}</b> 544 </td> 545 <td nowrap="nowrap"> 546 <input type="checkbox" name="setting_parseprivate" value="on" /> 547 </td> 548 <td class="small"> 549 The parameter Parse @access private tells phpDocumentor whether to parse elements with an '@access private' tag in their docblock. In addition, it will turn on parsing of @internal tags and inline {@internal}} sections 550 </td> 551 </tr> 552 <tr> 553 <td nowrap="nowrap"> 554 <b>Generate Highlighted Source Code</b> 555 </td> 556 <td nowrap="nowrap"> 557 <input type="checkbox" name="setting_sourcecode" value="on" /> 558 </td> 559 <td class="small">
560 The parameter Generate Highlighted Source Code tells phpDocumentor whether to generate highlighted XRef source code similar to PHP-XRef output. 561 </td> 562 </tr> 563 <tr> 564 <td nowrap="nowrap"> 565 <b>JavaDoc-compliant<br />Description parsing.</b> 566 </td> 567 <td> 568 <input type="checkbox" name="setting_javadocdesc" value="on" /> 569 </td> 570 <td class="small"> 571 Normally, phpDocumentor uses several rules to determine the short description. This switch asks phpDocumentor to simply search for the first period (.) and use it to delineate the short description. In addition, the short description will not be separated from the long description. 572 </td> 573 </tr> 574 <tr> 575 <td nowrap="nowrap"> 576 <b>PEAR package repository parsing</b> 577 </td> 578 <td> 579 <input type="checkbox" name="setting_pear" value="on" /> 580 </td> 581 <td class="small"> 582 PEAR package repositories have specific requirements: 583 <ol> 584 <li>Every package is in a directory with the same name.</li> 585 <li>All private data members and methods begin with an underscore (function _privfunction()).</li> 586 <li>_Classname() is a destructor</li> 587 </ol> 588 This option recognizes these facts and uses them to make assumptions about packaging and access levels. Note that with PHP 5, the destructor option will be obsolete. 589 </td> 590 </tr> 591 </table> 592 </div> 593 594 <div class="tab-page" id="tab_credits"> 595 <h2 class="tab">Credits</h2> 596 phpDocumentor written by Joshua Eichorn 597 <br />Web Interface originally written by Juan Pablo Morales, enhanced by Greg Beaver and super-charged by Andrew Eddie 598 <p> 599 Joshua Eichorn <a href="mailto:[email protected]">[email protected]</a> 600 <br>Juan Pablo Morales <a href= 601 "mailto:[email protected]">[email protected]</a> 602 <br>Gregory Beaver <a href= 603 "mailto:[email protected]">[email protected]</a> 604 <br>Andrew Eddie <a href= 605 "mailto:[email protected]">[email protected]</a> 606 </p> 607 <p> 608 If you have any problems with phpDocumentor, please visit the website: 609 <a href='http://phpdoc.org'>phpdoc.org</a>, or 610 <a href="http://pear.php.net/bugs/search.php?cmd=display&package_name[]=PhpDocumentor&status =Open"> 611 submit a bug at PEAR</a>. 612 </p> 613 <!-- Created: Tue Jun 26 18:52:40 MEST 2001 --> 614 <!-- hhmts start --> 615 <pre> 616 Last modified: $Date: 2007-04-19 15:20:57 -0500 (Thu, 19 Apr 2007) $ 617 Revision: $Revision: 234145 $ 618 </pre> 619 </div> 620 <div class="tab-page" id="tab_links"> 621 <h2 class="tab">Links</h2> 622 <ul> 623 <li><a target="_top" href="http://www.phpdoc.org/manual.php">phpDocumentor manual</a> - Learn how to use phpDocumentor to document your PHP source code</li> 624 <li><a target="_top"
href="http://pear.php.net/package/PhpDocumentor/">phpDocumentor homepage</a> on PEAR</li> 625 <li><a target="_top" href="http://phpdocu.sourceforge.net/">phpDocumentor homepage</a> on SourceForge</li> 626 <li><a target="_top" href="http://freshmeat.net/projects/phpdocu">Freshmeat record</a> - subscribe here</li> 627 </ul> 628 </div> 629 </div> 630 <input type="hidden" name="interface" value="web"> 631 <input type="hidden" name="dataform" value="true"> 632 633 </form> 634 635 <script type="text/javascript"> 636 637 tp1.addTabPage( document.getElementById( "tab_intro" ) ); 638 tp1.addTabPage( document.getElementById( "tab_config" ) ); 639 tp1.addTabPage( document.getElementById( "tab_files" ) ); 640 tp1.addTabPage( document.getElementById( "tab_output" ) ); 641 tp1.addTabPage( document.getElementById( "tab_options" ) ); 642 tp1.addTabPage( document.getElementById( "tab_credits" ) ); 643 tp1.addTabPage( document.getElementById( "tab_links" ) ); 644 setupAllTabs(); 645 </script> 646 647 </body> 648 </html>
68 } 69 .title { 70 font-size: 12pt; 71 } 72 </style> 73 </head> 74 75 <body bgcolor="#0099cc" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"> 76 77 <table width="100%" cellspacing="0" cellpadding="0"> 78 <tr> 79 <td bgcolor="#0099cc" height="35" width="100" nowrap="nowrap"> 80 <img src="../poweredbyphpdoc.gif" alt="" width="88" height="31" border="0" alt="" /> 81 </td> 82 <td bgcolor="#0099cc" width="100%"> 83 <span class="title"><strong>docBuilder</strong> :: phpDocumentor v<?php print PHPDOCUMENTOR_VER; ?> Web Interface</span> 84 </td> 85 </tr> 86 </table> 87 88 </body> 89 </html>
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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 142 143 144 145 146 147
* @todo CS cleanup - change package to PhpDocumentor */ class Classes { /**#@+ * @access private */ /** * file being parsed, used in every add function to match up elements with * the file that contains them * * This variable is used during parsing to associate class elements added * to the data structures that contain them with the file they reside in * @see addClass(), addMethod(), addVar(), nextFile() * @var string */ var $curfile; /** * class being parsed, used to match up methods and vars with their parent * class * * This variable is used during parsing to associate class elements added * to the data structures that contain them with the file they reside in * @see addMethod(), addVar() * @var string */ var $curclass; /** * Used when a definite match is made between a parent class and a child * class * * This variable is used in post-parsing. * * Format:<pre> * array( * parent => array( * parentfile => array( * child => childfile * ) * ) * )</pre> * @var array */ var $definitechild; /** * array of parsed classes organized by the name of the file that contains * the class. * * Format:<pre> * array( * filename => array( * classname => {@link parserClass} * ) * )</pre> * @var array */ var $classesbyfile = array(); /** * array of file names organized by classes that are in the file. * * This structure is designed to handle name conflicts. Two files can * contain classes with the same name, and this array will record both * filenames to help control linking and inheritance errors * * Format:<pre> * array( * classname => array( * name of file containing classname, * name of file 2 containing classname, * ... * ) * )</pre> * @var array */ var $classesbynamefile = array(); /** * array of parsed methods organized by the file that contains them. * * Format:<pre>
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
* array( * filename => array( * classname => array( * {@link parserMethod} 1, * {@link parserMethod} 2, * ... * ) * ) * )</pre> * @var array */ var $methodsbyfile = array(); /** * array of parsed vars organized by the file that contains them. * * Format:<pre> * array( * filename => array( * classname => array( * {@link parserVar} 1, * {@link parserVar} 2, * ... * ) * ) * )</pre> * @var array */ var $varsbyfile = array(); /** * array of parsed class constants organized by the file that contains them. * * Format:<pre> * array( * filename => array( * classname => array( * {@link parserConst} 1, * {@link parserConst} 2, * ... * ) * ) * )</pre> * @var array */ var $constsbyfile = array(); /** * keeps track of extend declarations by file, used to find inheritance * * Format:<pre> * array( * filename => array( * classname => parentclassname * ) * )</pre> * @var array */ var $extendsbyfile = array(); /** * Keeps track of child classes by file. * Since phpDocumentor can document collections of files that contain name * conflicts (PHP would give a fatal error), it * is impossible to assume a class that declares "extends foo" necessarily * extends the class foo in file X. It could be an * extended class of class foo in file Y. Because of this, phpDocumentor * relies on packaging to resolve the name conflict * This array keeps track of the packages of a child class * * Format:<pre> * array( * parentclassname => array( * filename => array( * childclassname => array( * packagename, * packagename * ) * ) * ) * )</pre> * @var array */ var $classchildrenbyfile = array();
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
/** * Keeps track of class packages found in a file. * This is used in {@link getParentClass()} to determine the number of * packages in a file, in order to resolve inheritance issues * Format:<pre> * array( * filename => array( * packagename1, * packagename2, * ... * ) * )</pre> * @var array */ var $classpackagebyfile = array(); /** * a tree of class inheritance by name. * * Format:<pre> * array( * childname => parentname, * childname1 => parentname1, * rootname => 0, * ... * )</pre> * @var array * @see Converter::generateSortedClassTreeFromClass() */ var $classparents = array(); /** * Keeps track of package and subpackage for each class name, organized * by package * * Format:<pre> * array( * classname => array( * path => array( * package, * subpackage * ), * path2 => array( * package, * subpackage * ), * ... * ) * )</pre> * @var array */ var $classpathpackages = array(); /** * used to delete duplicates in the same package to avoid documentation errors * * Specifically used in {@link Converter::checkKillClass()} */ var $killclass = array(); /** * array of methods by package and class * * format:<pre> * array(packagename => * array(classname => * array(methodname1 => {@link parserMethod} class, * methodname2 => {@link parserMethod} class,...) * ) * ) * )</pre> * @var array * @see Converter */ var $methods = array(); /** * array of class variables by package and class * * format:<pre> * array(packagename => * array(classname => * array(variablename1 => {@link parserVar} class, * variablename2 => {@link parserVar} class,...
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
/** * array of class variables by package and class * * format:<pre> * array(packagename => * array(classname => * array(constname1 => {@link parserConst} class, * constname2 => {@link parserConst} class,... * ) * ) * )</pre> * @var array * @see Converter */ var $consts = array(); /** * Reverse class_packages_by_file, used to prevent duplicates * @var array Format: array(packagename => 1) */ var $revcpbf = array(); /** * All classes with no parents (no extends clause) are tracked in this array * by the file that contains them. * * Format:<pre> * array( * classname => array( * name of file1 that contains root classname, * name of file2 that contains root classname, * ... * ) * )</pre> * @var array */ var $roots = array(); /** * All classes with a parent that was not parsed are included in this array * * Format:<pre> * array( * classname => array( * name of file1 that contains root classname, * name of file2 that contains root classname, * ... * ) * )</pre> * @var array */ var $specialRoots = array(); /** * array of all files that contain classes with the same name * @var array Format: (classname => array(path1, path2,...)) */ var $potentialclassconflicts = array(); /** * array of all inter-package name conflicts of classes * * This array allows documentation of PHP namespace conflicts that would * occur should a user try to include these files in the same file * @var array Format: (classname => array(path1, path2,...)) */ var $classconflicts = array(); /**#@-*/ /** * While parsing, add a class to the list of parsed classes * * sets up the {@link $classesbyfile, $classesbynamefile, $extendsbyfile}, * {@link $classchildrenbyfile, $roots} arrays, and sets {@link $curclass} * * @param parserClass &$element element is a {@link parserClass}
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466
* * @return void * @uses addPackageToFile() marks the current class's package as being * present in a file */ function addClass(& $element) { $this-> curclass = $element-> getName(); $element-> curfile = $this-> curfile; if (isset($this-> classesbyfile[$this-> curfile][$this-> curclass])) { addWarning(PDERROR_ELEMENT_IGNORED, 'class', $this-> curclass, $this-> curfile); $this-> curclass = false; return; } $this-> classesbyfile [$this-> curfile][$this-> curclass] = $element; $this-> classesbynamefile[$this-> curclass][] = $this-> curfile; $this-> extendsbyfile[$this-> curfile][$this-> curclass] = $element-> getExtends(); $this-> classchildrenbyfile[$element-> getExtends()] [$this-> curfile][$this-> curclass][] = $element-> docblock-> package; if ($element-> docblock-> getExplicitPackage()) $this-> addPackageToFile($element-> docblock-> package); if (!$element-> getExtends()) { $this-> roots[$this-> curclass][] = $this-> curfile; } } /** * While parsing, add a method to the list of parsed methods * * sets up the {@link $methodsbyfile} array using {@link $curfile} and * {@link $curclass} * * @param parserMethod &$element element is a {@link parserMethod} * * @return void */ function addMethod(& $element) { if (!$this-> curclass) return; $this-> methodsbyfile[$this-> curfile][$this-> curclass][] = $element; } /** * While parsing, add a variable to the list of parsed variables * * sets up the {@link $varsbyfile} array using {@link $curfile} * and {@link $curclass} * * @param parserVar &$element element is a {@link parserVar} * * @return void */ function addVar(& $element) { if (!$this-> curclass) return; $this-> varsbyfile[$this-> curfile][$this-> curclass][] = $element; } /** * While parsing, add a variable to the list of parsed variables * * sets up the {@link $constsbyfile} array using {@link $curfile} * and {@link $curclass} * * @param parserConst &$element element is a {@link parserConst} * * @return void */ function addConst(& $element)
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
{ if (!$this-> curclass) return; $this-> constsbyfile[$this-> curfile][$this-> } /** * Prepare to parse a new file * * sets {@link $curfile} to $file and {@link $curclass} * to false (no class being parsed) * * @param string $file file currently being parsed * * @return void */ function nextFile($file) { $this-> curfile = $file; $this-> curclass = false; } /** * Mark a package as being used in a class * * {@source } * * @param string $package package name * * @return void */ function addPackageToFile($package) { if (!isset($this-> revcpbf[$this-> curfile][$package])) $this-> classpackagebyfile[$this-> curfile][] = $package; $this-> revcpbf[$this-> curfile][$package] = 1; } /** * Find the parent class of $class, and set up structures to note this fact * * Modifies the {@link parserClass} element in {@link $classesbyfile} to use * the parent's package, and inherit methods/vars * * @param string $class child class to find parent class * @param string $file file child class is located in * * @return void * @uses $definitechild if a match is made between a parent class and parameter * $class in file $file, then definitechild is set here * @uses getParentClass() to find the parent class */ function setClassParent($class,$file) { if (is_array($par = $this-> getParentClass($class, $file))) { // (for debugging) // phpDocumentor_out("$file class $class extends " // . $par[1] ." file ". $par[0] . "\n"); $this-> $this-> } else { $this-> } } /** * Main processing engine for setting up class inheritance. * * This function uses {@link $roots} to traverse the inheritance tree via * {@link processChild()} and returns the data structures * phpDocumentor_IntermediateParser needs to convert parsed data * to output using {@link phpDocumentor_IntermediateParser::Convert()} * * @param phpDocumentor_IntermediateParser &$render the renderer object * * @return void * @uses processChild() set up inheritance * @todo CS Cleanup - rename to "inherit" for CamelCaps naming standard */ function Inherit(& $render) classesbyfile[$file][$class]-> setParent($par[1], $par[0], $this); definitechild[$par[1]][$par[0]][$class] = $file; classesbyfile[$file][$class]-> setParentNoClass($par); curclass][] = $element;
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626
{ phpDocumentor_out("\nProcessing Class Inheritance\n\n" ); flush(); phpDocumentor_out("\nProcessing Root Trees\n\n" ); flush(); foreach ($this-> roots as $class => $files) { for ($i=0; $i< count($files); $i++) { $this-> processChild($render, $class, $files[$i]); } } if (0) foreach ($this-> classesbyfile as $i => $j) { foreach ($j as $k => $m) { var_dump($i, $k); if ($i == 'iConverter') { var_dump($j); } } } phpDocumentor_out("\nProcessing leftover classes " . "(classes that extend root classes not found in the same package)\n" flush(); foreach ($this-> classesbyfile as $i => $j) { foreach ($j as $k => $m) { $this-> processChild($render, $k, $i, true); } } phpDocumentor_out("done processing leftover classes\n" ); flush(); $this-> setupClassConflicts(); } /** * Transfers actual conflicts from {@link $potentialClassconflicts} to * {@link $classconflicts} * * @return void * @access private * @uses $potentialclassconflicts transfers values to {@link $classconflicts} */ function setupClassConflicts() { foreach ($this-> potentialclassconflicts as $class => $paths) { if (count($paths) - 1) { //conflict $package = array(); foreach ($paths as $path) { // create a list of conflicting classes in each package if (isset($this-> classpathpackages[$class][$path])) $package[$this-> classpathpackages[$class][$path][0]][] = $path; } foreach ($package as $pathpackages) { /* * if at least 2 functions exist in the same package, * delete all but the first one and add warnings */ if (count($pathpackages) - 1) { for ($i=1; $i < count($pathpackages); $i++) { if (isset($this-> classesbyfile[$pathpackages[$i]])) { addWarning(PDERROR_ELEMENT_IGNORED, 'class', $class, $pathpackages[$i]); $this-> killClass($class, $pathpackages[$i]); $oth = array_flip($paths); unset($paths[$oth[$pathpackages[$i]]]); } } } } $this-> classconflicts[$class] = $paths; } } } /** * If a package contains two classes with the same name, this function finds * that conflict * * Returns the {@link $classconflicts} entry for class $class, minus its own path * * @param mixed $class the class name to search for *
);
627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706
* @return mixed returns false if no conflicts, * or an array of paths containing conflicts */ function getConflicts($class) { if (!isset($this-> classconflicts[$class])) return false; $a = array(); foreach ($this-> classconflicts[$class] as $conflict) { $a[$this-> classesbyfile[$conflict][$class]-> docblock-> = $this-> classesbyfile[$conflict][$class]; } return $a; } /** * sets up {@link $killclass} for use by Converter::checkKillClass() * * @param mixed $class the class * @param mixed $path the path * * @return void * @access private */ function killClass($class,$path) { $this-> killclass[$class][$path] = true; }
package]
/** * This function recursively climbs up the class tree, setting inherited * information like package and adds the elements to * {@link phpDocumentor_IntermediateParser}. * * Using structures defined in {@link Classes}, * the function first sets package information, * and then seeks out child classes. * It uses 3 tests to determine whether a class is a child class. * <ol> * <li>child class is in the same file as the parent class * and extends parent class * </li> * <li>child class is in a different file and specifies * the parent's @package in its docblock * </li> * <li>child class is in a different file and is in a * different @package, with one possible parent class * </li> * </ol> * * @param phpDocumentor_IntermediateParser &$render the renderer object * @param string $class class to process * @param string $file name of file $class * is located in * @param boolean $furb flag used privately * to control informational * output while parsing * (used when processing * leftover classes in * {@link Inherit()} * * @return void * @global string default package, usually "default" */ function processChild(& $render,$class,$file,$furb = false) { global $phpDocumentor_DefaultPackageName; if (isset($this-> classesbyfile[$file][$class]-> processed)) return; $this-> potentialclassconflicts[$class][] = $file; if ($furb) phpDocumentor_out(" Processing $class in file $file\n" ); flush(); $this-> classesbyfile[$file][$class]-> processed = true; $db = $this-> classesbyfile[$file][$class]; $render-> addUses($db, $file); if (!$render-> parsePrivate) { /* * if this class has an @access private, * and parse private is disabled, remove it
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786
*/ if ($db-> docblock-> hasaccess) { $aaa = $db-> docblock-> getKeyword('access'); if (is_object($aaa) && $aaa-> getString() == 'private') { if (isset($this-> varsbyfile[$file]) && isset( $this-> varsbyfile[$file][$class])) { unset($this-> varsbyfile[$file][$class]); } if (isset($this-> methodsbyfile[$file]) && isset( $this-> methodsbyfile[$file][$class])) { unset($this-> methodsbyfile[$file][$class]); } if (isset($this-> constsbyfile[$file]) && isset( $this-> constsbyfile[$file][$class])) { unset($this-> constsbyfile[$file][$class]); } $this-> classesbyfile[$file][$class]-> ignore = true; // if this is a root class, remove it from the roots array if (isset($this-> roots[$class])) { foreach ($this-> roots[$class] as $i => $files) { // find the file key and unset if ($files == $file) unset($this-> roots[$class][$i]); } } /* * if this is a child, remove it from the list * of child classes of its parent */ if ($db-> getExtends()) unset($this-> classchildrenbyfile[$db-> getExtends()][$file]); return; } } } if ($render-> packageoutput) { if (!in_array($db-> docblock-> package, $render-> packageoutput)) { if (isset($this-> varsbyfile[$file]) && isset( $this-> varsbyfile[$file][$class])) { unset($this-> varsbyfile[$file][$class]); } if (isset($this-> methodsbyfile[$file]) && isset( $this-> methodsbyfile[$file][$class])) { unset($this-> methodsbyfile[$file][$class]); } if (isset($this-> constsbyfile[$file]) && isset( $this-> constsbyfile[$file][$class])) { unset($this-> constsbyfile[$file][$class]); } $this-> classesbyfile[$file][$class]-> ignore = true; if (isset($this-> roots[$class])) { foreach ($this-> roots[$class] as $i => $files) { if ($files == $file) unset($this-> roots[$class][$i]); } } if ($db-> getExtends()) unset($this-> classchildrenbyfile[$db-> getExtends()][$file]); return; } } $this-> setClassParent($class, $file); $db = $this-> classesbyfile[$file][$class]; if ($furb && ! is_array($db-> parent)) { // debug("furb adding $class $file to roots"); $this-> specialRoots[$db-> parent][] = array($class, $file); } // fix for 591396 if (!$db-> docblock-> getExplicitPackage()) { $a = $render-> proceduralpages-> pagepackages[$file]; if ($a[0] != $phpDocumentor_DefaultPackageName) { // inherit page package $this-> classesbyfile[$file][$class]-> docblock-> package = $a[0]; } } if ($this-> classesbyfile[$file][$class]-> docblock-> package == $render-> proceduralpages-> pagepackages[$file][0]) { if ($this-> classesbyfile[$file][$class]-> docblock-> subpackage == '') { $this-> classesbyfile[$file][$class]-> docblock-> subpackage = $render-> proceduralpages-> pagepackages[$file][1]; }
787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 $vr; 848 849 850 851 852 853 854 855 856 857 858 $vr; 859 860 861 862 863 864
} $db = $this-> classesbyfile[$file][$class]; $render-> addPackageParent($db); $render-> addPageIfNecessary($file, $db); if ($access = $db-> docblock-> getKeyword('access')) { if (!is_string($access) && is_object($access)) $access = $access-> getString(); if (!is_string($access)) $access = 'public'; if (($access == 'private') && (! $render-> parsePrivate)) { if (isset($this-> varsbyfile[$file]) && isset( $this-> varsbyfile[$file][$class])) { foreach ($this-> varsbyfile[$file][$class] as $i => $vr) { $vr-> docblock-> addKeyword('access', 'private'); $this-> varsbyfile[$file][$class][$i] = $vr; } } if (isset($this-> methodsbyfile[$file]) && isset( $this-> methodsbyfile[$file][$class])) { foreach ($this-> methodsbyfile[$file][$class] as $i => $vr) { $vr-> docblock-> addKeyword('access', 'private'); $this-> methodsbyfile[$file][$class][$i] = $vr; } } if (isset($this-> constsbyfile[$file]) && isset( $this-> constsbyfile[$file][$class])) { foreach ($this-> constsbyfile[$file][$class] as $i => $vr) { $vr-> docblock-> addKeyword('access', 'private'); $this-> constsbyfile[$file][$class][$i] = $vr; } } } } $this-> classpathpackages[$class][$file] = array($db-> docblock-> package,$db-> docblock-> subpackage); if ($db-> docblock-> getExplicitPackage()) { $render-> proceduralpages-> addClassPackageToFile($file, $db-> docblock-> package, $db-> docblock-> subpackage); } $render-> addElementToPage($db, $file); if (isset($this-> varsbyfile[$file]) && isset( $this-> varsbyfile[$file][$class])) { foreach ($this-> varsbyfile[$file][$class] as $i => $vr) { $vr-> docblock-> package = $db-> docblock-> package; $vr-> docblock-> subpackage = $db-> docblock-> subpackage; $render-> addElementToPage($vr, $file); $render-> addUses($vr, $file); $this-> varsbyfile[$file][$class][$i] = $vr; $this-> vars[$db-> docblock-> package][$class][$vr-> getName()] = $vr; } } if (isset($this-> methodsbyfile[$file]) && isset( $this-> methodsbyfile[$file][$class])) { foreach ($this-> methodsbyfile[$file][$class] as $i => $vr) { $vr-> docblock-> package = $db-> docblock-> package; $vr-> docblock-> subpackage = $db-> docblock-> subpackage; $render-> addElementToPage($vr, $file); $render-> addUses($vr, $file); $this-> methodsbyfile[$file][$class][$i] = $vr; $this-> methods[$db-> docblock-> package][$class][$vr-> getName()] = } } if (isset($this-> constsbyfile[$file]) && isset( $this-> constsbyfile[$file][$class])) { foreach ($this-> constsbyfile[$file][$class] as $i => $vr) { $vr-> docblock-> package = $db-> docblock-> package; $vr-> docblock-> subpackage = $db-> docblock-> subpackage; $render-> addElementToPage($vr, $file); $render-> addUses($vr, $file); $this-> constsbyfile[$file][$class][$i] = $vr; $this-> methods[$db-> docblock-> package][$class][$vr-> getName()] = } } $this-> classpackages[$class][] = array($db-> docblock-> package,$db-> if (is_array($db-> parent)) $this-> classparents[$db-> docblock->
docblock->
subpackage); parent[1];
package][$class] = $db->
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944
docblock->
getExtends();
parent[1], $db->
$this-> classchildren[$z-> docblock-> package][$db-> parent[1]][] = $db; } if (isset($this-> classchildrenbyfile[$class])) { foreach ($this-> classchildrenbyfile[$class] as $childfile => $other) { // test 1, inherits in same file (must be same package) if ($childfile == $file) { foreach ($other as $child => $packages) { // debug("parent $class same file $child"); $this-> processChild($render, $child, $childfile); $x = $this-> getClass($child, $childfile); if ($x-> docblock-> package != $GLOBALS['phpDocumentor_DefaultPackageName']) { // child package need root for class trees if ($x-> docblock-> package != $db-> docblock-> package) { // debug("adding $child in $childfile 1"); $this-> roots[$child][] = $childfile; } } } } else { // test 2, different file, same package foreach ($other as $child => $packages) { for ($j=0; $j< count($packages); $j++) { if ($this-> classesbyfile[$file][$class]-> docblock-> package == $packages[$j]) { $this-> processChild($render, $child, $childfile); // debug("$childfile diff file $child, parent $class, // same package ".$packages[$j]); } else { /* * test 3, different file, different package, * only 1 parent is possible */ if (isset($this-> classesbynamefile[$child])) { // 1 possible parent if (count($this-> classesbynamefile[$class]) == 1) { // debug("$childfile diff file $child, // diff package, // 1 possible parent root $class"); $this-> processChild($render, $child, $childfile); $x = $this-> getClass($child, $childfile); if ($x-> docblock-> package != $GLOBALS ['phpDocumentor_DefaultPackageName']) { // child package need root //for class trees if ($x-> docblock-> package != $db-> docblock-> package) { // debug("adding roots // $child in $childfile 2"); $this-> roots[$child][] = $childfile; } } } } } } } } } } } /** * Get the parserClass representation of a class from its name and file * * @param string $class classname * @param string $file file classname is located in * * @return parserClass */ function & getClass($class, $file) {
945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024
// debug("getClass called with class $class file $file"); return $this-> classesbyfile[$file][$class]; } /** * Used by {@link parserData::getClasses()} * to retrieve classes defined in file $path * * retrieves the array entry from {@link $classesbyfile} for $path * * @param string $path full path to filename * * @return mixed returns false if no classes defined in the file, * otherwise returns an array of {@link parserClass}es */ function getClassesInPath($path) { if (!isset($this-> classesbyfile[$path])) return false; return $this-> classesbyfile[$path]; } /** * called by {@link parserClass::hasMethods()}. Should not be directly called * * @param string $file file classname is located in * @param string $class classname * * @return bool * @access private */ function hasMethods($file, $class) { return isset($this-> methodsbyfile[$file][$class]); } /** * called by {@link parserClass::hasConsts()}. * Should not be directly called * * @param string $file file classname is located in * @param string $class classname * * @return bool * @access private */ function hasConsts($file,$class) { return isset($this-> constsbyfile[$file][$class]); } /** * called by {@link parserClass::hasVars()}. Should not be directly called * * @param string $file file classname is located in * @param string $class classname * * @return bool * @access private */ function hasVars($file, $class) { return isset($this-> varsbyfile[$file][$class]); } /** * called by {@link parserClass::hasMethod()}. Should not be directly called * * @param string $class classname * @param string $file file classname is located in * @param string $name method name * * @return bool * @access private */ function hasMethod($class, $file, $name) { if (!$this-> hasMethods($file, $class)) return false; for ($i=0; $i< count($this-> methodsbyfile[$file][$class]); $i++) { if ($this-> methodsbyfile[$file][$class][$i]-> getName() == $name) return true;
1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104
} return false; } /** * called by {@link parserClass::hasVar()}. Should not be directly called * * @param string $class classname * @param string $file file classname is located in * @param string $name var name * * @return bool * @access private */ function hasVar($class, $file, $name) { if (!$this-> hasVars($file, $class)) return false; for ($i=0; $i< count($this-> varsbyfile[$file][$class]); $i++) { if ($this-> varsbyfile[$file][$class][$i]-> getName() == $name) return true; } return false; } /** * called by {@link parserClass::hasConst()}. Should not be directly called * * @param string $class classname * @param string $file file classname is located in * @param string $name constant name * * @return bool * @access private */ function hasConst($class, $file, $name) { if (!$this-> hasConsts($file, $class)) return false; for ($i=0; $i< count($this-> constsbyfile[$file][$class]); $i++) { if ($this-> constsbyfile[$file][$class][$i]-> getName() == $name) return true; } return false; } /** * called by {@link parserClass::getMethods()}. Should not be directly called * * @param string $class classname * @param string $file file classname is located in * * @return mixed * @access private */ function & getMethods($class, $file) { if (!isset($this-> methodsbyfile[$file][$class])) { $flag = false; return $flag; } return $this-> methodsbyfile[$file][$class]; } /** * called by {@link parserClass::getVars()}. Should not be directly called * * @param string $class classname * @param string $file file classname is located in * * @return mixed * @access private */ function & getVars($class, $file) { if (!isset($this-> varsbyfile[$file][$class])) { $flag = false; return $flag; } return $this-> varsbyfile[$file][$class]; }
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184
/** * called by {@link parserClass::getConsts()}. Should not be directly called * * @param string $class classname * @param string $file file classname is located in * * @return mixed * @access private */ function & getConsts($class, $file) { if (!isset($this-> constsbyfile[$file][$class])) { $flag = false; return $flag; } return $this-> constsbyfile[$file][$class]; } /** * called by {@link parserClass::getMethod()}. Should not be directly called * * @param string $class classname * @param string $file file classname is located in * @param string $name method name * * @return mixed * @access private */ function getMethod($class, $file, $name) { if (!$this-> hasMethod($class, $file, $name)) return false; for ($i=0; $i< count($this-> methodsbyfile[$file][$class]); $i++) { if ($this-> methodsbyfile[$file][$class][$i]-> getName() == $name) return $this-> methodsbyfile[$file][$class][$i]; } } /** * called by {@link parserClass::getVar()}. Should not be directly called * * @param string $class classname * @param string $file file classname is located in * @param string $name var name * * @return mixed * @access private */ function getVar($class, $file, $name) { if (!$this-> hasVar($class, $file, $name)) return false; for ($i=0; $i< count($this-> varsbyfile[$file][$class]); $i++) { if ($this-> varsbyfile[$file][$class][$i]-> getName() == $name) return $this-> varsbyfile[$file][$class][$i]; } } /** * called by {@link parserClass::getConst()}. Should not be directly called * * @param string $class classname * @param string $file file classname is located in * @param string $name const name * * @return mixed * @access private */ function getConst($class, $file, $name) { if (!$this-> hasConst($class, $file, $name)) return false; for ($i=0; $i< count($this-> constsbyfile[$file][$class]); $i++) { if ($this-> constsbyfile[$file][$class][$i]-> getName() == $name) return $this-> constsbyfile[$file][$class][$i]; } } /** * Search for a class in a package * * @param string $class classname * @param string $package package classname is in
1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264
* * @return mixed returns false if no class in $package, * otherwise returns a {@link parserClass} */ function & getClassByPackage($class, $package) { if (!isset($this-> classesbynamefile[$class])) { // removed, too many warnings, not very useful // addWarning(PDERROR_CLASS_NOT_IN_PACKAGE,$class,$package); $flag = false; return $flag; } for ($i=0; $i < count($this-> classesbynamefile[$class]); $i++) { $cls = $this-> classesbyfile[$this-> classesbynamefile[$class][$i]][$class]; $pkg = $cls-> getPackage(); if ($pkg == $package) return $cls; } // addWarning(PDERROR_CLASS_NOT_IN_PACKAGE,$class,$package); $flag = false; return $flag; } /** * Find the parent class of a class in file $file * uses 3 tests to find the parent classname: * <ol> * <li>only one class with the parent classname</li> * <li>more than one class, but only one in the same file as the child</li> * <li>only one parent class in the same package as the child</li> * </ol> * * @param string $class classname * @param string $file file classname is located in * * @return mixed false if no parent class, * a string if no parent class found by that name, * and an array(file parentclass is in, parentclassname) */ function getParentClass($class,$file) { if (!isset($this-> classesbyfile[$file][$class])) { return false; } $element = $this-> classesbyfile[$file][$class]; if (!($ex = $element-> getExtends())) return false; // first check to see if there is one and only one // class with the parent class's name if (isset($this-> classesbynamefile[$ex])) { if (count($this-> classesbynamefile[$ex]) == 1) { if ($this-> classesbyfile [$this-> classesbynamefile[$ex][0]][$ex]-> ignore) { return $ex; } return array($this-> classesbynamefile[$ex][0],$ex); } else { // next check to see if there is a parent class in the same file if (isset($this-> classesbyfile[$file][$ex])) { if ($this-> classesbyfile[$file][$ex]-> ignore) { return $ex; } return array($file,$ex); } // next check to see if there is only one package // used in the file, try to resolve it that way if (isset($this-> classpackagebyfile[$file])) { if (count($this-> classpackagebyfile[$file]) == 1) { for ($i=0;$i< count($this-> classesbynamefile[$ex]);$i++) { if ($this-> classesbyfile [$this-> classesbynamefile[$ex][$i]][$ex]-> getPackage() == $this-> classpackagebyfile[$file][0]) { if ($this-> classesbyfile [$this-> classesbynamefile[$ex][$i]][$ex]-> ignore) return $ex; return array($this-> classesbynamefile[$ex][$i],$ex); } }
1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344
} } // name conflict addWarning(PDERROR_INHERITANCE_CONFLICT, $class, $file, $ex); return $ex; } } else { if (class_exists('ReflectionClass') && class_exists($ex)) { $r = new ReflectionClass($ex); if ($r-> isInternal()) { return $ex; // no warning } } addWarning(PDERROR_PARENT_NOT_FOUND, $class, $ex); return $ex; } } /** * Get a list of all root classes indexed by package. Used to generate * class trees by {@link Converter} * * @param boolean $all [since phpDocumentor 1.3.0RC6] determines whether to * return class trees that extend non-parsed classes * * @return array array(package => array(rootclassname, rootclassname,...),...) */ function getRoots($all = false) { $roots = array(); $temproots = $this-> roots; if (!$all) { foreach ($this-> specialRoots as $package => $root) { foreach ($root as $parent => $info) { $temproots[$info[0]][] = $info[1]; } } } foreach ($temproots as $class => $files) { if (count($files)) { foreach ($files as $i => $boofou) { $x = $this-> getClass($class, $files[$i]); $roots[$x-> } } } foreach ($roots as $package => $root) { usort($roots[$package], "strnatcasecmp" ); } if ($all) { $specialRoots = array(); foreach ($this-> specialRoots as $parent => $classinfo) { if (count($classinfo)) { foreach ($classinfo as $i => $info) { $x = $this-> getClass($info[0], $info[1]); $specialRoots[$x-> } } } foreach ($specialRoots as $package => $root) { uksort($specialRoots[$package], "strnatcasecmp" ); foreach ($specialRoots[$package] as $parent => $classes) { usort($specialRoots[$package][$parent], 'strnatcasecmp'); } } return array('special' => $specialRoots, 'normal' => $roots); } return $roots; } /** * Get all classes confirmed in parsing * to be descended class $parclass in file $file * * @param string $parclass name of parent class * @param string $file file parent class is found in * * @return mixed either false if no children, or array of format getPackage()][$parent][] = $info[0]; getPackage()][] = $class;
1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356
* array(childname => childfile,childname2 => childfile2,...) * @see parserClass::getChildClassList() * @uses $definitechild */ function getDefiniteChildren($parclass, $file) { if (isset($this-> definitechild[$parclass][$file])) return $this-> definitechild[$parclass][$file]; return false; } } ?>
, "@VER@" , "1.4.3"
); );
, "http://www.phpdoc.org"
);
// set the correct path delimiter define('SMART_PATH_DELIMITER', DIRECTORY_SEPARATOR); define('tokenizer_ext', extension_loaded('tokenizer') && version_compare(phpversion(), "4.3.0" , ">=" ));
// we just replace all the \ with / so that we can just operate on / define('PATH_DELIMITER', '/'); // set the correct path delimiter define('PHPDOCUMENTOR_WINDOWS', substr(PHP_OS, 0, 3) == 'WIN'); define('_IN_PHP5', phpversion() == '5.0.0RC1-dev' || phpversion() == '5.0.0RC2-dev'
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 0) { 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
|| version_compare(phpversion(), '5.0.0', 'ge')); // determine which "clone" class to set, based on PHP major version $cloneClassDir = 'PhpDocumentor' . DIRECTORY_SEPARATOR . 'phpDocumentor'; $cloneClassFile = 'clone.inc.php'; if ('@VER@' == '@'.'VER@') { // we're _not_ in a PEAR installation $cloneClassDir = dirname(__FILE__); } if (_IN_PHP5) { // we _are_ in PHP5 $cloneClassFile = 'clone5.inc.php'; } require_once $cloneClassDir . DIRECTORY_SEPARATOR . $cloneClassFile; // make arg arrays available if (isset($_SERVER['argv'])) { $argv = $_SERVER['argv']; $argc = $_SERVER['argc']; } /** * used in phpdoc.php and new_phpdoc.php * * @param string $directory a directory string * * @return array an array of directory contents * @todo CS cleanup - rename function to PhpDocumentor_ConfigFileList */ function phpDocumentor_ConfigFileList($directory) { $ret = array(); if (@is_dir($directory)) { $ret = array(); // thanks to Jason E Sweat ([email protected]) for fix $d = @dir($directory); while ($d && $entry=$d-> $getentry = false; if (strcmp($entry, "." read()) { ) != 0 && strcmp($entry, ".." ) !=
if (substr($entry, 0, 1) != "." ) $getentry = true; } if ($getentry == true) { if (strpos($entry, '.ini')) if (is_file($directory . PATH_DELIMITER . $entry)) { $ret[] = str_replace('.ini', '', $entry); } } } if ($d) $d-> } else { } return $ret; } /** * Parse an .ini file * * Works like {@link parse_ini_file}, except it will take a section like: * * <pre> * [MYVAR] * value1 * value2 * value3 * </pre> * * and return an associative array(MYVAR => array(value1, value2, value3)) * * @param string $filename full path to the ini file * @param bool $process_sections add an associative index * for each section [in brackets] * * @return array * @todo CS cleanup - rename function to PhpDocumentor_parse_ini_file */ function phpDocumentor_parse_ini_file($filename, $process_sections = false) close();
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
{ $ini_array = array(); $sec_name = "" ; $lines = @file($filename); if (!$lines) return $lines; foreach ($lines as $line) { // code by Greg Beaver, ignore comments if ($line[0] == ';') continue; $line = trim($line); if ($line == "" ) { continue; } if ($line[0] == "[" && $line[strlen($line) - 1] == "]" ) { $sec_name = substr($line, 1, strlen($line) - 2); } else { if (strpos($line, "=" )) { $pos = strpos($line, "=" ); $property = trim(substr($line, 0, $pos)); // code by Greg Beaver if (substr($property, 0, 1) == '"' && substr($property, -1) == ) { $property = stripcslashes(substr($property, 1, count($property) - 2)); } $value = trim(substr($line, $pos + 1)); if ($value == 'false') $value = false; if ($value == 'true') $value = true; if (substr($value, 0, 1) == '"' &&
$value = stripcslashes(substr($value, 1, count($value) - 2)); } // done additions if ($process_sections) { if ($sec_name != '') $ini_array[$sec_name][$property] = $value; else $ini_array[$property] = $value; } else { $ini_array[$property] = $value; } } else { // code by Greg Beaver if (trim($line[0]) == ';') continue; if ($process_sections) { $ini_array[$sec_name][] = trim($line); } // done additions } } } return $ini_array; } /** * construct an "array_key_exists()" method * if the runtime PHP version doesn't have one * * @todo CS Cleanup - can't avoid "prefixed by package" error * @todo depend on PHP_Compat for this? */ if (!function_exists('array_key_exists')) { /** * Determines if a given key exists in a given array * * @param mixed $key key to search for * @param array $search the array of keys to search * * @return bool whether or not the key was found * @ignore */ function array_key_exists($key, $search) { foreach ($search as $keys => $nul) { if ($key == $keys) return true; } return false; }
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
} /** * construct an "is_a()" method * if the runtime PHP version doesn't have one * * @todo CS Cleanup - can't avoid "prefixed by package" error * @todo depend on PHP_Compat for this? */ if (!function_exists('is_a')) { /** * Determines if one item "is" an object of the other item * * @param string $classname the class in question * @param string $classquery the "is it a" class * * @return bool whether or not the class "is" one * @ignore */ function is_a($classname, $classquery) { $father = get_parent_class($classname); if (strtolower($father) == strtolower($classquery)) { return true; } elseif (!empty($father)) { return is_a($father, $classquery); } else { return false; } } } /** * Debugging output * * @param string $s the "debug message" string to echo out * * @return void * @todo CS Cleanup - can't avoid "prefixed by package" error */ function debug($s) { echo " $s\n" ; } /** * Returns a formatted var_dump for debugging purposes. * * @param string $s string to display * @param mixed $v unlimited number of variables to display with var_dump() * * @return void */ function fancy_debug($s,$v) { if (isset($GLOBALS['dont_debug']) && $GLOBALS['dont_debug']) return; debug($s."\n\n</pre><blockquote><pre>" ); var_dump($v); if (func_num_args()> 2) { for ($i=2;$i< func_num_args();$i++) { $a = func_get_arg($i); // debug(" "); var_dump($a); } } debug("</pre></blockquote><pre>\n\n" ); } /** * Returns a lower-cased version of get_class for PHP 5 * * get_class() returns case as declared in the file in PHP 5 * * @param object $object the object to get the classname for * * @return string the class name of the given object * @todo CS cleanup - rename function to PhpDocumentor_get_class */ function phpDocumentor_get_class($object)
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
* * @param int $event All events must be constants * * @return void */ function pushEvent($event) { $this-> num = array_push($this-> stack, $event) - 1; } /** * Pop an event from the stack * * @return int An event */ function popEvent() { $this-> num--; return array_pop($this-> stack); } /** * Get the current event * * @return int An event */ function getEvent() { return $this-> stack[$this-> } }
num];
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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 142 143 144 145 146 147
* type of the last parser Element handled * * This is used in handleDocBlock to determine whether a DocBlock is a * page-level DocBlock in conjunction with the {@link parserData::$clean} * var. A page-level DocBlock is alwaysthe first DocBlock in a file, and * must be followed by another DocBlock. The first test is handled by * parserData::$clean, which is set to false on the first encounter of an * element, and the second test is handled by this variable, which must be * equal to "docblock" * @see handleDocBlock() * @var string */ var $lasttype = ''; /** * Name of the class currently being parsed. * It is only used (and only valid) when phpDocumentor_IntermediateParser is * parsing a class * @var string */ var $cur_class = ''; /** * type of the current parser Element being handled * * This is used by {@link HandleEvent()} to set the {@link $lasttype} var, * which is used to detect page-level DocBlocks * @var string */ var $type = ''; /** * set in {@link Setup.inc.php} to the value of the parseprivate commandline * option. If this option is true, elements with an @access private tag * will be parsed and displayed * @tutorial phpDocumentor.howto.pkg#using.command-line.parseprivate * @var boolean */ var $parsePrivate = false; /** * this variable is used to prevent parsing of elements with an @ignore tag * @see $packageoutput * @see $parsePrivate */ var $private_class = false; /** * used to set the output directory * @see setTargetDir() */ var $targetDir; /** * used to set the template base directory * @see setTemplateBase() */ var $templateBase; /** * array of parsed package pages * * used by {@link Convert()} to convert all package pages into output * @var array */ var $package_pages = array(); /** * @var array array of all {@link parserData} containing page information */ var $pages = array(); /** * Put away a page that has been @ignored or @access private if * !{@link $parsePrivate} * * When a page has @access private in its DocBlock, it is placed here * instead of in {@link $pages}, to allow for proper Class parsing. Since * classes and pages are parsed as if they were separate, this array allows * public classes on private pages to retrieve information needed about the * page that holds the class and to {@link addPageIfNecessary()} to the
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
* $pages array * @var array */ var $privatepages = array(); /** * Keeps track of packages of classes that have parent classes in another * package. Used in automatic linking. * * This array is updated by {@link addPackageParent()}, which is called in * {@link Classes::processChild()} to keep track of classes that descend * from classes in different packages. In other words, if class foo is in * package one, and class bar is in package two, an entry * $package_parents['two'] = 'one' will be made. * @var array Format: packagename => parentpackagename * @see Converter::getLink() */ var $package_parents = array(); /** * Used to determine the category for tutorials. * * <b>WARNING:</b> If more than one category exists, the last category * encountered will overwrite the previous and will raise a big warning * @var array Format: packagename => categoryname */ var $packagecategories = array(); /** * list of all packages encountered while documenting. Used in automatic * linking. * * Converter::getLink() first checks if an ambiguous link is found in the * current package. If not, it then checks in parent packages, and if still * not found, uses this array to check in the rest of the packages before * giving up * @var array Format: array(packagename => 1, packagename => 1,...) * @see Converter::getLink() */ var $all_packages = array(); /** * array of packages to parser and output documentation for, if not all * packages should be documented * * Format:<br /> * array(package1,package2,...)<br /> * or false if not set * * Use this option to limit output similar to ignoring files. If you have * some temporary files that you don't want to specify by name but don't * want included in output, set a package name for all the elements in your * project, and set packageoutput to that name. the default package will be * ignored. Parsing speed does not improve. If you want to ignore files * for speed reasons, use the ignore command-line option * @tutorial phpDocumentor.howto.pkg#using.command-line.packageoutput * @see Io * @var false|array */ var $packageoutput = false; /** * the functions which handle output from the {@link Parser} * @see handleEvent(), handleDocBlock(), handlePage(), handleClass() * @see handleDefine(), handleFunction(), handleMethod(), handleVar() * @see handlePackagePage(), handleInclude(), handleTutorial() */ var $event_handlers = array( 'docblock' => 'handleDocBlock', 'page' => 'handlePage', 'class' => 'handleClass', 'define' => 'handleDefine', 'function' => 'handleFunction', 'method' => 'handleMethod', 'var' => 'handleVar', 'const' => 'handleConst', 'packagepage' => 'handlePackagePage', 'include' => 'handleInclude', 'global' => 'handleGlobal', 'tutorial' => 'handleTutorial', );
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
/** * $data contains parsed structures for the current page being parsed * * In version 1.1+, $data is only used to store the current page information. * All handling of documented elements is handled by the * {@link ProceduralPages} and {@link Classes} classes. * @var parserData */ var $data; /** * set in {@link Setup.inc.php} to the value of the quitemode commandline * option. * * If this option is true, informative output while parsing will not be * displayed (documentation is unaffected) * @var boolean * @tutorial phpDocumentor.howto.pkg#using.command-line.quiet */ var $quietMode = false; /** * set in {@link Setup.inc.php} to the value of the undocumentedElementWarnings commandline * option. * * If this option is true, warnings about certain elements (classes, methods) * that are not documented with DocBlocks will be shown while parsing, * and will also be displayed in the errors.html page * (other documentation is unaffected) * @var boolean * @tutorial phpDocumentor.howto.pkg#using.command-line.undocumentedelements */ var $undocumentedElementWarnings = false; /** * used to keep track of inheritance at the smartest level possible for a * dumb computer * @var Classes */ var $classes = false; /** * used to keep track of all elements in a procedural page. * conflicts with elegance * @since 1.1 * @var ProceduralPages */ var $proceduralpages = false; Handles name
/** * an array of template names indexed by converter name * * For example, if the default HTMLframesConverter is using the DOM/l0l33t * template, the array will be * <code>$converters['frames'] = 'DOM/l0l33t'</code> * @var array Format: array(Convertername1 => templatename) * @see Converter */ var $converters = false; /** * @var string Title of generated documentation, passed to Converters */ var $title = ''; var $uses = array(); var $db_template; /** * Stores parsed CHANGELOG/INSTALL/README files * @var array Format: array(CHANGELOG => contents, * INSTALL => contents, * README => contents) */ var $ric = array(); /** * Flag used to determine whether the last docblock * was a page-level docblock.
308 * @var boolean 309 * @access private 310 */ 311 var $_lastDocBlockWasPageLevel = false; 312 313 /** 314 * Flag used to determine whether the Page-level 315 * DocBlock was declared in old or new style 316 * @var boolean 317 * @access private 318 */ 319 var $_oldPageLevel = false; 320 321 /** 322 * sets up basic data structures 323 * @param string Title of generated documentation, passed to Converters 324 * @see $title, $data, $classes, $proceduralpages 325 */ 326 function phpDocumentor_IntermediateParser($title='Generated Documentation') 327 { 328 $this-> title = $title; 329 $this-> data = new parserData; 330 $this-> classes = new Classes; 331 $this-> proceduralpages = new ProceduralPages; 332 } 333 334 /** 335 * Retrieve the relative path. If the path contains "pear/" it will 336 * be used as the base, otherwise the Program_Root string will be used. 337 * @global array uses 'Program_Root' option to replace it with '' for 338 * retrieving the source location of a file 339 * @param string path to file 340 * @return string 341 * @see $sourceLocation 342 * @access private 343 */ 344 function _getSourceLocation($sl, $sourceloc) 345 { 346 global $_phpDocumentor_options; 347 if (empty($sl)) return false; 348 $sl = str_replace('\\','/',$sl); 349 if (strpos($sl,'pear/')) 350 { 351 $sl = substr($sl,strpos($sl,'pear/') + 5); 352 if (dirname($sl) == '.') 353 { 354 return 'PEAR'; 355 } 356 return dirname($sl); 357 } else 358 { 359 if (strpos(str_replace($_phpDocumentor_options['Program_Root'] . PATH_DELIMITER,'',$sourceloc),PATH_DELIMITER) === false) 360 return ''; 361 return dirname(str_replace($_phpDocumentor_options['Program_Root'] . PATH_DELIMITER,'',$sourceloc)); 362 } 363 } 364 365 /** 366 * Guess the package/subpackage based on subdirectory if the --pear option 367 * 368 * A file in pear/dir/file.php will be in package "dir." A file in 369 * pear/dir/subdir/file.php will be in package "dir," subpackage "subdir." 370 * @param string full path of file 371 * @param template-ready source location Program_Root/dir/file.php 372 * @global array uses the 'pear' option to determine whether to guess based 373 * on subdirectory 374 * @tutorial phpDocumentor.howto.pkg#using.command-line.pear 375 */ 376 function _guessPackage($path, $sourceloc) 377 { 378 global $_phpDocumentor_setting; 379 if ($_phpDocumentor_setting['pear']) 380 { 381 $subpath = explode(PATH_DELIMITER, $this-> _getSourceLocation($path, $sourceloc)); 382 if (!empty($subpath[0])) 383 { // can only have package and subpackage in this version 384 $package = $subpath[0];
385 $subpackage = ''; 386 if (isset($subpath[1])) $subpackage = $subpath[1]; 387 return array($package,$subpackage); 388 } else return array($this-> package, $this-> subpackage); 389 } else return array($this-> package, $this-> subpackage); 390 } 391 392 /** 393 * handles post-parsing of include/require/include_once/require_once 394 * 395 * This function sets {@link $data}->clean to false to tell the 396 * phpDocumentor_IntermediateParser that a page-level DocBlock can't be 397 * found after this point on this page. It then sets the package 398 * to be the same as the page, and adds itself to the 399 * {@link ProceduralPages} class 400 * @param integer $event Event number from {@link Parser.inc} 401 * @param parserInclude $data 402 */ 403 function handleInclude($event,$data) 404 { 405 if ($this-> _lastDocBlockWasPageLevel) 406 { 407 addWarning(PDERROR_DOCBLOCK_CONFLICT, $data-> getName(), $data-> getValue()); 408 if (!$this-> _oldPageLevel) 409 { 410 unset($this-> last); 411 } 412 } 413 $this-> _lastDocBlockWasPageLevel = false; 414 $this-> data-> clean = false; 415 // page was @ignored 416 if ($this-> private_page) 417 { 418 unset($this-> last); 419 return; 420 } 421 if (empty($this-> last)) 422 { 423 if (isset($this-> db_template)) 424 { 425 // use the docblock template 426 $this-> last = phpDocumentor_clone($this-> db_template); 427 } 428 else 429 { 430 // we don't have a docblock, create an empty one to get rid of errors 431 $this-> last = new parserDocblock(); 432 } 433 } 434 // $this->last->setLineNumber($data->getLineNumber()); 435 if ($this-> last-> getKeyword('ignore')) 436 { 437 $this-> last = false; 438 return; 439 // addWarning(PDERROR_IGNORE_TAG_IGNORED,'include',$data->getName().'('.$data>getValue().')'); 440 } 441 442 $this-> last-> overridePackage($this-> category,$this-> package,$this> subpackage,$data-> getName(),'include'); 443 $data-> setDocBlock($this-> last); 444 $this-> proceduralpages-> addInclude($data); 445 $this-> last = false; 446 } 447 448 /** 449 * handles post-parsing of global variables 450 * 451 * This function sets {@link $data}->clean to false to tell the 452 * phpDocumentor_IntermediateParser that a page-level DocBlock can't be 453 * found after this point on this page. It then sets the package 454 * to be the same as the page, and adds itself to the 455 * {@link ProceduralPages} class 456 * @param integer $event Event number from {@link Parser.inc} 457 * @param parserGlobal $data 458 */ 459 function handleGlobal($event,$data) 460 { 461 if ($this-> _lastDocBlockWasPageLevel) 462 {
463 addWarning(PDERROR_DOCBLOCK_CONFLICT, 'global variable', $data-> getName()); 464 if (!$this-> _oldPageLevel) 465 { 466 unset($this-> last); 467 } 468 } 469 $this-> _lastDocBlockWasPageLevel = false; 470 $this-> data-> clean = false; 471 if ($this-> private_page) 472 { 473 unset($this-> last); 474 return; 475 } 476 if (empty($this-> last)) 477 { 478 if (isset($this-> db_template)) 479 { 480 // use the docblock template 481 $this-> last = phpDocumentor_clone($this-> db_template); 482 } 483 else 484 { 485 // we don't have a docblock, create an empty one to get rid of errors 486 $this-> last = new parserDocblock(); 487 } 488 } 489 // $this->last->setLineNumber($data->getLineNumber()); 490 if ($this-> last-> getKeyword('ignore')) 491 { 492 addWarning(PDERROR_IGNORE_TAG_IGNORED,'global variable - just don\'t document the',$data-> getName()); 493 $this-> last = false; 494 return; 495 } 496 $this-> last-> overridePackage($this-> category,$this-> package,$this> subpackage,$data-> getName(),'global'); 497 $data-> setDocBlock($this-> last); 498 if ($data-> docblock-> getKeyword('name')) 499 { 500 $a = $data-> docblock-> getKeyword('name'); 501 if (is_object($a)) $a = $a-> value; 502 $data-> setName($a); 503 } 504 $this-> proceduralpages-> addGlobal($data); 505 $this-> last = false; 506 } 507 508 /** 509 * handles post-parsing of Package-level documentation pages. 510 * 511 * sets the {@link $package_pages}[$data->package] to $data 512 * @param integer $event Event number from {@link Parser.inc} 513 * @param parserPackagePage $data 514 */ 515 function handlePackagePage($event,$data) 516 { 517 $this-> package_pages[$data-> package] = & $data; 518 $this-> last = false; 519 } 520 521 /** 522 * handle post-parsing of Tutorials. 523 * 524 * This adds the parsed tutorial to the tutorial tree 525 * @uses $tutorials sets the value of tutorials to parameter $data 526 * @param integer $event Event Number 527 * @param parserTutorial $data 528 * @since 1.2 529 */ 530 function handleTutorial($event,$data) 531 { 532 if (isset($this-> packagecategories[$data-> package])) 533 { 534 $data-> category = $this-> packagecategories[$data-> package]; 535 } else 536 { 537 $data-> category = $GLOBALS['phpDocumentor_DefaultCategoryName']; 538 } 539 $this-> tutorials[$data-> package][$data-> subpackage][$data> tutorial_type][$data-> name] = $data;
540 } 541 542 /** 543 * handles post-parsing of class vars 544 * 545 * This function sets up a @var tag if none is found, and aligns $data's 546 * $path var and packages to match the parent object 547 * @param integer $event Event number from {@link Parser.inc} 548 * @param parserVar $data 549 */ 550 function handleVar($event,$data) 551 { 552 global $_phpDocumentor_setting; 553 if ($this-> private_class) 554 { 555 unset($this-> last); 556 return; 557 } 558 if (empty($this-> last)) 559 { 560 if (isset($this-> db_template)) 561 { 562 // use the docblock template 563 $this-> last = phpDocumentor_clone($this-> db_template); 564 } 565 else 566 { 567 // we don't have a docblock, create an empty one to get rid of errors 568 $this-> last = new parserDocblock(); 569 } 570 } 571 // $this->last->setLineNumber($data->getLineNumber()); 572 $this-> last-> overridePackage($this-> category,$this-> package,$this> subpackage,$data-> getName(),'var'); 573 $this-> last-> updateModifiers($data-> getModifiers()); 574 575 if ($this-> last-> getKeyword('ignore')) 576 { 577 $this-> last = false; 578 return; 579 // addWarning(PDERROR_IGNORE_TAG_IGNORED,'var',$this->cur_class.'::'.$data>getName()); 580 } 581 if (!$this-> last-> var) 582 { 583 $this-> last-> addVar('mixed',new parserStringWithInlineTags); 584 } 585 586 if ($_phpDocumentor_setting['pear']) 587 { 588 if (strpos($data-> getName(), '_') == 1 && ! $this-> last> getKeyword('access')) 589 { 590 addWarning(PDERROR_PRIVATE_ASSUMED,'class variable',$data-> class.'::'.$data> getName()); 591 $this-> last-> addKeyword('access','private'); 592 $data-> setDocBlock($this-> last); 593 } 594 } 595 $data-> setDocBlock($this-> last); 596 $data-> path = $this-> data-> parent-> path; 597 $this-> classes-> addVar($data); 598 $this-> last = false; 599 } 600 601 /** 602 * handles post-parsing of class constants 603 * 604 * This function aligns $data's 605 * $path var and packages to match the parent object 606 * @param integer $event Event number from {@link Parser.inc} 607 * @param parserVar $data 608 */ 609 function handleConst($event,$data) 610 { 611 global $_phpDocumentor_setting; 612 if ($this-> private_class) 613 { 614 unset($this-> last); 615 return;
616 } 617 if (empty($this-> last)) 618 { 619 if (isset($this-> db_template)) 620 { 621 // use the docblock template 622 $this-> last = phpDocumentor_clone($this-> db_template); 623 } 624 else 625 { 626 // we don't have a docblock, create an empty one to get rid of errors 627 $this-> last = new parserDocblock(); 628 } 629 } 630 // $this->last->setLineNumber($data->getLineNumber()); 631 $this-> last-> overridePackage($this-> category,$this-> package,$this> subpackage,$data-> getName(),'const'); 632 633 if ($this-> last-> getKeyword('ignore')) 634 { 635 $this-> last = false; 636 return; 637 // addWarning(PDERROR_IGNORE_TAG_IGNORED,'var',$this->cur_class.'::'.$data>getName()); 638 } 639 $data-> setDocBlock($this-> last); 640 $data-> path = $this-> data-> parent-> path; 641 $this-> classes-> addConst($data); 642 $this-> last = false; 643 } 644 645 /** 646 * handles post-parsing of class methods 647 * 648 * This function first aligns $data's path and package to match the parent 649 * object, and also aligns the docblock's @param, @global, and @staticvar 650 * tags with the information parsed from the method source code. It also 651 * checks to see if the method is a constructor and sets the $isConstructor 652 * flag. If source code has been parsed by a {@}source} tag, the source is 653 * added to its docblock 654 * 655 * Finally, it adds the method to the {@link Classes} class. 656 * @param integer $event Event number from {@link Parser.inc} 657 * @param parserMethod $data 658 */ 659 function handleMethod($event,$data) 660 { 661 global $_phpDocumentor_setting; 662 if ($this-> private_class) 663 { 664 unset($this-> last); 665 return; 666 } 667 668 if (empty($this-> last)) 669 { 670 if ($this-> undocumentedElementWarnings) 671 { 672 addWarning(PDERROR_UNDOCUMENTED_ELEMENT,'Method',$data-> getName(),'method'); 673 } 674 if (isset($this-> db_template)) 675 { 676 // use the docblock template 677 $this-> last = phpDocumentor_clone($this-> db_template); 678 } 679 else 680 { 681 // we don't have a docblock, create an empty one to get rid of errors 682 $this-> last = new parserDocblock(); 683 } 684 } 685 // $this->last->setLineNumber($data->getLineNumber()); 686 if ($this-> last-> getKeyword('ignore')) 687 { 688 $this-> last = false; 689 return; 690 // addWarning(PDERROR_IGNORE_TAG_IGNORED,'method',$this->cur_class.'::'.$data>getName()); 691 } 692 $this-> last-> overridePackage($this-> category,$this-> package,$this-
> subpackage,$data-> getName(),'method'); 693 if ($data-> hasSource()) 694 { 695 $this-> last-> setSource($data-> getSource(), $data-> getClass()); 696 } 697 foreach($data-> listParams() as $key => $param) 698 { 699 $update_params[$key] = $param; 700 } 701 foreach($data-> listGlobals() as $param) 702 { 703 $update_globals[] = $param[1]; 704 } 705 foreach($data-> listStatics() as $param) 706 { 707 $update_statics[] = $param[0]; 708 } 709 if (isset($update_params)) 710 $this-> last-> updateParams($update_params); 711 if (isset($update_globals)) 712 $this-> last-> updateGlobals($update_globals); 713 if (isset($update_statics)) 714 $this-> last-> updateStatics($update_statics); 715 $this-> last-> updateModifiers($data-> getModifiers()); 716 unset($update_params); 717 unset($update_globals); 718 unset($update_statics); 719 720 if ($data-> getName() == $this-> cur_class) $data-> setConstructor(); 721 if ($data-> getName() == '__construct') { 722 $data-> setConstructor(); 723 } 724 if ($data-> getName() == '__destruct') { 725 $data-> setDestructor(); 726 } 727 728 if ($_phpDocumentor_setting['pear']) 729 { 730 if (strpos($data-> getName(), '_') === 0 && substr($data-> getName(), 1) == $data-> class) 731 { // is destructor 732 $data-> setDestructor(); 733 } elseif (strpos($data-> getName(), '_') === 0 && ! $this-> last> getKeyword('access')) 734 { 735 if (strpos($data-> getName(), '__') !== 0) { 736 addWarning(PDERROR_PRIVATE_ASSUMED,'method',$data-> class.'::'.$data> getName().'()'); 737 $this-> last-> addKeyword('access','private'); 738 $data-> setDocBlock($this-> last); 739 } 740 } 741 } 742 $data-> setDocBlock($this-> last); 743 $data-> path = $this-> data-> parent-> path; 744 $this-> classes-> addMethod($data); 745 $this-> last = false; 746 } 747 748 /** 749 * handles post-parsing of functions 750 * 751 * This function sets {@link $data}->clean to false to tell the 752 * phpDocumentor_IntermediateParser that a page-level DocBlock can't be 753 * found after this point on this page. It then sets the package to be the 754 * same as the page, aligns the docblock's @param, @global, and @staticvar 755 * tags with the information parsed from the function source code. 756 * 757 * If source code has been parsed by a {@}source} tag, the source is added 758 * to its docblock, and then the parserFunction adds itself to the 759 * {@link ProceduralPages} class 760 * @param integer $event Event number from {@link Parser.inc} 761 * @param parserFunction $data 762 */ 763 function handleFunction($event,$data) 764 { 765 if ($this-> _lastDocBlockWasPageLevel) 766 { 767 addWarning(PDERROR_DOCBLOCK_CONFLICT, 'function', $data-> getName()); 768 if (!$this-> _oldPageLevel)
769 { 770 unset($this-> last); 771 } 772 } 773 $this-> _lastDocBlockWasPageLevel = false; 774 $this-> data-> clean = false; 775 if ($this-> private_page) 776 { 777 unset($this-> last); 778 return; 779 } 780 781 if (empty($this-> last)) 782 { 783 if (isset($this-> db_template)) 784 { 785 // use the docblock template 786 $this-> last = phpDocumentor_clone($this-> db_template); 787 } 788 else 789 { 790 // we don't have a docblock, create an empty one to get rid of errors 791 $this-> last = new parserDocblock(); 792 } 793 } 794 // $this->last->setLineNumber($data->getLineNumber()); 795 if ($this-> last-> getKeyword('ignore')) 796 { 797 unset($this-> last); 798 return; 799 } 800 $this-> last-> overridePackage($this-> category,$this-> package,$this> subpackage,$data-> getName(),'function'); 801 802 foreach($data-> listParams() as $key => $param) 803 { 804 $update_params[$key] = $param; 805 } 806 foreach($data-> listGlobals() as $param) 807 { 808 $update_globals[] = $param[1]; 809 } 810 foreach($data-> listStatics() as $param) 811 { 812 $update_statics[] = $param[0]; 813 } 814 if (isset($update_params)) 815 $this-> last-> updateParams($update_params); 816 if (isset($update_globals)) 817 $this-> last-> updateGlobals($update_globals); 818 if (isset($update_statics)) 819 $this-> last-> updateStatics($update_statics); 820 unset($update_params); 821 unset($update_globals); 822 unset($update_statics); 823 824 if ($data-> hasSource()) 825 { 826 $this-> last-> setSource($data-> getSource()); 827 } 828 if (count($this-> last-> params) == 1 && ! count($data-> listParams())) 829 { 830 // if the function has no parameters, and 1 @param, add it to the list as optional, default value is description from @param 831 $pars = $this-> last-> listParams(); 832 $data-> addParam($pars[0]['var'],$pars[0]['data']-> getString()); 833 } 834 $data-> setDocBlock($this-> last); 835 $this-> proceduralpages-> addFunction($data); 836 $this-> last = false; 837 } 838 839 /** 840 * handles post-parsing of defines 841 * 842 * This function sets {@link $data}->clean to false to tell the 843 * phpDocumentor_IntermediateParser that a page-level DocBlock can't be 844 * found after this point on this page. It then sets the package to be the 845 * same as the page and adds itself to the {@link ProceduralPages} class 846 * @param integer $event Event number from {@link Parser.inc}
847 * @param parserDefine $data 848 */ 849 function handleDefine($event,$data) 850 { 851 if ($this-> _lastDocBlockWasPageLevel) 852 { 853 addWarning(PDERROR_DOCBLOCK_CONFLICT, 'define', $data-> getName()); 854 if (!$this-> _oldPageLevel) 855 { 856 unset($this-> last); 857 } 858 } 859 $this-> _lastDocBlockWasPageLevel = false; 860 $this-> data-> clean = false; 861 if ($this-> private_page) 862 { 863 unset($this-> last); 864 return; 865 } 866 if (empty($this-> last)) 867 { 868 if (isset($this-> db_template)) 869 { 870 // use the docblock template 871 $this-> last = phpDocumentor_clone($this-> db_template); 872 } 873 else 874 { 875 // we don't have a docblock, create an empty one to get rid of errors 876 $this-> last = new parserDocblock(); 877 } 878 } 879 // $this->last->setLineNumber($data->getLineNumber()); 880 if ($this-> last-> getKeyword('ignore')) 881 { 882 unset($this-> last); 883 return; 884 } 885 886 $this-> last-> overridePackage($this-> category,$this-> package,$this> subpackage,$data-> getName(),'define'); 887 $data-> setDocBlock($this-> last); 888 $this-> proceduralpages-> addDefine($data); 889 $this-> last = false; 890 } 891 892 /** 893 * handles post-parsing of classes 894 * 895 * This function sets {@link $data}->clean to false to tell the 896 * phpDocumentor_IntermediateParser that a page-level DocBlock can't be 897 * found after this point on this page. It sets {@link $cur_class} to its 898 * name, and if an @ignore tag is found in the DocBlock, it sets 899 * {@link $private_class} to true, to prevent post-parsing of any of the 900 * class's vars or methods. Then it checks for the existence of a package 901 * page for the class's package 902 * @param integer $event Event number from {@link Parser.inc} 903 * @param parserClass $data 904 */ 905 function handleClass($event,$data) 906 { 907 global $_phpDocumentor_setting; 908 if ($data-> isInterface()) 909 { 910 $objectType = 'interface'; 911 } 912 else 913 { 914 $objectType = 'class'; 915 } 916 if ($this-> _lastDocBlockWasPageLevel) 917 { 918 if (!$this-> _oldPageLevel) 919 { 920 addWarning(PDERROR_DOCBLOCK_GOES_CLASS, $data-> getName()); 921 $doc = new parserDocBlock; 922 $doc-> category = $this-> category; 923 $doc-> package = $this-> package; 924 $doc-> subpackage = $this-> subpackage; 925 if ($_phpDocumentor_setting['sourcecode']) {
926 927 > 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 > > 955 > 956 957 958 959 960 > > 961 > 962 963 964 965 > 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 > 988 989 990 991 992 993 994 995 996
parent->
data-> source); } $this-> data-> setDocBlock($doc); unset($doc); if ($this-> last) { $this-> last-> cantSource(); } }
$doc-> $doc->
canSource(); addFileSource($this->
parent->
path, $this->
data-
} $this-> _lastDocBlockWasPageLevel = false; $this-> data-> clean = false; if (empty($this-> last)) { if ($this-> undocumentedElementWarnings) { addWarning(PDERROR_UNDOCUMENTED_ELEMENT,'Class',$data-> getName(),'Class'); } if (isset($this-> db_template)) { // use the docblock template $this-> last = phpDocumentor_clone($this-> db_template); } else { // we don't have a docblock, create an empty one to get rid of errors $this-> last = new parserDocblock(); } list($this-> last-> package, $this-> last-> subpackage) = $this_guessPackage($this-> data-> parent-> path, $this-> data-> parentgetSourceLocation('dummy')); addWarning(PDERROR_NO_PACKAGE_TAG,$objectType,$data-> getName(),$this-> lastpackage); } else { if (!$this-> last-> getExplicitPackage()) { list($this-> last-> package, $this-> last-> subpackage) = $this_guessPackage($this-> data-> parent-> path, $this-> data-> parentgetSourceLocation('dummy')); addWarning(PDERROR_NO_PACKAGE_TAG,$objectType,$data-> getName(),$thislast-> package); } else { if (isset($this-> packagecategories[$this-> package]) && $this-> packagecategories[$this-> package] != $thiscategory) addWarning(PDERROR_PACKAGECAT_SET,$this-> package, $this-> packagecategories[$this-> package], $this-> category); $this-> packagecategories[$this-> package] = $this-> category; } } $this-> last-> updateModifiers($data-> getModifiers()); // $this->last->setLineNumber($data->getLineNumber()); $data-> setDocBlock($this-> last); $this-> cur_class = $name = $data-> getName(); if ($this-> last-> getKeyword('ignore')) { $this-> private_class = true; unset($this-> last); return; } $data-> path = $this-> data-> parent-> path; $this-> classes-> addClass($data); $this-> private_class = false; if ($this-> last-> package) { $this-> parsePackagePage($this-> last-> package, $this-> data-> parentgetPath()); } $this-> last = false; } /** * handles post-parsing of procedural pages * * this event is called at the start of a new page, before the Parser knows * whether the page will contain any procedural pages or not
997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076
* @param integer $event Event number from {@link Parser.inc} * @param parserPage $data */ function handlePage($event,$data) { $type = 'page'; $this-> private_page = false; $this-> data = new parserData; $data-> category = $this-> category = $GLOBALS['phpDocumentor_DefaultCategoryName']; $this-> package = $GLOBALS['phpDocumentor_DefaultPackageName']; $this-> subpackage = ''; $this-> proceduralpages-> addPage($data); $this-> data-> setParent($data); $this-> pages[$data-> getPath()] = $this-> data; $this-> classes-> nextFile($data-> getPath()); $this-> packageoutput = $data-> getPackageOutput(); } /** * handles post-parsing of DocBlocks * * This function sets {@link $last} to the DocBlock represented by $data, to * allow the next documentable element passed to * phpDocumentor_IntermediateParser to link the DocBlock into its $docblock * property. This function also checks for two special cases of DocBlocks: * <ol> * <li>First DocBlock in the file contains a @package tag</li> * <li>First DocBlock in the file is immediately followed by another * DocBlock</li> * </ol> * In both cases, the function extracts this tag and uses it as the * page-level package. If the @package tag is in the DocBlock of an * element (function, global variable, whatever) that isn't a page-level * DocBlock, a warning will be raised to notify the author that a @package * tag belongs in a page-level DocBlock. * * <b>New</b> in version 1.2.2, if the first DocBlock in a file contains * a @package tag, it is a page-level DocBlock. * * If the DocBlock is page-level, it is processed with * {@link _processPageLevelDocBlock} * * Finally, the function replaces the old parserPage in * {@link parserData::$data}->parent with the new one containing information * from the DocBlock by calling {@link addPage()}, and checks for * package-level docs. * @param integer $event Event number from {@link Parser.inc} * @param parserDocBlock $data */ function handleDocBlock($event,$data) { $type = 'docblock'; $data-> postProcess(); // Zend desc support if ($tdesc = $data-> getKeyword('desc')) { $data-> setShortDesc($tdesc); unset($data-> tags['desc']); } $this-> _lastDocBlockWasPageLevel = false; // 1st docblock in file, check for @package if ($this-> data-> isClean() && !isset( $this-> last)) { if ($data-> getExplicitPackage()) { // new with 1.2.2: // if the first docblock in a file // contains a @package tag, then it is // a page-level docblock $this-> _processPageLevelDocBlock($data); $this-> _lastDocBlockWasPageLevel = true; $this-> all_packages[$data-> package] = 1; $this-> last = $data; return; } $doc = new parserDocBlock; $doc-> category = $this-> category; $doc-> package = $this-> package; $doc-> subpackage = $this-> subpackage; $this-> data-> setDocBlock($doc);
1077 $this-> proceduralpages-> addPagePackage($this-> data-> parent> getPath(),$this-> package,$this-> subpackage); 1078 unset($doc); 1079 } 1080 // 2nd docblock in a row, and it's at the top of the file, page-level docblock 1081 if ($this-> lasttype == "docblock" && $this-> data-> isClean()) 1082 { 1083 $this-> _processPageLevelDocBlock($this-> last); 1084 $this-> _oldPageLevel = true; 1085 $this-> _lastDocBlockWasPageLevel = false; 1086 } 1087 $this-> all_packages[$data-> package] = 1; 1088 $this-> last = $data; 1089 } 1090 1091 /** 1092 * Process a Page-level DocBlock 1093 * 1094 * First, it checks for an @ignore tag, 1095 * and if found, calls {@link ProceduralPages::ignorePage()}. An @ignore 1096 * tag in a page-level DocBlock will ignore all functions, defines, global 1097 * variables, and includes. It will not ignore classes! The function next 1098 * checks for an @access private, and if --parseprivate is off, performs the 1099 * same actions as @ignore. 1100 * Next, it checks for the @name tag, which is used to rename the page. 1101 * This is also a PEAR compatibility issue, and may not be very useful in 1102 * the long run. Documentation is best when it refers to real entities in 1103 * the package, and not to aliases. 1104 * @access private 1105 */ 1106 function _processPageLevelDocBlock($data) 1107 { 1108 global $_phpDocumentor_setting; 1109 // can only have 1 package-level docblock, others are ignored 1110 if (!$this-> data-> isClean()) 1111 { 1112 return; 1113 } 1114 $this-> data-> clean = false; 1115 $this-> data-> explicitDocBlock(); 1116 $data-> canSource(); 1117 if ($_phpDocumentor_setting['sourcecode']) 1118 { 1119 $data-> addFileSource($this-> data-> parent-> path, $this-> data> parent-> source); 1120 } 1121 if (!$data-> getExplicitPackage()) 1122 { 1123 list($data-> package,$data-> subpackage) = $this-> _guessPackage($this> data-> parent-> getPath(), $this-> data-> parent-> getSourceLocation('dummy')); 1124 addWarning(PDERROR_NO_PACKAGE_TAG,'file',$this-> data-> parent> getPath(),$this-> last-> package); 1125 } 1126 if (isset($this-> packagecategories[$this-> package]) 1127 && $this-> packagecategories[$this-> package] != $data-> category) 1128 addWarning(PDERROR_PACKAGECAT_SET,$this-> package, 1129 $this-> packagecategories[$this-> package], 1130 $data-> category); 1131 $this-> packagecategories[$this-> package] = $data-> category; 1132 $this-> category = $this-> data-> parent-> category = $data-> category; 1133 $this-> packagecategories[$this-> package] = $this-> category; 1134 $this-> subpackage = $this-> data-> parent-> subpackage = $data-> subpackage; 1135 $this-> data-> setDocBlock($data); 1136 if ($data-> getKeyword('ignore')) 1137 { 1138 $this-> proceduralpages-> ignorePage($this-> data-> parent); 1139 $this-> private_page = true; 1140 unset($this-> last); 1141 $this-> privatepages[$this-> data-> parent-> getPath()] = $this-> data; 1142 unset($this-> pages[$this-> data-> parent-> getPath()]); 1143 return; 1144 } 1145 $this-> package = $this-> data-> parent-> package = $data-> package; 1146 $this-> subpackage = $this-> data-> parent-> subpackage = $data-> subpackage; 1147 $this-> proceduralpages-> addPagePackage($this-> data-> parent> getPath(),$this-> package,$this-> subpackage); 1148 if ($access = $data-> getKeyword('access')) 1149 { 1150 if (is_object($access) && ( $access-> getString() == 'private') && (!$this-> parsePrivate))
1151 { 1152 $this-> proceduralpages-> ignorePage($this-> data-> parent); 1153 $this-> private_page = true; 1154 unset($this-> last); 1155 $this-> privatepages[$this-> data-> parent-> getPath()] = $this> data; 1156 unset($this-> pages[$this-> data-> parent-> getPath()]); 1157 return; 1158 } 1159 } 1160 if ($data-> getKeyword('name')) 1161 { 1162 $a = $data-> getKeyword('name'); 1163 if (is_object($a)) $a = $a-> value; 1164 $this-> data-> parent-> setFile($a); 1165 $this-> proceduralpages-> setName($a); 1166 } 1167 $this-> addPage($this-> data-> parent, $this-> data-> parent-> getPath()); 1168 if ($this-> package) 1169 { 1170 $this-> parsePackagePage($this-> package, $this-> data-> parent> getPath()); 1171 } 1172 } 1173 1174 /** 1175 * Backward-compatibility only, use the new tutorials for more power 1176 * @tutorial tutorials.pkg 1177 * @param string package name of package file to parse 1178 * @param string directory of file that contains package name 1179 */ 1180 function parsePackagePage($package, $path) 1181 { 1182 if (!isset($this-> package_pages[$package])) 1183 { 1184 if (file_exists(dirname($path) . SMART_PATH_DELIMITER . $package . '.html')) 1185 { 1186 if ($this-> quietMode === false) 1187 { 1188 phpDocumentor_out("Reading package-level file " .$package . '.html'); 1189 flush(); 1190 } 1191 $fp = fopen(dirname($path) . SMART_PATH_DELIMITER . $package . '.html',"r" ); 1192 $ret = fread($fp,filesize(dirname($path) . SMART_PATH_DELIMITER . $package . '.html')); 1193 fclose($fp); 1194 unset($fp); 1195 if ($this-> quietMode === false) 1196 { 1197 phpDocumentor_out(" -- Parsing File\n" ); 1198 flush(); 1199 } 1200 $pageParser = new ppageParser; 1201 $tempp = $this-> package; 1202 $lp = $this-> last; 1203 $pageParser-> subscribe('*',$this); 1204 $pageParser-> parse($ret,false,$package); 1205 $this-> package = $tempp; 1206 $this-> last = $lp; 1207 unset($tempp); 1208 unset($pageParser); 1209 } 1210 } 1211 } 1212 1213 /** 1214 * called via {@link Parser::parse()} and Parser's inherited method 1215 * {@link Publisher::publishEvent()} 1216 * 1217 * $event is one of the PHPDOC constants from Parser.inc. If it is not 1218 * PHPDOCUMENTOR_EVENT_NEWSTATE, then a function name is retrieved from the 1219 * {@link $event_handlers} array and called to handle the $data 1220 * @param integer $event event number from {@link Parser.inc} 1221 * @param mixed $data if $event is {@link PHPDOCUMENTOR_EVENT_NEWSTATE}, $data is a {@link PHP_DOC_EVENT_END_PAGE} or {@link STATE_END_CLASS}, 1222 * otherwise $data is either a {@link parserDocBlock}, {@link parserPage} or descendant of {@link parserElement} 1223 * @global array we use 'sourcecode' to determine whether to highlight the source
1224 * of the current file if it has no file-level docblock 1225 */ 1226 function HandleEvent($event,$data) 1227 { 1228 global $_phpDocumentor_setting; 1229 global $phpDocumentor_DefaultPackageName, $phpDocumentor_DefaultCategoryName; 1230 if (empty($this-> packagecategories)) 1231 $this-> packagecategories[$phpDocumentor_DefaultPackageName] = $phpDocumentor_DefaultCategoryName; 1232 if ($event == PHPDOCUMENTOR_EVENT_NEWSTATE) 1233 { 1234 if ($data == STATE_END_CLASS) 1235 { 1236 } elseif ($data == PHPDOCUMENTOR_EVENT_END_PAGE) 1237 { 1238 if (!$this-> private_page) 1239 { 1240 $this-> all_packages[$this-> package] = 1; 1241 if (!$this-> data-> hasExplicitDocBlock()) 1242 { 1243 $doc = $this-> data-> docblock; 1244 if (!$this-> data-> docblock) 1245 { 1246 $doc = new parserDocBlock; 1247 } 1248 if ($_phpDocumentor_setting['sourcecode']) 1249 { 1250 $doc-> canSource(); 1251 $doc-> addFileSource($this-> data-> parent-> path, $this> data-> parent-> source); 1252 } 1253 list($doc-> package,$doc-> subpackage) = $this> _guessPackage($this-> data-> parent-> getPath(), $this-> data-> parent> getSourceLocation('dummy')); 1254 addWarning(PDERROR_NO_PAGE_LEVELDOCBLOCK,$this-> data-> parent> getPath()); 1255 $this-> data-> setDocBlock($doc); 1256 $this-> proceduralpages-> addPage($this-> data-> parent,$doc> package,$doc-> subpackage); 1257 } 1258 $this-> pages[$this-> data-> parent-> getPath()] = $this-> data; 1259 } 1260 $this-> private_page = false; 1261 $this-> private_class = false; 1262 if (isset($this-> db_template)) 1263 { 1264 addWarning(PDERROR_DB_TEMPLATE_UNTERMINATED); 1265 } 1266 unset($this-> db_template); 1267 unset($this-> last); 1268 } elseif ($data == PHPDOCUMENTOR_EVENT_END_DOCBLOCK_TEMPLATE) 1269 { 1270 unset($this-> db_template); 1271 } 1272 //echo $this->state_lookup[$data] . "\n"; 1273 //echo $data."\n"; 1274 } 1275 else 1276 { 1277 if ($event == PHPDOCUMENTOR_EVENT_README_INSTALL_CHANGELOG) 1278 { 1279 $this-> ric[$data[0]] = $data[1]; 1280 return; 1281 } 1282 if ($event == PHPDOCUMENTOR_EVENT_DOCBLOCK_TEMPLATE) 1283 { 1284 $data-> postProcess(); 1285 $this-> db_template = $data; 1286 $this-> _lastDocBlockWasPageLevel = false; 1287 // 2nd docblock in a row, and it's at the top of the file, page-level docblock 1288 if ($this-> type == "docblock" && $this-> data> isClean()) 1289 { 1290 // can only have 1 package-level docblock, others are ignored 1291 $this-> data-> clean = false; 1292 if ($this-> last-> getKeyword('ignore')) 1293 { 1294 $this-> proceduralpages-> ignorePage($this-> data-> parent); 1295 $this-> private_page = true; 1296 unset($this-> last);
1297 $this-> privatepages[$this-> data-> parent-> getPath()] = $this> data; 1298 unset($this-> pages[$this-> data-> parent-> getPath()]); 1299 return; 1300 } 1301 $this-> data-> setDocBlock($this-> last); 1302 $this-> package = $this-> data-> parent-> package = $this-> last> package; 1303 $this-> subpackage = $this-> data-> parent-> subpackage = $this> last-> subpackage; 1304 $this-> proceduralpages-> addPagePackage($this-> data-> parent> getPath(),$this-> package,$this-> subpackage); 1305 if ($access = $this-> last-> getKeyword('access')) 1306 { 1307 if (is_object($access) && ( $access-> getString() == 'private') && (! $this-> parsePrivate)) 1308 { 1309 addWarning(PDERROR_PARSEPRIVATE, $this-> data-> parent> getPath()); 1310 $this-> proceduralpages-> ignorePage($this-> data-> parent); 1311 $this-> private_page = true; 1312 unset($this-> last); 1313 $this-> privatepages[$this-> data-> parent-> getPath()] = $this-> data; 1314 unset($this-> pages[$this-> data-> parent-> getPath()]); 1315 return; 1316 } 1317 } 1318 if ($this-> last-> getKeyword('name')) 1319 { 1320 $a = $this-> last-> getKeyword('name'); 1321 if (is_object($a)) $a = $a-> value; 1322 $this-> data-> parent-> setFile($a); 1323 $this-> proceduralpages-> setName($a); 1324 } 1325 $this-> addPage($this-> data-> parent, $this-> data-> parent> getPath()); 1326 if ($this-> package) 1327 { 1328 $this-> parsePackagePage($this-> package, $this-> data-> parent> getPath()); 1329 } 1330 } 1331 unset($this-> last); 1332 } else 1333 { 1334 $this-> lasttype = $this-> type; 1335 $type = $data-> getType(); 1336 // fancy_debug($type,$data); 1337 if (($type != 'page') && ( $type != 'docblock') && ( $type != 'packagepage') && ( $type != 'tutorial')) 1338 { 1339 $data-> setFile($this-> data-> parent-> getFile()); 1340 } 1341 $this-> type = $type; 1342 //echo $type . "\n"; 1343 1344 if (isset($this-> event_handlers[$type])) 1345 { 1346 $handle = $this-> event_handlers[$type]; 1347 $this-> $handle($event,$data); 1348 } 1349 } 1350 } 1351 } 1352 1353 /** 1354 * Replaces the {@link parserPage} represented by $this->pages[$path] with 1355 * $page 1356 * 1357 * Called by {@link addPageIfNecessary(), handleDocBlock()} and 1358 * {@link ProceduralPages::setupPages()}, this method first checks to see if 1359 * the page has been added. If not, it assumes that the page has either 1360 * been @ignored or set with @access private with --parseprivate off, and 1361 * returns {@link addPrivatePage()}. Otherwise, it sets the pages[$path] to 1362 * be the parserPage $page and sets the package and subpackage to that of 1363 * $page 1364 * @see $pages 1365 * @param parserPage 1366 * @param string full path to the file
1367 */ 1368 function addPage($page, $path) 1369 { 1370 if (!isset($this-> pages[$path])) return $this-> addPrivatePage($page, $path); 1371 $this-> pages[$path]-> setParent($page); 1372 if ($page-> package != $GLOBALS['phpDocumentor_DefaultPackageName']) 1373 { 1374 if (!$this-> pages[$path]-> docblock) 1375 { 1376 $docblock = new parserDocBlock; 1377 $docblock-> package = $page-> package; 1378 $docblock-> subpackage = $page-> subpackage; 1379 $this-> pages[$path]-> docblock = $docblock; 1380 } else 1381 { 1382 $this-> pages[$path]-> docblock-> package = $page-> package; 1383 $this-> pages[$path]-> docblock-> subpackage = $page-> subpackage; 1384 } 1385 } 1386 } 1387 1388 /** 1389 * add a new {@link parserPage} to the $pages array if none is found 1390 * 1391 * This method is used when a page has been @ignored or marked with @access 1392 * private, and a public class is in the page (a class with no @access 1393 * private in its DocBlock). The method first creates a new page in the 1394 * {@link $pages} array and then copies path information, and calls 1395 * {@link addPage()} to set up packages 1396 * @param string full path of page 1397 */ 1398 function addPageIfNecessary($path, & $class) 1399 { 1400 global $_phpDocumentor_setting; 1401 if (!$this-> parsePrivate) 1402 { 1403 if (!isset($this-> pages[$path])) 1404 { 1405 $this-> pages[$path] = new parserData; 1406 $this-> pages[$path]-> docblock = new parserDocBlock; 1407 $this-> pages[$path]-> docblock-> package = $this-> privatepages[$path]> docblock-> package; 1408 $this-> pages[$path]-> docblock-> subpackage = $this> privatepages[$path]-> docblock-> subpackage; 1409 $par = $this-> privatepages[$path]-> parent; 1410 $this-> pages[$path]-> setParent($par); 1411 $this-> proceduralpages-> addPage($par); 1412 } 1413 } 1414 if (!empty($_phpDocumentor_setting['packageoutput'])) 1415 $packages = explode(',',$_phpDocumentor_setting['packageoutput']); 1416 if (!empty($_phpDocumentor_setting['packageoutput']) && 1417 $this-> pages[$path]-> parent-> package != $class-> docblock-> package && 1418 !in_array($this-> pages[$path]-> parent-> package,$packages)) 1419 { 1420 $this-> pages[$path]-> parent-> package = $class-> docblock-> package; 1421 $this-> addPage($this-> pages[$path]-> parent, $path); 1422 $this-> proceduralpages-> addPage($this-> pages[$path]-> parent); 1423 } 1424 } 1425 1426 /** 1427 * Adds a {@link parserPage} element to the {@link parserData} element in 1428 * $this->privatepages[$path] 1429 * 1430 * Performs a similar function to addPage, but adds to the 1431 * {@link $privatePages} array 1432 * @param parserPage $page 1433 * @param string $path full path to the page 1434 * @see addPage() 1435 */ 1436 function addPrivatePage($page, $path) 1437 { 1438 /* 1439 * if privatepages is still empty, 1440 * we need to initialize it with an empty 1441 * path=>ParserData element, so that it has 1442 * a top-level element... otherwise the setParent() call 1443 * below will crap out.
1444 */ 1445 if (count($this-> privatepages) == 0) { 1446 $this-> privatepages[$path] = new ParserData(); 1447 } 1448 $this-> privatepages[$path]-> setParent($page); 1449 if (isset($page-> package) && $page-> package != $GLOBALS['phpDocumentor_DefaultPackageName']) 1450 { 1451 if (!$this-> privatepages[$path]-> docblock) 1452 { 1453 $docblock = new parserDocBlock; 1454 $docblock-> package = $page-> package; 1455 $docblock-> subpackage = $page-> subpackage; 1456 $this-> privatepages[$path]-> docblock = $docblock; 1457 } else 1458 { 1459 $this-> privatepages[$path]-> docblock-> package = $page-> package; 1460 $this-> privatepages[$path]-> docblock-> subpackage = $page> subpackage; 1461 } 1462 } 1463 } 1464 1465 /** 1466 * adds a processed descendant of {@link parserElement} to the {@link $pages} 1467 * array or {@link $privatepages} array 1468 * 1469 * This function expects the page to exist in either $pages or $privatepages. It calls the 1470 * {@link parserData::addElement()} method to add $element to the page. 1471 * @param parserElement $element this will actually be a descendant of parserElement 1472 * @param string $path 1473 */ 1474 function addElementToPage($element, $path) 1475 { 1476 if (isset($this-> privatepages[$path])) 1477 { 1478 if (isset($this-> pages[$path])) 1479 { 1480 if ($element-> type == 'class' || $element-> type == 'method' 1481 || $element-> type == 'var' || $element-> type == 'const') 1482 { 1483 $this-> pages[$path]-> addElement($element); 1484 } else 1485 $this-> privatepages[$path]-> addElement($element); 1486 } else 1487 $this-> privatepages[$path]-> addElement($element); 1488 } else 1489 { 1490 if (isset($this-> pages[$path])) 1491 { 1492 $this-> pages[$path]-> addElement($element); 1493 } 1494 } 1495 } 1496 1497 /** 1498 * Add all the @uses tags from $element to the $uses array so that @usedby 1499 * virtual tags can be added 1500 * @uses parserUsesTag::getSeeElement() used to initialize {@link $uses} 1501 * @uses parserUsesTag::getDescription() used to initialize {@link $uses} 1502 * @param parserElement descendant of parserElement 1503 * @param string full path to the file 1504 */ 1505 function addUses($element, $path) 1506 { 1507 if (isset($element-> type) && $element-> type == 'page') 1508 { 1509 $element = $this-> pages[$element-> path]; 1510 } 1511 if (!$this-> parsePrivate && isset( $element-> docblock-> hasaccess) && $element-> docblock-> hasaccess) 1512 { 1513 $a = $element-> docblock-> getKeyword('access'); 1514 if (is_object($a) && $a-> getString() == 'private') return; 1515 } 1516 if (isset($this-> privatepages[$path])) 1517 { 1518 if (isset($this-> pages[$path])) 1519 { 1520 $uses = $element-> docblock-> getKeyword('uses');
1521 if ($uses) 1522 { 1523 if (!is_array($uses)) $uses = array($uses); 1524 foreach($uses as $use) 1525 { 1526 if (!is_object($use)) continue; 1527 $el = $use-> getSeeElement(); 1528 $description = $use-> getDescription(); 1529 $this-> uses[$el][] = array($element, $description); 1530 } 1531 } 1532 } 1533 } else 1534 { 1535 if (isset($this-> pages[$path])) 1536 { 1537 $uses = $element-> docblock-> getKeyword('uses'); 1538 if ($uses) 1539 { 1540 if (!is_array($uses)) $uses = array($uses); 1541 foreach($uses as $use) 1542 { 1543 if (!is_object($use)) continue; 1544 $el = $use-> getSeeElement(); 1545 $description = $use-> getDescription(); 1546 $this-> uses[$el][] = array($element, $description); 1547 } 1548 } 1549 } 1550 } 1551 } 1552 1553 /** 1554 * Add a {@link parserUsedByTag} link to every element referred to by @uses 1555 * @param Converter temporary converter used to retrieve abstract links 1556 * @uses phpDocumentor_IntermediateParser::addUses() indirectly, as 1557 * addUses() sets up $uses, which is iterated over here 1558 * @uses $pages sets up all @usedby tags from here 1559 * @access private 1560 */ 1561 function _setupUsesList(& $converter) 1562 { 1563 ob_start(); 1564 $converter-> _createPkgElements($this-> pages); 1565 ob_end_clean(); 1566 ksort($this-> uses); 1567 foreach($this-> uses as $link => $elements) 1568 { 1569 foreach($elements as $element) 1570 { 1571 if ($element[0]-> type == 'method' || $element[0]-> type == 'var' || 1572 $element[0]-> type == 'const') 1573 { 1574 $converter-> class = $element[0]-> getClass(); 1575 } 1576 if ($element[0]-> type == 'class') 1577 { 1578 $converter-> class = $element[0]-> getName(); 1579 } 1580 $reallink = $converter-> getLink($link,$element[0]-> docblock-> package); 1581 if (is_object($reallink)) 1582 { 1583 // add a used by tag to the docblock of the destination 1584 switch(phpDocumentor_get_class($reallink)) 1585 { 1586 case 'pagelink' : 1587 $this-> pages[$reallink-> path]-> docblock-> addUsedBy( 1588 $element[0]-> getLink($converter, false, true), 1589 $element[1]); 1590 break; 1591 case 'functionlink' : 1592 case 'definelink' : 1593 case 'globallink' : 1594 if (isset($this-> pages[$reallink-> path])) 1595 { 1596 for ($i=0; 1597 $i< count($this-> pages[$reallink-> path]-> elements); 1598 $i++) { 1599 if ($this-> pages[$reallink-> path]-> elements[$i]> type ==
1600 str_replace('link', '', 1601 phpDocumentor_get_class($reallink)) && 1602 $this-> pages[$reallink-> path]-> 1603 elements[$i]-> getName() 1604 == $reallink-> name) { 1605 $this-> pages[$reallink-> path]-> elements[$i]-> 1606 docblock-> addUsedBy( 1607 $element[0]-> getLink($converter,false,true), 1608 $element[1]); 1609 // debug('added @usedby to '.str_replace('link','',phpDocumentor_get_class($reallink)).' '.$reallink->name); 1610 } 1611 } 1612 } 1613 break; 1614 case 'classlink' : 1615 case 'methodlink' : 1616 case 'varlink' : 1617 case 'constlink' : 1618 if (isset($this-> pages[$reallink-> path])) 1619 { 1620 for ($i=0;$i< count($this-> pages[$reallink-> path]> classelements);$i++) 1621 { 1622 if ($this-> pages[$reallink-> path]-> classelements[$i]> type == 1623 str_replace('link','',phpDocumentor_get_class($reallink)) && 1624 $this-> pages[$reallink-> path]-> classelements[$i]> getName() == $reallink-> name && 1625 (!isset($reallink-> class) || 1626 $this-> pages[$reallink-> path]-> classelements[$i]> getClass() == $reallink-> class)) 1627 { 1628 $this-> pages[$reallink-> path]-> classelements[$i]> docblock-> addUsedBy($element[0]-> getLink($converter,false,true), $element[1]); 1629 // debug('added @usedby to '.str_replace('link','',phpDocumentor_get_class($reallink)).' '.$reallink->name); 1630 } 1631 } 1632 } 1633 break; 1634 } 1635 } 1636 } 1637 } 1638 } 1639 1640 /** 1641 * Interface to the Converter 1642 * 1643 * This function simply passes {@link $pages} and {@link package_pages} to 1644 * the walk() method, and then calls the Output() method. Note that 1645 * Output() is not required to do anything, and in fact doesn't in 1646 * HTMLframesConverter. 1647 * @uses Converter::walk() passes {@link $pages} and {@link $package_pages} 1648 * @uses Converter::Output() 1649 */ 1650 function Convert($title, $converter) 1651 { 1652 $converter-> walk($this-> pages, $this-> package_pages); 1653 $converter-> Output($title); 1654 $converter-> cleanup(); 1655 } 1656 1657 /** 1658 * Clean up classes 1659 * 1660 * {@source } 1661 * @access private 1662 * @uses Classes::Inherit() passes $this 1663 */ 1664 function fixClasses() 1665 { 1666 $this-> classes-> Inherit($this); 1667 } 1668 1669 /** 1670 * Clean up Procedural Pages 1671 * {@source }
1672 * @access private 1673 * @uses ProceduralPages::setupPages() passes $this 1674 */ 1675 function fixProcPages() 1676 { 1677 $this-> proceduralpages-> setupPages($this); 1678 } 1679 1680 /** 1681 * If the parent class of $class is in a different package, adds it to the 1682 * {@link $package_parents} array 1683 * @param parserClass &$class 1684 */ 1685 function addPackageParent(& $class) 1686 { 1687 if (!is_array($class-> parent)) return; 1688 $par = $this-> classes-> getClass($class-> parent[1], $class-> parent[0]); 1689 if ($class-> docblock-> package == $par-> docblock-> package) return; 1690 $this-> package_parents[$class-> docblock-> package] = $par-> docblock> package; 1691 if (!isset($this-> package_parents[$par-> docblock-> package]) || !$this> package_parents[$par-> docblock-> package]) $this-> package_parents[$par-> docblock> package] = false; 1692 } 1693 1694 /** 1695 * Add a converter name to use to the list of converters 1696 * 1697 * Sets up the {@link $converters} array. 1698 * {@internal 1699 * First, the Converter's file is included, and then, if successful, 1700 * the converter classname is tested for existance. If all is good, 1701 * then the templates are added to the list of converters/templates to use}}} 1702 * @param string $output output format (HTML, PDF, XML). Must be all caps 1703 * @param string $name Converter name (frames, for example, is the name of 1704 * HTMLframesConverter) 1705 * @param string $template template to use, should be a relative path to the 1706 * templates dir (like DOM/default) 1707 */ 1708 function addConverter($output,$name,$template) 1709 { 1710 if ($this-> templateBase) { 1711 $templateBase = str_replace('\\','/', $this-> templateBase) . '/Converters'; 1712 } else { 1713 if ('@PEAR-DIR@' != '@'.'PEAR-DIR@') { 1714 $templateBase = 'PhpDocumentor/phpDocumentor/Converters'; 1715 } else { 1716 $templateBase = str_replace('\\','/',$GLOBALS['_phpDocumentor_install_dir']) . '/phpDocumentor/Converters'; 1717 } 1718 } 1719 if (strpos($name,PATH_DELIMITER)) 1720 { 1721 // include the parent template 1722 $parent = explode(PATH_DELIMITER,$name); 1723 $parent = $parent[0]; 1724 if (!class_exists($output . $parent . 'Converter')) { 1725 $filename = $templateBase . '/' . $output . '/' . $parent . '/' . $output 1726 . $parent . 'Converter.inc'; 1727 if (Io::isIncludeable($filename)) 1728 { 1729 include_once($filename); 1730 } 1731 } 1732 if (!class_exists($output . $parent . 'Converter')) 1733 { 1734 addError(PDERROR_CONVERTER_NOT_FOUND,"parent Converter " .$output . $parent . "Converter of child Converter " .$output . str_replace(PATH_DELIMITER,'',$name) . "Converter" ); 1735 } 1736 } 1737 $filename = $templateBase . 1738 PATH_DELIMITER . $output . PATH_DELIMITER . $name . PATH_DELIMITER . $output . 1739 str_replace(PATH_DELIMITER, '', $name) . "Converter" . ".inc" ; 1740 if (Io::isIncludeable($filename)) 1741 { 1742 include_once($filename); 1743 } 1744 if (class_exists($output . str_replace(PATH_DELIMITER,'',$name) . 'Converter')) 1745 {
1746 $this-> converters[$output][$output . str_replace(PATH_DELIMITER,'',$name) . "Converter" ][] = $template; 1747 } else 1748 { 1749 addError(PDERROR_CONVERTER_NOT_FOUND,$output . str_replace(PATH_DELIMITER,'',$name) . "Converter" ); 1750 } 1751 } 1752 1753 /** 1754 * does a natural case sort on two {@link parserElement} descendants 1755 * 1756 * @param mixed $a 1757 * @param mixed $b 1758 * @return int 1759 * @see generateElementIndex() 1760 */ 1761 function elementCmp ($a, $b) 1762 { 1763 return strnatcasecmp($a-> getName(), $b-> getName()); 1764 } 1765 1766 /** 1767 * does a natural case sort on two class elements (either 1768 * {@link parserClass, parserMethod} or {@link parserVar} 1769 * 1770 * @param mixed $a 1771 * @param mixed $b 1772 * @return int 1773 * @see generateElementIndex() 1774 */ 1775 function ClasselementCmp ($a, $b) 1776 { 1777 if (phpDocumentor_get_class($a) == 'parserclass') $atest = $a-> name; else $atest = $a-> class; 1778 if (phpDocumentor_get_class($b) == 'parserclass') $btest = $b-> name; else $btest = $b-> class; 1779 1780 if(($c = strnatcasecmp($atest, $btest)) != 0) return $c; 1781 if (phpDocumentor_get_class($a) != 'parserclass') $atest .= $a-> name; 1782 if (phpDocumentor_get_class($b) != 'parserclass') $btest .= $b-> name; 1783 if (phpDocumentor_get_class($a) == 'parsermethod' && phpDocumentor_get_class($b) == 'parsermethod') 1784 { 1785 if ($a-> isConstructor) return -1; 1786 if ($b-> isConstructor) return 1; 1787 if ($a-> isDestructor) return -1; 1788 if ($b-> isDestructor) return 1; 1789 } 1790 return strnatcasecmp($atest,$btest); 1791 } 1792 1793 /** 1794 * call this method once parsing has completed. 1795 * 1796 * This method calls the private methods fixClasses and fixProcPages, both 1797 * of which adjust inheritance and package information based on complicated 1798 * post-parsing rules described in {@link ProceduralPages::setupPages()} 1799 * and {@link Classes::Inherit()}. Then, it sorts elements of the $pages 1800 * array and calls Convert for each Converter in the $converters array 1801 * @see $converters 1802 * @see $pages 1803 * @see Convert() 1804 */ 1805 function Output ($title = "Generated Documentation" ) 1806 { 1807 $GLOBALS['phpDocumentor_errors']-> curfile = false; 1808 $this-> fixClasses(); 1809 $this-> fixProcPages(); 1810 // var_dump($this->uses); 1811 // exit; 1812 phpDocumentor_out("\nSorting page elements..." ); 1813 flush(); 1814 uasort($this-> pages,'pagesort'); 1815 foreach($this-> pages as $i => $page) 1816 { 1817 usort($this-> pages[$i]-> elements,array($this,'elementCmp')); 1818 usort($this-> pages[$i]-> classelements,array($this,'ClasselementCmp')); 1819 } 1820 phpDocumentor_out("done\n" );
1821 flush(); 1822 $complicatedout = false; 1823 if (is_array($this-> converters)) 1824 { 1825 if (count($this-> converters) > 1) 1826 { 1827 $complicatedout = true; 1828 } 1829 phpDocumentor_out("Formatting @uses list..." ); 1830 flush(); 1831 $a = new __dummyConverter($this-> all_packages, $this-> package_parents, $this> classes, $this-> proceduralpages, $this-> packageoutput, $this-> parsePrivate, $this> quietMode, $this-> targetDir , '', $this-> title); 1832 $this-> _setupUsesList($a); 1833 unset($a); 1834 phpDocumentor_out("done\n\n" ); 1835 flush(); 1836 foreach($this-> converters as $converter => $blah) 1837 { 1838 if (is_array($blah)) 1839 { 1840 if (count($blah) > 1) 1841 { 1842 $complicatedout = true; 1843 } 1844 foreach($blah as $converter => $templates) 1845 { 1846 foreach($templates as $template) 1847 { 1848 $extraout = ''; 1849 if ($complicatedout) 1850 { 1851 $extraout = SMART_PATH_DELIMITER . $converter; 1852 } 1853 if (count($templates) > 1) 1854 { 1855 $extraout .= SMART_PATH_DELIMITER . str_replace(PATH_DELIMITER, SMART_PATH_DELIMITER, substr($template,0,strlen($template) - 1)); 1856 } 1857 $a = new $converter($this-> all_packages, $this> package_parents, $this-> classes, $this-> proceduralpages, $this-> packageoutput, $this> parsePrivate, $this-> quietMode, $this-> targetDir . $extraout, $template, $this-> title); 1858 if (isset($this-> templateBase)) 1859 { 1860 $a-> setTemplateBase($this-> templateBase, $template); 1861 } 1862 $a-> ric = $this-> ric; 1863 $a-> packagecategories = $this-> packagecategories; 1864 if (isset($this-> tutorials)) $a-> setTutorials($this> tutorials); 1865 $this-> Convert($title, $a); 1866 unset($a); 1867 } 1868 } 1869 } 1870 } 1871 } else 1872 { 1873 addErrorDie(PDERROR_NO_CONVERTERS); 1874 } 1875 } 1876 1877 /** 1878 * Sets the output directory 1879 * 1880 * @param string $dir the output directory 1881 */ 1882 function setTargetDir($dir) 1883 { 1884 $this-> targetDir = $dir; 1885 } 1886 1887 /** 1888 * Sets the template base directory 1889 * 1890 * @param string $dir the template base directory 1891 * @tutorial phpDocumentor.howto.pkg#using.command-line.templatebase 1892 */ 1893 function setTemplateBase($dir) 1894 {
1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940
$this-> }
templateBase = $dir;
/** * set parsing information output mode (quiet or verbose) * * If set to false, no parsing information (parsing /php/file/thisfile.php, * Converting etc.) will be displayed. * Useful for cron jobs * @param bool $quietMode */ function setQuietMode($quietMode) { $this-> quietMode = $quietMode; } /** * show warnings for undocumented elements * * If set to false, no warnings will be shown for undocumented elements. * Useful for identifying classes and methods that haven't yet been documented. * @param bool $undocumentedElementWarnings */ function setUndocumentedElementWarningsMode($undocumentedElementWarnings) { $this-> undocumentedElementWarnings = $undocumentedElementWarnings; } /** * set display of elements marked with @access private * * If set to true, elements will be displayed * @param bool $parse */ function setParsePrivate($parse) { $this-> parsePrivate = $parse; } } /** @access private */ function pagesort($a, $b) { return strnatcasecmp($a-> } ?>
parent->
file,$b->
parent->
file);
68 * Use lowercase letters always, to simplify string comparisons 69 * @var array 70 */ 71 var $valid_booleans = array 72 ( 73 '', ' ', 'on', 'y', 'yes', 'true', '1', 74 'off', 'n', 'no', 'false', '0' 75 76 ); 77 78 /** 79 * creates an array $this->phpDocOptions and sets program options in it. 80 * Array is in the format of: 81 * <pre> 82 * [filename][tag][] = "f"; 83 * [filename][tag][] = "-file"; 84 * [filename][desc] "name of file to parse" 85 * </pre> 86 */ 87 function Io() 88 { 89 $this-> phpDocOptions['filename']['tag'] = array( "-f" , "-filename" ); 90 $this-> phpDocOptions['filename']['desc'] = "name of file(s) to parse ',' file1,file2. Can contain complete path and * ? wildcards" ; 91 $this-> phpDocOptions['filename']['type'] = "path" ; 92 93 $this-> phpDocOptions['directory']['tag'] = array( "-d" , "-directory" ); 94 $this-> phpDocOptions['directory']['desc'] = "name of a directory(s) to parse directory1,directory2" ; 95 $this-> phpDocOptions['directory']['type'] = "path" ; 96 97 $this-> phpDocOptions['examplesdir']['tag'] = array( "-ed" , "-examplesdir" ); 98 $this-> phpDocOptions['examplesdir']['desc'] = "full path of the directory to look for example files from @example tags" ; 99 $this-> phpDocOptions['examplesdir']['type'] = "path" ; 100 101 $this-> phpDocOptions['templatebase']['tag'] = array( "-tb" , "-templatebase" ); 102 $this-> phpDocOptions['templatebase']['desc'] = "base location of all templates for this parse." ; 103 $this-> phpDocOptions['templatebase']['type'] = "path" ; 104 105 $this-> phpDocOptions['target']['tag'] = array("-t" , "--target" ); 106 $this-> phpDocOptions['target']['desc'] = "path where to save the generated files" ; 107 $this-> phpDocOptions['target']['type'] = "path" ; 108 109 $this-> phpDocOptions['ignore']['tag'] = array("-i" , "--ignore" ); 110 $this-> phpDocOptions['ignore']['desc'] = "file(s) that will be ignored, multiple separated by ','. Wildcards * and ? are ok" ; 111 $this-> phpDocOptions['ignore']['type'] = "path" ; 112 113 $this-> phpDocOptions['ignoresymlinks']['tag'] = array("-is" , "-ignoresymlinks" ); 114 $this-> phpDocOptions['ignoresymlinks']['desc'] = "ignore symlinks to other files or directories, default is off" ; 115 $this-> phpDocOptions['ignoresymlinks']['type'] = "set" ; 116 $this-> phpDocOptions['ignoresymlinks']['validvalues'] = $this-> valid_booleans; 117 118 $this-> phpDocOptions['ignoretags']['tag'] = array("-it" , "--ignoretags" ); 119 $this-> phpDocOptions['ignoretags']['desc'] = "tags to ignore for this parse. @package, @subpackage, @access and @ignore may not be ignored." ; 120 $this-> phpDocOptions['ignoretags']['type'] = "value" ; 121 122 $this-> phpDocOptions['hidden']['tag'] = array("-dh" , "--hidden" ); 123 $this-> phpDocOptions['hidden']['desc'] = "set equal to on (-dh on) to descend into hidden directories (directories starting with '.'), default is off" ; 124 $this-> phpDocOptions['hidden']['type'] = "set" ; 125 $this-> phpDocOptions['hidden']['validvalues'] = $this-> valid_booleans; 126 127 $this-> phpDocOptions['quiet']['tag'] = array("-q" , "--quiet" ); 128 $this-> phpDocOptions['quiet']['desc'] = "do not display parsing/conversion messages. Useful for cron jobs on/off default off" ; 129 $this-> phpDocOptions['quiet']['type'] = "set" ; 130 $this-> phpDocOptions['quiet']['validvalues'] = $this-> valid_booleans; 131
132 $this-> phpDocOptions['undocumentedelements']['tag'] = array("-ue" , "-undocumentedelements" ); 133 $this-> phpDocOptions['undocumentedelements']['desc'] = "Control whether or not warnings will be shown for undocumented elements. Useful for identifying classes and methods that haven't yet been documented on/off default off" ; 134 $this-> phpDocOptions['undocumentedelements']['type'] = "set" ; 135 $this-> phpDocOptions['undocumentedelements']['validvalues'] = $this> valid_booleans; 136 137 $this-> phpDocOptions['title']['tag'] = array("-ti" ,"--title" ); 138 $this-> phpDocOptions['title']['desc'] = "title of generated documentation, default is 'Generated Documentation'" ; 139 $this-> phpDocOptions['title']['type'] = "value" ; 140 141 $this-> phpDocOptions['help']['tag'] = array("-h" , "--help" ); 142 $this-> phpDocOptions['help']['desc'] = " show this help message" ; 143 144 $this-> phpDocOptions['useconfig']['tag'] = array("-c" ,"-useconfig" ); 145 $this-> phpDocOptions['useconfig']['desc'] = "Use a Config file in the users/ subdirectory for all command-line options" ; 146 $this-> phpDocOptions['useconfig']['type'] = "value" ; 147 148 $this-> phpDocOptions['parseprivate']['tag'] = array("-pp" ,"-parseprivate" ); 149 $this-> phpDocOptions['parseprivate']['desc'] = "parse @internal and elements marked private with @access. Use on/off, default off" ; 150 $this-> phpDocOptions['parseprivate']['type'] = "set" ; 151 $this-> phpDocOptions['parseprivate']['validvalues'] = array('on', 'off'); 152 153 $this-> phpDocOptions['packageoutput']['tag'] = array("-po" ,"-packageoutput" ); 154 $this-> phpDocOptions['packageoutput']['desc'] = "output documentation only for selected packages. Use a comma-delimited list" ; 155 $this-> phpDocOptions['packageoutput']['type'] = "value" ; 156 157 $this-> phpDocOptions['defaultpackagename']['tag'] = array("-dn" ,"-defaultpackagename" ); 158 $this-> phpDocOptions['defaultpackagename']['desc'] = "name to use for the default package. If not specified, uses 'default'" ; 159 $this-> phpDocOptions['defaultpackagename']['type'] = "value" ; 160 161 $this-> phpDocOptions['defaultcategoryname']['tag'] = array("-dc" ,"-defaultcategoryname" ); 162 $this-> phpDocOptions['defaultcategoryname']['desc'] = "name to use for the default category. If not specified, uses 'default'" ; 163 $this-> phpDocOptions['defaultcategoryname']['type'] = "value" ; 164 165 $this-> phpDocOptions['output']['tag'] = array("-o" ,"--output" ); 166 $this-> phpDocOptions['output']['desc'] = "output information to use separated by ','. Format: output:converter:templatedir like \"HTML:frames:phpedit\"" ; 167 $this-> phpDocOptions['output']['type'] = "value" ; 168 169 $this-> phpDocOptions['converterparams']['tag'] = array("-cp" ,"-converterparams" ); 170 $this-> phpDocOptions['converterparams']['desc'] = "dynamic parameters for a converter, separate values with commas" ; 171 $this-> phpDocOptions['converterparams']['type'] = "value" ; 172 173 $this-> phpDocOptions['customtags']['tag'] = array("-ct" ,"-customtags" ); 174 $this-> phpDocOptions['customtags']['desc'] = "custom tags, will be recognized and put in tags[] instead of unknowntags[]" ; 175 $this-> phpDocOptions['customtags']['type'] = "value" ; 176 177 $this-> phpDocOptions['sourcecode']['tag'] = array("-s" ,"-sourcecode" ); 178 $this-> phpDocOptions['sourcecode']['desc'] = "generate highlighted sourcecode for every parsed file (PHP 4.3.0+ only) on/off default off" ; 179 $this-> phpDocOptions['sourcecode']['type'] = "set" ; 180 $this-> phpDocOptions['sourcecode']['validvalues'] = array('on', 'off'); 181 182 $this-> phpDocOptions['javadocdesc']['tag'] = array("-j" ,"-javadocdesc" ); 183 $this-> phpDocOptions['javadocdesc']['desc'] = "JavaDoc-compliant description parsing. Use on/off, default off (more flexibility)" ; 184 $this-> phpDocOptions['javadocdesc']['type'] = "set" ; 185 $this-> phpDocOptions['javadocdesc']['validvalues'] = array('on', 'off'); 186 187 $this-> phpDocOptions['pear']['tag'] = array("-p" ,"--pear" );
188 $this-> phpDocOptions['pear']['desc'] = "Parse a PEAR-style repository (package is directory, _members are @access private) on/off default off" ; 189 $this-> phpDocOptions['pear']['type'] = "set" ; 190 $this-> phpDocOptions['pear']['validvalues'] = array('on', 'off'); 191 192 $this-> phpDocOptions['readmeinstallchangelog']['tag'] = array("ric" ,"--readmeinstallchangelog" ); 193 $this-> phpDocOptions['readmeinstallchangelog']['desc'] = "Specify custom filenames to parse like README, INSTALL or CHANGELOG files" ; 194 $this-> phpDocOptions['readmeinstallchangelog']['type'] = "value" ; 195 196 $this-> phpDocOptions['general']['message'] ="You can have multiple directories and multiple files, as well as a combination of both options" ; 197 } 198 199 200 /** 201 * create the help message for display on the command-line 202 * @return string a string containing a help message 203 */ 204 function displayHelpMsg() 205 { 206 unset($ret); 207 $ret = "\n" ; 208 foreach($this-> phpDocOptions as $data) 209 { 210 unset($tag); 211 $tag = "" ; 212 if (isset($data['tag'])) 213 { 214 if (is_array($data['tag'])) { 215 foreach($data['tag'] as $param) { 216 $tag .= " $param " ; 217 } 218 } 219 $taglen = 34; 220 $outputwidth = 79; 221 $tagspace = str_repeat(" " ,$taglen); 222 $tmp = " " .trim($tag).$tagspace; 223 $tmp = substr($tmp,0,$taglen); 224 $d = wordwrap(ltrim($data['desc']),($outputwidth-$taglen)); 225 $dt = explode("\n" ,$d); 226 $dt[0] = $tmp .$dt[0]; 227 for($i=1;$i< count($dt);$i++) 228 { 229 $dt[$i] = $tagspace.$dt[$i]; 230 } 231 $ret .= implode("\n" ,$dt)."\n\n" ; 232 233 } 234 } 235 $ret .= "\n" .wordwrap($data['message'],$outputwidth)."\n" ; 236 return $ret; 237 } 238 239 /** 240 * calls {@link file_exists()} for each value in include_path, 241 * then calls {@link is_readable()} when it finds the file 242 * @param string 243 * @return boolean 244 */ 245 function isIncludeable($filename) 246 { 247 $test = realpath($filename); 248 if ($test && is_readable($test)) { 249 return true; // for absolute paths 250 } 251 $ip = get_include_path(); 252 if (PHPDOCUMENTOR_WINDOWS) 253 { 254 $ip = explode(';', $ip); 255 } else { 256 $ip = explode(':', $ip); 257 } 258 foreach($ip as $path) 259 { 260 if ($a = realpath($path . DIRECTORY_SEPARATOR . $filename)) 261 { 262 if (is_readable($a)) 263 {
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343
return true; } } } return false; } /** * Parses $_SERVER['argv'] and creates a setup array * @return array a setup array * @global array command-line arguments * @todo replace with Console_* ? */ function parseArgv() { global $argv; // defaults for setting $setting['hidden'] = "off" ; $setting['ignoresymlinks'] = 'off'; $setting['template'] = 'templates' . PATH_DELIMITER .'default' . PATH_DELIMITER; $valnext = "junk" ; $data = array(); if(isset($argv) && is_array($argv)) { foreach ($argv as $cmd) { if ($cmd == '--') { continue; } if ($cmd == '-h' || $cmd == '--help') { echo $this-> displayHelpMsg(); die(); } // at first, set the arg value as if we // already know it's formatted normally, e.g. // -q on $setting[$valnext] = $cmd; if (isset($data['type']) && $data['type'] == 'set') {
if ($valnext !== 'junk' && strpos(trim($cmd),'-') === 0) { // if valnext isn't 'junk' (i.e it was an arg option) // then the first arg needs an implicit "" as its value, e.g. // ... -q -pp ... ===> ... -q '' -pp ... $setting[$valnext] = ''; } else if (!in_array(strtolower($cmd), $data['validvalues'], true)) { // the arg value is not a valid value addErrorDie(PDERROR_INVALID_VALUES, $valnext, $cmd, '(' . implode(', ', $data['validvalues']) . ')'); } } foreach( $this-> phpDocOptions as $name => { if (!empty($data['tag'])) { if (in_array($cmd,$data['tag'])) { $valnext = $name; break; } else { $valnext = "junk" ; } } } $data )
if ($valnext == 'junk' && ( strpos(trim($cmd),'-') === 0)) { // this indicates the last arg of the command // is an arg option (-) that was preceded by unrecognized "junk" addErrorDie(PDERROR_UNKNOWN_COMMANDLINE,$cmd); } else if ($valnext != 'junk' && ( strpos(trim($cmd),'-') === 0)) { // this indicates the last arg of the command
344 // is an arg option (-) without an arg value 345 346 // add an empty arg "value" for this arg "option" 347 $setting[$valnext] = ''; 348 } 349 350 351 } 352 } else 353 { 354 echo "Please use php-cli.exe in windows, or set register_argc_argv On" ; 355 die; 356 } 357 /* $setting will always have at least 3 elements 358 [hidden] => off 359 [ignoresymlinks] => 'off' 360 [template] => templates/default 361 */ 362 if (count($setting) < 4) { 363 echo $this-> displayhelpMsg(); 364 die(); 365 } 366 367 return $setting; 368 } 369 370 371 /** 372 * @return array list of files in a directory 373 * @param string $directory full path to the directory you want the list of 374 * @param bool whether to list files that begin with . like .bash_history 375 * @param bool whether to ignore symlinks 376 */ 377 function dirList($orig_directory, $hidden = false, $ignore_symlinks = false) 378 { 379 $directory = realpath($orig_directory); 380 $ret = false; 381 if (! @is_dir($directory)) 382 { 383 die(" directory: '$directory' not found\n" ); 384 } 385 $ret = array(); 386 $d = @dir($directory); // thanks to Jason E Sweat ([email protected]) for fix 387 while($d && ( $entry=$d-> read()) !== false) { 388 if (strcmp($entry,"." ) == 0 || strcmp($entry,".." ) == 0) { 389 continue; 390 } 391 392 // skip hidden files, if we're supposed to 393 if (!$hidden) 394 { 395 if (substr($entry,0,1) == "." ) 396 { 397 phpDocumentor_out("Hidden " . $directory . PATH_DELIMITER . $entry . " Ignored\n" ); 398 continue; 399 } 400 } 401 402 // skip symlink files, if we're supposed to 403 if ($ignore_symlinks) 404 { 405 if (is_link($directory . PATH_DELIMITER . $entry)) 406 { 407 phpDocumentor_out("Symlink " . $directory . PATH_DELIMITER . $entry . " Ignored\n" ); 408 continue; 409 } 410 } 411 412 if (is_file($directory . PATH_DELIMITER . $entry)) { 413 $ret[] = $directory . PATH_DELIMITER . $entry; 414 } 415 if (is_dir($directory . PATH_DELIMITER . $entry)) { 416 $tmp = $this-> dirList($directory . PATH_DELIMITER . $entry, $hidden, $ignore_symlinks); 417 if (is_array($tmp)) { 418 foreach($tmp as $ent) { 419 $ret[] = $ent; 420 }
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500
} } } if ($d) $d-> return $ret; } /** * Retrieve common directory (case-insensitive in windows) * * takes the list of files, and returns the subdirectory they share in common, * so in this list: * * <code> * array( * "/dir1/dir2/subdir/dir3/filename.ext", * "/dir1/dir2/subdir/dir4/filename.ext", * "/dir1/dir2/mydir/dir5/filename.ext"); * </code> * * getBase will return "/dir1/dir2" * @param array array of strings */ function getBase($filelist) { $masterPath = false; foreach($filelist as $path) { if (!$masterPath) { $masterPath = str_replace('\\','/',dirname($path)); } else { if (dirname($path) != $masterPath) { $mp = explode(PATH_DELIMITER, $masterPath); $np = explode(PATH_DELIMITER, str_replace('\\', '/', dirname($path))); if (count($np) < count($mp)) { $masterPath = join($np, PATH_DELIMITER); } else { $test = false; $found = false; for($i=0;$i < count($mp) && $i < count($np);$i++) { if (PHPDOCUMENTOR_WINDOWS) { if (strtolower($mp[$i]) != strtolower($np[$i])) $found = $i; } else { if ($mp[$i] != $np[$i]) $found = $i; } } if ($found !== false) { $mp = array_slice($mp,0,$found); $masterPath = join($mp,PATH_DELIMITER); } } } } } return $masterPath; } /** * Retrieve tutorial subdirectories and their contents from the list of * files to parse * @param array array of paths (strings) * @return array array(filelist - tutorials, tutorials) */ function getTutorials($filelist) { $list = $tutorials = array(); foreach($filelist as $file) { if (strpos($file,'tutorials/') !== false) { $tutedir = explode('/',substr($file,strpos($file,'tutorials/'))); close();
501 array_shift($tutedir); 502 if (count($tutedir) <= 3) 503 { 504 $res = array(); 505 // kludge - will need to fix for 2.0 506 $res['category'] = $GLOBALS['phpDocumentor_DefaultCategoryName']; 507 $res['package'] = array_shift($tutedir); 508 $res['subpackage'] = ''; 509 if (count($tutedir) > 1) 510 $res['subpackage'] = array_shift($tutedir); 511 $f = array_shift($tutedir); 512 $res['tutename'] = $f; 513 $f = explode('.',$f); 514 $res['tutetype'] = array_pop($f); 515 if ($res['tutetype'] == 'ini') continue; 516 $res['path'] = $file; 517 if (@file_exists($file . '.ini')) 518 { 519 $res['ini'] = phpDocumentor_parse_ini_file($file . '.ini', true); 520 } else 521 { 522 $res['ini'] = false; 523 } 524 $tutorials[] = $res; 525 } 526 } else $list[] = $file; 527 } 528 return array($list,$tutorials); 529 } 530 531 /** 532 * @param string base directory from {@link getBase()} 533 * @param array file list from {@link dirList()} 534 * @return array array(filelist - README/INSTALL/CHANGELOG, 535 * README/INSTALL/CHANGELOG) 536 */ 537 function getReadmeInstallChangelog($base,$filelist) 538 { 539 $list = $ric = array(); 540 $names = $GLOBALS['_phpDocumentor_RIC_files']; 541 foreach($filelist as $file) 542 { 543 if ((dirname($file) == $base) && in_array(strtoupper(basename($file)), $names)) 544 { // be sure to change $this->checkIgnore() if any other files are added here!! 545 $ric[] = $file; 546 } else 547 { 548 $list[] = $file; 549 } 550 } 551 return array($list,$ric); 552 } 553 554 /** 555 * @param string directory 556 * @param string base directory 557 * @param array array of ignored items 558 * @param boolean the "hidden" flag 559 * @param boolean the "ignoresymlinks" flag 560 * @uses dirList 561 * @uses checkIgnore 562 * @uses setup_dirs 563 */ 564 function getDirTree($dir, $base_dir, $ignore = array(), $hidden = false, $ignoresymlinks = false) 565 { 566 $allfiles = $this-> dirList($dir,$hidden,$ignoresymlinks); 567 $struc = array(); 568 foreach($allfiles as $file) 569 { 570 if ($this> checkIgnore(basename($file),dirname(realpath($file)),$ignore,$ignoresymlinks)) continue; 571 if (PHPDOCUMENTOR_WINDOWS) { 572 $path = substr(dirname($file),strlen(str_replace('\\','/',realpath($base_dir)))); 573 } else { 574 $path = substr(dirname($file),strlen(str_replace('\\','/',realpath($base_dir)))+1); 575 }
576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 PHP File 646 647 648 649 650 651 652 653 654
if (!$path) $path = '/'; $parts = pathinfo($file); if (!isset($parts['extension'])) { $parts['extension'] = ''; } $struc[$path][] = array( 'file' => $parts['basename'], 'ext' => $parts['extension'], 'path' => $file); } uksort($struc,'strnatcasecmp'); foreach($struc as $key => $ind) { usort($ind,'Ioinc_sortfiles'); $struc[$key] = $ind; $save = $key; if ($key != '/') { $key = explode('/',$key); while (count($key)) { array_pop($key); if (isset($struc[join('/',$key)])) { $struc[join('/',$key)][substr($save,strlen(join('/',$key)) + 1)] = $ind; unset($struc[$save]); } } } } foreach($struc as $key => $ind) { if ($key != '/') { if (count(explode('/',$key)) == 1) { $struc['/'][$key] = $struc[$key]; unset($struc[$key]); } } } $tempstruc = $struc; unset($tempstruc['/']); $leftover_dirs = array_keys($tempstruc); $splitdirs = array(); foreach($leftover_dirs as $dir) { $splitdirs[] = explode('/',$dir); } $leftover_dirs = array(); foreach($splitdirs as $dir) { $save = join($dir,'/'); $struc['/'] = setup_dirs($struc['/'], $dir, $tempstruc[$save]); unset($struc[$save]); } @uksort($struc['/'],'Ioinc_mystrucsort'); return $struc; } /** * Reads a file and returns it as a string * Does basic error checking * * file extensions are set in {@link phpdoc.inc} * * @global array PHP File extensions, used to validate that $path is a PHP File * @global array PHP File extensions in a CVS repository, used to validate that $path is a * @param string $path */ function readPhpFile($path, $quietMode = false) { global $_phpDocumentor_cvsphpfile_exts, $_phpDocumentor_phpfile_exts; // tiberiusblue addition $cvsExt = $_phpDocumentor_cvsphpfile_exts; $ext = $_phpDocumentor_phpfile_exts; if (file_exists($path))
655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734
{ if (is_file($path)) { // check extension $tmp = explode("." ,$path); // tiberiusblue addition $tmp2 = $tmp; if (in_array(array_pop($tmp),$ext)) { phpDocumentor_out(" -- Parsing file\n" ); flush(); if (function_exists('file_get_contents')) { return file_get_contents($path); } $fp = fopen($path,"r" ); $ret = fread($fp,filesize($path)); fclose($fp); return $ret; } elseif (in_array(array_pop($tmp2),$cvsExt)) { phpDocumentor_out(" CVS file [EXPERIMENTAL]\n" ); flush(); if (function_exists('file_get_contents')) { $ret = file_get_contents($path); } else { $fp = fopen($path,"r" ); $ret = fread($fp,filesize($path)); fclose($fp); } $ret = strstr($ret,"<?" ); $ret = substr($ret,0,strpos($ret,"@\n" )); $ret = str_replace("@@" ,"@" ,$ret); return $ret; } else { phpDocumentor_out(" -- File not parsed, not a php file\n" flush(); } } else { phpDocumentor_out(" -- Unable to read file, not a file\n" flush(); } } else { phpDocumentor_out(" -- Unable to read file, file does not exist\n" flush(); } } /** * Tell whether to ignore a file or a directory * allows * and ? wildcards * * @author Greg Beaver <[email protected]> * @param string $file just the file name of the file or directory, * in the case of directories this is the last dir * @param string $path the path to consider (should be checked by * realpath() before, and may be relative) * @param array $ignore * @param bool * @param bool Ignore symlinks? * @return bool true if $path should be ignored, false if it should not */ function checkIgnore($file,$path,$ignore,$ignore_no_ext = true,$ignoresymlinks = false) { global $_phpDocumentor_RIC_files; if ($ignoresymlinks && is_link($path . PATH_DELIMITER . $file)) return false;
);
);
);
if (!count($ignore)) return false; if (!isset($this-> ignore)) { $this-> _setupIgnore($ignore); } if (!$this-> ignore) { return false; } if ($ignore_no_ext &&
735 !in_array(strtoupper($file), $_phpDocumentor_RIC_files)) 736 { 737 if (!is_numeric(strpos($file,'.'))) return true; 738 } 739 if (is_array($this-> ignore)) 740 { 741 foreach($this-> ignore as $match) 742 { 743 // match is an array if the ignore parameter was a /path/to/pattern 744 if (is_array($match)) 745 { 746 // check to see if the path matches with a path delimiter appended 747 preg_match('/^' . strtoupper($match[0]).'$/', strtoupper($path) . PATH_DELIMITER,$find); 748 if (!count($find)) 749 { 750 // check to see if it matches without an appended path delimiter 751 preg_match('/^' . strtoupper($match[0]).'$/', strtoupper($path), $find); 752 } 753 if (count($find)) 754 { 755 // check to see if the file matches the file portion of the regex string 756 preg_match('/^' . strtoupper($match[1]).'$/', strtoupper($file), $find); 757 if (count($find)) 758 { 759 return true; 760 } 761 } 762 // check to see if the full path matches the regex 763 preg_match('/^' . strtoupper($match[0]).'$/', 764 strtoupper($path . DIRECTORY_SEPARATOR . $file), $find); 765 if (count($find)) 766 { 767 return true; 768 } 769 } else 770 { 771 // ignore parameter was just a pattern with no path delimiters 772 // check it against the path 773 preg_match('/^' . strtoupper($match).'$/', strtoupper($path), $find); 774 if (count($find)) 775 { 776 return true; 777 } 778 // check it against the file only 779 preg_match('/^' . strtoupper($match).'$/', strtoupper($file), $find); 780 if (count($find)) 781 { 782 return true; 783 } 784 } 785 } 786 } 787 return false; 788 } 789 790 /** 791 * Construct the {@link $ignore} array 792 * @author Greg Beaver <[email protected]> 793 * @param array strings of files/paths/wildcards to ignore 794 * @access protected 795 */ 796 function _setupIgnore($ignore) 797 { 798 $ig = array(); 799 if ( ! is_array($ignore)) 800 { 801 $this-> ignore = false; 802 return; 803 } 804 for($i=0; $i< count($ignore);$i++) 805 { 806 if (empty($ignore[$i])) 807 continue; 808 809 $ignore[$i] = strtr($ignore[$i], '\\', '/'); 810 $ignore[$i] = str_replace('//','/',$ignore[$i]); 811 812 if (!is_numeric(strpos($ignore[$i],PATH_DELIMITER))) 813 {
814 $ig[] = $this-> getRegExpableSearchString($ignore[$i]); 815 } else 816 { 817 if (basename($ignore[$i]) . PATH_DELIMITER == $ignore[$i]) 818 $ig[] = $this-> getRegExpableSearchString($ignore[$i]); 819 else 820 $ig[] = array($this-> getRegExpableSearchString($ignore[$i]),$this> getRegExpableSearchString(basename($ignore[$i]))); 821 } 822 } 823 if (count($ig)) $this-> ignore = $ig; 824 } 825 826 /** 827 * Converts $s into a string that can be used with preg_match 828 * @param string $s string with wildcards ? and * 829 * @author Greg Beaver <[email protected]> 830 * @return string converts * to .*, ? to ., etc. 831 */ 832 function getRegExpableSearchString($s) 833 { 834 $y = '\/'; 835 if (DIRECTORY_SEPARATOR == '\\') 836 { 837 $y = '\\\\'; 838 } 839 $s = str_replace('/', DIRECTORY_SEPARATOR, $s); 840 $x = strtr($s, array('?' => '.','*' => '.*','.' => '\\.','\\' => '\\\\','/' => '\\/', 841 '[' => '\\[',']' => '\\]','-' => '\\-')); 842 if (strpos($s, DIRECTORY_SEPARATOR) !== false && 843 strrpos($s, DIRECTORY_SEPARATOR) === strlen($s) - 1) 844 { 845 $x = " (?:.*$y$x?.*|$x.*)" ; 846 } 847 return $x; 848 } 849 850 /** 851 * Removes files from the $dir array that do not match the search string in 852 * $match 853 * @param array $dir array of filenames (full path) 854 * @param string $match search string with wildcards 855 * @author Greg Beaver <[email protected]> 856 * @return string|arraylisting of every file in a directory that matches 857 * the search string 858 */ 859 function removeNonMatches($dir, $match) 860 { 861 $match = $this-> getRegExpableSearchString($match); 862 $nodir = false; 863 if (!is_array($dir)) 864 { 865 $dir = array($dir); 866 $nodir = true; 867 } 868 foreach($dir as $i => $file) 869 { 870 preg_match('/^'.$match.'$/',basename($file),$find); 871 if (!count($find)) unset($dir[$i]); 872 } 873 if ($nodir) return $dir[0]; 874 return $dir; 875 } 876 877 /** 878 * Take a filename with wildcards and return all files that match the 879 * wildcards 880 * @param string $file a full path from the -f command-line parameter, with 881 * potential * and ? wildcards. 882 * @return mixed if $file contains wildcards, returns an array of matching 883 * files, otherwise returns false 884 * @author Greg Beaver <[email protected]> 885 * @uses dirList 886 * @uses removeNonMatches 887 */ 888 function getAllFiles($file) 889 { 890 $path = realpath(dirname($file)); 891 $file = basename($file);
892 // any wildcards? 893 if (is_numeric(strpos($file,'?')) || is_numeric(strpos($file,'*'))) 894 { 895 $files = $this-> dirList($path); 896 $a = $this-> removeNonMatches($files,$file); 897 return $a; 898 } 899 return false; 900 } 901 } 902 903 /**#@+ 904 * Sorting functions for the file list 905 * @param string 906 * @param string 907 */ 908 function Ioinc_sortfiles($a, $b) 909 { 910 return strnatcasecmp($a['file'],$b['file']); 911 } 912 913 function Ioinc_mystrucsort($a, $b) 914 { 915 if (is_numeric($a) && is_string($b)) return 1; 916 if (is_numeric($b) && is_string($a)) return -1; 917 if (is_numeric($a) && is_numeric($b)) 918 { 919 if ($a > $b) return 1; 920 if ($a < $b) return -1; 921 if ($a == $b) return 0; 922 } 923 return strnatcasecmp($a,$b); 924 } 925 /**#@-*/ 926 927 /** 928 * Recursively add all the subdirectories of $contents to $dir without erasing anything in 929 * $dir 930 * @param array 931 * @param array 932 * @return array processed $dir 933 */ 934 function set_dir($dir,$contents) 935 { 936 while(list($one,$two) = each($contents)) 937 { 938 if (isset($dir[$one])) 939 { 940 $dir[$one] = set_dir($dir[$one],$contents[$one]); 941 } else $dir[$one] = $two; 942 } 943 return $dir; 944 } 945 946 /** 947 * Recursively move contents of $struc into associative array 948 * 949 * The contents of $struc have many indexes like 'dir/subdir/subdir2'. 950 * This function converts them to 951 * array('dir' => array('subdir' => array('subdir2'))) 952 * @param array struc is array('dir' => array of files in dir,'dir/subdir' => array of files in dir/subdir,...) 953 * @param array array form of 'dir/subdir/subdir2' array('dir','subdir','subdir2') 954 * @return array same as struc but with array('dir' => array(file1,file2,'subdir' => array(file1,...))) 955 */ 956 function setup_dirs($struc,$dir,$contents) 957 { 958 if (!count($dir)) 959 { 960 foreach($contents as $dir => $files) 961 { 962 if (is_string($dir)) 963 { 964 if (strpos($dir,'/')) 965 { 966 $test = true; 967 $a = $contents[$dir]; 968 unset($contents[$dir]); 969 $b = explode('/',$dir);
970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992
$c = array_shift($b); if (isset($contents[$c])) { $contents[$c] = set_dir($contents[$c],setup_dirs(array(),$b,$a)); } else $contents[$c] = setup_dirs(array(),$b,$a); } } } return $contents; } $me = array_shift($dir); if (!isset($struc[$me])) $struc[$me] = array(); $struc[$me] = setup_dirs($struc[$me],$dir,$contents); return $struc; } if (!function_exists('get_include_path')) { function get_include_path() { return ini_get('include_path'); } } ?>
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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 142 143 144 145 146 147
* @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - rename class to ParserCode */ class parserCode extends parserStringWithInlineTags { /** * performs the conversion of code tags * * @param Converter &$c the converter object * * @return string the converted code block * @uses Converter::ProgramExample() * @todo CS cleanup - rename method to convert() */ function Convert(& $c) { if (!isset($this-> value[0])) { return ''; } if (is_string($this-> value[0]) && $this-> value[0]{0} == "\n" $this-> value[0] = substr($this-> value[0], 1); } $linktags = array(); foreach ($this-> value as $val) { if (phpDocumentor_get_class($val) == 'parserlinkinlinetag' || phpDocumentor_get_class($val) == 'parsertutorialinlinetag' ) { $linktags[] = array( $c-> postProcess($val-> Convert($c, false, false)), $val); } } $a = $c-> ProgramExample(rtrim(ltrim(parent::Convert($c, false, false), "\n\r" ))); foreach ($linktags as $tag) { $a = str_replace($tag[0], $tag[1]-> Convert($c, false, false), $a); } return $a; } } /** * Used for <<pre>> in a description * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DescHTML * @author Greg Beaver <[email protected]> * @copyright 2002-2007 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - rename class to ParserPre */ class parserPre extends parserStringWithInlineTags { /** * performs the conversion of code tags * * @param Converter &$c the converter object * * @return string the converted pre block * @uses Converter::PreserveWhiteSpace() * @todo CS cleanup - rename method to convert() */ function Convert(& $c) { return $c-> PreserveWhiteSpace(rtrim(ltrim(parent::Convert($c, false, false), "\n\r" ))); } } /** * Used for <<b>> in a description *
) {
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
* @category ToolsAndUtilities * @package phpDocumentor * @subpackage DescHTML * @author Greg Beaver <[email protected]> * @copyright 2002-2007 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - rename class to ParserB */ class parserB extends parserStringWithInlineTags { /** * performs the conversion of bold tags * * @param Converter &$c the converter object * * @return string the converted pre block * @uses Converter::Bolden() * @todo CS cleanup - rename method to convert() */ function Convert(& $c) { return $c-> Bolden(parent::Convert($c)); } } /** * Used for <<i>> in a description * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DescHTML * @author Greg Beaver <[email protected]> * @copyright 2002-2007 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - rename class to ParserI */ class parserI extends parserStringWithInlineTags { /** * performs the conversion of italic tags * * @param Converter &$c the converter object * * @return string the converted pre block * @uses Converter::Italicize() * @todo CS cleanup - rename method to convert() */ function Convert(& $c) { return $c-> Italicize(parent::Convert($c)); } } /** * Used for <<var>> in a description * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DescHTML * @author Greg Beaver <[email protected]> * @copyright 2002-2007 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - rename class to ParserDescVar */ class parserDescVar extends parserStringWithInlineTags
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
{ /** * performs the conversion of variable tags * * @param Converter &$c the converter object * * @return string the converted pre block * @uses Converter::Varize() * @todo CS cleanup - rename method to convert() */ function Convert(& $c) { return $c-> Varize(parent::Convert($c)); } } /** * Used for <<samp>> in a description * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DescHTML * @author Greg Beaver <[email protected]> * @copyright 2002-2007 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - rename class to ParserSamp */ class parserSamp extends parserStringWithInlineTags { /** * performs the conversion of sample tags * * @param Converter &$c the converter object * * @return string the converted pre block * @uses Converter::Sampize() * @todo CS cleanup - rename method to convert() */ function Convert(& $c) { return $c-> Sampize(parent::Convert($c)); } } /** * Used for <<kbd>> in a description * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DescHTML * @author Greg Beaver <[email protected]> * @copyright 2002-2007 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - rename class to ParserKbd */ class parserKbd extends parserStringWithInlineTags { /** * performs the conversion of keyboard tags * * @param Converter &$c the converter object * * @return string the converted pre block * @uses Converter::Kbdize() * @todo CS cleanup - rename method to convert() */ function Convert(& $c) { return $c-> Kbdize(parent::Convert($c)); }
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
} /** * Used for <<br>> in a description * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DescHTML * @author Greg Beaver <[email protected]> * @copyright 2002-2007 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - rename class to ParserBr */ class parserBr extends parserStringWithInlineTags { /** * performs the conversion of linebreak tags * * @param Converter &$c the converter object * * @return string the converted pre block * @uses Converter::Br() * @todo CS cleanup - rename method to convert() */ function Convert(& $c) { return $c-> Br($this-> getString()); } } /** * Used for lists <<ol>> and <<ul>> * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DescHTML * @author Greg Beaver <[email protected]> * @copyright 2002-2007 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - rename class to ParserList */ class parserList extends parserStringWithInlineTags { /** * @var boolean */ var $numbered; /** * @var integer */ var $items = 0; /** * Constructor - create a new list * * @param integer $numbered a reference number for the new list */ function parserList($numbered) { $this-> numbered = $numbered; } /** * add an item to a list * * @param parserStringWithInlineTags $item the item to add * * @return void */ function addItem($item) {
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
$this-> }
value[$this->
items++] = $item;
/** * add a list * * @param parserList $list the list to add * * @return void */ function addList($list) { $this-> value[$this-> items++] = $list; } /** * performs the conversion of list tags * * @param Converter &$c the converter object * * @return string the converted pre block * @uses Converter::ListItem() enclose each item of the list * @uses Converter::EncloseList() enclose the list * @todo CS cleanup - rename method to convert() */ function Convert(& $c) { $list = ''; foreach ($this-> value as $item) { $list .= $c-> ListItem(trim($item-> Convert($c))); } return $c-> EncloseList($list, $this-> numbered); } } ?>
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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 142 143 144 145 146 147
*/ var $type = '_tag'; /** * tag name (see, access, etc.) * @var string */ var $keyword = ''; /** * Set up the tag * * {@source } * * @param string $keyword tag name * @param parserStringWithInlineTags $value tag value * @param boolean $noparse whether to parse the $value * for html tags */ function parserTag($keyword, $value, $noparse = false) { $this-> keyword = $keyword; if (!$noparse) { $parser = new parserDescParser; $parser-> subscribe('*', $this); $parser-> parse($value-> value, true, 'parserstringwithinlinetags'); } else { $this-> value = $value; } } /** * Perform the output conversion on this {@link parserTag} * using the {@link Converter output converter} that is passed in * * @param Converter &$converter the converter object * * @return string * @see Converter * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $converter) { if (is_array($this-> value)) { if (count($this-> value) == 1) { reset($this-> value); list(, $val) = each($this-> value); $a = $val-> Convert($converter); return $a; } $result = ''; foreach ($this-> value as $val) { // this is only true if we processed the description // in the constructor if (phpDocumentor_get_class($val) == 'parserstringwithinlinetags') { $result .= $converter-> EncloseParagraph($val-> Convert($converter)); } else { $result .= $val-> Convert($converter); } } return $result; } else { $a = $this-> value-> Convert($converter); return $a; } } /** * Gets a count of the number of paragraphs in this * tag's description. * * Useful in determining whether to enclose the * tag in a paragraph or not. * * @return integer (actually, body is empty, so it doesn't return at all) * @access private * @todo does this need to be implemented? its body is empty */ function _valueParagraphCount()
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
{ } /** * Called by the {@link parserDescParser} when processing a description. * * @param integer $a not used * @param array $desc array of {@link parserStringWithInlineTags} * representing paragraphs in the tag description * * @return void * @see parserTag::parserTag() * @todo CS cleanup - rename to handleEvent for camelCase rule */ function HandleEvent($a,$desc) { $this-> value = $desc; } /** * Returns the text minus any inline tags * * @return string the text minus any inline tags * @see parserStringWithInlineTags::getString() */ function getString() { if (is_array($this-> value)) { $result = ''; foreach ($this-> value as $val) { $result .= $val-> getString(); } return $result; } else { return $this-> value-> getString(); } } } /** * This class represents the @name tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.name.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserNameTag extends parserTag { /** * tag name * @var string */ var $keyword = 'name'; /** * set up the name tag * * @param string $name tag name (not used) * @param string $value tag value */ function parserNameTag($name, $value) { $this-> value = $value; } /** * process this tag through the given output converter * * @param Converter &$c output converter * * @return string converted value of the tag
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
* @see parserStringWithInlineTags::Convert() * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $c) { return $this-> value; } } /** * This class represents the @access tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.access.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserAccessTag extends parserTag { /** * tag name * @var string */ var $keyword = 'access'; /** * set to true if the returned tag has a value type of private, protected * or public, false otherwise * @var boolean */ var $isvalid = false; /** * checks $value to make sure it is private, protected or public, otherwise * it's not a valid @access tag * * @param parserStringWithInlineTags $value the tag value * * @see $isvalid */ function parserAccessTag($value) { if (!is_string($value)) { if (is_object($value)) { if (method_exists($value, 'getstring')) { $value = $value-> getString(); } } } switch(trim($value)) { case 'private' : case 'public' : case 'protected' : $this-> value = $value; $this-> isvalid = true; break; default : addError(PDERROR_ACCESS_WRONG_PARAM, $value); $this-> value = 'public'; break; } } /** * process this tag through the given output converter * * @param Converter &$converter the output converter * * @return string converted value of the tag * @see parserStringWithInlineTags::Convert() * @todo CS cleanup - rename to convert for camelCase rule */
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
$converter) value;
/** * No inline tags are possible, returns 'public', 'protected' or 'private' * * @return string returns the text minus any inline tags */ function getString() { return $this-> value; } } /** * represents the "@return" tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.return.pkg * @since 1.0rc1 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserReturnTag extends parserTag { /** * always 'return' * @var string */ var $keyword = 'return'; /** * the type a function returns */ var $returnType = 'void'; /** * contains a link to the documentation for a class * passed as a type in @return, @var or @param * * Example: * * <code> * class myclass * { * ... * } * /** @return myclass blahblahblah * ... * </code> * * In this case, $converted_returnType will contain a link to myclass * instead of the string 'myclass' * * @var mixed either the same as $returnType or a link to the docs for a class * @see $returnType */ var $converted_returnType = false; /** * set up the tag * * @param string $returnType returned datatype * @param parserStringWithInlineTags $value tag value */ function parserReturnTag($returnType, $value) { $this-> returnType = $returnType; parent::parserTag('return', $value); }
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
/** * process this tag through the given output converter * (sets up the $converted_returnType) * * @param Converter &$converter the output converter * * @return string converted value of the tag * @see parserStringWithInlineTags::Convert(), $converted_returnType * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $converter) { $my_types = ''; if (strpos($this-> returnType, '|')) { $types = explode('|', $this-> returnType); foreach ($types as $returntype) { $a = $converter-> getLink($returntype); if (is_object($a) && phpDocumentor_get_class($a) == 'classlink') { if (!empty($my_types)) { $my_types .= '|'; } $my_types .= $converter-> returnSee($a, $converter-> type_adjust($returntype)); } else { if (!empty($my_types)) { $my_types .= '|'; } $my_types .= $converter-> type_adjust($returntype); } } $this-> converted_returnType = $my_types; } else { $a = $converter-> getLink($this-> returnType); if (is_object($a) && phpDocumentor_get_class($a) == 'classlink') { $this-> converted_returnType = $converter-> returnSee($a, $converter-> type_adjust($this-> returnType)); } else { $this-> converted_returnType = $converter-> type_adjust($this-> returnType); } } return parserTag::Convert($converter); } } /** * represents the "@property" tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.property.pkg * @since 1.4.0a1 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserPropertyTag extends parserReturnTag { /** * always 'property' * @var string */ var $keyword = 'property'; /** * the type a property has * @var string */ var $returnType = 'mixed'; /** * set up the property tag * * @param string $returnType the tag value's datatype * @param parserStringWithInlineTags $value the tag value
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547
*/ function parserPropertyTag($returnType, $value) { $this-> returnType = $returnType; parent::parserTag($this-> keyword, $value); } } /** * represents the "@property-read" tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.property.pkg * @since 1.4.0a1 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserPropertyReadTag extends parserPropertyTag { /** * always 'property-read' * @var string */ var $keyword = 'property-read'; } /** * represents the "@property-write" tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.property.pkg * @since 1.4.0a1 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserPropertyWriteTag extends parserPropertyTag { /** * always 'property-write' * @var string */ var $keyword = 'property-write'; } /** * represents the "@method" tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.method.pkg * @since 1.4.0a1 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserMethodTag extends parserPropertyTag { /**
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627
* always 'method' * @var string */ var $keyword = 'method'; /** * the return type a method has * @var string */ var $returnType = 'void'; } /** * represents the "@var" tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.var.pkg * @since 1.0rc1 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserVarTag extends parserReturnTag { /** * always 'var' * @var string */ var $keyword = 'var'; /** * the type a var has * @var string */ var $returnType = 'mixed'; } /** * represents the "@param" tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.param.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserParamTag extends parserVarTag { /** * always 'param' * @var string */ var $keyword = 'param'; } /** * represents the "@staticvar" tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.staticvar.pkg
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707
* @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserStaticvarTag extends parserParamTag { /** * always 'staticvar' * @var string */ var $keyword = 'staticvar'; } /** * represents the "@link" tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.0rc1 * @tutorial tags.link.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserLinkTag extends parserTag { /** * always 'link' * @var string */ var $keyword = 'link'; /** * sets up the link tag * * @param string $link URL to link to * (might also contain the URL's * description text) */ function parserLinkTag($link) { $start = $val = $link-> getString(); if (strpos($val, ' ')) { $val = explode(' ', $val); $start = array_shift($val); $val = join($val, ' '); } $a = new parserLinkInlineTag($start, $val); $b = new parserStringWithInlineTags; $b-> add($a); $this-> value = $b; } } /** * represents the "@see" tag * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.0rc1 * @tutorial tags.see.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserSeeTag extends parserLinkTag { /** * always 'see'
708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787
* @var string */ var $keyword = 'see'; /** * sets up the see tag * * @param string $name element to link to */ function parserSeeTag($name) { parserTag::parserTag($this-> keyword, $name, true); } /** * process this tag through the given output converter * * @param Converter &$converter the output converter * * @return string converted value of the tag * @see parserStringWithInlineTags::Convert() * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $converter) { if ($this-> value-> hasInlineTag()) { addErrorDie(PDERROR_INLINETAG_IN_SEE); } $a = $converter-> getLink(trim($this-> value-> Convert($converter))); if (is_string($a)) { // feature 564991 if (strpos($a, '://')) { // php function return $converter-> returnLink($a, str_replace('PHP_MANUAL#', '', $this-> value-> Convert($converter))); } return $a; } if (is_object($a)) { return $converter-> returnSee($a); } // getLink parsed a comma-delimited list of linked thingies, // add the commas back in if (is_array($a)) { $b = ''; foreach ($a as $i => $bub) { if (!empty($b)) { $b .= ', '; } if (is_string($a[$i])) { $b .= $a[$i]; } if (is_object($a[$i])) { $b .= $converter-> returnSee($a[$i]); } } return $b; } return false; } } /** * represents the "@see" tag * * Link to a license, instead of including lines and lines of license information * in every file * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.license.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_*
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867
*/ class parserLicenseTag extends parserLinkTag { /** * always 'license' * @var string */ var $keyword = 'license'; /** * set up the license tag * * @param string $name unused? * @param string $link URL to link to */ function parserLicenseTag($name, $link) { $a = explode(' ', $link-> getString()); $url = array_shift($a); $license = join($a, ' '); if (empty($license)) { $license = $url; } $a = new parserLinkInlineTag($url, $license); $b = new parserStringWithInlineTags; $b-> add($a); $this-> value = $b; } } /** * represents the "@uses" tag * * This is exactly like @see except that the element used * has a @useby link to this element added to its docblock * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @tutorial tags.uses.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserUsesTag extends parserSeeTag { /** * Always "uses" * @var string */ var $keyword = 'uses'; /** * @access private */ var $_description; /** * set up the uses tag * * @param string $seeel element to link to * @param parserStringWithInlineTags $description description of how * the element is used */ function parserUsesTag($seeel, $description) { if ($seeel-> hasInlineTag()) { addErrorDie(PDERROR_DUMB_USES); } parent::parserSeeTag($seeel); $this-> _description = $description; } /** * Return a link to documentation for other element,
868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947
* and description of how it is used * * Works exactly like {@link parent::Convert()} * except that it also includes a description of * how the element used is used. * * @param Converter &$c the output converter * * @return string link to the uses target * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $c) { $val = $this-> value; $see = parent::Convert($c); $this-> value = $this-> _description; $desc_val = parserTag::Convert($c); if (!empty($desc_val)) { $see .= ' - '.$desc_val; } $this-> value = $val; return $see; } /** * Get the text of the link to the element that is being used * * @return string * @access private */ function getSeeElement() { return $this-> value-> getString(); } /** * Get the description of how the element used is being used. * * @return parserStringWithInlineTags */ function getDescription() { return $this-> _description; } } /** * This is a virtual tag, it is created by @uses to cross-reference the used element * * This is exactly like @uses. * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserUsedByTag extends parserUsesTag { /** * Always "usedby" * @var string */ var $keyword = 'usedby'; /** * @access private */ var $_link; /** * set up the usedby tag * * @param abstractLink $link
948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027
* @param string $description description of how the element is used */ function parserUsedByTag($link, $description) { $this-> value = $description; $this-> _link = $link; } /** * process this tag through the given output converter * * @param Converter &$c the output converter * * @return string * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $c) { $see = $c-> returnSee($this-> _link); $desc_val = parserTag::Convert($c); if (!empty($desc_val)) { $see .= ' - '.$desc_val; } return $see; } } /** * represents "@tutorial" * * This is exactly like @see except that it only links to tutorials * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @tutorial phpDocumentor/tutorials.pkg * @tutorial tags.tutorial.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserTutorialTag extends parserSeeTag { /** * Always "tutorial" * @var string */ var $keyword = 'tutorial'; /** * process this tag through the given output converter * * @param Converter &$converter the output converter * * @return string|bool * @see parserStringWithInlineTags::Convert() * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $converter) { $a = $converter-> getTutorialLink(trim($this-> value-> Convert($converter))); if (is_string($a)) { return $a; } if (is_object($a)) { return $converter-> returnSee($a); } // getLink parsed a comma-delimited list of linked thingies, // add the commas back in if (is_array($a)) { $b = ''; foreach ($a as $i => $bub) { if (!empty($b)) { $b .= ', ';
1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107
} if (is_string($a[$i])) { $b .= $a[$i]; } if (is_object($a[$i])) { $b .= $converter-> returnSee($a[$i]); } } return $b; } return false; } } /** * represents "@filesource" * * Use this to create a link to a highlighted phpxref-style source file listing * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2 * @tutorial tags.filesource.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserFileSourceTag extends parserTag { /** * Always "filesource" * @var string */ var $keyword = 'filesource'; /** * @var array */ var $source; /** * @var string */ var $path; /** * Flag variable, controls double writes of file for each converter * @var array * @access private */ var $_converted = array(); /** * Set {@link $source} to $value, and set up path * * @param string $filepath the file's path * @param array $value output from * {@link phpDocumentorTWordParser::getFileSource()} */ function parserFileSourceTag($filepath, $value) { parent::parserTag($this-> keyword, ''); $this-> path = $filepath; $this-> source = $value; } /** * Return a link to the highlighted source and generate the source * * @param Converter &$c the output converter * * @return string output from {@link getSourceLink()} * @uses ConvertSource() generate source code and write it out * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $c) {
1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187
$this-> ConvertSource($c); return $this-> getSourceLink($c); } /** * convert the source code * * @param Converter &$c the output converter * * @return void * @uses phpDocumentor_HighlightParser highlights source code * @uses writeSource() * @todo CS cleanup - rename to convertSource for camelCase rule * @todo what's up with all the "return" statements? * can they _all_ be removed? */ function ConvertSource(& $c) { $this-> writeSource($c, $c-> ProgramExample($this-> source, true, false, false, false, $this-> return; $parser = new phpDocumentor_HighlightParser; $return = ''; $return = $parser-> parse($this-> source, $c, false, false, false, $this-> path); $this-> writeSource($c, $return); } /** * have the output converter write the source code * * @param Converter &$c the output converter * @param string $source highlighted source code * * @return void * @uses Converter::writeSource() export highlighted file source */ function writeSource(& $c, $source) { $c-> writeSource($this-> path, $source); } /** * gets path to the sourcecode file * * @param Converter &$c the output converter * * @return output from getSourceLink() * @uses Converter::getSourceLink() */ function getSourceLink(& $c) { return $c-> getSourceLink($this-> path); } } /** * represents "@example" * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage DocBlockTags * @author Greg Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @tutorial tags.example.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserExampleTag extends parserFileSourceTag { /** * always "example" * @var string */ var $keyword = 'example';
path));
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267
/** * Reads and parses the example file indicated * * The example tag takes one parameter: the full path to a php file that * should be parsed and included as an example. * * @param parserStringWithInlineTags $value tag value * @param string $current_path path of file containing * this @example tag * * @uses phpDocumentorTWordParser::getFileSource() uses to parse an example * and retrieve all tokens by line number * @todo does this "x = y = z = false" still work as expected in PHP5? * @todo CS cleanup - rename constant to TOKENIZER_EXT */ function parserExampleTag($value, $current_path) { global $_phpDocumentor_setting; parent::parserTag('example', $value); $path = false; // code thanks to Sam Blum, modified by Greg Beaver $tagValue = $value-> getString(); $path = $isAbsPath = $pathOnly = $fileName = $fileExt = $original_path = $title = false; do { // make sure the format is stuff.ext description if (!preg_match('`(.*)\.(\w*)\s(.*)`', $tagValue, $match)) { // or format is stuff.ext if (!preg_match('`(.*)\.(\w*)\s*$`', $tagValue, $match)) { // Murphy: Some funny path was given $original_path = $tagValue; // used for error output break; // try-block } } if (strlen($match[1]) === 0) { // Murphy: Some funny path was given $original_path = $tagValue; // used for error output break; // try-block } $fileExt = $match[2]; $title = 'example'; if (isset($match[3])) { $title = trim($match[3]); } // Replace windows '\' the path. $pathTmp = str_replace('\\', '/', $match[1]); // Is there a path and a file or is it just a file? if (strpos($pathTmp, '/') === false) { // No path part $pathOnly = ''; $fileName = $pathTmp .'.'. $fileExt; } else { // split the path on the last directory, find the filename $splitPos = strrpos($pathTmp, '/'); $pathOnly = substr($match[1], 0, $splitPos+1); $fileName = substr($match[1], $splitPos+1) .'.'. $fileExt; // Is the path absolute? (i.e. does it start like an absolute path?) if (('/' === $pathTmp[0]) || preg_match('`^\w*:`i', $pathTmp)) { // works for both windows 'C:' and URLs like 'http://' $isAbsPath = true; // Yes } } $original_path = $pathOnly . $fileName; // Now look for the file starting with abs. path. if ($isAbsPath) { // remove any weirdities like /../file.ext $tmp = realpath($original_path); if ($tmp && is_file($tmp)) { $path = $tmp; } // Alway break if abs. path was detected,
1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347
// even if file was not found. break; // try-block } // Search for the example file some standard places // 1) Look if the ini-var examplesdir is set and look there ... if (isset($_phpDocumentor_setting['examplesdir'])) { $tmp = realpath($_phpDocumentor_setting['examplesdir'] . PATH_DELIMITER . $original_path); if ($tmp && is_file($tmp)) { $path = $tmp; // Yo! found it :) break; // try-block } } // 2) Then try to look for an 'example/'-dir // below the *currently* parsed file ... if (!empty($current_path)) { $tmp = realpath(dirname($current_path) . PATH_DELIMITER . 'examples' . PATH_DELIMITER . $fileName); if ($tmp && is_file($tmp)) { $path = $tmp; // Yo! found it :) break; // try-block } } // 3) Then try to look for the example file // below the subdir PHPDOCUMENTOR_BASE/examples/ ... if (is_dir(PHPDOCUMENTOR_BASE . PATH_DELIMITER . 'examples')) { $tmp = realpath(PHPDOCUMENTOR_BASE . PATH_DELIMITER . 'examples' . PATH_DELIMITER . $original_path); if ($tmp && is_file($tmp)) { $path = $tmp; // Yo! found it :) break; // try-block } } $tmp = realpath(PHPDOCUMENTOR_BASE . PATH_DELIMITER . $original_path); if ($tmp && is_file($tmp)) { $path = $tmp; // Yo! found it :) break; // try-block } // If we reach this point, nothing was found and $path is false. } while (false); if (!$path) { addWarning(PDERROR_EXAMPLE_NOT_FOUND, $original_path); $this-> _title = 'example not found'; $this-> path = false; } else { $this-> _title = ($title) ? $title : 'example'; // make a unique html-filename but avoid it to get too long. $uniqueFileName = str_replace(array(':', DIRECTORY_SEPARATOR, '/'), array('_', '_', '_'), $path); $uniqueFileName = substr($uniqueFileName, -50) . '_' . md5($path); $this-> path = $uniqueFileName; $f = @fopen($path, 'r'); if ($f) { $example = fread($f, filesize($path)); if (tokenizer_ext) { $obj = new phpDocumentorTWordParser; $obj-> setup($example); $this-> source = $obj-> getFileSource(); $this-> origsource = $example; unset($obj); } else { $this-> source = $example; } } } } /** * convert the source code * * @param Converter &$c the output converter * * @return void * @uses phpDocumentor_HighlightParser highlights source code
1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396
* @uses writeSource() * @todo CS cleanup - rename to convertSource for camelCase rule * @todo what's up with all the "return" statements? * can they _all_ be removed? */ function ConvertSource(& $c) { $this-> writeSource($c, $c-> ProgramExample($this-> source, true, null, null, null, null, $this-> origsource)); return; $parser = new phpDocumentor_HighlightParser; $return = ''; $return = $parser-> parse($this-> source, $c); $this-> writeSource($c, $return); } /** * have the output converter write the source code * * @param Converter &$c the output converter * @param string $source highlighted source code * * @return void * @access private * @uses Converter::writeExample() writes final example out */ function writeSource(& $c, $source) { if ($this-> path) { $c-> writeExample($this-> _title, $this-> path, $source); } } /** * Retrieve a converter-specific link to the example * * @param Converter &$c the output converter * * @return string * @uses Converter::getExampleLink() retrieve the link to the example */ function getSourceLink(& $c) { if (!$this-> path) return $this-> _title; return $c-> getExampleLink($this-> path, $this-> _title); } } ?>
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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 142 143 144 145 146 147
define("PDERROR_CONVERTER_NOT_FOUND" , 6); /** * warning triggered when a converter is passed to * {@link phpDocumentor_IntermediateParser::addConverter()} that is not a class */ define("PDERROR_NO_CONVERTERS" , 7); /** * warning triggered when the arguments to @access are neither public nor private */ define("PDERROR_ACCESS_WRONG_PARAM" , 8); /** * warning triggered when there are multiple @access tags in a docblock */ define("PDERROR_MULTIPLE_ACCESS_TAGS" , 9); /** * warning triggered when there are multiple @return tags in a docblock */ define("PDERROR_MULTIPLE_RETURN_TAGS" , 10); /** * warning triggered when there are multiple @var tags in a docblock */ define("PDERROR_MULTIPLE_VAR_TAGS" , 11); /** * warning triggered when there are multiple @package tags in a docblock */ define("PDERROR_MULTIPLE_PACKAGE_TAGS" , 12); /** * warning triggered when there are multiple @subpackage tags in a docblock */ define("PDERROR_MULTIPLE_SUBPACKAGE_TAGS" , 13); /** * warning triggered when the package or subpackage name is illegal */ define("PDERROR_ILLEGAL_PACKAGENAME" , 14); /** * warning triggered when there a @package tag is used in a function, * define, method, var or include */ define("PDERROR_OVERRIDDEN_PACKAGE_TAGS" , 15); /** * warning triggered when there a @subpackage tag is used in a function, * define, method, var or include */ define("PDERROR_OVERRIDDEN_SUBPACKAGE_TAGS" , 16); /** * warning triggered when classes in the same package have the same name */ define("PDERROR_CLASS_CONFLICT" , 17); /** * warning triggered when classes in the same package have the same name */ define("PDERROR_UNKNOWN_TAG" , 18); /** * warning triggered when there are multiple @name tags in a docblock */ define("PDERROR_MULTIPLE_NAME_TAGS" , 19); /** * warning triggered when there are multiple @name tags in a docblock * @todo I think this description is a copy/paste that was never updated */ define("PDERROR_PACKAGEOUTPUT_DELETES_PARENT_FILE" , 20); /** * warning triggered when there are multiple @name tags in a docblock * @todo I think this description is a copy/paste that was never updated */ define("PDERROR_GLOBAL_NOT_FOUND" , 21); /** * warning triggered when there are multiple @name tags in a docblock * @todo I think this description is a copy/paste that was never updated */ define("PDERROR_MULTIPLE_GLOBAL_TAGS" , 22); /** * warning triggered when there are multiple @name tags in a docblock * @todo I think this description is a copy/paste that was never updated */ define("PDERROR_MALFORMED_GLOBAL_TAG" , 23); /** * warning triggered when an @ignore tag is used in a DocBlock preceding * a method, variable, include, or global variable */
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
define("PDERROR_IGNORE_TAG_IGNORED" , 24); /** * warning triggered when a duplicate element is encountered that will be * ignored by the documentor */ define("PDERROR_ELEMENT_IGNORED" , 25); /** * warning triggered when an entire page is ignored because of @access private */ define("PDERROR_PARSEPRIVATE" , 26); /** * warning triggered when an entire page is ignored because of @access private * @todo I think this description is a copy/paste that was never updated */ define("PDERROR_UNKNOWN_COMMANDLINE" , 27); /** * warning triggered when an entire page is ignored because of @access private * @todo I think this description is a copy/paste that was never updated */ define("PDERROR_NEED_WHITESPACE" , 28); /** * warning triggered when an entire page is ignored because of @access private * @todo I think this description is a copy/paste that was never updated */ define("PDERROR_CLASS_PARENT_NOT_FOUND" , 29); /** * warning triggered when a getClassByPackage is called and can't find the class */ define("PDERROR_CLASS_NOT_IN_PACKAGE" , 30); /** * warning triggered when a { @source } inline tag is used in a docblock not * preceding a function */ define("PDERROR_SOURCE_TAG_FUNCTION_NOT_FOUND" , 31); /** * warning triggered when a docblock template is never turned off * with /**#@-* / (no space) */ define("PDERROR_DB_TEMPLATE_UNTERMINATED" , 32); /** * warning triggered when a docblock has an unmatched <ol> or <ul> */ define("PDERROR_UNMATCHED_LIST_TAG" , 33); /** * warning triggered when another tag is nested in <b> * (not allowed in phpDocumentor) */ define("PDERROR_CANT_NEST_IN_B" , 34); /** * warning triggered when a docbook tag is not properly matched */ define("PDERROR_UNMATCHED_TUTORIAL_TAG" , 35); /** * warning triggered when an inline tag is found inside an xml tag name * in a package page */ define("PDERROR_CANT_HAVE_INLINE_IN_TAGNAME" , 36); /** * warning triggered when a tutorial is referenced * via @tutorial/{ @tutorial} and is not found */ define("PDERROR_TUTORIAL_NOT_FOUND" , 37); /** * warning triggered when a tutorial lists itself as a child tutorial */ define("PDERROR_TUTORIAL_IS_OWN_CHILD" , 38); /** * warning triggered when a tutorial's child lists the parent tutorial * as a child tutorial */ define("PDERROR_TUTORIAL_IS_OWN_GRANDPA" , 39); /** * warning triggered when a tutorial's child in the .ini file doesn't exist in the * package and subpackage of the parent */ define("PDERROR_CHILD_TUTORIAL_NOT_FOUND" , 40); /** * warning triggered when a <pdffunction:funcname /> tag is used in the PDF * Converter and no funcname is present (<pdffunction: />) */
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
define("PDERROR_PDFFUNCTION_NO_FUNC" , 41); /** * warning triggered when a <pdffunction:funcname /> tag is used in the PDF * Converter and funcname is not a {@link Cezpdf} method */ define("PDERROR_PDF_METHOD_DOESNT_EXIST" , 42); /** * warning triggered when a <pdffunction:funcname arg=$tempvar/> tag * is used in the PDF * Converter and "tempvar" is not set from the return of a previous pdffunction tag */ define("PDERROR_PDF_TEMPVAR_DOESNT_EXIST" , 43); /** * warning triggered when a subsection's title is asked for, but the subsection * is not found */ define("PDERROR_TUTORIAL_SUBSECTION_NOT_FOUND" , 44); /** * warning triggered when a subsection's title is asked for, but the subsection * is not found */ define("PDERROR_UNTERMINATED_ATTRIB" , 45); /** * warning triggered when no @package tag is used in a page-level * or class-level DocBlock */ define("PDERROR_NO_PACKAGE_TAG" , 46); /** * warning triggered when no @access private tag is used in a * global variable/method/var with _ as first char in name * and --pear was specified */ define("PDERROR_PRIVATE_ASSUMED" , 47); /** * warning triggered when an example's path from @example /path/to/example.php * is not found */ define("PDERROR_EXAMPLE_NOT_FOUND" , 48); /** * warning triggered when an example's path from @example /path/to/example.php * is not found */ define("PDERROR_NO_CONVERTER_HANDLER" , 49); /** * warning triggered when an example's path from @example /path/to/example.php * is not found */ define("PDERROR_INLINETAG_IN_SEE" , 50); /** * warning triggered when an id attribute in a tutorial docbook tag is not * an {@}id} inline tag */ define("PDERROR_ID_MUST_BE_INLINE" , 51); /** * warning triggered when an {@}internal}} tag is not closed */ define("PDERROR_INTERNAL_NOT_CLOSED" , 52); /** * warning triggered when an {@}source} tag is found in a short description */ define("PDERROR_SOURCE_TAG_IGNORED" , 53); /** * warning triggered when a child converter doesn't override * getFormattedClassTrees() */ define("PDERROR_CONVERTER_OVR_GFCT" , 54); /** * warning triggered when a package is already associated with a category, and * a new association is found */ define("PDERROR_PACKAGECAT_SET" , 55); /** * warning triggered when text in a docblock list is not contained in * an <<li>> opening tag */ define("PDERROR_TEXT_OUTSIDE_LI" , 56); /** * warning triggered when a DocBlock html tag is unclosed */ define("PDERROR_UNCLOSED_TAG" , 57);
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
/** * warning triggered by @filesource, if PHP < 4.3.0 */ define("PDERROR_TAG_NOT_HANDLED" , 58); /** * warning triggered by sourcecode="on", if PHP < 4.3.0 */ define("PDERROR_SOURCECODE_IGNORED" , 59); /** * warning triggered by an empty tag */ define("PDERROR_MALFORMED_TAG" , 60); /** * warning triggered by more than 1 @category tag */ define("PDERROR_MULTIPLE_CATEGORY_TAGS" , 61); /** * warning triggered by {@}inheritdoc} in a non-inheritable situation */ define("PDERROR_INHERITDOC_DONT_WORK_HERE" , 62); /** * warning triggered by @example path/to/example with no title */ define("PDERROR_EMPTY_EXAMPLE_TITLE" , 63); /** * warning triggered by non-existent template directory */ define("PDERROR_TEMPLATEDIR_DOESNT_EXIST" , 64); /** * warning triggered by an unterminated entity in a tutorial */ define("PDERROR_UNTERMINATED_ENTITY" , 65); /** * warning triggered by an unterminated entity in a tutorial */ define("PDERROR_BEAUTIFYING_FAILED" , 66); /** * warning triggered by a function with no name * * <pre> * function ($params) * { * } * </pre> * triggers this error */ define("PDERROR_FUNCTION_HAS_NONAME" , 67); /** * warning triggered by a page-level docblock preceding a source element * * <code> * <?php * /** * * Page-level DocBlock * * @package pagepackage * *{@*} * include 'file.php'; * </code> */ define("PDERROR_DOCBLOCK_CONFLICT" , 68); /** * warning triggered when a file does not contain a page-level docblock */ define("PDERROR_NO_PAGE_LEVELDOCBLOCK" , 69); /** * warning triggered when the first docblock in a file with a @package tag * precedes a class. In this case, the class gets the docblock. */ define("PDERROR_DOCBLOCK_GOES_CLASS" , 70); /** * warning triggered in tutorial parsing if there is a missing {@id} inline tag */ define("PDERROR_NO_DOCBOOK_ID" , 71); /** * warning triggered if someone brilliant tries "class X extends X {" */ define("PDERROR_CANNOT_EXTEND_SELF" , 72); /** * warning triggered by improper "@uses {@link blah}" */
388 define("PDERROR_DUMB_USES" , 73); 389 /** 390 * warning triggered if <<ul>> is nested inside <<ul>> and not <<li>> 391 */ 392 define("PDERROR_UL_IN_UL" , 74); 393 /** 394 * warning triggered if a command line option does not have a valid value passed in 395 */ 396 define("PDERROR_INVALID_VALUES" , 75); 397 /** 398 * warning triggered when {@}internal}} is nested inside another {@}internal}} 399 */ 400 define("PDERROR_NESTED_INTERNAL" , 76); 401 /** 402 * warning triggered when @todo is used on an include element 403 */ 404 define("PDERROR_NOTODO_INCLUDE" , 77); 405 /** 406 * warning triggered when a class or method hasn't got docblock 407 */ 408 define("PDERROR_UNDOCUMENTED_ELEMENT" , 78); 409 /** 410 * warning triggered when any of {@}property}}, {@}property-read}}, 411 * {@}property-write}}, or {@}method}} tag does not have name 412 */ 413 define("PDERROR_MISSING_PROPERTY_TAG_NAME" , 79); 414 /** 415 * warning triggered when the PHP version being used has dangerous bug/behavior 416 */ 417 define("PDERROR_DANGEROUS_PHP_BUG_EXISTS" , 80); 418 /** 419 * warning triggered when the alias value in an page-level docblock's @name tag 420 * is the same value as the target filename is it supposed to alias 421 */ 422 define("PDERROR_NAME_ALIAS_SAME_AS_TARGET" , 81); 423 /** 424 * warning triggered when the a loop recursion tripwire has been tripped 425 */ 426 define("PDERROR_LOOP_RECURSION_LIMIT_REACHED" , 82); 427 428 /** 429 * Error messages for phpDocumentor parser warnings 430 * @global array $GLOBALS['phpDocumentor_warning_descrip'] 431 * @name $phpDocumentor_warning_descrip 432 */ 433 $GLOBALS['phpDocumentor_warning_descrip'] = 434 array( 435 PDERROR_MULTIPLE_PARENT => 436 'Class %s has multiple possible parents, package inheritance aborted' 437 , 438 PDERROR_PARENT_NOT_FOUND => 439 'Class %s parent %s not found' 440 , 441 PDERROR_INHERITANCE_CONFLICT => 442 'Class %s in file %s has multiple possible parents named %s. ' . 443 'Cannot resolve name conflict,' . "\n" . 444 ' try ignoring a file that contains the conflicting parent class' 445 , 446 PDERROR_UNKNOWN_TAG => 447 'Unknown tag "@%s" used' 448 , 449 PDERROR_IGNORE_TAG_IGNORED => 450 '@ignore tag used for %s element "%s" will be ignored' 451 , 452 PDERROR_ELEMENT_IGNORED => 453 "\n" . 'duplicate %s element "%s" in file %s will be ignored.' . "\n" . 454 'Use an @ignore tag on the original ' . 455 'if you want this case to be documented.' 456 , 457 PDERROR_PARSEPRIVATE => 458 "entire page %s ignored because of @access private." . "\n" 459 "Choose -pp to enable parsing of private elements" 460 , 461 PDERROR_CLASS_PARENT_NOT_FOUND => 462 "class %s in package %s parent not found in @see parent::%s" 463 , 464 PDERROR_CLASS_NOT_IN_PACKAGE => 465 "class %s was not found in package %s"
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
, PDERROR_DB_TEMPLATE_UNTERMINATED => 'docblock template never terminated with /**#@-*/' , PDERROR_PDF_METHOD_DOESNT_EXIST => '<pdffunction:%s /> called, but pdf method "%s" doesn\'t exist' , PDERROR_TUTORIAL_NOT_FOUND => "tutorial \"%s\" not found, does it exist?" , PDERROR_CHILD_TUTORIAL_NOT_FOUND => 'child tutorial "%s" listed in %s not found ' . 'in parent package "%s" subpackage "%s"' , PDERROR_TUTORIAL_SUBSECTION_NOT_FOUND => 'tutorial %s subsection "%s" doesn\'t exist, ' . 'but its title was asked for' , PDERROR_NO_PACKAGE_TAG => 'no @package tag was used in a DocBlock for %s %s' , PDERROR_PRIVATE_ASSUMED => '%s "%s" is assumed to be @access private because its name ' 'starts with _, but has no @access tag' , PDERROR_EXAMPLE_NOT_FOUND => 'example file "%s" does not exist' , PDERROR_SOURCE_TAG_IGNORED => '{@source} can only be used in the long description, ' . 'not in the short description: "%s"' , PDERROR_PACKAGECAT_SET => 'package %s is already in category %s, ' . 'will now replace with category %s' , PDERROR_SOURCECODE_IGNORED => 'sourcecode command-line option is ignored ' . 'when your PHP build has no tokenizer support' , PDERROR_INHERITDOC_DONT_WORK_HERE => '{@inheritdoc} can only be used in the docblock of a child class' , PDERROR_EMPTY_EXAMPLE_TITLE => 'Example file found at "%s" has no title, using "%s"' , PDERROR_DOCBLOCK_CONFLICT => 'Page-level DocBlock precedes "%s %s", ' . 'use another DocBlock to document the source element' , PDERROR_NO_PAGE_LEVELDOCBLOCK => 'File "%s" has no page-level DocBlock, ' . 'use @package in the first DocBlock to create one' , PDERROR_DOCBLOCK_GOES_CLASS => 'DocBlock would be page-level, but precedes class "%s", ' . 'use another DocBlock to document the file' , PDERROR_NO_DOCBOOK_ID => 'Tutorial section %s "%s" has no id="{@id subsection}" tag ' '({@id} for refentry)' , PDERROR_BEAUTIFYING_FAILED => 'Beautifying failed: %s' , PDERROR_NOTODO_INCLUDE => '@todo on an include element is ignored (line %s, file %s)' , PDERROR_UNDOCUMENTED_ELEMENT => '%s "%s" has no %s-level DocBlock.' , PDERROR_MISSING_PROPERTY_TAG_NAME => '@%s magic tag does not have name, illegal. Ignoring tag "@%s %s %s"' , PDERROR_NAME_ALIAS_SAME_AS_TARGET => '@name value is the same as the filename it is supposed to alias' );
546 //******************************************************** 547 548 549 550 /** 551 * Error messages for phpDocumentor parser errors 552 * @global array $GLOBALS['phpDocumentor_error_descrip'] 553 * @name $phpDocumentor_error_descrip 554 */ 555 $GLOBALS['phpDocumentor_error_descrip'] = 556 array( 557 PDERROR_UNTERMINATED_INLINE_TAG => 558 'Inline tag {@%s} in tag %s is unterminated, "%s"' 559 , 560 PDERROR_CLASS_EXISTS => 561 'Class %s already exists in package "%s"' 562 , 563 PDERROR_CONVERTER_NOT_FOUND => 564 'Converter %s specified by --output command-line option is not a class' 565 , 566 PDERROR_NO_CONVERTERS => 567 'No Converters have been specified by --output command-line option' 568 , 569 PDERROR_ACCESS_WRONG_PARAM => 570 '@access was passed neither "public" nor "private." Was passed: "%s"' 571 , 572 PDERROR_MULTIPLE_ACCESS_TAGS => 573 'DocBlock has multiple @access tags, illegal. ' . 574 'ignoring additional tag "@access %s"' 575 , 576 PDERROR_MULTIPLE_RETURN_TAGS => 577 'DocBlock has multiple @return tags, illegal. ' . 578 'ignoring additional tag "@return %s %s"' 579 , 580 PDERROR_MULTIPLE_VAR_TAGS => 581 'DocBlock has multiple @var tags, illegal. ' . 582 'ignoring additional tag "@var %s %s"' 583 , 584 PDERROR_MULTIPLE_PACKAGE_TAGS => 585 'DocBlock has multiple @package tags, illegal. ' . 586 'ignoring additional tag "@package %s"' 587 , 588 PDERROR_MULTIPLE_SUBPACKAGE_TAGS => 589 'DocBlock has multiple @subpackage tags, illegal. ' . 590 'ignoring additional tag "@subpackage %s"' 591 , 592 PDERROR_ILLEGAL_PACKAGENAME => 593 '@%s tag has illegal %s name "%s"' 594 , 595 PDERROR_OVERRIDDEN_PACKAGE_TAGS => 596 '%s %s\'s DocBlock has @package tag, illegal. ' . 597 'ignoring tag "@package %s"' 598 , 599 PDERROR_OVERRIDDEN_SUBPACKAGE_TAGS => 600 '"%s" %s\'s DocBlock has @subpackage tags, illegal. ' . 601 'ignoring tag "@subpackage %s"' 602 , 603 PDERROR_CLASS_CONFLICT => 604 'class "%s" has multiple declarations in package %s, ' . 605 'in file %s and file %s, documentation will have output errors!' 606 , 607 PDERROR_MULTIPLE_NAME_TAGS => 608 'DocBlock has multiple @name tags, illegal. ' . 609 'ignoring additional tag "@name %s"' 610 , 611 PDERROR_PACKAGEOUTPUT_DELETES_PARENT_FILE => 612 '-po (packageoutput) option deletes parent file "%s" containing class' . 613 ' "%s."' . "\n" . ' Try using --defaultpackagename (-dn) %s to ' . 614 'include the parent file in the same package as the class' 615 , 616 PDERROR_GLOBAL_NOT_FOUND => 617 'global variable %s specified in @global tag was never found' 618 , 619 PDERROR_MULTIPLE_GLOBAL_TAGS => 620 '@global define tag already used for global variable "%s", ' . 621 'ignoring @global %s' 622 , 623 PDERROR_MALFORMED_GLOBAL_TAG =>
624 'incorrect @global syntax. ' . 625 'Should be @global vartype $varname or @global vartype description' 626 , 627 PDERROR_UNKNOWN_COMMANDLINE => 628 'Unknown command-line option "%s" encountered, use phpdoc -h for help' 629 , 630 PDERROR_NEED_WHITESPACE => 631 'phpDocumentor programmer error - wordparser whitespace set to false ' . 632 'in handleDocBlock, notify developers. You should never see this error' 633 , 634 PDERROR_SOURCE_TAG_FUNCTION_NOT_FOUND => 635 '{@source} tag used in a docblock that isn\'t preceding a function' 636 , 637 PDERROR_UNMATCHED_LIST_TAG => 638 'unmatched ol or ul tag in DocBlock, parsing will be incorrect' 639 , 640 PDERROR_CANT_NEST_IN_B => 641 'Can\'t nest a code, pre, ul, or ol tag in a b tag in ' . 642 'phpDocumentor DocBlock (%s tag nested)' 643 , 644 PDERROR_UNMATCHED_TUTORIAL_TAG => 645 'While parsing extended documentation, "%s" tag was matched ' . 646 'with "%s" endtag, missing endtag' ."\ntag contents:\"%s\"" 647 , 648 PDERROR_CANT_HAVE_INLINE_IN_TAGNAME => 649 'Can\'t have an inline tag inside a package page XML tag!' 650 , 651 PDERROR_TUTORIAL_IS_OWN_CHILD => 652 'Tutorial %s lists itself as its own child in %s, illegal' 653 , 654 PDERROR_TUTORIAL_IS_OWN_GRANDPA => 655 'Tutorial %s\'s child %s lists %s as its child in %s, illegal' 656 , 657 PDERROR_PDFFUNCTION_NO_FUNC => 658 'Invalid pdffunction syntax: "<pdffunction: />", ' . 659 'should be "<pdffunction:functionname [arg="value"...]/>"' 660 , 661 PDERROR_PDF_TEMPVAR_DOESNT_EXIST => 662 '<pdffunction:%s arg=%s /> called ' . 663 'but temporary variable "%s" doesn\'t exist' 664 , 665 PDERROR_UNTERMINATED_ATTRIB => 666 'Tutorial tag %s attribute %s is unterminated, current value "%s"' 667 , 668 PDERROR_NO_CONVERTER_HANDLER => 669 'Handler for element of type "%s" called, but %s is not a method of %s' 670 , 671 PDERROR_INLINETAG_IN_SEE => 672 'Inline tags are not allowed in a @see tag' 673 , 674 PDERROR_ID_MUST_BE_INLINE => 675 '<%s id="%s"> must be <%s id="{@id %s}">' 676 , 677 PDERROR_INTERNAL_NOT_CLOSED => 678 '{@internal was never terminated with }}' 679 , 680 PDERROR_CONVERTER_OVR_GFCT => 681 'Converter "%s" must override getFormattedClassTrees() but doesn\'t' 682 , 683 PDERROR_TEXT_OUTSIDE_LI => 684 'Text cannot be outside of li tag in a DocBlock list, ' . 685 'parsing will be incorrect' 686 , 687 PDERROR_UNCLOSED_TAG => 688 'Unclosed %s tag in DocBlock, parsing will be incorrect' 689 , 690 PDERROR_TAG_NOT_HANDLED => 691 '"%s" tag is not available in PHP built without tokenizer support, tag ignored' 692 , 693 PDERROR_MALFORMED_TAG => 694 '"%s" tag was used without any parameters, illegal' 695 , 696 PDERROR_MULTIPLE_CATEGORY_TAGS => 697 'package has multiple @category tags, ignoring "@category %s"' 698 , 699 PDERROR_TEMPLATEDIR_DOESNT_EXIST => 700 'template directory "%s" does not exist' 701 ,
702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781
PDERROR_UNTERMINATED_ENTITY => 'entity &%s is unterminated' , PDERROR_FUNCTION_HAS_NONAME => 'function has no name (PHP error - test your file before parsing!)' , PDERROR_CANNOT_EXTEND_SELF => 'class %s cannot extend itself - TEST YOUR CODE BEFORE PARSING' , PDERROR_DUMB_USES => '@uses can only link to string data' , PDERROR_UL_IN_UL => 'ul/ol tags cannot be directly nested inside ul/ol, nest inside li' , PDERROR_INVALID_VALUES => 'command %s was passed "%s" but must be one of %s' , PDERROR_NESTED_INTERNAL => '{@internal}} cannot be nested inside {@internal}}' , PDERROR_DANGEROUS_PHP_BUG_EXISTS => 'Dangerous PHP Bug exists in PHP version %s that can be triggered ' . 'by this parse (see PHP Bug #%s and PEAR Bug #%s)' , PDERROR_LOOP_RECURSION_LIMIT_REACHED => 'An internal loop in PhpDocumentor has reached its preset ' . 'recursion limit, preventing a possible infinite loop condition.' ); /** * encapsulates warning information * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage Errors * @author Greg Beaver <[email protected]> * @copyright 2001-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @todo CS cleanup - change package to PhpDocumentor */ class RecordWarning { /** * name of global variable that descriptors for this warning/error is kept * @var string */ var $type = 'phpDocumentor_warning_descrip'; /** * file this error occurred in * @var string */ var $file = false; /** * line number of the file this error occurred in * @var integer */ var $linenum; /** * error string * @var string */ var $data; /** * error number * @see Errors.inc * @var string */ var $num; /** * Constructor * * @param string $file filename this error occurred in ({@link $file}) * @param integer $linenum line number this error occurred on ({@link $linenum}) * @param integer $num Error number defined in {@link Errors.inc} * @param string $data... variable number of strings, up to 4, *
782 * @todo CS Cleanup - do I need to add $data to the method signature? 783 * to sprintf based on the error number 784 */ 785 function RecordWarning($file, $linenum, $num) 786 { 787 $this-> file = $file; 788 $this-> linenum = $linenum; 789 $a = array('', '', '', ''); 790 if (func_num_args()> 3) { 791 for ($i=3;$i< func_num_args();$i++) { 792 $a[$i - 3] = func_get_arg($i); 793 } 794 } 795 796 $this-> num = $num; 797 $this-> data = 798 sprintf($GLOBALS[$this-> type][$this-> num], $a[0], $a[1], $a[2], $a[3]); 799 $this-> output(); 800 } 801 802 /** 803 * prints the warning 804 * 805 * @param string $string the warning to print 806 * 807 * @return void 808 */ 809 function output($string = false) 810 { 811 if ($string) { 812 if ($this-> file) { 813 return 814 " WARNING in $this-> file on line $this-> linenum: $this> data\n" ; 815 } else { 816 return " WARNING: $this-> data\n" ; 817 } 818 } 819 if ($this-> file) { 820 phpDocumentor_out(" WARNING in $this-> file " . 821 " on line $this-> linenum: $this-> data\n" ); 822 } else { 823 phpDocumentor_out(" WARNING: $this-> data\n" ); 824 } 825 flush(); 826 } 827 } 828 829 /** 830 * encapsulates error information 831 * 832 * @category ToolsAndUtilities 833 * @package phpDocumentor 834 * @subpackage Errors 835 * @author Greg Beaver <[email protected]> 836 * @copyright 2001-2008 Gregory Beaver 837 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 838 * @version Release: @VER@ 839 * @link http://www.phpdoc.org 840 * @link http://pear.php.net/PhpDocumentor 841 * @todo CS cleanup - change package to PhpDocumentor 842 */ 843 class RecordError extends RecordWarning 844 { 845 /** 846 * name of global variable that descriptors for this warning/error is kept 847 * @var string 848 */ 849 var $type = 'phpDocumentor_error_descrip'; 850 851 /** 852 * prints the error 853 * 854 * @param string $string the error to print 855 * 856 * @return string 857 */ 858 function output($string = false) 859 { 860 if ($string) {
861 if ($this-> file) { 862 return 863 " \n\tERROR in $this-> file on line $this-> linenum: $this> data\n" 864 ; 865 } else { 866 return " \n\tERROR: $this-> data\n" ; 867 } 868 } 869 if ($this-> file) { 870 phpDocumentor_out(" \n\tERROR in $this-> file " . 871 " on line $this-> linenum: $this-> data\n" ); 872 } else { 873 phpDocumentor_out(" \n\tERROR: $this-> data\n" ); 874 } 875 flush(); 876 } 877 } 878 879 /** 880 * contains all the errors/warnings 881 * 882 * @category ToolsAndUtilities 883 * @package phpDocumentor 884 * @subpackage Errors 885 * @author Greg Beaver <[email protected]> 886 * @copyright 2001-2008 Gregory Beaver 887 * @license http://www.opensource.org/licenses/lgpl-license.php LGPL 888 * @version Release: @VER@ 889 * @link http://www.phpdoc.org 890 * @link http://pear.php.net/PhpDocumentor 891 * @todo CS cleanup - change package to PhpDocumentor 892 * @see $errors, $warnings 893 */ 894 class ErrorTracker 895 { 896 /** 897 * array of {@link RecordError}s 898 * @var array 899 */ 900 var $errors = array(); 901 /** 902 * array of {@link RecordWarning}s 903 * @var array 904 */ 905 var $warnings = array(); 906 /** 907 * @var string 908 */ 909 var $curfile = ''; 910 /** 911 * @var integer 912 */ 913 var $linenum = 0; 914 915 /** 916 * index in {@link $errors} of last error triggered 917 * @var integer|false 918 */ 919 var $lasterror = false; 920 921 /** 922 * index in {@link $warnings} of last warning triggered 923 * @var integer|false 924 */ 925 var $lastwarning = false; 926 927 /** 928 * This function subscribes to two events in the Parser 929 * in order to keep track of line number information and file name. 930 * 931 * @param integer $num parser-passed event 932 * (see {@link PHPDOCUMENTOR_EVENT_NEWLINENUM,} 933 * PHPDOCUMENTOR_EVENT_NEWFILE}) 934 * @param mixed $data either a line number if $num is 935 * PHPDOCUMENTOR_EVENT_NEWLINENUM or a file name 936 * if $num is PHPDOCUMENTOR_EVENT_NEWFILE 937 * 938 * @return void 939 */
940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019
function handleEvent($num,$data) { switch($num) { case PHPDOCUMENTOR_EVENT_NEWLINENUM : $this-> linenum = $data; break; case PHPDOCUMENTOR_EVENT_NEWFILE : $this-> linenum = 0; $this-> curfile = $data; break; case 1000000635 : // debugging phpDocumentor_out($this-> curfile . ' has ' . $this-> linenum . ' lines' . "\n" flush(); break; } } /** * add a new warning to the {@link $warnings} array * * @param integer $num error number from {@link Errors.inc} * @param string $data... up to 4 string parameters to sprintf() * into the error string for error number $num * * @return void * @todo CS Cleanup - do I need to add $data to the method signature? */ function addWarning($num) { $a = array('', '', '', ''); if (func_num_args()> 1) { for ($i=1;$i< func_num_args();$i++) { $a[$i - 1] = func_get_arg($i); } } $this-> warnings[] = new RecordWarning($this-> curfile, $this-> linenum, $num, $a[0], $a[1], $a[2], $a[3]); $this-> lastwarning = count($this-> warnings) - 1; } /** * add a new error to the {@link $errors} array * * @param integer $num error number from {@link Errors.inc} * @param string $data... up to 4 string parameters to sprintf() * into the error string for error number $num * * @return void * @todo CS Cleanup - do I need to add $data to the method signature? */ function addError($num) { $a = array('', '', '', ''); if (func_num_args()> 1) { for ($i=1;$i< func_num_args();$i++) { $a[$i - 1] = func_get_arg($i); } } $this-> errors[] = new RecordError($this-> curfile, $this-> linenum, $num, $a[0], $a[1], $a[2], $a[3]); $this-> lasterror = count($this-> errors) - 1; } /** * add a new error to the {@link $errors} array and returns the error string * * @param integer $num error number from {@link Errors.inc} * @param string $data... up to 4 string parameters to sprintf() * into the error string for error number $num * * @return void * @todo CS Cleanup - do I need to add $data to the method signature? */ function addErrorReturn($num) { $a = array('', '', '', ''); if (func_num_args()> 1) {
);
1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099
for ($i=1;$i< func_num_args();$i++) { $a[$i - 1] = func_get_arg($i); } } $this-> errors[] = new RecordError($this-> curfile, $this-> linenum, $num, $a[0], $a[1], $a[2], $a[3], false); $this-> lasterror = count($this-> errors) - 1; } /** * Get sorted array of all warnings in parsing/conversion * * @return array */ function & returnWarnings() { usort($this-> warnings, array($this, "errorsort" return $this-> warnings; }
));
/** * Get sorted array of all non-fatal errors in parsing/conversion * * @return array */ function & returnErrors() { usort($this-> errors, array($this, "errorsort" )); return $this-> errors; } /** * sort two errors * * @param RecordError|RecordWarning$a the first error/warning * @param RecordError|RecordWarning$b the second error/warning * * @return int * @access private */ function errorsort($a, $b) { if (!$a-> file) return -1; if (!$b-> file) return 1; if ($a-> file == $b-> file) { if ($a-> linenum == $b-> linenum) return 0; if ($a-> linenum < $b-> linenum) return -1; return 1; } return strnatcasecmp($a-> file, $b-> file); } /** * Get the error message of the last error * * @return string */ function returnLastError() { return $this-> errors[$this-> lasterror]-> }
output(true);
/** * Get the warning message of the last warning * * @return string */ function returnLastWarning() { return $this-> warnings[$this-> lastwarning]-> } } /** * @global ErrorTracker $GLOBALS['phpDocumentor_errors'] * @name $phpDocumentor_errors */ $GLOBALS['phpDocumentor_errors'] = new ErrorTracker; /**
output(true);
1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172
* add an Error * * @param integer $num error number from {@link Errors.inc} * @param string $data... up to 4 string parameters to sprintf() * into the error string for error number $num * * @return void * @see ErrorTracker::addError() * @todo CS Cleanup - do I need to add $data to the method signature? */ function addError($num) { global $phpDocumentor_errors; $a = array('', '', '', ''); if (func_num_args()> 1) { for ($i=1;$i< func_num_args();$i++) { $a[$i - 1] = func_get_arg($i); } } $phpDocumentor_errors-> addError($num, $a[0], $a[1], $a[2], $a[3]); } /** * like {@link addError()} but exits parsing * * @param integer $num error number from {@link Errors.inc} * @param string $data... up to 4 string parameters to sprintf() * into the error string for error number $num * * @return void * @global ErrorTracker repository for all errors generated by phpDocumentor * @see ErrorTracker::addError() * @todo CS Cleanup - do I need to add $data to the method signature? */ function addErrorDie($num) { global $phpDocumentor_errors; $a = array('', '', '', ''); if (func_num_args()> 1) { for ($i=1;$i< func_num_args();$i++) { $a[$i - 1] = func_get_arg($i); } } $phpDocumentor_errors-> addErrorReturn($num, $a[0], $a[1], $a[2], $a[3]); echo $phpDocumentor_errors-> returnLastError(); die(1); } /** * add a Warning * * @param integer $num warning number from {@link Errors.inc} * @param string $data... up to 4 string parameters to sprintf() * into the error string for error number $num * * @return void * @global ErrorTracker repository for all errors generated by phpDocumentor * @see ErrorTracker::addWarning() * @todo CS Cleanup - do I need to add $data to the method signature? */ function addWarning($num) { global $phpDocumentor_errors; $a = array('', '', '', ''); if (func_num_args()> 1) { for ($i=1;$i< func_num_args();$i++) { $a[$i - 1] = func_get_arg($i); } } $phpDocumentor_errors-> } ?> addWarning($num, $a[0], $a[1], $a[2], $a[3]);
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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 142 143 144 145 146 147
* <code> * if phpDocumentor_get_class($blah) == 'parserBlah' * </code> * always "inlinetag" * @var string */ var $type = 'inlinetag'; /** * the name of the inline tag (like link) * @var string */ var $inlinetype = ''; /** * sets up the tag * * @param string $type tag type (example: link) * @param string $value tag value (example: what to link to) */ function parserInlineTag($type, $value) { $this-> inlinetype = $type; $this-> value = trim($value); } /** * get length of the tag * * @return integer length of the tag * @todo CS cleanup - rename to strLen for camelCase rule */ function Strlen() { // fix 1203451 if (is_array($this-> value)) { return array_reduce(create_function('$a, $b', 'return $a + strlen($b);')) + count($this-> value); } return strlen($this-> value); } /** * always gets an empty string * * @return string always '', used by {@link Parser::handleDocBlock()} to * calculate the short description of a DocBlock * @see parserStringWithInlineTags::getString() * @see parserStringWithInlineTags::trimmedStrlen() */ function getString() { return ''; } } /** * represents inline links * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage InlineTags * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @see parserStringWithInlineTags * @since 1.0rc1 * @tutorial tags.inlinelink.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserLinkInlineTag extends parserInlineTag { /** * text to display in the link, can be different from the link for standard * links like websites * @var string
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
*/ var $linktext = ''; /** * sets up the tag * * @param string $link stored in $value, see {@link parserBase::$value} * @param string $text see {@link $linktext} */ function parserLinkInlineTag($link, $text) { if (strpos($link, ',')) { $link = explode(',', $link); parserInlineTag::parserInlineTag('link', ''); $this-> value = $link; } else { parserInlineTag::parserInlineTag('link', $link); } $this-> linktext = trim($text); } /** * calls the output conversion * * @param Converter &$c converter used to change the abstract link * into text for display * * @return false|stringreturns the converted link or false * if not converted successfully * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $c) { if (is_array($this-> value)) { $ret = ''; foreach ($this-> value as $text) { if (!empty($ret)) { $ret .= ', '; } $ret .= $this-> ConvertPart($c, trim($text)); } return $ret; } else { return $this-> ConvertPart($c, $this-> value); } } /** * convert part of the tag * * @param Converter &$c the output converter * @param string $value the tag value * * @return string * @todo CS cleanup - rename to convertPart for camelCase rule */ function ConvertPart(& $c, $value) { if (strpos($value, '://') || (strpos($value, 'mailto:') === 0)) { if (strpos($value, ' ')) { $value = explode(' ', $value); $link = array_shift($value); $text = join(' ', $value); } else { $link = $value; $text = $this-> linktext; } return $c-> returnLink($link, htmlspecialchars($text)); } else { $savevalue = $value; $descrip = false; if (strpos(trim($value), ' ')) { $v = preg_split('/\s/', trim($value)); if (in_array(strtolower($v[0]), array('object', 'function'))) { if (!isset($v[1]) || (isset($v[1]) && strlen($v[1]) && ! in_array($v[1]{0}, array('$','&' )) && $v[1] != '###commanana####' ) ) {
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
$vsave = $v[0]; array_shift($v); $v[0] = $vsave . ' ' . $v[0]; } } $value = $c-> getLink($v[0]); array_shift($v); $descrip = join($v, ' '); $descrip = str_replace('###commanana####', ',', $descrip); } else { $value = $c-> getLink($value); } if (is_string($value)) { // feature 564991 if (strpos($value, '://')) { // php function return $c-> returnLink($value, $descrip ? $descrip : str_replace('PHP_MANUAL#', '', $value)); } return $value; } if (!$descrip) { $descrip = $c-> type_adjust($savevalue); } if (is_object($value)) { return $c-> returnSee($value, $descrip); } return $savevalue; } } } /** * Represents inline links to external tutorial documentation * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage InlineTags * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @see parserStringWithInlineTags * @tutorial tags.inlinetutorial.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserTutorialInlineTag extends parserLinkInlineTag { /** * constructor * * @param string $link stored in $value, see {@link parserBase::$value} * @param string $text see {@link $linktext} */ function parserTutorialInlineTag($link,$text) { parserInlineTag::parserInlineTag('tutorial', $link); $this-> linktext = trim($text); } /** * convert part of the tag * * @param Converter &$c converter used to change the abstract link * into text for display * * @return mixed returns the converted link * or false if not converted successfully * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $c) { $descrip = false; if (strpos($this-> value, ',') === false) { if (strpos(trim($this-> value), ' ')) { $v = explode(' ', trim($this-> value));
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
$value = $c-> getTutorialLink($v[0]); array_shift($v); $descrip = join($v, ' '); } else { $value = $c-> getTutorialLink($this-> value); } } else { $vals = explode(',', $this-> value); $descrip = array(); foreach ($vals as $val) { $val = trim($val); if (strpos($val, ' ')) { $v = explode(' ', $val); $value[] = $c-> getTutorialLink($v[0]); array_shift($v); $descrip[] = join($v, ' '); } else { $value[] = $c-> getTutorialLink($val); $descrip[] = false; } } } if (is_string($value)) { return $value; } if (is_object($value)) { return $c-> returnSee($value, $descrip); } /* * getLink parsed a comma-delimited list of linked thingies, * add the commas back in */ if (is_array($value)) { $a = ''; foreach ($value as $i => $bub) { if (!empty($a)) { $a .= ', '; } if (is_string($value[$i])) { $a .= $value[$i]; } if (is_object($value[$i])) { $a .= $c-> returnSee($value[$i], $descrip[$i]); } } return $a; } return false; } } /** * represents inline source tag, used for function/method source * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage InlineTags * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @see parserStringWithInlineTags * @tutorial tags.inlinesource.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserSourceInlineTag extends parserInlineTag { /** * always 'source' * @var string */ var $inlinetype = 'source'; /** * First line of source code to display * @var integer * @see $end
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
*/ var $start = 1; /** * Last line to display * @var '*'|integerIf '*' then the whole source will be used, otherwise * the {@link $start} to $end line numbers will be displayed */ var $end = '*'; /** * tokenized source organized by line numbers for php 4.3.0+, the old * {@}source} tag used a string * @var string|array */ var $source = false; /**#@+ @access private */ /** @var string|false*/ var $_class; /**#@-*/ /** * constructor * * @param string $value format "start [end]", * where start and end are line numbers * with the end line number optional */ function parserSourceInlineTag($value) { parserInlineTag::parserInlineTag('source', ''); preg_match('/^([0-9]+)\W([0-9]*)$/', trim($value), $match); if (!count($match)) { preg_match('/^([0-9]+)$/', trim($value), $match); if (count($match)) { $this-> start = (int) $match[1]; } } else { $this-> start = (int) $match[1]; $this-> end = (int) $match[2]; } } /** * only used to determine blank lines. * * @return int */ function Strlen() { return 1; } /** * gets the source string * * @return string */ function getString() { return '{@source}'; } /** * sets the source tag's value * * @param string|array$source source code * @param string|bool $class class name if this is a method, * boolean in php 4.3.0, * if this is a method this will be true * * @return void */ function setSource($source, $class = false) { if (is_array($source)) { $this-> _class = $class; $this-> source = $source; } else { $source = strstr($source, 'function'); $pos = strrpos($source, '}'); $this-> source = substr($source, 0, $pos + 1); {@}source} will not be blank, probably
468 } 469 } 470 471 /** 472 * convert the tag 473 * 474 * @param Converter &$c the output converter object 475 * 476 * @return string 477 * @uses stringConvert() in PHP 4.2.3-, this method is used to convert 478 * @uses arrayConvert() in PHP 4.3.0+, this method is used to convert 479 * @todo CS cleanup - rename to convert for camelCase rule 480 */ 481 function Convert(& $c) 482 { 483 if (is_string($this-> source)) { 484 return $this-> stringConvert($c); 485 } 486 return $this-> arrayConvert($c); 487 } 488 489 /** 490 * converter helper used in PHP 4.3.0+ 491 * 492 * @param Converter &$c the output converter object 493 * 494 * @return string 495 * @uses phpDocumentor_HighlightParser Parses the tokenized source 496 */ 497 function arrayConvert(& $c) 498 { 499 $source = $this-> source; 500 if ($this-> end != '*') { 501 $source = array_slice($this-> source, 0, $this-> end + $this-> start - 1); 502 } 503 $start = $this-> start - 1; 504 if ($start < 0) { 505 $start = 0; 506 } 507 return $c-> ProgramExample($source, true, true, $this-> _class, $start); 508 } 509 510 /** 511 * converter helper used in PHP 4.2.3512 * 513 * @param Converter &$c the output converter object 514 * 515 * @return string 516 * @uses Converter::unmangle() remove the extraneous stuff from 517 * {@link highlight_string()} 518 * @deprecated in favor of PHP 4.3.0+ {@link arrayConvert()} 519 */ 520 function stringConvert(& $c) 521 { 522 $source = highlight_string('<?php ' . $this-> source . ' ?>' , true); 523 $source = '<code>' . substr($source, strlen('<code><font color="#000000"> 524 <font color="#0000CC"><?php </font>' ) - 1); 525 $source = str_replace('} </font><font color="#0000CC">?></font>' , 526 '}</font></code>' , $source); 527 if ($this-> start || ($this-> end != '*')) { 528 $source = explode('<br />' , $source); 529 $start = $this-> start; 530 if ($this-> end != '*') { 531 $source = array_slice($source, $start - 1, $this-> end - $start + 1); 532 } else { 533 $source = array_slice($source, $start - 1); 534 } 535 $source = implode($source, '<br />' ); 536 if ($start > 0) { 537 $source = " <code> $source" ; 538 } 539 if ($this-> end != '*') { 540 $source = " $source</code> " ; 541 } 542 } 543 $source = $c-> unmangle($source, $this-> source); 544 return $source; 545 }
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625
} /** * Represents the example inline tag, used to display an example file * inside a docblock or tutorial * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage InlineTags * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @see parserStringWithInlineTags * @tutorial tags.inlineexample.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserExampleInlineTag extends parserSourceInlineTag { /** * constructor * * @param string $value format "filepath[ start [end]]" * where start and end are line numbers * with the end line number optional * @param string $current_path full path to the current file, * used to check relative directory locations * @param bool $isTutorial if true, then this is in a tutorial * * @return mixed * @todo replace tokenizer_ext constant with TOKENIZER_EXT for CS rule */ function parserExampleInlineTag($value, $current_path, $isTutorial = false) { global $_phpDocumentor_setting; parserInlineTag::parserInlineTag('example', ''); $path = false; $tagValue = trim($value); $path = $isAbsPath = $pathOnly = $fileName = $fileExt = $original_path = $title = false; do { // make sure the format is stuff.ext startline[ endline] if (!preg_match('`(.*)\.(\w*)\s(.*)`', $tagValue, $match)) { // or format is stuff.ext if (!preg_match('`(.*)\.(\w*)\s*$`', $tagValue, $match)) { // Murphy: Some funny path was given $original_path = $tagValue; // used for error output break; // try-block } } if (strlen($match[1]) === 0) { // Murphy: Some funny path was given $original_path = $tagValue; // used for error output break; // try-block } $fileExt = $match[2]; if (isset($match[3])) { $lines = explode(' ', trim($match[3])); $this-> start = (int) $lines[0]; if (isset($lines[1])) { $this-> end = (int) $lines[1]; } } // Replace windows '\' the path. $pathTmp = str_replace('\\', '/', $match[1]); // Is there a path and a file or is it just a file? if (strpos($pathTmp, '/') === false) { // No path part $pathOnly = ''; $fileName = $pathTmp .'.'. $fileExt; } else { // split the path on the last directory, find the filename $splitPos = strrpos($pathTmp, '/'); $pathOnly = substr($match[1], 0, $splitPos+1); $fileName = substr($match[1], $splitPos+1) .'.'. $fileExt;
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705
// Is the path absolute? (i.e. does it start like an absolute path?) if (('/' === $pathTmp[0]) || preg_match('`^\w*:`i', $pathTmp)) { // works for both windows 'C:' and URLs like 'http://' $isAbsPath = true; // Yes } } $original_path = $pathOnly . $fileName; // Now look for the file starting with abs. path. if ($isAbsPath) { // remove any weirdities like /../file.ext $tmp = realpath($original_path); if ($tmp && is_file($tmp)) { $path = $tmp; } /* * Alway break if abs. path was detected, * even if file was not found. */ break; // try-block } // Search for the example file some standard places // 1) Look if the ini-var examplesdir is set and look there ... if (isset($_phpDocumentor_setting['examplesdir'])) { $tmp = realpath($_phpDocumentor_setting['examplesdir'] . PATH_DELIMITER . $original_path); if ($tmp && is_file($tmp)) { $path = $tmp; // Yo! found it :) break; // try-block } } // 2) Then try to look for an 'example/'-dir // below the *currently* parsed file ... if (!empty($current_path)) { $tmp = realpath(dirname($current_path) . PATH_DELIMITER . 'examples' . PATH_DELIMITER . $fileName); if ($tmp && is_file($tmp)) { $path = $tmp; // Yo! found it :) break; // try-block } } // 3) Then try to look for the example file // below the subdir PHPDOCUMENTOR_BASE/examples/ ... if (is_dir(PHPDOCUMENTOR_BASE . PATH_DELIMITER . 'examples')) { $tmp = realpath(PHPDOCUMENTOR_BASE . PATH_DELIMITER . 'examples' . PATH_DELIMITER . $original_path); if ($tmp && is_file($tmp)) { $path = $tmp; // Yo! found it :) break; // try-block } } $tmp = realpath(PHPDOCUMENTOR_BASE . PATH_DELIMITER . $original_path); if ($tmp && is_file($tmp)) { $path = $tmp; // Yo! found it :) break; // try-block } // If we reach this point, nothing was found and $path is false. } while (false); if (!$path) { addWarning(PDERROR_EXAMPLE_NOT_FOUND, $original_path); $this-> path = false; } else { $f = @fopen($path, 'r'); if ($f) { $example = fread($f, filesize($path)); if (tokenizer_ext && ! $isTutorial) { $obj = new phpDocumentorTWordParser; $obj-> setup($example); $this-> setSource($obj-> getFileSource()); unset($obj); } else { $this-> setSource($example); } }
706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785
} } /** * sets the source * * @param string|array$source source code * @param string|bool $class class name if this is a method, * boolean in php 4.3.0, * if this is a method this will be true * * @return void */ function setSource($source, $class = false) { $this-> _class = $class; $this-> source = $source; } /** * converter helper for PHP 4.3.0+ * * @param Converter &$c output converter * * @return string * @uses phpDocumentor_HighlightParser Parses the tokenized source */ function arrayConvert(& $c) { $source = $this-> source; if ($this-> end != '*') { $source = array_slice($this-> source, 0, $this-> end + $this-> start - 1); } $start = $this-> start - 1; if ($start < 0) { $start = 0; } return $c-> exampleProgramExample($source, true, true, $this-> _class, $start); } /** * Return the source for the example file, enclosed in * a <programlisting> tag to use in a tutorial * * @return string */ function getProgramListing() { $source = explode("\n" , $this-> source); $start = $this-> start; if ($this-> end != '*') { $source = array_slice($source, $start - 1, $this-> } else { $source = array_slice($source, $start - 1); } $source = join("\n" , $source); return "<programlisting role=\"php\"> <![CDATA[\n" . $source . "\n]]>\n</programlisting>" ; } } /** * Represents the inheritdoc inline tag, used by classes/methods/vars to inherit * documentation from the parent class if possible * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage InlineTags * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @see parserStringWithInlineTags * @tutorial tags.inlineinheritdoc.pkg
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865
* @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserInheritdocInlineTag extends parserInlineTag { /** * always 'inheritdoc' * @var string */ var $inlinetype = 'inheritdoc'; /** * Does nothing, overrides parent constructor */ function parserInheritdocInlineTag() { } /** * only sets a warning and returns empty * * @return string * @todo CS cleanup - rename to convert for camelCase rule */ function Convert() { addWarning(PDERROR_INHERITDOC_DONT_WORK_HERE); return ''; } } /** * Represents the inline {@}id} tag for tutorials * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage InlineTags * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @see parserStringWithInlineTags * @tutorial tags.inlineid.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserIdInlineTag extends parserInlineTag { /** * always 'id' * @var string */ var $inlinetype = 'id'; /** * package of the {@}id} * @var string */ var $package = 'default'; /** * category of the {@}id} * @var string */ var $category = 'default'; /** * subpackage of the {@}id} * @var string */ var $subpackage = ''; /** * full name of the tutorial * @var string */ var $tutorial; /** * section/subsection name * @var string */
866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945
var $id; /** * constructor * * @param string $category category name * @param string $package package name * @param string $subpackage subpackage name * @param string $tutorial tutorial name * @param string $id section/subsection name */ function parserIdInlineTag($category,$package,$subpackage,$tutorial,$id = false) { $this-> package = $package; $this-> subpackage = $subpackage; $this-> tutorial = $tutorial; $this-> id = $id; $this-> category = $category; } /** * converter * * @param Converter &$c output converter * * @return string * @uses Converter::getTutorialId() retrieve converter-specific ID * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $c) { if (!$this-> id) { return ''; } return $c-> getTutorialId($this-> package, $this-> subpackage, $this-> tutorial, $this-> id, $this-> category); } } /** * Represents {@}toc} for table of contents generation in tutorials * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage InlineTags * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @filesource * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @see parserStringWithInlineTags * @tutorial tags.inlinetoc.pkg * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class parserTocInlineTag extends parserInlineTag { /** * always 'toc' * @var string */ var $inlinetype = 'toc'; /** * @var array format: * <pre> * array( * array( * 'tagname' => section, * 'link' => returnsee link, * 'id' => anchor name, * 'title' => from title tag * ), * ... * ) * </pre> * @access private */ var $_toc = false;
946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025
/** * full path to tutorial, used in conversion * @var string * @access private */ var $_path = false; /** * constructor */ function parserTocInlineTag() { parent::parserInlineTag('toc', ''); } /** * set the TOC * * @param array $toc format: * <pre> * array( * array( * 'tag' => {@link parserXMLDocBookTag}, * 'id' => {@link parserIdInlineTag}, * 'title' => {@link parserXMLDocBookTag title} * ), * ... * ) * </pre> * * @return void */ function setTOC($toc) { $this-> toc = $toc; } /** * set the path * * @param string $path the path * * @return void */ function setPath($path) { $this-> _path = $path; } /** * converter method * * <pre> * array( * 'tagname' => string name of tag, * 'link' => {@link tutorialLink} to the tutorial, * 'id' => converter specific tutorial ID from * {@link Converter::getTutorialId()} * 'title' => title of the tutorial) * </pre> * and returns the results as the table of contents * * @param Converter &$c converter object * * @return mixed * @uses Converter::getTutorialId() retrieve the tutorial ID for * @uses Converter::formatTutorialTOC() passes an array of format: * @todo CS cleanup - rename to convert for camelCase rule */ function Convert(& $c) { $newtoc = array(); if (isset($this-> toc) && is_array($this-> toc)) { foreach ($this-> toc as $i => $toc) { if (isset($toc['title'])) { $toc['tag']-> setTitle($toc['title']); } else { $toc['tag']-> setTitle(new parserStringWithInlineTags); } $newtoc[$i]['tagname'] = $toc['tag']-> name;
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044
$l = new tutorialLink; if (!isset($toc['title'])) { $title = 'section '.$toc['id']-> id; } else { $title = $toc['title']-> Convert($c); } $l-> addLink($toc['id']-> id, $this-> _path, basename($this-> _path), $toc['id']-> package, $toc['id']-> subpackage, strip_tags($title)); $newtoc[$i]['link'] = $c-> returnSee($l); $newtoc[$i]['id'] = $c-> getTutorialId($toc['id']-> package, $toc['id']-> subpackage, basename($this-> _path), $toc['id']-> id, $toc['id']-> category); $newtoc[$i]['title'] = $title; } } return $c-> } } ?> formatTutorialTOC($newtoc);
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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 142 143 144 145 146 147
* phpdoc alias _phpdoc_inc for phpdoc.inc */ var $fileAlias = ''; /** * element type linked to. * can only be a documentable element */ var $type = ''; var $name = ''; var $category = ''; var $package = ''; var $subpackage = ''; /**#@-*/ /** * sets up the link * * @param string $path full path to file containing element * @param string $fileAlias page name, as configured by {@link Parser::parse} * @param string $name element name * @param string $package package element is in * @param string $subpackage subpackage element is in * @param string $category optional category that documentation is in * * @return void */ function addLink($path, $fileAlias, $name, $package, $subpackage, $category = false) { $this-> path = $path; $this-> fileAlias = $fileAlias; $this-> name = $name; $this-> category = $category; $this-> package = $package; $this-> subpackage = $subpackage; } } /** * procedural page link * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage Links * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class pageLink extends abstractLink { /** * @var string */ var $type = 'page'; } /** * function link * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage Links * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class functionLink extends abstractLink { /** * @var string
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
*/ var $type = 'function'; } /** * define link * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage Links * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class defineLink extends abstractLink { /** * @var string */ var $type = 'define'; } /** * global variable link * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage Links * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class globalLink extends abstractLink { /** * @var string */ var $type = 'global'; } /** * class link * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage Links * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class classLink extends abstractLink { /** * @var string */ var $type = 'class'; } /** * method link * * @category * @package * @subpackage * @author
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
* @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class methodLink extends abstractLink { /** * @var string */ var $type = 'method'; /** * @var string */ var $class = ''; /** * sets up the link * * @param string $class class name * @param string $path full path to file containing element * @param string $fileAlias page name, as configured by {@link Parser::parse} * @param string $name element name * @param string $package package element is in * @param string $subpackage subpackage element is in * @param string $category optional category that documentation is in * * @return void */ function addLink($class, $path , $fileAlias, $name, $package, $subpackage, $category = false) { $this-> class = $class; abstractLink::addLink($path, $fileAlias, $name, $package, $subpackage, $category); } } /** * class variable link * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage Links * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class varLink extends methodLink { /** * @var string */ var $type = 'var'; } /** * class constant link * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage Links * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class constLink extends methodLink
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361
{ /** * @var string */ var $type = 'const'; } /** * tutorial link * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage Links * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change classname to PhpDocumentor_* */ class tutorialLink extends abstractLink { /**#@+ * @var string */ var $type = 'tutorial'; var $section = ''; var $title = false; /**#@-*/ /** * sets up the link * * @param string $section section/subsection name * @param string $path full path to file containing element * @param string $name page name, as configured by {@link Parser::parse} * @param string $package package element is in * @param string $subpackage subpackage element is in * @param string $title title of tutorial * @param string $category optional category that documentation is in * * @return void */ function addLink($section, $path, $name, $package, $subpackage, $title = false, $category = false) { $this-> section = $section; $this-> title = $title; parent::addLink($path, '', $name, $package, $subpackage, $category); } } ?>
65 if ($this-> apiVersion() != '1.0') { 66 return $this-> raiseError('API version must be 1.0'); 67 } 68 /** 69 * Split the document into tokens 70 * using the XML_Tokenizer 71 */ 72 require_once dirname(__FILE__) . '/Tokenizer.php'; 73 $tokenizer = new phpDocumentor_XML_Beautifier_Tokenizer(); 74 75 $tokens = $tokenizer-> tokenize( $file, true ); 76 77 if (PEAR::isError($tokens)) { 78 return $tokens; 79 } 80 81 include_once dirname(__FILE__) . '/Plain.php'; 82 $renderer = new PHPDoc_XML_Beautifier_Renderer_Plain($this-> 83 84 $xml = $renderer-> serialize($tokens); 85 86 if ($newFile == null) { 87 return $xml; 88 } 89 90 $fp = @fopen($newFile, "w" ); 91 if (!$fp) { 92 return PEAR::raiseError("Could not write to output file" XML_BEAUTIFIER_ERROR_NO_OUTPUT_FILE); 93 } 94 95 flock($fp, LOCK_EX); 96 fwrite($fp, $xml); 97 flock($fp, LOCK_UN); 98 fclose($fp); 99 return true; } 100 101 /** 102 * format an XML string 103 * 104 * @access public 105 * @param string $string XML 106 * @return string formatted XML string 107 * @throws PEAR_Error 108 */ 109 function formatString($string, $renderer = "Plain" ) 110 { 111 if ($this-> apiVersion() != '1.0') { 112 return $this-> raiseError('API version must be 1.0'); 113 } 114 /** 115 * Split the document into tokens 116 * using the XML_Tokenizer 117 */ 118 require_once dirname(__FILE__) . '/Tokenizer.php'; 119 $tokenizer = new phpDocumentor_XML_Beautifier_Tokenizer(); 120 121 $tokens = $tokenizer-> tokenize( $string, false ); 122 123 if (PEAR::isError($tokens)) { 124 return $tokens; 125 } 126 127 include_once dirname(__FILE__) . '/Plain.php'; 128 $renderer = new PHPDoc_XML_Beautifier_Renderer_Plain($this-> 129 130 $xml = $renderer-> serialize($tokens); 131 132 return $xml; 133 } 134 } 135 ?>
_options);
_options);
68 PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE => 'attrHandler', 69 PHPDOC_XMLTOKEN_EVENT_OPENTAG => 'tagHandler', 70 PHPDOC_XMLTOKEN_EVENT_IN_CDATA => 'realcdataHandler', 71 PHPDOC_XMLTOKEN_EVENT_DEF => 'defHandler', 72 PHPDOC_XMLTOKEN_EVENT_CLOSETAG => 'closetagHandler', 73 PHPDOC_XMLTOKEN_EVENT_ENTITY => 'entityHandler', 74 PHPDOC_XMLTOKEN_EVENT_COMMENT => 'commentHandler', 75 PHPDOC_XMLTOKEN_EVENT_SINGLEQUOTE => 'stringHandler', 76 PHPDOC_XMLTOKEN_EVENT_DOUBLEQUOTE => 'stringHandler', 77 PHPDOC_XMLTOKEN_EVENT_CDATA => 'parseCdataHandler', 78 ); 79 80 /** 81 * Parse a new file 82 * 83 * The parse() method is a do...while() loop that retrieves tokens one by 84 * one from the {@link $_event_stack}, and uses the token event array set up 85 * by the class constructor to call event handlers. 86 * 87 * The event handlers each process the tokens passed to them, and use the 88 * {@link _addoutput()} method to append the processed tokens to the 89 * {@link $_line} variable. The word parser calls {@link newLineNum()} 90 * every time a line is reached. 91 * 92 * In addition, the event handlers use special linking functions 93 * {@link _link()} and its cousins (_classlink(), etc.) to create in-code 94 * hyperlinks to the documentation for source code elements that are in the 95 * source code. 96 * 97 * @uses setupStates() initialize parser state variables 98 * @uses configWordParser() pass $parse_data to prepare retrieval of tokens 99 * @param string 100 * @param Converter 101 * @param false|stringfull path to file with @filesource tag, if this 102 * is a @filesource parse 103 * @param false|integerstarting line number from {@}source linenum} 104 * @staticvar integer used for recursion limiting if a handler for 105 * an event is not found 106 * @return bool 107 */ 108 function parseString ($parse_data) 109 { 110 static $endrecur = 0; 111 $parse_data = str_replace(array("\r\n" , "\t" ), array("\n" , ' '), $parse_data); 112 $this-> setupStates($parse_data); 113 114 $this-> configWordParser(PHPDOC_XMLTOKEN_EVENT_NOEVENTS); 115 // initialize variables so E_ALL error_reporting doesn't complain 116 $pevent = 0; 117 $word = 0; 118 $this-> _curthing = ''; 119 120 do 121 { 122 $lpevent = $pevent; 123 $pevent = $this-> _event_stack-> getEvent(); 124 if ($lpevent != $pevent) 125 { 126 $this-> _last_pevent = $lpevent; 127 $this-> configWordParser($pevent); 128 } 129 $this-> _wp-> setWhitespace(true); 130 131 $dbg_linenum = $this-> _wp-> linenum; 132 $dbg_pos = $this-> _wp-> getPos(); 133 $this-> _pv_last_word = $word; 134 $this-> _pv_curline = $this-> _wp-> linenum; 135 $word = $this-> _wp-> getWord(); 136 137 if (PHPDOCUMENTOR_DEBUG == true) 138 { 139 echo "LAST: " ; 140 echo "|" . $this-> _pv_last_word; 141 echo "|\n" ; 142 echo "PEVENT: " . $this-> getParserEventName($pevent) . "\n" ; 143 echo "LASTPEVENT: " . $this-> getParserEventName($this> _last_pevent) . "\n" ; 144 // echo "LINE: ".$this->_line."\n";
145 // 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 reached" 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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
echo "OUTPUT: ".$this->_output."\n"; echo $dbg_linenum.'-'.$dbg_pos . ": " echo '|'.htmlspecialchars($word); echo "|\n" ; echo "-------------------\n\n\n" flush();
; ;
} if (isset($this-> eventHandlers[$pevent])) { $handle = $this-> eventHandlers[$pevent]; $this-> $handle($word, $pevent); } else { echo ('WARNING: possible error, no handler for event number '.$pevent); if ($endrecur++ == 25) { return $this-> raiseError("FATAL ERROR, recursion limit ); } } } while (!($word === false)); return true; } /**#@+ * Event Handlers * * All Event Handlers use {@link checkEventPush()} and * {@link checkEventPop()} to set up the event stack and parser state. * @access private * @param string|array token value * @param integer parser event from {@link Parser.inc} */ /** * Most tokens only need highlighting, and this method handles them */ function normalHandler($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _wp-> backupPos($word); $this-> _addoutput($pevent); $this-> _curthing = ''; return; } $this-> _curthing .= $word; if ($this-> $this-> $this-> } } /** * handle <!-- comments --> */ function commentHandler($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _wp-> backupPos($word); return; } $this-> _curthing .= $word; if ($this-> checkEventPop($word, $pevent)) { $this-> _addoutput($pevent); $this-> _curthing = ''; } } /** * handle <?Processor instructions?> */ function parsePiHandler($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _wp-> backupPos($word); return; } if ($this-> checkEventPop($word, $pevent)) { $this-> _addoutput($pevent); checkEventPop($word, $pevent)) { _addoutput($pevent); _curthing = '';
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
} if (!strlen($this-> _curthing)) { $this-> _curthing .= str_replace('<?' , '', $word); } else { if (!isset($this-> _attrs) || !is_string($this-> _attrs)) { $this-> _attrs = ''; } $this-> _attrs .= $word; } } /** * handle <?xml Processor instructions?> */ function parseXMLHandler($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _wp-> backupPos($word); return; } $this-> _curthing .= $word; if ($this-> checkEventPop($word, $pevent)) { $this-> _addoutput($pevent); $this-> _curthing = ''; } } /** * handle <![CDATA[ unescaped text ]]> */ function realcdataHandler($word, $pevent) { $this-> _curthing .= $word; if ($this-> checkEventPop($word, $pevent)) { $this-> _addoutput($pevent); $this-> _curthing = ''; } } /** * handle <tags> */ function tagHandler($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _wp-> backupPos($word); $this-> _curthing = ''; return; } if ($word{0} == '<' ) { $this-> _tag = substr($word, 1); } if ($this-> checkEventPop($word, $pevent)) { $this-> _addoutput($pevent); $this-> _tag = null; $this-> _attrs = null; if ($word == '>' ) { $this-> _event_stack-> pushEvent(PHPDOC_XMLTOKEN_EVENT_CDATA); return; } } } /** * handle </tags> */ function closetagHandler($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _wp-> backupPos($word); return; } if ($this-> checkEventPop($word, $pevent)) { $this-> _addoutput($pevent);
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383
_tag = trim(str_replace('</'
/** * handle <!def> */ function defHandler($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _wp-> backupPos($word); return; } $this-> _curthing .= $word; if ($this-> checkEventPop($word, $pevent)) { $this-> _addoutput($pevent); $this-> _curthing = ''; } } /** * Most tokens only need highlighting, and this method handles them */ function attrHandler($word, $pevent) { if ($e = $this-> checkEventPush($word, $pevent)) { return; } if (!isset($this-> _attrs) || !is_array($this-> _attrs)) { $this-> _attrs = array(); } if (strpos($word, '=')) { $this-> _attrs[$this-> _attr = trim(str_replace('=', '', $word))] = ''; } if ($this-> checkEventPop($word, $pevent)) { $this-> _wp-> backupPos($word); return; } } /** * handle attribute values */ function stringHandler($word, $pevent) { if ($this-> checkEventPop($word, $pevent)) { return; } $this-> _attrs[$this-> _attr] = $word; } /** * handle &entities; */ function entityHandler($word, $pevent) { if ($this-> checkEventPop($word, $pevent)) { $this-> _addoutput($pevent); $this-> _curthing = ''; return; } if (strlen($word) && $word{0} == '&' $word = substr($word, 1); } $this-> _curthing .= $word; } /** * handle tag contents */ function parseCdataHandler($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _wp-> backupPos($word); if (strlen($this-> _curthing)) { $this-> _addoutput($pevent); }
) {
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463
$this-> return;
_curthing = '';
} if ($this-> checkEventPop($word, $pevent)) { if (strlen($this-> _curthing)) { $this-> _addoutput($pevent); } $this-> _curthing = ''; $this-> _event_stack-> pushEvent(PHPDOC_XMLTOKEN_EVENT_CLOSETAG); return; } $this-> _curthing .= $word; } /**#@-*/ /** * Handler for real character data * * @access protected * @param object XML parser object * @param string CDATA * @return void */ function incdataHandler($parser, $cdata) { if ((string)$cdata === '') { return true; } $struct = array( "type" "data" "depth" ); => => => PHPDOC_BEAUTIFIER_CDATA, $cdata, $this-> _depth
//
// //
//
$this-> _appendToParent($struct); } /**#@+ * Output Methods * @access private */ /** * This method adds output to {@link $_line} * * If a string with variables like "$test this" is present, then special * handling is used to allow processing of the variable in context. * @see _flush_save() */ function _addoutput($event) { $type = array( PHPDOC_XMLTOKEN_EVENT_NOEVENTS => '_handleXMLDefault', PHPDOC_XMLTOKEN_EVENT_CLOSETAG => 'endHandler', PHPDOC_XMLTOKEN_EVENT_ENTITY => 'entityrefHandler', PHPDOC_XMLTOKEN_EVENT_DEF => '_handleXMLDefault', PHPDOC_XMLTOKEN_EVENT_PI => 'parsePiHandler', PHPDOC_XMLTOKEN_EVENT_XML => '_handleXMLDefault', PHPDOC_XMLTOKEN_EVENT_OPENTAG => 'startHandler', PHPDOC_XMLTOKEN_EVENT_COMMENT => '_handleXMLDefault', PHPDOC_XMLTOKEN_EVENT_CDATA => 'cdataHandler', PHPDOC_XMLTOKEN_EVENT_IN_CDATA => 'incdataHandler', ); $method = $type[$event]; switch ($event) { case PHPDOC_XMLTOKEN_EVENT_COMMENT : echo "comment: $this->_curthing\n"; $this-> $method(false, $this-> _curthing); break; case PHPDOC_XMLTOKEN_EVENT_OPENTAG : echo "open tag: $this->_tag\n"; var_dump($this->_attrs); $this-> $method(false, $this-> _tag, $this-> _attrs); break; case PHPDOC_XMLTOKEN_EVENT_CLOSETAG : echo "close tag: $this->_tag\n"; $this-> $method(false, $this-> _curthing); break; case PHPDOC_XMLTOKEN_EVENT_NOEVENTS :
464 if (!strlen($this-> _curthing)) { 465 return; 466 } 467 // echo "default: $this->_curthing\n"; 468 $this-> $method(false, $this-> _curthing); 469 break; 470 case PHPDOC_XMLTOKEN_EVENT_DEF : 471 // echo "<!definition: $this->_curthing\n"; 472 $this-> $method(false, $this-> _curthing); 473 break; 474 case PHPDOC_XMLTOKEN_EVENT_PI : 475 // echo "<?pi: $this->_curthing\n"; 476 // echo "<?pi attrs: $this->_attrs\n"; 477 $this-> $method(false, $this-> _curthing, $this-> _attrs); 478 break; 479 case PHPDOC_XMLTOKEN_EVENT_XML : 480 // echo "<?xml: $this->_curthing\n"; 481 $this-> $method(false, $this-> _curthing, $this-> _attrs); 482 break; 483 case PHPDOC_XMLTOKEN_EVENT_CDATA : 484 case PHPDOC_XMLTOKEN_EVENT_IN_CDATA : 485 // echo "cdata: $this->_curthing\n"; 486 $this-> $method(false, $this-> _curthing); 487 break; 488 case PHPDOC_XMLTOKEN_EVENT_ENTITY : 489 // echo "entity: $this->_curthing\n"; 490 $this-> $method(false, $this-> _curthing, false, false, false); 491 break; 492 } 493 } 494 /**#@-*/ 495 496 /** 497 * tell the parser's WordParser {@link $wp} to set up tokens to parse words by. 498 * tokens are word separators. In English, a space or punctuation are examples of tokens. 499 * In PHP, a token can be a ;, a parenthesis, or even the word "function" 500 * @param $value integer an event number 501 * @see WordParser 502 */ 503 504 function configWordParser($e) 505 { 506 $this-> _wp-> setSeperator($this-> tokens[($e + 100)]); 507 } 508 /** 509 * this function checks whether parameter $word is a token for pushing a new event onto the Event Stack. 510 * @return mixed returns false, or the event number 511 */ 512 513 function checkEventPush($word,$pevent) 514 { 515 $e = false; 516 if (isset($this-> pushEvent[$pevent])) 517 { 518 if (isset($this-> pushEvent[$pevent][strtolower($word)])) 519 $e = $this-> pushEvent[$pevent][strtolower($word)]; 520 } 521 if ($e) 522 { 523 $this-> _event_stack-> pushEvent($e); 524 return $e; 525 } else { 526 return false; 527 } 528 } 529 530 /** 531 * this function checks whether parameter $word is a token for popping the current event off of the Event Stack. 532 * @return mixed returns false, or the event number popped off of the stack 533 */ 534 535 function checkEventPop($word,$pevent) 536 { 537 if (!isset($this-> popEvent[$pevent])) return false; 538 if (in_array(strtolower($word),$this-> popEvent[$pevent])) 539 { 540 return $this-> _event_stack-> popEvent(); 541 } else {
542 return false; 543 } 544 } 545 546 /** 547 * Initialize all parser state variables 548 * @param boolean true if we are highlighting an inline {@}source} tag's 549 * output 550 * @param false|stringname of class we are going to start from 551 * @uses $_wp sets to a new {@link phpDocumentor_HighlightWordParser} 552 */ 553 function setupStates($parsedata) 554 { 555 $this-> _output = ''; 556 $this-> _line = ''; 557 unset($this-> _wp); 558 $this-> _wp = new WordParser; 559 $this-> _wp-> setup($parsedata); 560 $this-> _event_stack = @(new EventStack); 561 $this-> _event_stack-> popEvent(); 562 $this-> _event_stack-> pushEvent(PHPDOC_XMLTOKEN_EVENT_NOEVENTS); 563 $this-> _pv_linenum = null; 564 $this-> _pv_next_word = false; 565 } 566 567 /** 568 * Initialize the {@link $tokenpushEvent, $wordpushEvent} arrays 569 */ 570 function phpDocumentor_XML_Beautifier_Tokenizer() 571 { 572 $this-> tokens[STATE_XMLTOKEN_CDATA] = 573 $this-> tokens[STATE_XMLTOKEN_NOEVENTS] = array('<?xml' , '<!--' , '<![CDATA[' , '<!' , '</' , '<?' , '<' );//, '&'); 574 $this-> tokens[STATE_XMLTOKEN_OPENTAG] = array("\n" ,"\t" ," " , '>' , '/>' ); 575 $this-> tokens[STATE_XMLTOKEN_XML] = 576 $this-> tokens[STATE_XMLTOKEN_PI] = array("\n" ,"\t" ," " , '?>' ); 577 $this-> tokens[STATE_XMLTOKEN_IN_CDATA] = array(']]>' ); 578 $this-> tokens[STATE_XMLTOKEN_CLOSETAG] = array("\n" ,'>' ); 579 $this-> tokens[STATE_XMLTOKEN_COMMENT] = array("\n" ,'-->' ); 580 $this-> tokens[STATE_XMLTOKEN_DEF] = array("\n" ,']>' ,'>' ); 581 $this-> tokens[STATE_XMLTOKEN_ENTITY] = array("\n" ,';'); 582 $this-> tokens[STATE_XMLTOKEN_ATTRIBUTE] = array("\n" ,'"' ,"'" ,'>' ,'/>' ); 583 $this-> tokens[STATE_XMLTOKEN_DOUBLEQUOTE] = array("\n" ,'"' ); 584 $this-> tokens[STATE_XMLTOKEN_SINGLEQUOTE] = array("\n" ,"'" ); 585 /**************************************************************/ 586 587 $this-> pushEvent[PHPDOC_XMLTOKEN_EVENT_NOEVENTS] = 588 array( 589 '<' => PHPDOC_XMLTOKEN_EVENT_OPENTAG, 590 '<?' => PHPDOC_XMLTOKEN_EVENT_PI, 591 '<?xml' => PHPDOC_XMLTOKEN_EVENT_XML, 592 '</' => PHPDOC_XMLTOKEN_EVENT_CLOSETAG, 593 // '&' => PHPDOC_XMLTOKEN_EVENT_ENTITY, 594 '<![cdata[' => PHPDOC_XMLTOKEN_EVENT_IN_CDATA, 595 '<!--' => PHPDOC_XMLTOKEN_EVENT_COMMENT, 596 '<!' => PHPDOC_XMLTOKEN_EVENT_DEF, 597 ); 598 /**************************************************************/ 599 600 $this-> pushEvent[PHPDOC_XMLTOKEN_EVENT_OPENTAG] = 601 array( 602 " " => PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE, 603 "\n" => PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE, 604 ); 605 /**************************************************************/ 606 607 $this-> pushEvent[PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE] = 608 array( 609 "'" => PHPDOC_XMLTOKEN_EVENT_SINGLEQUOTE, 610 '"' => PHPDOC_XMLTOKEN_EVENT_DOUBLEQUOTE, 611 ); 612 /**************************************************************/ 613 614 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_IN_CDATA] = array(']]>' ); 615 /**************************************************************/ 616
617 $this-> pushEvent[PHPDOC_XMLTOKEN_EVENT_CDATA] = 618 array( 619 '<' => PHPDOC_XMLTOKEN_EVENT_OPENTAG, 620 '<?' => PHPDOC_XMLTOKEN_EVENT_PI, 621 // '&' => PHPDOC_XMLTOKEN_EVENT_ENTITY, 622 '<!--' => PHPDOC_XMLTOKEN_EVENT_COMMENT, 623 '<!' => PHPDOC_XMLTOKEN_EVENT_DEF, 624 '<![cdata[' => PHPDOC_XMLTOKEN_EVENT_IN_CDATA, 625 ); 626 /**************************************************************/ 627 628 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_XML] = 629 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_PI] = array('?>' ); 630 /**************************************************************/ 631 632 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_ENTITY] = array(';'); 633 /**************************************************************/ 634 635 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_SINGLEQUOTE] = array("'" ); 636 /**************************************************************/ 637 638 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_DOUBLEQUOTE] = array('"' ); 639 /**************************************************************/ 640 641 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_OPENTAG] = array('>' , '/>' ); 642 /**************************************************************/ 643 644 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_CLOSETAG] = array('>' ); 645 /**************************************************************/ 646 647 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_COMMENT] = array('-->' ); 648 /**************************************************************/ 649 650 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_DEF] = array('>' ,']>' ); 651 /**************************************************************/ 652 653 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE] = array('>' ,'/>' ); 654 /**************************************************************/ 655 656 $this-> popEvent[PHPDOC_XMLTOKEN_EVENT_CDATA] = 657 array('</' ); 658 /**************************************************************/ 659 } 660 661 function getParserEventName ($value) 662 { 663 $lookup = array( 664 PHPDOC_XMLTOKEN_EVENT_NOEVENTS => "PHPDOC_XMLTOKEN_EVENT_NOEVENTS" , 665 PHPDOC_XMLTOKEN_EVENT_PI => "PHPDOC_XMLTOKEN_EVENT_PI" 666 PHPDOC_XMLTOKEN_EVENT_OPENTAG => "PHPDOC_XMLTOKEN_EVENT_OPENTAG" , 667 PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE => "PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE" , 668 PHPDOC_XMLTOKEN_EVENT_CLOSETAG => "PHPDOC_XMLTOKEN_EVENT_CLOSETAG" , 669 PHPDOC_XMLTOKEN_EVENT_ENTITY => "PHPDOC_XMLTOKEN_EVENT_ENTITY" 670 PHPDOC_XMLTOKEN_EVENT_COMMENT => "PHPDOC_XMLTOKEN_EVENT_COMMENT" , 671 PHPDOC_XMLTOKEN_EVENT_SINGLEQUOTE => "PHPDOC_XMLTOKEN_EVENT_SINGLEQUOTE" , 672 PHPDOC_XMLTOKEN_EVENT_DOUBLEQUOTE => "PHPDOC_XMLTOKEN_EVENT_DOUBLEQUOTE" , 673 PHPDOC_XMLTOKEN_EVENT_CDATA => 'PHPDOC_XMLTOKEN_EVENT_CDATA', 674 PHPDOC_XMLTOKEN_EVENT_DEF => 'PHPDOC_XMLTOKEN_EVENT_DEF', 675 PHPDOC_XMLTOKEN_EVENT_XML => 'PHPDOC_XMLTOKEN_EVENT_XML', 676 PHPDOC_XMLTOKEN_EVENT_IN_CDATA => 'PHPDOC_XMLTOKEN_EVENT_IN_CDATA', 677 ); 678 if (isset($lookup[$value])) 679 return $lookup[$value]; 680 else return $value; 681 } 682 } 683 684 685 /** starting state */ 686 define("PHPDOC_XMLTOKEN_EVENT_NOEVENTS" , 1); 687 /** currently in starting state */ 688 define("STATE_XMLTOKEN_NOEVENTS" , 101); 689
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752
/** used when a processor instruction is found */ define("PHPDOC_XMLTOKEN_EVENT_PI" , /** currently in processor instruction */ define("STATE_XMLTOKEN_PI" , 102); /** used when an open <tag> is found */ define("PHPDOC_XMLTOKEN_EVENT_OPENTAG" /** currently parsing an open <tag> */ define("STATE_XMLTOKEN_OPENTAG"
2);
, , 103); ,
3);
/** used when a <tag attr="attribute"> is found */ define("PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE" /** currently parsing an open <tag> */ define("STATE_XMLTOKEN_ATTRIBUTE" , /** used when a close </tag> is found */ define("PHPDOC_XMLTOKEN_EVENT_CLOSETAG" /** currently parsing a close </tag> */ define("STATE_XMLTOKEN_CLOSETAG" /** used when an &entity; is found */ define("PHPDOC_XMLTOKEN_EVENT_ENTITY" /** currently parsing an &entity; */ define("STATE_XMLTOKEN_ENTITY"
4);
104); , 5);
105); , 6);
/** used when a <!-- comment --> is found */ define("PHPDOC_XMLTOKEN_EVENT_COMMENT" /** currently parsing a <!-- comment --> */ define("STATE_XMLTOKEN_COMMENT" , /** used when a <!-- comment --> is found */ define("PHPDOC_XMLTOKEN_EVENT_SINGLEQUOTE" /** currently parsing a <!-- comment --> */ define("STATE_XMLTOKEN_SINGLEQUOTE" /** used when a <!-- comment --> is found */ define("PHPDOC_XMLTOKEN_EVENT_DOUBLEQUOTE" /** currently parsing a <!-- comment --> */ define("STATE_XMLTOKEN_DOUBLEQUOTE" /** used when a <! is found */ define("PHPDOC_XMLTOKEN_EVENT_DEF" /** currently parsing a <! */ define("STATE_XMLTOKEN_DEF" /** used when a <! is found */ define("PHPDOC_XMLTOKEN_EVENT_CDATA" /** currently parsing a <! */ define("STATE_XMLTOKEN_CDATA" /** used when a <?xml is found */ define("PHPDOC_XMLTOKEN_EVENT_XML" /** currently parsing a <?xml */ define("STATE_XMLTOKEN_XML"
112);
/** used when a <![CDATA[ section is found */ define('PHPDOC_XMLTOKEN_EVENT_IN_CDATA', 13); /** currently parsing a <![CDATA[ ]]> */ define('STATE_XMLTOKEN_IN_CDATA', 113); /** do not remove, needed in plain renderer */ define('PHPDOC_BEAUTIFIER_CDATA', 100000); ?>
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 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 142 143 144 145 146 147
*/ class phpDocumentor_HighlightWordParser extends phpDocumentorTWordParser { /** * Hash used to keep track of line numbers that have already been initialized * @var array * @access private */ var $_listLineNums = array(); /** * Initialize the parser object * * @param array &$input the input * @param phpDocumentor_HighlightParser &$parser the parser * * @return void */ function setup(& $input, & $parser) { $this-> _parser = & $parser; $this-> data = & $input; $this-> _all = $input; $this-> _sourceline = 0; $this-> pos = 0; $this-> linenum = 0; } /** * debugging function * * @return void * @access private */ function printState() { $linenum = $this-> linenum; $pos = $this-> pos; if (!isset($this-> _all[$this-> linenum][$this-> pos])) { $linenum++; $pos = 0; } $details = ''; $token = $this-> _all[$linenum][$pos]; if (is_array($token)) { $details = token_name($token[0]); $token = htmlspecialchars($token[1]); } else { $token = htmlspecialchars($token); } debug('Next Token ' . $this-> linenum . '-' . $this-> pos . ':' . $details); var_dump($token); } /** * Retrieve the position of the next token that will be parsed * in the internal token array * * @return array format: array(line number, position) */ function nextToken() { $linenum = $this-> linenum; $pos = $this-> pos; if (!isset($this-> _all[$this-> linenum][$this-> pos])) { $linenum++; $pos = 0; } if (!isset($this-> _all[$linenum][$pos])) { return false; } return array($linenum, $pos); } /** * Retrieve the next token * * @return array|stringeither array(PHP token constant, token) or string * non-specific separator */ function getWord()
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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
{ if (!isset($this-> _all[$this-> linenum][$this-> pos])) { $this-> linenum++; $this-> pos = 0; if (!isset($this-> _all[$this-> linenum])) { return false; } $this-> _parser-> newLineNum(); return $this-> getWord(); } $word = $this-> _all[$this-> linenum][$this-> pos++]; return str_replace("\t" , ' ', $word); } /** * back the word parser to the previous token as defined by $last_token * * @param array|string$last_token token, or output from {@link nextToken()} * @param bool $is_pos if true, backupPos interprets $last_token * to be the position in the internal token * array of the last token * * @return void */ function backupPos($last_token, $is_pos = false) { if (!$last_token) { return; } if ($is_pos) { $this-> linenum = $last_token[0]; $this-> pos = $last_token[1]; return; } if ($last_token === false) { return; } //fancy_debug('before', $this->linenum, $this->pos, // token_name($this->_all[$this->linenum][$this->pos][0]), // htmlentities($this->_all[$this->linenum][$this->pos][1]), // $this->_all[$this->linenum]); do { $this-> pos--; if ($this-> pos < 0) { $this-> linenum--; if ($this-> linenum < 0) { var_dump($last_token); break; } $this-> pos = count($this-> _all[$this-> linenum]) - 1; } } while (!$this-> tokenEquals($last_token, str_replace("\t" $this-> _all[$this-> linenum][$this-> pos]))); //fancy_debug('after', $this->linenum, $this->pos, // token_name($this->_all[$this->linenum][$this->pos][0]), // htmlentities($this->_all[$this->linenum][$this->pos][1])); } } /** * Highlights source code using {@link parse()} * * @category ToolsAndUtilities * @package phpDocumentor * @subpackage Parsers * @author Gregory Beaver <[email protected]> * @copyright 2002-2008 Gregory Beaver * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version Release: @VER@ * @link http://www.phpdoc.org * @link http://pear.php.net/PhpDocumentor * @since 1.2.0beta3 * @todo CS cleanup - change package to PhpDocumentor * @todo CS cleanup - change class name to PhpDocumentor_* */ class phpDocumentor_HighlightParser extends phpDocumentorTParser {
, '
',
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
/**#@+ * @access private */ /** * Highlighted source is built up in this string * @var string */ var $_output; /** * contents of the current source code line as it is parsed * @var string */ var $_line; /** * Used to retrieve highlighted tokens * @var Converter a descendant of Converter */ var $_converter; /** * Path to file being highlighted, if this is from a @filesource tag * @var false|stringfull path */ var $_filesourcepath; /** * @var array */ var $eventHandlers = array( PARSER_EVENT_ARRAY PARSER_EVENT_CLASS PARSER_EVENT_COMMENT PARSER_EVENT_DOCBLOCK_TEMPLATE PARSER_EVENT_END_DOCBLOCK_TEMPLATE PARSER_EVENT_LOGICBLOCK PARSER_EVENT_METHOD_LOGICBLOCK PARSER_EVENT_NOEVENTS PARSER_EVENT_OUTPHP PARSER_EVENT_CLASS_MEMBER PARSER_EVENT_DEFINE PARSER_EVENT_DEFINE_PARAMS PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS PARSER_EVENT_DOCBLOCK PARSER_EVENT_TAGS PARSER_EVENT_DESC PARSER_EVENT_DOCKEYWORD PARSER_EVENT_DOCKEYWORD_EMAIL PARSER_EVENT_EOFQUOTE PARSER_EVENT_FUNCTION PARSER_EVENT_METHOD PARSER_EVENT_FUNCTION_PARAMS PARSER_EVENT_FUNC_GLOBAL PARSER_EVENT_INLINE_DOCKEYWORD PARSER_EVENT_INCLUDE PARSER_EVENT_INCLUDE_PARAMS PARSER_EVENT_QUOTE PARSER_EVENT_QUOTE_VAR PARSER_EVENT_PHPCODE PARSER_EVENT_SINGLEQUOTE PARSER_EVENT_STATIC_VAR PARSER_EVENT_STATIC_VAR_VALUE PARSER_EVENT_VAR );
=> => => => => => => => => => => => => => => => => => => => => => => => => => => => => => => => => =>
'defaultHandler', 'handleClass', 'handleComment', 'handleDocBlockTemplate', 'handleEndDocBlockTemplate', 'handleLogicBlock', 'handleMethodLogicBlock', 'defaultHandler', 'defaultHandler', 'handleClassMember', 'defaultHandler', 'defaultHandler', 'defaultHandler', 'defaultHandler', 'handleDocBlock', 'handleTags', 'handleDesc', 'handleTag', 'handleDockeywordEmail', 'handleQuote', 'handleFunction', 'handleMethod', 'handleFunctionParams', 'handleFuncGlobal', 'handleInlineDockeyword', 'defaultHandler', 'defaultHandler', 'handleQuote', 'handleQuoteVar', 'handlePhpCode', 'handleSingleQuote', 'defaultHandler', 'defaultHandler', 'handleVar',
/** * event handlers for @tags * @tutorial tags.pkg */ var $tagHandlers = array( '*' => 'defaultTagHandler', 'abstract' => 'coreTagHandler', 'access' => 'coreTagHandler', 'author' => 'coreTagHandler', 'category' => 'coreTagHandler', 'copyright' => 'coreTagHandler', 'deprecated' => 'coreTagHandler',
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
'example' 'filesource' 'final' 'global' 'ignore' 'license' 'link' 'name' 'package' 'param' 'parameter' 'see' 'since' 'subpackage' 'internal' 'return' 'static' 'staticvar' 'throws' 'todo' 'tutorial' 'uses' 'var' 'version' 'property' 'property-read' 'property-write' 'method' ); /**#@-*/
=> => => => => => => => => => => => => => => => => => => => => => => => => => => =>
'coreTagHandler', 'coreTagHandler', 'coreTagHandler', 'globalTagHandler', 'coreTagHandler', 'coreTagHandler', 'coreTagHandler', 'coreTagHandler', 'coreTagHandler', 'paramTagHandler', 'paramTagHandler', 'coreTagHandler', 'coreTagHandler', 'coreTagHandler', 'coreTagHandler', 'returnTagHandler', 'coreTagHandler', 'staticvarTagHandler', 'coreTagHandler', 'coreTagHandler', 'coreTagHandler', 'coreTagHandler', 'varTagHandler', 'coreTagHandler', 'propertyTagHandler', 'propertyTagHandler', 'propertyTagHandler', 'propertyTagHandler'
/** * wraps the current line (via the converter) and resets it to empty * * @return void * @uses Converter::SourceLine() encloses {@link $_line} in a * converter-specific format */ function newLineNum() { if ($this-> _pf_no_output_yet) { return; } $this-> _flush_save(); $this-> _line .= $this-> _converter-> flushHighlightCache(); $this-> _output .= $this-> _converter-> SourceLine($this-> _wp-> $this-> _line, $this-> _path); $this-> _line = ''; } /** * Start the parsing at a certain line number * * @param int $num line number * * @return void */ function setLineNum($num) { $this-> _wp-> linenum = $num; } /** * Parse a new file * * The parse() method is a do...while() loop that retrieves tokens one by * one from the {@link $_event_stack}, and uses the token event array set up * by the class constructor to call event handlers. * * The event handlers each process the tokens passed to them, and use the * {@link _addoutput()} method to append the processed tokens to the * {@link $_line} variable. The word parser calls {@link newLineNum()} * every time a line is reached. * * In addition, the event handlers use special linking functions * {@link _link()} and its cousins (_classlink(), etc.) to create in-code * hyperlinks to the documentation for source code elements that are in the * source code. * * @param array &$parse_data the parse data
linenum,
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 >pos); 464 465 466
* @param Converter &$converter the converter object * @param bool $inlinesourceparse whether this data is from an * inline {@}source} tag * @param string|false $class if a string, it is the name of the * class whose method we are parsing * containing a {@}source} tag * @param false|integer$linenum starting line number from * {@}source linenum} * @param false|string $filesourcepath full path to file with @filesource * tag, if this is a @filesource parse * * @staticvar int used for recursion limiting if a handler for * an event is not found * @return bool * @uses setupStates() initialize parser state variables * @uses configWordParser() pass $parse_data to prepare retrieval of tokens * @todo CS cleanup - rename tokenizer_ext constant to uppercase */ function parse (& $parse_data, & $converter, $inlinesourceparse = false, $class = false, $linenum = false, $filesourcepath = false) { if (!tokenizer_ext) { if (is_array($parse_data)) { $parse_data = join($parse_data, ''); } $parse_data = explode("\n" , $parse_data); $this-> _output = ''; foreach ($parse_data as $linenum => $line) { if ($linenum > 0) { $this-> _output .= $converter-> SourceLine($linenum, $line, $filesourcepath); } } return $converter-> PreserveWhiteSpace($this-> _output); } static $endrecur = 0; $this-> _converter = & $converter; $converter-> startHighlight(); $this-> _path = $filesourcepath; $this-> setupStates($inlinesourceparse, $class); $this-> configWordParser($parse_data); if ($linenum !== false) { $this-> setLineNum($linenum); } // initialize variables so E_ALL error_reporting doesn't complain $pevent = 0; $word = 0; do { $lpevent = $pevent; $pevent = $this-> _event_stack-> getEvent(); if ($lpevent != $pevent) { $this-> _last_pevent = $lpevent; } if ($pevent == PARSER_EVENT_CLASS_MEMBER) { $this-> _wp-> setWhitespace(true); } else { $this-> _wp-> setWhitespace(false); } if (!is_array($word)) { $lw = $word; } if (is_array($word) && $word[0] != T_WHITESPACE) { $lw = $word; } $dbg_linenum = $this-> _wp-> linenum; $dbg_pos = $this-> _wp-> getPos(); $word = $this-> _wp-> getWord(); if (is_array($word) && ( $word[0] == T_WHITESPACE || $word[0] == T_COMMENT) && $pevent != PARSER_EVENT_CLASS_MEMBER ) { //debug("added " . $this->_wp->linenum . '-' . $this->_wp$this-> _addoutput($word); continue; } else {
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 "\n" 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
$this-> _pv_last_word = $lw; } if ($pevent != PARSER_EVENT_DOCBLOCK) { $this-> _pv_last_next_word = $this-> _pv_next_word; $this-> _pv_next_word = $this-> _wp-> nextToken(); } // in wordparser, have to keep track of lines //$this->publishEvent(PHPDOCUMENTOR_EVENT_NEWLINENUM, // $this->_wp->linenum); if (PHPDOCUMENTOR_DEBUG == true) { echo "LAST: " ; if (is_array($this-> _pv_last_word)) { echo token_name($this-> _pv_last_word[0]) . ' => |' . htmlspecialchars($this-> _pv_last_word[1]); } else { echo "|" . $this-> _pv_last_word; } echo "|\n" ; echo "PEVENT: " . $this-> getParserEventName($pevent) . ; echo "LASTPEVENT: " . $this-> getParserEventName($this-> _last_pevent) . "\n" ; //echo "LINE: " . $this->_line . "\n"; //echo "OUTPUT: " . $this->_output . "\n"; echo $dbg_linenum . '-' . $dbg_pos . ": " ; if (is_array($word)) { echo token_name($word[0]) . ' => |' . htmlspecialchars($word[1]); } else { echo '|'.htmlspecialchars($word); } echo "|\n" ; $this-> _wp-> printState(); echo "NEXT TOKEN: " ; $tok1 = $this-> _pv_next_word; $tok = $this-> _wp-> _all[$tok1[0]][$tok1[1]]; if (is_array($tok)) { echo token_name($tok[0]) . ' => ' . $tok1[0] . '-' . $tok1[1] . '|' . htmlspecialchars($tok[1]); } else { echo "|" . $tok; } echo "|\n" ; echo "-------------------\n\n\n" ; flush(); } if ($word !== false && isset( $this-> eventHandlers[$pevent])) { $handle = $this-> eventHandlers[$pevent]; $this-> $handle($word, $pevent); } elseif ($word !== false) { debug('WARNING: possible error, no handler for event number ' . $pevent); if ($endrecur++ == 25) { die("FATAL ERROR, recursion limit reached" ); } } } while (!($word === false)); if (strlen($this-> _line)) { $this-> newLineNum(); } return $this-> _output; } /**#@+ * Event Handlers * * All Event Handlers use {@link checkEventPush()} and * {@link checkEventPop()} to set up the event stack and parser state. * * @param string|array $word token value * @param int $pevent parser event from {@link Parser.inc} * * @return void * @access private */ /** * Most tokens only need highlighting, and this method handles them */ function defaultHandler($word, $pevent) {
546 $this-> _addoutput($word); 547 if ($this-> checkEventPush($word, $pevent)) { 548 return; 549 } 550 $this-> checkEventPop($word, $pevent); 551 } 552 553 /** 554 * Handles global declarations in a function, like: 555 * 556 * <code> 557 * function foobar() 558 * { 559 * global $_phpDocumentor_setting; 560 * } 561 * </code> 562 * 563 * @uses _globallink() instead of _addoutput(), to link to global variables 564 * if they are used in a function 565 */ 566 function handleFuncGlobal($word, $pevent) 567 { 568 if ($this-> checkEventPush($word, $pevent)) { 569 return; 570 } 571 $this-> _globallink($word); 572 $this-> checkEventPop($word, $pevent); 573 } 574 575 /** 576 * Handles strings in quotation marks and heredoc 577 * 578 * Special handling is needed for strings that contain variables like: 579 * 580 * <code>$a = "$test string"</code> 581 * 582 * The tokenizer parses out tokens '"',array(T_VARIABLE,'$test'),' string', 583 * and '"'. Since it is possible to have $this->classvar in a string, 584 * we save a variable name just in case the next token is -> to allow linking 585 * to class members. Otherwise, the string is simply highlighted. 586 * 587 * constant strings (with no $variables in them) are passed as a single 588 * entity, and so will be saved in the last token parsed. This means the 589 * event handler must tell the word parser to re-retrieve the current token 590 * so that the correct event handler can process it. 591 */ 592 function handleQuote($word, $pevent) 593 { 594 if ($this-> _pf_inmethod && is_array($word) && $word[0] == T_VARIABLE) { 595 $this-> _pv_lastvar = $word; 596 } 597 if ($this-> checkEventPush($word, $pevent)) { 598 $this-> _addoutput($word); 599 return; 600 } 601 if ($this-> _pf_quote_active && 602 (($this-> _pv_last_word == '"' && 603 $this-> _last_pevent != PARSER_EVENT_QUOTE) || 604 (is_array($this-> _pv_last_word) && 605 $this-> _pv_last_word[0] == T_END_HEREDOC && 606 $this-> _last_pevent != PARSER_EVENT_EOFQUOTE)) 607 ) { 608 $this-> _pf_quote_active = false; 609 $this-> _wp-> backupPos($word); 610 $this-> _event_stack-> popEvent(); 611 return; 612 } 613 if (!$this-> _pf_quote_active && 614 (($this-> _pv_last_word == '"' && 615 $this-> _last_pevent != PARSER_EVENT_QUOTE) || 616 (is_array($this-> _pv_last_word) && 617 $this-> _pv_last_word[0] == T_END_HEREDOC && 618 $this-> _last_pevent != PARSER_EVENT_EOFQUOTE)) 619 ) { 620 if (is_array($word) && $word[0] == T_VARIABLE) { 621 $this-> _pv_lastvar = $word; 622 } 623 $this-> _pf_quote_active = true; 624 $this-> _save_highlight_state = $this-> _converter-> getHighlightState();
625 $this-> _converter-> startHighlight(); 626 $this-> _addoutput($word); 627 $this-> checkEventPop($word, $pevent); 628 return; 629 } elseif (is_array($this-> _pv_last_word) && 630 $this-> _pv_last_word[0] == T_CONSTANT_ENCAPSED_STRING 631 ) { 632 //$this->_pv_quote_data = $this->_pv_last_word[1]; 633 $this-> _event_stack-> popEvent(); 634 $this-> _wp-> backupPos($word); 635 return; 636 } 637 if ($this-> checkEventPop($word, $pevent)) { 638 $this-> _pf_quote_active = false; 639 } 640 $this-> _addoutput($word); 641 } 642 643 /** 644 * Handles {$variable} within a "quote" 645 * 646 * This is a simple handler, for a very complex 647 * array of legal syntax. It is legal to nest control structures 648 * inside the {}, and other weird stuff. 649 */ 650 function handleQuoteVar($word, $pevent) 651 { 652 if ($this-> checkEventPop($word, $pevent)) { 653 $this-> _pf_quote_active = true; 654 $this-> _addoutput($word); 655 return; 656 } 657 if ($this-> _pf_inmethod && is_array($word) && $word[0] == T_VARIABLE) { 658 $this-> _pv_lastvar = $word; 659 } 660 if ($this-> checkEventPush($word, $pevent)) { 661 $this-> _pf_quote_active = false; 662 if (is_string($word) && ( $word == '{' || $word == '"' || $word == "'" ) 663 ) { 664 $this-> _pf_quote_active = true; 665 $this-> _pv_lastvar = false; 666 } 667 } 668 $this-> _addoutput($word); 669 } 670 671 /** 672 * Handles define() statements 673 * 674 * The only thing this handler cares about is retrieving the name of the 675 * define variable, and the end of the define statement, so after the name 676 * is found, it simply makes sure parentheses are matched as in this case: 677 * 678 * <code> 679 * define("test",array("hello",6 => 4, 5 => array('there'))); 680 * </code> 681 * 682 * This handler and the DEFINE_PARAMS_PARENTHESIS handler (which is just 683 * {@link defaultHandler()} in this version, as nothing fancy is needed) 684 * work together to ensure proper parenthesis matching. 685 * 686 * If the define variable is documented, a link will be created to its 687 * documentation using the Converter passed. 688 */ 689 function handleDefine($word, $pevent) 690 { 691 static $token_save; 692 if (!isset($token_save)) { 693 $token_save = array(); 694 } 695 $e = $this-> checkEventPush($word, $pevent); 696 if ($e && $e != PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS) { 697 return; 698 } 699 700 if (!isset($this-> _pv_define_params_data)) { 701 $this-> _pv_define_params_data = ''; 702 }
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 T_STRING)
if ($this-> checkEventPop($word, $pevent)) { unset($token_save); $this-> _addoutput($word); } if ($this-> _pf_definename_isset) { $this-> _addoutput($word); } else { if ($word != "," ) { $token_save[] = $word; if (is_array($word)) { $word = $word[1]; } $this-> _pv_define_params_data .= $word; } else { if (substr($this-> _pv_define_params_data, 0, 1) == substr($this-> _pv_define_params_data, strlen($this-> _pv_define_params_data) - 1) && in_array(substr($this-> _pv_define_params_data, 0, 1), array('"' , "'" )) ) { // remove leading and ending quotation marks // if there are only two $a = substr($this-> _pv_define_params_data, 0, 1); $b = substr($this-> _pv_define_params_data, 1, strlen($this-> _pv_define_params_data) - 2); if (strpos($b, $a) === false) { $this-> _pv_define_params_data = $b; } } $this-> _pf_definename_isset = true; $link = $this-> _converter-> getLink($this-> _pv_define_params_data); foreach ($token_save as $token) { if (is_object($link)) { if (is_array($token)) { $token = $token[1]; } $this-> _addoutput($this-> _converter-> returnSee($link, $token)); } else { $this-> _addoutput($save, $token); } } $this-> _pv_define_params_data = ''; } } } /** * Handles normal global code. Special consideration is taken for DocBlocks * as they need to retrieve the whole DocBlock before doing any output, so * the parser flag {@link $_pf_no_output_yet} is set to tell * {@link _addoutput()} not to spit anything out yet. * * @uses _link() make any global code that is a documentable element link * to the php manual or its documentation */ function handlePhpCode($word, $pevent) { $test = $this-> checkEventPush($word, $pevent); if ($test == PARSER_EVENT_DOCBLOCK || $test == PARSER_EVENT_COMMENT) { if (substr($word[1], 0, 2) == '/*' && strpos($word[1], '*/')) { $this-> _pv_last_word = $word; if ($word[1] == '/**#@-*/') { $this-> _pf_docblock_template = true; } else { $this-> _pf_docblock = true; } return $this-> handleDocBlock($word, PARSER_EVENT_DOCBLOCK); } $this-> _pf_no_output_yet = true; $this-> _pv_saveline = $this-> _wp-> linenum + 1; return; } if (is_array($word) && $word[0] == T_DOUBLE_COLON) { $this-> _pf_colon_colon = true; } if (!$this-> _pf_colon_colon && is_array($word) && $word[0] == {
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861
$this-> _pv_last_string = $word; } $this-> _link($word); $this-> checkEventPop($word, $pevent); } /** * Handle the function declaration header * * This handler only sees the "function name" portion of the function * declaration. Handling of the function parameters is by * {@link handleFunctionParams()}, and the function body is handled by * {@link handleLogicBlock()} */ function handleFunction($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _addoutput($word); return; } if ($this-> checkEventPop($word, $pevent)) { return; } $this-> _link($word); } /** * Handle the method declaration header * * This handler only sees the "function name" portion of the method * declaration. Handling of the method parameters is by * {@link handleFunctionParams()}, and the method body is handled by * {@link handleMethodLogicBlock()} */ function handleMethod($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _addoutput($word); return; } if ($this-> checkEventPop($word, $pevent)) { if ($word == ';') { $this-> _addoutput($word); } return; } $this-> _methodlink($word); } /** * Handler for the stuff between ( and ) in a function declaration * * <code> * function handles($only,$these,$parameters){...} * </code> */ function handleFunctionParams($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _addoutput($word); return; } $this-> _addoutput($word); $this-> checkEventPop($word, $pevent); } /** * Handler for function body. * * The function body is checked for php functions, documented constants, * functions, and indirectly for global statements. It hyperlinks to the * documentation for detected elements is created. Everything else is * highlighted normally. */ function handleLogicBlock($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _addoutput($word); return; }
862 863 864 865 T_STRING) 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 T_STRING) 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939
if (is_array($word) && $word[0] == T_DOUBLE_COLON) { $this-> _pf_colon_colon = true; } if (!$this-> _pf_colon_colon && is_array($word) && { $this-> _pv_last_string = $word; } $this-> _link($word); if ($this-> checkEventPop($word, $pevent)) { $e = $this-> _event_stack-> popEvent(); $this-> _event_stack-> pushEvent($e); if ($e == PARSER_EVENT_FUNCTION) { $this-> _wp-> backupPos($word); } } }
$word[0] ==
/** * Handler for method body. * * Like functions, the method body is checked for php functions, documented * constants, functions, and indirectly for global statements. It also * checks for "$this->XXXX" where XXXX is a class variable or method, and * links to the documentation for detected elements is created. Everything * else is highlighted normally. */ function handleMethodLogicBlock($word, $pevent) { if (isset($this-> _pv_prev_var_type)) { //debug('prevtype is set'); if (!is_array($word)) { unset($this-> _pv_prev_var_type); } else { if ($word[0] != T_WHITESPACE && $word[0] != T_STRING && $word[0] != T_OBJECT_OPERATOR ) { //fancy_debug('unset', $word); unset($this-> _pv_prev_var_type); } } } $this-> _pf_inmethod = true; if ($e = $this-> checkEventPush($word, $pevent)) { $this-> _addoutput($word); if ($e == PARSER_EVENT_CLASS_MEMBER) { $this-> _pf_no_output_yet = true; } return; } if (is_array($word) && $word[0] == T_DOUBLE_COLON) { $this-> _pf_colon_colon = true; } if (!$this-> _pf_colon_colon && is_array($word) && $word[0] == { $this-> _pv_last_string = $word; } if (is_array($word) && $word[0] == T_VARIABLE) { $this-> _pv_lastvar = $word; } $this-> _link($word); if ($this-> checkEventPop($word, $pevent)) { $this-> _pf_inmethod = false; $e = $this-> _event_stack-> popEvent(); $this-> _event_stack-> pushEvent($e); if ($e == PARSER_EVENT_METHOD) { $this-> _wp-> backupPos($word); } } } /** * Handles $obj->classmember in a method body * * This handler is responsible for linking to the documentation of a * class member when it is used directly in a method body. * * There are two methods of determining whether to link: * - $this->member * - $this->member->submember *
940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019
* The first case is handled by the $_pv_lastvar variable, and the * second case is handled by the $_pv_prev_var_type variable. $_pv_lastvar * is always set to the value of the last T_VARIABLE token, if and only if * no text has occurred between the variable and a T_OBJECT_OPERATOR token * "->". handleClassMember will only link if the last variable encountered * was $this. * * When $this->variable is encountered, the variable is looked up to see * if it can be found, and if so, the contents of its @var tag are processed * to see if the member variable is defined to have 1 and only 1 class. * If so, the $_pv_prev_var_type variable is set to this classname. When * submember is processed, the HighlightParser checks to see if * $_pv_prev_var_type::submember() or $_pv_prev_var_type::$submember exists, * and if it does, it is linked to. */ function handleClassMember($word, $pevent) { if (!isset($this-> _pv_lastvar) && !isset( $this-> _pv_prev_var_type)) { //fancy_debug('returned from', $word, $this->_pv_prev_var_type); $this-> _pf_no_output_yet = false; $this-> _event_stack-> popEvent(); return $this-> defaultHandler($word, $pevent); } if (isset($this-> _pv_cm_name)) { $this-> _pf_obj_op = false; $name = $this-> _pv_cm_name; unset($this-> _pv_cm_name); //debug('unset pvcmname'); $this-> _event_stack-> popEvent(); // control variable for _pv_prev_var_type $setnow = false; if ((isset($this-> _pv_lastvar) && $this-> _pv_lastvar[1] == '$this') || isset($this-> _pv_prev_var_type) ) { if (is_array($word) && $word[0] == T_WHITESPACE) { // preserve value of _pv_prev_var_type $setnow = true; $save = $this-> _wp-> nextToken(); $temp = $this-> _wp-> getWord(); $this-> _wp-> backupPos($save, true); } if ((is_string($word) && $word == '(') || (isset($temp) && is_string($temp) && $temp == '(') ) { // it's a function $this-> _pf_no_output_yet = false; $this-> _methodlink($name); unset($this-> _pv_prev_var_type); } else { // it's a variable //fancy_debug('name is ', $name); $this-> _pf_no_output_yet = false; $this-> _varlink($name, true); $templink = $this-> _converter-> getLink('object ' . $this-> _pv_class); $class = false; if (is_object($templink)) { $class = $this-> _converter-> classes -> getClass($templink-> name, $templink-> path); } if ($class) { $varname = $name; if (is_array($varname)) { $varname = $name[1]; } if ($varname{0} != '$') { $varname = '$'.$varname; } $var = $class-> getVar($this-> _converter, $varname); if (is_object($var) && $var-> docblock-> var) { $type = $var-> docblock-> var-> returnType; } if (isset($type)) { if (strpos($type, 'object') === false) { $type = 'object '.$type; } $type = $this-> _converter-> getLink($type); if (phpDocumentor_get_class($type) == 'classlink') { // the variable's type is a class,
1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099
// save it for future -> //fancy_debug('set prev_var_type!', $type->name); $setnow = true; $this-> _pv_prev_var_type = $type-> name; } else { unset($this-> _pv_prev_var_type); } } else { unset($this-> _pv_prev_var_type); } } else { unset($this-> _pv_prev_var_type); } } } else { $this-> _pf_no_output_yet = false; // this does NewLinenum if necessary $this-> _wp-> backupPos($word); $this-> _wp-> getWord(); $this-> _addoutput($name); } if (!$setnow) { //debug('unset prevtype, no setnow'); unset($this-> _pv_prev_var_type); } unset($this-> _pv_lastvar); $this-> _pf_no_output_yet = false; // this does NewLinenum if necessary $this-> _wp-> backupPos($word); $this-> _wp-> getWord(); if ($word[0] == T_OBJECT_OPERATOR) { $this-> _wp-> backupPos($word); } else { $this-> _addoutput($word); } return; } if (!$this-> _pf_obj_op && is_array($this-> _pv_last_word) && $this-> _pv_last_word[0] == T_OBJECT_OPERATOR ) { if ((isset($this-> _pv_lastvar) && $this-> _pv_lastvar[1] == '$this') || isset($this-> _pv_prev_var_type) ) { $this-> _pf_obj_op = true; } else { $this-> _pf_no_output_yet = false; // this does NewLinenum if necessary $this-> _wp-> backupPos($word); $this-> _wp-> getWord(); $this-> _addoutput($word); $this-> _event_stack-> popEvent(); } } if (is_array($word) && $word == T_WHITESPACE) { $this-> _pf_no_output_yet = false; // this does NewLinenum if necessary $this-> _wp-> backupPos($word); $this-> _wp-> getWord(); $this-> _addoutput($word); return; } if ($this-> _pf_obj_op) { if (!(is_array($word) && ( $word[0] == T_STRING || $word[0] == T_WHITESPACE)) ) { unset($this-> _pv_lastvar); //debug('unset lastvar'); $this-> _event_stack-> popEvent(); $this-> _pf_no_output_yet = false; // this does NewLinenum if necessary $this-> _wp-> backupPos($word); $this-> _wp-> getWord(); $this-> _addoutput($word); return; } if ($word[0] == T_STRING) { //fancy_debug('set pvcmname to', $word); $this-> _pv_cm_name = $word; } else { $this-> _pf_no_output_yet = false;
1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 T_STRING) 1178
// this does NewLinenum if necessary $this-> _wp-> backupPos($word); $this-> _wp-> getWord(); $this-> _addoutput($word); } } } /** * Handles comments * * Comments are almost always single-line tokens, and so will be * in the last word. This handler checks to see if the current token * is in fact a comment, and if it isn't, it backs up and returns control * to the parent event handler with that word. */ function handleComment($word, $pevent) { $w = $this-> _pv_last_word; // don't perform this check if this is a normal comment. Docblocks // have the _pf_no_output_yet variable set to true if ($this-> _pf_no_output_yet && is_array($w) && (in_array($w[0], array(T_COMMENT, T_DOC_COMMENT)) && strpos($w[1], '/**') === 0) ) { $this-> _event_stack-> popEvent(); $this-> _event_stack-> pushEvent(PARSER_EVENT_DOCBLOCK); return $this-> handleDocBlock($word, PARSER_EVENT_DOCBLOCK); } if ($this-> _pf_no_output_yet) { $flag = 1; $this-> _pf_no_output_yet = false; $this-> _addoutput($this-> _pv_last_word); } if (!is_array($word) || !in_array($word[0], array(T_COMMENT, T_DOC_COMMENT)) || (in_array($word[0], array(T_COMMENT, T_DOC_COMMENT)) && strpos($word[1], '/**') === 0) ) { $this-> _event_stack-> popEvent(); if (strpos($this-> _pv_last_word[1], "\n" ) !== false) { //$this->_wp->linenum++; //$this->newLineNum(); } $this-> _wp-> backupPos($this-> _pv_last_word); $this-> _wp-> getWord(); //var_dump($this->_wp->nextToken()); return; } elseif (isset($flag)) { $this-> newLineNum(); } $this-> _addoutput($word); $this-> checkEventPop($word, $pevent); if (strpos($word[1], '*/') === strlen($word[1]) - 2) { $this-> _event_stack-> popEvent(); } } /** * Handle class declarations * * Handles the initial declaration line: * * <code>class X</code> * * or * * <code>class X extends Y implements I</code> * * @uses _classlink() to link to documentation for X and for Y class in * "class X extends Y" */ function handleClass($word, $pevent) { $this-> _pf_in_class = true; $a = $this-> checkEventPush($word, $pevent); if (!isset($this-> { $this-> _pv_class = $this-> _converter-> class = $word[1]; _pv_class) && is_array($word) && $word[0] ==
1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 T_STRING) 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257
$this-> return; }
_classlink($word);
if (is_array($word) && in_array($word[0], array(T_PRIVATE, T_PROTECTED, T_PUBLIC)) ) { $starttok = $this-> _wp-> nextToken(); $test = array(T_WHITESPACE); while ($test && $test[0] == T_WHITESPACE) { $tok = $this-> _wp-> nextToken(); $test = $this-> _wp-> getWord(); } // while if (is_array($test) && $test[0] == T_VARIABLE) { $this-> _wp-> backupPos($tok, true); return; } $this-> _wp-> backupPos($starttok, true); } if (@in_array($this-> _pv_last_word[0], array(T_PRIVATE, T_PROTECTED, T_PUBLIC)) ) { if (is_array($word) && $word[0] == T_VARIABLE) { $this-> _wp-> backupPos($this-> _pv_last_word); $this-> _event_stack-> pushEvent(PARSER_EVENT_VAR); return; } } if ($this-> { $this-> return; _classlink($word); } if (is_array($word) && $word[0] == T_EXTENDS) { $this-> _pf_extends_found = true; } if ($a == PARSER_EVENT_DOCBLOCK) { $this-> _pf_no_output_yet = true; $this-> _pv_saveline = $this-> _wp-> linenum + 1; return; } $this-> _addoutput($word); if ($this-> checkEventPop($word, $pevent)) { $this-> _pf_in_class = false; unset($this-> _pv_class); } } /** * Handles class variable declaration * * <code> * class X * { * var $Y; * } * </code> * * @uses _varlink() make a link to $Y documentation in class variable * declaration "var $Y;" */ function handleVar($word, $pevent) { if ($this-> checkEventPush($word, $pevent)) { $this-> _addoutput($word); return; } if (is_array($word) && $word[0] == T_VARIABLE) { return $this-> _varlink($word); } $this-> _addoutput($word); $this-> checkEventPop($word, $pevent); } /** * This handler is responsible for highlighting DocBlocks * _pf_extends_found && is_array($word) && $word[0] ==
1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337
* handleDocBlock determines whether the docblock is normal or a template, * and gathers all the lines of the docblock together before doing any * processing * * As it is not possible to distinguish any comment token from a docblock * token, this handler is also called for comments, and will pass control * to {@link handleComment()} if the comment is not a DocBlock * * @uses commonDocBlock() once all lines of the DocBlock have been retrieved */ function handleDocBlock($word, $pevent) { if (!($this-> _pf_docblock || $this-> _pf_docblock_template)) { if (strpos($this-> _pv_last_word[1], '/**') !== 0) { // not a docblock $this-> _wp-> backupPos($this-> _pv_last_word); $this-> _event_stack-> popEvent(); $this-> _event_stack-> pushEvent(PARSER_EVENT_COMMENT); $this-> _pf_no_output_yet = false; return; } else { $this-> _pf_no_output_yet = true; $this-> _pv_db_lines = array(); } } $last_word = $this-> _pv_last_word[1]; $dtype = '_pv_docblock'; if ($last_word == '/**#@-*/') { // stop using docblock template $this-> _pf_no_output_yet = false; $this-> _addDocBlockoutput('closetemplate', $last_word); if ($this-> _pv_next_word !== false) { $this-> _wp-> backupPos($this-> _pv_next_word, true); } $this-> _event_stack-> popEvent(); return; } if (!($this-> _pf_docblock || $this-> _pf_docblock_template)) { $this-> _pv_db_lines = array(); if (strpos($last_word, '/**#@+') === 0) { // docblock template definition $this-> _pf_docblock_template = true; } else { $this-> _pf_docblock = true; } $this-> _pv_db_lines[] = $last_word; if (strpos($last_word, '*/') !== false) { $this-> commonDocBlock(); return; } $this-> _pv_db_lines[] = $word[1]; if (strpos($word[1], '*/') !== false) { $this-> commonDocBlock(); } } else { $this-> _pv_db_lines[] = $word[1]; } if (($this-> _pf_docblock || $this-> _pf_docblock_template) && (strpos($word[1], '*/') !== false) ) { $this-> commonDocBlock(); } } /**#@-*/ /** * This continuation of handleDocBlock splits DocBlock comments up into * phpDocumentor tokens. It highlights DocBlock templates in a different * manner from regular DocBlocks, recognizes inline tags, regular tags, * and distinguishes between standard core tags and other tags, and * recognizes parameters to tags like @var. * * the type in "@var type description" will be highlighted as a php type, * and the var in "@param type $var description" will be highlighted as a * php variable. * * @return void * @uses handleDesc() highlight inline tags in the description * @uses handleTags() highlight all tags * @access private
1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417
*/ function commonDocBlock() { $this-> _event_stack-> popEvent(); $lines = $this-> _pv_db_lines; $go = count($this-> _pv_db_lines); for ($i=0; $i < $go; $i++) { if (substr(trim($lines[$i]), 0, 2) == '*/' || substr(trim($lines[$i]), 0, 1) != '*' && substr(trim($lines[$i]), 0, 3) != '/**' ) { $lines[$i] = array($lines[$i], false); } elseif (substr(trim($lines[$i]), 0, 3) == '/**') { $linesi = array(); // remove leading "/**" $linesi[1] = substr(trim($lines[$i]), 3); if (empty($linesi[1])) { $linesi[0] = $lines[$i]; } else { $linesi[0] = substr($lines[$i], 0, strpos($lines[$i], $linesi[1])); } $lines[$i] = $linesi; } else { $linesi = array(); // remove leading "* " $linesi[1] = substr(trim($lines[$i]), 1); if (empty($linesi[1])) { $linesi[0] = $lines[$i]; } else { $linesi[0] = substr($lines[$i], 0, strpos($lines[$i], $linesi[1])); } $lines[$i] = $linesi; } } for ($i = 0; $i < count($lines); $i++) { if ($lines[$i][1] === false) { continue; } if (substr(trim($lines[$i][1]), 0, 1) == '@' && substr(trim($lines[$i][1]), 0, 2) != '@ ' ) { $tagindex = $i; $i = count($lines); } } if (isset($tagindex)) { $tags = array_slice($lines, $tagindex); $desc = array_slice($lines, 0, $tagindex); } else { $tags = array(); $desc = $lines; } //var_dump($desc, $tags); $this-> _pf_no_output_yet = false; $save = $this-> _wp-> linenum; $this-> _wp-> linenum = $this-> _pv_saveline; $this-> handleDesc($desc); $this-> handleTags($tags); $this-> _pv_db_lines = array(); $this-> _wp-> linenum = $save; if (strpos($this-> _pv_last_word[1], '*/') !== false) { $this-> _wp-> backupPos($this-> _pv_next_word, true); } $this-> _pf_docblock = $this-> _pf_docblock_template = false; } /** * Handle the description area of a DocBlock * * This method simply finds inline tags and highlights them * separately from the rest of the description. * * @param mixed $desc the description piece(s) * * @return void * @uses getInlineTags() * @access private */
1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497
function handleDesc($desc) { $dbtype = 'docblock'; $dbtype .= ($this-> _pf_docblock ? '' : 'template'); foreach ($desc as $line) { $this-> getInlineTags($line[0] . $line[1]); if (strpos($line[0], '*/') === false && !(substr($line[0], 0, 2) == '/*' && strpos($line[1], '*/') !== false) ) { $this-> newLineNum(); $this-> _wp-> linenum++; } } if ($this-> _pf_internal) { $this-> _pf_internal = false; } } /** * Handle phpDocumentor tags in a DocBlock * * This method uses the {@link $tagHandlers} array to determine which * method will handle tags found in the docblock, and passes the data to * the individual handlers one by one * * @param array $tags array of tags to handle * * @return void * @access private */ function handleTags($tags) { $newtags = array(); $curtag = array(); for ($i=0; $i < count($tags); $i++) { $tagsi = trim($tags[$i][1]); if (substr($tagsi, 0, 1) == '@' && substr($tagsi, 0, 2) != '@ ') { // start a new tag $tags[$i][1] = array(substr($tags[$i][1], 0, strpos($tags[$i][1], $tagsi)), $tagsi); if (!empty($curtag)) { $newtags[] = $curtag; $curtag = array(); } $curtag[] = $tags[$i]; } else { $curtag[] = $tags[$i]; } } if (!empty($curtag)) { $newtags[] = $curtag; } foreach ($newtags as $tag) { foreach ($tag as $i => $t) { if ($t[1] === false) { continue; } if (is_array($t[1])) { $tag[$i][1][1] = explode(" " , str_replace("\t" , ' ', $t[1][1])); $x = $tag[$i][1][1]; } } $tagname = substr(array_shift($x), 1); $restoftag = $tag; if (isset($this-> tagHandlers[$tagname])) { $handle = $this-> tagHandlers[$tagname]; } else { $handle = $this-> tagHandlers['*']; } $this-> $handle($tagname, $restoftag); } } /** * This handler recognizes all {@}inline} tags * * Normal inline tags are simply highlighted. the {@}internal}} inline * tag {@tutorial tags.inlineinternal.pkg} is highlighted differently
1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577
* to distinguish it from other inline tags. * * @param mixed $value the tag value * @param bool $endinternal indicates the end of an @internal tag * * @return void * @access private */ function getInlineTags($value, $endinternal = false) { if (!$value) { return; } if ($this-> _pf_internal && ! $endinternal) { if (strpos($value, '}}') !== false) { $x = strrpos($value, '}}'); // add the rest of internal $this-> getInlineTags(substr($value, 0, $x + 3), true); // strip internal from value $value = substr($value, strrpos($value, '}}') + 1); // turn off internal $this-> _pf_internal = false; } } if (!$value) { return; } $dbtype = 'docblock'; $dbtype .= ($this-> _pf_docblock ? '' : 'template'); $save = $value; $value = explode('{@', $value); $newval = array(); // everything before the first {@ is normal text $this-> _addDocBlockoutput($dbtype, $value[0]); for ($i=1; $i < count($value); $i++) { if (substr($value[$i], 0, 1) == '}') { $this-> _addDocBlockoutput($dbtype, '{@}' . substr($value[$i], 1)); } else { $save = $value[$i]; $value[$i] = str_replace("\t" , " " , $value[$i]); $value[$i] = explode(" " , $value[$i]); $word = array_shift($value[$i]); $val = join(' ', $value[$i]); if ($word == 'internal') { $this-> _pf_internal = true; $this-> _addDocBlockoutput($dbtype, '{@internal '); $value[$i] = substr($save, strlen('internal') + 1); // strip internal and cycle as if it were normal text. $this-> _addDocBlockoutput($dbtype, $value[$i]); continue; } if (in_array(str_replace('}', '', $word), $this-> allowableInlineTags) ) { if (strpos($word, '}')) { $word = str_replace('}', '', $word); $val = '} ' . $val; } $val = explode('}', $val); if (count($val) == 1) { //addError(PDERROR_UNTERMINATED_INLINE_TAG, // $word, '', $save); } $rest = $val; $val = array_shift($rest); if ($endinternal) { $rest = join('}', $rest); } else { $rest = join(' ', $rest); } if (isset($this-> inlineTagHandlers[$word])) { $handle = $this-> inlineTagHandlers[$word]; } else { $handle = $this-> inlineTagHandlers['*']; } $this-> $handle($word, $val); $this-> _addDocBlockoutput($dbtype, $rest); } else { $val = $word . ' ' . $val; $this-> _addDocBlockoutput($dbtype, '{@' . $val); }
1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657
} } } /** * Handles all inline tags * * @param string $name the tag name * @param mixed $value the tag value * * @return void * @access private */ function handleDefaultInlineTag($name, $value) { $this-> _addDocBlockoutput('inlinetag', '{@' . $name . ' ' . $value . '}'); } /**#@+ * phpDocumentor DocBlock tag handlers * * @param string $name tag name * @param array $value array of lines contained in the tag description * * @return void * @access private */ /** * Handle normal tags * * This handler adds to outpu all comment information before the tag begins * as in " * " before "@todo" in " * @todo" * * Then, it highlights the tag as a regular or coretag based on $coretag. * Finally, it uses getInlineTags to highlight the description * * @param bool $coretag whether this tag is a core tag or not * * @uses getInlineTags() highlight a tag description */ function defaultTagHandler($name, $value, $coretag = false) { $dbtype = 'docblock'; $dbtype .= ($this-> _pf_docblock ? '' : 'template'); foreach ($value as $line) { $this-> _addDocBlockoutput($dbtype, $line[0]); if ($line[1] === false) { if (trim($line[0]) != '*/') { $this-> newLineNum(); $this-> _wp-> linenum++; } continue; } $this-> _addDocBlockoutput($dbtype, $line[1][0]); $stored = ''; if (is_array($line[1][1])) { foreach ($line[1][1] as $i => $tpart) { if ($tpart == '@' . $name && $i == 0) { $tagname = 'tag'; if ($coretag) { $tagname = 'coretag'; } $this-> _addDocBlockoutput($tagname, '@' . $name); continue; } $stored .= ' ' . $tpart; } } else { $stored = $line[1]; } $this-> getInlineTags($stored); if (strpos($stored, '*/') === false) { $this-> newLineNum(); $this-> _wp-> linenum++; } } } /**
1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737
* main handler for "core" tags * * @see defaultTagHandler() */ function coreTagHandler($name, $value) { return $this-> defaultTagHandler($name, $value, true); } /** * Handles @global * * This handler works like {@link defaultTagHandler()} except it highlights * the type and variable (if present) in "@global type $variable" or * "@global type description" */ function globalTagHandler($name, $value) { $this-> paramTagHandler($name, $value); } /** * Handles @param * * This handler works like {@link defaultTagHandler()} except it highlights * the type and variable (if present) in "@param type $variable description" * or "@param type description" * * @param bool $checkforvar private parameter, checks for $var or not */ function paramTagHandler($name, $value, $checkforvar = true) { $dbtype = 'docblock'; $dbtype .= ($this-> _pf_docblock ? '' : 'template'); $ret = $this-> retrieveType($value, 0, $checkforvar); foreach ($value as $num => $line) { $this-> _addDocBlockoutput($dbtype, $line[0]); if ($line[1] === false) { if (trim($line[0]) != '*/') { $this-> newLineNum(); $this-> _wp-> linenum++; } continue; } $this-> _addDocBlockoutput($dbtype, $line[1][0]); $stored = ''; $typeloc = 1; $varloc = 2; if (is_array($line[1][1])) { $this-> _addDocBlockoutput('coretag', '@' . $name . ' '); foreach ($ret[0] as $text) { if (is_string($text)) { $this-> _addDocBlockoutput($dbtype, $text); } if (is_array($text)) { if ($text[0] != 'desc') { $this-> _addDocBlockoutput($text[0], $text[1]); } else { $stored .= $text[1]; } } } } else { if (isset($ret[$num])) { foreach ($ret[$num] as $text) { if (is_string($text)) { $this-> _addDocBlockoutput($dbtype, $text); } if (is_array($text)) { if ($text[0] != 'desc') { $this-> _addDocBlockoutput($text[0], $text[1]); } else { $stored .= $text[1]; } } } } else { $stored = $line[1]; } }
1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817
$this-> getInlineTags($stored); if (strpos($stored, '*/') === false) { $this-> newLineNum(); $this-> _wp-> linenum++; } } } /** * handles the @staticvar tag * * @see paramTagHandler() */ function staticvarTagHandler($name, $value) { return $this-> paramTagHandler($name, $value); } /** * handles the @var tag * * @see paramTagHandler() */ function varTagHandler($name, $value) { return $this-> paramTagHandler($name, $value); } /** * Handles @return * * This handler works like {@link defaultTagHandler()} except it highlights * the type in "@return type description" */ function returnTagHandler($name, $value) { $this-> paramTagHandler($name, $value, false); } /** * Handles @property(-read or -write) and @method magic tags */ function propertyTagHandler($name, $value) { return $this-> paramTagHandler($name, $value, true); } /**#@-*/ /** * Retrieve the type portion of a @tag type description * * Tags like @param, @return and @var all have a PHP type portion in their * description. Since the type may contain the expression "object blah" * where blah is a classname, it makes parsing out the type field complex. * * Even more complicated is the case where a tag variable can contain * multiple types, such as object blah|object blah2|false, and so this * method handles these cases. * * @param array $value array of words that were separated by spaces * @param 0|1 $state 0 = find the type, 1 = find the var, if present * @param bool $checkforvar flag to determine whether to check for the end of a * type is defined by a $varname * * @return array Format: array(state (0 [find type], 1 [var], 2 [done]), * @access private */ function retrieveType($value, $state = 0, $checkforvar = false) { $index = 0; $result = array(); do { if (!isset($value[$index][1])) { return $result; } $val = $value[$index][1]; if (empty($val)) { return $result; }
1818 if ($index == 0) { 1819 $val = $val[1]; 1820 array_shift($val); 1821 } else { 1822 $val = explode(' ', $val); 1823 } 1824 $ret = $this-> _retrieveType($val, $state, $checkforvar); 1825 $state = $ret[0]; 1826 $result[$index++] = $ret[1]; 1827 } while ((!$checkforvar && $state < 1) || ($state < 2 && $checkforvar)); 1828 return $result; 1829 } 1830 1831 /** 1832 * used by {@link retrieveType()} in its work 1833 * 1834 * @param array $value array of words that were separated by spaces 1835 * @param 0|1 $state 0 = find the type, 1 = find the var, if present 1836 * @param bool $checkforvar flag to determine whether to check for the end of a 1837 * type is defined by a $varname 1838 * 1839 * @return array 1840 * @access private 1841 */ 1842 function _retrieveType($value, $state, $checkforvar) 1843 { 1844 $result = array(); 1845 $result[] = $this-> _removeWhiteSpace($value, 0); 1846 if ($state == 0) { 1847 if (!count($value)) { 1848 return array(2, $result); 1849 } 1850 $types = ''; 1851 $index = 0; 1852 if (trim($value[0]) == 'object') { 1853 $result[] = array('tagphptype', $value[0] . ' '); 1854 $types .= array_shift($value).' '; 1855 $result[] = $this-> _removeWhiteSpace($value, 0); 1856 if (!count($value)) { 1857 // was just passed "object" 1858 return array(2, $result); 1859 } 1860 if ($value[0]{0} == '$' || substr($value[0], 0, 2) == '&$' ) { 1861 // was just passed "object" 1862 // and the next thing is a variable name 1863 if ($checkforvar) { 1864 $result[] = array('tagvarname' , $value[0] . ' '); 1865 array_shift($value); 1866 } 1867 $result[] = array('desc', join(' ', $value)); 1868 return array(2, $result); 1869 } 1870 } 1871 $done = false; 1872 $loop = -1; 1873 do { 1874 // this loop checks for type|type|type and for 1875 // type|object classname|type|object classname2 1876 if (strpos($value[0], '|')) { 1877 $temptypes = explode('|', $value[0]); 1878 while (count($temptypes)) { 1879 $type = array_shift($temptypes); 1880 $result[] = array('tagphptype', $type); 1881 if (count($temptypes)) { 1882 $result[] = '|'; 1883 } 1884 } 1885 if (trim($type) == 'object') { 1886 $result[] = array('tagphptype', $types . ' '); 1887 $result[] = $this-> _removeWhiteSpace($value, 0); 1888 } else { 1889 $done = true; 1890 } 1891 array_shift($value); 1892 if (count($value) && strlen($value[0]) && isset ( $value[0]) && 1893 ($value[0]{0} == '$' || substr($value[0], 0, 2) == '&$' ) 1894 ) { 1895 // was just passed "object"
1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975
// and the next thing is a variable name $result[] = array('tagvarname' , $value[0] . ' '); array_shift($value); $result[] = array('desc', join(' ', $value)); return array(2, $result); } } else { $result[] = array('tagphptype', $value[0] . ' '); array_shift($value); $done = true; } $loop++; } while (!$done && count($value)); if ($loop) { $result[] = ' '; } // still searching for type if (!$done && ! count($value)) { return array(0, $result); } // still searching for var if ($done && ! count($value)) { return array(1, $result); } } $result[] = $this-> _removeWhiteSpace($value, 0); $state = 1; if ($checkforvar) { if (count($value)) { $state = 2; if (substr($value[0], 0, 1) == '$' || substr($value[0], 0, 2) == '&$' ) { $result[] = array('tagvarname' , $value[0] . ' '); array_shift($value); } } else { $state = 1; } } $result[] = array('desc', join(' ', $value)); return array($state, $result); } /** * captures trailing whitespace * * @param array &$value array of string * @param int $index index to seek non-whitespace to * * @return string whitespace * @access private */ function _removeWhiteSpace(& $value, $index) { $result = ''; if (count($value) > $index && empty( $value[$index])) { $found = false; for ($i = $index; $i < count($value) && ! strlen($value[$i]); $i++) { $result .= ' '; } array_splice($value, $index, $i - $index); } return $result; } /**#@+ * Link generation methods * * @param string|array $word token to try to link * * @access private */ /** * Generate a link to documentation for an element * * This method tries to link to documentation for functions, methods, * PHP functions, class names, and if found, adds the links to output * instead of plain text */
1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055
function _link($word) { if (is_array($word) && $word[0] == T_STRING) { if ($this-> _pf_colon_colon) { $this-> _pf_colon_colon = false; $combo = $this-> _pv_last_string[1] . '::' . $word[1] . '()'; //debug('testing ' . $combo); $link = $this-> _converter-> getLink($combo); if (is_object($link)) { $this-> _addoutput($this-> _converter-> returnSee($link, $word[1]), true); return; } $this-> _addoutput($word); return; } $link = $this-> _converter-> getLink($word[1] . '()'); if (is_object($link)) { $this-> _addoutput($this-> _converter-> returnSee($link, $word[1]), true); return; } elseif (is_string($link) && strpos($link, 'ttp://')) { $this-> _addoutput($this-> _converter-> returnLink($link, $word[1]), true); return; } else { $link = $this-> _converter-> getLink($word[1]); if (is_object($link)) { $word[1] = $this-> _converter-> returnSee($link, $word[1]); } $this-> _addoutput($word, true); return; } } $this-> } /** * Works like {@link _link()} except it only links to global variables */ function _globallink($word) { if (!is_array($word)) { return $this-> _addoutput($word); } if ($word[0] != T_VARIABLE) { return $this-> _addoutput($word); } if (is_array($word) && $word[0] == T_VARIABLE) { $link = $this-> _converter-> getLink('global ' . $word[1]); if (is_object($link)) { $this-> _addoutput($this-> _converter-> returnSee($link, $word[1]), true); return; } } $this-> _addoutput($word); } /** * Works like {@link _link()} except it only links to classes */ function _classlink($word) { //debug("checking class " . $word[1]); if (is_array($word) && $word[0] == T_STRING) { $link = $this-> _converter-> getLink($word[1]); if (is_object($link)) { $this-> _addoutput($this-> _converter-> returnSee($link, $word[1]), true); return; } } $this-> _addoutput($word); } /** * Works like {@link _link()} except it only links to methods */ _addoutput($word);
2056 2057 2058 2059 '()'); 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134
function _methodlink($word) { if (is_array($word) && $word[0] == T_STRING) { //debug("checking method " . $this->_pv_class . '::' . $word[1] . if (isset($this-> _pv_prev_var_type)) { $link = $this-> _converter-> getLink($this-> _pv_prev_var_type . '::' . $word[1] . '()'); } else { $link = $this-> _converter-> getLink($this-> _pv_class . '::' . $word[1] . '()'); } if (is_object($link)) { $this-> _addoutput($this-> _converter-> returnSee($link, $word[1]), true); return; } if (isset($this-> _pv_prev_var_type)) { $this-> _addoutput($word); return; } //debug("checking method " . $word[1] . '()'); $link = $this-> _converter-> getLink($word[1] . '()'); if (is_object($link)) { $this-> _addoutput($this-> _converter-> returnSee($link, $word[1]), true); return; } } $this-> } /** * Works like {@link _link()} except it only links to class variables * * @param bool $justastring true if the $word is only a string */ function _varlink($word, $justastring=false) { if ($justastring) { $word[0] = T_VARIABLE; } if (is_array($word) && $word[0] == T_VARIABLE) { $x = ($justastring ? '$' : ''); //debug("checking var " . $this->_pv_class . '::' . $x . $word[1]); if (isset($this-> _pv_prev_var_type)) { //debug("checking var " . $this->_pv_prev_var_type . '::' . // $x . $word[1]); $link = $this-> _converter-> getLink($this-> _pv_prev_var_type . '::' . $x . $word[1]); } else { $link = $this-> _converter-> getLink($this-> _pv_class . '::' . $x . $word[1]); } if (is_object($link)) { $this-> _addoutput($this-> _converter-> returnSee($link, $word[1]), true); return; } //debug("checking var " . $x . $word[1]); if (isset($this-> _pv_prev_var_type)) { $this-> _addoutput($word); return; } $link = $this-> _converter-> getLink($x . $word[1]); if (is_object($link)) { $this-> _addoutput($this-> _converter-> returnSee($link, $word[1]), true); return; } } $this-> _addoutput($word); } /**#@-*/ /**#@+ * Output Methods * @access private */ /** _addoutput($word);
2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214
* This method adds output to {@link $_line} * * If a string with variables like "$test this" is present, then special * handling is used to allow processing of the variable in context. * * @param mixed $word the string|array tag token and value * @param bool $preformatted whether or not the $word is already formatted * * @return void * @see _flush_save() */ function _addoutput($word, $preformatted = false) { if ($this-> _pf_no_output_yet) { return; } if ($this-> _pf_quote_active) { if (is_array($word)) { $this-> _save .= $this-> _converter-> highlightSource($word[0], $word[1]); } else { $this-> _save .= $this-> _converter-> highlightSource(false, $word, true); } } else { $this-> _flush_save(); if (is_string($word) && trim($word) == '') { $this-> _line .= $this-> _converter-> postProcess($word); return; } if (is_array($word) && trim($word[1]) == '') { $this-> _line .= $this-> _converter-> postProcess($word[1]); return; } if (is_array($word)) { $this-> _line .= $this-> _converter-> highlightSource($word[0], $word[1], $preformatted); } else { $this-> _line .= $this-> _converter-> highlightSource(false, $word, $preformatted); } } } /** * Like {@link _output()}, but for DocBlock highlighting * * @param mixed $dbtype the docblock type * @param mixed $word the string|array tag token and value * @param bool $preformatted whether or not the $word is already formatted * * @return void */ function _addDocBlockoutput($dbtype, $word, $preformatted = false) { if ($this-> _pf_internal) { $this-> _line .= $this-> _converter-> highlightDocBlockSource('internal', $word, $preformatted); } else { $this-> _line .= $this-> _converter-> highlightDocBlockSource($dbtype, $word, $preformatted); } } /** * Flush a saved string variable highlighting * * {@source } * * @return void * @todo CS cleanup - rename to _flushSave() for camelCase rule */ function _flush_save() { if (!empty($this-> _save)) { $this-> _save .= $this-> _converter-> flushHighlightCache(); // clear the existing cache, reset it to the old value if (isset($this-> _save_highlight_state)) { $this-> _converter-> _setHighlightCache($this-> _save_highlight_state[0],
2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294
$this-> _save_highlight_state[1]); } $this-> _line .= $this-> _converter-> highlightSource(T_CONSTANT_ENCAPSED_STRING, $this-> $this-> _save = ''; } } /**#@-*/ /** * Give the word parser necessary data to begin a new parse * * @param array &$data all tokens separated by line number * * @return void */ function configWordParser(& $data) { $this-> _wp-> setup($data, $this); $this-> _wp-> setWhitespace(true); }
_save, true);
/** * Initialize all parser state variables * * @param bool $inlinesourceparse true if we are highlighting an inline * {@}source} tag's output * @param false|string$class name of class we are going * to start from * * @return void * @uses $_wp sets to a new {@link phpDocumentor_HighlightWordParser} */ function setupStates($inlinesourceparse, $class) { $this-> _output = ''; $this-> _line = ''; unset($this-> _wp); $this-> _wp = new phpDocumentor_HighlightWordParser; $this-> _event_stack = new EventStack; if ($inlinesourceparse) { $this-> _event_stack-> pushEvent(PARSER_EVENT_PHPCODE); if ($class) { $this-> _event_stack-> pushEvent(PARSER_EVENT_CLASS); $this-> _pv_class = $class; } } else { $this-> _pv_class = null; } $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> _pv_define _pv_define_name _pv_define_value _pv_define_params_data _pv_dtype _pv_docblock _pv_dtemplate _pv_func _pv_global_name _pv_global_val _pv_globals _pv_global_count _pv_include_params_data _pv_include_name _pv_include_value _pv_linenum _pv_periodline _pv_paren_count _pv_statics _pv_static_count _pv_static_val _pv_quote_data _pv_function_data _pv_var _pv_varname _pf_definename_isset _pf_extends_found _pf_includename_isset _pf_get_source _pf_getting_source = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = null; null; null; null; null; null; null; null; null; null; null; null; null; null; null; null; null; 0; null; null; null; null; null; null; null; false; false; false; false; false;
2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374
$this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> $this-> }
_pf_in_class _pf_in_define _pf_in_global _pf_in_include _pf_in_var _pf_funcparam_val _pf_quote_active _pf_reset_quote_data _pf_useperiod _pf_var_equals _pf_obj_op _pf_docblock _pf_docblock_template _pf_colon_colon _pv_last_string _pf_inmethod _pf_no_output_yet _pv_saveline _pv_next_word _save
= = = = = = = = = = = = = = = = = = = =
false; false; false; false; false; false; false; true; false; false; false; false; false; false; false; false; false; 0; false; '';
/** * Initialize the {@link $tokenpushEvent, $wordpushEvent} arrays * * @return void */ function phpDocumentor_HighlightParser() { if (!defined('T_INTERFACE')) { define('T_INTERFACE', -1); } $this-> allowableTags = $GLOBALS['_phpDocumentor_tags_allowed']; $this-> allowableInlineTags = $GLOBALS['_phpDocumentor_inline_doc_tags_allowed']; $this-> inlineTagHandlers = array('*' => 'handleDefaultInlineTag'); /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_NOEVENTS] = array( T_OPEN_TAG => PARSER_EVENT_PHPCODE, ); /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_PHPCODE] = array( T_FUNCTION => PARSER_EVENT_FUNCTION, T_CLASS => PARSER_EVENT_CLASS, T_INTERFACE => PARSER_EVENT_CLASS, T_INCLUDE_ONCE => PARSER_EVENT_INCLUDE, T_INCLUDE => PARSER_EVENT_INCLUDE, T_START_HEREDOC => PARSER_EVENT_EOFQUOTE, T_REQUIRE => PARSER_EVENT_INCLUDE, T_REQUIRE_ONCE => PARSER_EVENT_INCLUDE, T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpushEvent[PARSER_EVENT_PHPCODE] = array( "define" => PARSER_EVENT_DEFINE, '"' => PARSER_EVENT_QUOTE, '\'' => PARSER_EVENT_QUOTE, ); /**************************************************************/ $this-> wordpushEvent[PARSER_EVENT_FUNCTION] = array( '{' => PARSER_EVENT_LOGICBLOCK, '(' => PARSER_EVENT_FUNCTION_PARAMS, ); $this-> tokenpushEvent[PARSER_EVENT_FUNCTION] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpopEvent[PARSER_EVENT_FUNCTION] = array("}" /**************************************************************/
);
2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 ","
$this-> tokenpopEvent[PARSER_EVENT_EOFQUOTE] = array(T_END_HEREDOC); /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_FUNCTION_PARAMS] = array( T_CONSTANT_ENCAPSED_STRING => PARSER_EVENT_QUOTE, T_ARRAY => PARSER_EVENT_ARRAY, T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpushEvent[PARSER_EVENT_FUNCTION_PARAMS] = array( '"' => PARSER_EVENT_QUOTE, "'" => PARSER_EVENT_QUOTE, ); $this-> wordpopEvent[PARSER_EVENT_FUNCTION_PARAMS] = array(")" /**************************************************************/ $this-> wordpushEvent[PARSER_EVENT_LOGICBLOCK] = array( "{" => PARSER_EVENT_LOGICBLOCK, '"' => PARSER_EVENT_QUOTE, ); $this-> tokenpushEvent[PARSER_EVENT_LOGICBLOCK] = array( T_GLOBAL => PARSER_EVENT_FUNC_GLOBAL, T_STATIC => PARSER_EVENT_STATIC_VAR, T_START_HEREDOC => PARSER_EVENT_EOFQUOTE, T_CURLY_OPEN => PARSER_EVENT_LOGICBLOCK, T_DOLLAR_OPEN_CURLY_BRACES => PARSER_EVENT_LOGICBLOCK, ); $this-> wordpopEvent[PARSER_EVENT_LOGICBLOCK] = array("}" ); $this-> tokenpopEvent[PARSER_EVENT_LOGICBLOCK] = array(T_CURLY_OPEN); /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_ARRAY] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpopEvent[PARSER_EVENT_ARRAY] = array(")" /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_FUNC_GLOBAL] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpopEvent[PARSER_EVENT_FUNC_GLOBAL] = array(";" /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_STATIC_VAR] = array( T_CONSTANT_ENCAPSED_STRING => PARSER_EVENT_QUOTE, T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpushEvent[PARSER_EVENT_STATIC_VAR] = array( "=" => PARSER_EVENT_STATIC_VAR_VALUE, ); $this-> wordpopEvent[PARSER_EVENT_STATIC_VAR] = array(";" /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_STATIC_VAR_VALUE] = array( T_CONSTANT_ENCAPSED_STRING => PARSER_EVENT_QUOTE, T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, T_ARRAY => PARSER_EVENT_ARRAY, ); $this-> wordpushEvent[PARSER_EVENT_STATIC_VAR_VALUE] = array( '"' => PARSER_EVENT_QUOTE, "'" => PARSER_EVENT_QUOTE, ); $this-> wordpopEvent[PARSER_EVENT_STATIC_VAR_VALUE] = array(";" );
);
);
);
);
2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533
/**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_QUOTE] = array( T_OBJECT_OPERATOR => PARSER_EVENT_CLASS_MEMBER, T_CURLY_OPEN => PARSER_EVENT_QUOTE_VAR, ); $this-> wordpopEvent[PARSER_EVENT_QUOTE] = array('"' ); /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_QUOTE_VAR] = array( T_OBJECT_OPERATOR => PARSER_EVENT_CLASS_MEMBER, T_CURLY_OPEN => PARSER_EVENT_QUOTE_VAR, ); $this-> wordpushEvent[PARSER_EVENT_QUOTE_VAR] = array( "{" => PARSER_EVENT_QUOTE_VAR, '"' => PARSER_EVENT_QUOTE_VAR, "'" => PARSER_EVENT_QUOTE_VAR, ); $this-> wordpopEvent[PARSER_EVENT_QUOTE_VAR] = array('}'); /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_DEFINE] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, T_CONSTANT_ENCAPSED_STRING => PARSER_EVENT_QUOTE, ); $this-> wordpushEvent[PARSER_EVENT_DEFINE] = array( "(" => PARSER_EVENT_DEFINE_PARAMS, ); $this-> wordpopEvent[PARSER_EVENT_DEFINE] = array(";" /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_DEFINE_PARAMS] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpushEvent[PARSER_EVENT_DEFINE_PARAMS] = array( "(" => PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS, '"' => PARSER_EVENT_QUOTE, "'" => PARSER_EVENT_QUOTE, ); $this-> wordpopEvent[PARSER_EVENT_DEFINE_PARAMS] = array(")" /**************************************************************/
);
);
$this-> tokenpushEvent[PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpushEvent[PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS] = array( "(" => PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS, '"' => PARSER_EVENT_QUOTE, "'" => PARSER_EVENT_QUOTE, ); $this-> wordpopEvent[PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS] = array(")" /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_VAR] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, T_ARRAY => PARSER_EVENT_ARRAY, ); $this-> wordpopEvent[PARSER_EVENT_VAR] = array(";" ); /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_CLASS] = array( T_FUNCTION => PARSER_EVENT_METHOD, T_VAR => PARSER_EVENT_VAR, T_COMMENT => PARSER_EVENT_DOCBLOCK, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, T_CLOSE_TAG => PARSER_EVENT_OUTPHP, );
);
2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 array(")" 2601 } 2602 } 2603 ?>
$this-> wordpopEvent[PARSER_EVENT_CLASS] = array("}" /**************************************************************/ $this-> wordpushEvent[PARSER_EVENT_METHOD] = array( '{' => PARSER_EVENT_METHOD_LOGICBLOCK, '(' => PARSER_EVENT_FUNCTION_PARAMS, ); $this-> tokenpushEvent[PARSER_EVENT_METHOD] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpopEvent[PARSER_EVENT_METHOD] = array("}" /**************************************************************/
);
, ";"
);
$this-> wordpushEvent[PARSER_EVENT_METHOD_LOGICBLOCK] = array( "{" => PARSER_EVENT_METHOD_LOGICBLOCK, '"' => PARSER_EVENT_QUOTE, ); $this-> tokenpushEvent[PARSER_EVENT_METHOD_LOGICBLOCK] = array( T_OBJECT_OPERATOR => PARSER_EVENT_CLASS_MEMBER, T_GLOBAL => PARSER_EVENT_FUNC_GLOBAL, T_STATIC => PARSER_EVENT_STATIC_VAR, T_CURLY_OPEN => PARSER_EVENT_LOGICBLOCK, T_DOLLAR_OPEN_CURLY_BRACES => PARSER_EVENT_LOGICBLOCK, ); $this-> wordpopEvent[PARSER_EVENT_METHOD_LOGICBLOCK] = array("}" ); $this-> tokenpopEvent[PARSER_EVENT_METHOD_LOGICBLOCK] = array(T_CURLY_OPEN); /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_INCLUDE] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpushEvent[PARSER_EVENT_INCLUDE] = array( "(" => PARSER_EVENT_INCLUDE_PARAMS, ); $this-> wordpopEvent[PARSER_EVENT_INCLUDE] = array(";" /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_INCLUDE_PARAMS] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpushEvent[PARSER_EVENT_INCLUDE_PARAMS] = array( "(" => PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS, ); $this-> wordpopEvent[PARSER_EVENT_INCLUDE_PARAMS] = array(")" /**************************************************************/ $this-> tokenpushEvent[PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS] = array( T_COMMENT => PARSER_EVENT_COMMENT, T_DOC_COMMENT => PARSER_EVENT_DOCBLOCK, ); $this-> wordpushEvent[PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS] = array( "(" => PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS, ); $this-> wordpopEvent[PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS] = );
);
);
In CHMdefaultConverter::Output() :
In PDFdefaultConverter :
In XMLDocBookConverter :
In Package phpDocumentor
In abstractLink :
In ErrorTracker::addError() :
In addError() :
In addErrorDie() :
In ErrorTracker::addErrorReturn() :
In addWarning() :
In ErrorTracker::addWarning() :
In phpDocumentor_TutorialHighlightParser::checkEventPop() :
In phpDocumentor_TutorialHighlightParser::checkEventPush() :
In Classes :
In Classes.inc :
In classLink :
In clone.inc.php :
In clone5.inc.php :
In common.inc.php :
In constLink :
In parserLinkInlineTag::Convert() :
In parserTutorialTag::Convert() :
In parserSamp::Convert() :
In parserSeeTag::Convert() :
In parserAccessTag::Convert() :
In parserUsesTag::Convert() :
In parserUsedByTag::Convert() :
In parserIdInlineTag::Convert() :
In parserInheritdocInlineTag::Convert() :
In parserFileSourceTag::Convert() :
In parserPre::Convert() :
In parserTocInlineTag::Convert() :
In parserB::Convert() :
In parserReturnTag::Convert() :
In parserTag::Convert() :
In parserCData::Convert() :
In parserStringWithInlineTags::Convert() :
In parserEntity::Convert() :
In parserBr::Convert() :
In parserCode::Convert() :
In parserNameTag::Convert() :
In parserList::Convert() :
In parserKbd::Convert() :
In parserTutorialInlineTag::Convert() :
In parserDescVar::Convert() :
In parserI::Convert() :
In parserSourceInlineTag::Convert() :
In parserLinkInlineTag::ConvertPart() :
In parserFileSourceTag::ConvertSource() :
CS cleanup - rename to convertSource for camelCase rule what's up with all the "return" statements? can they _all_ be removed?
In parserExampleTag::ConvertSource() :
CS cleanup - rename to convertSource for camelCase rule what's up with all the "return" statements? can they _all_ be removed?
In debug() :
In defineLink :
In DescHTML.inc :
In DocBlockTags.inc :
In Errors.inc :
In ErrorTracker :
In EventStack :
In EventStack.inc :
In find_phpdoc.php :
In functionLink :
In ProceduralPages::getPathInfo() :
In parserPage::getSourceLocation() :
determine if the str_replace in the 'pear/' ELSE branch should be removed (see Documentation/tests/bug1574043.php). It does NOT exist in the similar function parserClass->getSourceLocation() in ParserElements.inc.
In globalLink :
In parserTag::HandleEvent() :
In HighlightParser.inc :
In Classes::Inherit() :
In InlineTags.inc :
In LinkClasses.inc :
In methodLink :
In new_phpdoc.php :
In PackagePageElements.inc :
In pageLink :
In phpDocumentor_TutorialHighlightParser::parse() :
In phpDocumentor_HighlightParser::parse() :
In Io::parseArgv() :
In parserAccessTag :
In parserB :
In parserBase :
In parserBr :
In parserCData :
In parserCode :
In parserData :
In ParserData.inc :
In parserDescVar :
In parserEntity :
In parserExampleInlineTag::parserExampleInlineTag() :
In parserExampleInlineTag :
In parserExampleTag::parserExampleTag() :
CS cleanup - rename constant to TOKENIZER_EXT does this "x = y = z = false" still work as expected in PHP5?
In parserExampleTag :
In parserFileSourceTag :
In parserI :
In parserIdInlineTag :
In parserInheritdocInlineTag :
In parserInlineTag :
In parserKbd :
In parserLicenseTag :
In parserLinkInlineTag :
In parserLinkTag :
In parserList :
In parserMethodTag :
In parserNameTag :
In parserPage :
In parserParamTag :
In parserPre :
In parserPropertyReadTag :
In parserPropertyTag :
In parserPropertyWriteTag :
In parserReturnTag :
In parserSamp :
In parserSeeTag :
In parserSourceInlineTag :
In parserStaticvarTag :
In parserStringWithInlineTags :
In parserTag :
In parserTocInlineTag :
In parserTutorialInlineTag :
In parserTutorialTag :
In parserUsedByTag :
In parserUsesTag :
In parserVarTag :
In parserXMLDocBookTag::parserXMLDocBookTag() :
In parserXMLDocBookTag :
CS cleanup - change classname to PhpDocumentor_* CS cleanup - change package to PhpDocumentor CS cleanup - rename to parserXmlDocBookTag for camelCase rule
In PDERROR_CLASS_PARENT_NOT_FOUND:
In PDERROR_GLOBAL_NOT_FOUND :
In PDERROR_MALFORMED_GLOBAL_TAG :
In PDERROR_MULTIPLE_GLOBAL_TAGS :
In PDERROR_NEED_WHITESPACE:
In PDERROR_PACKAGEOUTPUT_DELETES_PARENT_FILE :
In PDERROR_UNKNOWN_COMMANDLINE:
In phpdoc.inc :
In phpdoc.php :
In phpDocumentorTParser :
In phpDocumentorTParser.inc :
In phpDocumentorTWordParser :
In phpDocumentorTWordParser.inc :
CS cleanup - change package to PhpDocumentor CS cleanup - PHPCS needs to ignore CVS Id length
In phpDocumentor_clone() :
In phpDocumentor_ConfigFileList() :
In phpDocumentor_get_class() :
In phpDocumentor_HighlightParser :
In phpDocumentor_HighlightWordParser :
In phpDocumentor_parse_ini_file() :
In phpDocumentor_TutorialHighlightParser :
In ProceduralPages :
In ProceduralPages.inc :
In Publisher :
In Publisher.inc :
In RecordError :
In RecordWarning::RecordWarning() :
CS Cleanup - do I need to add $data to the method signature? on the error number
to sprintf based
In RecordWarning :
In phpDocumentor_setup::setMemoryLimit() :
recognize "K" and "G" in memory_limit settings, rather than just "M"
In parserInlineTag::Strlen() :
In Publisher::subscribe() :
CS Cleanup - there's no way I can get the &$object desc under 85 chars
In TutorialHighlightParser.inc :
CS cleanup - change package to PhpDocumentor CS cleanup - PHPCS needs to ignore CVS Id length
In tutorialLink :
In varLink :
In WordParser :
In WordParser.inc :
In XMLPackagePageParser :
In XMLpackagePageParser.inc :
CS cleanup - change package to PhpDocumentor CS cleanup - PHPCS needs to ignore CVS Id length
In Package tests
In ParserClassGetSourceLocationTests.php :
research possibility of refactoring ParserClass->getSourceLocation() and ParserPage->getSourceLocation() into a common method... also, there might be more occurrences of similar getSourceLocation() methods in other classes.
In ParserPageGetSourceLocationTests.php :
research possibility of refactoring ParserClass->getSourceLocation() and ParserPage->getSourceLocation() into a common method... also, there might be more occurrences of similar getSourceLocation() methods in other classes.
In tests_ParserPageGetSourceLocationTests::testWhenNonPearLocationSetAndPearize True():
Revisit this test... I think it highlights a bug in the getSourceLocation method. Compare it with the same test in bug1574047.php against similar method parserClass>getSourceLocation().
In tests_ParserPageGetSourceLocationTests::testWhenNonPearLocationSetIncludingD otsAndPearizeTrue():
Revisit this test... I think it highlights a bug in the getSourceLocation method. Compare it with the same test in bug1574047.php against similar method parserClass>getSourceLocation().
In tests_ParserPageGetSourceLocationTests::testWhenNonPearRelativeLocationSetAn dPearizeTrue():
Revisit this test... I think it highlights a bug in the getSourceLocation method. Compare it with the same test in bug1574047.php against similar method parserClass>getSourceLocation().
In Package XML_Beautifier
In PHPDoc_XML_Beautifier_Renderer_Plain :
automatically create <![CDATA[ ]]> sections option to specify inline tags option to specify treatment of whitespac in data sections
Index
47 16
@
@see @since @return @property @package @param @static @staticvar @var @version @uses @tutorial @subpackage @todo @name @method @deprecated @example @copyright @category @access @author @final @filesource @license @link @internal @ignore @global @abstract 80 82 78 76 71 73 83 85 94 95 91 89 86 88 70 69 57 58 56 55 52 54 60 61 67 68 66 65 62 51
A
abstractLink::$name abstractLink::$fileAlias phpdoc alias _phpdoc_inc for phpdoc.inc abstractLink::$category 789 789 789
abstractLink linking classes parent abstractLink::$package abstractLink::$path abstractLink::addLink() sets up the link abstractLink::$type element type linked to. abstractLink::$subpackage addWarning() add a Warning addErrorDie() like addError() but exits parsing a tests linking to methods and vars aa_567059() test links to methods and vars a() test links to methods and vars a::$a a::$c addError() add an Error actions.php phpDocumentor :: docBuilder Web Interface a::b() adv_htmlentities() smart htmlentities, doesn't entity the allowed tags list
789 789 789 790 789 789 757 756 530 518 517 530 530 756 619 530 144
B
brokenlinkstovars baby::$oopsieindexing baby brokenlinkstovars::$broken bug540341 bug557861 this page will not be shown in the package list and should be bug540341::get_header2() b553607_Parser bug-shortdesc.php bug-loseprocedural.php bug-escaping.php bug-eofquotes.php bug-pageleveldocsblocks.php Im a page level docblock bug-quote_new_parser.php bqnp_testie() The tokenizer splits up strings that have inline variables bqnp_tester The tokenizer splits up strings that have inline variables bug_489398 531 531 531 531 531 532 532 530 529 526 525 524 527 528 528 528 532
bug_489398::$test_01 Checking the single quote var case builder.php phpDocumentor :: docBuilder Web Interface bug_556894_sub2 Subclass in different subpackage bug_556894_sub1 Subclass in same subpackage bug_772441 Beautifier.php XML/Beautifier.php Beautifier.php Source code builder.php Source code bug_556894_base::test() I'm a test method bug_556894_base::$test I'm a test var bug_489398::$test_03 Checking the no quote cause bug_489398::$test_02 checking the double quote var case bug_489398::$test_04 Checking the empty array case bug_489398::$test_05 Checking the array with data case bug_556894_base Base Class bug-541886.php Test for bug #541886 bug-defineparse.php bug-authoremail.php bug-540368.php bug-445820.php bug-445305.php blah() bug-542586.php bug-551120.php bug-550489.php bug-445298.php bug-443153.php bug-441275.php block.textformat.php Smarty plugin block.strip.php Smarty plugin bug-441278.php bug-441287.php bug-441433.php bug-441289.php bug-553137.php bug-554712.php
532 621 614 613 661 863 1311 1169 613 613 533 533 533 533 613 554 523 522 496 495 494 496 497 499 498 493 492 486 428 427 487 488 491 489 500 501
bug-566600.php bug-566200.php bug-562997.php This page returns a class with name "%s"'."\n", and shouldn't find class at all bug-567059.php bug-645588.php Global functions bug698356_Output() Create the phpdoc.hhp, contents.hhc files needed by MS HTML Help Compiler to create a CHM file bug-698356.php This is a test of bug 698356. Must be parsed with -pp on to test bug-560595.php bug-560578.php page-level stuff bug-558031.php bug-557861.php bug is fixed. to test, remove this page-level docblock bug-558051.php bug-559467.php bug-559668.php bug-559494.php tests variable names with the word 'array' in them bug-904820.php This is a test of a package with a . in its name
521 514 513 503 502 504 505 507 506 365
C
Cpdf::o_destination() 341 destination object, used to specify the location for the user to jump to, presently on opening Cpdf::o_encryption() 342 encryption object. Cpdf::o_font() 342 an object to hold the font description Cpdf::o_contents() 341 the contents objects hold all of the content which appears on pages Cpdf::o_catalog() 341 define the document catalog, the overall controller for the document Cpdf::o_action() 340 an action object, used to link to URLS initially Cpdf::o_annotation() 341 an annotation object, this will add an annotation to the current page. Cpdf::o_fontDescriptor() 342 a font descriptor, needed for including additional fonts Cpdf::o_fontEncoding() 342 the font encoding Cpdf::o_pages() 344 object which is a parent to the pages in the document Cpdf::o_procset() 344 the document procset, solves some problems with printing to old PS printers
Cpdf::o_page() 343 a page object, it also creates a contents object to hold its contents Cpdf::o_outlines() 343 define the outlines in the doc, empty for now Cpdf::o_image() 343 an image object, will be an XObject in the document, includes description and data Cpdf::o_info() 343 define the document information Cpdf::output() 340 return the pdf stream as a string returned from the function Cpdf::openObject() 340 make a loose object, the output will go into this object, until it is closed, then will revert to the current one. Cpdf::encryptInit() 337 initialize the encryption for processing a particular object Cpdf::filledEllipse() 338 draw a filled ellipse Cpdf::filledRectangle() 338 a filled rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not Cpdf::ellipse() 337 draw an ellipse note that the part and filled ellipse are just special cases of this function Cpdf::curve() 336 draw a bezier curve based on 4 control points Cpdf::checkAllHere() 336 should be used for internal checks, not implemented as yet Cpdf::closeObject() 336 close an object Cpdf::getFirstPageId() 338 function for the user to find out what the ID is of the first page that was created during startup - useful if they wish to add something to it later. Cpdf::getFontDecender() 338 return the font decender, this will normally return a negative number Cpdf::newPage() 339 add a new page to the document Cpdf::openHere() 340 specify where the document should open when it first starts Cpdf::md5_16() 339 calculate the 16 byte version of the 128 bit md5 digest of the string Cpdf::line() 339 draw a line from one set of coordinates to another Cpdf::getFontHeight() 339 return the height in units of the current font in the given size Cpdf::getTextWidth() 339 calculate how wide a given text string will be on a page, at a given size. Cpdf::o_viewerPreferences() 344 set the viewer preferences Cpdf::partEllipse() 344 draw a part of an ellipse constructor HTML_TreeNode::HTML_TreeNode() 361 Constructor Config_File.class.php 367
Config_File class. Config_File 371 Config file reading class constructor HTML_TreeMenu_Presentation::HTML_TreeMenu_Presentation() 359 Base constructor simply sets the menu object constructor HTML_TreeMenu_Listbox::HTML_TreeMenu_Listbox() 358 Constructor constructor HTML_TreeMenu::HTML_TreeMenu() 354 Constructor constructor HTML_TreeMenu_DHTML::HTML_TreeMenu_DHTML() 356 Constructor, takes the tree structure as Config_File::$booleanize 371 Controls whether config values of on/true/yes and off/false/no get converted to boolean values automatically. Config_File::$fix_newlines 371 Controls whether or not to fix mac or dos formatted newlines. Config_File::clear() 372 Clear loaded config data for a certain file or all files. Config_File::get() 372 Retrieves config info based on the file, section, and variable name. constructor Config_File::Config_File() 372 Constructs a new config file class. Config_File::$_config_data 372 Config_File::$overwrite 371 Controls whether variables with the same name overwrite each other. Config_File::$read_hidden 372 Controls whether hidden config sections/vars are read from the file. constructor DirNode::DirNode() 353 Cpdf::transaction() 349 a few functions which should allow the document to be treated transactionally. Cpdf::saveState() 346 this will be called at a new page to return the state to what it was on the Cpdf::selectFont() 346 if the font is not loaded then load it and make the required object Cpdf::restoreState() 345 restore a previously saved state Cpdf::reopenObject() 345 open an existing object for editing Cpdf::polygon() 345 draw a polygon, the syntax for this is similar to the GD polygon command Cpdf::rectangle() 345 draw a rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not Cpdf::setColor() 346 sets the colour for fill operations Cpdf::setEncryption() 347 set the encryption of the document can be used to turn it on and/or set the passwords which it will have. Cpdf::stopObject() 348 stop an object from appearing on pages from this point on Cpdf::stream() 348 output the pdf code, streaming it to the browser Cpdf::setStrokeColor() 348
sets the colour for stroke operations Cpdf::setPreferences() 348 set the viewer preferences of the document, it is up to the browser to obey these. Cpdf::setFontFamily() 347 define font families, this is used to initialize the font families for the default fonts and for the user to add new ones for their fonts. The default bahavious can be overridden should that be desired. Cpdf::setLineStyle() 347 this sets the line drawing style. Cpdf::ARC4_init() 336 initialize the ARC4 encryption Cpdf::ARC4() 336 ARC4 encrypt a text string Cpdf::$currentColour 328 current colour for fill operations, defaults to inactive value, all three components should be between 0 and 1 inclusive when active Cpdf::$currentContents 328 object number of the currently active contents block Cpdf::$currentFont 328 a record of the current font Cpdf::$currentBaseFont 328 the current base font Cpdf::$checkpoint 327 store the stack for the transaction commands, each item in here is a record of the values of all the variables within the class, so that the user can rollback at will (from each 'start' command) note that this includes the objects array, so these can be large. Cpdf::$callback 327 array which forms a stack to keep track of nested callback functions Cpdf::$catalogId 327 the objectId (number within the objects array) of the document catalog Cpdf::$currentFontNum 328 the number of the current font within the font array Cpdf::$currentLineStyle 328 current style that lines are drawn in Cpdf::$destinations 329 store label->id pairs for named destinations, these will be used to replace internal links Cpdf::$encrypted 329 a flag to say if a document is to be encrypted or not Cpdf::$currentTextState 329 track if the current font is bolded or italicised Cpdf::$currentStrokeColour 329 current colour for stroke operations (lines etc.) Cpdf::$currentNode 328 Cpdf::$currentPage 329 object number of the current page Cpdf::$arc4_objnum 327 the object Id of the encryption information Cpdf::$arc4 327 the ancryption array for the document encryption is stored here Cezpdf::ezStartPageNumbers() 325 Cezpdf::ezStopPageNumbers() 325
Cezpdf::ezStream() 325 Cezpdf::ezSetY() 324 Cezpdf::ezSetMargins() 324 Cezpdf::ezSetCmMargins() 324 Cezpdf::ezSetDy() 324 Cezpdf::ezTable() 325 Cezpdf::ezText() 325 Cpdf 326 Cpdf Cpdf::$addLooseObjects 327 array contains infomation about how the loose objects are to be added to the document Cezpdf::uline() 326 Cezpdf::loadTemplate() 326 Cezpdf::ezWhatPageNumber() 326 Cezpdf::ilink() 326 Cpdf::$encryptionKey 329 the ancryption key for the encryption of all the document content (structure is not encrypted) Cpdf::$fileIdentifier 329 the file identifier, used to uniquely identify a pdf document Cpdf::addDestination() 333 create a labelled destination within the document Cpdf::addImage() 333 add an image into the document, from a GD object Cpdf::addInfo() 333 add content to the documents info object constructor Cpdf::Cpdf() 332 class constructor Cpdf::$wordSpaceAdjust 332 used to track the last used value of the inter-word spacing, this is so that it is known when the spacing is changed. Cpdf::$stack 332 object Id storage stack Cpdf::$stateStack 332 an array which is used to save the state of the document, mainly the colours and styles Cpdf::addInternalLink() 334 add a link in the document to an internal destination (ie. within the document) Cpdf::addJpegFromFile() 334 add a JPEG image into the document, from a file Cpdf::addText() 335 add text to the document, at a specified location, size and angle on the page Cpdf::addTextWrap() 335 add text to the page, but ensure that it fits within a certain width if it does not fit then put in as much as possible, splitting at word boundaries and return the remainder. Cpdf::addPngFromFile() 335 add a PNG image into the document, from a file Cpdf::addObject() 335 after an object has been created, it wil only show if it has been added, using this function. Cpdf::addLink() 334 add a link in the document to an external URL Cpdf::addMessage() 334 used to add messages for use in debugging
Cpdf::$procsetObjectId 332 the object Id of the procset object Cpdf::$options 332 an array containing options about the document Cpdf::$looseObjects 330 an array which contains information about the objects which are not firmly attached to pages Cpdf::$messages 330 messages are stored here during processing, these can be selected afterwards to give some useful debug information Cpdf::$infoObject 330 the objectId of the information object for the document this contains authorship, title etc. Cpdf::$fonts 330 array carrying information about the fonts that the system currently knows about Cpdf::$firstPageId 330 the objectId of the first page of the document Cpdf::$fontFamilies 330 store the information about the relationship between font families this used so that the code knows which font is the bold version of another font, etc. Cpdf::$nCallback 330 the number of callback functions in the callback array Cpdf::$nStack 331 number of elements within the object Id storage stack Cpdf::$numPages 331 number of page objects within the document Cpdf::$objects 331 this array contains all of the pdf objects, ready for final assembly Cpdf::$numObj 331 the current number of pdf objects in the document Cpdf::$numImages 331 number of images being tracked within the document Cpdf::$nStateStack 331 number of elements within the state stack Cpdf::$numFonts 331 number of fonts within the system Config_File::get_file_names() 373 Get all loaded config file names. Config_File::get_key() 373 Retrieves config info based on the key. constructor parserSeeTag::parserSeeTag() 741 sets up the see tag constructor parserTag::parserTag() 743 Set up the tag constructor parserUsedByTag::parserUsedByTag() 746 set up the usedby tag constructor parserReturnTag::parserReturnTag() 740 set up the tag constructor parserPropertyTag::parserPropertyTag() 737 set up the property tag constructor parserLinkTag::parserLinkTag() 733 sets up the link tag constructor parserNameTag::parserNameTag() 735
set up the name tag constructor parserUsesTag::parserUsesTag() set up the uses tag constructor RecordWarning::RecordWarning() Constructor constructor parserLinkInlineTag::parserLinkInlineTag() sets up the tag constructor parserSourceInlineTag::parserSourceInlineTag() constructor constructor parserInlineTag::parserInlineTag() sets up the tag constructor parserInheritdocInlineTag::parserInheritdocInlineTag() Does nothing, overrides parent constructor constructor parserExampleInlineTag::parserExampleInlineTag() constructor constructor parserIdInlineTag::parserIdInlineTag() constructor constructor parserLicenseTag::parserLicenseTag() set up the license tag constructor parserFileSourceTag::parserFileSourceTag() Set $source to $value, and set up path Classes::getRoots() Get a list of all root classes indexed by package. Used to generate class trees by Converter Classes::Inherit() Main processing engine for setting up class inheritance. Classes::nextFile() Prepare to parse a new file Classes::getParentClass() Find the parent class of a class in file $file Classes::getDefiniteChildren() Get all classes confirmed in parsing to be descended class $parclass in file $file Classes::getClassesInPath() Used by parserData::getClasses() to retrieve classes defined in file $path Classes::getConflicts() If a package contains two classes with the same name, this function finds that conflict Classes::processChild() This function recursively climbs up the class tree, setting inherited information like package and adds the elements to phpDocumentor_IntermediateParser. Classes::setClassParent() Find the parent class of $class, and set up structures to note this fact constructor parserAccessTag::parserAccessTag() checks $value to make sure it is private, protected or public, otherwise it's not a valid @access tag constructor parserExampleTag::parserExampleTag() Reads and parses the example file indicated constructor parserList::parserList() Constructor - create a new list constructor phpDocumentor_setup::phpDocumentor_setup()
747 771 780 783 779 778 774 776 732 730 665
664
664
666
667 726
Checks PHP version, makes sure it is 4.2.0+, and chooses the constructor Io::Io() creates an array $this->phpDocOptions and sets program options in it. constructor phpDocumentor_IntermediateParser::phpDocumentor_IntermediateParser() sets up basic data structures constructor parserTocInlineTag::parserTocInlineTag() constructor constructor parserTutorialInlineTag::parserTutorialInlineTag() constructor constructor parserXMLDocBookTag::parserXMLDocBookTag() sets up the tag constructor ObjectWordParser::ObjectWordParser() ChangeLog constructor parserEntity::parserEntity() sets up the entity constructor XMLPackagePageParser::XMLPackagePageParser() Set up the wordparser constructor phpDocumentor_XML_Beautifier_Tokenizer::phpDocumentor_XML_Beautifier_Tokenizer() Initialize the $tokenpushEvent, $wordpushEvent arrays constructor ppageParser::ppageParser() set up invariant Parser variables Converter.inc Source code CHMdefaultConverter.inc Source code clone5.inc.php Source code common.inc.php Source code clone.inc.php Source code Classes.inc Source code class.phpdocpdf.php Source code config.php Source code constructor phpDocumentor_TutorialHighlightParser::phpDocumentor_TutorialHighlightParser() Initialize the $tokenpushEvent, $wordpushEvent arrays constructor phpDocumentor_HighlightParser::phpDocumentor_HighlightParser() Initialize the $tokenpushEvent, $wordpushEvent arrays constructor parserPage::parserPage() sets package to default package constructor parserDocBlock::parserDocBlock() sets package to default constLink::$type constLink class constant link classLink class link classLink::$type
906 909 960 1034 1204 1205 1203 1185 1113 1171
constructor parserConst::parserConst() constructor parserMethod::parserMethod() constructor parserDescParser::parserDescParser() sets $wp to be a ObjectWordParser constructor phpDocumentorTParser::phpDocumentorTParser() Constructor constructor Parser::Parser() Set up invariant parsing variables constructor parserVar::parserVar() constructor parserPackagePage::parserPackagePage() constructor parserTutorial::parserTutorial() Classes::getClassByPackage() Search for a class in a package Classes::getClass() Get the parserClass representation of a class from its name and file core.rm_auto.php Smarty plugin core.run_insert_handler.php Smarty plugin core.smarty_include_php.php Smarty plugin core.rmdir.php Smarty plugin core.read_cache_file.php Smarty plugin core.process_cached_inserts.php Smarty plugin core.process_compiled_include.php Smarty plugin core.write_cache_file.php Smarty plugin core.write_compiled_include.php Smarty plugin Config Config file for MLib constructor brokenlinkstovars::brokenlinkstovars() CONSTANT2 blah blah short description CONSTANT1 blah blah short description core.write_compiled_resource.php Smarty plugin core.write_file.php Smarty plugin core.load_resource_plugin.php Smarty plugin core.load_plugins.php Smarty plugin constructor Smarty::Smarty() The class constructor. constructor Smarty_Compiler::Smarty_Compiler() The class constructor. core.assemble_plugin_filepath.php
838 851 893 896 887 860 854 857 664 663 420 421 422 419 418 416 417 423 424 508 531 505 505 425 426 415 414 382 396 405
Smarty plugin Config_File::set_path() Set the path where configuration files can be found. Config_File::load_file() Load a configuration file manually. Config_File::get_section_names() Get all section names from a loaded file. Config_File::get_var_names() Get all global or section variable names. core.assign_smarty_interface.php Smarty plugin core.create_dir_structure.php Smarty plugin core.is_secure.php Smarty plugin core.is_trusted.php Smarty plugin core.get_php_resource.php Smarty plugin core.get_microtime.php Smarty plugin core.display_debug_console.php Smarty plugin core.get_include_path.php Smarty plugin childofpriv what happens here? testing bug 564135 ClubBase Classes.inc Intermediate class parsing structure. clone.inc.php Object clone method clone5.inc.php Object clone method config.php phpDocumentor :: docBuilder Web Interface constructor testClass::testClass() ctest::btest() constructor kiddie_b587733::kiddie_b587733() common.inc.php Common information needed by all portions of the application checkForBugCondition() Crash in case of known, dangerous bug condition Classes::addPackageToFile() Mark a package as being used in a class Classes::addVar() While parsing, add a variable to the list of parsed variables Classes::addMethod() While parsing, add a method to the list of parsed methods Classes::addConst() While parsing, add a variable to the list of parsed variables Classes Intermediate class parsing structure.
374 373 373 373 406 407 412 413 411 410 408 409 533 534 631 632 634 623 552 538 548 635 652 663 663 662 662 661
Classes::addClass() While parsing, add a class to the list of parsed classes constructor ctest::ctest() ctest::$t3 ClubBase::getPropType() getPropType gibt den Datentyp eines Objekt-Eigenschaft zurueck. ClubBase::loadClass() ClubBase::getProperty() getProperty() Gibt den Wert einer Eigenschaft zurueck ClubBase::getAllProperties() getAllProperties() Gibt die Wert aller Eigenschaften einer Klasse zurueck ClubBase::$_bPrintFlush constructor ClubBase::ClubBase() ClubBase() Der Konstruktor ClubBase::printFlush() ClubBase::printVar() ctest ctest::$t1 ClubBase::_PHPDOCUMENTOR_DEBUG() _PHPDOCUMENTOR_DEBUG() Debugmeldungen ausgeben ClubBase::_ERROR() _ERROR() Fehler registrieren und ggf. zur Debug-Ausgabe weiterleiten ClubBase::setDebug() set_debug() Debug-Level fuer die Klasse setzen ClubBase::setProperty() setProperty() Setzt den Wert einer Eigenschaft Cezpdf::ezPrvtTableDrawLines() Cezpdf::ezPrvtTableColumnHeadings() Converter::getFormattedDescMethods() Get a list of methods in child classes that override this method Converter::getFormattedDescVars() Get a list of vars in child classes that override this var Converter::getFormattedImplements() returns an array containing the class inheritance tree from the root object to the class. Converter::getFormattedConflicts() Converter::getFileSourcePath() Return the fixed path to the source-code file folder. Converter::getDefineLink() return false or a defineLink to $expr Converter::getFileSourceName() Translate the path info into a unique file name for the highlighted source code. Converter::getFormattedInheritedConsts() Return template-enabled list of inherited class constants Converter::getFormattedInheritedMethods() Return template-enabled list of inherited methods Converter::getGlobalLink() return false or a globalLink to $expr Converter::getGlobalValue() Parse a global variable's default value for class initialization. Converter::getFunctionLink() return false or a functionLink to $expr
662 538 538 535 535 535 534 534 534 536 536 538 538 537 537 536 536 324 323 169 170 170
Converter::getFormattedOverrides() Get the method this method overrides, if any Converter::getFormattedInheritedVars() Return template-enabled list of inherited variables Converter::getFormattedMethodImplements() Get the method this method(s) implemented from an interface, if any Converter::getCurrentPageURL() Return the path to the current Converter::getCurrentPageLink() Converter::flushHighlightCache() Return the close text for the current token Converter::formatIndex() Called by walk() while converting. Converter::formatLeftIndex() Called by walk() while converting. Converter::exampleProgramExample() Used to convert the {@example} inline tag in a docblock. Converter::endPage() Called by walk() while converting, when the last procedural page element has been parsed. Converter::EncloseParagraph() Used to enclose a paragraph in a docblock Converter::endClass() Called by walk() while converting, when the last class element has been parsed. Converter::formatPkgIndex() Called by walk() while converting. Converter::formatTutorialTOC() Creates a table of contents for a {@toc} inline tag in a tutorial Converter::getConstLink() return false or a constLink to $expr in $class Converter::getConverterDir() Get the absolute path to the converter's base directory Converter::getClassLink() return false or a classLink to $expr Converter::getClassesOnPage() gets a list of all classes declared on a procedural page represented by Converter::generateChildClassList() returns a list of child classes Converter::generateFormattedClassTree() returns an array containing the class inheritance tree from the root object to the class. Converter::getHighlightState() Converter::getId() take abstractLink descendant and text $eltext and return a Converter::Output() do all necessary output Converter::postProcess() This version does nothing Converter::prepareDocBlock() convert the element's DocBlock for output Converter::newSmarty() Return a Smarty template object to operate with
172 171 172 168 168 164 165 165 164 164
163 163
Converter::ListItem() 183 Used to convert the contents of <<li>> in a docblock Converter::Italicize() 182 Used to convert the contents of <<i>> in a docblock Converter::Kbdize() 182 Used to convert the contents of <<kbd>> in a docblock Converter::PreserveWhiteSpace() 184 Used to convert the contents of <<pre>> in a docblock Converter::ProgramExample() 185 Used to convert the <<code>> tag in a docblock Converter::setTargetDir() 186 Sets the output directory for generated documentation Converter::setTemplateBase() 187 Set the template directory with a different template base directory Converter::setSourcePaths() 186 Mark a file as having had source code highlighted Converter::Sampize() 186 Used to convert the contents of <<samp>> in a docblock Converter::returnLink() 185 take URL $link and text $text and return a link in the format needed for the Converter Converter::returnSee() 185 take abstractLink descendant and text $eltext and return a link Converter::highlightTutorialSource() 182 Used to allow converters to format the source code of Tutorial XML the way they'd like. Converter::highlightSource() 181 Used to allow converters to format the source code the way they'd like. Converter::getSortedClassTreeFromClass() 176 Return a tree of all classes that extend this class Converter::getSourceLink() 178 Converter::getPageLink() 176 return false or a pageLink to $expr Converter::getMethodLink() 175 return false or a methodLink to $expr in $class Converter::getIncludeValue() 174 Parse an include's file to see if it is a file documented in this project Converter::getLink() 174 The meat of the @see tag and inline {@link} tag Converter::getState() 178 Return parserStringWithInlineTags::Convert() cache state Converter::getTutorialId() 178 Return a converter-specific id to distinguish tutorials and their sections Converter::hasTutorial() 181 Converter::highlightDocBlockSource() 181 Used to allow converters to format the source code of DocBlocks the way they'd like. Converter::hasSourceCode() 181 Determine whether an element's file has generated source code, used for linking to line numbers of source. Converter::getVarLink() 180 return false or a varLink to $expr in $class Converter::getTutorialLink() 179
The meat of the @tutorial tag and inline {@tutorial} tag Converter::getTutorialTree() Get a tree structure representing the hierarchy of tutorials Converter::EncloseList() Used to convert the contents of <<ol>> or <<ul>> in a docblock Converter::createParentDir() Recursively creates all subdirectories that don't exist in the $dir path Converter::$package_output set to value of -po commandline Converter::$package_parents Hierarchy of packages Converter::$page name of current page being converted Converter::$package_elements alphabetical index of all elements sorted by package, subpackage, page, and class. Converter::$packagecategories Packages associated with categories Converter::$outputformat output format of this converter Converter::$package package name currently being converted Converter::$page_contents alphabetical index of all elements on a page by package/subpackage Converter::$page_data template for the procedural page currently being processed Converter::$processSpecialRoots This converter knows about the new root tree processing Converter::$quietmode controls display of progress information while parsing. Converter::$pkg_elements alphabetical index of all elements, indexed by package/subpackage Converter::$path path of current page being converted Converter::$page_elements alphabetized index of procedural pages by package Converter::$parseprivate controls processing of elements marked private with @access private Converter::$leftindex Controls which of the one-element-only indexes are generated. Converter::$highlightingSource Flag used to help converters determine whether to do special source highlighting Converter::$class set to a classname if currently parsing a class, false if not Converter::$classes All class information, organized by path, and by package Converter::$class_contents alphabetical index of all methods and vars in a class by package/subpackage Converter::$all_packages All packages encountered in parsing Converter Base class for all output converters. Converter Manual
149 149 149 151 151 152 152 152 152 151 152 148 148 146 146 146 145 145 128
Converter.inc 143 Base class for all Converters Converter::$class_data 146 template for the class currently being processed Converter::$class_elements 147 alphabetized index of classes by package Converter::$function_elements 148 alphabetized index of functions by package Converter::$global_elements 148 alphabetized index of global variables by package Converter::$elements 147 alphabetical index of all elements Converter::$define_elements 147 alphabetized index of defines by package Converter::$curfile 147 full path of the current file being converted Converter::$curpage 147 current procedural page being processed Converter::$smarty_dir 153 Directory that the smarty templates are in Converter::$sort_absolutely_everything 153 This is used if the content must be passed in the order it should be read, i.e. by package, procedural then classes Converter::convertFunction() 159 Converts function for template output Converter::convertGlobal() 159 Converts global variables for template output Converter::convertInclude() 160 Converts includes for template output Converter::ConvertErrorLog() 158 Convert the phpDocumentor parsing/conversion error log Converter::convertDefine() 158 Converts defines for template output Converter::convertClass() 157 Default Class Handler Converter::convertConst() 158 Converts class constants for template output. Converter::convertMethod() 160 Converts method for template output Converter::convertPage() 160 Default Page Handler Converter::Convert_RIC() 162 Convert README/INSTALL/CHANGELOG file contents to output format Converter::copyFile() 162 Copies a file from the template directory to the target directory Converter::convertVar() 162 Converts class variables for template output. Converter::convertTutorial() 161 Default Tutorial Handler Converter::ConvertTitle() 161 Convert the title of a Tutorial docbook tag section Converter::ConvertTodoList() 161 Convert the list of all @todo tags
Converter::Convert() 157 Convert all elements to output format Converter::cleanup() 157 Finish up parsing/cleanup directories Converter::$templateDir 154 Directory that the template is in, relative to phpDocumentor root directory Converter::$templateName 154 Name of the template, from last part of -o Converter::$targetDir 154 directory that output is sent to. -t command-line sets this. Converter::$subpackage 153 subpackage name currently being converted Converter::$sort_page_contents_by_type 153 This determines whether the $page_contents array should be sorted by element type as well as alphabetically by name Converter::$sourcePaths 153 A list of files that have had source code generated Converter::$template_options 154 Options for each template, parsed from the options.ini file in the template base directory Converter::$title 154 Converter::Br() 156 Used to convert <<br>> in a docblock Converter::checkState() 156 Compare parserStringWithInlineTags::Convert() cache state to $state Converter::Bolden() 156 Used to convert the contents of <<b>> in a docblock Converter::AttrToString() 155 Convert the attribute of a Tutorial docbook tag's attribute list Converter::$todoList 155 List of all @todo tags and a link to the element with the @todo constructor Converter::Converter() 155 Initialize Converter data structures Converter::setTemplateDir() 187 sets the template directory based on the $outputformat and $name Converter::sortPageContentsByElementType() 187 sorts $page_contents by element type as well as alphabetically CHMdefaultConverter::ProgramExample() 213 Used to convert the <<code>> tag in a docblock CHMdefaultConverter::rcNatCmp() 213 does a nat case sort on the specified second level value of the array CHMdefaultConverter::rcNatCmp1() 213 does a nat case sort on the specified second level value of the array. CHMdefaultConverter::postProcess() 213 Uses htmlspecialchars() on the input CHMdefaultConverter::Output() 212 Create the phpdoc.hhp, contents.hhc files needed by MS HTML Help Compiler to create a CHM file CHMdefaultConverter::getTutorialId() 211 CHMdefaultConverter::getVarLink() 212 CHMdefaultConverter::returnLink() 214 CHMdefaultConverter::returnSee() 214 This function takes an abstractLink descendant and returns an html link CHMdefaultConverter::TutorialExample() 215
CHMdefaultConverter::unmangle() 215 CHMdefaultConverter::sourceLine() 215 Return a line of highlighted source code with formatted line number CHMdefaultConverter::SmartyInit() 214 CHMdefaultConverter::setTargetDir() 214 calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied CHMdefaultConverter::setTemplateDir() 214 CHMdefaultConverter::getSourceLink() 211 CHMdefaultConverter::getSourceAnchor() 211 Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag. CHMdefaultConverter::getCurrentPageLink() 208 CHMdefaultConverter::getDefineLink() 208 CHMdefaultConverter::getExampleLink() 208 CHMdefaultConverter::getConstLink() 207 CHMdefaultConverter::getClassLink() 207 CHMdefaultConverter::generateTOC() 207 CHMdefaultConverter::getCData() 207 CHMdefaultConverter::getFunctionLink() 208 CHMdefaultConverter::getGlobalLink() 209 CHMdefaultConverter::getPageName() 210 CHMdefaultConverter::getRootTree() 211 return formatted class tree for the Class Trees page CHMdefaultConverter::getPageLink() 210 CHMdefaultConverter::getMethodLink() 210 CHMdefaultConverter::getId() 209 CHMdefaultConverter::getIndexInformation() 209 Generate indexing information for given element CHMdefaultConverter::writeExample() 215 CHMdefaultConverter::writefile() 216 Write a file to disk, and add it to the $hhp_files list of files to include in the generated CHM Cezpdf::ezColumnsStop() 322 Cezpdf::ezGetCurrentPageNumber() 322 Cezpdf::ezImage() 322 Cezpdf::ezColumnsStart() 322 Cezpdf::execTemplate() 322 constructor Cezpdf::Cezpdf() 321 Cezpdf::alink() 322 Cezpdf::ezInsertMode() 322 Cezpdf::ezNewPage() 323 Cezpdf::ezPrvtGetTextWidth() 323 Cezpdf::ezPRVTpageNumberSearch() 323 Cezpdf::ezPRVTcleanUp() 323 Cezpdf::ezPRVTaddPageNumbers() 323 Cezpdf::ezOutput() 323 Cezpdf::ezProcessText() 323 Cezpdf::$y 321 Cezpdf::$ezPages 321 class.phpdocpdf.php 258 Cezpdf callback class customized for phpDocumentor constructor PDFdefaultConverter::PDFdefaultConverter() 263
constructor HTMLSmartyConverter::HTMLSmartyConverter() 240 constructor HTMLframesConverter::HTMLframesConverter() 221 sets $base_dir to $targetDir CHMdefaultConverter::writeNewPPage() 216 CHMdefaultConverter::writeSource() 216 constructor PDFParser::PDFParser() 273 Sets up the wordparser for this class constructor phpdocpdf::phpdocpdf() 275 Cezpdf::$ez 321 Cezpdf::$ezPageCount 321 Cezpdf 321 This class will take the basic interaction facilities of the Cpdf class and make more useful functions so that the user does not have to know all the ins and outs of pdf presentation to produce something pretty. class.ezpdf.php 320 constructor XMLDocBookConverter::XMLDocBookConverter() 285 sets $base_dir to $targetDir constructor XMLDocBookpeardoc2Converter::XMLDocBookpeardoc2Converter() 303 sets $base_dir to $targetDir CHMdefaultConverter::generatePkgElementIndexes() 207 CHMdefaultConverter::generatePkgElementIndex() 206 Generate alphabetical index of all elements by package and subpackage CHMdefaultConverter::$class_dir 195 output directory for the current class being processed CHMdefaultConverter::$current 195 contains all of the template procedural page element loop data needed for the current template CHMdefaultConverter::$currentclass 195 contains all of the template class element loop data needed for the current template CHMdefaultConverter::$base_dir 195 target directory passed on the command-line. CHMdefaultConverter 194 Generates files that MS HTML Help Worshop can use to create a MS Windows compiled help file (CHM) Converter::_tutorial_path() 193 Returns the path to this tutorial as a string CHMdefaultConverter.inc 194 CHM (Compiled Help Manual) output converter for Smarty Template. CHMdefaultConverter::$juststarted 196 controls formatting of parser informative output CHMdefaultConverter::$KLinks 196 Table of Contents entry for index.hhk CHMdefaultConverter::$page_dir 197 output directory for the current procedural page being processed CHMdefaultConverter::$ric_set 197 CHMdefaultConverter::$package_pages 196 array of converted package page names. CHMdefaultConverter::$outputformat 196 CHMdefaultConverter::$leftindex 196 indexes of elements by package that need to be generated CHMdefaultConverter::$name 196 Converter::_setHighlightCache() 193 Converter::_rmdir() 193
Completely remove a directory and its contents Converter::TutorialExample() 189 Converter::type_adjust() 189 Called by parserReturnTag::Convert() to allow converters to change type names to desired formatting Converter::TranslateTag() 188 Used to translate an XML DocBook tag from a tutorial by reading the options.ini file for the template. Converter::TranslateEntity() 188 Used to translate an XML DocBook entity like ” from a tutorial by reading the options.ini file for the template. Converter::sourceLine() 188 Return a line of highlighted source code with formatted line number Converter::startHighlight() 188 Initialize highlight caching Converter::unmangle() 189 Called by parserSourceInlineTag::stringConvert() to allow converters to format the source code the way they'd like. Converter::vardump_tree() 190 Debugging function for dumping $tutorial_tree Converter::writeFile() 192 Writes a file to target dir Converter::writeSource() 192 Write out the formatted source code for a php file Converter::writeExample() 191 Write out the formatted source code for an example php file Converter::walk_everything() 191 walk over elements by package rather than page Converter::Varize() 190 Used to convert the contents of <<var>> in a docblock Converter::walk() 190 called by phpDocumentor_IntermediateParser::Convert() to traverse the array of pages and their elements, converting them to the output format CHMdefaultConverter::$sort_page_contents_by_type 197 CHMdefaultConverter wants elements sorted by type as well as alphabetically CHMdefaultConverter::$wrote 197 CHMdefaultConverter::endClass() 203 Writes out the template file of $class_data and unsets the template to save memory CHMdefaultConverter::endPage() 203 Writes out the template file of $page_data and unsets the template to save memory CHMdefaultConverter::formatIndex() 203 CHMdefaultConverter uses this function to format template index.html and packages.html CHMdefaultConverter::copyMediaRecursively() 203 CHMdefaultConverter::Convert_RIC() 203 Convert README/INSTALL/CHANGELOG file contents to output format CHMdefaultConverter::convertTutorial() 202 CHMdefaultConverter::convertVar() 202 Converts class variables for template output CHMdefaultConverter::formatLeftIndex() 204 Generate indexes for li_package.html and classtree output files CHMdefaultConverter::formatPkgIndex() 204 CHMdefaultConverter chooses to format both package indexes and the complete index here
CHMdefaultConverter::generateFormattedInterfaceTrees() 206 returns a template-enabled array of interface inheritance trees CHMdefaultConverter::generateKLinks() 206 Get the table of contents for index.hhk CHMdefaultConverter::generateFormattedClassTrees() 205 returns a template-enabled array of class trees CHMdefaultConverter::generateFormattedClassTree() 205 returns an array containing the class inheritance tree from the root object to the class CHMdefaultConverter::formatTutorialTOC() 205 Use the template tutorial_toc.tpl to generate a table of contents for HTML CHMdefaultConverter::generateElementIndex() 205 Generate alphabetical index of all elements CHMdefaultConverter::ConvertTodoList() 202 CHMdefaultConverter::convertPage() 202 converts procedural pages for template output CHMdefaultConverter::addTOC() 199 CHMdefaultConverter::convertClass() 199 Converts class for template output CHMdefaultConverter::addSourceTOC() 198 CHMdefaultConverter::addKLink() 198 Add an item to the index.hhk file constructor CHMdefaultConverter::CHMdefaultConverter() 197 sets $base_dir to $targetDir CHMdefaultConverter::addHHP() 198 CHMdefaultConverter::convertConst() 199 Converts class constants for template output CHMdefaultConverter::convertDefine() 200 Converts defines for template output CHMdefaultConverter::convertMethod() 201 Converts class methods for template output CHMdefaultConverter::convertPackagepage() 201 Converts package page and sets its package as used in $package_pages CHMdefaultConverter::convertInclude() 201 Converts include elements for template output CHMdefaultConverter::convertGlobal() 201 Converts global variables for template output CHMdefaultConverter::ConvertErrorLog() 200 Create errors.html template file output CHMdefaultConverter::convertFunction() 200 Converts function for template output Converter Default Template Variables 117
D
defineLink define link DocBlockTags.inc All abstract representations of DocBlock tags are defined by the classes in this file defineLink::$type DescHTML.inc Source code 791 725
791 1253
DocBlockTags.inc 1259 Source code DescHTML.inc 715 All abstract representations of html tags in DocBlocks are handled by the classes in this file decideOnOrOff() 652 Fuzzy logic to interpret the boolean args' intent DirNode::$path 353 full path to this node DirNode 353 Directory Node DIR_SEP 368 DIR_SEP isn't used anymore, but third party apps might dummy() 527 Im a dummy function currently you need at least one function in your procedural page for this to work debug() 635 Debugging output Documentable PHP Elements 36
E
ErrorTracker::addErrorReturn() add a new error to the $errors array and returns the error string ErrorTracker::addWarning() add a new warning to the $warnings array ErrorTracker::addError() add a new error to the $errors array ErrorTracker::$warnings array of RecordWarnings ErrorTracker::$linenum ErrorTracker::handleEvent() This function subscribes to two events in the Parser in order to keep track of line number information and file name. ErrorTracker::returnErrors() Get sorted array of all non-fatal errors in parsing/conversion EventStack.inc Source code Errors.inc Source code ErrorTracker::returnWarnings() Get sorted array of all warnings in parsing/conversion ErrorTracker::returnLastWarning() Get the warning message of the last warning ErrorTracker::returnLastError() Get the error message of the last error ErrorTracker::$lastwarning index in $warnings of last warning triggered ErrorTracker::$lasterror index in $errors of last error triggered EventStack::$num The number of events in the stack 768 768 767 767 767 768
EventStack::$stack The stack EventStack An event Stack EventStack.inc An Event Stack for inter-program communication, particularly for parsing ezStartPageNumbers() tests function param bug EventStack::getEvent() Get the current event EventStack::popEvent() Pop an event from the stack ErrorTracker::$curfile ErrorTracker::$errors array of RecordErrors ErrorTracker contains all the errors/warnings Errors.inc Error handling for phpDocumentor EventStack::pushEvent() Push an event onto the stack element I'm an element
668 667 638 516 668 668 767 767 766 750 668 365
F
func3() few few::$pfh ****===really fancy===**** func2() func1() func 1 function.popup_init.php Smarty plugin function.var_dump.php func() functionincomment functionincomment::process() FAQ file_dialog.php Source code find_phpdoc.php Source code find_phpdoc.php Utility file to locate phpDocumentor for a non-PEAR installation functionLink::$type fancy_debug() Returns a formatted var_dump for debugging purposes. functionLink function link function.popup.php 500 500 455 456 497 539 539 954 1164 1356 914 792 636 792 454 500 538 539
Smarty plugin function.math.php Smarty plugin function.cycle.php Smarty plugin function.debug.php Smarty plugin function.eval.php Smarty plugin function.counter.php Smarty plugin function.config_load.php Smarty plugin function.assign.php Smarty plugin function.assign_debug_info.php Smarty plugin function.fetch.php Smarty plugin function.html_checkboxes.php Smarty plugin function.html_select_time.php Smarty plugin function.html_table.php Smarty plugin function.mailto.php Smarty plugin function.html_select_date.php Smarty plugin function.html_radios.php Smarty plugin function.html_image.php Smarty plugin function.html_options.php Smarty plugin file_dialog.php phpDocumentor :: docBuilder Web Interface
453 433 435 436 432 431 429 430 437 438 448 449 451 446 444 440 442 351
G
global $phpDocumentor_errors 750 global $_phpDocumentor_setting 652 $_phpDocumentor_setting is either the value from the web interface, or is set up by Io::parseArgv() global $phpDocumentor_error_descrip 754 Error messages for phpDocumentor parser errors global $phpDocumentor_warning_descrip 756 Error messages for phpDocumentor parser warnings globalLink::$type 793 globalLink 792 global variable link global $phpDocumentor_DefaultPackageName 652
default package name, set using -dn --defaultpackagename global $phpDocumentor_DefaultCategoryName default package name, set using -dn --defaultcategoryname globalSetVar() Set a variable, used by the template engine but available to all scripts globalGetVar() Get a variable's value global $bqnp_tester The tokenizer splits up strings that have inline variables getDir() global $interface $interface is either 'web' or is not set at all get_include_path() global $_MLIB_GLOBAL_DSN Global DSN to be used by classes
H
HTMLSmartyConverter::getPageContents() HTMLSmartyConverter::getMethodLink() HTMLSmartyConverter::getPageLeft() HTMLSmartyConverter::getPageLink() HTMLSmartyConverter::getPageName() HTMLSmartyConverter::getIndexInformation() Generate indexing information for given element HTMLSmartyConverter::getId() HTMLSmartyConverter::getDefineLink() HTMLSmartyConverter::getExampleLink() HTMLSmartyConverter::getFunctionLink() HTMLSmartyConverter::getGlobalLink() HTMLSmartyConverter::getRootTree() return formatted class tree for the Class Trees page HTMLSmartyConverter::getSourceAnchor() Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag. HTMLSmartyConverter::postProcess() Uses htmlspecialchars() on the input HTMLSmartyConverter::Output() This function is not used by HTMLdefaultConverter, but is required by Converter HTMLSmartyConverter::ProgramExample() Used to convert the <<code>> tag in a docblock HTMLSmartyConverter::rcNatCmp() does a nat case sort on the specified second level value of the array HTMLSmartyConverter::rcNatCmp1() does a nat case sort on the specified second level value of the array. HTMLSmartyConverter::makeLeft() HTMLSmartyConverter::getVarLink() HTMLSmartyConverter::getSourceLink() HTMLSmartyConverter::getTutorialId() HTMLSmartyConverter::getTutorialList() HTMLSmartyConverter::getTutorialTree() HTMLSmartyConverter::getCurrentPageLink() 252 251 252 252 252 251 251 250 250 250 250 252 253
254 254 254 254 255 254 253 253 253 253 253 249
HTMLSmartyConverter::getConstLink() 249 HTMLSmartyConverter::endClass() 245 Writes out the template file of $class_data and unsets the template to save memory HTMLSmartyConverter::copyMediaRecursively() 245 HTMLSmartyConverter::endPage() 245 Writes out the template file of $page_data and unsets the template to save memory HTMLSmartyConverter::formatIndex() 245 HTMLdefaultConverter uses this function to format template index.html and packages.html HTMLSmartyConverter::formatLeftIndex() 246 Generate indexes for li_package.html and classtree output files HTMLSmartyConverter::Convert_RIC() 245 Convert README/INSTALL/CHANGELOG file contents to output format HTMLSmartyConverter::convertVar() 244 Converts class variables for template output HTMLSmartyConverter::convertPackagepage() 243 Converts package page and sets its package as used in $package_pages HTMLSmartyConverter::convertPage() 244 converts procedural pages for template output HTMLSmartyConverter::ConvertTodoList() 244 HTMLSmartyConverter::convertTutorial() 244 HTMLSmartyConverter::formatPkgIndex() 246 HTMLdefaultConverter chooses to format both package indexes and the complete index here HTMLSmartyConverter::formatTutorialTOC() 247 Use the template tutorial_toc.tpl to generate a table of contents for HTML HTMLSmartyConverter::getCData() 249 HTMLSmartyConverter::getClassContents() 249 HTMLSmartyConverter::getClassLeft() 249 HTMLSmartyConverter::getClassLink() 249 HTMLSmartyConverter::generatePkgElementIndexes() 248 HTMLSmartyConverter::generatePkgElementIndex() 248 Generate alphabetical index of all elements by package and subpackage HTMLSmartyConverter::generateElementIndex() 247 Generate alphabetical index of all elements HTMLSmartyConverter::generateFormattedClassTree() 247 returns an array containing the class inheritance tree from the root object to the class HTMLSmartyConverter::generateFormattedClassTrees() 247 returns a template-enabled array of class trees HTMLSmartyConverter::generateFormattedInterfaceTrees() 248 returns a template-enabled array of interface inheritance trees HTMLSmartyConverter::returnLink() 255 HTMLSmartyConverter::returnSee() 255 This function takes an abstractLink descendant and returns an html link HTML_TreeNode::$events 360 Javascript event handlers; HTML_TreeNode::$ensureVisible 360 Should this node be made visible? HTML_TreeNode::$expanded 360 Whether this node is expanded or not HTML_TreeNode::$icon 360 The icon for this node. HTML_TreeNode::$isDynamic 361 Whether this node is dynamic or not
HTML_TreeNode::$cssClass 360 The css class for this node HTML_TreeNode 360 HTML_TreeNode class HTML_TreeMenu_Listbox::toHTML() 358 Returns the HTML generated HTML_TreeMenu_Presentation 358 HTML_TreeMenu_Presentation class HTML_TreeMenu_Presentation::$menu 359 The TreeMenu structure HTML_TreeMenu_Presentation::printMenu() 359 Prints the HTML generated by the toHTML() method. HTML_TreeNode::$items 361 Indexed array of subnodes HTML_TreeNode::$link 361 The link for this node. HighlightParser.inc 868 Source Code Highlighting HighlightParserTests.php 655 HTMLframesConverter.inc 1060 Source code HTMLSmartyConverter.inc 1086 Source code HighlightParser.inc 1323 Source code htmlArraySelect() 625 Returns a select box based on an key,value array where selected is based on key HighlightParserGetInlineTagsTests.php 555 Unit Tests for the HighlightParser->getInlineTags() method HTML_TreeNode::$parent 361 The parent node. Null if top level HTML_TreeNode::$text 361 The text for this node. HTML_TreeNode::addItem() 362 Adds a new subnode to this node. HTML_TreeNode::setOption() 362 Allows setting of various parameters after the initial HTML_TreeMenu_Listbox::$promoText 358 The text that is displayed in the first option HTML_TreeMenu_Listbox::$linkTarget 358 Target for the links generated HTMLSmartyConverter::writeRIC() 257 HTMLSmartyConverter::writeNewPPage() 257 HTMLSmartyConverter::writeSource() 257 HTML_TreeMenu 354 HTML_TreeMenu Class HTML_TreeMenu::$items 354 Indexed array of subnodes HTMLSmartyConverter::writeExample() 257 HTMLSmartyConverter::unmangle() 256 HTMLSmartyConverter::setTargetDir() 255 calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied
HTMLSmartyConverter::SmartyInit() 256 HTMLSmartyConverter::sourceLine() 256 Return a line of highlighted source code with formatted line number HTMLSmartyConverter::TutorialExample() 256 HTML_TreeMenu::addItem() 354 This function adds an item to the the tree. HTML_TreeMenu_DHTML 355 HTML_TreeMenu_DHTML class HTML_TreeMenu_DHTML::toHTML() 357 Returns the HTML for the menu. This method can be used instead of printMenu() to use the menu system with a template system. HTML_TreeMenu_Listbox 357 HTML_TreeMenu_Listbox class HTML_TreeMenu_Listbox::$indentChar 357 The character used for indentation HTML_TreeMenu_Listbox::$indentNum 357 How many of the indent chars to use HTML_TreeMenu_DHTML::$userPersistence 356 Whether to use clientside persistence or not HTML_TreeMenu_DHTML::$noTopLevelImages 356 Whether to skip first level branch images HTML_TreeMenu_DHTML::$defaultClass 355 The default CSS class for the nodes HTML_TreeMenu_DHTML::$images 355 Path to the images HTML_TreeMenu_DHTML::$isDynamic 356 Dynamic status of the treemenu. If true (default) this has no effect. If false it will override all dynamic status vars and set the menu to be fully expanded an non-dynamic. HTML_TreeMenu_DHTML::$linkTarget 356 Target for the links generated HTMLSmartyConverter::convertMethod() 243 Converts class methods for template output HTMLSmartyConverter::convertInclude() 243 Converts include elements for template output HTMLframesConverter::endPage() 226 Writes out the template file of $page_data and unsets the template to save memory HTMLframesConverter::endClass() 226 Writes out the template file of $class_data and unsets the template to save memory HTMLframesConverter::formatIndex() 226 HTMLdefaultConverter uses this function to format template index.html and packages.html HTMLframesConverter::formatLeftIndex() 227 Generate indexes for li_package.html and classtree output files HTMLframesConverter::formatPkgIndex() 227 HTMLdefaultConverter chooses to format both package indexes and the complete index here HTMLframesConverter::copyMediaRecursively() 226 HTMLframesConverter::Convert_RIC() 225 Convert README/INSTALL/CHANGELOG file contents to output format HTMLframesConverter::convertPage() 224 converts procedural pages for template output HTMLframesConverter::ConvertTodoList() 225
HTMLframesConverter::convertTutorial() 225 HTMLframesConverter::convertVar() 225 Converts class variables for template output HTMLframesConverter::formatTutorialTOC() 227 Use the template tutorial_toc.tpl to generate a table of contents for HTML HTMLframesConverter::generateElementIndex() 228 Generate alphabetical index of all elements HTMLframesConverter::getConstLink() 230 HTMLframesConverter::getClassLink() 229 HTMLframesConverter::getCurrentPageLink() 230 HTMLframesConverter::getDefineLink() 230 HTMLframesConverter::getExampleLink() 231 HTMLframesConverter::getCData() 229 HTMLframesConverter::generatePkgElementIndexes() 229 HTMLframesConverter::generateFormattedClassTree() 228 returns an array containing the class inheritance tree from the root object to the class HTMLframesConverter::generateFormattedClassTrees() 228 returns a template-enabled array of class trees HTMLframesConverter::generateFormattedInterfaceTrees() 228 returns a template-enabled array of interface inheritance trees HTMLframesConverter::generatePkgElementIndex() 229 Generate alphabetical index of all elements by package and subpackage HTMLframesConverter::convertPackagepage() 224 Converts package page and sets its package as used in $package_pages HTMLframesConverter::convertMethod() 224 Converts class methods for template output HTMLframesConverter::$leftindex 220 indexes of elements by package that need to be generated HTMLframesConverter::$juststarted 220 controls formatting of parser informative output HTMLframesConverter::$name 220 HTMLframesConverter::$outputformat 220 HTMLframesConverter::$package_pages 220 array of converted package page names. HTMLframesConverter::$currentclass 219 contains all of the template class element loop data needed for the current template HTMLframesConverter::$current 219 contains all of the template procedural page element loop data needed for the current template HTMLSmartyConverter.inc 218 HTML output converter for Smarty Template. HTMLframesConverter 219 HTML output converter. HTMLframesConverter::$base_dir 219 target directory passed on the command-line. HTMLframesConverter::$class_dir 219 output directory for the current class being processed HTMLframesConverter::$page_dir 220 output directory for the current procedural page being processed HTMLframesConverter::$processSpecialRoots 221 This converter knows about the new root tree processing HTMLframesConverter::ConvertErrorLog() 223 Create errors.html template file output
HTMLframesConverter::convertFunction() 223 Converts function for template output HTMLframesConverter::convertGlobal() 223 Converts global variables for template output HTMLframesConverter::convertInclude() 224 Converts include elements for template output HTMLframesConverter::convertDefine() 222 Converts defines for template output HTMLframesConverter::convertConst() 222 Converts class variables for template output HTMLframesConverter::$ric_set 221 HTMLframesConverter::$sort_page_contents_by_type 221 Smarty Converter wants elements sorted by type as well as alphabetically HTMLframesConverter::$wrote 221 HTMLframesConverter::convertClass() 222 Converts class for template output HTMLframesConverter::getFunctionLink() 231 HTMLframesConverter::getGlobalLink() 231 HTMLSmartyConverter::$juststarted 239 controls formatting of parser informative output HTMLSmartyConverter::$currentclass 239 contains all of the template class element loop data needed for the current template HTMLSmartyConverter::$leftindex 239 indexes of elements by package that need to be generated HTMLSmartyConverter::$name 239 HTMLSmartyConverter::$outputformat 239 HTMLSmartyConverter::$current 239 contains all of the template procedural page element loop data needed for the current template HTMLSmartyConverter::$class_dir 239 output directory for the current class being processed HTMLframesConverter::writeNewPPage() 237 HTMLframesConverter::writeSource() 238 HTMLSmartyConverter 238 HTML output converter. HTMLSmartyConverter::$base_dir 238 target directory passed on the command-line. HTMLSmartyConverter::$package_pages 239 array of converted package page names. HTMLSmartyConverter::$page_dir 240 output directory for the current procedural page being processed HTMLSmartyConverter::convertDefine() 241 Converts defines for template output HTMLSmartyConverter::ConvertErrorLog() 242 Create errors.html template file output HTMLSmartyConverter::convertFunction() 242 Converts function for template output HTMLSmartyConverter::convertGlobal() 242 Converts global variables for template output HTMLSmartyConverter::convertConst() 241 Converts class variables for template output HTMLSmartyConverter::convertClass() 241 Converts class for template output
HTMLSmartyConverter::$processSpecialRoots 240 This converter knows about the new root tree processing HTMLSmartyConverter::$ric_set 240 HTMLSmartyConverter::$sort_page_contents_by_type 240 Smarty Converter wants elements sorted by type as well as alphabetically HTMLSmartyConverter::$wrote 240 HTMLframesConverter::writeExample() 237 HTMLframesConverter::unmangle() 237 HTMLframesConverter::getSourceLink() 234 HTMLframesConverter::getSourceAnchor() 233 Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag. HTMLframesConverter::getTutorialId() 234 HTMLframesConverter::getTutorialTree() 234 HTMLframesConverter::getVarLink() 234 HTMLframesConverter::getRootTree() 233 return formatted class tree for the Class Trees page HTMLframesConverter::getPageName() 233 HTMLframesConverter::getId() 232 HTMLframesConverter::getIndexInformation() 232 Generate indexing information for given element HTMLframesConverter::getMethodLink() 232 HTMLframesConverter::getPageLink() 232 HTMLframesConverter::makeLeft() 235 HTMLframesConverter::Output() 235 This function is not used by HTMLdefaultConverter, but is required by Converter HTMLframesConverter::setTargetDir() 236 calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied HTMLframesConverter::SmartyInit() 236 HTMLframesConverter::sourceLine() 237 Return a line of highlighted source code with formatted line number HTMLframesConverter::TutorialExample() 237 HTMLframesConverter::returnSee() 236 This function takes an abstractLink descendant and returns an html link HTMLframesConverter::returnLink() 236 HTMLframesConverter::postProcess() 235 Uses htmlspecialchars() on the input HTMLframesConverter::ProgramExample() 235 Used to convert the <<code>> tag in a docblock HTMLframesConverter::rcNatCmp() 235 does a nat case sort on the specified second level value of the array HTMLframesConverter::rcNatCmp1() 235 does a nat case sort on the specified second level value of the array. HTMLframesConverter.inc 217 HTML original framed output converter, modified to use Smarty Template.
I
Io::$ignore Format: array(array(regexp-ready string to search for whole path, Io 669 668
Class to handle file and user io opperations IntermediateParserTests.php Io::$phpDocOptions Holds all the options that are avaible to the cmd line interface Io::$valid_booleans A specific array of values that boolean-based arguments can understand, aided by the decideOnOrOff() helper method. Io::dirList() Io::checkIgnore() Tell whether to ignore a file or a directory allows * and ? wildcards Ioinc_sortfiles() Sorting functions for the file list Ioinc_mystrucsort() Sorting functions for the file list iParser iNewRender::$vars array of class variables by package, subpackage and class iNewRender::$targetDir used to set the output directory iparserElement IntermediateParserAddPrivatePageTests.php Unit Tests for the IntermediateParser->addPrivatePage() method Io.inc File and input handling routines IntermediateParser.inc The phpDocumentor_IntermediateParser Class Io::displayHelpMsg() create the help message for display on the command-line Io::getAllFiles() Take a filename with wildcards and return all files that match the InlineTags.inc All abstract representations of inline tags are in this file Io::_setupIgnore() Construct the $ignore array Io::removeNonMatches() Removes files from the $dir array that do not match the search string in INSTALL IntermediateParser.inc Source code InlineTags.inc Source code Io.inc Source code Io::readPhpFile() Reads a file and returns it as a string Does basic error checking Io::parseArgv() Parses $_SERVER['argv'] and creates a setup array Io::getDirTree() Io::getBase() Retrieve common directory (case-insensitive in windows) Io::getReadmeInstallChangelog()
670 670
641 640 547 547 546 547 557 640 639 670 670 773 674 673 952 1212 1292 1238 673
Io::getRegExpableSearchString() 672 Converts $s into a string that can be used with preg_match Io::isIncludeable() 672 calls http://www.php.net/file_exists for each value in include_path, Io::getTutorials() 672 Retrieve tutorial subdirectories and their contents from the list of iNewRender::$quietMode 546 set in phpdoc.inc to the value of the quitemode commandline option. iNewRender::$private_class 546 this variable is used to prevent parsing of private elements if $parsePrivate is false. iHTMLConverter::Convert() 541 iHTMLConverter 540 Base class for all output converters. iConverter::walk() 540 iiparserBase 541 iiparserBase::$type 542 always base iiparserBase::getType() 542 iiparserBase::$value 542 set to different things by its descendants iConverter 539 Base class for all output converters. inline {@tutorial} 111 inline {@internal}} 101 inline {@id} 99 inline {@inheritdoc} 102 inline {@link} 104 inline {@toc} 109 inline {@source} 106 iiparserBase::getValue() 542 iiparserBase::setValue() 542 iNewRender::$methods 545 array of methods by package, subpackage and class iNewRender::$links 544 the workhorse of linking. iNewRender::$event_handlers 544 the functions which handle output from the Parser iNewRender::$packageoutput 545 array of packages to parser and output documentation for, if not all packages should be documented iNewRender::$pages 545 iNewRender::$pkg_elements 546 iNewRender::$parsePrivate 546 set in phpdoc.inc to the value of the parserprivate commandline option. iNewRender::$elements 544 iNewRender::$data 544 data contains parsed structures for the current page being parsed iNewRender::$classpackage 542 set to the name of the package of the current class being parsed iNewRender 542 iNewRender::$classpackages 543 used in Converter::getClassPackage() to inherit package from parent classes. iNewRender::$classsubpackage 543
set to the name of the subpackage of the current class being parsed iNewRender::$class_children An array of extended classes by package and parent class Format: array(packagename => array(parentclass => array(childclassname1, childclassname2,... iNewRender::$classtree a tree of class inheritance by name. inline {@example}
543
543 97
K
kiddie_b587733 548
L
LinkClasses.inc Source code LinkClasses.inc Linking to element documentation is performed by the classes in this file. 1306 788
M
MLIB_LOG_FILE Default log file MLIB_SYSLOG_PRIORITY Syslog priority MLIB_TEMPLATE_PATH Template path MLIB_USE_SYSLOG Use syslog MLIB_INCLUDE_PATH MLib include path MLIB_GLOBAL_DEBUG Global debugging modifier.truncate.php Smarty plugin modifier.upper.php Smarty plugin modifier.wordwrap.php Smarty plugin mama metoo methodLink::$class methodLink::$type methodLink::addLink() sets up the link methodLink method link multipl::func() 509 509 509 510 509 508 478 479 480 548 548 793 793 793 793 549
metoo::$mine multipl multipl::$manyvars modifier.strip_tags.php Smarty plugin modifier.strip.php Smarty plugin modifier.date_format.php Smarty plugin modifier.debug_print_var.php Smarty plugin modifier.default.php Smarty plugin modifier.count_words.php Smarty plugin modifier.count_sentences.php Smarty plugin modifier.cat.php Smarty plugin modifier.count_characters.php Smarty plugin modifier.count_paragraphs.php Smarty plugin modifier.escape.php Smarty plugin modifier.htmlentities.php modifier.replace.php Smarty plugin modifier.spacify.php Smarty plugin modifier.string_format.php Smarty plugin modifier.regex_replace.php Smarty plugin modifier.rawurlencode.php modifier.indent.php Smarty plugin modifier.lower.php Smarty plugin modifier.nl2br.php Smarty plugin modifier.capitalize.php Smarty plugin
548 549 549 477 476 463 464 465 462 461 458 459 460 466 467 473 474 475 472 471 468 469 470 457
N
new_phpdoc.php Source code new_phpdoc.php Advanced Web Interface to phpDocumentor notseen 1183 629 554
O
ObjectWordParser::nextIsObjectOrNonNL() Determine if the next word is an inline tag ObjectWordParser::setup() Set the word parser to go. ObjectWordParser::getWord() ObjectWordParser Like WordParser but designed to handle an array with strings and one() one outputfilter.trimwhitespace.php Smarty plugin 925 925 925 924 504 514 481
P
parserClass::getInheritedMethods() parserClass::getInheritedConsts() parserClass::getInheritedVars() parserClass::getLink() quick way to link to this element parserClass::getMethodNames() parserClass::getMethod() parserClass::getImplements() parserClass::getExtends() parserClass::addTutorial() parserClass::addImplements() parserClass::getChildClassList() returns a list of all child classes of this class parserClass::getConflicts() Returns all classes in other packages that have the same name as this class parserClass::getConsts() parserClass::getConstNames() parserClass::getMethods() parserClass::getModifiers() Get the PHP5+ modifiers for this class parserClass::hasVar() parserClass::hasMethod() parserClass::isInterface() parserClass::setAccessModifiers() Use this method to set access modifiers for a class parserClass::setInterface() Use this method to set the type of class to be an interface parserClass::setExtends() parserClass::hasConst() parserClass::getVars() parserClass::getParentClassTree() parserClass::getParent() retrieve object that represents the parent class parserClass::getSourceLocation() parserClass::getTutorial() Get the associated tutorial for this class, if any 832 832 832 833 833 833 832 832 831 830 831 831 832 831 833 833 835 835 835 836 836 836 835 835 834 833 834 834
parserClass::getVarNames() 835 parserClass::getVar() 835 parserClass::$_implements 830 parserClass::$type 830 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' parserDocBlock::replaceInheritDoc() 824 Wrapper for parserDesc::replaceInheritDoc() parserDocBlock::postProcess() 824 Parse out any html tags from doc comments, and make them into parserDocBlock::resetParams() 825 parserDocBlock::setDesc() 825 parserDocBlock::setExplicitCategory() 825 Used if this docblock has a @category tag. parserDocBlock::setEndLineNumber() 825 Sets the ending line number for the DocBlock parserDocBlock::overridePackage() 824 set the element's package to the passed values. Used in phpDocumentor_IntermediateParser to align package of parserDocBlock::listTags() 824 parserDocBlock::getSDesc() 823 parserDocBlock::getLineNumber() 823 Retrieve starting line number parserDocBlock::getType() 823 parserDocBlock::hasInheritDoc() 823 Wrapper for parserDesc::hasInheritDoc() parserDocBlock::listProperties() 824 parserDocBlock::listParams() 824 parserDocBlock::setExplicitPackage() 825 Used if this docblock has a @package tag. parserDocBlock::setLineNumber() 825 Sets the starting line number for the DocBlock parserClass::$extends 829 parserClass::$curfile 829 parserClass::$ignore 829 Used to determine whether a class should be ignored or not. Helps maintain integrity of parsing parserClass::$parent 829 Format: array(file, parent) where parent class is found or false if no parent parserClass::$tutorial 830 parserClass::$sourceLocation 830 parserClass 828 ParserElements.inc 828 Parser Elements, all classes representing documentable elements parserDocBlock::setSource() 826 Passes to parserStringWithInlineTags::setSource() parserDocBlock::setShortDesc() 826 Set the short description of the DocBlock parserDocBlock::updateGlobals() 826 replaces nameless global variables in the $funcglobals array with their names parserDocBlock::updateModifiers() 827 parserDocBlock::updateStatics() 827 replaces nameless static variables in the $statics array with their names
parserDocBlock::updateParams() 827 replaces nameless parameters in the $params array with their names parserClass::setModifiers() 836 Set the PHP5+ modifiers for this class parserClass::setParent() 836 parserFunction::addStatics() 845 Add all "static $var, $var2 = 6" declarations to this function parserFunction::addSource() 845 Set the source code. Always array in PHP 4.3.0+ parserFunction::getConflicts() 845 Returns all functions in other packages that have the same name as this function parserFunction::getFunctionCall() 846 Get a human-friendly description of the function call parserFunction::getLink() 846 quick way to link to this element parserFunction::getIntricateFunctionCall() 846 Like getFunctionCall(), but has no English or pre-determined formatting. parserFunction::addParam() 845 parserFunction::addGlobals() 844 Add all "global $var, $var2" declarations to this function parserFunction::$params 843 parameters parsed from function definition. parserFunction::$globals 843 global declarations parsed from function definition parserFunction::$returnsreference 844 Function returns a reference to an element, instead of a value parserFunction::$source 844 parserFunction::$type 844 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' parserFunction::$statics 844 static variable declarations parsed from function definition parserFunction::getParam() 846 parserFunction::getReturnsReference() 846 parserGlobal::getConflicts() 847 Returns all global variables in other packages that have the same name as this global variable parserGlobal::$type 847 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' parserGlobal::getDataType() 848 Retrieve converter-specific representation of the data type parserGlobal::getLink() 848 quick way to link to this element parserInclude 849 parserGlobal::setDataType() 848 Sets the name of the global variable's type parserGlobal::$datatype 847 Name of the global's data type parserGlobal 847 parserFunction::hasSource() 846 Determine whether the source code has been requested via {@source} parserFunction::getSource() 846
parserFunction::listGlobals() 847 parserFunction::listParams() 847 parserFunction::setReturnsReference() 847 sets $returnsreference to true parserFunction::listStatics() 847 parserFunction 843 parserElement::setPath() 842 parserDefine::getConflicts() 839 Returns all defines in other packages that have the same name as this define parserDefine::$type 839 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' parserDefine::getLink() 839 quick way to link to this element parserElement 840 all elements except parserPackagePage descend from this abstract class parserElement::$docblock 840 parserElement::$conflicts 840 parserDefine 839 parserConst::getLink() 838 quick way to link to this element parserClass::setSourceLocation() 837 parserClass::setParentNoClass() 837 parserConst 837 parserConst::$class 837 parserConst::getClass() 838 Retrieve the class name parserConst::$type 838 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' parserElement::$endlinenumber 841 line number on file where this element stops parserElement::$file 841 location of this element (filename) parserElement::setDocBlock() 842 parserElement::getPath() 841 parserElement::setEndLineNumber() 842 Sets the ending line number of elements parserElement::setFile() 842 parserElement::setName() 842 parserElement::setLineNumber() 842 Set starting line number parserElement::getPackage() 841 parserElement::getName() 841 parserElement::$name 841 name of this element, or include type if element is a parserInclude parserElement::$linenumber 841 Line number in the source on which this element appears parserElement::$path 841 full path location of this element (filename) parserElement::getEndLineNumber() 841 parserElement::getLineNumber() 841 parserElement::getFile() 841
parserDocBlock::getKeyword() parserDocBlock::getExplicitPackage() If the DocBlock has a @package tag, then this returns true parserPage::$parserVersion parserPage::$packageOutput Used to limit output, contains contents of --packageoutput commandline. parserPage::$path parserPage::$source Tokenized source code of the file parserPage::$subpackage parserPage::$sourceLocation relative source location parserPage::$package parserPage::$origName original phpdoc-safe name (only letters, numbers and _) parserPage::$category parserPage Contains information about a PHP file, used to group procedural elements together. parserPage::$file filename.ext (no path) parserPage::$id not implemented in this version, will be used to link xml output pages parserPage::$name phpdoc-safe name (only letters, numbers and _) parserPage::$modDate not implemented yet parserPage::$type Type is used by many functions to skip the hassle of if parserPage::getFile() gets the file name parserPage::setPath() sets the path to the file parserPage::setPackageOutput() loads the package output array parserPage::setSource() Sets the source code of the file for highlighting. parserPage::setSourceLocation() sets the source location parserStringWithInlineTags::$type Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah'... parserStringWithInlineTags Used to represent strings that contain inline tags, so that they can be properly parsed at link time parserPage::setName() sets the name parserPage::setFile() Sets the name to display in documentation (can be an alias set with @name) parserPage::getPackageOutput() gets the package output array parserPage::getName() gets the name
823 823 805 804 805 805 805 805 804 804 804 803
804 804 804 804 805 806 808 807 808 808 809
809
parserPage::getParseData() Not implemented in this version parserPage::getPath() gets the path parserPage::getType() gets the tag type parserPage::getSourceLocation() gets the source location parserData::setParent() sets the parent parserData::setDocBlock() sets the docblock parserData::$clean used by phpDocumentor_IntermediateParser::handleDocBlock() to parserData::$classelements array of parsed class elements parserData::$docblock DocBlock (parserDocBlock) for this page, or false if not set parserData::$elements array of parsed elements parserData::$parent parserPage element that is this parserData's parent, or false if not set. parserData::$links array of links descended from abstractLink parserData Contains an in-memory representation of all documentable elements (parserPage, parserFunction, parserDefine, parserInclude, parserClass, parserMethod, parserVar) and their DocBlocks (parserDocBlock). parserBase::setValue() sets the given value parserBase Base class for all elements ParserData.inc Parser Data Structures parserBase::$type Type is used by many functions to skip the hassle of if parserBase::$value set to different things by its descendants parserBase::getValue() gets the value parserBase::getType() gets the type parserData::$privateclasselements array of parsed class elements with @access private parserData::$privateelements array of parsed elements with @access private parserData::getTutorial() If this file has a tutorial associated with it, returns a link to the tutorial. parserData::getName() Get the output-safe filename (. changed to _)
806 806 807 806 803 803 799 799 800 800 800
800 799
798 797 797 798 798 798 798 800 800 802
802
parserData::hasClasses() Does this package have classes? parserData::hasExplicitDocBlock() If the page-level DocBlock was present in the source, returns true parserData::isClean() checks if the element is "cleaned" already parserData::hasInterfaces() Does this package have interfaces? parserData::getLink() returns a link parserData::getClasses() returns a list of all classes declared in a file parserData::$type Type is used by many functions to skip the hassle of if parserData::$tutorial parserData::addElement() add a new element to the tracking array parserData::addLink() adds a link parserData::explicitDocBlock() Tells this page that its DocBlock was not implicit parserData::addTutorial() adds a tutorial parser parserStringWithInlineTags::$value array of strings and parserInlineTags parserStringWithInlineTags::add() equivalent to the . operator ($a = $b . $c) parserDocBlock::addKeyword() parserDocBlock::addFuncGlobal() adds a function declaration of @global to the $funcglobals array parserDocBlock::addLink() creates a parserLinkTag and adds it to the $tags array parserDocBlock::addName() Adds a @name tag to the tag list parserDocBlock::addParam() parserDocBlock::addPackage() parserDocBlock::addFileSource() Adds a new @filesource tag to the DocBlock parserDocBlock::addExample() adds an @example tag parserDocBlock::$subpackagedescrip description of subpackage parsed from @package tag parserDocBlock::$subpackage parserDocBlock::$tags array of parserTags parserDocBlock::$unknown_tags array of unrecognized parserTags parserDocBlock::addAccess() add an @access tag to the tags array parserDocBlock::$var This is either a parserVarTag or false if no var tag is present parserDocBlock::addProperty() Adds a @property(-read or -write) or @method magic tag to the DocBlock
802 802 802 802 802 802 801 801 801 801 802 801 809 809 819 818 819 819 820 819 818 818 817 817 817 817 818 817 820
parserDocBlock::addReturn() 820 creates a parserReturnTag and adds it to the $tags array parserDocBlock::changeParam() 822 parserDocBlock::changeGlobal() 822 parserDocBlock::changeStatic() 823 parserDocBlock::getDesc() 823 parserDocBlock::getExplicitCategory() 823 If the DocBlock has a @category tag, then this returns true parserDocBlock::getEndLineNumber() 823 Retrieve ending line number parserDocBlock::cantSource() 822 Tells the DocBlock it can't have a @filesource tag parserDocBlock::canSource() 822 Tells the DocBlock it can have a @filesource tag parserDocBlock::addStaticVar() 821 parserDocBlock::addSee() 820 creates a parserLinkTag and adds it to the $tags array parserDocBlock::addTag() 821 Used to insert DocBlock Template tags into a docblock parserDocBlock::addUnknownTag() 821 adds an unknown tag to the $unknown_tags array for use by custom converters parserDocBlock::addVar() 822 creates a parserVarTag and adds it to the $tags array parserDocBlock::addUses() 821 Add a @uses tag to the DocBlock parserDocBlock::$statics 817 array of static variable data. parserDocBlock::$sdesc 817 parserDesc::hasInheritDoc() 813 parserDesc::add() 813 parserDesc::hasSource() 813 parserDesc::replaceInheritDoc() 813 replaces {@inheritdoc} with the contents of the parent DocBlock parserDocBlock::$category 814 parserDocBlock 814 Represents a docblock and its components, $desc, $sdesc, $tags, and also $params for functions parserDesc::$type 813 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' parserDesc 812 represents a short or long description in a DocBlock (parserDocBlock) parserStringWithInlineTags::getString() 810 return the string unconverted (all inline tags are taken out - this should only be used in pre-parsing to see if any other text is in the string) parserStringWithInlineTags::Convert() 809 Use to convert the string to a real string with all inline tags parsed and linked parserStringWithInlineTags::hasInlineTag() 810 Determine whether the string contains any inline tags parserStringWithInlineTags::setSource() 810 Pass source code to any {@source} tags contained within the string
for later conversion. ParserDocBlock.inc 812 DocBlock Parser Classes parserStringWithInlineTags::trimmedStrlen() 811 equivalent to trim(strlen($string)) parserDocBlock::$desc 814 parserDocBlock::$endlinenumber 814 Line number in the source on which this docblock ends parserDocBlock::$params 816 array of param data. parserDocBlock::$packagedescrip 816 description of package parsed from @package tag parserDocBlock::$processed_desc 816 parserDocBlock::$processed_sdesc 816 parserDocBlock::$return 816 This is either a parserReturnTag or false if no return tag is present parserDocBlock::$properties 816 array of parserPropertyTag, parserPropertyReadTag, parserPropertyWriteTag, parserMethodTag magic tags parserDocBlock::$package 815 parserDocBlock::$linenumber 815 Line number in the source on which this docblock begins parserDocBlock::$explicitpackage 815 fix for bug 591396 parserDocBlock::$explicitcategory 814 fix for bug 708559 parserDocBlock::$funcglobals 815 array of global variable data. parserDocBlock::$hasaccess 815 whether this DocBlock has an @access tag parserDocBlock::$hasname 815 whether this DocBlock has a @name tag parserInclude::$type 849 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' parserMethod 849 parserDescParser::getParserEventName() 894 parserDescParser::doSimpleList() 893 Return a simple list, if found parserDescParser::parse() 894 Parse a long or short description for tags parserDescParser::setupStates() 894 setup the parser tokens, and the pushEvent/popEvent arrays phpDocumentorTParser::$eventHandlers 896 phpDocumentorTParser 895 Tokenizer-based parser for PHP source code parserDescParser 893 Parses a DocBlock description to retrieve abstract representations of Parser::varTagHandler() 892 handles @var Parser::propertyTagHandler() 891 Handles @property(-read or -write) and @method magic tag Parser::parse() 890
Parse a new file Parser::returnTagHandler() 891 handles @return Parser::setupStates() 891 setup the parser tokens, and the pushEvent/popEvent arrays Parser::usesTagHandler() 892 handles @uses Parser::staticvarTagHandler() 892 handles @staticvar phpDocumentorTParser::$inlineTagHandlers 896 phpDocumentorTParser::$source_location 896 relative path of the parsed file from the base parse directory phpDocumentor_HighlightWordParser::getWord() 900 Retrieve the next token phpDocumentor_HighlightWordParser::backupPos() 900 back the word parser to the previous token as defined by $last_token phpDocumentor_HighlightWordParser::nextToken() 900 Retrieve the position of the next token that will be parsed in the internal token array phpDocumentor_HighlightWordParser::setup() 900 Initialize the parser object phpDocumentor_peardoc2_XML_Beautifier::formatFile() 901 format a file or URL phpDocumentor_peardoc2_XML_Beautifier 901 This is just like XML_Beautifier, but uses phpDocumentor_XML_Beautifier_Tokenizer phpDocumentor_HighlightWordParser 899 Retrieve tokens from an array of tokens organized by line numbers phpDocumentor_HighlightParser::setupStates() 899 Initialize all parser state variables phpDocumentor_HighlightParser 897 Highlights source code using parse() phpDocumentorTParser::parse() 896 Parse a new file phpDocumentor_HighlightParser::configWordParser() 897 Give the word parser necessary data to begin a new parse phpDocumentor_HighlightParser::newLineNum() 898 wraps the current line (via the converter) and resets it to empty phpDocumentor_HighlightParser::setLineNum() 899 Start the parsing at a certain line number phpDocumentor_HighlightParser::parse() 898 Parse a new file Parser::paramTagHandler() 890 handles @param Parser::packageTagHandler() 890 handles @package PHPDOCUMENTOR_PDP_EVENT_ATTRIBUTES 885 when tag attributes name="value" are found phpDocumentorTParser.inc 881 tokenizer extension-based parser for PHP code PHPDOCUMENTOR_PDP_EVENT_CDATA 885 when <![CDATA[ ]]> is found PHPDOCUMENTOR_PDP_EVENT_ENTITY 886 when tag attributes name="value" are found
PHPDOCUMENTOR_PDP_EVENT_TAG 886 when a DocBook <tag> is found PHPDOCUMENTOR_PDP_EVENT_PROGRAMLISTING 886 when <programlisting> is found PHPDOCUMENTOR_EVENT_VAR 876 Class Variable published to IntermediateParser with this event PHPDOCUMENTOR_EVENT_TUTORIAL 876 Tutorial published to IntermediateParser with this event PHPDOCUMENTOR_EVENT_NEWLINENUM 875 use to inform ErrorTracker of the next line number being parsed PHPDOCUMENTOR_EVENT_NEWFILE 875 use to inform ErrorTracker of a new file being parsed PHPDOCUMENTOR_EVENT_NEWSTATE 875 use to inform IntermediateParser of a new element being parsed PHPDOCUMENTOR_EVENT_PACKAGEPAGE 875 Package-level page published to IntermediateParser with this event PHPDOCUMENTOR_EVENT_README_INSTALL_CHANGELOG 875 Contents of README/INSTALL/CHANGELOG files published to IntermediateParser with this event PHPDOCUMENTOR_EVENT_PAGE 875 New File (page) published to IntermediateParser with this event PHPDOCUMENTOR_PDP_STATE_ATTRIBUTES 886 when tag attributes name="value" are found PHPDOCUMENTOR_PDP_STATE_CDATA 886 when <![CDATA[ ]]> is found Parser::endTag() 888 Called to clean up at the end of parsing a @tag in a docblock Parser::defaultTagHandler() 888 Handles all standard tags that only have a description Parser::exampleTagHandler() 888 handles @example Parser::getParserEventName() 889 Debugging function, takes an event number and attempts to return its name Parser::invalidTagHandler() 889 Handles tags like '@filesource' that only work in PHP 4.3.0+ Parser::globalTagHandler() 889 handles @global Parser::configWordParser() 888 tell the parser's WordParser $wp to set up tokens to parse words by. Parser::checkEventPush() 887 this function checks whether parameter $word is a token for pushing a new event onto the Event Stack. PHPDOCUMENTOR_PDP_STATE_PROGRAMLISTING 886 when <programlisting> is found PHPDOCUMENTOR_PDP_STATE_ENTITY 886 when tag attributes name="value" are found PHPDOCUMENTOR_PDP_STATE_TAG 886 when a DocBook <tag> is found Parser 886 PHP Parser for PHP 4.2.3Parser::checkEventPop() 887 this function checks whether parameter $word is a token for popping the current event off of the Event Stack.
Parser::categoryTagHandler() handles @category phpDocumentor_peardoc2_XML_Beautifier::formatString() format an XML string phpDocumentor_TutorialHighlightParser Highlights source code using parse() parserXMLDocBookTag::hasTitle() Determine whether the docbook element has a title parserXMLDocBookTag::getTOC() Retrieve either the table of contents index, or the location that the TOC will go parserXMLDocBookTag::setId() If the id attribute is present, this method will set its id parserXMLDocBookTag::setTitle() Set the title of a DocBook tag section. parserXMLDocBookTag::startCData() Begin a new CData section parserXMLDocBookTag::setTOC() sets the TOC value parserXMLDocBookTag::getTitle() Retrieve Converter-specific formatting of the title of this element parserXMLDocBookTag::getSubsection() Retrieve the contents of a subsection parserXMLDocBookTag::addAttribute() Add an xml tag attribute name="value" pair parserXMLDocBookTag::add() Add contents to this tag. parserXMLDocBookTag::addCData() add a word to CData parserXMLDocBookTag::Convert() calls the output conversion parserXMLDocBookTag::getId() Return converter-specific formatting of ID. parserXMLDocBookTag::endCData() Adds $_cdata to $value phpDocumentorTWordParser.inc tokenizer extension-based lexer for PHP code phpDocumentorTWordParser Like WordParser, but expects an array of tokens from the tokenizer instead of a string. phpDocumentorTWordParser::tokenEquals() Utility function to determine whether two tokens from the tokenizer are equal phpDocumentorTWordParser::setup() Uses http://www.php.net/token_get_all to tokenize the source code. ParserPDF.inc Source code PDFdefaultConverter.inc Source code phpdoc.inc Source code phpdoc.php Source code phpDocumentorTWordParser::getWord()
921 922 922 922 921 921 919 919 920 920 920 920 923 925
Retrieve a token for the phpDocumentorTParser phpDocumentorTWordParser::getSource() 928 loads up next set of source code phpDocumentorTWordParser::addSource() 926 Generate source token arrays organized by line number phpDocumentorTWordParser::addFileSource() 926 Wrapper for addSource() used to retrieve the entire source code organized by line number in setup() phpDocumentorTWordParser::backupPos() 926 backs the parser up to the previous position phpDocumentorTWordParser::concatTokens() 927 Utility function to convert a series of tokens into a string phpDocumentorTWordParser::getFileSource() 927 gets the source code tokens phpDocumentorTWordParser::findGlobal() 927 Tell the phpDocumentorTWordParser to return the entire global variable if it is found. parserXMLDocBookTag::$name 919 Name of the tag parserXMLDocBookTag::$attributes 918 Attributes from the XML tag phpDocumentor_XML_Beautifier_Tokenizer::$eventHandlers 906 phpDocumentor_XML_Beautifier_Tokenizer 905 Highlights source code using parse() phpDocumentor_XML_Beautifier_Tokenizer::checkEventPop() 906 this function checks whether parameter $word is a token for popping the current event off of the Event Stack. phpDocumentor_XML_Beautifier_Tokenizer::checkEventPush() 906 this function checks whether parameter $word is a token for pushing a new event onto the Event Stack. phpDocumentor_XML_Beautifier_Tokenizer::getParserEventName() 907 phpDocumentor_XML_Beautifier_Tokenizer::configWordParser() 907 tell the parser's WordParser $wp to set up tokens to parse words by. phpDocumentor_TutorialHighlightParser::setupStates() 905 Initialize all parser state variables phpDocumentor_TutorialHighlightParser::setLineNum() 905 Start the parsing at a certain line number phpDocumentor_TutorialHighlightParser::checkEventPush() 903 This function checks whether parameter $word is a token for pushing a new event onto the Event Stack. phpDocumentor_TutorialHighlightParser::checkEventPop() 902 This function checks whether parameter $word is a token for popping the current event off of the Event Stack. phpDocumentor_TutorialHighlightParser::configWordParser() 903 Tell the parser's WordParser $wp to set up tokens to parse words by. phpDocumentor_TutorialHighlightParser::getParserEventName() 904 searches for a parser event name based on its number phpDocumentor_TutorialHighlightParser::parse() 904 Parse a new file phpDocumentor_TutorialHighlightParser::newLineNum() 904 advances output to a new line phpDocumentor_XML_Beautifier_Tokenizer::incdataHandler() 907 Handler for real character data
phpDocumentor_XML_Beautifier_Tokenizer::parseString() 907 Parse a new file parserCData 916 Represents <![CDATA[ ]]> sections. PackagePageElements.inc 915 Data structures used in parsing XML DocBook-based tutorials parserCData::Convert() 916 calls the output conversion parserEntity 917 a standard entity like ” parserXMLDocBookTag 918 a standard XML DocBook Tag parserEntity::Convert() 917 calls the output conversion ppageParser::setupStates() 910 set up invariant Parser variables ppageParser::parse() 910 Parse a new file ppageParser 909 Global package page parser phpDocumentor_XML_Beautifier_Tokenizer::setupStates() 908 Initialize all parser state variables ppageParser::$package 909 ppageParser::$subpackage 909 ppageParser::handleInlineDockeyword() 910 handler for INLINE_DOCKEYWORD. ppageParser::defaultHandler() 909 Handles all non-inline tags PHPDOCUMENTOR_EVENT_MESSAGE 875 PHPDOCUMENTOR_EVENT_INCLUDE 875 Include (include/require/include_once/include_once) published to IntermediateParser with this event parserTutorial::isChildOf() 858 Determine if this parserTutorial object is a child of another parserTutorial::getTitle() 858 Retrieve the title of the tutorial, or of any subsection parserTutorial::setNext() 858 parserTutorial::setParent() 859 parserVar 860 parserTutorial::setPrev() 859 parserTutorial::getPrev() 858 Retrieve converter-specific link to the previous tutorial's documentation parserTutorial::getParent() 857 Retrieve converter-specific link to the parent tutorial's documentation parserTutorial::$type 856 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' parserTutorial::$tutorial_type 856 Either cls, pkg, or proc parserTutorial::$_xml 856 parserTutorial::Convert() 857 parserTutorial::getNext() 857 Retrieve converter-specific link to the next tutorial's documentation
parserTutorial::getLink() 857 Get a link to this tutorial, or to any subsection of this tutorial parserVar::$class 860 parserVar::$type 860 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' PHPDOC_XMLTOKEN_EVENT_ATTRIBUTE 864 used when a <tag attr="attribute"> is found PHPDOC_BEAUTIFIER_CDATA 864 do not remove, needed in plain renderer PHPDOC_XMLTOKEN_EVENT_CDATA 865 used when a <! is found PHPDOC_XMLTOKEN_EVENT_CLOSETAG 865 used when a close </tag> is found PHPDOC_XMLTOKEN_EVENT_DEF 865 used when a <! is found PHPDOC_XMLTOKEN_EVENT_COMMENT 865 used when a <!-- comment --> is found parserVar::setModifiers() 861 Return name of the class that contains this method parserVar::getOverridingVarsForClass() 861 parserVar::getClass() 860 Retrieve the class name parserVar::$_modifiers 860 parserVar::getLink() 861 quick way to link to this element parserVar::getModifiers() 861 Return a list of access modifiers (static/private/etc.) parserVar::getOverridingVars() 861 parserVar::getOverrides() 861 parserTutorial::$prev 856 link to the previous tutorial in a document series, or false if none parserTutorial::$path 856 path to the tutorial page parserMethod::getIntricateFunctionCall() 851 parserMethod::getImplements() 851 parserMethod::getLink() 852 quick way to link to this element parserMethod::getModifiers() 852 Return name of the class that contains this method parserMethod::getOverridingMethods() 852 parserMethod::getOverrides() 852 parserMethod::getFunctionCall() 851 adds "constructor " to start of function call if $isConstructor is true parserMethod::getClass() 851 Return name of the class that contains this method parserMethod::$isConstructor 850 parserMethod::$class 850 parserMethod::$isDestructor 850 parserMethod::$type 850 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' parserMethod::addParam() 851
parserMethod::$_modifiers 851 parserMethod::getOverridingMethodsForClass() 852 parserMethod::setConstructor() 853 Use this method to tell the parser that this method is the class constructor parserTutorial::$linked_element 855 The documentable element this tutorial is linked to parserTutorial::$ini 854 output from tutorialname.ext.ini parserTutorial::$name 855 filename minus extension of this tutorial (used for @tutorial tag) parserTutorial::$next 855 link to the next tutorial in a document series, or false if none parserTutorial::$parent 855 link to the parent tutorial in a document series, or false if none parserTutorial::$package 855 parserTutorial::$children 854 links to the child tutorials, or false if none parserTutorial 854 parserMethod::setModifiers() 853 Return name of the class that contains this method parserMethod::setDestructor() 853 Use this method to tell the parser that this method is the class constructor parserPackagePage 853 parserPackagePage::$package 853 parserPackagePage::Convert() 854 parserPackagePage::$type 853 Type is used by many functions to skip the hassle of if phpDocumentor_get_class($blah) == 'parserBlah' PHPDOC_XMLTOKEN_EVENT_DOUBLEQUOTE 865 used when a <!-- comment --> is found PHPDOC_XMLTOKEN_EVENT_ENTITY 865 used when an &entity; is found PARSER_EVENT_NOEVENTS 873 used for the beginning of parsing, before first < ? php encountered PARSER_EVENT_METHOD_LOGICBLOCK 873 used by the HighlightParser only, when a method body is parsed PARSER_EVENT_OUTPHP 873 used when a ? > (with no space) is encountered in parsing PARSER_EVENT_PHPCODE 873 used when php code processor instruction (< ? php) is encountered in parsing PARSER_EVENT_QUOTE_VAR 873 used by the HighlightParser only, when {$var} is encountered in a string PARSER_EVENT_QUOTE 873 used when double quotation mark (") encountered in parsing PARSER_EVENT_METHOD 873 used by the HighlightParser only, when a method starts PARSER_EVENT_LOGICBLOCK 873 { encountered in parsing a function or php code PARSER_EVENT_IMPLEMENTS 872 used when a class implements interfaces PARSER_EVENT_GLOBAL_VALUE 872 used when parsing the default value in a global variable declaration PARSER_EVENT_INCLUDE 872
used when an include/require/include_once/include_once statement is encountered in parsing PARSER_EVENT_INCLUDE_PARAMS 872 used when an opening parenthesis of an include/require/include_once/include_once statement is encountered in parsing PARSER_EVENT_INLINE_DOCKEYWORD 873 used when an inline {@tag} is encountered in parsing a DocBlock PARSER_EVENT_INCLUDE_PARAMS_PARENTHESIS 873 used when an inner ( ) is encountered while parsing an include/require/include_once/include_once statement PARSER_EVENT_SINGLEQUOTE 873 used when a single quote (') is encountered in parsing PARSER_EVENT_STATIC_VAR 873 used when parsing a "static $var1, $var2;" declaration in a function PHPDOCUMENTOR_EVENT_DOCBLOCK_TEMPLATE 874 used when a docblock template is encountered in the source PHPDOCUMENTOR_EVENT_DOCBLOCK 874 DocBlock published to IntermediateParser with this event PHPDOCUMENTOR_EVENT_END_DOCBLOCK_TEMPLATE 874 used when a docblock template is encountered in the source PHPDOCUMENTOR_EVENT_END_PAGE 874 used to inform phpDocumentor_IntermediateParser that the current file has been completely parsed. PHPDOCUMENTOR_EVENT_GLOBAL 875 used when a global variable definition is encountered in the source PHPDOCUMENTOR_EVENT_FUNCTION 875 Function published to IntermediateParser with this event PHPDOCUMENTOR_EVENT_DEFINE 874 Constant (define) published to IntermediateParser with this event PHPDOCUMENTOR_EVENT_CONST 874 Class Constant published to IntermediateParser with this event PARSER_EVENT_TAGS 874 used when parsing the @tag block of a docblock PARSER_EVENT_STATIC_VAR_VALUE 874 used when parsing the value in a "static $var1 = x" declaration in a function PARSER_EVENT_VAR 874 used when a var statement is encountered in parsing a class definition PARSER_EVENT_VAR_ARRAY 874 used when a variable value is an array PHPDOCUMENTOR_EVENT_CLASS 874 Class published to IntermediateParser with this event PARSER_EVENT_VAR_ARRAY_COMMENT 874 used when a comment is found in a variable array value PARSER_EVENT_FUNC_GLOBAL 872 used when parsing a "global $var1, $var2;" declaration in a function PARSER_EVENT_FUNCTION_PARAM_VAR 872 used when a $param is encountered in a function definition PARSER_EVENT_CLASS 870 used when a class definition is encountered in parsing PARSER_EVENT_ARRAY 870 used when an array definition is encountered in parsing PARSER_EVENT_CLASS_CONSTANT 871 used when a class implements interfaces
PARSER_EVENT_CLASS_MEMBER 871 used by the HighlightParser only, when ->var or ->function() is encountered in a method PARSER_EVENT_COMMENTBLOCK 871 used when long comment /x x/ where x is an asterisk is encountered in parsing PARSER_EVENT_COMMENT 871 used when short comment // is encountered in parsing PARSER_EVENT_ACCESS_MODIFIER 870 used when parsing an access modifier Parser.inc 870 Base parser for all parsers PHPDOC_XMLTOKEN_EVENT_NOEVENTS 865 starting state PHPDOC_XMLTOKEN_EVENT_IN_CDATA 865 used when a <![CDATA[ section is found PHPDOC_XMLTOKEN_EVENT_OPENTAG 865 used when an open <tag> is found PHPDOC_XMLTOKEN_EVENT_PI 865 used when a processor instruction is found PHPDOC_XMLTOKEN_EVENT_XML 865 used when a <?xml is found PHPDOC_XMLTOKEN_EVENT_SINGLEQUOTE 865 used when a <!-- comment --> is found PARSER_EVENT_DEFINE 871 used when a define statement is encountered in parsing PARSER_EVENT_DEFINE_GLOBAL 871 used when parsing a global variable declaration PARSER_EVENT_END_STATEMENT 872 PARSER_EVENT_END_DOCBLOCK_TEMPLATE 872 used when encountering a /**#@-* / comment (no space) marking the end of using a docblock template PARSER_EVENT_EOFQUOTE 872 used when a <<< is encountered in parsing PARSER_EVENT_ESCAPE 872 used when a backslash is encountered in parsing a string or other escapable entity PARSER_EVENT_FUNCTION_PARAMS 872 used when a function statement opening parenthesis is encountered in parsing PARSER_EVENT_FUNCTION 872 used when a function definition is encountered in parsing PARSER_EVENT_DOCKEYWORD_EMAIL 872 used when a <email@address> is encountered in parsing an @author tag PARSER_EVENT_DOCKEYWORD 871 used when a @tag is encountered in DocBlock parsing PARSER_EVENT_DEFINE_PARAMS_PARENTHESIS 871 used when a define statement's opening parenthesis is encountered in parsing PARSER_EVENT_DEFINE_PARAMS 871 used when a define statement opening parenthesis is encountered in parsing PARSER_EVENT_DESC 871 used when parsing the desc part of a docblock PARSER_EVENT_DOCBLOCK 871 used when a DocBlock is encountered in parsing PARSER_EVENT_DOCBLOCK_TEMPLATE 871 used when encountering a /**#@+ comment marking a new docblock template
pageLink::$type pageLink procedural page link phpDocumentorTParserTests.php phpDocumentorSetupTests.php PHPUnit_MAIN_METHOD phpDocumentor_IntermediateParser The phpDocumentor_IntermediateParser Class phpDocumentor_IntermediateParser::$classes used to keep track of inheritance at the smartest level possible for a phpDocumentor_IntermediateParser::$all_packages list of all packages encountered while documenting. Used in automatic linking. ParserPageTests.php ParserClassTests.php PHPDOCUMENTOR_PDP_STATE_VAR when <<var>> is found in a desc PHPDOCUMENTOR_PDP_STATE_SIMLIST when a simple list is found in a desc phpdoc.inc startup file ProceduralPages.inc Intermediate procedural page parsing structure. phpDocumentor_out() Print parse information if quiet setting is off Publisher.inc a class for handling the publishing of data phpDocumentor_IntermediateParser::$converters an array of template names indexed by converter name phpDocumentor_IntermediateParser::$cur_class Name of the class currently being parsed. phpDocumentor_IntermediateParser::$pages phpDocumentor_IntermediateParser::$package_parents Keeps track of packages of classes that have parent classes in another package. Used in automatic linking. phpDocumentor_IntermediateParser::$parsePrivate set in Setup.inc.php to the value of the parseprivate commandline phpDocumentor_IntermediateParser::$privatepages Put away a page that has been @ignored or @access private if !$parsePrivate phpDocumentor_IntermediateParser::$proceduralpages used to keep track of all elements in a procedural page. Handles name phpDocumentor_IntermediateParser::$private_class this variable is used to prevent parsing of elements with an @ignore tag phpDocumentor_IntermediateParser::$package_pages array of parsed package pages phpDocumentor_IntermediateParser::$packageoutput array of packages to parser and output documentation for, if not all packages should be documented phpDocumentor_IntermediateParser::$db_template phpDocumentor_IntermediateParser::$data $data contains parsed structures for the current page being parsed phpDocumentor_IntermediateParser::$event_handlers
658 657 647 647 648 649 654 650 675 676 679 678
679 679
the functions which handle output from the Parser phpDocumentor_IntermediateParser::$last phpDocumentor_IntermediateParser::$packagecategories Used to determine the category for tutorials. phpDocumentor_IntermediateParser::$lasttype type of the last parser Element handled PHPDOCUMENTOR_PDP_STATE_SAMP when <<samp>> is found in a desc PHPDOCUMENTOR_PDP_STATE_PRE when <<pre>> is found in a desc PHPDOCUMENTOR_PDP_EVENT_ESCAPE_CODE when << /code>> is found in a <<code>><</code>> section PHPDOCUMENTOR_PDP_EVENT_ESCAPE when the << potential escape for tags is found in a desc PHPDOCUMENTOR_PDP_EVENT_ESCAPE_PRE when << /pre>> is found in a <<pre>><</pre>> section PHPDOCUMENTOR_PDP_EVENT_I when <<i>> is found in a desc PHPDOCUMENTOR_PDP_EVENT_LIST when <<ul>>/<<ol>> is found in a desc PHPDOCUMENTOR_PDP_EVENT_KBD when <<kbd>> is found in a desc PHPDOCUMENTOR_PDP_EVENT_DOUBLECR when \n\n is found in a desc PHPDOCUMENTOR_PDP_EVENT_CODE when <<code>> is found in a desc PHPDOCUMENTOR_WEBSITE PHPDOCUMENTOR_VER PHPDOCUMENTOR_WINDOWS ParserDescCleanup.inc All of the functions to clean up and handle the long description of a DocBlock are in this file. PHPDOCUMENTOR_PDP_EVENT_BR when <<br>> is found in a desc PHPDOCUMENTOR_PDP_EVENT_B when <<b>> is found in a desc PHPDOCUMENTOR_PDP_EVENT_P when <<p>> is found in a desc PHPDOCUMENTOR_PDP_EVENT_PRE when <<pre>> is found in a desc PHPDOCUMENTOR_PDP_STATE_ESCAPE_PRE when << /pre>> is found in a <<pre>><</pre>> section PHPDOCUMENTOR_PDP_STATE_ESCAPE_CODE when << /code>> is found in a <<code>><</code>> section PHPDOCUMENTOR_PDP_STATE_I when <<i>> is found in a desc PHPDOCUMENTOR_PDP_STATE_KBD when <<kbd>> is found in a desc PHPDOCUMENTOR_PDP_STATE_P when <<p>> is found in a desc PHPDOCUMENTOR_PDP_STATE_LIST when <<ul>>/<<ol>> is found in a desc PHPDOCUMENTOR_PDP_STATE_ESCAPE
677 677 677 647 647 644 644 644 644 645 644 644 644 637 637 637 643
644 643 645 645 646 646 646 646 646 646 646
when the << potential escape for tags is found in a desc PHPDOCUMENTOR_PDP_STATE_DOUBLECR 646 when \n\n is found in a desc PHPDOCUMENTOR_PDP_EVENT_SIMLIST 645 when a simple list is found in a desc PHPDOCUMENTOR_PDP_EVENT_SAMP 645 when <<samp>> is found in a desc PHPDOCUMENTOR_PDP_EVENT_VAR 645 when <<var>> is found in a desc PHPDOCUMENTOR_PDP_STATE_B 645 when <<b>> is found in a desc PHPDOCUMENTOR_PDP_STATE_CODE 645 when <<code>> is found in a desc PHPDOCUMENTOR_PDP_STATE_BR 645 when <<br>> is found in a desc phpDocumentor_IntermediateParser::$quietMode 680 set in Setup.inc.php to the value of the quitemode commandline option. phpDocumentor_IntermediateParser::$ric 680 Stores parsed CHANGELOG/INSTALL/README files phpDocumentor_setup::$ignoresymlinks 695 contents of --ignoresymlinks commandline phpDocumentor_setup::$hidden 695 contents of --hidden commandline phpDocumentor_setup::$ignore_files 695 contents of --ignore commandline phpDocumentor_setup::$packages 695 Packages to create documentation for phpDocumentor_setup::$render 695 Used to organize output from the Parser before Conversion phpDocumentor_setup::$parse 695 The main parser phpDocumentor_setup::$files 694 contents of --filename commandline phpDocumentor_setup::$dirs 694 contents of --directory commandline phpDocumentor_IntermediateParser::setTargetDir() 692 Sets the output directory phpDocumentor_IntermediateParser::setQuietMode() 692 set parsing information output mode (quiet or verbose) phpDocumentor_IntermediateParser::setTemplateBase() 693 Sets the template base directory phpDocumentor_IntermediateParser::setUndocumentedElementWarningsMode() 693 show warnings for undocumented elements phpDocumentor_setup 694 phpDocumentor_IntermediateParser::_guessPackage() 693 Guess the package/subpackage based on subdirectory if the --pear option phpDocumentor_setup::$setup 696 Used to parse command-line options phpDocumentor_setup::checkIgnoreTag() 696 phpDocumentor_setup::setMemoryLimit() 697 Allow a memory_limit setting in phpDocumentor.ini to override php.ini or default memory limit
phpDocumentor_setup::setJavadocDesc() 697 phpDocumentor_setup::setPackageOutput() 698 phpDocumentor_setup::setParsePrivate() 698 phpDocumentor_setup::setTargetDir() 698 phpDocumentor_setup::setQuietMode() 698 phpDocumentor_setup::setIgnore() 697 phpDocumentor_setup::setFilesToParse() 697 phpDocumentor_setup::parseHiddenFiles() 696 phpDocumentor_setup::createDocs() 696 phpDocumentor_setup::parseIni() 696 Parse configuration file phpDocumentor.ini phpDocumentor_setup::readCommandLineSettings() 697 Get phpDocumentor settings from command-line or web interface phpDocumentor_setup::setDirectoriesToParse() 697 phpDocumentor_setup::readConfigFile() 697 Get phpDocumentor settings from a user configuration file phpDocumentor_IntermediateParser::setParsePrivate() 692 set display of elements marked with @access private phpDocumentor_IntermediateParser::parsePackagePage() 692 Backward-compatibility only, use the new tutorials for more power phpDocumentor_IntermediateParser::addPage() 683 Replaces the parserPage represented by $this->pages[$path] with $page phpDocumentor_IntermediateParser::addPackageParent() 683 If the parent class of $class is in a different package, adds it to the phpDocumentor_IntermediateParser::addPageIfNecessary() 684 add a new parserPage to the $pages array if none is found phpDocumentor_IntermediateParser::addPrivatePage() 684 Adds a parserPage element to the parserData element in $this->privatepages[$path] phpDocumentor_IntermediateParser::ClasselementCmp() 685 does a natural case sort on two class elements (either parserClass, parserMethod or parserVar phpDocumentor_IntermediateParser::addUses() 684 Add all the @uses tags from $element to the $uses array so that @usedby phpDocumentor_IntermediateParser::addElementToPage() 683 adds a processed descendant of parserElement to the $pages array or $privatepages array phpDocumentor_IntermediateParser::addConverter() 682 Add a converter name to use to the list of converters phpDocumentor_IntermediateParser::$templateBase 681 used to set the template base directory phpDocumentor_IntermediateParser::$targetDir 681 used to set the output directory phpDocumentor_IntermediateParser::$title 681 phpDocumentor_IntermediateParser::$type 681 type of the current parser Element being handled phpDocumentor_IntermediateParser::$uses 682 phpDocumentor_IntermediateParser::$undocumentedElementWarnings 682 set in Setup.inc.php to the value of the undocumentedElementWarnings commandline option. phpDocumentor_IntermediateParser::Convert() 685 Interface to the Converter
phpDocumentor_IntermediateParser::elementCmp() does a natural case sort on two parserElement descendants phpDocumentor_IntermediateParser::handlePackagePage() handles post-parsing of Package-level documentation pages. phpDocumentor_IntermediateParser::handleMethod() handles post-parsing of class methods phpDocumentor_IntermediateParser::handlePage() handles post-parsing of procedural pages phpDocumentor_IntermediateParser::handleTutorial() handle post-parsing of Tutorials. phpDocumentor_IntermediateParser::Output() call this method once parsing has completed. phpDocumentor_IntermediateParser::handleVar() handles post-parsing of class vars phpDocumentor_IntermediateParser::handleInclude() handles post-parsing of include/require/include_once/require_once phpDocumentor_IntermediateParser::handleGlobal() handles post-parsing of global variables phpDocumentor_IntermediateParser::handleConst() handles post-parsing of class constants phpDocumentor_IntermediateParser::handleClass() handles post-parsing of classes phpDocumentor_IntermediateParser::handleDefine() handles post-parsing of defines phpDocumentor_IntermediateParser::handleDocBlock() handles post-parsing of DocBlocks phpDocumentor_IntermediateParser::handleFunction() handles post-parsing of functions phpDocumentor_IntermediateParser::HandleEvent() called via Parser::parse() and Parser's inherited method Publisher::publishEvent() phpDocumentor_parse_ini_file() Parse an .ini file phpDocumentor_get_class() Returns a lower-cased version of get_class for PHP 5 PDFdefaultConverter::convertVar() PDFdefaultConverter::convertTutorial() PDFdefaultConverter::Convert_RIC() Convert README/INSTALL/CHANGELOG file contents to output format PDFdefaultConverter::generateFormattedClassTrees() returns a template-enabled array of class trees PDFdefaultConverter::getClassLink() PDFdefaultConverter::getCData() PDFdefaultConverter::convertParams() PDFdefaultConverter::convertPage() PDFdefaultConverter::convertFunction() PDFdefaultConverter::convertDocBlock() PDFdefaultConverter::convertGlobal() PDFdefaultConverter::convertInclude() PDFdefaultConverter::convertPackagepage() PDFdefaultConverter::convertMethod() PDFdefaultConverter::getConstLink() PDFdefaultConverter::getDefineLink()
686 690 689 690 690 691 691 689 689 686 686 687 687 688 688
637 636 266 266 266 266 267 266 265 265 264 264 265 265 265 265 267 267
PDFdefaultConverter::getSourceAnchor() Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag. PDFdefaultConverter::getRootTree() return formatted class tree for the Class Trees page PDFdefaultConverter::getSourceLink() PDFdefaultConverter::getState() PDFdefaultConverter::getVarLink() PDFdefaultConverter::getTutorialId() PDFdefaultConverter::getPageName() PDFdefaultConverter::getPageLink() PDFdefaultConverter::getFileSourceName() PDFdefaultConverter::getExampleLink() PDFdefaultConverter::getFunctionLink() PDFdefaultConverter::getGlobalLink() PDFdefaultConverter::getMethodLink() PDFdefaultConverter::getGlobalValue() PDFdefaultConverter::convertDefine() PDFdefaultConverter::convertConst() PHPDOCUMENTOR_PDF_EVENT_TEXT when <text> is found in an ezText input PHPDOCUMENTOR_PDF_EVENT_PDFFUNCTION when <pdffunction> is found in an ezText input PHPDOCUMENTOR_PDF_STATE_CONTENT used for parsing stuff between <text> PHPDOCUMENTOR_PDF_STATE_FONT when <font> is found in an ezText input PHPDOCUMENTOR_PDF_STATE_PDFFUNCTION when <pdffunction> is found in an ezText input PHPDOCUMENTOR_PDF_STATE_NEWPAGE when <newpage/> is found in an ezText input PHPDOCUMENTOR_PDF_EVENT_NEWPAGE when <newpage/> is found in an ezText input PHPDOCUMENTOR_PDF_EVENT_FONT when <font> is found in an ezText input phpDocumentor Tutorials phpDocumentor Quickstart phpDocumentor tags phpDocumentor Inline tags PHPDOCUMENTOR_PDF_EVENT_CONTENT used for parsing stuff between <text> ParserPDF.inc This class handles the XML-based CezPDF markup language created to allow templates for the PDFdefaultConverter PHPDOCUMENTOR_PDF_STATE_TEXT when <text> is found in an ezText input PDFdefaultConverter.inc Outputs documentation in PDF format PDFdefaultConverter::$ric_set PDFdefaultConverter::$pdf PDFdefaultConverter::$smarty_dir PDFdefaultConverter::$sort_absolutely_everything default PDF Converter wants elements sorted by type as well as alphabetically
270
270 270 270 271 270 270 269 268 268 268 268 269 269 264 264 260 260 260 260 260 260 260 259 41 3 49 96 259 259
PDFdefaultConverter::convertClass() 264 PDFdefaultConverter::$_sourcecode 263 Source files for appendix C are stored here PDFdefaultConverter::$pagepackage_pagenums 263 PDFdefaultConverter::$outputformat 262 PDFdefaultConverter::$classpackage_pagenums 262 PDFdefaultConverter 262 PDF output converter. PDFdefaultConverter::$curclasspackage 262 PDFdefaultConverter::$curpagepackage 262 PDFdefaultConverter::$name 262 PDFdefaultConverter::$leftindex 262 PDFdefaultConverter::mystrnatcasecmp() 271 PDFdefaultConverter::Output() 271 calls Cezpdf::ezOutput() and writes documentation.pdf to targetDir phpdocpdf::validHTMLColor() 278 phpdocpdf::textcolor() 278 phpdocpdf::_ezText() 278 PHPDOC_WEBROOT_DIR 352 PDERROR_MULTIPLE_PARENT 515 warning triggered when inheritance could be from more than one class passbyref() 501 passes a variable by reference phpdocpdf::setupTOC() 278 phpdocpdf::setHTMLColor() 278 phpdocpdf::index() 277 phpdocpdf::indent() 277 phpdocpdf::IndexLetter() 277 phpdocpdf::orderedBullet() 278 phpdocpdf::setColorArray() 278 phpdocpdf::rf() 278 parent_b587733 549 inherited functions with @access private should not be shown in inherited list of child priv1 549 PHPDoc_XML_Beautifier_Renderer_Plain::serialize() 617 Serialize the XML tokens PHPDoc_XML_Beautifier_Renderer_Plain 617 Basic XML Renderer for XML Beautifier phpdoc.php 630 Original Web Interface to phpDocumentor phpDocumentor_clone() 632 Clone an object in PHP 4 phpDocumentor_ConfigFileList() 636 used in phpdoc.php and new_phpdoc.php PATH_DELIMITER 636 Plain.php 616 XML/Beautifier/Renderer/Plain.php phpDocumentorTParserGetInlineTagsTests.php 567 Unit Tests for the phpDocumentorTParser->getInlineTags() method ParserPageGetSourceLocationTests.php 561 Unit Tests for the ParserPage->getSourceLocation() method ParserClassGetSourceLocationTests.php 559 Unit Tests for the ParserClass->getSourceLocation() method
phpDocumentorSetupCleanConverterNamePieceTests.php Unit Tests for the phpDocumentor_setup->cleanConverterNamePiece() method phpDocumentorSetupDecideOnOrOffTests.php Unit Tests for the phpDocumentor_setup->decideOnOrOff() method PHPUnit_MAIN_METHOD PHPUnit main() hack PHPDOCUMENTOR_BASE Base directory of code phpdocpdf::getYPlusOffset() phpdocpdf::getColor() This really should be in the parent class PDFParser::getParserEventName() Return the name of the parser event PDFParser PDFParser::parse() Parse text for PDFParser XML tags, and add the text to the PDF file PDFParser::setupStates() setup the parser tokens, and the pushEvent/popEvent arrays phpdocpdf::$converter phpdocpdf PDFdefaultConverter::writeSource() PDFdefaultConverter::writeExample() PDFdefaultConverter::returnLink() PDFdefaultConverter::postProcess() PDFdefaultConverter::returnSee() Returns a bookmark using Cezpdf 009 PDFdefaultConverter::setTemplateDir() PDFdefaultConverter::unmangle() PDFdefaultConverter::TranslateTag() Used to translate an XML DocBook tag from a tutorial by reading the options.ini file for the template. phpdocpdf::$font_dir phpdocpdf::$indents phpdocpdf::dots() phpdocpdf::bullet() phpdocpdf::ezNewPage() phpdocpdf::ezOutput() phpdocpdf::ezText() phpdocpdf::ezProcessText() phpdocpdf::addMessage() phpdocpdf::$_save phpdocpdf::$listType phpdocpdf::$indexContents phpdocpdf::$reportContents phpdocpdf::$set_pageNumbering phpdocpdf::$_colorStack phpDocumentor_setup::setTemplateBase() phpDocumentor_setup::setTitle() PDERROR_MULTIPLE_PARENT warning triggered when inheritance could be from more than one class PDERROR_MULTIPLE_PACKAGE_TAGS warning triggered when there are multiple @package tags in a docblock PDERROR_MULTIPLE_RETURN_TAGS
563 565 565 565 277 277 274 273 274 274 275 274 273 273 272 271 272 272 272 272
275 275 276 276 276 276 277 276 276 275 275 275 275 275 275 698 698 762 762 762
warning triggered when there are multiple @return tags in a docblock PDERROR_MULTIPLE_SUBPACKAGE_TAGS warning triggered when there are multiple @subpackage tags in a docblock PDERROR_NAME_ALIAS_SAME_AS_TARGET warning triggered when the alias value in an page-level docblock's @name tag PDERROR_MULTIPLE_VAR_TAGS warning triggered when there are multiple @var tags in a docblock PDERROR_MULTIPLE_NAME_TAGS warning triggered when there are multiple @name tags in a docblock PDERROR_MULTIPLE_GLOBAL_TAGS warning triggered when there are multiple @name tags in a docblock PDERROR_MALFORMED_GLOBAL_TAG warning triggered when there are multiple @name tags in a docblock PDERROR_LOOP_RECURSION_LIMIT_REACHED warning triggered when the a loop recursion tripwire has been tripped PDERROR_MALFORMED_TAG warning triggered by an empty tag PDERROR_MISSING_PROPERTY_TAG_NAME warning triggered when any of {@property}}, {@property-read}}, PDERROR_MULTIPLE_CATEGORY_TAGS warning triggered by more than 1 @category tag PDERROR_MULTIPLE_ACCESS_TAGS warning triggered when there are multiple @access tags in a docblock PDERROR_NEED_WHITESPACE warning triggered when an entire page is ignored because of @access private PDERROR_NESTED_INTERNAL warning triggered when {@internal}} is nested inside another {@internal}} PDERROR_PACKAGEOUTPUT_DELETES_PARENT_FILE warning triggered when there are multiple @name tags in a docblock PDERROR_PACKAGECAT_SET warning triggered when a package is already associated with a category, and PDERROR_PARENT_NOT_FOUND warning triggered when parent class doesn't exist PDERROR_PARSEPRIVATE warning triggered when an entire page is ignored because of @access private PDERROR_PDF_METHOD_DOESNT_EXIST warning triggered when a <pdffunction:funcname /> tag is used in the PDF PDERROR_PDFFUNCTION_NO_FUNC warning triggered when a <pdffunction:funcname /> tag is used in the PDF PDERROR_OVERRIDDEN_SUBPACKAGE_TAGS warning triggered when there a @subpackage tag is used in a function, PDERROR_OVERRIDDEN_PACKAGE_TAGS warning triggered when there a @package tag is used in a function, PDERROR_NO_CONVERTERS warning triggered when a converter is passed to PDERROR_NOTODO_INCLUDE warning triggered when @todo is used on an include element PDERROR_NO_CONVERTER_HANDLER warning triggered when an example's path from @example /path/to/example.php PDERROR_NO_DOCBOOK_ID warning triggered in tutorial parsing if there is a missing {@id} inline tag PDERROR_NO_PAGE_LEVELDOCBLOCK warning triggered when a file does not contain a page-level docblock
762 762 762 761 761 761 761 761 761 761 761 762 762 763 763 763 764 764 764 763 763 762 762 763 763 763
PDERROR_NO_PACKAGE_TAG warning triggered when no @package tag is used in a page-level PDERROR_INVALID_VALUES warning triggered if a command line option does not have a valid value passed in PDERROR_INTERNAL_NOT_CLOSED warning triggered when an {@internal}} tag is not closed PDERROR_CLASS_EXISTS warning triggered when inheritance could be from more than one class PDERROR_CLASS_CONFLICT warning triggered when classes in the same package have the same name PDERROR_CLASS_NOT_IN_PACKAGE warning triggered when a getClassByPackage is called and can't find the class PDERROR_CLASS_PARENT_NOT_FOUND warning triggered when an entire page is ignored because of @access private PDERROR_CONVERTER_OVR_GFCT warning triggered when a child converter doesn't override PDERROR_CONVERTER_NOT_FOUND warning triggered when a converter is passed to PDERROR_CHILD_TUTORIAL_NOT_FOUND warning triggered when a tutorial's child in the .ini file doesn't exist in the PDERROR_CANT_NEST_IN_B warning triggered when another tag is nested in <b> parserVarTag::$returnType the type a var has parserVarTag::$keyword always 'var' PDERROR_ACCESS_WRONG_PARAM warning triggered when the arguments to @access are neither public nor private PDERROR_BEAUTIFYING_FAILED warning triggered by an unterminated entity in a tutorial PDERROR_CANT_HAVE_INLINE_IN_TAGNAME warning triggered when an inline tag is found inside an xml tag name PDERROR_CANNOT_EXTEND_SELF warning triggered if someone brilliant tries "class X extends X {" PDERROR_DANGEROUS_PHP_BUG_EXISTS warning triggered when the PHP version being used has dangerous bug/behavior PDERROR_DB_TEMPLATE_UNTERMINATED warning triggered when a docblock template is never turned off PDERROR_IGNORE_TAG_IGNORED warning triggered when an @ignore tag is used in a DocBlock preceding PDERROR_ID_MUST_BE_INLINE warning triggered when an id attribute in a tutorial docbook tag is not PDERROR_ILLEGAL_PACKAGENAME warning triggered when the package or subpackage name is illegal PDERROR_INHERITANCE_CONFLICT warning triggered when inheritance could be from more than one class PDERROR_INLINETAG_IN_SEE warning triggered when an example's path from @example /path/to/example.php PDERROR_INHERITDOC_DONT_WORK_HERE warning triggered by {@inheritdoc} in a non-inheritable situation PDERROR_GLOBAL_NOT_FOUND warning triggered when there are multiple @name tags in a docblock PDERROR_FUNCTION_HAS_NONAME
763 761 760 758 758 758 758 758 758 758 758 749 749 757 757 758 757 759 759 760 760 760 760 760 760 760 759
warning triggered by a function with no name PDERROR_DOCBLOCK_GOES_CLASS warning triggered when the first docblock in a file with a @package tag precedes a class. In this case, the class gets the docblock. PDERROR_DOCBLOCK_CONFLICT warning triggered by a page-level docblock preceding a source element PDERROR_DUMB_USES warning triggered by improper "@uses blah" PDERROR_ELEMENT_IGNORED warning triggered when a duplicate element is encountered that will be PDERROR_EXAMPLE_NOT_FOUND warning triggered when an example's path from @example /path/to/example.php PDERROR_EMPTY_EXAMPLE_TITLE warning triggered by @example path/to/example with no title PDERROR_PDF_TEMPVAR_DOESNT_EXIST warning triggered when a <pdffunction:funcname arg=$tempvar/> tag PDERROR_PRIVATE_ASSUMED warning triggered when no @access private tag is used in a parserLinkInlineTag::$linktext text to display in the link, can be different from the link for standard parserLinkInlineTag represents inline links parserLinkInlineTag::Convert() calls the output conversion parserLinkInlineTag::ConvertPart() convert part of the tag parserSourceInlineTag::$end Last line to display parserSourceInlineTag represents inline source tag, used for function/method source parserInlineTag::Strlen() get length of the tag parserInlineTag::getString() always gets an empty string parserInheritdocInlineTag::$inlinetype always 'inheritdoc' parserInheritdocInlineTag Represents the inheritdoc inline tag, used by classes/methods/vars to inherit documentation from the parent class if possible parserInheritdocInlineTag::Convert() only sets a warning and returns empty parserInlineTag Use this element to represent an {@inline tag} like {@link} parserInlineTag::$type Element type parserInlineTag::$inlinetype the name of the inline tag (like link) parserSourceInlineTag::$inlinetype always 'source' parserSourceInlineTag::$source tokenized source organized by line numbers for php 4.3.0+, the old parserTocInlineTag::Convert() converter method
759
759 759 759 759 759 764 764 780 780 781 781 782 781 779 779 778 777
parserTocInlineTag::$inlinetype always 'toc' parserTocInlineTag::setPath() set the path parserTocInlineTag::setTOC() set the TOC parserTutorialInlineTag::Convert() convert part of the tag parserTutorialInlineTag Represents inline links to external tutorial documentation parserTocInlineTag Represents {@toc} for table of contents generation in tutorials parserSourceInlineTag::Strlen() only used to determine blank lines. {@source} will not be blank, probably parserSourceInlineTag::arrayConvert() converter helper used in PHP 4.3.0+ parserSourceInlineTag::$start First line of source code to display parserSourceInlineTag::Convert() convert the tag parserSourceInlineTag::getString() gets the source string parserSourceInlineTag::stringConvert() converter helper used in PHP 4.2.3parserSourceInlineTag::setSource() sets the source tag's value parserIdInlineTag::Convert() converter parserIdInlineTag::$tutorial full name of the tutorial PDERROR_TUTORIAL_SUBSECTION_NOT_FOUND warning triggered when a subsection's title is asked for, but the subsection PDERROR_TUTORIAL_NOT_FOUND warning triggered when a tutorial is referenced PDERROR_UL_IN_UL warning triggered if <<ul>> is nested inside <<ul>> and not <<li>> PDERROR_UNCLOSED_TAG warning triggered when a DocBlock html tag is unclosed PDERROR_UNKNOWN_COMMANDLINE warning triggered when an entire page is ignored because of @access private PDERROR_UNDOCUMENTED_ELEMENT warning triggered when a class or method hasn't got docblock PDERROR_TUTORIAL_IS_OWN_GRANDPA warning triggered when a tutorial's child lists the parent tutorial PDERROR_TUTORIAL_IS_OWN_CHILD warning triggered when a tutorial lists itself as a child tutorial PDERROR_SOURCE_TAG_FUNCTION_NOT_FOUND warning triggered when a { @source } inline tag is used in a docblock not PDERROR_SOURCECODE_IGNORED warning triggered by sourcecode="on", if PHP < 4.3.0 PDERROR_SOURCE_TAG_IGNORED warning triggered when an {@source} tag is found in a short description
785 786 786 787 786 785 784 783 782 783 784 784 784 777 776 765 765 765
PDERROR_TAG_NOT_HANDLED warning triggered by @filesource, if PHP < 4.3.0 PDERROR_TEXT_OUTSIDE_LI warning triggered when text in a docblock list is not contained in PDERROR_TEMPLATEDIR_DOESNT_EXIST warning triggered by non-existent template directory PDERROR_UNKNOWN_TAG warning triggered when classes in the same package have the same name PDERROR_UNMATCHED_LIST_TAG warning triggered when a docblock has an unmatched <ol> or <ul> parserIdInlineTag::$category category of the {@id} parserIdInlineTag Represents the inline {@id} tag for tutorials parserIdInlineTag::$id section/subsection name parserIdInlineTag::$inlinetype always 'id' parserIdInlineTag::$subpackage subpackage of the {@id} parserIdInlineTag::$package package of the {@id} parserExampleInlineTag::setSource() sets the source parserExampleInlineTag::getProgramListing() Return the source for the example file, enclosed in a <programlisting> tag to use in a tutorial PDERROR_UNTERMINATED_ATTRIB warning triggered when a subsection's title is asked for, but the subsection PDERROR_UNMATCHED_TUTORIAL_TAG warning triggered when a docbook tag is not properly matched PDERROR_UNTERMINATED_ENTITY warning triggered by an unterminated entity in a tutorial PDERROR_UNTERMINATED_INLINE_TAG warning triggered when an {@inline tag} is not terminated parserExampleInlineTag::arrayConvert() converter helper for PHP 4.3.0+ parserExampleInlineTag Represents the example inline tag, used to display an example file inside a docblock or tutorial parserVarTag represents the "@var" tag parserUsesTag::getDescription() Get the description of how the element used is being used. Publisher::subscribe() Adds a subscriber to the $subscriber array(). Publisher::publishEvent() Publish an event parserB Used for <<b>> in a description parserB::Convert() performs the conversion of bold tags
parserBr::Convert() performs the conversion of linebreak tags parserBr Used for <<br>> in a description Publisher::$tokens Publisher::$subscriber Array of references objects that have Subscribed to this publisher ProceduralPages::setupPagePackages() if there is one class package in a file, the parent path inherits the package if its package is default. ProceduralPages::setParseBase() sets the parser base ProceduralPages::setupPages() Adjusts packages of all pages and removes name conflicts within a package Publisher a class for handling the publishing of data Publisher::$pushEvent Publisher::$popEvent parserCode Used for <<code>> in a description parserCode::Convert() performs the conversion of code tags parserList::addItem() add an item to a list parserList::$numbered parserList::addList() add a list parserList::Convert() performs the conversion of list tags parserPre::Convert() performs the conversion of code tags parserPre Used for <<pre>> in a description parserList::$items parserList Used for lists <<ol>> and <<ul>> parserDescVar::Convert() performs the conversion of variable tags parserDescVar Used for <<var>> in a description parserI Used for <<i>> in a description parserI::Convert() performs the conversion of italic tags parserKbd::Convert() performs the conversion of keyboard tags parserKbd Used for <<kbd>> in a description ProceduralPages::setName() Change a page's name from its file to alias $name ProceduralPages::replaceElement() Used to align an element with the package of its parent page prior to Conversion.
707 708 708 709 709 718 718 722 722 722 722 723 723 721 721 719 718 719 720 721 720 707 707
ProceduralPages::$globalconflicts Namespace conflicts within all documented packages of functions ProceduralPages::$functionsbynamefile array of file names organized by functions that are in the file. ProceduralPages::$globalsbyfile array of parsed global variables organized by the full path of the file that contains the global variable definition. ProceduralPages::$globalsbynamefile array of file names organized by global variables that are in the file. ProceduralPages::$includesbyfile array of parsed includes organized by the full path of the file that contains the include. ProceduralPages::$ignorepages array of all procedural pages ordered by name ProceduralPages::$functionsbyfile array of parsed functions organized by the full path of the file that contains the function. ProceduralPages::$functionconflicts Namespace conflicts within all documented packages of functions ProceduralPages Intermediate procedural page parsing structure. phpDocumentor_setup::setUndocumentedElementWarnings() ProceduralPages::$curfile file being parsed, used in every add function to match up elements with the file that contains them ProceduralPages::$defineconflicts Namespace conflicts within all documented packages of functions ProceduralPages::$definesbynamefile array of file names organized by defines that are in the file. ProceduralPages::$definesbyfile array of parsed defines organized by the full path of the file that contains the define. ProceduralPages::$pageclasspackages array of packages assigned to classes in a file, ordered by fullpath ProceduralPages::$pageconflicts Namespace conflicts within all documented pages ProceduralPages::addPagePackage() Changes the package of the page represented by $path ProceduralPages::addPage() sets up the $pages array ProceduralPages::getPathInfo() gathers path-related info about a given element ProceduralPages::getRealPath() Ensures the path to the file is an absolute path ProceduralPages::pathMatchesParsedFile() checks to see if the parsed file matches the given path ProceduralPages::ignorePage() moves a page from the $pages array to the $ignorepages array ProceduralPages::addInclude() sets up the $includesbyfile array using $curfile ProceduralPages::addGlobal() sets up the $globalsbyfile array using $curfile ProceduralPages::$pages
702 702
702 701
703 703 705 705 706 706 707 706 705 705 704
array of all procedural pages ordered by name ProceduralPages::$pagepackages array of packages ordered by full path ProceduralPages::$pathpages array of all procedural page names ordered by full path to the file ProceduralPages::addClassPackageToFile() adds a package from a class to the current file ProceduralPages::addFunction() sets up the $functionsbyfile array using $curfile ProceduralPages::addDefine() sets up the $definesbyfile array using $curfile parserSamp Used for <<samp>> in a description parserSamp::Convert() performs the conversion of sample tags parserReturnTag::Convert() process this tag through the given output converter (sets up the $converted_returnType) parserReturnTag::$returnType the type a function returns parserSeeTag represents the "@see" tag parserSeeTag::$keyword always 'see' parserStaticvarTag represents the "@staticvar" tag parserSeeTag::Convert() process this tag through the given output converter parserReturnTag::$keyword always 'return' parserReturnTag::$converted_returnType contains a link to the documentation for a class passed as a type in @return, @var or @param parserPropertyTag::$keyword always 'property' parserPropertyTag represents the "@property" tag parserPropertyTag::$returnType the type a property has parserPropertyWriteTag represents the "@property-write" tag parserReturnTag represents the "@return" tag parserPropertyWriteTag::$keyword always 'property-write' parserStaticvarTag::$keyword always 'staticvar' parserTag used to represent standard tags like @access, etc. parserUsedByTag::$keyword Always "usedby" parserUsedByTag This is a virtual tag, it is created by @uses to cross-reference the used element
737 737 737 738 738 738 742 742 746 746
parserUsedByTag::Convert() process this tag through the given output converter parserUsesTag represents the "@uses" tag parserUsesTag::Convert() Return a link to documentation for other element, and description of how it is used parserUsesTag::$keyword Always "uses" parserTutorialTag::Convert() process this tag through the given output converter parserTutorialTag::$keyword Always "tutorial" parserTag::$type Type is used by many functions to skip the hassle of parserTag::$keyword tag name (see, access, etc.) parserTag::Convert() Perform the output conversion on this parserTag using the output converter that is passed in parserTag::getString() Returns the text minus any inline tags parserTutorialTag represents "@tutorial" parserTag::HandleEvent() Called by the parserDescParser when processing a description. parserPropertyReadTag::$keyword always 'property-read' parserPropertyReadTag represents the "@property-read" tag parserFileSourceTag represents "@filesource" parserExampleTag::getSourceLink() Retrieve a converter-specific link to the example parserFileSourceTag::$keyword Always "filesource" parserFileSourceTag::$path parserFileSourceTag::Convert() Return a link to the highlighted source and generate the source parserFileSourceTag::$source parserExampleTag::ConvertSource() convert the source code parserExampleTag::$keyword always "example" parserAccessTag::$isvalid set to true if the returned tag has a value type of private, protected parserAccessTag This class represents the @access tag parserAccessTag::$keyword tag name parserAccessTag::Convert() process this tag through the given output converter parserExampleTag
744 744 744 736 736 729 729 729 730 730 730 728 728 726 726 726 727 727
represents "@example" parserAccessTag::getString() No inline tags are possible, returns 'public', 'protected' or 'private' parserFileSourceTag::ConvertSource() convert the source code parserFileSourceTag::getSourceLink() gets path to the sourcecode file parserNameTag This class represents the @name tag parserMethodTag::$returnType the return type a method has parserNameTag::$keyword tag name parserNameTag::Convert() process this tag through the given output converter parserParamTag::$keyword always 'param' parserParamTag represents the "@param" tag parserMethodTag::$keyword always 'method' parserMethodTag represents the "@method" tag parserLicenseTag represents the "@see" tag parserFileSourceTag::writeSource() have the output converter write the source code parserLicenseTag::$keyword always 'license' parserLinkTag represents the "@link" tag parserLinkTag::$keyword always 'link' phpDocumentor Guide to Creating Fantastic Documentation
727 730 731 734 734 735 735 736 735 734 733 732 731 732 732 733 1
R
RecordWarning::$linenum line number of the file this error occurred in RecordWarning::$file file this error occurred in RecordWarning::$num error number RecordWarning::$type name of global variable that descriptors for this warning/error is kept README RecordWarning::output() prints the warning RecordWarning::$data error string RecordWarning encapsulates warning information 771 771 771 771 949 772 770 770
recurseDir() RecordWarning RecordError encapsulates error information RecordError::$type name of global variable that descriptors for this warning/error is kept RecordError::output() prints the error returnsme() returns a reference
S
smarty_modifier_htmlentities() Smarty plugin smarty_modifier_escape() Smarty escape modifier plugin smarty_modifier_default() Smarty default modifier plugin smarty_modifier_indent() Smarty indent modifier plugin smarty_modifier_lower() Smarty lower modifier plugin smarty_modifier_regex_replace() Smarty regex_replace modifier plugin smarty_modifier_rawurlencode() Smarty plugin smarty_modifier_nl2br() Smarty plugin smarty_modifier_debug_print_var() Smarty debug_print_var modifier plugin smarty_modifier_date_format() Smarty date_format modifier plugin smarty_modifier_cat() Smarty cat modifier plugin smarty_modifier_capitalize() Smarty capitalize modifier plugin smarty_function_var_dump() Smarty plugin smarty_modifier_count_characters() Smarty count_characters modifier plugin smarty_modifier_count_paragraphs() Smarty count_paragraphs modifier plugin smarty_modifier_count_words() Smarty count_words modifier plugin smarty_modifier_count_sentences() Smarty count_sentences modifier plugin smarty_modifier_replace() Smarty replace modifier plugin smarty_modifier_spacify() Smarty spacify modifier plugin smarty_make_timestamp() 467 466 465 468 469 472 471 470 464 463 458 457 456 459 460 462 461 473 474 484
Function: smarty_make_timestamp<br> Purpose: used by other smarty functions to make a timestamp from a string. shared.make_timestamp.php Smarty shared plugin smarty_function_escape_special_chars() escape_special_chars common function SendEMail() This is a Test SMART_PATH_DELIMITER does not parse correctly because of function in definition summary_form::blah() summary_form::$dp summary_form shared.escape_special_chars.php Smarty shared plugin smarty_outputfilter_trimwhitespace_replace() smarty_modifier_strip_tags() Smarty strip_tags modifier plugin smarty_modifier_strip() Smarty strip modifier plugin smarty_modifier_string_format() Smarty string_format modifier plugin smarty_modifier_truncate() Smarty truncate modifier plugin smarty_modifier_upper() Smarty upper modifier plugin smarty_outputfilter_trimwhitespace() Smarty trimwhitespace outputfilter plugin smarty_modifier_wordwrap() Smarty wordwrap modifier plugin smarty_function_popup_init() Smarty {popup_init} function plugin smarty_function_popup() Smarty {popup} function plugin smarty_block_strip() Smarty {strip}{/strip} block plugin smarty_core_write_file() write out a file to disk smarty_core_write_compiled_resource() write the compiled resource smarty_block_textformat() Smarty {textformat}{/textformat} block plugin smarty_function_assign() Smarty {assign} function plugin smarty_function_counter() Smarty {counter} function plugin smarty_function_config_load() Smarty {config_load} function plugin smarty_function_assign_debug_info() Smarty {assign_debug_info} function plugin smarty_core_write_compiled_include() Extract non-cacheable parts out of compiled template and write it
484 483 491 523 550 550 550 483 481 477 476 475 478 479 481 480 455 454 427 426 425 428 429 432 431 430 424
smarty_core_write_cache_file() Prepend the cache information to the cache file and write it smarty_core_read_cache_file() read a cache file, determine if it needs to be regenerated or not smarty_core_process_compiled_include() Replace nocache-tags by results of the corresponding non-cacheable functions and return it smarty_core_process_cached_inserts() Replace cached inserts with the actual results smarty_core_rmdir() delete a dir recursively (level=0 -> keep root) WARNING: no tests, it will try to remove what you tell it! smarty_core_rm_auto() delete an automagically created file by name and id smarty_core_smarty_include_php() called for included php files within templates smarty_core_run_insert_handler() Handle insert tags smarty_function_cycle() Smarty {cycle} function plugin smarty_function_debug() Smarty {debug} function plugin smarty_function_html_select_time() Smarty {html_select_time} function plugin smarty_function_html_select_date() Smarty {html_select_date} plugin smarty_function_html_radios_output() smarty_function_html_table() Smarty {html_table} function plugin smarty_function_html_table_cycle() smarty_function_math() Smarty {math} function plugin smarty_function_mailto() Smarty {mailto} function plugin smarty_function_html_radios() Smarty {html_radios} function plugin smarty_function_html_options_optoutput() smarty_function_html_checkboxes() Smarty {html_checkboxes} function plugin smarty_function_fetch() Smarty {fetch} plugin smarty_function_eval() Smarty {eval} function plugin smarty_function_html_checkboxes_output() smarty_function_html_image() Smarty {html_image} function plugin smarty_function_html_options_optgroup() smarty_function_html_options() Smarty {html_options} function plugin summary_form::get_header2() showImage()
423
418
417
416 419
420 422 421 433 435 448 446 445 449 450 453 451 444 443 438 437 436 439 440 442 442 550 626
Allows png's with alpha transparency to be displayed in IE 6 STATE_LOGICBLOCK currently parsing a { } block STATE_INLINE_DOCKEYWORD currently parsing an inline tag like { @link} in a DocBlock STATE_INCLUDE_PARAMS_PARENTHESIS currently parsing an inner parenthetical statement of an include/includeonce/require/requireonce( ) STATE_METHOD currently parsing a method using the HighlightParser STATE_METHOD_LOGICBLOCK currently parsing the method body using the HighlightParser STATE_PHPCODE currently parsing php code STATE_OUTPHP currently out of php code STATE_NOEVENTS out of < ? php tag STATE_INCLUDE_PARAMS currently parsing the stuff in ( ) of a define statement STATE_INCLUDE currently parsing an include/require/include_once/include_once STATE_FUNCTION_PARAM_VAR currently parsing a $param in a function definition STATE_FUNCTION_PARAMS currently parsing the stuff in ( ) of a function definition STATE_FUNCTION currently parsing a Function or Method STATE_FUNC_GLOBAL currently parsing a "global $var1, $var2;" declaration in a function STATE_GLOBAL currently parsing a global variable declaration STATE_IMPLEMENTS currently parsing an implements clause STATE_GLOBAL_VALUE currently parsing the default value in a global variable declaration STATE_QUOTE currently parsing a quote STATE_QUOTE_VAR currently parsing a {$encapsed_var} using the HighlightParser STATE_TUTORIAL_ENTITY currently parsing an &entity; STATE_TUTORIAL_DOUBLEQUOTE currently parsing a <!-- comment --> STATE_TUTORIAL_COMMENT currently parsing a <!-- comment --> STATE_TUTORIAL_ITAG currently parsing an {@inline tag} STATE_TUTORIAL_NOEVENTS currently in starting state STATE_TUTORIAL_SINGLEQUOTE currently parsing a <!-- comment --> STATE_TUTORIAL_OPENTAG
878 878 879 878 878 878 878 877 877 877 878 878 878 878 879 879 883 883 883 883 883 883 883
currently parsing an open <tag> STATE_TUTORIAL_CLOSETAG 883 currently parsing a close </tag> STATE_TUTORIAL_ATTRIBUTE 883 currently parsing an open <tag> STATE_STATIC_VAR_VALUE 879 currently parsing the value in a "static $var1 = x" declaration in a function STATE_STATIC_VAR 879 currently parsing a "static $var1, $var2;" declaration in a function STATE_SINGLEQUOTE 879 currently parsing a string enclosed in single quotes (') STATE_TAGS 879 currently parsing the @tag block of a docblock STATE_VAR 879 currently parsing a Class variable STATE_VAR_ARRAY_COMMENT 879 currently parsing a comment in a variable array value STATE_VAR_ARRAY 879 currently parsing a variable value is an array STATE_ESCAPE 877 used when a backslash is encountered in parsing a string or other escapable entity STATE_EOFQUOTE 877 currently parsing a string defined using Perl <<< STATE_XMLTOKEN_ENTITY 866 currently parsing an &entity; STATE_XMLTOKEN_DOUBLEQUOTE 866 currently parsing a <!-- comment --> STATE_XMLTOKEN_DEF 866 currently parsing a <! STATE_XMLTOKEN_IN_CDATA 866 currently parsing a <![CDATA[ ]]> STATE_XMLTOKEN_NOEVENTS 866 currently in starting state STATE_XMLTOKEN_SINGLEQUOTE 866 currently parsing a <!-- comment --> STATE_XMLTOKEN_PI 866 currently in processor instruction STATE_XMLTOKEN_OPENTAG 866 currently parsing an open <tag> STATE_XMLTOKEN_COMMENT 866 currently parsing a <!-- comment --> STATE_XMLTOKEN_CLOSETAG 866 currently parsing a close </tag> setup_dirs() 641 Recursively move contents of $struc into associative array SMART_PATH_DELIMITER 637 switchDirTree() 626 set_dir() 641 Recursively add all the subdirectories of $contents to $dir without erasing anything in Setup.inc.php 651 This was all in phpdoc.inc, and now encapsulates the complexity STATE_XMLTOKEN_CDATA 866 currently parsing a <!
STATE_XMLTOKEN_ATTRIBUTE currently parsing an open <tag> STATE_XMLTOKEN_XML currently parsing a <?xml STATE_ACCESS_MODIFIER currently parsing an access modifier STATE_DOCBLOCK_TEMPLATE currently parsing the value in a "static $var1 = x" declaration in a function STATE_DOCBLOCK currently parsing a DocBlock STATE_DESC currently parsing the desc part of a docblock STATE_DOCKEYWORD currently parsing a @tag in a DocBlock STATE_DOCKEYWORD_EMAIL currently parsing an email in brackets in an @author tag of a DocBlock STATE_END_DOCBLOCK_TEMPLATE currently parsing the value in a "static $var1 = x" declaration in a function STATE_END_CLASS used to tell Render that a class has been completely parsed, and to flush buffers STATE_DEFINE_PARAMS_PARENTHESIS currently parsing an inner parenthetical statement of a define( ) STATE_DEFINE_PARAMS currently parsing the stuff in ( ) of a define statement STATE_CLASS_CONSTANT currently parsing a class constant STATE_CLASS currently parsing a class definition STATE_ARRAY currently parsing an array STATE_CLASS_MEMBER currently parsing a class member using the HighlightParser STATE_COMMENT currently parsing a short comment // STATE_DEFINE currently parsing a define statement STATE_COMMENTBLOCK currently parsing a long comment /x x/ where x is an asterisk smarty_core_load_resource_plugin() load a resource plugin smarty_core_load_plugins() Load requested plugins Smarty::append() appends values to template variables Smarty::$use_sub_dirs This tells Smarty whether or not to use sub dirs in the cache/ and templates_c/ directories. sub directories better organized, but may not work well with PHP safe mode enabled. Smarty::$undefined The value of "undefined". Leave it alone :-) Smarty::append_by_ref() appends values to template variables by reference Smarty::assign()
866 867 876 877 877 877 877 877 877 877 876 876 876 876 876 876 876 876 876 415 414 383 382
assigns values to template variables Smarty::clear_all_cache() clear the entire contents of cache (all templates) Smarty::clear_all_assign() clear all the assigned template variables. Smarty::assign_by_ref() assigns values to template variables by reference Smarty::$trusted_dir This is an array of directories where trusted php scripts reside. Smarty::$template_dir The name of the directory where templates are located. Smarty::$request_vars_order The order in which request variables are registered, similar to variables_order in php.ini E = Environment, G = GET, P = POST, C = Cookies, S = Server Smarty::$request_use_auto_globals Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false) Smarty::$plugins_dir An array of directories searched for plugins. Smarty::$right_delimiter The right delimiter used for the template tags. Smarty::$secure_dir This is the list of template directories that are considered secure. This is used only if $security is enabled. One directory per array element. $template_dir is in this list implicitly. Smarty::$security_settings These are the security settings for Smarty. They are used only when $security is enabled. Smarty::$security This enables template security. When enabled, many things are restricted Smarty::clear_assign() clear the given assigned template variable. Smarty::clear_cache() clear cached content for the given template and cache id Smarty::register_compiler_function() Registers compiler function Smarty::register_block() Registers block function to be used in templates Smarty::load_filter() load a filter of specified type and name Smarty::register_function() Registers custom function to be used in templates Smarty::register_modifier() Registers modifier to be used in templates Smarty::register_postfilter() Registers a postfilter function to apply to a compiled template after compilation Smarty::register_outputfilter() Registers an output filter function to apply to a template output Smarty::register_object() Registers object to be used in templates Smarty::is_cached()
381
388
388 386
test to see if valid cache exists for this template Smarty::get_template_vars() Returns an array containing template variables Smarty::config_load() load configuration values Smarty::clear_config() clear configuration values Smarty::clear_compiled_tpl() clears compiled version of specified template resource, or all compiled template files if one is not specified. Smarty::display() executes & displays the template results Smarty::fetch() executes & returns or displays the template results Smarty::get_registered_object() return a reference to a registered object Smarty::get_config_vars() Returns an array containing config variables Smarty::$php_handling This determines how Smarty handles "<?php ... ?>" tags in templates. Smarty::$left_delimiter The left delimiter used for the template tags. Smarty::$cache_dir The name of the directory for cache files. Smarty::$autoload_filters This indicates which filters are automatically loaded into Smarty. Smarty Smarty::$cache_handler_func The function used for cache file handling. If not set, built-in caching is used. Smarty::$cache_lifetime This is the number of seconds cached content will persist. Smarty::$compiler_class The class used for compiling templates. Smarty::$caching This enables template caching. Smarty::$cache_modified_check Only used when $caching is enabled. If true, then If-Modified-Since headers are respected with cached content, and appropriate HTTP headers are sent. Smarty_Compiler.class.php Project: Smarty: the PHP compiling template engine File: Smarty_Compiler.class.php SMARTY_PHP_REMOVE Smarty.class.php Project: Smarty: the PHP compiling template engine File: Smarty.class.php Source code for sample3.php Source code for sample2.php SMARTY_DIR set SMARTY_DIR to absolute path to Smarty library files. SMARTY_PHP_ALLOW SMARTY_PHP_QUOTE SMARTY_PHP_PASSTHRU Smarty::$compiler_file
385 385 386 386 380 380 375 374 374 375 375 376 375 375
370
369 368
The file that contains the compiler class. This can a full pathname, or relative to the php_include path. Smarty::$compile_check This tells Smarty whether to check for recompiling or not. Recompiling does not need to happen unless a template or config file is changed. Smarty::$default_modifiers This is a list of the modifiers to apply to all template variables. Smarty::$debug_tpl This is the path to the debug console template. If not set, the default one will be used. Smarty::$debugging_ctrl This determines if debugging is enable-able from the browser. Smarty::$default_resource_type This is the resource type to be used when not specified Smarty::$default_template_handler_func If a template cannot be found, this PHP function will be executed. Smarty::$global_assign These are the variables from the globals array that are assigned to all templates automatically. This isn't really necessary any more, you can use the $smarty var to access them directly. Smarty::$force_compile This forces templates to compile every time. Useful for development or debugging. Smarty::$debugging If debugging is enabled, a debug console window will display when the page loads (make sure your browser allows unrequested popup windows) Smarty::$config_read_hidden This tells whether hidden sections [.foobar] are readable from the tempalates or not. Normally you would never allow this since that is the point behind hidden sections: the application can access them, but the templates cannot. Smarty::$config_booleanize This tells whether or not to automatically booleanize config file variables. Smarty::$compile_id Set this if you want different sets of compiled files for the same templates. This is useful for things like different languages. Smarty::$compile_dir The directory where compiled templates are located. Smarty::$config_class The class used to load config vars. Smarty::$config_dir The directory where config files are located. Smarty::$config_overwrite This tells if config file vars of the same name overwrite each other or not. Smarty::$config_fix_newlines This tells whether or not automatically fix newlines in config files. Smarty::register_prefilter() Registers a prefilter function to apply to a template before compiling Smarty::register_resource() Registers a resource to fetch a template
376
378 378
379
378
377
377 376
389
Smarty_Compiler::_expand_quoted_text() expand quoted text with embedded variables Smarty_Compiler::_compile_tag() Compile a template tag Smarty_Compiler::_compile_smarty_ref() Compiles references of type $smarty.foo Smarty_Compiler::_load_filters() load pre- and post-filters Smarty_Compiler::_parse_attrs() Parse attribute string Smarty_Compiler::_parse_modifiers() parse modifier chain into PHP code Smarty_Compiler::_parse_is_expr() Parse is expression Smarty_Compiler::_parse_conf_var() parse configuration variable expression into PHP code Smarty_Compiler::_compile_section_start() Compile {section ...} tag Smarty_Compiler::_compile_registered_object_tag() compile a registered object tag Smarty_Compiler::_compile_if_tag() Compile {if ...} tag Smarty_Compiler::_compile_foreach_start() Compile {foreach ...} tag. Smarty_Compiler::_compile_file() compile a resource Smarty_Compiler::_compile_include_php_tag() Compile {include ...} tag Smarty_Compiler::_compile_include_tag() Compile {include ...} tag Smarty_Compiler::_compile_plugin_call() compiles call to plugin of type $type with name $name Smarty_Compiler::_compile_insert_tag() Compile {insert ...} tag Smarty_Compiler::_parse_parenth_args() parse arguments in function call parenthesis Smarty_Compiler::_parse_section_prop() parse section property expression into PHP code smarty_core_get_include_path() Get path to file from include_path smarty_core_display_debug_console() Smarty debug_console function plugin smarty_core_create_dir_structure() create full directory structure smarty_core_get_microtime() Get seconds and microseconds smarty_core_get_php_resource() Retrieves PHP script resource smarty_core_is_trusted() determines if a resource is trusted or not smarty_core_is_secure() determines if a resource is secure or not. smarty_core_assign_smarty_interface()
401 400 400 401 401 402 401 401 400 400 399 398 398 399 399 399 399 402 402 409 408 407 410 411 413 412 406
Smarty assign_smarty_interface core plugin smarty_core_assemble_plugin_filepath() assemble filepath of requested plugin Smarty_Compiler::_parse_var_props() compile single variable and section properties token into PHP code Smarty_Compiler::_parse_vars_props() compile multiple variables and section properties tokens into PHP code Smarty_Compiler::_parse_var() parse variable expression into PHP code Smarty_Compiler::_pop_cacheable_state() check if the compilation changes from non-cacheable to cacheable state with the end of the current plugin return php-code to reflect the transition. Smarty_Compiler::_push_cacheable_state() check if the compilation changes from cacheable to non-cacheable state with the beginning of the current plugin. return php-code to reflect the transition. Smarty_Compiler::_syntax_error() display Smarty syntax error Smarty_Compiler::_quote_replace() Quote subpattern references Smarty_Compiler::_compile_custom_tag() compile custom function tag Smarty_Compiler::_compile_compiler_tag() compile the custom compiler tag Smarty::_compile_resource() compile the template Smarty::unregister_resource() Unregisters a resource Smarty::unregister_prefilter() Unregisters a prefilter function Smarty::_compile_source() compile the given source Smarty::_dequote() Remove starting and ending quotes from the string Smarty::_get_auto_filename() get a concrete filename for automagically created content Smarty::_fetch_resource_info() fetch the template info. Gets timestamp, and source if get_source is true Smarty::_eval() wrapper for eval() retaining $this Smarty::unregister_postfilter() Unregisters a postfilter function Smarty::unregister_outputfilter() Unregisters an outputfilter function Smarty::unregister_block() Unregisters block function Smarty::trigger_error() trigger Smarty error Smarty::template_exists()
405 403
403
402 403
403
404 403 398 398 391 391 391 391 392 393 392
Checks whether requested template exists. Smarty::unregister_compiler_function() Unregisters compiler function Smarty::unregister_function() Unregisters custom function Smarty::unregister_object() Unregisters object Smarty::unregister_modifier() Unregisters modifier Smarty::_get_auto_id() returns an auto_id for auto-file-functions Smarty::_get_compile_path() Get the compile path for this resource Smarty_Compiler Template compiling class Smarty::_unlink() unlink a file, possibly using expiration time Smarty::_trigger_fatal_error() trigger Smarty plugin error Smarty_Compiler::_add_plugin() add plugin Smarty_Compiler::_compile_arg_list() Smarty_Compiler::_compile_capture_tag() Compile {capture} .. {/capture} tags Smarty_Compiler::_compile_block_tag() compile block function tag Smarty::_smarty_include() called for included templates Smarty::_smarty_cache_attrs() get or set an array of cached attributes for function that is Smarty::_is_compiled() test if resource needs compiling Smarty::_include() wrapper for include() retaining $this Smarty::_get_plugin_filepath() get filepath of requested plugin Smarty::_parse_resource_name() parse out the type and name from the resource Smarty::_process_compiled_include_callback() callback function for preg_replace, to call a non-cacheable block Smarty::_run_mod_handler() Handle modifiers Smarty::_read_file() read in a file from line $start for $lines. Source code for sample1.php
390 390 390 390 393 393 396 396 396 397 397 397 397 395 395 394 394 393 394 394 395 395 10
T
tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyNoC() Shows correct behavior for handling the fuzzy "NO" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyNoB() Shows correct behavior for handling the fuzzy "No" value 604 603
tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyOffA() Shows correct behavior for handling the fuzzy "Off" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyOffB() Shows correct behavior for handling the fuzzy "OFF" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyOnB() Shows correct behavior for handling the fuzzy "ON" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyOnA() Shows correct behavior for handling the fuzzy "On" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyNoA() Shows correct behavior for handling the fuzzy "no" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyFalseC() Shows correct behavior for handling the fuzzy "FALSE" value tests_phpDocumentorSetupDecideOnOrOffTests::testBasicOff() Shows correct behavior for handling the perfect expected "off" value tests_phpDocumentorSetupDecideOnOrOffTests::tearDown() Tears down the fixture, for example, close a network connection. tests_phpDocumentorSetupDecideOnOrOffTests::testBasicOn() Shows correct behavior for handling the perfect expected "on" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyEmpty() Shows correct behavior for handling the fuzzy "" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyFalseB() Shows correct behavior for handling the fuzzy "False" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyFalseA() Shows correct behavior for handling the fuzzy "false" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyOne() Shows correct behavior for handling the fuzzy "1" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyTrueA() Shows correct behavior for handling the fuzzy "true" value tests_phpDocumentorSetupDecideOnOrOffTests::testUnexpectedGreatLiterature() Shows correct behavior for handling an odd "ash nazg durbatuluk" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyZero() Shows correct behavior for handling the fuzzy "0" value tests_phpDocumentorSetupDecideOnOrOffTests::testUnexpectedLargeNumber() Shows correct behavior for handling an odd "10" value tests_phpDocumentorSetupDecideOnOrOffTests::testUnexpectedNegative() Shows correct behavior for handling an odd "-1" value tests_phpDocumentorSetupDecideOnOrOffTests::testUnexpectedSpaces() Shows correct behavior for handling an odd " " value tests_phpDocumentorSetupDecideOnOrOffTests::testUnexpectedNull() Shows correct behavior for handling an odd NULL value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyYesE() Shows correct behavior for handling the fuzzy "YES" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyYesD() Shows correct behavior for handling the fuzzy "Yes" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyTrueC() Shows correct behavior for handling the fuzzy "TRUE" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyTrueB() Shows correct behavior for handling the fuzzy "True" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyYesA() Shows correct behavior for handling the fuzzy "y" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyYesB() Shows correct behavior for handling the fuzzy "Y" value tests_phpDocumentorSetupDecideOnOrOffTests::testFuzzyYesC()
604 604 605 604 603 603 602 601 602 602 603 602 605 605 607 607 607 608 608 608 607 606 605 605 606 606 606
Shows correct behavior for handling the fuzzy "yes" value tests_phpDocumentorSetupDecideOnOrOffTests::setUp() 601 Sets up the fixture, for example, open a network connection. tests_phpDocumentorSetupDecideOnOrOffTests::main() 601 Runs the test methods of this class. tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryHands() 595 Shows correct behavior for handling the perfect expected "HandS" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryEarthli() 594 Shows correct behavior for handling the perfect expected "earthli" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryL0l33t() 595 Shows correct behavior for handling the perfect expected "l0l33t" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryPear() 595 Shows correct behavior for handling the perfect expected "PEAR" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryPhpdocde( ) 596 Shows correct behavior for handling the perfect expected "phpdoc.de" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryPhp() 595 Shows correct behavior for handling the perfect expected "PHP" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryDomPhpht mllib() 594 Shows correct behavior for handling the perfect expected "DOM/phphtmllib" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryDomPhpdo cde() 594 Shows correct behavior for handling the perfect expected "DOM/phpdoc.de" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalSecondarySmarty( ) 592 Shows correct behavior for handling the perfect expected "Smarty" secondary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalSecondaryFrames( ) 592 Shows correct behavior for handling the perfect expected "frames" secondary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryDefault() 592 Shows correct behavior for handling the perfect expected "default" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryDomDefaul t() 593 Shows correct behavior for handling the perfect expected "DOM/default" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryDomL0l33t () 593 Shows correct behavior for handling the perfect expected "DOM/l0l33t" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryDomEarthli () 593 Shows correct behavior for handling the perfect expected "DOM/earthli" tertiary value
tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalTertiaryPhphtmllib( ) 596 Shows correct behavior for handling the perfect expected "phphtmllib" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalWithOneArgPrimar yCHM() 596 Shows correct behavior for handling the perfect expected "CHM" primary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testPreventUpToParentPathin gOnPrimaryWithTwoArgs() 599 Verify no up-to-parent pathing is allowed... tests_phpDocumentorSetupCleanConverterNamePieceTests::testPreventUpToParentPathin gOnPrimaryWithOneArg() 599 Verify no up-to-parent pathing is allowed... tests_phpDocumentorSetupCleanConverterNamePieceTests::testPreventUpToParentPathin gOnSecondary() 600 Verify no up-to-parent pathing is allowed... tests_phpDocumentorSetupCleanConverterNamePieceTests::testPreventUpToParentPathin gOnTertiary() 600 Verify no up-to-parent pathing is allowed... tests_phpDocumentorSetupDecideOnOrOffTests 601 Unit Testing of the phpDocumentor_setup's decideOnOrOff() method tests_phpDocumentorSetupCleanConverterNamePieceTests::testUserDefinedTertiaryValue () 600 Shows correct behavior for handling the perfect expected "b2evo.v-1-10" tertiary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalWithTwoArgsPrim aryXML() 599 Shows correct behavior for handling the perfect expected "XML" primary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalWithTwoArgsPrim aryPDF() 598 Shows correct behavior for handling the perfect expected "PDF" primary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalWithOneArgPrimar yPDF() 597 Shows correct behavior for handling the perfect expected "PDF" primary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalWithOneArgPrimar yHTML() 597 Shows correct behavior for handling the perfect expected "HTML" primary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalWithOneArgPrimar yXML() 597 Shows correct behavior for handling the perfect expected "XML" primary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalWithTwoArgsPrim aryCHM() 598 Shows correct behavior for handling the perfect expected "CHM" primary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalWithTwoArgsPrim aryHTML() 598 Shows correct behavior for handling the perfect expected "HTML" primary value tests_phpDocumentorTParserGetInlineTagsTests 608 Unit Testing of the phpDocumentorTParser's getInlineTags() method tests_phpDocumentorTParserGetInlineTagsTests::main() 609 Runs the test methods of this class. T_DOC_COMMENT 879
T_CONST T_FINAL T_IMPLEMENTS T_ML_COMMENT T_INTERFACE T_ABSTRACT Tokenizer.php XML/Beautifier.php tutorialLink tutorial link tests_phpDocumentorTParserTests::suite() tutorialLink::$section tutorialLink::$title tutorialLink::addLink() sets up the link tutorialLink::$type T_PRIVATE T_PROTECTED TUTORIAL_EVENT_NOEVENTS starting state TUTORIAL_EVENT_ITAG used when an {@inline tag} is found TUTORIAL_EVENT_OPENTAG used when an open <tag> is found TUTORIAL_EVENT_SINGLEQUOTE used when a <!-- comment --> is found Tokenizer.php Source code top.php Source code TUTORIAL_EVENT_ENTITY used when an &entity; is found TUTORIAL_EVENT_DOUBLEQUOTE used when a <!-- comment --> is found TutorialHighlightParser.inc Source Code Highlighting T_PUBLIC TUTORIAL_EVENT_ATTRIBUTE used when a <tag attr="attribute"> is found TUTORIAL_EVENT_CLOSETAG used when a close </tag> is found TUTORIAL_EVENT_COMMENT used when a <!-- comment --> is found tests_phpDocumentorTParserTests::main() tests_phpDocumentorTParserTests tests_phpDocumentorTParserGetInlineTagsTests::testShowCorrectBehaviorInlineSourceW henParsePrivateOn() Shows correct behavior for handling an inline source tag e.g. {at-source} tests_phpDocumentorTParserGetInlineTagsTests::testShowCorrectBehaviorInlineSourceW henParsePrivateOff() Shows correct behavior for handling an inline source tag e.g. {at-source}
879 879 879 879 879 879 864 794 713 795 795 795 795 879 879 884 884 884 884 1313 1181 884 884 882 880 883 883 883 713 713 612
611
tests_phpDocumentorTParserGetInlineTagsTests::testShowCorrectBehaviorInlineTutorialW henParsePrivateOff() 612 Shows correct behavior for handling an inline tutorial tag e.g. {at-tutorial path-to-pkgfile} tests_phpDocumentorTParserGetInlineTagsTests::testShowCorrectBehaviorInlineTutorialW henParsePrivateOn() 612 Shows correct behavior for handling an inline tutorial tag e.g. {at-tutorial path-to-pkgfile} tokenizer_ext 637 top.php 628 phpDocumentor :: docBuilder Web Interface tests_phpDocumentorTParserGetInlineTagsTests::testShowCorrectBehaviorInlineLinkWhen ParsePrivateOn() 611 Shows correct behavior for handling an inline link tag e.g. {at-link URL link-text} tests_phpDocumentorTParserGetInlineTagsTests::testShowCorrectBehaviorInlineLinkWhen ParsePrivateOff() 611 Shows correct behavior for handling an inline link tag e.g. {at-link URL link-text} tests_phpDocumentorTParserGetInlineTagsTests::tearDown() 609 Tears down the fixture, for example, close a network connection. tests_phpDocumentorTParserGetInlineTagsTests::setUp() 609 Sets up the fixture, for example, open a network connection. tests_phpDocumentorTParserGetInlineTagsTests::testShowCorrectBehaviorInlineExample WhenParsePrivateOff() 610 Shows correct behavior for handling an inline example tag e.g. {at-example path-to-file} tests_phpDocumentorTParserGetInlineTagsTests::testShowCorrectBehaviorInlineExample WhenParsePrivateOn() 610 Shows correct behavior for handling an inline example tag e.g. {at-example path-to-file} tests_phpDocumentorTParserGetInlineTagsTests::testShowCorrectBehaviorInlineInternalW henParsePrivateOn() 611 Shows correct behavior for handling an inline internal tag e.g. {at-internal blah-blah-blah} tests_phpDocumentorTParserGetInlineTagsTests::testShowCorrectBehaviorInlineInternalW henParsePrivateOff() 610 Shows correct behavior for handling an inline internal tag e.g. {at-internal blah-blah-blah} tests_HighlightParserTests 710 tests_HighlightParserTests::main() 710 tests_ParserPageTests::main() 712 tests_ParserPageTests 712 tests_ParserPageTests::suite() 712 tests_phpDocumentorSetupTests 712 tests_phpDocumentorSetupTests::suite() 713 tests_phpDocumentorSetupTests::main() 713 tests_ParserClassTests::suite() 712 tests_ParserClassTests::main() 711 tests_IntermediateParserTests 711 tests_HighlightParserTests::suite() 710 tests_IntermediateParserTests::main() 711 tests_IntermediateParserTests::suite() 711
tests_ParserClassTests 711 tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalSecondaryDocboo kPeardoc2() 591 Shows correct behavior for handling the perfect expected "DocBook/peardoc2" secondary value tests_phpDocumentorSetupCleanConverterNamePieceTests::testNormalSecondaryDefault( ) 591 Shows correct behavior for handling the perfect expected "default" secondary value testClass 552 testarraybug::$myarrayName1 552 test with no default, should be myarrayName1 testme 552 testme::$me 553 tests_HighlightParserGetInlineTagsTests 568 Unit Testing of the HighlightParser's getInlineTags() method test_541886 554 Test for bug #541886 testarraybug::$myarrayName 552 testarraybug::$arrayType1 552 test with no default, should be arrayType1 testContantBlah5 529 Short Desc 2.0 Test This is still the short desc Comment and so is this testContantBlah4 529 Short Desc 2.0 Test This is still the short desc Comment test 551 I'm a odd test case test2 551 tags demonstration, but this @version tag is ignored testarraybug::$arrayType 552 testarraybug 551 tests variable names with the word 'array' in them tests_HighlightParserGetInlineTagsTests::main() 568 Runs the test methods of this class. tests_HighlightParserGetInlineTagsTests::setUp() 568 Sets up the fixture, for example, open a network connection. tests_IntermediateParserAddPrivatePageTests::testShowCorrectBehaviorWhenPrivatePage ArrayIsEmpty() 571 Shows correct behavior for adding a private page object, tests_IntermediateParserAddPrivatePageTests::tearDown() 571 Tears down the fixture, for example, close a network connection. tests_IntermediateParserAddPrivatePageTests::testShowCorrectBehaviorWhenPrivatePage ArrayIsNotAlreadyEmpty() 571 Shows correct behavior for adding a private page object, tests_ParserClassGetSourceLocationTests 572 Unit Testing of the ParserClass's getSourceLocation() method tests_ParserClassGetSourceLocationTests::setUp() 572 Sets up the fixture, for example, open a network connection. tests_ParserClassGetSourceLocationTests::main() 572 Runs the test methods of this class. tests_IntermediateParserAddPrivatePageTests::setUp() 570 Sets up the fixture, for example, open a network connection.
tests_IntermediateParserAddPrivatePageTests::main() 570 Runs the test methods of this class. tests_HighlightParserGetInlineTagsTests::testShowCorrectBehaviorWhenGivenOneEmptyA rg() 569 Shows correct behavior when called with no actual value tests_HighlightParserGetInlineTagsTests::tearDown() 569 Tears down the fixture, for example, close a network connection. tests_HighlightParserGetInlineTagsTests::testShowCorrectBehaviorWhenGivenOneEmptyA rgAndFalse() 569 Shows correct behavior when called with no actual value tests_HighlightParserGetInlineTagsTests::testShowCorrectBehaviorWhenGivenOneEmptyA rgAndTrue() 569 Shows correct behavior when called with no actual value tests_IntermediateParserAddPrivatePageTests 570 Unit Testing of the IntermediateParser's addPrivatePage() method testContantBlah3 529 Short Desc 2.0 Test. This is the Extended Comment testContantBlah2 529 Short Desc 2.0 Test. This is the Extended Comment test_4412893() 489 I am using just the first line as my short desc test_4412892() 489 I started my short desc on the first line. test_4412894() 490 I am using a blank line to end my short desc test_4412895() 490 This is a test to see if the desc is fooled by 2.4 the short desc ends here. test_bug_567455_2() 490 This example is also really tricky test_bug_567455() 490 This example is really tricky test_441289() 489 This is a long comment which needs more than one line. test8() 489 This is a test case where i think things break test_441278() 487 Test description. test_441275() 486 This makes sure the basic element of bug 44127 is fixed test_441287() 488 sdesc test_4412872() 488 Check to see if we are stripping whitespace before the * test7() 489 This desc tries to fool the non period short desc systems test6() 489 This desc test_441433() 491 a second test.
test_443153() 492 test function test_escape() 525 tests test_eofquotes() 524 tests test_escape2() 525 test() 526 test2 was lost, isn't any more testContantBlah 529 Short Desc Test. This is the Extended Comment test2() 526 test_authoremail() 522 test function test_558031() 503 test_445305() 494 test_445298() 493 test function test_445820() 495 test function testie 497 testie thisisdumbbutworks 498 ! tests_ParserClassGetSourceLocationTests::tearDown() 572 Tears down the fixture, for example, close a network connection. tests_ParserClassGetSourceLocationTests::testWhenLocationNotSetAndPearizeFalse() 573 Shows correct behavior when tests_ParserPageGetSourceLocationTests::testWhenPearLocationSetIncludingDotsAndPea rizeFalse() 585 Include a ".." in an absolute, PEAR path, tests_ParserPageGetSourceLocationTests::testWhenPearLocationSetAndPearizeTrue() 585 Show correct behavior when tests_ParserPageGetSourceLocationTests::testWhenPearLocationSetIncludingDotsAndPea rizeNull() 585 Include a ".." in an absolute, PEAR path, tests_ParserPageGetSourceLocationTests::testWhenPearLocationSetIncludingDotsAndPea rizeTrue() 585 Include a ".." in an absolute, PEAR path, tests_ParserPageGetSourceLocationTests::testWhenPearRelativeLocationSetAndPearizeN ull() 586 Include a ".." in a relative, PEAR path, tests_ParserPageGetSourceLocationTests::testWhenPearRelativeLocationSetAndPearizeF alse() 586 Include a ".." in a relative, PEAR path, tests_ParserPageGetSourceLocationTests::testWhenPearLocationSetAndPearizeNull() 584 Show correct behavior when tests_ParserPageGetSourceLocationTests::testWhenPearLocationSetAndPearizeFalse() 584 Show correct behavior when tests_ParserPageGetSourceLocationTests::testWhenNonPearLocationSetIncludingDotsAnd PearizeNull() 582 Include a ".." in an absolute, non-PEAR path, tests_ParserPageGetSourceLocationTests::testWhenNonPearLocationSetIncludingDotsAnd
PearizeFalse() 582 Include a ".." in an absolute, non-PEAR path, tests_ParserPageGetSourceLocationTests::testWhenNonPearLocationSetIncludingDotsAnd PearizeTrue() 583 Include a ".." in an absolute, non-PEAR path, tests_ParserPageGetSourceLocationTests::testWhenNonPearRelativeLocationSetAndPeari zeFalse() 583 Include a ".." in a relative, non-PEAR path, tests_ParserPageGetSourceLocationTests::testWhenNonPearRelativeLocationSetAndPeari zeTrue() 584 Include a ".." in a relative, non-PEAR path, tests_ParserPageGetSourceLocationTests::testWhenNonPearRelativeLocationSetAndPeari zeNull() 583 Include a ".." in a relative, non-PEAR path, tests_ParserPageGetSourceLocationTests::testWhenPearRelativeLocationSetAndPearizeTr ue() 586 Include a ".." in a relative, PEAR path, tests_phpDocumentorSetupCleanConverterNamePieceTests 587 Unit Testing of the phpDocumentor_setup's cleanConverterNamePiece() method tests_phpDocumentorSetupCleanConverterNamePieceTests::testExtremeExampleAndInvali dTertiaryA() 590 Extreme example of messy input... tests_phpDocumentorSetupCleanConverterNamePieceTests::testExtremeExampleAndInvali dSecondary() 589 Extreme example of messy input... tests_phpDocumentorSetupCleanConverterNamePieceTests::testExtremeExampleAndInvali dTertiaryB() 590 Extreme example of messy input... tests_phpDocumentorSetupCleanConverterNamePieceTests::testExtremeExampleButValid PrimaryWithOneArg() 590 Extreme example of messy input... tests_phpDocumentorSetupCleanConverterNamePieceTests::testExtremeExampleButValid Secondary() 591 Extreme example of messy input... tests_phpDocumentorSetupCleanConverterNamePieceTests::testExtremeExampleButValid PrimaryWithTwoArgs() 591 Extreme example of messy input... tests_phpDocumentorSetupCleanConverterNamePieceTests::testDoNotAllowTruePathingO nTertiary() 589 Verify no up-to-parent pathing is allowed... tests_phpDocumentorSetupCleanConverterNamePieceTests::testDoNotAllowTruePathingO nSecondary() 589 Verify no up-to-parent pathing is allowed... tests_phpDocumentorSetupCleanConverterNamePieceTests::setUp() 587 Sets up the fixture, for example, open a network connection. tests_phpDocumentorSetupCleanConverterNamePieceTests::main() 587 Runs the test methods of this class. tests_phpDocumentorSetupCleanConverterNamePieceTests::tearDown() 588 Tears down the fixture, for example, close a network connection. tests_phpDocumentorSetupCleanConverterNamePieceTests::testDoNotAllowTruePathingO nPrimaryWithOneArg() 588 Verify no up-to-parent pathing is allowed... tests_phpDocumentorSetupCleanConverterNamePieceTests::testDoNotAllowTruePathingO
nPrimaryWithTwoArgs() 588 Verify no up-to-parent pathing is allowed... tests_ParserPageGetSourceLocationTests::testWhenNonPearLocationSetAndPearizeTrue()582 Shows correct behavior when tests_ParserPageGetSourceLocationTests::testWhenNonPearLocationSetAndPearizeNull() 581 Shows correct behavior when tests_ParserClassGetSourceLocationTests::testWhenNonPearRelativeLocationSetAndPeari zeFalse() 575 Include a ".." in a relative, non-PEAR path, tests_ParserClassGetSourceLocationTests::testWhenNonPearLocationSetIncludingDotsAn dPearizeTrue() 575 Include a ".." in an absolute, non-PEAR path, tests_ParserClassGetSourceLocationTests::testWhenNonPearRelativeLocationSetAndPeari zeNull() 576 Include a ".." in a relative, non-PEAR path, tests_ParserClassGetSourceLocationTests::testWhenNonPearRelativeLocationSetAndPeari zeTrue() 576 Include a ".." in a relative, non-PEAR path, tests_ParserClassGetSourceLocationTests::testWhenPearLocationSetAndPearizeNull() 577 Show correct behavior when tests_ParserClassGetSourceLocationTests::testWhenPearLocationSetAndPearizeFalse() 576 Show correct behavior when tests_ParserClassGetSourceLocationTests::testWhenNonPearLocationSetIncludingDotsAn dPearizeNull() 575 Include a ".." in an absolute, non-PEAR path, tests_ParserClassGetSourceLocationTests::testWhenNonPearLocationSetIncludingDotsAn dPearizeFalse() 575 Include a ".." in an absolute, non-PEAR path, tests_ParserClassGetSourceLocationTests::testWhenLocationNotSetAndPearizeTrue() 573 Shows correct behavior when tests_ParserClassGetSourceLocationTests::testWhenLocationNotSetAndPearizeNull() 573 Shows correct behavior when tests_ParserClassGetSourceLocationTests::testWhenNonPearLocationSetAndPearizeFalse () 574 Shows correct behavior when tests_ParserClassGetSourceLocationTests::testWhenNonPearLocationSetAndPearizeNull() 574 Shows correct behavior when tests_ParserClassGetSourceLocationTests::testWhenNonPearLocationSetAndPearizeTrue( ) 574 Shows correct behavior when tests_ParserClassGetSourceLocationTests::testWhenPearLocationSetAndPearizeTrue() 577 Show correct behavior when tests_ParserClassGetSourceLocationTests::testWhenPearLocationSetIncludingDotsAndPea rizeFalse() 577 Include a ".." in an absolute, PEAR path, tests_ParserPageGetSourceLocationTests::tearDown() 580 Tears down the fixture, for example, close a network connection. tests_ParserPageGetSourceLocationTests::setUp() 580 Sets up the fixture, for example, open a network connection. tests_ParserPageGetSourceLocationTests::testWhenLocationNotSetAndPearizeFalse() 580 Shows correct behavior when tests_ParserPageGetSourceLocationTests::testWhenLocationNotSetAndPearizeNull() 580 Shows correct behavior when
tests_ParserPageGetSourceLocationTests::testWhenNonPearLocationSetAndPearizeFalse( ) 581 Shows correct behavior when tests_ParserPageGetSourceLocationTests::testWhenLocationNotSetAndPearizeTrue() 581 Shows correct behavior when tests_ParserPageGetSourceLocationTests::main() 579 Runs the test methods of this class. tests_ParserPageGetSourceLocationTests 579 Unit Testing of the ParserPage's getSourceLocation() method tests_ParserClassGetSourceLocationTests::testWhenPearLocationSetIncludingDotsAndPea rizeTrue() 578 Include a ".." in an absolute, PEAR path, tests_ParserClassGetSourceLocationTests::testWhenPearLocationSetIncludingDotsAndPea rizeNull() 578 Include a ".." in an absolute, PEAR path, tests_ParserClassGetSourceLocationTests::testWhenPearRelativeLocationSetAndPearizeF alse() 578 Include a ".." in a relative, PEAR path, tests_ParserClassGetSourceLocationTests::testWhenPearRelativeLocationSetAndPearizeN ull() 578 Include a ".." in a relative, PEAR path, tests_ParserClassGetSourceLocationTests::testWhenPearRelativeLocationSetAndPearizeT rue() 579 Include a ".." in a relative, PEAR path, test2_441275() 486 This tests some more advanced cases to make sure to handle them
U
utilities.php phpDocumentor :: docBuilder Web Interface Using the PDFParser XML templating language 625 131
V
varLink::$type varLink class variable link vdump_par() 796 795 626
W
WordParser::getSource() Retrieve source code for the last function/method WordParser::getPos() Returns the current pointer position, or 1 character after the end of the word WordParser::getBlock() Unused WordParser::getWord() Retrieve a token from the token list 929 929 929 930
WordParser::setPos() Set the internal cursor within the source code WordParser::setWhitespace() set parser to return or strip whitespace WordParser::setup() Initialize the WordParser WordParser::setSeperator() Sets the list of possible separator tokens WordParser::backupPos() Backup to the previous token so that it can be retrieved again in a new context. WordParser Retrieves tokens from source code for use by the Parser Writing templates for the CHMdefault Converter Writing templates for the PDFdefault Converter Writing a Converter, Methods Writing templates for the XMLDocBook Converter Writing templates for the HTMLSmarty Converter WordParser.inc a generic lexer Writing templates for the HTMLframes Converter Writing a New Converter
X
XMLDocBookpeardoc2Converter::convertVar() 307 Does nothing in this converter XMLDocBookpeardoc2Converter::endClass() 307 Writes out the template file of $class_data and unsets the template to save memory XMLDocBookpeardoc2Converter::exampleProgramExample() 307 Used to convert the {@example} inline tag in a docblock. XMLDocBookpeardoc2Converter::flushPackageXml() 308 XMLDocBookpeardoc2Converter::convertTutorial() 306 Convert tutorials for output XMLDocBookpeardoc2Converter::convertPage() 306 converts procedural pages for template output XMLDocBookpeardoc2Converter::convertInclude() 305 Converts include elements for template output XMLDocBookpeardoc2Converter::convertMethod() 305 Converts method for template output XMLDocBookpeardoc2Converter::convertPackagePage() 306 Does nothing - use tutorials for DocBook XMLDocBookpeardoc2Converter::formatIndex() 308 Does nothing XMLDocBookpeardoc2Converter::formatLeftIndex() 308 Creates package/lang/categoryname/packagename.xml for each package XMLDocBookpeardoc2Converter::generateFormattedInterfaceTrees() 309 returns a template-enabled array of interface inheritance trees XMLDocBookpeardoc2Converter::generatePkgElementIndex() 310 Generate alphabetical index of all elements by package and subpackage XMLDocBookpeardoc2Converter::generatePkgElementIndexes() 310 XMLDocBookpeardoc2Converter::getCData() 310
XMLDocBookpeardoc2Converter::generateFormattedClassTrees() 309 returns a template-enabled array of class trees XMLDocBookpeardoc2Converter::generateFormattedClassTree() 309 returns an array containing the class inheritance tree from the root object to the class XMLDocBookpeardoc2Converter::formatPkgIndex() 308 Does nothing XMLDocBookpeardoc2Converter::generateChildClassList() 308 returns a list of child classes XMLDocBookpeardoc2Converter::generateElementIndex() 308 does nothing XMLDocBookpeardoc2Converter::convertGlobal() 305 Converts global variables for template output XMLDocBookpeardoc2Converter::convertFunction() 305 Converts function for template output - does nothing in peardoc2! XMLDocBookpeardoc2Converter::$path 301 path of current page being converted XMLDocBookpeardoc2Converter::$processSpecialRoots 302 This converter knows about the new root tree processing XMLDocBookpeardoc2Converter::$sort_absolutely_everything 302 Pass elements by package, simplifies generation of package.xml/category.xml XMLDocBookpeardoc2Converter::$sort_page_contents_by_type 302 XMLDocBookConverter wants elements sorted by type as well as alphabetically XMLDocBookpeardoc2Converter::$page_dir 301 output directory for the current procedural page being processed XMLDocBookpeardoc2Converter::$page_data 301 template for the procedural page currently being processed XMLDocBookpeardoc2Converter::$packagexml 301 Contents of the packagename.xml file are stored in this template variable XMLDocBookpeardoc2Converter::$package_pages 301 array of converted package page names. XMLDocBookpeardoc2Converter::$page 301 name of current page being converted XMLDocBookpeardoc2Converter::$sourceloc 302 XMLDocBookpeardoc2Converter::$template_options 302 template options. Currently only 1 recognized option usepear XMLDocBookpeardoc2Converter::Br() 304 XMLDocBookpeardoc2Converter::convertClass() 304 Converts class for template output XMLDocBookpeardoc2Converter::convertDefine() 304 Converts defines for template output XMLDocBookpeardoc2Converter::ConvertErrorLog() 304 Create errors.html template file output XMLDocBookpeardoc2Converter::addSummaryToPackageXml() 303 XMLDocBookpeardoc2Converter::$_write_globals_xml 303 XMLDocBookpeardoc2Converter::$_peardoc2_constants 303 Constants, used for constants.tpl XMLDocBookpeardoc2Converter::$_peardoc2_globals 303 Global Variables, used for globals.tpl XMLDocBookpeardoc2Converter::$_write_constants_xml 303 XMLDocBookpeardoc2Converter::getClassLink() 310 XMLDocBookpeardoc2Converter::getDefineLink() 311 XMLDocBookpeardoc2Converter::writeFile() 317 Writes a file to target dir, beautify any .xml files first
XMLDocBookpeardoc2Converter::writeNewPPage() Does nothing XMLDocBookpeardoc2Converter::writeSource() Does nothing XMLpackagePageParser.inc Parser for XML DocBook-based phpDocumentor tutorials XMLDocBookpeardoc2Converter::writeExample() XMLDocBookpeardoc2Converter::wordwrap() XMLDocBookpeardoc2Converter::setTemplateDir() XMLDocBookpeardoc2Converter::type_adjust() XMLDocBookpeardoc2Converter::unmangle() XMLPackagePageParser Used to parse XML DocBook-based tutorials XMLPackagePageParser::$context XMLPackagePageParser::getParserEventName() debugging function XMLPackagePageParser::parse() Parse a new file XMLPackagePageParser::setupStates() setup the parser tokens, and the pushEvent/popEvent arrays XMLDocBookpeardoc2Converter.inc Source code XMLPackagePageParser::$refsect3id XMLPackagePageParser::$refsect2id XMLPackagePageParser::$eventHandlers XMLPackagePageParser::$pars XMLPackagePageParser::$refsect1id XMLDocBookpeardoc2Converter::returnSee() This function takes an abstractLink descendant and returns an html link XMLDocBookpeardoc2Converter::returnLink() XMLDocBookpeardoc2Converter::getMethodLink() XMLDocBookpeardoc2Converter::getPageLink() XMLDocBookpeardoc2Converter::getPageName() XMLDocBookpeardoc2Converter::getRootTree() return formatted class tree for the Class Trees page XMLDocBookpeardoc2Converter::getLink() do that stuff in $template_options XMLDocBookpeardoc2Converter::getId() Get the id value needed to allow linking XMLDocBookpeardoc2Converter::getExampleLink() XMLDocBookpeardoc2Converter::getFunctionLink() XMLDocBookpeardoc2Converter::getGlobalLink() XMLDocBookpeardoc2Converter::getSourceAnchor() Retrieve a Converter-specific anchor to a segment of a source code file parsed via a @filesource tag. XMLDocBookpeardoc2Converter::getTutorialId() XMLDocBookpeardoc2Converter::ProgramExample() XMLDocBookpeardoc2Converter::rcNatCmp() does a nat case sort on the specified second level value of the array XMLDocBookpeardoc2Converter::rcNatCmp1() does a nat case sort on the specified second level value of the array. XMLDocBookpeardoc2Converter::prepareDocBlock() XMLDocBookpeardoc2Converter::postProcess()
318 318 885 317 317 316 317 317 910 911 912 913 913 1140 911 911 911 911 911 316 316 313 313 313 313 312 312 311 311 312 314
XMLDocBookpeardoc2Converter::getVarLink() 314 XMLDocBookpeardoc2Converter::makeLeft() 315 XMLDocBookpeardoc2Converter::Output() 315 Generate the constants.xml, packagename.xml, and globals.xml files XMLDocBookpeardoc2Converter::$outputformat 301 XMLDocBookpeardoc2Converter::$name 301 XMLDocBookConverter::convertFunction() 286 Converts function for template output XMLDocBookConverter::convertGlobal() 287 Converts global variables for template output XMLDocBookConverter::convertInclude() 287 Converts include elements for template output XMLDocBookConverter::convertMethod() 287 Converts method for template output XMLDocBookConverter::ConvertErrorLog() 286 Create errors.html template file output XMLDocBookConverter::convertDefine() 286 Converts defines for template output XMLDocBookConverter::$sourceloc 284 XMLDocBookConverter::$template_options 284 template options. Currently only 1 recognized option usepear XMLDocBookConverter::convertClass() 285 Converts class for template output XMLDocBookConverter::convertPackagePage() 288 Converts package page and sets its package as used in $package_pages XMLDocBookConverter::convertPage() 288 converts procedural pages for template output XMLDocBookConverter::formatLeftIndex() 289 Generate indexes for li_package.html and classtree output files XMLDocBookConverter::formatPkgIndex() 290 HTMLdefaultConverter chooses to format both package indexes and the complete index here XMLDocBookConverter::generateElementIndex() 290 Generate alphabetical index of all elements XMLDocBookConverter::generateFormattedClassTree() 290 returns an array containing the class inheritance tree from the root object to the class XMLDocBookConverter::formatIndex() 289 HTMLdefaultConverter uses this function to format template index.html and packages.html XMLDocBookConverter::endPage() 289 Writes out the template file of $page_data and unsets the template to save memory XMLDocBookConverter::convertTutorial() 288 XMLDocBookConverter::convertVar() 288 Converts class variables for template output. XMLDocBookConverter::endClass() 289 Writes out the template file of $class_data and unsets the template to save memory XMLDocBookConverter::$sort_page_contents_by_type 284 XMLDocBookConverter wants elements sorted by type as well as alphabetically XMLDocBookConverter::$path 284 path of current page being converted XMLDocBookConverter::$class_data 282 template for the class currently being processed XMLDocBookConverter::$class_dir 282 output directory for the current class being processed
XMLDocBookConverter::$current 282 contains all of the template procedural page element loop data needed for the current template XMLDocBookConverter::$currentclass 282 contains all of the template class element loop data needed for the current template XMLDocBookConverter::$class 282 name of current class being converted XMLDocBookConverter::$category 282 peardoc2 Category XMLDocBookConverter.inc 281 XML output converter for DocBook. XMLDocBookConverter 281 XML DocBook converter. XMLDocBookConverter::$base_dir 281 target directory passed on the command-line. XMLDocBookConverter::$function_data 282 XMLDocBookConverter::$juststarted 283 controls formatting of parser informative output XMLDocBookConverter::$package_pages 283 array of converted package page names. XMLDocBookConverter::$page 284 name of current page being converted XMLDocBookConverter::$page_data 284 template for the procedural page currently being processed XMLDocBookConverter::$page_dir 284 output directory for the current procedural page being processed XMLDocBookConverter::$outputformat 283 XMLDocBookConverter::$name 283 XMLDocBookConverter::$leftindex 283 indexes of elements by package that need to be generated XMLDocBookConverter::$local 283 whether a @see is going to be in the $base_dir, or in a package/subpackage subdirectory of $base_dir XMLDocBookConverter::$method_data 283 XMLDocBookConverter::generateFormattedClassTrees() 291 returns a template-enabled array of class trees XMLDocBookConverter::generatePkgElementIndex() 291 Generate alphabetical index of all elements by package and subpackage XMLDocBookConverter::unmangle() 298 XMLDocBookConverter::writeNewPPage() 298 XMLDocBookpeardoc2Converter 298 XML DocBook converter. XMLDocBookpeardoc2Converter::$base_dir 299 target directory passed on the command-line. XMLDocBookConverter::type_adjust() 298 XMLDocBookConverter::SmartyInit() 298 XMLDocBookConverter::returnSee() 297 This function takes an abstractLink descendant and returns an html link XMLDocBookConverter::setTargetDir() 297 calls the converter setTargetDir, and then copies any template images and the stylesheet if they haven't been copied XMLDocBookConverter::setTemplateDir() 297 XMLDocBookpeardoc2Converter::$category 299
peardoc2 Category XMLDocBookpeardoc2Converter::$class 299 name of current class being converted XMLDocBookpeardoc2Converter::$juststarted 300 controls formatting of parser informative output XMLDocBookpeardoc2Converter::$leftindex 300 indexes of elements by package that need to be generated XMLDocBookpeardoc2Converter::$local 300 whether a @see is going to be in the $base_dir, or in a package/subpackage subdirectory of $base_dir XMLDocBookpeardoc2Converter::$method_data 300 XMLDocBookpeardoc2Converter::$function_data 300 XMLDocBookpeardoc2Converter::$currentclass 300 contains all of the template class element loop data needed for the current template XMLDocBookpeardoc2Converter::$class_data 299 template for the class currently being processed XMLDocBookpeardoc2Converter::$class_dir 299 output directory for the current class being processed XMLDocBookpeardoc2Converter::$current 300 contains all of the template procedural page element loop data needed for the current template XMLDocBookConverter::returnLink() 297 XMLDocBookConverter::rcNatCmp1() 296 does a nat case sort on the specified second level value of the array. XMLDocBookConverter::getGlobalLink() 293 XMLDocBookConverter::getId() 293 Get the id value needed to allow linking XMLDocBookConverter::getLink() 294 do that stuff in $template_options XMLDocBookConverter::getMethodLink() 294 XMLDocBookConverter::getFunctionLink() 293 XMLDocBookConverter::getDefineLink() 292 XMLDocBookConverter::generatePkgElementIndexes() 292 XMLDocBookConverter::getCData() 292 XMLDocBookConverter::getClassLink() 292 XMLDocBookConverter::getPageLink() 294 XMLDocBookConverter::getPageName() 295 XMLDocBookConverter::postProcess() 296 XMLDocBookConverter::prepareDocBlock() 296 XMLDocBookConverter::rcNatCmp() 296 does a nat case sort on the specified second level value of the array XMLDocBookConverter::Output() 296 This function is not used by HTMLdefaultConverter, but is required by Converter XMLDocBookConverter::makeLeft() 296 XMLDocBookConverter::getRootTree() 295 return formatted class tree for the Class Trees page XMLDocBookConverter::getTutorialId() 295 XMLDocBookConverter::getVarLink() 295 XMLDocBookpeardoc2Converter.inc 280 Outputs documentation in XML DocBook format, in the version expected by pear.php.net's documentation team
_
_IN_PHP5 637