From 0b7aad2174fc5535f4a56eafc10350640b4f70f0 Mon Sep 17 00:00:00 2001 From: Kharhamel Date: Mon, 24 Feb 2020 14:52:50 +0100 Subject: [PATCH 1/2] now use git instead of svn to get the doc --- .github/workflows/continuous-integration.yml | 6 +++--- CONTRIBUTING.md | 16 +++++++--------- generator/doc/update.sh | 11 +++++++++++ 3 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 generator/doc/update.sh diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 9cd0f7f7..a45096b3 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -15,16 +15,16 @@ jobs: - name: "Checkout" uses: "actions/checkout@v2.0.0" - - name: "Cache PHP documentation checked out with svn" + - name: "Cache PHP documentation checked out with git" id: cache-svn uses: "actions/cache@v1.0.3" with: path: "generator/doc/doc-en" key: "php-documentation" - - name: "Check out PHP documentation with svn" + - name: "Check out PHP documentation with git" if: steps.cache-svn.outputs.cache-hit != 'true' - run: svn co https://svn.php.net/repository/phpdoc/modules/doc-en doc-en + run: sh update.sh working-directory: "generator/doc" continuous-integration: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 42f94240..1f967166 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,21 +4,19 @@ Safe-PHP code is generated automatically from the PHP doc. ## How to install Safe-PHP development environment -The first step is to download the PHP documentation project locally. -You will need Subversion (svn) installed on your computer. +The first step is to download the PHP documentation project locally, using git. ```bash $ cd generator/doc -$ svn co https://svn.php.net/repository/phpdoc/modules/doc-en doc-en -$ cd ../.. +$ sh update.sh ``` -At any point, if you want to update the documentation to the latest version, you can use: +The script can be used to both install the doc and to update it. +All it does is pull from theses mirrors: -```bash -$ cd generator/doc/doc-en -$ svn update -``` +https://github.com/salathe/phpdoc-base + +https://github.com/php/doc-en To use the generator, you need to make sure you installed all the needed dependencies: diff --git a/generator/doc/update.sh b/generator/doc/update.sh new file mode 100644 index 00000000..d3c6006a --- /dev/null +++ b/generator/doc/update.sh @@ -0,0 +1,11 @@ +if [ ! -d "doc-en" ]; then + mkdir doc-en + cd doc-en + git clone https://github.com/salathe/phpdoc-base doc-base + git clone https://github.com/php/doc-en en + else + cd doc-en/en + git pull + cd ../doc-base + git pull + fi \ No newline at end of file From d4c4935ceff8be45e633020d161dd18d9efa641c Mon Sep 17 00:00:00 2001 From: Kharhamel Date: Mon, 24 Feb 2020 14:59:00 +0100 Subject: [PATCH 2/2] removed the php doc cache --- .github/workflows/continuous-integration.yml | 29 ++------------------ 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index a45096b3..20a90567 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -8,29 +8,9 @@ on: jobs: - init-php-doc: - name: "Init the php documentation cache" - runs-on: "ubuntu-latest" - steps: - - name: "Checkout" - uses: "actions/checkout@v2.0.0" - - - name: "Cache PHP documentation checked out with git" - id: cache-svn - uses: "actions/cache@v1.0.3" - with: - path: "generator/doc/doc-en" - key: "php-documentation" - - - name: "Check out PHP documentation with git" - if: steps.cache-svn.outputs.cache-hit != 'true' - run: sh update.sh - working-directory: "generator/doc" - continuous-integration: name: "Continuous Integration" - needs: init-php-doc runs-on: "ubuntu-latest" strategy: @@ -52,12 +32,9 @@ jobs: coverage: "pcov" php-version: "${{ matrix.php-version }}" - - name: "Cache PHP documentation checked out with svn" - id: cache-svn - uses: "actions/cache@v1.0.3" - with: - path: "generator/doc/doc-en" - key: "php-documentation" + - name: "Check out PHP documentation with git" + run: sh update.sh + working-directory: "generator/doc" - name: "Cache dependencies installed with composer" uses: "actions/cache@v1.0.3"