Merged
Conversation
kbsali
approved these changes
Jun 7, 2021
Collaborator
Author
|
In case someone should ask for an installation possibility by hand (without Composer), please follow these instruction: It can be hard to follow the instruction, especially when there are many dependencies with sub-dependencies. (This work is usually done for you by Composer.) So I have created a script install-redmine-api.sh#!/bin/sh
>&2 echo 'Download composer.phar file to local directory'
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
if [ "$RESULT" != 0 ]
then
>&2 echo 'ERROR: Could not install composer.phar'
rm composer.phar
exit $RESULT
fi
INSTALL_VERSION=""
if [[ $1 != "" ]]; then
INSTALL_VERSION=":"$1;
fi
>&2 echo 'Download PHP library kbsali/php-redmine-api and create autoload.php'
php composer.phar require kbsali/redmine-api$INSTALL_VERSION --quiet
RESULT=$?
if [ "$RESULT" != 0 ]
then
>&2 echo ''
>&2 echo 'ERROR: Could not download kbsali/php-redmine-api'
rm composer.json
rm composer.phar
exit $RESULT
fi
>&2 echo 'Remove composer.phar from local directory and other unused files'
rm composer.json
rm composer.lock
rm composer.phar
>&2 echo ''
>&2 echo 'Alright! You can now start using kbsali/php-redmine-api in your PHP script:'
>&2 echo 'require_once("vendor/autoload.php");'UsageDownload the latest version: $ ./install-redmine-api.shor download a specific version: $ ./install-redmine-api.sh v1.8.1Output$ ./install-redmine-api.sh
Download composer.phar file to local directory
Download PHP library kbsali/php-redmine-api and create autoload.php
Remove composer.phar from local directory and other unused files
Alright! You can now start using kbsali/php-redmine-api in your PHP script:
require_once("vendor/autoload.php"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
src/autoload.phpwas created in #96 to allow using the library without Composer.Since v1.7.0 we have dependencies to
psr/http-clientandpsr/http-factoryso thesrc/autoload.phpstops working without manual installing this dependencies. The new recommended way to use this library without Composer is to use a service like php-download.com. Therefore,src/autoload.,phpis no longer needed.This PR removes the
src/autoload.php.