From ec4fc804bb0eb6b80acf4cc56f1e80a96e27f6ad Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 20 Feb 2018 20:47:25 +0000 Subject: [PATCH] Update documentation, update travis ci build script --- README.md | 5 +++-- docs/index.md | 5 +++-- src/danog/MadelineProto/MTProto.php | 2 +- tests/makephar.sh | 26 ++++++++++++++------------ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index bc521439b..5ab527187 100644 --- a/README.md +++ b/README.md @@ -367,11 +367,12 @@ Here are the default values for the settings arrays and explanations for every s 'timeout' => 2, // timeout for sockets 'proxy' => '\Socket', // The proxy class to use 'proxy_extra' => [], // Extra parameters to pass to the proxy class using setExtra + 'pfs' => true, // Should we use PFS for this socket? ], ], 'app_info' => [ // obtained in https://my.telegram.org - //'api_id' => you should put an API id in the settings array you provide - //'api_hash' => you should put an API hash in the settings array you provide + 'api_id' => you should put an API id in the settings array you provide + 'api_hash' => you should put an API hash in the settings array you provide 'device_model' => $device_model, 'system_version' => $system_version, 'app_version' => 'Unicorn', diff --git a/docs/index.md b/docs/index.md index 755209fa8..6ed8948de 100644 --- a/docs/index.md +++ b/docs/index.md @@ -371,11 +371,12 @@ Here are the default values for the settings arrays and explanations for every s 'timeout' => 2, // timeout for sockets 'proxy' => '\Socket', // The proxy class to use 'proxy_extra' => [], // Extra parameters to pass to the proxy class using setExtra + 'pfs' => true, // Should we use PFS for this socket? ], ], 'app_info' => [ // obtained in https://my.telegram.org - //'api_id' => you should put an API id in the settings array you provide - //'api_hash' => you should put an API hash in the settings array you provide + 'api_id' => you should put an API id in the settings array you provide + 'api_hash' => you should put an API hash in the settings array you provide 'device_model' => $device_model, 'system_version' => $system_version, 'app_version' => 'Unicorn', diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index 5eb513423..2e54cdb52 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -489,7 +489,7 @@ class MTProto 'timeout' => 2, // timeout for sockets 'proxy' => '\Socket', // The proxy class to use 'proxy_extra' => [], // Extra parameters to pass to the proxy class using setExtra - 'pfs' => true, + 'pfs' => true, // Should we use PFS for this socket? ], ], 'app_info' => [ // obtained in https://my.telegram.org diff --git a/tests/makephar.sh b/tests/makephar.sh index bf67ba309..466758f9f 100755 --- a/tests/makephar.sh +++ b/tests/makephar.sh @@ -1,11 +1,13 @@ #!/bin/sh -e -composer global require spatie/7to5 +echo "$TRAVIS_COMMIT_MESSAGE" | grep -q phar && { -rm -rf phar7 phar5 + composer global require spatie/7to5 -mkdir phar7 -cd phar7 -echo '{ + rm -rf phar7 phar5 + + mkdir phar7 + cd phar7 + echo '{ "name": "danog/madelineprototests", "minimum-stability":"dev", "require": { @@ -24,21 +26,21 @@ echo '{ } ] }' > composer.json -composer update -cd .. + composer update + cd .. -$HOME/.composer/vendor/bin/php7to5 convert --copy-all phar7 phar5 - -php makephar.php phar5 madeline.phar $TRAVIS_COMMIT + $HOME/.composer/vendor/bin/php7to5 convert --copy-all phar7 phar5 + php makephar.php phar5 madeline.phar $TRAVIS_COMMIT +} [ -d JSON.sh ] || git clone https://github.com/dominictarr/JSON.sh for chat_id in $destinations;do - ID=$(curl -s https://api.telegram.org/bot$token/sendMessage -F text=" Recent Commits to MadelineProto:master + ID=$(curl -s https://api.telegram.org/bot$token/sendMessage -F disable_web_page_preview=1 -F text=" Recent Commits to MadelineProto:master $TRAVIS_COMMIT_MESSAGE $TRAVIS_COMMIT_MESSAGE" -F parse_mode="HTML" -F chat_id=$chat_id | JSON.sh/JSON.sh -s | egrep '\["result","message_id"\]' | cut -f 2 | cut -d '"' -f 2) - curl -s https://api.telegram.org/bot$token/sendDocument -F caption="md5: $(md5sum madeline.phar | sed 's/\s.*//g') + echo "$TRAVIS_COMMIT_MESSAGE" | grep -q phar && curl -s https://api.telegram.org/bot$token/sendDocument -F caption="md5: $(md5sum madeline.phar | sed 's/\s.*//g') commit: $TRAVIS_COMMIT" -F chat_id=$chat_id -F document=@madeline.phar -F reply_to_message_id=$ID done