File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ if (php_sapi_name () !== 'cli ' ) {
4+ die ('This script must be run from the command line. ' );
5+ }
6+
7+ $ required_files = [
8+ 'include/pregen-events.inc ' ,
9+ 'include/pregen-news.inc ' ,
10+ 'include/pregen-confs.inc ' ,
11+ 'feed.atom ' ,
12+ 'news.rss ' ,
13+ 'conferences/news.rss ' ,
14+ 'backend/win-releases.json ' ,
15+ 'backend/win-qa-releases.json ' ,
16+ ];
17+
18+ fwrite (STDOUT , "Copying data from production server into local directories: \n" );
19+ fwrite (STDOUT , "Do not commit these files! \n" );
20+
21+ foreach ($ required_files as $ fileName ) {
22+ $ url = 'https://www.php.net/ ' . $ fileName ;
23+ $ source = @file_get_contents ($ url );
24+ if ($ source === false ) {
25+ fwrite (STDERR , "Unable to read " . $ url . "\n" );
26+ exit (1 );
27+ }
28+
29+ $ saveTo = __DIR__ . '/../ ' . $ fileName ;
30+ $ success = file_put_contents ($ saveTo , $ source );
31+ if ($ success === false ) {
32+ fwrite (STDERR , "Unable to write to " . $ saveTo . "\n" );
33+ exit (1 );
34+ }
35+
36+ fwrite (STDOUT , "Copied " . $ url . " to " . $ saveTo . "\n" );
37+ }
You can’t perform that action at this time.
0 commit comments