| @@ -7,6 +7,7 @@ module Docs · 6 unmodified lines |
| 7 | 'Cond' => 'pthreads', | 7 | 'Cond' => 'pthreads', |
| 8 | 'CURL' => 'cURL', | 8 | 'CURL' => 'cURL', |
| 9 | 'Date' => 'Date/Time', | 9 | 'Date' => 'Date/Time', |
| | 10 | 'Ds' => 'Data Structures', |
| 10 | 'ErrorException' => 'Predefined Exceptions', | 11 | 'ErrorException' => 'Predefined Exceptions', |
| 11 | 'Exception' => 'Predefined Exceptions', | 12 | 'Exception' => 'Predefined Exceptions', |
| 12 | 'Json' => 'JSON', | 13 | 'Json' => 'JSON', |
| @@ -14,6 +15,7 @@ module Docs · 1 unmodified line |
| 14 | 'Mutex' => 'pthreads', | 15 | 'Mutex' => 'pthreads', |
| 15 | 'php_user_filter' => 'Stream', | 16 | 'php_user_filter' => 'Stream', |
| 16 | 'Pool' => 'pthreads', | 17 | 'Pool' => 'pthreads', |
| | 18 | 'QuickHash' => 'Quickhash', |
| 17 | 'Reflector' => 'Reflection', | 19 | 'Reflector' => 'Reflection', |
| 18 | 'Soap' => 'SOAP', | 20 | 'Soap' => 'SOAP', |
| 19 | 'SplFile' => 'SPL/File', | 21 | 'SplFile' => 'SPL/File', |
| @@ -24,6 +26,7 @@ module Docs · 4 unmodified lines |
| 24 | 'streamWrapper' => 'Stream', | 26 | 'streamWrapper' => 'Stream', |
| 25 | 'Thread' => 'pthreads', | 27 | 'Thread' => 'pthreads', |
| 26 | 'tidy' => 'Tidy', | 28 | 'tidy' => 'Tidy', |
| | 29 | 'Weak' => 'Weakref', |
| 27 | 'Worker' => 'pthreads', | 30 | 'Worker' => 'pthreads', |
| 28 | 'XsltProcessor' => 'XSLT', | 31 | 'XsltProcessor' => 'XSLT', |
| 29 | 'Yar' => 'Yar', | 32 | 'Yar' => 'Yar', |
| @@ -48,8 +51,10 @@ module Docs · 18 unmodified lines |
| 48 | end | 51 | end |
| 49 | | 52 | |
| 50 | REPLACE_TYPES = { | 53 | REPLACE_TYPES = { |
| | 54 | 'APCu' => 'APC', |
| 51 | 'Error' => 'Errors', | 55 | 'Error' => 'Errors', |
| 52 | 'Exceptions' => 'SPL/Exceptions', | 56 | 'Exceptions' => 'SPL/Exceptions', |
| | 57 | 'Exif' => 'Image/Exif', |
| 53 | 'finfo' => 'File System', | 58 | 'finfo' => 'File System', |
| 54 | 'GD and Image' => 'Image', | 59 | 'GD and Image' => 'Image', |
| 55 | 'Gmagick' => 'Image/GraphicsMagick', | 60 | 'Gmagick' => 'Image/GraphicsMagick', |
| @@ -74,7 +79,7 @@ module Docs · 18 unmodified lines |
| 74 | 'Database' => ['DBA', 'ODBC', 'PDO'], | 79 | 'Database' => ['DBA', 'ODBC', 'PDO'], |
| 75 | 'Date and Time' => ['Calendar', 'Date/Time'], | 80 | 'Date and Time' => ['Calendar', 'Date/Time'], |
| 76 | 'Errors' => ['Error Handling', 'Predefined Exceptions'], | 81 | 'Errors' => ['Error Handling', 'Predefined Exceptions'], |
| 77 | 'File System' => ['Directory', 'Fileinfo', 'Filesystem', 'Inotify'], | 82 | 'File System' => ['Directory', 'Fileinfo', 'Filesystem', 'Inotify', 'Proctitle'], |
| 78 | 'HTML' => ['DOM', 'Tidy'], | 83 | 'HTML' => ['DOM', 'Tidy'], |
| 79 | 'Language' => ['Control Structures', 'Misc.', 'PHP Options/Info', 'Predefined Variables'], | 84 | 'Language' => ['Control Structures', 'Misc.', 'PHP Options/Info', 'Predefined Variables'], |
| 80 | 'Mail' => ['Mail', 'Mailparse'], | 85 | 'Mail' => ['Mail', 'Mailparse'], |
| @@ -116,6 +121,47 @@ module Docs · 35 unmodified lines |
| 116 | REPLACE_TYPES[type] || type | 121 | REPLACE_TYPES[type] || type |
| 117 | end | 122 | end |
| 118 | | 123 | |
| | 124 | ALIASES = { |
| | 125 | 'language.oop5.traits' => ['trait'], |
| | 126 | 'language.operators.type' => ['instanceof'], |
| | 127 | 'functions.user-defined' => ['function'], |
| | 128 | 'language.oop5.visibility' => ['public', 'private', 'protected'], |
| | 129 | 'language.references.whatdo' => ['=&'], |
| | 130 | 'language.oop5.static' => ['static'], |
| | 131 | 'language.oop5.interfaces' => ['interface', 'implements'], |
| | 132 | 'language.oop5.inheritance' => ['extends'], |
| | 133 | 'language.oop5.cloning' => ['clone', '__clone()'], |
| | 134 | 'language.operators.logical' => ['and', 'or', 'xor'], |
| | 135 | 'language.operators.increment' => ['++', '--'], |
| | 136 | 'language.generators.syntax' => ['yield'], |
| | 137 | 'language.oop5.final' => ['final'], |
| | 138 | 'language.exceptions' => ['try', 'catch', 'finally'], |
| | 139 | 'language.oop5.decon' => ['__construct()', '__destruct()'], |
| | 140 | 'language.operators.comparison' => ['==', '===', '!=', '<>', '!==', '<=>'], |
| | 141 | 'language.oop5.abstract' => ['abstract'], |
| | 142 | 'language.operators.bitwise' => ['&', '|', '^', '~', '<<', '>>'] |
| | 143 | } |
| | 144 | |
| | 145 | def additional_entries |
| | 146 | if aliases = ALIASES[slug] |
| | 147 | aliases.map { |a| [a] } |
| | 148 | elsif slug == 'language.constants.predefined' |
| | 149 | css('table tr[id]').map do |node| |
| | 150 | [node.at_css('code').content, node['id']] |
| | 151 | end |
| | 152 | elsif slug == 'language.oop5.magic' |
| | 153 | css('h3 a').map do |node| |
| | 154 | [node.content, node['href'][/#(.+)/, 1]] |
| | 155 | end |
| | 156 | elsif slug == 'language.oop5.overloading' |
| | 157 | css('.methodsynopsis[id]').map do |node| |
| | 158 | [node.at_css('.methodname').content + '()', node['id']] |
| | 159 | end |
| | 160 | else |
| | 161 | [] |
| | 162 | end |
| | 163 | end |
| | 164 | |
| 119 | def include_default_entry? | 165 | def include_default_entry? |
| 120 | !initial_page? && doc.at_css('.reference', '.refentry', '.sect1', '.simpara', '.para') | 166 | !initial_page? && doc.at_css('.reference', '.refentry', '.sect1', '.simpara', '.para') |
| 121 | end | 167 | end |