2013-10-24 20:25:52 +02:00
|
|
|
module Docs
|
|
|
|
class Php < FileScraper
|
2016-02-07 18:56:01 +01:00
|
|
|
include FixInternalUrlsBehavior
|
|
|
|
|
2013-10-24 20:25:52 +02:00
|
|
|
self.name = 'PHP'
|
|
|
|
self.type = 'php'
|
2018-05-14 02:59:36 +02:00
|
|
|
self.release = '7.2.5'
|
2016-02-07 18:56:01 +01:00
|
|
|
self.base_url = 'https://secure.php.net/manual/en/'
|
2013-12-06 23:17:55 +01:00
|
|
|
self.root_path = 'index.html'
|
2013-12-11 19:53:04 +01:00
|
|
|
self.initial_paths = %w(
|
2013-12-06 23:17:55 +01:00
|
|
|
funcref.html
|
2016-02-07 18:56:01 +01:00
|
|
|
langref.html
|
2013-12-06 23:17:55 +01:00
|
|
|
refs.database.html
|
|
|
|
set.mysqlinfo.html
|
|
|
|
language.control-structures.html
|
2016-02-07 18:56:01 +01:00
|
|
|
reference.pcre.pattern.syntax.html
|
2013-12-06 23:17:55 +01:00
|
|
|
reserved.exceptions.html
|
|
|
|
reserved.interfaces.html
|
|
|
|
reserved.variables.html)
|
2013-10-24 20:25:52 +02:00
|
|
|
|
2016-02-07 18:56:01 +01:00
|
|
|
self.links = {
|
|
|
|
home: 'https://secure.php.net/',
|
2017-11-26 23:39:40 +01:00
|
|
|
code: 'https://git.php.net/?p=php-src.git;a=summary'
|
2016-02-07 18:56:01 +01:00
|
|
|
}
|
|
|
|
|
2013-12-11 19:53:04 +01:00
|
|
|
# Downloaded from php.net/download-docs.php
|
|
|
|
self.dir = '/Users/Thibaut/DevDocs/Docs/PHP'
|
|
|
|
|
|
|
|
html_filters.push 'php/internal_urls', 'php/entries', 'php/clean_html', 'title'
|
|
|
|
text_filters.push 'php/fix_urls'
|
2013-10-24 20:25:52 +02:00
|
|
|
|
2013-12-11 19:53:04 +01:00
|
|
|
options[:title] = false
|
|
|
|
options[:root_title] = 'PHP: Hypertext Preprocessor'
|
|
|
|
options[:skip_links] = ->(filter) { !filter.initial_page? }
|
2013-10-24 20:25:52 +02:00
|
|
|
|
2013-12-06 23:17:55 +01:00
|
|
|
options[:only_patterns] = [
|
2016-02-07 18:56:01 +01:00
|
|
|
/\Alanguage\./,
|
2013-12-06 23:17:55 +01:00
|
|
|
/\Aclass\./,
|
2016-05-29 16:44:08 +02:00
|
|
|
/\Afunctions?\./,
|
2013-12-06 23:17:55 +01:00
|
|
|
/\Acontrol-structures/,
|
2016-02-07 18:56:01 +01:00
|
|
|
/\Aregexp\./,
|
2013-12-06 23:17:55 +01:00
|
|
|
/\Areserved\.exceptions/,
|
|
|
|
/\Areserved\.interfaces/,
|
|
|
|
/\Areserved\.variables/]
|
2013-10-24 20:25:52 +02:00
|
|
|
|
2016-12-04 19:34:32 +01:00
|
|
|
BOOKS = %w(apache apc apcu array bc bzip2 calendar csprng classobj ctype curl
|
|
|
|
datetime dba dir dom ds eio errorfunc ev event exec exif fileinfo filesystem filter
|
2017-11-26 23:39:40 +01:00
|
|
|
ftp funchand gearman geoip gettext gmagick gmp hash ibase iconv iisfunc image
|
2017-03-25 17:46:56 +01:00
|
|
|
imagick imap info inotify intl json judy ldap libevent libxml lua mail mailparse
|
2016-02-07 18:56:01 +01:00
|
|
|
math mbstring mcrypt memcached misc mysqli network oauth openssl
|
2016-12-04 19:34:32 +01:00
|
|
|
outcontrol password pcntl pcre pdo pgsql phar posix proctitle pthreads quickhash regex runkit
|
|
|
|
reflection sca session sem session-pgsql shmop simplexml soap sockets solr sphinx spl
|
2017-03-25 17:46:56 +01:00
|
|
|
spl-types sqlite3 sqlsrv ssh2 stats stream strings sync taint tidy tokenizer uodbc url
|
|
|
|
v8js var varnish weakref xml xmlreader xmlrpc xmlwriter xsl yaf yar yaml zip zlib)
|
2013-10-24 20:25:52 +02:00
|
|
|
|
2013-12-11 19:53:04 +01:00
|
|
|
options[:only] = BOOKS.map { |s| "book.#{s}.html" }
|
2013-10-24 20:25:52 +02:00
|
|
|
|
2013-12-06 23:17:55 +01:00
|
|
|
options[:skip] = %w(
|
|
|
|
control-structures.intro.html
|
|
|
|
control-structures.alternative-syntax.html
|
2016-02-07 18:56:01 +01:00
|
|
|
function.mssql-select-db.html
|
|
|
|
pthreads.modifiers.html)
|
2013-10-24 20:25:52 +02:00
|
|
|
|
2018-05-14 02:59:36 +02:00
|
|
|
options[:skip_patterns] = [/mysqlnd/, /xdevapi/i]
|
2013-10-24 20:25:52 +02:00
|
|
|
|
2013-11-16 17:00:08 +01:00
|
|
|
options[:attribution] = <<-HTML
|
2018-02-25 20:24:57 +01:00
|
|
|
© 1997–2018 The PHP Documentation Group<br>
|
2013-10-24 20:25:52 +02:00
|
|
|
Licensed under the Creative Commons Attribution License v3.0 or later.
|
|
|
|
HTML
|
|
|
|
end
|
|
|
|
end
|