diff --git a/.gitignore b/.gitignore index dff608834..b14e95737 100755 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,8 @@ generator/* util/elasticsearch/ util/cache/ -# Sami docs generator -/sami.phar +# Doctum docs generator +/doctum.phar # PHPUnit /phpunit.xml diff --git a/util/docsConfig.php b/util/docsConfig.php index 3cde65e52..8d4aaa9e7 100644 --- a/util/docsConfig.php +++ b/util/docsConfig.php @@ -6,7 +6,7 @@ * @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co) * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 * @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1 - * + * * Licensed to Elasticsearch B.V under one or more agreements. * Elasticsearch B.V licenses this file to you under the Apache 2.0 License or * the GNU Lesser General Public License, Version 2.1, at your option. @@ -16,18 +16,18 @@ declare(strict_types = 1); -use Sami\Sami; +use Doctum\Doctum; use Symfony\Component\Finder\Finder; $iterator = Finder::create() ->files() ->name('*Namespace.php') - ->name("Client.php") - ->name("ClientBuilder.php") - ->notName("AbstractNamespace.php") + ->name('Client.php') + ->name('ClientBuilder.php') + ->notName('AbstractNamespace.php') ->in(__DIR__.'/../src/'); -return new Sami($iterator, [ +return new Doctum($iterator, [ 'theme' => 'asciidoc', 'template_dirs' => [__DIR__.'/docstheme/'], 'title' => 'Elasticsearch-php', diff --git a/util/generate_docs.sh b/util/generate_docs.sh index 88092120b..4b746e288 100755 --- a/util/generate_docs.sh +++ b/util/generate_docs.sh @@ -1,4 +1,22 @@ #!/usr/bin/env bash -curl -O http://get.sensiolabs.org/sami.phar -php sami.phar update --force -v util/docsConfig.php +set -e + +# Clean the files just in case +rm -f doctum.phar +rm -f doctum.phar.sha256 + +# Download the latest (5.1.x) release +curl -O https://doctum.long-term.support/releases/5.1/doctum.phar +curl -O https://doctum.long-term.support/releases/5.1/doctum.phar.sha256 + +sha256sum --strict --check doctum.phar.sha256 +rm -f doctum.phar.sha256 +# You can fetch the latest (5.1.x) version code here: +# https://doctum.long-term.support/releases/5.1/VERSION + +# Show the version to inform users of the script +php doctum.phar --version + +# Only exit if the process fails, not if parse errors are found +php doctum.phar update --force --ignore-parse-errors -v util/docsConfig.php