Commit 5d3a1209 authored by LONGMAN's avatar LONGMAN

All examples moved to examples folder. Added .editoconfig. Fixed php version...

All examples moved to examples folder. Added .editoconfig. Fixed php version in composer and travis.yaml
parent 4286cad3
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
language: php language: php
php: php:
- 5.4
- 5.5 - 5.5
- 5.6 - 5.6
- 7.0 - 7.0
...@@ -13,11 +12,11 @@ before_install: ...@@ -13,11 +12,11 @@ before_install:
- composer self-update - composer self-update
install: install:
- travis_retry composer install --no-interaction --prefer-source - travis_retry composer install --no-interaction
script: script:
- phpunit - vendor/bin/phpunit
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then vendor/bin/phpcs --report=full --extensions=php -p --standard=build/phpcs .; fi" - sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then vendor/bin/phpcs --report=full --extensions=php -np --standard=build/phpcs .; fi"
matrix: matrix:
allow_failures: allow_failures:
...@@ -28,4 +27,4 @@ matrix: ...@@ -28,4 +27,4 @@ matrix:
notifications: notifications:
on_success: never on_success: never
on_failure: always on_failure: always
\ No newline at end of file
The MIT License (MIT) The [MIT License](http://opensource.org/licenses/mit-license.php)
Copyright (c) 2015 Avtandil Kikabidze aka LONGMAN Copyright (c) 2015 [Avtandil Kikabidze aka LONGMAN](https://github.com/akalongman)
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
# PHP Telegram Bot # PHP Telegram Bot
[![Join the chat at [![Join the chat at https://gitter.im/akalongman/php-telegram-bot](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/akalongman/php-telegram-bot?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
https://gitter.im/akalongman/php-telegram-bot](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/akalongman/php-telegram-bot?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/akalongman/php-telegram-bot.svg?branch=master)](https://travis-ci.org/akalongman/php-telegram-bot) [![Build Status](https://travis-ci.org/akalongman/php-telegram-bot.svg?branch=master)](https://travis-ci.org/akalongman/php-telegram-bot)
[![Latest Stable [![Latest Stable Version](https://img.shields.io/packagist/v/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
Version](https://img.shields.io/packagist/v/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
[![Total Downloads](https://img.shields.io/packagist/dt/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot) [![Total Downloads](https://img.shields.io/packagist/dt/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
[![Downloads Month](https://img.shields.io/packagist/dm/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot) [![Downloads Month](https://img.shields.io/packagist/dm/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot)
[![License](https://img.shields.io/packagist/l/Longman/telegram-bot.svg)](https://packagist.org/packages/longman/telegram-bot) [![License](https://img.shields.io/packagist/l/Longman/telegram-bot.svg)](https://github.com/akalongman/php-telegram-bot/LICENSE.md)
A Telegram Bot based on the official [Telegram Bot A Telegram Bot based on the official [Telegram Bot API](https://core.telegram.org/bots/api)
API](https://core.telegram.org/bots/api)
### Introduction ### Introduction
...@@ -27,7 +24,7 @@ The Bot can: ...@@ -27,7 +24,7 @@ The Bot can:
- supports all types and methods according to Telegram API (2015 October 8). - supports all types and methods according to Telegram API (2015 October 8).
- handle commands in chat with other bots. - handle commands in chat with other bots.
It is ready for the channels support. It is ready for the channels support.
## Instructions ## Instructions
...@@ -127,7 +124,7 @@ The bot can handle updates with **webhook** or **getUpdate** method: ...@@ -127,7 +124,7 @@ The bot can handle updates with **webhook** or **getUpdate** method:
## Webhook installation ## Webhook installation
You need server with https and composer support. You need server with https and composer support.
You must set a [WebHook](https://core.telegram.org/bots/api#setwebhook). You must set a [WebHook](https://core.telegram.org/bots/api#setwebhook).
Create *set.php* (just edit *example-set.php*) and put into it: Create *set.php* (just copy and edit *examples/set.php*) and put into it:
```php ```php
<?php <?php
//Composer Loader //Composer Loader
...@@ -151,7 +148,7 @@ try { ...@@ -151,7 +148,7 @@ try {
And open your *set.php* via browser. And open your *set.php* via browser.
After, create *hook.php* (or just edit *example-hook.php*) and put: After, create *hook.php* (or just copy and edit *examples/hook.php*) and put:
```php ```php
<?php <?php
$loader = require __DIR__.'/vendor/autoload.php'; $loader = require __DIR__.'/vendor/autoload.php';
...@@ -180,7 +177,7 @@ $result = $telegram->setWebHook($url, $certificate_path); ...@@ -180,7 +177,7 @@ $result = $telegram->setWebHook($url, $certificate_path);
## getUpdate installation ## getUpdate installation
You need the database Mysql active. You need the database Mysql active.
Create *getUpdateCLI.php* (just edit *example-getUpdateCLI.php*) and put into it: Create *getUpdateCLI.php* (just copy and edit *examples/getUpdateCLI.php*) and put into it:
```php ```php
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
...@@ -199,7 +196,7 @@ try { ...@@ -199,7 +196,7 @@ try {
} catch (Longman\TelegramBot\Exception\TelegramException $e) { } catch (Longman\TelegramBot\Exception\TelegramException $e) {
// log telegram errors // log telegram errors
echo $e; echo $e;
} }
``` ```
give to the file the permission for execution: give to the file the permission for execution:
...@@ -223,7 +220,7 @@ $data['chat_id'] = $chat_id; ...@@ -223,7 +220,7 @@ $data['chat_id'] = $chat_id;
$result = Request::sendPhoto($data,$this->telegram->getUploadPath().'/'.'image.jpg'); $result = Request::sendPhoto($data,$this->telegram->getUploadPath().'/'.'image.jpg');
``` ```
If you know the file_id of a previously uploaded file, just provide it in the fist param: If you know the file_id of a previously uploaded file, just provide it in the fist param:
```php ```php
$data['chat_id'] = $chat_id; $data['chat_id'] = $chat_id;
...@@ -302,12 +299,12 @@ $COMMANDS_FOLDER = __DIR__.'/Commands/'; ...@@ -302,12 +299,12 @@ $COMMANDS_FOLDER = __DIR__.'/Commands/';
$telegram->addCommandsPath($COMMANDS_FOLDER); $telegram->addCommandsPath($COMMANDS_FOLDER);
``` ```
Inside *CommandsExamples/* there are some sample that show how to use types. Inside *examples/Commands/* there are some sample that show how to use types.
### Admin Commands ### Admin Commands
Enabling this feature, the admin bot can perform some super user command like: Enabling this feature, the admin bot can perform some super user command like:
- Send message to all chats - Send message to all chats
- List all the chats started with the bot (new!) - List all the chats started with the bot (new!)
You can specify one or more admin with this option: You can specify one or more admin with this option:
...@@ -329,37 +326,46 @@ array('google_api_key'=>'your_google_api_key_here')); ...@@ -329,37 +326,46 @@ array('google_api_key'=>'your_google_api_key_here'));
You can overwrite the default Upload and Download directory with: You can overwrite the default Upload and Download directory with:
```php ```php
$telegram->setDownloadPath("yourpath/Download"); $telegram->setDownloadPath("yourpath/Download");
$telegram->setUploadPath("yourpath../Upload"); $telegram->setUploadPath("yourpath../Upload");
``` ```
### Logging ### Logging
Thrown Exception are stored in TelegramException.log file (in the base directory). Thrown Exception are stored in TelegramException.log file (in the base directory).
Incoming update (json string from webhook and getUpdates) can be logged on a text file, set those options with the methods: Incoming update (json string from webhook and getUpdates) can be logged on a text file, set those options with the methods:
```php ```php
$telegram->setLogRequests(true); $telegram->setLogRequests(true);
$telegram->setLogPath($BOT_NAME.'.log'); $telegram->setLogPath($BOT_NAME.'.log');
``` ```
(New!) Set verbosity to 3, to log also curl requests and responses from the bot to Telegram: (New!) Set verbosity to 3, to log also curl requests and responses from the bot to Telegram:
```php ```php
$telegram->setLogRequests(true); $telegram->setLogRequests(true);
$telegram->setLogPath($BOT_NAME.'.log'); $telegram->setLogPath($BOT_NAME.'.log');
$telegram->setLogVerbosity(3); $telegram->setLogVerbosity(3);
``` ```
----- -----
This code is available on This code is available on
[Github](https://github.com/akalongman/php-telegram-bot). Pull [Github](https://github.com/akalongman/php-telegram-bot). Pull requests are welcome.
requests are welcome.
## Troubleshooting ## Troubleshooting
If you like living on the edge, please report any bugs you find on the If you like living on the edge, please report any bugs you find on the
[PHP Telegram Bot [PHP Telegram Bot issues](https://github.com/akalongman/php-telegram-bot/issues) page.
issues](https://github.com/akalongman/php-telegram-bot/issues) page.
## Contributing ## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for information. See [CONTRIBUTING.md](CONTRIBUTING.md) for information.
## License
Please see the [LICENSE](LICENSE.md) included in this repository for a full copy of the MIT license,
which this project is licensed under.
## Credits ## Credits
Credit list in [CREDITS](CREDITS) Credit list in [CREDITS](CREDITS)
2015-11-24 20:08:51 exception 'Longman\TelegramBot\Exception\TelegramException' with message 'Bot Username not defined!' in /media/D/applications/repositories/php-telegram-bot/src/Telegram.php:168
Stack trace:
#0 /media/D/applications/repositories/php-telegram-bot/tests/Unit/TelegramTest.php(43): Longman\TelegramBot\Telegram->__construct('testapikey', NULL)
#1 [internal function]: Tests\Unit\TelegramTest->newInstanceWithoutParams()
#2 phar:///usr/local/bin/phpunit/phpunit/Framework/TestCase.php(908): ReflectionMethod->invokeArgs(Object(Tests\Unit\TelegramTest), Array)
#3 phar:///usr/local/bin/phpunit/phpunit/Framework/TestCase.php(771): PHPUnit_Framework_TestCase->runTest()
#4 phar:///usr/local/bin/phpunit/phpunit/Framework/TestResult.php(617): PHPUnit_Framework_TestCase->runBare()
#5 phar:///usr/local/bin/phpunit/phpunit/Framework/TestCase.php(727): PHPUnit_Framework_TestResult->run(Object(Tests\Unit\TelegramTest))
#6 phar:///usr/local/bin/phpunit/phpunit/Framework/TestSuite.php(747): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))
#7 phar:///usr/local/bin/phpunit/phpunit/Framework/TestSuite.php(747): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#8 phar:///usr/local/bin/phpunit/phpunit/TextUI/TestRunner.php(425): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#9 phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php(154): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#10 phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php(105): PHPUnit_TextUI_Command->run(Array, true)
#11 /usr/local/bin/phpunit(509): PHPUnit_TextUI_Command::main()
#12 {main}
2015-11-24 20:31:17 exception 'Longman\TelegramBot\Exception\TelegramException' with message 'Bot Username not defined!' in /media/D/applications/repositories/php-telegram-bot/src/Telegram.php:168
Stack trace:
#0 /media/D/applications/repositories/php-telegram-bot/tests/Unit/TelegramTest.php(43): Longman\TelegramBot\Telegram->__construct('testapikey', NULL)
#1 [internal function]: Tests\Unit\TelegramTest->newInstanceWithoutParams()
#2 phar:///usr/local/bin/phpunit/phpunit/Framework/TestCase.php(908): ReflectionMethod->invokeArgs(Object(Tests\Unit\TelegramTest), Array)
#3 phar:///usr/local/bin/phpunit/phpunit/Framework/TestCase.php(771): PHPUnit_Framework_TestCase->runTest()
#4 phar:///usr/local/bin/phpunit/phpunit/Framework/TestResult.php(617): PHPUnit_Framework_TestCase->runBare()
#5 phar:///usr/local/bin/phpunit/phpunit/Framework/TestCase.php(727): PHPUnit_Framework_TestResult->run(Object(Tests\Unit\TelegramTest))
#6 phar:///usr/local/bin/phpunit/phpunit/Framework/TestSuite.php(747): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))
#7 phar:///usr/local/bin/phpunit/phpunit/Framework/TestSuite.php(747): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#8 phar:///usr/local/bin/phpunit/phpunit/TextUI/TestRunner.php(425): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#9 phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php(154): PHPUnit_TextUI_TestRunner->doRun(Object(PHPUnit_Framework_TestSuite), Array)
#10 phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php(105): PHPUnit_TextUI_Command->run(Array, true)
#11 /usr/local/bin/phpunit(509): PHPUnit_TextUI_Command::main()
#12 {main}
...@@ -13,13 +13,18 @@ ...@@ -13,13 +13,18 @@
<!-- Exclude 3rd party libraries and Framework code. --> <!-- Exclude 3rd party libraries and Framework code. -->
<exclude-pattern type="relative">vendor/*</exclude-pattern> <exclude-pattern type="relative">vendor/*</exclude-pattern>
<!-- Include all sniffs in an external standard directory --> <arg name="colors"/>
<!-- Include some additional sniffs from the Generic standard --> <!-- Include some additional sniffs from the Generic standard -->
<rule ref="PSR2"> <rule ref="PSR2">
<exclude name="PEAR.Functions.FunctionCallSignature"/> <exclude name="PEAR.Functions.FunctionCallSignature"/>
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket"/> <exclude name="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket"/>
</rule> </rule>
<rule ref="Generic.Files.LineLength">
<properties>
<property phpcs-only="true" name="lineLimit" value="100"/>
<property phpcbf-only="true" name="lineLimit" value="120"/>
</properties>
</rule>
</ruleset> </ruleset>
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
}, },
"authors": [ "authors": [
{ {
"name": "Avtandil Kikabidze aka LONGMAN", "name": "Avtandil Kikabidze aka LONGMAN",
"email": "akalongman@gmail.com", "email": "akalongman@gmail.com",
"homepage": "http://longman.ge", "homepage": "http://longman.me",
"role": "Developer" "role": "Developer"
} }
], ],
"require": { "require": {
"php": ">=5.4.0", "php": ">=5.5.0",
"ext-pdo": "*", "ext-pdo": "*",
"ext-curl": "*" "ext-curl": "*"
}, },
...@@ -32,10 +32,9 @@ ...@@ -32,10 +32,9 @@
"Tests\\": "tests/" "Tests\\": "tests/"
} }
}, },
"minimum-stability": "dev",
"require-dev": { "require-dev": {
"phpunit/phpunit": "4.1.*", "phpunit/phpunit": "~4.1",
"phpspec/phpspec": "~2.1", "phpspec/phpspec": "~2.1",
"squizlabs/php_codesniffer": "2.3.*" "squizlabs/php_codesniffer": "~2.3"
} }
} }
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "a8ca63804713b62dbe981dba7fae8c49",
"content-hash": "ba99241058ac97458860d93705a811af",
"packages": [],
"packages-dev": [
{
"name": "doctrine/instantiator",
"version": "1.0.5",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
"reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
"shasum": ""
},
"require": {
"php": ">=5.3,<8.0-DEV"
},
"require-dev": {
"athletic/athletic": "~0.1.8",
"ext-pdo": "*",
"ext-phar": "*",
"phpunit/phpunit": "~4.0",
"squizlabs/php_codesniffer": "~2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "http://ocramius.github.com/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://github.com/doctrine/instantiator",
"keywords": [
"constructor",
"instantiate"
],
"time": "2015-06-14 21:17:01"
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8",
"reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"suggest": {
"dflydev/markdown": "~1.0",
"erusev/parsedown": "~1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-0": {
"phpDocumentor": [
"src/"
]
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mike van Riel",
"email": "mike.vanriel@naenius.com"
}
],
"time": "2015-02-03 12:10:50"
},
{
"name": "phpspec/php-diff",
"version": "v1.0.2",
"source": {
"type": "git",
"url": "https://github.com/phpspec/php-diff.git",
"reference": "30e103d19519fe678ae64a60d77884ef3d71b28a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/php-diff/zipball/30e103d19519fe678ae64a60d77884ef3d71b28a",
"reference": "30e103d19519fe678ae64a60d77884ef3d71b28a",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-0": {
"Diff": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Chris Boulton",
"homepage": "http://github.com/chrisboulton",
"role": "Original developer"
}
],
"description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).",
"time": "2013-11-01 13:02:21"
},
{
"name": "phpspec/phpspec",
"version": "2.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/phpspec.git",
"reference": "36635a903bdeb54899d7407bc95610501fd98559"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/phpspec/zipball/36635a903bdeb54899d7407bc95610501fd98559",
"reference": "36635a903bdeb54899d7407bc95610501fd98559",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.1",
"php": ">=5.3.3",
"phpspec/php-diff": "~1.0.0",
"phpspec/prophecy": "~1.4",
"sebastian/exporter": "~1.0",
"symfony/console": "~2.3",
"symfony/event-dispatcher": "~2.1",
"symfony/finder": "~2.1",
"symfony/process": "^2.6",
"symfony/yaml": "~2.1"
},
"require-dev": {
"behat/behat": "^3.0.11",
"bossa/phpspec2-expect": "~1.0",
"phpunit/phpunit": "~4.4",
"symfony/filesystem": "~2.1"
},
"suggest": {
"phpspec/nyan-formatters": "~1.0 – Adds Nyan formatters"
},
"bin": [
"bin/phpspec"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev"
}
},
"autoload": {
"psr-0": {
"PhpSpec": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
},
{
"name": "Marcello Duarte",
"homepage": "http://marcelloduarte.net/"
}
],
"description": "Specification-oriented BDD framework for PHP 5.3+",
"homepage": "http://phpspec.net/",
"keywords": [
"BDD",
"SpecBDD",
"TDD",
"spec",
"specification",
"testing",
"tests"
],
"time": "2015-09-07 07:07:37"
},
{
"name": "phpspec/prophecy",
"version": "v1.5.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7",
"reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"phpdocumentor/reflection-docblock": "~2.0",
"sebastian/comparator": "~1.1"
},
"require-dev": {
"phpspec/phpspec": "~2.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
}
},
"autoload": {
"psr-0": {
"Prophecy\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
},
{
"name": "Marcello Duarte",
"email": "marcello.duarte@gmail.com"
}
],
"description": "Highly opinionated mocking framework for PHP 5.3+",
"homepage": "https://github.com/phpspec/prophecy",
"keywords": [
"Double",
"Dummy",
"fake",
"mock",
"spy",
"stub"
],
"time": "2015-08-13 10:07:40"
},
{
"name": "phpunit/php-code-coverage",
"version": "2.2.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"phpunit/php-file-iterator": "~1.3",
"phpunit/php-text-template": "~1.2",
"phpunit/php-token-stream": "~1.3",
"sebastian/environment": "^1.3.2",
"sebastian/version": "~1.0"
},
"require-dev": {
"ext-xdebug": ">=2.1.4",
"phpunit/phpunit": "~4"
},
"suggest": {
"ext-dom": "*",
"ext-xdebug": ">=2.2.1",
"ext-xmlwriter": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
"homepage": "https://github.com/sebastianbergmann/php-code-coverage",
"keywords": [
"coverage",
"testing",
"xunit"
],
"time": "2015-10-06 15:47:00"
},
{
"name": "phpunit/php-file-iterator",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "FilterIterator implementation that filters files based on a list of suffixes.",
"homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
"keywords": [
"filesystem",
"iterator"
],
"time": "2015-06-21 13:08:43"
},
{
"name": "phpunit/php-text-template",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Simple template engine.",
"homepage": "https://github.com/sebastianbergmann/php-text-template/",
"keywords": [
"template"
],
"time": "2015-06-21 13:50:34"
},
{
"name": "phpunit/php-timer",
"version": "1.0.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
"reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Utility class for timing",
"homepage": "https://github.com/sebastianbergmann/php-timer/",
"keywords": [
"timer"
],
"time": "2015-06-21 08:01:12"
},
{
"name": "phpunit/php-token-stream",
"version": "1.4.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
"reference": "3144ae21711fb6cac0b1ab4cbe63b75ce3d4e8da",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Wrapper around PHP's tokenizer extension.",
"homepage": "https://github.com/sebastianbergmann/php-token-stream/",
"keywords": [
"tokenizer"
],
"time": "2015-09-15 10:49:45"
},
{
"name": "phpunit/phpunit",
"version": "4.8.18",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fa33d4ad96481b91df343d83e8c8aabed6b1dfd3",
"reference": "fa33d4ad96481b91df343d83e8c8aabed6b1dfd3",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"php": ">=5.3.3",
"phpspec/prophecy": "^1.3.1",
"phpunit/php-code-coverage": "~2.1",
"phpunit/php-file-iterator": "~1.4",
"phpunit/php-text-template": "~1.2",
"phpunit/php-timer": ">=1.0.6",
"phpunit/phpunit-mock-objects": "~2.3",
"sebastian/comparator": "~1.1",
"sebastian/diff": "~1.2",
"sebastian/environment": "~1.3",
"sebastian/exporter": "~1.2",
"sebastian/global-state": "~1.0",
"sebastian/version": "~1.0",
"symfony/yaml": "~2.1|~3.0"
},
"suggest": {
"phpunit/php-invoker": "~1.1"
},
"bin": [
"phpunit"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.8.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "The PHP Unit Testing framework.",
"homepage": "https://phpunit.de/",
"keywords": [
"phpunit",
"testing",
"xunit"
],
"time": "2015-11-11 11:32:49"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "2.3.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": ">=5.3.3",
"phpunit/php-text-template": "~1.2",
"sebastian/exporter": "~1.2"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"suggest": {
"ext-soap": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.3.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"role": "lead"
}
],
"description": "Mock Object library for PHPUnit",
"homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
"keywords": [
"mock",
"xunit"
],
"time": "2015-10-02 06:51:40"
},
{
"name": "sebastian/comparator",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22",
"reference": "937efb279bd37a375bcadf584dec0726f84dbf22",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/diff": "~1.2",
"sebastian/exporter": "~1.2"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Provides the functionality to compare PHP values for equality",
"homepage": "http://www.github.com/sebastianbergmann/comparator",
"keywords": [
"comparator",
"compare",
"equality"
],
"time": "2015-07-26 15:48:44"
},
{
"name": "sebastian/diff",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
"reference": "863df9687835c62aa423a22412d26fa2ebde3fd3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3",
"reference": "863df9687835c62aa423a22412d26fa2ebde3fd3",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Kore Nordmann",
"email": "mail@kore-nordmann.de"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Diff implementation",
"homepage": "http://www.github.com/sebastianbergmann/diff",
"keywords": [
"diff"
],
"time": "2015-02-22 15:13:53"
},
{
"name": "sebastian/environment",
"version": "1.3.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "6324c907ce7a52478eeeaede764f48733ef5ae44"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44",
"reference": "6324c907ce7a52478eeeaede764f48733ef5ae44",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Provides functionality to handle HHVM/PHP environments",
"homepage": "http://www.github.com/sebastianbergmann/environment",
"keywords": [
"Xdebug",
"environment",
"hhvm"
],
"time": "2015-08-03 06:14:51"
},
{
"name": "sebastian/exporter",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
"reference": "7ae5513327cb536431847bcc0c10edba2701064e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e",
"reference": "7ae5513327cb536431847bcc0c10edba2701064e",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"sebastian/recursion-context": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Volker Dusch",
"email": "github@wallbash.com"
},
{
"name": "Bernhard Schussek",
"email": "bschussek@2bepublished.at"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
}
],
"description": "Provides the functionality to export PHP variables for visualization",
"homepage": "http://www.github.com/sebastianbergmann/exporter",
"keywords": [
"export",
"exporter"
],
"time": "2015-06-21 07:55:53"
},
{
"name": "sebastian/global-state",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
},
"suggest": {
"ext-uopz": "*"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
}
],
"description": "Snapshotting of global state",
"homepage": "http://www.github.com/sebastianbergmann/global-state",
"keywords": [
"global state"
],
"time": "2015-10-12 03:26:01"
},
{
"name": "sebastian/recursion-context",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
"reference": "994d4a811bafe801fb06dccbee797863ba2792ba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba",
"reference": "994d4a811bafe801fb06dccbee797863ba2792ba",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phpunit/phpunit": "~4.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Jeff Welch",
"email": "whatthejeff@gmail.com"
},
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de"
},
{
"name": "Adam Harvey",
"email": "aharvey@php.net"
}
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2015-06-21 08:04:50"
},
{
"name": "sebastian/version",
"version": "1.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"shasum": ""
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version",
"time": "2015-06-21 13:59:46"
},
{
"name": "squizlabs/php_codesniffer",
"version": "2.4.0",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "32a879f4f35019d78d568db2885d7779ca084a33"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/32a879f4f35019d78d568db2885d7779ca084a33",
"reference": "32a879f4f35019d78d568db2885d7779ca084a33",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"php": ">=5.1.2"
},
"bin": [
"scripts/phpcs",
"scripts/phpcbf"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"classmap": [
"CodeSniffer.php",
"CodeSniffer/CLI.php",
"CodeSniffer/Exception.php",
"CodeSniffer/File.php",
"CodeSniffer/Fixer.php",
"CodeSniffer/Report.php",
"CodeSniffer/Reporting.php",
"CodeSniffer/Sniff.php",
"CodeSniffer/Tokens.php",
"CodeSniffer/Reports/",
"CodeSniffer/Tokenizers/",
"CodeSniffer/DocGenerators/",
"CodeSniffer/Standards/AbstractPatternSniff.php",
"CodeSniffer/Standards/AbstractScopeSniff.php",
"CodeSniffer/Standards/AbstractVariableSniff.php",
"CodeSniffer/Standards/IncorrectPatternException.php",
"CodeSniffer/Standards/Generic/Sniffs/",
"CodeSniffer/Standards/MySource/Sniffs/",
"CodeSniffer/Standards/PEAR/Sniffs/",
"CodeSniffer/Standards/PSR1/Sniffs/",
"CodeSniffer/Standards/PSR2/Sniffs/",
"CodeSniffer/Standards/Squiz/Sniffs/",
"CodeSniffer/Standards/Zend/Sniffs/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Greg Sherwood",
"role": "lead"
}
],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "http://www.squizlabs.com/php-codesniffer",
"keywords": [
"phpcs",
"standards"
],
"time": "2015-11-23 21:30:59"
},
{
"name": "symfony/console",
"version": "v2.7.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "16bb1cb86df43c90931df65f529e7ebd79636750"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/16bb1cb86df43c90931df65f529e7ebd79636750",
"reference": "16bb1cb86df43c90931df65f529e7ebd79636750",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/event-dispatcher": "~2.1",
"symfony/process": "~2.1"
},
"suggest": {
"psr/log": "For using the console logger",
"symfony/event-dispatcher": "",
"symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Console\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2015-11-18 09:54:26"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.7.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "7e2f9c31645680026c2372edf66f863fc7757af5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7e2f9c31645680026c2372edf66f863fc7757af5",
"reference": "7e2f9c31645680026c2372edf66f863fc7757af5",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"require-dev": {
"psr/log": "~1.0",
"symfony/config": "~2.0,>=2.0.5",
"symfony/dependency-injection": "~2.6",
"symfony/expression-language": "~2.6",
"symfony/stopwatch": "~2.3"
},
"suggest": {
"symfony/dependency-injection": "",
"symfony/http-kernel": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\EventDispatcher\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2015-10-30 20:10:21"
},
{
"name": "symfony/finder",
"version": "v2.7.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "a06a0c0ff7db3736a50d530c908cca547bf13da9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/a06a0c0ff7db3736a50d530c908cca547bf13da9",
"reference": "a06a0c0ff7db3736a50d530c908cca547bf13da9",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Finder\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2015-10-30 20:10:21"
},
{
"name": "symfony/process",
"version": "v2.7.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "f6290983c8725d0afa29bdc3e5295879de3e58f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/f6290983c8725d0afa29bdc3e5295879de3e58f5",
"reference": "f6290983c8725d0afa29bdc3e5295879de3e58f5",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Process\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2015-11-19 16:11:24"
},
{
"name": "symfony/yaml",
"version": "v2.7.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "4cfcd7a9fceba662b3c036b7d9a91f6197af046c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/4cfcd7a9fceba662b3c036b7d9a91f6197af046c",
"reference": "4cfcd7a9fceba662b3c036b7d9a91f6197af046c",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.7-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2015-11-18 13:41:01"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.4.0",
"ext-pdo": "*",
"ext-curl": "*"
},
"platform-dev": []
}
...@@ -4,12 +4,18 @@ ...@@ -4,12 +4,18 @@
#while true; do ./getUpdatesCLI.php; done #while true; do ./getUpdatesCLI.php; done
//Composer Loader //Composer Loader
$loader = require __DIR__.'/vendor/autoload.php'; $dir = realpath(__DIR__.'/..');
$loader = require $dir.'/vendor/autoload.php';
$API_KEY = 'your_bot_api_key'; $API_KEY = 'your_bot_api_key';
$BOT_NAME = 'namebot'; $BOT_NAME = 'namebot';
//$COMMANDS_FOLDER = __DIR__.'/Commands/'; //$COMMANDS_FOLDER = __DIR__.'/Commands/';
$credentials = array('host'=>'localhost', 'user'=>'dbuser', 'password'=>'dbpass', 'database'=>'dbname'); $credentials = array(
'host'=>'localhost',
'user'=>'dbuser',
'password'=>'dbpass',
'database'=>'dbname'
);
try { try {
// create Telegram API object // create Telegram API object
......
<?php <?php
//Composer Loader //Composer Loader
$loader = require __DIR__.'/vendor/autoload.php'; $dir = realpath(__DIR__.'/..');
$loader = require $dir.'/vendor/autoload.php';
$API_KEY = 'your_bot_api_key'; $API_KEY = 'your_bot_api_key';
$BOT_NAME = 'namebot'; $BOT_NAME = 'namebot';
//$COMMANDS_FOLDER = __DIR__.'/Commands/'; //$COMMANDS_FOLDER = __DIR__.'/Commands/';
//$credentials = array('host'=>'localhost', 'user'=>'dbuser', 'password'=>'dbpass', 'database'=>'dbname'); /*$credentials = array(
'host'=>'localhost',
'user'=>'dbuser',
'password'=>'dbpass',
'database'=>'dbname'
);*/
try { try {
// create Telegram API object // create Telegram API object
......
<?php <?php
//Composer Loader //Composer Loader
$loader = require __DIR__.'/vendor/autoload.php'; $dir = realpath(__DIR__.'/..');
$loader = require $dir.'/vendor/autoload.php';
$API_KEY = 'your_bot_api_key'; $API_KEY = 'your_bot_api_key';
$BOT_NAME = 'namebot'; $BOT_NAME = 'namebot';
......
...@@ -57,7 +57,8 @@ abstract class Command ...@@ -57,7 +57,8 @@ abstract class Command
abstract public function execute(); abstract public function execute();
//this methods is executed if $need_mysql is true but DB connection for some reason is not avaiable // this methods is executed if $need_mysql is true
// but DB connection for some reason is not avaiable
public function executeNoDB() public function executeNoDB()
{ {
......
...@@ -17,7 +17,11 @@ class TelegramException extends \Exception ...@@ -17,7 +17,11 @@ class TelegramException extends \Exception
parent::__construct($message, $code); parent::__construct($message, $code);
$path = 'TelegramException.log'; $path = 'TelegramException.log';
$status = file_put_contents($path, date('Y-m-d H:i:s', time()) .' '. self::__toString() . "\n", FILE_APPEND); $status = file_put_contents(
$path,
date('Y-m-d H:i:s', time()) .' '. self::__toString() . "\n",
FILE_APPEND
);
} }
} }
...@@ -100,7 +100,12 @@ class Request ...@@ -100,7 +100,12 @@ class Request
if (isset($data['chat_id'])) { if (isset($data['chat_id'])) {
$data['message_id'] = '1234'; $data['message_id'] = '1234';
$data['date'] = '1441378360'; $data['date'] = '1441378360';
$data['from'] = array( 'id' => 123456789 ,'first_name' => 'botname', 'username'=> 'namebot'); $data['from'] = array(
'id' => 123456789,
'first_name' =>
'botname',
'username'=> 'namebot'
);
$data['chat'] = array('id'=> $data['chat_id'] ); $data['chat'] = array('id'=> $data['chat_id'] );
$fake_response['result'] = $data; $fake_response['result'] = $data;
...@@ -152,7 +157,9 @@ class Request ...@@ -152,7 +157,9 @@ class Request
//Logging getUpdates Update //Logging getUpdates Update
//Logging curl updates //Logging curl updates
if ($action == 'getUpdates' & self::$telegram->getLogVerbosity() >=1 | self::$telegram->getLogVerbosity() >=3) { if ($action == 'getUpdates'
& self::$telegram->getLogVerbosity() >=1
| self::$telegram->getLogVerbosity() >=3) {
self::setInputRaw($result); self::setInputRaw($result);
self::log($result); self::log($result);
} }
...@@ -211,7 +218,7 @@ class Request ...@@ -211,7 +218,7 @@ class Request
curl_close($ch); curl_close($ch);
# close local file # close local file
fclose($fp); fclose($fp);
if (filesize($loc_path) > 0) { if (filesize($loc_path) > 0) {
return true; return true;
} else { } else {
......
<?php <?php
/* /*
* This file is part of the TelegramBot package. * This file is part of the TelegramBot package.
* *
...@@ -537,6 +536,7 @@ class Telegram ...@@ -537,6 +536,7 @@ class Telegram
//$str[0] = strtolower($str[0]); //$str[0] = strtolower($str[0]);
return $str; return $str;
} }
/** /**
* Enable Admin Account * Enable Admin Account
* *
...@@ -550,7 +550,7 @@ class Telegram ...@@ -550,7 +550,7 @@ class Telegram
if ($admin > 0) { if ($admin > 0) {
$this->admins_list[] = $admin; $this->admins_list[] = $admin;
} else { } else {
throw new TelegramException('Only users can be admin not chat!'); throw new TelegramException('Invalid value "'.$admin.'" for admin!');
} }
} }
...@@ -564,7 +564,6 @@ class Telegram ...@@ -564,7 +564,6 @@ class Telegram
* *
* @return bool * @return bool
*/ */
public function isDbEnabled() public function isDbEnabled()
{ {
if ($this->mysql_enabled) { if ($this->mysql_enabled) {
......
...@@ -15,11 +15,11 @@ use \Longman\TelegramBot\Entities\Message; ...@@ -15,11 +15,11 @@ use \Longman\TelegramBot\Entities\Message;
use \Longman\TelegramBot\Request; use \Longman\TelegramBot\Request;
/** /**
* @package TelegramTest * @package TelegramTest
* @author Avtandil Kikabidze <akalongman@gmail.com> * @author Avtandil Kikabidze <akalongman@gmail.com>
* @copyright Avtandil Kikabidze <akalongman@gmail.com> * @copyright Avtandil Kikabidze <akalongman@gmail.com>
* @license http://opensource.org/licenses/mit-license.php The MIT License (MIT) * @license http://opensource.org/licenses/mit-license.php The MIT License (MIT)
* @link http://www.github.com/akalongman/php-telegram-bot * @link http://www.github.com/akalongman/php-telegram-bot
*/ */
class ServerResponseTest extends TestCase class ServerResponseTest extends TestCase
{ {
...@@ -27,7 +27,7 @@ class ServerResponseTest extends TestCase ...@@ -27,7 +27,7 @@ class ServerResponseTest extends TestCase
* @var \Longman\TelegramBot\Telegram * @var \Longman\TelegramBot\Telegram
*/ */
private $server; private $server;
/** /**
* setUp * setUp
*/ */
...@@ -39,7 +39,7 @@ class ServerResponseTest extends TestCase ...@@ -39,7 +39,7 @@ class ServerResponseTest extends TestCase
* @test * @test
*/ */
public function sendMessageOk() public function sendMessageOk()
{ {
return '{ return '{
"ok":true, "ok":true,
...@@ -55,7 +55,7 @@ class ServerResponseTest extends TestCase ...@@ -55,7 +55,7 @@ class ServerResponseTest extends TestCase
public function testSendMessageOk() { public function testSendMessageOk() {
$result = $this->sendMessageOk(); $result = $this->sendMessageOk();
$this->server = new ServerResponse(json_decode($result, true), 'testbot'); $this->server = new ServerResponse(json_decode($result, true), 'testbot');
...@@ -82,7 +82,7 @@ class ServerResponseTest extends TestCase ...@@ -82,7 +82,7 @@ class ServerResponseTest extends TestCase
* @test * @test
*/ */
public function sendMessageFail() public function sendMessageFail()
{ {
return '{ return '{
"ok":false, "ok":false,
...@@ -110,7 +110,7 @@ class ServerResponseTest extends TestCase ...@@ -110,7 +110,7 @@ class ServerResponseTest extends TestCase
public function setWebHookOk() public function setWebHookOk()
{ {
return '{"ok":true,"result":true,"description":"Webhook was set"}'; return '{"ok":true,"result":true,"description":"Webhook was set"}';
} }
public function testSetWebhookOk() { public function testSetWebhookOk() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment