MadelineProto/tests/makephar.sh
Daniil Gentili df24fa4611
Merge alpha into master (async, huge bugfixes and more) (#546)
* Implement async and lots of bugfixes

* Implement more async

* Implement async, implement bugfixes for the connection module, for the datacenter module, huge bugfixes, huge perfomance improvements, media DCs for https, advanced selecting, custom var_dump, totally rewritten IOLoop and response mechanism, promises, improvements to the TL parser, custom mb_substr

* Apply fixes from StyleCI

* Bugfixes

* Apply fixes from StyleCI

* Bugfixes, implement combined promises

* Apply fixes from StyleCI

* Support passing method arguments as callable

* Starting to write async upload logic

* Apply fixes from StyleCI

* Start implementing async file upload

* Apply fixes from StyleCI

* bugfix

* Apply fixes from StyleCI

* Start rewriting connection module

* Add PHP file docblocks for all classes

* Start working on new async stream API

* Finish writing stream API

* More stream API fixes

* Apply fixes from StyleCI

* Rewrite DataCenter and Connection modules

* Clean up stream API documentation

* Fixes

* Apply fixes from StyleCI

* Add referenced parameter to get length of buffer to read in getReadBuffer API

* Moved all MessageHandler code in the Connection module, added a PHP version warning in the phar

* Start fixing reads

* Fix all protocol stream wrappers

* Apply fixes from StyleCI

* Implement disconnection, and remove end function

* Working async RPC

* Implement async file upload

* Bugfix

* Method recall bugfixes

* Bugfixes

* Trait bugfixes

* Fix FIFO buffer

* Bugfixes and speedtests

* Async logging

* Implement websocket streams

* Implement loop API, signal API, clean closing and start changing layer

* Small magna, websocket and HTTP fixes

* Clean up loop API

* Improved stack traces, 2FA and async

* Login fixes

* Added instructions for manual verification

* Small fixes

* More app info improvements

* More app info improvements

* TL and 2FA fixes

* Update to layer 89

* More bugfixes

* Implement broken media reporting

* Remove debug comments

* PHP 7.2 backwards compatibility

* Bugfixes

* Async key generation

* Some simplifications

* Transport fixes

* Cleanup

* async API

* Performance fixes

* Fixes to async API

* Bugfixes

* Implement one-time async loop

* Authorization and logging fixes

* Update to layer 91

* 7to5 fix

* Null coalesce conversion

* Implement socks5 proxy

* Implement HTTP proxy

* Fixes to HTTP proxy

* MTProxy and socks5 fixes

* Disable PHP 5 conversion

* Proxies have higher priority

* Avoid error handling in vendor

* Override composer dependencies

* Fix travis build

* Final composer fixes

* Proxy logic fixes

* Fix get_updates update handling

* Do not use parallel file driver if not supported

* Refactor loader and implement HTTP fixes

* Suppress errors in loader

* HTTP and authorization fixes

* HTTP fixes

* Improved peer management

* Use HTTP protocol on altervista

* Small bugfixes

* Minor fixes

* Docufix

* Docufix

* Legacy fixes

* Fix message queue

* Avoid updating if using MTProxy

* Improve logs and examples

* Trim final newlines while converting parse mode

* Reimplement noResponse flag

* Async combined event handler and APIFactory fixes

* Actually return config

* Case-insensitive methods

* Bugfix

* Apply fixes from StyleCI (#545)

* MTProxy fixes

* PHP 5 warning

* Improved PHP 5 warning

* Use <br> along with newlines in web logs

* Update docs
2018-12-26 20:51:14 +01:00

71 lines
2.4 KiB
Bash
Executable File

#!/bin/bash -e
#composer global require spatie/7to5 dev-master#7b3e0f4254aadd81cf1a7ef2ddad68d5fcdadcc1
[ -f $HOME/.composer/vendor/bin/php7to5 ] && php7to5=$HOME/.composer/vendor/bin/php7to5
[ -f $HOME/.config/composer/vendor/bin/php7to5 ] && php7to5=$HOME/.config/composer/vendor/bin/php7to5
rm -rf phar7 phar5 MadelineProtoPhar
mkdir phar7
cd phar7
echo '{
"name": "danog/madelineprototests",
"minimum-stability":"dev",
"require": {
"danog/madelineproto": "dev-'$TRAVIS_BRANCH'#'$TRAVIS_COMMIT'",
"amphp/dns": "dev-master#861cc857b1ba6e02e8a7439c30403682785fce96 as 0.9.9",
"amphp/file": "dev-master#5a69fca406ac5fd220de0aa68c887bc8046eb93c as 0.3.3",
"amphp/uri": "dev-master#f3195b163275383909ded7770a11d8eb865cbc86 as 0.1.3"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/danog/phpseclib"
}
],
"authors": [
{
"name": "Daniil Gentili",
"email": "daniil@daniil.it"
}
]
}' > composer.json
composer update
cd ..
cp -a phar7 phar5
#$php7to5 convert --copy-all phar7 phar5 >/dev/null
find phar5 -type f -exec sed 's/\w* \.\.\./.../' -i {} +
#sed 's/^Loop::set.*;//g' -i phar5/vendor/amphp/amp/lib/Loop.php
#echo 'Loop::set((new DriverFactory())->create());' >> phar5/vendor/amphp/amp/lib/Loop.php
[ "$TRAVIS_BRANCH" != "master" ] && branch="-$TRAVIS_BRANCH" || branch=""
php makephar.php phar5 "madeline$branch.phar" $TRAVIS_COMMIT
eval "$(ssh-agent -s)"
echo -e "$private_key" > madeline_rsa
chmod 600 madeline_rsa
ssh-add madeline_rsa
git clone git@github.com:danog/MadelineProtoPhar
cd MadelineProtoPhar
cp "../madeline$branch.phar" .
cp ../phar.php ../mtproxyd .
echo -n $TRAVIS_COMMIT > release$branch
git add -A
git commit -am "Release $TRAVIS_BRANCH - $TRAVIS_COMMIT_MESSAGE"
git push origin master
cd ..
echo "$TRAVIS_COMMIT_MESSAGE" | grep "Apply fixes from StyleCI" && exit
[ -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 disable_web_page_preview=1 -F text=" <b>Recent Commits to MadelineProto:$TRAVIS_BRANCH</b>
<a href=\"https://github.com/danog/MadelineProto/commit/$TRAVIS_COMMIT\">$TRAVIS_COMMIT_MESSAGE</a>
$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)
done