99
1010\exec ('git clone https://github.com/php-censor/php-censor.git "docs-raw" ' );
1111
12- \mkdir ('docs/plugins ' , 0777 , true );
13- \mkdir ('docs/sources ' , 0777 , true );
14- \mkdir ('docs/workers ' , 0777 , true );
12+ \mkdir ('docs/plugins ' , 0755 , true );
13+ \mkdir ('docs/sources ' , 0755 , true );
14+ \mkdir ('docs/workers ' , 0755 , true );
1515
1616\exec ('cp --recursive --no-target-directory "docs-raw/docs/images" "assets/img/docs" ' );
1717\exec ('cp --recursive --no-target-directory "docs-raw/docs/screenshots" "assets/img/docs/screenshots" ' );
@@ -47,9 +47,15 @@ function parse(array $config, &$result): void {
4747\parse ($ config , $ result );
4848
4949foreach ($ result as $ path => $ title ) {
50- $ newPath = \substr ($ path , \strlen ('docs/ ' ));
50+ $ newPath = 'docs-raw/docs/en/ ' . \substr ($ path , \strlen ('docs/ ' ));
51+ if ('docs/upgrade_from_1_to_2 ' === $ path ) {
52+ $ newPath = 'docs-raw/docs/UPGRADE_2.0 ' ;
53+ }
54+ if ('docs/changelog_2_1 ' === $ path ) {
55+ $ newPath = 'docs-raw/CHANGELOG ' ;
56+ }
5157
52- $ content = \file_get_contents (' docs-raw/docs/en/ ' . $ newPath . '.md ' );
58+ $ content = \file_get_contents ($ newPath . '.md ' );
5359 $ content = \str_replace (['../screenshots/ ' , '../images/ ' ], ['/assets/img/docs/screenshots/ ' , '/assets/img/docs/ ' ], $ content );
5460
5561 $ prefix = "---
@@ -60,7 +66,7 @@ function parse(array $config, &$result): void {
6066---
6167
6268 " ;
63- \file_put_contents (' docs/ ' . $ newPath . '.md ' , \sprintf ('%s%s ' , $ prefix , $ content ));
69+ \file_put_contents ($ path . '.md ' , \sprintf ('%s%s ' , $ prefix , $ content ));
6470}
6571
6672\exec ('rm --force --recursive --verbose "docs-raw" ' );
0 commit comments