@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * Traitement synchrone des URL brutes http:// transformée en {lien web} ou {article} |
28 | 28 | */ |
29 | 29 | |
30 | -include __DIR__ . '/../myBootstrap.php'; |
|
30 | +include __DIR__.'/../myBootstrap.php'; |
|
31 | 31 | |
32 | 32 | // --page="Skateboard" --stats=redis --stats=sqlite --debug --verbose |
33 | 33 | echo "OPTIONS: --debug --verbose --stats=redis --stats=sqlite --page=\"Skateboard\" --offset=1000 \n"; |
@@ -59,18 +59,18 @@ discard block |
||
59 | 59 | $torClient = ServiceFactory::getHttpClient(true); |
60 | 60 | |
61 | 61 | |
62 | -$list = PageList::FromFile(__DIR__ . '/../../../resources/titles/titles100kan'); |
|
62 | +$list = PageList::FromFile(__DIR__.'/../../../resources/titles/titles100kan'); |
|
63 | 63 | |
64 | 64 | // filter titles already in edited.txt |
65 | 65 | $titles = $list->getPageTitles(); |
66 | -echo '> before filtering: ' . count($titles) . " articles.\n"; |
|
66 | +echo '> before filtering: '.count($titles)." articles.\n"; |
|
67 | 67 | unset($list); |
68 | -$edited = file(__DIR__ . '/../resources/article_externRef_edited.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|
68 | +$edited = file(__DIR__.'/../resources/article_externRef_edited.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
|
69 | 69 | $titles = array_diff($titles, $edited); |
70 | 70 | $list = new PageList($titles); |
71 | 71 | |
72 | 72 | |
73 | -echo ">" . $list->count() . " dans liste\n"; |
|
73 | +echo ">".$list->count()." dans liste\n"; |
|
74 | 74 | if ($list->count() === 0) { |
75 | 75 | echo "END of process: EMPTY ARTICLE LIST\n"; |
76 | 76 | sleep(120); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | // if carriage return </ref>\n<ref… outside that template, the ref-link appears on a new line => \n deleted |
56 | 56 | // regex option /u for unicode char catch "à<ref>" |
57 | 57 | $wikiText = preg_replace('#</ref>[\n\r\s]*<ref#u', '</ref>{{,}}<ref', $wikiText); |
58 | - $wikiText = preg_replace('#(<ref name=[^\/\>\r\n]+/>)[\n\r\s]*<ref#u', "$1" . '{{,}}<ref', $wikiText); |
|
58 | + $wikiText = preg_replace('#(<ref name=[^\/\>\r\n]+/>)[\n\r\s]*<ref#u', "$1".'{{,}}<ref', $wikiText); |
|
59 | 59 | |
60 | 60 | // {{Sfn|...}}{{Sfn|...}} |
61 | 61 | $wikiText = preg_replace('#(\{\{sfn[\s\|\n\r][^\{\}]+}})\s*(\{\{sfn[\s\|\n\r])#ui', '$1{{,}}$2', $wikiText); |