3 * Scrape all config options from the CKEditor documentation site.
5 $content = file_get_contents('http://docs.ckeditor.com/?print=/api/CKEDITOR.config');
6 $matches = $output = [];
7 preg_match_all("#name expandable'>([^<]+)</a>\s?:\s?(.*)<span.*'short'>([\s\S]*?)</div>#", $content, $matches);
8 foreach ($matches[1] as $i => $name) {
11 'type' => strip_tags($matches[2][$i]),
12 'description' => str_replace(["\n", '. ...'], [' ', '.'], $matches[3][$i]),
16 $location = str_replace('tools/bin/scripts', '', __DIR__
);
17 file_put_contents($location . '/js/wysiwyg/ck-options.json', json_encode($output, JSON_PRETTY_PRINT
));
19 print "\nTotal: " . count($output) . "\n";