├── .github ├── FUNDING.yml ├── workflows │ └── doc.yml ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── stale.yml ├── bot examples ├── updates │ ├── composer │ │ ├── getUpdates.php │ │ └── error.php │ └── getUpdates.php └── webhook │ ├── gamebot.php │ ├── updatecowsay.php │ └── update.php ├── mainpage.dox ├── composer.json ├── LICENSE.md ├── TelegramErrorLogger.php ├── README.md ├── Telegram.php └── Doxyfile /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | liberapay: eleirbag89 4 | custom: ["https://paypal.me/eleirbag89", "https://flattr.com/@Eleirbag89"] 5 | -------------------------------------------------------------------------------- /bot examples/updates/composer/getUpdates.php: -------------------------------------------------------------------------------- 1 | getUpdates()); 9 | -------------------------------------------------------------------------------- /bot examples/updates/composer/error.php: -------------------------------------------------------------------------------- 1 | getUpdates(); 9 | $telegram->serveUpdate(0); 10 | 11 | $res = $telegram->sendMessage([ 12 | 'chat_id' => 'adsf', // Chat not found 13 | 'text' => 'Hello world', 14 | ]); 15 | var_dump($res); 16 | -------------------------------------------------------------------------------- /mainpage.dox: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | \mainpage TelegramBotPHP documentation 4 | 5 | This is the API documentation of the TelegramBotPHP project.
6 | For see a bot in action, using this API, add [CowBot] (https://telegram.me/cowmooobot).
7 | Pages:
8 | * Telegram Class API
9 | * TelegramErrorLogger Class
10 | * [Readme] (md__home_travis_build__eleirbag89__telegram_bot_p_h_p__r_e_a_d_m_e.html)
11 | * [License] (md__home_travis_build__eleirbag89__telegram_bot_p_h_p__l_i_c_e_n_s_e.html) 12 | */ -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eleirbag89/telegrambotphp", 3 | "description": "A very simple PHP Telegram Bot API", 4 | "type": "library", 5 | "authors": [ 6 | { 7 | "name": "Gabriele Grillo", 8 | "email": "gabry.grillo@alice.it" 9 | } 10 | ], 11 | "license": "MIT", 12 | "minimum-stability": "alpha", 13 | "require": { 14 | "php": ">=5.0", 15 | "ext-json": "*", 16 | "ext-curl": "*" 17 | }, 18 | "autoload": { 19 | "files": ["Telegram.php", "TelegramErrorLogger.php"] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github/workflows/doc.yml: -------------------------------------------------------------------------------- 1 | name: GitHub Pages 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | generate-doc: 10 | runs-on: ubuntu-20.04 11 | steps: 12 | - name: Checkout source 13 | uses: actions/checkout@v1 14 | - name: Generate docs 15 | uses: mattnotmitt/doxygen-action@v1.9.2 16 | with: 17 | enable-latex: true 18 | - name: Deploy to GitHub Pages 19 | uses: peaceiris/actions-gh-pages@v3 20 | if: ${{ github.ref == 'refs/heads/master' }} 21 | with: 22 | github_token: ${{ secrets.GITHUB_TOKEN }} 23 | publish_dir: ./html 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 60 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - help_wanted 8 | - pinned 9 | - security 10 | # Label to use when marking an issue as stale 11 | staleLabel: wontfix 12 | # Comment to post when marking an issue as stale. Set to `false` to disable 13 | markComment: > 14 | This issue has been automatically marked as stale because it has not had 15 | recent activity. It will be closed if no further activity occurs. Thank you 16 | for your contributions. 17 | # Comment to post when closing a stale issue. Set to `false` to disable 18 | closeComment: false 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Bot code snippet 16 | 2. Action or message 17 | 18 | **Expected behavior** 19 | A clear and concise description of what you expected to happen. 20 | 21 | **Setup (please complete the following information):** 22 | - OS: [e.g. ubuntu 22.04] 23 | - Mode: webhook/update 24 | - Server[e.g. Apache Httpd/Nginx] 25 | - Lib Version [e.g. 1.3.12] 26 | - Installation: [e.g. composer] 27 | 28 | **Additional context** 29 | Add any other context about the problem here. 30 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2015-2017 Gabriele Grillo - gabry.grillo@alice.it, shakibonline - shakiba_9@yahoo.com (for the TelegramErrorLogger.php file) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /bot examples/webhook/gamebot.php: -------------------------------------------------------------------------------- 1 | Text(); 8 | $chat_id = $telegram->ChatID(); 9 | $data = $telegram->getData(); 10 | $callback_query = $telegram->Callback_Query(); 11 | 12 | if (isset($_GET['user_id']) && isset($_GET['inline']) && isset($_GET['score'])) { 13 | $content = ['user_id' => $_GET['user_id'], 'inline_message_id' => $_GET['inline'], 'score' => $_GET['score'], 'force' => 'false']; 14 | $reply = $telegram->setGameScore($content); 15 | echo $reply; 16 | 17 | return; 18 | } 19 | if (!empty($data['inline_query'])) { 20 | $query = $data['inline_query']['query']; 21 | 22 | if (strpos('gamename', $query) !== false) { 23 | $results = json_encode([['type' => 'game', 'id'=> '1', 'game_short_name' => 'game_short']]); 24 | $content = ['inline_query_id' => $data['inline_query']['id'], 'results' => $results]; 25 | $reply = $telegram->answerInlineQuery($content); 26 | } 27 | } 28 | 29 | if (!empty($callback_query)) { 30 | $game_name = $data['callback_query']['game_short_name']; 31 | $user_id = $data['callback_query']['from']['id']; 32 | $inline_id = $data['callback_query']['inline_message_id']; 33 | 34 | $content = ['callback_query_id' => $telegram->Callback_ID(), 'url' => 'http://domain.com/gamefolder/?user_id='.$user_id.'&inline='.$inline_id]; 35 | $telegram->answerCallbackQuery($content); 36 | } 37 | 38 | if ($text == '/start') { 39 | $content = ['chat_id' => $chat_id, 'text' => 'Welcome to Test GameBot !']; 40 | $telegram->sendMessage($content); 41 | } 42 | -------------------------------------------------------------------------------- /bot examples/updates/getUpdates.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | include 'Telegram.php'; 9 | 10 | $bot_token = 'bot_token'; 11 | $telegram = new Telegram($bot_token); 12 | 13 | // Get all the new updates and set the new correct update_id 14 | $req = $telegram->getUpdates(); 15 | for ($i = 0; $i < $telegram->UpdateCount(); $i++) { 16 | // You NEED to call serveUpdate before accessing the values of message in Telegram Class 17 | $telegram->serveUpdate($i); 18 | $text = $telegram->Text(); 19 | $chat_id = $telegram->ChatID(); 20 | 21 | if ($text == '/start') { 22 | $reply = 'Working'; 23 | $content = ['chat_id' => $chat_id, 'text' => $reply]; 24 | $telegram->sendMessage($content); 25 | } 26 | if ($text == '/test') { 27 | if ($telegram->messageFromGroup()) { 28 | $reply = 'Chat Group'; 29 | } else { 30 | $reply = 'Private Chat'; 31 | } 32 | // Create option for the custom keyboard. Array of array string 33 | $option = [['A', 'B'], ['C', 'D']]; 34 | // Get the keyboard 35 | $keyb = $telegram->buildKeyBoard($option); 36 | $content = ['chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => $reply]; 37 | $telegram->sendMessage($content); 38 | } 39 | if ($text == '/git') { 40 | $reply = 'Check me on GitHub: https://github.com/Eleirbag89/TelegramBotPHP'; 41 | // Build the reply array 42 | $content = ['chat_id' => $chat_id, 'text' => $reply]; 43 | $telegram->sendMessage($content); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /bot examples/webhook/updatecowsay.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | include 'Telegram.php'; 9 | 10 | // Set the bot TOKEN 11 | $bot_token = 'bot_token'; 12 | // Instances the class 13 | $telegram = new Telegram($bot_token); 14 | 15 | /* If you need to manually take some parameters 16 | * $result = $telegram->getData(); 17 | * $text = $result["message"] ["text"]; 18 | * $chat_id = $result["message"] ["chat"]["id"]; 19 | */ 20 | 21 | // Take text and chat_id from the message 22 | $text = $telegram->Text(); 23 | $chat_id = $telegram->ChatID(); 24 | 25 | if ($text == '/start') { 26 | $option = [["\xF0\x9F\x90\xAE"], ['Git', 'Credit']]; 27 | // Create a permanent custom keyboard 28 | $keyb = $telegram->buildKeyBoard($option, $onetime = false); 29 | $content = ['chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "Welcome to CowBot \xF0\x9F\x90\xAE \nPlease type /cowsay or click the Cow button !"]; 30 | $telegram->sendMessage($content); 31 | } 32 | if ($text == '/cowsay' || $text == "\xF0\x9F\x90\xAE") { 33 | $randstring = rand().sha1(time()); 34 | $cowurl = 'http://bangame.altervista.org/cowsay/fortune_image_w.php?preview='.$randstring; 35 | $content = ['chat_id' => $chat_id, 'text' => $cowurl]; 36 | $telegram->sendMessage($content); 37 | } 38 | if ($text == '/credit' || $text == 'Credit') { 39 | $reply = "Eleirbag89 Telegram PHP API http://telegrambot.ienadeprex.com \nFrancesco Laurita (for the cowsay script) http://francesco-laurita.info/wordpress/fortune-cowsay-on-php-5"; 40 | $content = ['chat_id' => $chat_id, 'text' => $reply]; 41 | $telegram->sendMessage($content); 42 | } 43 | 44 | if ($text == '/git' || $text == 'Git') { 45 | $reply = 'Check me on GitHub: https://github.com/Eleirbag89/TelegramBotPHP'; 46 | $content = ['chat_id' => $chat_id, 'text' => $reply]; 47 | $telegram->sendMessage($content); 48 | } 49 | -------------------------------------------------------------------------------- /TelegramErrorLogger.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class TelegramErrorLogger 9 | { 10 | private static $self; 11 | 12 | /// Log request and response parameters from/to Telegram API 13 | 14 | /** 15 | * Prints the list of parameters from/to Telegram's API endpoint 16 | * \param $result the Telegram's response as array 17 | * \param $content the request parameters as array. 18 | */ 19 | public static function log($result, $content, $use_rt = true) 20 | { 21 | try { 22 | if ($result['ok'] === false) { 23 | self::$self = new self(); 24 | $e = new \Exception(); 25 | $error = PHP_EOL; 26 | $error .= '==========[Response]=========='; 27 | $error .= "\n"; 28 | foreach ($result as $key => $value) { 29 | if ($value == false) { 30 | $error .= $key.":\t\t\tFalse\n"; 31 | } else { 32 | $error .= $key.":\t\t".$value."\n"; 33 | } 34 | } 35 | $array = '=========[Sent Data]=========='; 36 | $array .= "\n"; 37 | if ($use_rt == true) { 38 | foreach ($content as $item) { 39 | $array .= self::$self->rt($item).PHP_EOL.PHP_EOL; 40 | } 41 | } else { 42 | foreach ($content as $key => $value) { 43 | $array .= $key.":\t\t".$value."\n"; 44 | } 45 | } 46 | $backtrace = '============[Trace]==========='; 47 | $backtrace .= "\n"; 48 | $backtrace .= $e->getTraceAsString(); 49 | self::$self->_log_to_file($error.$array.$backtrace); 50 | } 51 | } catch (\Exception $e) { 52 | echo $e->getMessage(); 53 | } 54 | } 55 | 56 | /// Write a string in the log file adding the current server time 57 | 58 | /** 59 | * Write a string in the log file TelegramErrorLogger.txt adding the current server time 60 | * \param $error_text the text to append in the log. 61 | */ 62 | private function _log_to_file($error_text) 63 | { 64 | try { 65 | $dir_name = 'logs'; 66 | if (!is_dir($dir_name)) { 67 | mkdir($dir_name); 68 | } 69 | $fileName = $dir_name.'/'.__CLASS__.'-'.date('Y-m-d').'.txt'; 70 | $myFile = fopen($fileName, 'a+'); 71 | $date = '============[Date]============'; 72 | $date .= "\n"; 73 | $date .= '[ '.date('Y-m-d H:i:s e').' ] '; 74 | fwrite($myFile, $date.$error_text."\n\n"); 75 | fclose($myFile); 76 | } catch (\Exception $e) { 77 | echo $e->getMessage(); 78 | } 79 | } 80 | 81 | private function rt($array, $title = null, $head = true) 82 | { 83 | $ref = 'ref'; 84 | $text = ''; 85 | if ($head) { 86 | $text = "[$ref]"; 87 | $text .= "\n"; 88 | } 89 | foreach ($array as $key => $value) { 90 | if ($value instanceof CURLFile) { 91 | $text .= $ref.'.'.$key.'= File'.PHP_EOL; 92 | } elseif (is_array($value)) { 93 | if ($title != null) { 94 | $key = $title.'.'.$key; 95 | } 96 | $text .= self::rt($value, $key, false); 97 | } else { 98 | if (is_bool($value)) { 99 | $value = ($value) ? 'true' : 'false'; 100 | } 101 | if ($title != '') { 102 | $text .= $ref.'.'.$title.'.'.$key.'= '.$value.PHP_EOL; 103 | } else { 104 | $text .= $ref.'.'.$key.'= '.$value.PHP_EOL; 105 | } 106 | } 107 | } 108 | 109 | return $text; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /bot examples/webhook/update.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | include 'Telegram.php'; 8 | 9 | // Set the bot TOKEN 10 | $bot_token = 'bot_token'; 11 | // Instances the class 12 | $telegram = new Telegram($bot_token); 13 | 14 | /* If you need to manually take some parameters 15 | * $result = $telegram->getData(); 16 | * $text = $result["message"] ["text"]; 17 | * $chat_id = $result["message"] ["chat"]["id"]; 18 | */ 19 | 20 | // Take text and chat_id from the message 21 | $text = $telegram->Text(); 22 | $chat_id = $telegram->ChatID(); 23 | 24 | // Test CallBack 25 | $callback_query = $telegram->Callback_Query(); 26 | if (!empty($callback_query)) { 27 | $reply = 'Callback value '.$telegram->Callback_Data(); 28 | $content = ['chat_id' => $telegram->Callback_ChatID(), 'text' => $reply]; 29 | $telegram->sendMessage($content); 30 | 31 | $content = ['callback_query_id' => $telegram->Callback_ID(), 'text' => $reply, 'show_alert' => true]; 32 | $telegram->answerCallbackQuery($content); 33 | } 34 | 35 | //Test Inline 36 | $data = $telegram->getData(); 37 | if (!empty($data['inline_query'])) { 38 | $query = $data['inline_query']['query']; 39 | // GIF Examples 40 | if (strpos('testText', $query) !== false) { 41 | $results = json_encode([['type' => 'gif', 'id'=> '1', 'gif_url' => 'http://i1260.photobucket.com/albums/ii571/LMFAOSPEAKS/LMFAO/113481459.gif', 'thumb_url'=>'http://i1260.photobucket.com/albums/ii571/LMFAOSPEAKS/LMFAO/113481459.gif']]); 42 | $content = ['inline_query_id' => $data['inline_query']['id'], 'results' => $results]; 43 | $reply = $telegram->answerInlineQuery($content); 44 | } 45 | 46 | if (strpos('dance', $query) !== false) { 47 | $results = json_encode([['type' => 'gif', 'id'=> '1', 'gif_url' => 'https://media.tenor.co/images/cbbfdd7ff679e2ae442024b5cfed229c/tenor.gif', 'thumb_url'=>'https://media.tenor.co/images/cbbfdd7ff679e2ae442024b5cfed229c/tenor.gif']]); 48 | $content = ['inline_query_id' => $data['inline_query']['id'], 'results' => $results]; 49 | $reply = $telegram->answerInlineQuery($content); 50 | } 51 | } 52 | 53 | // Check if the text is a command 54 | if (!is_null($text) && !is_null($chat_id)) { 55 | if ($text == '/test') { 56 | if ($telegram->messageFromGroup()) { 57 | $reply = 'Chat Group'; 58 | } else { 59 | $reply = 'Private Chat'; 60 | } 61 | // Create option for the custom keyboard. Array of array string 62 | $option = [['A', 'B'], ['C', 'D']]; 63 | // Get the keyboard 64 | $keyb = $telegram->buildKeyBoard($option); 65 | $content = ['chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => $reply]; 66 | $telegram->sendMessage($content); 67 | } elseif ($text == '/git') { 68 | $reply = 'Check me on GitHub: https://github.com/Eleirbag89/TelegramBotPHP'; 69 | // Build the reply array 70 | $content = ['chat_id' => $chat_id, 'text' => $reply]; 71 | $telegram->sendMessage($content); 72 | } elseif ($text == '/img') { 73 | // Load a local file to upload. If is already on Telegram's Servers just pass the resource id 74 | $img = curl_file_create('test.png', 'image/png'); 75 | $content = ['chat_id' => $chat_id, 'photo' => $img]; 76 | $telegram->sendPhoto($content); 77 | //Download the file just sended 78 | $file_id = $message['photo'][0]['file_id']; 79 | $file = $telegram->getFile($file_id); 80 | $telegram->downloadFile($file['result']['file_path'], './test_download.png'); 81 | } elseif ($text == '/where') { 82 | // Send the Catania's coordinate 83 | $content = ['chat_id' => $chat_id, 'latitude' => '37.5', 'longitude' => '15.1']; 84 | $telegram->sendLocation($content); 85 | } elseif ($text == '/inlinekeyboard') { 86 | // Shows the Inline Keyboard and Trigger a callback on a button press 87 | $option = [ 88 | [ 89 | $telegram->buildInlineKeyBoardButton('Callback 1', $url = '', $callback_data = '1'), 90 | $telegram->buildInlineKeyBoardButton('Callback 2', $url = '', $callback_data = '2'), 91 | ], 92 | ]; 93 | 94 | $keyb = $telegram->buildInlineKeyBoard($option); 95 | $content = ['chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => 'This is an InlineKeyboard Test with Callbacks']; 96 | $telegram->sendMessage($content); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TelegramBotPHP 2 | [![API](https://img.shields.io/badge/Telegram%20Bot%20API-April%2016%2C%202022-36ade1.svg)](https://core.telegram.org/bots/api) 3 | ![PHP](https://img.shields.io/badge/php-%3E%3D5.3-8892bf.svg) 4 | ![CURL](https://img.shields.io/badge/cURL-required-green.svg) 5 | 6 | [![Total Downloads](https://poser.pugx.org/eleirbag89/telegrambotphp/downloads)](https://packagist.org/packages/eleirbag89/telegrambotphp) 7 | [![License](https://poser.pugx.org/eleirbag89/telegrambotphp/license)](https://packagist.org/packages/eleirbag89/telegrambotphp) 8 | [![StyleCI](https://styleci.io/repos/38492095/shield?branch=master)](https://styleci.io/repos/38492095) 9 | 10 | A very simple PHP [Telegram Bot API](https://core.telegram.org/bots). 11 | Compliant with the April 16, 2022 Telegram Bot API update. 12 | 13 | Requirements 14 | --------- 15 | 16 | * PHP >= 5.3 17 | * Curl extension for PHP5 must be enabled. 18 | * Telegram API key, you can get one simply with [@BotFather](https://core.telegram.org/bots#botfather) with simple commands right after creating your bot. 19 | 20 | For the WebHook: 21 | * An VALID SSL certificate (Telegram API requires this). You can use [Cloudflare's Free Flexible SSL](https://www.cloudflare.com/ssl) which crypts the web traffic from end user to their proxies if you're using CloudFlare DNS. 22 | Since the August 29 update you can use a self-signed ssl certificate. 23 | 24 | For the getUpdates(Long Polling): 25 | * Some way to execute the script in order to serve messages (for example cronjob) 26 | 27 | Download 28 | --------- 29 | 30 | #### Using Composer 31 | 32 | From your project directory, run: 33 | ``` 34 | composer require eleirbag89/telegrambotphp 35 | ``` 36 | or 37 | ``` 38 | php composer.phar require eleirbag89/telegrambotphp 39 | ``` 40 | Note: If you don't have Composer you can download it [HERE](https://getcomposer.org/download/). 41 | 42 | #### Using release archives 43 | 44 | https://github.com/Eleirbag89/TelegramBotPHP/releases 45 | 46 | #### Using Git 47 | 48 | From a project directory, run: 49 | ``` 50 | git clone https://github.com/Eleirbag89/TelegramBotPHP.git 51 | ``` 52 | 53 | Installation 54 | --------- 55 | 56 | #### Via Composer's autoloader 57 | 58 | After downloading by using Composer, you can include Composer's autoloader: 59 | ```php 60 | include (__DIR__ . '/vendor/autoload.php'); 61 | 62 | $telegram = new Telegram('YOUR TELEGRAM TOKEN HERE'); 63 | ``` 64 | 65 | #### Via TelegramBotPHP class 66 | 67 | Copy Telegram.php into your server and include it in your new bot script: 68 | ```php 69 | include 'Telegram.php'; 70 | 71 | $telegram = new Telegram('YOUR TELEGRAM TOKEN HERE'); 72 | ``` 73 | 74 | Note: To enable error log file, also copy TelegramErrorLogger.php in the same directory of Telegram.php file. 75 | 76 | Configuration (WebHook) 77 | --------- 78 | 79 | Navigate to 80 | https://api.telegram.org/bot(BOT_TOKEN)/setWebhook?url=https://yoursite.com/your_update.php 81 | Or use the Telegram class setWebhook method. 82 | 83 | Examples 84 | --------- 85 | 86 | ```php 87 | $telegram = new Telegram('YOUR TELEGRAM TOKEN HERE'); 88 | 89 | $chat_id = $telegram->ChatID(); 90 | $content = array('chat_id' => $chat_id, 'text' => 'Test'); 91 | $telegram->sendMessage($content); 92 | ``` 93 | 94 | If you want to get some specific parameter from the Telegram response: 95 | ```php 96 | $telegram = new Telegram('YOUR TELEGRAM TOKEN HERE'); 97 | 98 | $result = $telegram->getData(); 99 | $text = $result['message'] ['text']; 100 | $chat_id = $result['message'] ['chat']['id']; 101 | $content = array('chat_id' => $chat_id, 'text' => 'Test'); 102 | $telegram->sendMessage($content); 103 | ``` 104 | 105 | To upload a Photo or some other files, you need to load it with CurlFile: 106 | ```php 107 | // Load a local file to upload. If is already on Telegram's Servers just pass the resource id 108 | $img = curl_file_create('test.png','image/png'); 109 | $content = array('chat_id' => $chat_id, 'photo' => $img ); 110 | $telegram->sendPhoto($content); 111 | ``` 112 | 113 | To download a file on the Telegram's servers 114 | ```php 115 | $file = $telegram->getFile($file_id); 116 | $telegram->downloadFile($file['result']['file_path'], './my_downloaded_file_on_local_server.png'); 117 | ``` 118 | 119 | See update.php or update cowsay.php for the complete example. 120 | If you wanna see the CowSay Bot in action [add it](https://telegram.me/cowmooobot). 121 | 122 | If you want to use getUpdates instead of the WebHook you need to call the the `serveUpdate` function inside a for cycle. 123 | ```php 124 | $telegram = new Telegram('YOUR TELEGRAM TOKEN HERE'); 125 | 126 | $req = $telegram->getUpdates(); 127 | 128 | for ($i = 0; $i < $telegram-> UpdateCount(); $i++) { 129 | // You NEED to call serveUpdate before accessing the values of message in Telegram Class 130 | $telegram->serveUpdate($i); 131 | $text = $telegram->Text(); 132 | $chat_id = $telegram->ChatID(); 133 | 134 | if ($text == '/start') { 135 | $reply = 'Working'; 136 | $content = array('chat_id' => $chat_id, 'text' => $reply); 137 | $telegram->sendMessage($content); 138 | } 139 | // DO OTHER STUFF 140 | } 141 | ``` 142 | See getUpdates.php for the complete example. 143 | 144 | Functions 145 | ------------ 146 | 147 | For a complete and up-to-date functions documentation check http://eleirbag89.github.io/TelegramBotPHP/ 148 | 149 | Build keyboards 150 | ------------ 151 | 152 | Telegram's bots can have two different kind of keyboards: Inline and Reply. 153 | The InlineKeyboard is linked to a particular message, while the ReplyKeyboard is linked to the whole chat. 154 | They are both an array of array of buttons, which rapresent the rows and columns. 155 | For instance you can arrange a ReplyKeyboard like this: 156 | ![ReplyKeabordExample](https://picload.org/image/rilclcwr/replykeyboard.png) 157 | using this code: 158 | ```php 159 | $option = array( 160 | //First row 161 | array($telegram->buildKeyboardButton("Button 1"), $telegram->buildKeyboardButton("Button 2")), 162 | //Second row 163 | array($telegram->buildKeyboardButton("Button 3"), $telegram->buildKeyboardButton("Button 4"), $telegram->buildKeyboardButton("Button 5")), 164 | //Third row 165 | array($telegram->buildKeyboardButton("Button 6")) ); 166 | $keyb = $telegram->buildKeyBoard($option, $onetime=false); 167 | $content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "This is a Keyboard Test"); 168 | $telegram->sendMessage($content); 169 | ``` 170 | When a user click on the button, the button text is send back to the bot. 171 | For an InlineKeyboard it's pretty much the same (but you need to provide a valid URL or a Callback data) 172 | ![InlineKeabordExample](https://picload.org/image/rilclcwa/replykeyboardinline.png) 173 | ```php 174 | $option = array( 175 | //First row 176 | array($telegram->buildInlineKeyBoardButton("Button 1", $url="http://link1.com"), $telegram->buildInlineKeyBoardButton("Button 2", $url="http://link2.com")), 177 | //Second row 178 | array($telegram->buildInlineKeyBoardButton("Button 3", $url="http://link3.com"), $telegram->buildInlineKeyBoardButton("Button 4", $url="http://link4.com"), $telegram->buildInlineKeyBoardButton("Button 5", $url="http://link5.com")), 179 | //Third row 180 | array($telegram->buildInlineKeyBoardButton("Button 6", $url="http://link6.com")) ); 181 | $keyb = $telegram->buildInlineKeyBoard($option); 182 | $content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "This is a Keyboard Test"); 183 | $telegram->sendMessage($content); 184 | ``` 185 | This is the list of all the helper functions to make keyboards easily: 186 | 187 | ```php 188 | buildKeyBoard(array $options, $onetime=true, $resize=true, $selective=true) 189 | ``` 190 | Send a custom keyboard. $option is an array of array KeyboardButton. 191 | Check [ReplyKeyBoardMarkUp](https://core.telegram.org/bots/api#replykeyboardmarkup) for more info. 192 | 193 | ```php 194 | buildInlineKeyBoard(array $inline_keyboard) 195 | ``` 196 | Send a custom keyboard. $inline_keyboard is an array of array InlineKeyboardButton. 197 | Check [InlineKeyboardMarkup](https://core.telegram.org/bots/api#inlinekeyboardmarkup) for more info. 198 | 199 | ```php 200 | buildInlineKeyBoardButton($text, $url, $callback_data, $switch_inline_query) 201 | ``` 202 | Create an InlineKeyboardButton. 203 | Check [InlineKeyBoardButton](https://core.telegram.org/bots/api#inlinekeyboardbutton) for more info. 204 | 205 | ```php 206 | buildKeyBoardButton($text, $url, $request_contact, $request_location) 207 | ``` 208 | Create a KeyboardButton. 209 | Check [KeyBoardButton](https://core.telegram.org/bots/api#keyboardbutton) for more info. 210 | 211 | 212 | ```php 213 | buildKeyBoardHide($selective=true) 214 | ``` 215 | Hide a custom keyboard. 216 | Check [ReplyKeyBoarHide](https://core.telegram.org/bots/api#replykeyboardhide) for more info. 217 | 218 | ```php 219 | buildForceReply($selective=true) 220 | ``` 221 | Show a Reply interface to the user. 222 | Check [ForceReply](https://core.telegram.org/bots/api#forcereply) for more info. 223 | 224 | Emoticons 225 | ------------ 226 | For a list of emoticons to use in your bot messages, please refer to the column Bytes of this table: 227 | http://apps.timwhitlock.info/emoji/tables/unicode 228 | 229 | License 230 | ------------ 231 | 232 | This open-source software is distributed under the MIT License. See LICENSE.md 233 | 234 | Contributing 235 | ------------ 236 | 237 | All kinds of contributions are welcome - code, tests, documentation, bug reports, new features, etc... 238 | 239 | * Send feedbacks. 240 | * Submit bug reports. 241 | * Write/Edit the documents. 242 | * Fix bugs or add new features. 243 | 244 | Contact me 245 | ------------ 246 | 247 | You can contact me [via Telegram](https://telegram.me/ggrillo) but if you have an issue please [open](https://github.com/Eleirbag89/TelegramBotPHP/issues) one. 248 | 249 | Support me 250 | ------------ 251 | 252 | You can support me using via LiberaPay [![Donate using Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/eleirbag89/donate) 253 | 254 | or buy me a beer or two using [Paypal](https://paypal.me/eleirbag89). 255 | -------------------------------------------------------------------------------- /Telegram.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class Telegram 13 | { 14 | /** 15 | * Constant for type Inline Query. 16 | */ 17 | const INLINE_QUERY = 'inline_query'; 18 | /** 19 | * Constant for type Callback Query. 20 | */ 21 | const CALLBACK_QUERY = 'callback_query'; 22 | /** 23 | * Constant for type Edited Message. 24 | */ 25 | const EDITED_MESSAGE = 'edited_message'; 26 | /** 27 | * Constant for type Reply. 28 | */ 29 | const REPLY = 'reply'; 30 | /** 31 | * Constant for type Message. 32 | */ 33 | const MESSAGE = 'message'; 34 | /** 35 | * Constant for type Photo. 36 | */ 37 | const PHOTO = 'photo'; 38 | /** 39 | * Constant for type Video. 40 | */ 41 | const VIDEO = 'video'; 42 | /** 43 | * Constant for type Audio. 44 | */ 45 | const AUDIO = 'audio'; 46 | /** 47 | * Constant for type Voice. 48 | */ 49 | const VOICE = 'voice'; 50 | /** 51 | * Constant for type animation. 52 | */ 53 | const ANIMATION = 'animation'; 54 | /** 55 | * Constant for type sticker. 56 | */ 57 | const STICKER = 'sticker'; 58 | /** 59 | * Constant for type Document. 60 | */ 61 | const DOCUMENT = 'document'; 62 | /** 63 | * Constant for type Location. 64 | */ 65 | const LOCATION = 'location'; 66 | /** 67 | * Constant for type Contact. 68 | */ 69 | const CONTACT = 'contact'; 70 | /** 71 | * Constant for type Channel Post. 72 | */ 73 | const CHANNEL_POST = 'channel_post'; 74 | /** 75 | * Constant for type New Chat Member. 76 | */ 77 | const NEW_CHAT_MEMBER = 'new_chat_member'; 78 | /** 79 | * Constant for type Left Chat Member. 80 | */ 81 | const LEFT_CHAT_MEMBER = 'left_chat_member'; 82 | /** 83 | * Constant for type My Chat Member. 84 | */ 85 | const MY_CHAT_MEMBER = 'my_chat_member'; 86 | 87 | private $bot_token = ''; 88 | private $data = []; 89 | private $updates = []; 90 | private $log_errors; 91 | private $proxy; 92 | private $update_type; 93 | 94 | /// Class constructor 95 | 96 | /** 97 | * Create a Telegram instance from the bot token 98 | * \param $bot_token the bot token 99 | * \param $log_errors enable or disable the logging 100 | * \param $proxy array with the proxy configuration (url, port, type, auth) 101 | * \return an instance of the class. 102 | */ 103 | public function __construct($bot_token, $log_errors = true, array $proxy = []) 104 | { 105 | $this->bot_token = $bot_token; 106 | $this->data = $this->getData(); 107 | $this->log_errors = $log_errors; 108 | $this->proxy = $proxy; 109 | } 110 | 111 | /// Do requests to Telegram Bot API 112 | 113 | /** 114 | * Contacts the various API's endpoints 115 | * \param $api the API endpoint 116 | * \param $content the request parameters as array 117 | * \param $post boolean tells if $content needs to be sends 118 | * \return the JSON Telegram's reply. 119 | */ 120 | public function endpoint($api, array $content, $post = true) 121 | { 122 | $url = 'https://api.telegram.org/bot'.$this->bot_token.'/'.$api; 123 | if ($post) { 124 | $reply = $this->sendAPIRequest($url, $content); 125 | } else { 126 | $reply = $this->sendAPIRequest($url, [], false); 127 | } 128 | 129 | return json_decode($reply, true); 130 | } 131 | 132 | /// A method for testing your bot. 133 | 134 | /** 135 | * See getMe 136 | * \return the JSON Telegram's reply. 137 | */ 138 | public function getMe() 139 | { 140 | return $this->endpoint('getMe', [], false); 141 | } 142 | 143 | /** 144 | * See logOut 145 | * \return the JSON Telegram's reply. 146 | */ 147 | public function logOut() 148 | { 149 | return $this->endpoint('logOut', [], false); 150 | } 151 | 152 | /** 153 | * See close 154 | * \return the JSON Telegram's reply. 155 | */ 156 | public function close() 157 | { 158 | return $this->endpoint('close', [], false); 159 | } 160 | 161 | /// A method for responding http to Telegram. 162 | 163 | /** 164 | * \return the HTTP 200 to Telegram. 165 | */ 166 | public function respondSuccess() 167 | { 168 | http_response_code(200); 169 | 170 | return json_encode(['status' => 'success']); 171 | } 172 | 173 | /// Send a message 174 | 175 | /** 176 | * See sendMessage for the input values 177 | * \param $content the request parameters as array 178 | * \return the JSON Telegram's reply. 179 | */ 180 | public function sendMessage(array $content) 181 | { 182 | return $this->endpoint('sendMessage', $content); 183 | } 184 | 185 | /// Copy a message 186 | 187 | /** 188 | * See copyMessage for the input values 189 | * \param $content the request parameters as array 190 | * \return the JSON Telegram's reply. 191 | */ 192 | public function copyMessage(array $content) 193 | { 194 | return $this->endpoint('copyMessage', $content); 195 | } 196 | 197 | /// Forward a message 198 | 199 | /** 200 | * See forwardMessage for the input values 201 | * \param $content the request parameters as array 202 | * \return the JSON Telegram's reply. 203 | */ 204 | public function forwardMessage(array $content) 205 | { 206 | return $this->endpoint('forwardMessage', $content); 207 | } 208 | 209 | /// Send a photo 210 | 211 | /** 212 | * See sendPhoto for the input values 213 | * \param $content the request parameters as array 214 | * \return the JSON Telegram's reply. 215 | */ 216 | public function sendPhoto(array $content) 217 | { 218 | return $this->endpoint('sendPhoto', $content); 219 | } 220 | 221 | /// Send an audio 222 | 223 | /** 224 | * See sendAudio for the input values 225 | * \param $content the request parameters as array 226 | * \return the JSON Telegram's reply. 227 | */ 228 | public function sendAudio(array $content) 229 | { 230 | return $this->endpoint('sendAudio', $content); 231 | } 232 | 233 | /// Send a document 234 | 235 | /** 236 | * See sendDocument for the input values 237 | * \param $content the request parameters as array 238 | * \return the JSON Telegram's reply. 239 | */ 240 | public function sendDocument(array $content) 241 | { 242 | return $this->endpoint('sendDocument', $content); 243 | } 244 | 245 | /// Send an animation 246 | 247 | /** 248 | * See sendAnimation for the input values 249 | * \param $content the request parameters as array 250 | * \return the JSON Telegram's reply. 251 | */ 252 | public function sendAnimation(array $content) 253 | { 254 | return $this->endpoint('sendAnimation', $content); 255 | } 256 | 257 | /// Send a sticker 258 | 259 | /** 260 | * See sendSticker for the input values 261 | * \param $content the request parameters as array 262 | * \return the JSON Telegram's reply. 263 | */ 264 | public function sendSticker(array $content) 265 | { 266 | return $this->endpoint('sendSticker', $content); 267 | } 268 | 269 | /// Send a video 270 | 271 | /** 272 | * See sendVideo for the input values 273 | * \param $content the request parameters as array 274 | * \return the JSON Telegram's reply. 275 | */ 276 | public function sendVideo(array $content) 277 | { 278 | return $this->endpoint('sendVideo', $content); 279 | } 280 | 281 | /// Send a voice message 282 | 283 | /** 284 | * See sendVoice for the input values 285 | * \param $content the request parameters as array 286 | * \return the JSON Telegram's reply. 287 | */ 288 | public function sendVoice(array $content) 289 | { 290 | return $this->endpoint('sendVoice', $content); 291 | } 292 | 293 | /// Send a location 294 | 295 | /** 296 | * See sendLocation for the input values 297 | * \param $content the request parameters as array 298 | * \return the JSON Telegram's reply. 299 | */ 300 | public function sendLocation(array $content) 301 | { 302 | return $this->endpoint('sendLocation', $content); 303 | } 304 | 305 | /// Edit Message Live Location 306 | 307 | /** 308 | * See editMessageLiveLocation for the input values 309 | * \param $content the request parameters as array 310 | * \return the JSON Telegram's reply. 311 | */ 312 | public function editMessageLiveLocation(array $content) 313 | { 314 | return $this->endpoint('editMessageLiveLocation', $content); 315 | } 316 | 317 | /// Stop Message Live Location 318 | 319 | /** 320 | * See stopMessageLiveLocation for the input values 321 | * \param $content the request parameters as array 322 | * \return the JSON Telegram's reply. 323 | */ 324 | public function stopMessageLiveLocation(array $content) 325 | { 326 | return $this->endpoint('stopMessageLiveLocation', $content); 327 | } 328 | 329 | /// Set Chat Sticker Set 330 | 331 | /** 332 | * See setChatStickerSet for the input values 333 | * \param $content the request parameters as array 334 | * \return the JSON Telegram's reply. 335 | */ 336 | public function setChatStickerSet(array $content) 337 | { 338 | return $this->endpoint('setChatStickerSet', $content); 339 | } 340 | 341 | /// Delete Chat Sticker Set 342 | 343 | /** 344 | * See deleteChatStickerSet for the input values 345 | * \param $content the request parameters as array 346 | * \return the JSON Telegram's reply. 347 | */ 348 | public function deleteChatStickerSet(array $content) 349 | { 350 | return $this->endpoint('deleteChatStickerSet', $content); 351 | } 352 | 353 | /// Send Media Group 354 | 355 | /** 356 | * See sendMediaGroup for the input values 357 | * \param $content the request parameters as array 358 | * \return the JSON Telegram's reply. 359 | */ 360 | public function sendMediaGroup(array $content) 361 | { 362 | return $this->endpoint('sendMediaGroup', $content); 363 | } 364 | 365 | /// Send Venue 366 | 367 | /** 368 | * See sendVenue for the input values 369 | * \param $content the request parameters as array 370 | * \return the JSON Telegram's reply. 371 | */ 372 | public function sendVenue(array $content) 373 | { 374 | return $this->endpoint('sendVenue', $content); 375 | } 376 | 377 | //Send contact 378 | 379 | /** 380 | * See sendContact for the input values 381 | * \param $content the request parameters as array 382 | * \return the JSON Telegram's reply. 383 | */ 384 | public function sendContact(array $content) 385 | { 386 | return $this->endpoint('sendContact', $content); 387 | } 388 | 389 | //Send a poll 390 | 391 | /** 392 | * See sendPoll for the input values 393 | * \param $content the request parameters as array 394 | * \return the JSON Telegram's reply. 395 | */ 396 | public function sendPoll(array $content) 397 | { 398 | return $this->endpoint('sendPoll', $content); 399 | } 400 | 401 | //Send a dice 402 | 403 | /** 404 | * See sendDice for the input values 405 | * \param $content the request parameters as array 406 | * \return the JSON Telegram's reply. 407 | */ 408 | public function sendDice(array $content) 409 | { 410 | return $this->endpoint('sendDice', $content); 411 | } 412 | 413 | /// Send a chat action 414 | 415 | /** 416 | * See sendChatAction for the input values 417 | * \param $content the request parameters as array 418 | * \return the JSON Telegram's reply. 419 | */ 420 | public function sendChatAction(array $content) 421 | { 422 | return $this->endpoint('sendChatAction', $content); 423 | } 424 | 425 | /// Get a list of profile pictures for a user 426 | 427 | /** 428 | * See getUserProfilePhotos for the input values 429 | * \param $content the request parameters as array 430 | * \return the JSON Telegram's reply. 431 | */ 432 | public function getUserProfilePhotos(array $content) 433 | { 434 | return $this->endpoint('getUserProfilePhotos', $content); 435 | } 436 | 437 | /// Use this method to get basic info about a file and prepare it for downloading 438 | 439 | /** 440 | * Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot/, where is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again. 441 | * \param $file_id String File identifier to get info about 442 | * \return the JSON Telegram's reply. 443 | */ 444 | public function getFile($file_id) 445 | { 446 | $content = ['file_id' => $file_id]; 447 | 448 | return $this->endpoint('getFile', $content); 449 | } 450 | 451 | /// Kick Chat Member 452 | 453 | /** 454 | * Deprecated 455 | * \param $content the request parameters as array 456 | * \return the JSON Telegram's reply. 457 | */ 458 | public function kickChatMember(array $content) 459 | { 460 | return $this->endpoint('kickChatMember', $content); 461 | } 462 | 463 | /// Leave Chat 464 | 465 | /** 466 | * See leaveChat for the input values 467 | * \param $content the request parameters as array 468 | * \return the JSON Telegram's reply. 469 | */ 470 | public function leaveChat(array $content) 471 | { 472 | return $this->endpoint('leaveChat', $content); 473 | } 474 | 475 | /// Ban Chat Member 476 | 477 | /** 478 | * See banChatMember for the input values 479 | * \param $content the request parameters as array 480 | * \return the JSON Telegram's reply. 481 | */ 482 | public function banChatMember(array $content) 483 | { 484 | return $this->endpoint('banChatMember', $content); 485 | } 486 | 487 | /// Unban Chat Member 488 | 489 | /** 490 | * See unbanChatMember for the input values 491 | * \param $content the request parameters as array 492 | * \return the JSON Telegram's reply. 493 | */ 494 | public function unbanChatMember(array $content) 495 | { 496 | return $this->endpoint('unbanChatMember', $content); 497 | } 498 | 499 | /// Get Chat Information 500 | 501 | /** 502 | * See getChat for the input values 503 | * \param $content the request parameters as array 504 | * \return the JSON Telegram's reply. 505 | */ 506 | public function getChat(array $content) 507 | { 508 | return $this->endpoint('getChat', $content); 509 | } 510 | 511 | /// Get chat Administrators 512 | 513 | /** 514 | * See getChatAdministrators for the input values 515 | * \param $content the request parameters as array 516 | * \return the JSON Telegram's reply. 517 | */ 518 | public function getChatAdministrators(array $content) 519 | { 520 | return $this->endpoint('getChatAdministrators', $content); 521 | } 522 | 523 | /// Get chat member count 524 | 525 | /** 526 | * See getChatMemberCount for the input values 527 | * \param $content the request parameters as array 528 | * \return the JSON Telegram's reply. 529 | */ 530 | public function getChatMemberCount(array $content) 531 | { 532 | return $this->endpoint('getChatMemberCount', $content); 533 | } 534 | 535 | /** 536 | * For retrocompatibility 537 | * \param $content the request parameters as array 538 | * \return the JSON Telegram's reply. 539 | */ 540 | public function getChatMembersCount(array $content) 541 | { 542 | return $this->getChatMemberCount($content); 543 | } 544 | 545 | /** 546 | * See getChatMember for the input values 547 | * \param $content the request parameters as array 548 | * \return the JSON Telegram's reply. 549 | */ 550 | public function getChatMember(array $content) 551 | { 552 | return $this->endpoint('getChatMember', $content); 553 | } 554 | 555 | /** 556 | * See answerInlineQuery for the input values 557 | * \param $content the request parameters as array 558 | * \return the JSON Telegram's reply. 559 | */ 560 | public function answerInlineQuery(array $content) 561 | { 562 | return $this->endpoint('answerInlineQuery', $content); 563 | } 564 | 565 | /// Set Game Score 566 | 567 | /** 568 | * See setGameScore for the input values 569 | * \param $content the request parameters as array 570 | * \return the JSON Telegram's reply. 571 | */ 572 | public function setGameScore(array $content) 573 | { 574 | return $this->endpoint('setGameScore', $content); 575 | } 576 | 577 | /// Get Game Hi Scores 578 | 579 | /** 580 | * See getGameHighScores for the input values 581 | * \param $content the request parameters as array 582 | * \return the JSON Telegram's reply. 583 | */ 584 | public function getGameHighScores(array $content) 585 | { 586 | return $this->endpoint('getGameHighScores', $content); 587 | } 588 | 589 | /// Answer a callback Query 590 | 591 | /** 592 | * See answerCallbackQuery for the input values 593 | * \param $content the request parameters as array 594 | * \return the JSON Telegram's reply. 595 | */ 596 | public function answerCallbackQuery(array $content) 597 | { 598 | return $this->endpoint('answerCallbackQuery', $content); 599 | } 600 | 601 | /// Set the list of the bot commands 602 | 603 | /** 604 | * See setMyCommands for the input values 605 | * \param $content the request parameters as array 606 | * \return the JSON Telegram's reply. 607 | */ 608 | public function setMyCommands(array $content) 609 | { 610 | return $this->endpoint('setMyCommands', $content); 611 | } 612 | 613 | /// Delete the list of the bot commands 614 | 615 | /** 616 | * See deleteMyCommands for the input values 617 | * \param $content the request parameters as array 618 | * \return the JSON Telegram's reply. 619 | */ 620 | public function deleteMyCommands(array $content) 621 | { 622 | return $this->endpoint('deleteMyCommands', $content); 623 | } 624 | 625 | /// Get the list of the bot commands 626 | 627 | /** 628 | * See getMyCommands for the input values 629 | * \param $content the request parameters as array 630 | * \return the JSON Telegram's reply. 631 | */ 632 | public function getMyCommands(array $content) 633 | { 634 | return $this->endpoint('getMyCommands', $content); 635 | } 636 | 637 | /// Set the chat menu button 638 | 639 | /** 640 | * See setChatMenuButton for the input values 641 | * \param $content the request parameters as array 642 | * \return the JSON Telegram's reply. 643 | */ 644 | public function setChatMenuButton(array $content) 645 | { 646 | return $this->endpoint('setChatMenuButton', $content); 647 | } 648 | 649 | /// Get the chat menu button 650 | 651 | /** 652 | * See getChatMenuButton for the input values 653 | * \param $content the request parameters as array 654 | * \return the JSON Telegram's reply. 655 | */ 656 | public function getChatMenuButton(array $content) 657 | { 658 | return $this->endpoint('getChatMenuButton', $content); 659 | } 660 | 661 | /// Set the default aministrator rights 662 | 663 | /** 664 | * See setMyDefaultAdministratorRights for the input values 665 | * \param $content the request parameters as array 666 | * \return the JSON Telegram's reply. 667 | */ 668 | public function setMyDefaultAdministratorRights(array $content) 669 | { 670 | return $this->endpoint('setMyDefaultAdministratorRights', $content); 671 | } 672 | 673 | /// Get the default aministrator rights 674 | 675 | /** 676 | * See getMyDefaultAdministratorRights for the input values 677 | * \param $content the request parameters as array 678 | * \return the JSON Telegram's reply. 679 | */ 680 | public function getMyDefaultAdministratorRights(array $content) 681 | { 682 | return $this->endpoint('getMyDefaultAdministratorRights', $content); 683 | } 684 | 685 | /** 686 | * See editMessageText for the input values 687 | * \param $content the request parameters as array 688 | * \return the JSON Telegram's reply. 689 | */ 690 | public function editMessageText(array $content) 691 | { 692 | return $this->endpoint('editMessageText', $content); 693 | } 694 | 695 | /** 696 | * See editMessageCaption for the input values 697 | * \param $content the request parameters as array 698 | * \return the JSON Telegram's reply. 699 | */ 700 | public function editMessageCaption(array $content) 701 | { 702 | return $this->endpoint('editMessageCaption', $content); 703 | } 704 | 705 | /** 706 | * See editMessageMedia for the input values 707 | * \param $content the request parameters as array 708 | * \return the JSON Telegram's reply. 709 | */ 710 | public function editMessageMedia(array $content) 711 | { 712 | return $this->endpoint('editMessageMedia', $content); 713 | } 714 | 715 | /** 716 | * See editMessageReplyMarkup for the input values 717 | * \param $content the request parameters as array 718 | * \return the JSON Telegram's reply. 719 | */ 720 | public function editMessageReplyMarkup(array $content) 721 | { 722 | return $this->endpoint('editMessageReplyMarkup', $content); 723 | } 724 | 725 | /** 726 | * See stopPoll for the input values 727 | * \param $content the request parameters as array 728 | * \return the JSON Telegram's reply. 729 | */ 730 | public function stopPoll(array $content) 731 | { 732 | return $this->endpoint('stopPoll', $content); 733 | } 734 | 735 | /// Use this method to download a file 736 | 737 | /** 738 | * Use this method to to download a file from the Telegram servers. 739 | * \param $telegram_file_path String File path on Telegram servers 740 | * \param $local_file_path String File path where save the file. 741 | */ 742 | public function downloadFile($telegram_file_path, $local_file_path) 743 | { 744 | $file_url = 'https://api.telegram.org/file/bot'.$this->bot_token.'/'.$telegram_file_path; 745 | $in = fopen($file_url, 'rb'); 746 | $out = fopen($local_file_path, 'wb'); 747 | 748 | while ($chunk = fread($in, 8192)) { 749 | fwrite($out, $chunk, 8192); 750 | } 751 | fclose($in); 752 | fclose($out); 753 | } 754 | 755 | /// Set a WebHook for the bot 756 | 757 | /** 758 | * Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. 759 | * 760 | * If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/. Since nobody else knows your bot‘s token, you can be pretty sure it’s us. 761 | * \param $url String HTTPS url to send updates to. Use an empty string to remove webhook integration 762 | * \param $certificate InputFile Upload your public key certificate so that the root certificate in use can be checked 763 | * \return the JSON Telegram's reply. 764 | */ 765 | public function setWebhook($url, $certificate = '') 766 | { 767 | if ($certificate == '') { 768 | $requestBody = ['url' => $url]; 769 | } else { 770 | $requestBody = ['url' => $url, 'certificate' => "@$certificate"]; 771 | } 772 | 773 | return $this->endpoint('setWebhook', $requestBody, true); 774 | } 775 | 776 | /// Delete the WebHook for the bot 777 | 778 | /** 779 | * Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters. 780 | * \return the JSON Telegram's reply. 781 | */ 782 | public function deleteWebhook() 783 | { 784 | return $this->endpoint('deleteWebhook', [], false); 785 | } 786 | 787 | /// Get the data of the current message 788 | 789 | /** Get the POST request of a user in a Webhook or the message actually processed in a getUpdates() enviroment. 790 | * \return the JSON users's message. 791 | */ 792 | public function getData() 793 | { 794 | if (empty($this->data)) { 795 | $rawData = file_get_contents('php://input'); 796 | 797 | return json_decode($rawData, true); 798 | } else { 799 | return $this->data; 800 | } 801 | } 802 | 803 | /// Set the data currently used 804 | public function setData(array $data) 805 | { 806 | $this->data = $data; 807 | } 808 | 809 | /// Get the text of the current message 810 | 811 | /** 812 | * \return the String users's text. 813 | */ 814 | public function Text() 815 | { 816 | $type = $this->getUpdateType(); 817 | if ($type == self::CALLBACK_QUERY) { 818 | return @$this->data['callback_query']['data']; 819 | } 820 | if ($type == self::CHANNEL_POST) { 821 | return @$this->data['channel_post']['text']; 822 | } 823 | if ($type == self::EDITED_MESSAGE) { 824 | return @$this->data['edited_message']['text']; 825 | } 826 | 827 | return @$this->data['message']['text']; 828 | } 829 | 830 | public function Caption() 831 | { 832 | $type = $this->getUpdateType(); 833 | if ($type == self::CHANNEL_POST) { 834 | return @$this->data['channel_post']['caption']; 835 | } 836 | 837 | return @$this->data['message']['caption']; 838 | } 839 | 840 | /// Get the chat_id of the current message 841 | 842 | /** 843 | * \return the String users's chat_id. 844 | */ 845 | public function ChatID() 846 | { 847 | $chat = $this->Chat(); 848 | 849 | return $chat['id']; 850 | } 851 | 852 | /** 853 | * \return the Array chat. 854 | */ 855 | public function Chat() 856 | { 857 | $type = $this->getUpdateType(); 858 | if ($type == self::CALLBACK_QUERY) { 859 | return @$this->data['callback_query']['message']['chat']; 860 | } 861 | if ($type == self::CHANNEL_POST) { 862 | return @$this->data['channel_post']['chat']; 863 | } 864 | if ($type == self::EDITED_MESSAGE) { 865 | return @$this->data['edited_message']['chat']; 866 | } 867 | if ($type == self::INLINE_QUERY) { 868 | return @$this->data['inline_query']['from']; 869 | } 870 | if ($type == self::MY_CHAT_MEMBER) { 871 | return @$this->data['my_chat_member']['chat']; 872 | } 873 | 874 | return $this->data['message']['chat']; 875 | } 876 | 877 | /// Get the message_id of the current message 878 | 879 | /** 880 | * \return the String message_id. 881 | */ 882 | public function MessageID() 883 | { 884 | $type = $this->getUpdateType(); 885 | if ($type == self::CALLBACK_QUERY) { 886 | return @$this->data['callback_query']['message']['message_id']; 887 | } 888 | if ($type == self::CHANNEL_POST) { 889 | return @$this->data['channel_post']['message_id']; 890 | } 891 | if ($type == self::EDITED_MESSAGE) { 892 | return @$this->data['edited_message']['message_id']; 893 | } 894 | 895 | return $this->data['message']['message_id']; 896 | } 897 | 898 | /// Get the reply_to_message message_id of the current message 899 | 900 | /** 901 | * \return the String reply_to_message message_id. 902 | */ 903 | public function ReplyToMessageID() 904 | { 905 | return $this->data['message']['reply_to_message']['message_id']; 906 | } 907 | 908 | /// Get the reply_to_message forward_from user_id of the current message 909 | 910 | /** 911 | * \return the String reply_to_message forward_from user_id. 912 | */ 913 | public function ReplyToMessageFromUserID() 914 | { 915 | return $this->data['message']['reply_to_message']['forward_from']['id']; 916 | } 917 | 918 | /// Get the inline_query of the current update 919 | 920 | /** 921 | * \return the Array inline_query. 922 | */ 923 | public function Inline_Query() 924 | { 925 | return $this->data['inline_query']; 926 | } 927 | 928 | /// Get the callback_query of the current update 929 | 930 | /** 931 | * \return the String callback_query. 932 | */ 933 | public function Callback_Query() 934 | { 935 | return $this->data['callback_query']; 936 | } 937 | 938 | /// Get the callback_query id of the current update 939 | 940 | /** 941 | * \return the String callback_query id. 942 | */ 943 | public function Callback_ID() 944 | { 945 | return $this->data['callback_query']['id']; 946 | } 947 | 948 | /// Get the Get the data of the current callback 949 | 950 | /** 951 | * \deprecated Use Text() instead 952 | * \return the String callback_data. 953 | */ 954 | public function Callback_Data() 955 | { 956 | return $this->data['callback_query']['data']; 957 | } 958 | 959 | /// Get the Get the message of the current callback 960 | 961 | /** 962 | * \return the Message. 963 | */ 964 | public function Callback_Message() 965 | { 966 | return $this->data['callback_query']['message']; 967 | } 968 | 969 | /// Get the Get the chat_id of the current callback 970 | 971 | /** 972 | * \deprecated Use ChatId() instead 973 | * \return the String callback_query. 974 | */ 975 | public function Callback_ChatID() 976 | { 977 | return $this->data['callback_query']['message']['chat']['id']; 978 | } 979 | 980 | /// Get the Get the from_id of the current callback 981 | 982 | /** 983 | * \return the String callback_query from_id. 984 | */ 985 | public function Callback_FromID() 986 | { 987 | return $this->data['callback_query']['from']['id']; 988 | } 989 | 990 | /// Get the date of the current message 991 | 992 | /** 993 | * \return the String message's date. 994 | */ 995 | public function Date() 996 | { 997 | return $this->data['message']['date']; 998 | } 999 | 1000 | /// Get the first name of the user 1001 | public function FirstName() 1002 | { 1003 | $type = $this->getUpdateType(); 1004 | if ($type == self::CALLBACK_QUERY) { 1005 | return @$this->data['callback_query']['from']['first_name']; 1006 | } 1007 | if ($type == self::CHANNEL_POST) { 1008 | return @$this->data['channel_post']['from']['first_name']; 1009 | } 1010 | if ($type == self::EDITED_MESSAGE) { 1011 | return @$this->data['edited_message']['from']['first_name']; 1012 | } 1013 | 1014 | return @$this->data['message']['from']['first_name']; 1015 | } 1016 | 1017 | /// Get the last name of the user 1018 | public function LastName() 1019 | { 1020 | $type = $this->getUpdateType(); 1021 | if ($type == self::CALLBACK_QUERY) { 1022 | return @$this->data['callback_query']['from']['last_name']; 1023 | } 1024 | if ($type == self::CHANNEL_POST) { 1025 | return @$this->data['channel_post']['from']['last_name']; 1026 | } 1027 | if ($type == self::EDITED_MESSAGE) { 1028 | return @$this->data['edited_message']['from']['last_name']; 1029 | } 1030 | if ($type == self::MESSAGE) { 1031 | return @$this->data['message']['from']['last_name']; 1032 | } 1033 | 1034 | return ''; 1035 | } 1036 | 1037 | /// Get the username of the user 1038 | public function Username() 1039 | { 1040 | $type = $this->getUpdateType(); 1041 | if ($type == self::CALLBACK_QUERY) { 1042 | return @$this->data['callback_query']['from']['username']; 1043 | } 1044 | if ($type == self::CHANNEL_POST) { 1045 | return @$this->data['channel_post']['from']['username']; 1046 | } 1047 | if ($type == self::EDITED_MESSAGE) { 1048 | return @$this->data['edited_message']['from']['username']; 1049 | } 1050 | 1051 | return @$this->data['message']['from']['username']; 1052 | } 1053 | 1054 | /// Get the location in the message 1055 | public function Location() 1056 | { 1057 | return $this->data['message']['location']; 1058 | } 1059 | 1060 | /// Get the update_id of the message 1061 | public function UpdateID() 1062 | { 1063 | return $this->data['update_id']; 1064 | } 1065 | 1066 | /// Get the number of updates 1067 | public function UpdateCount() 1068 | { 1069 | return count($this->updates['result']); 1070 | } 1071 | 1072 | /// Get user's id of current message 1073 | public function UserID() 1074 | { 1075 | $type = $this->getUpdateType(); 1076 | if ($type == self::CALLBACK_QUERY) { 1077 | return $this->data['callback_query']['from']['id']; 1078 | } 1079 | if ($type == self::CHANNEL_POST) { 1080 | return $this->data['channel_post']['from']['id']; 1081 | } 1082 | if ($type == self::EDITED_MESSAGE) { 1083 | return @$this->data['edited_message']['from']['id']; 1084 | } 1085 | if ($type == self::INLINE_QUERY) { 1086 | return @$this->data['inline_query']['from']['id']; 1087 | } 1088 | 1089 | return $this->data['message']['from']['id']; 1090 | } 1091 | 1092 | /// Get user's id of current forwarded message 1093 | public function FromID() 1094 | { 1095 | return $this->data['message']['forward_from']['id']; 1096 | } 1097 | 1098 | /// Get chat's id where current message forwarded from 1099 | public function FromChatID() 1100 | { 1101 | return $this->data['message']['forward_from_chat']['id']; 1102 | } 1103 | 1104 | /// Tell if a message is from a group or user chat 1105 | 1106 | /** 1107 | * \return BOOLEAN true if the message is from a Group chat, false otherwise. 1108 | */ 1109 | public function messageFromGroup() 1110 | { 1111 | if ($this->data['message']['chat']['type'] == 'private') { 1112 | return false; 1113 | } 1114 | 1115 | return true; 1116 | } 1117 | 1118 | /// Get the contact phone number 1119 | 1120 | /** 1121 | * \return a String of the contact phone number. 1122 | */ 1123 | public function getContactPhoneNumber() 1124 | { 1125 | if ($this->getUpdateType() == self::CONTACT) { 1126 | return $this->data['message']['contact']['phone_number']; 1127 | } 1128 | 1129 | return ''; 1130 | } 1131 | 1132 | /// Get the title of the group chat 1133 | 1134 | /** 1135 | * \return a String of the title chat. 1136 | */ 1137 | public function messageFromGroupTitle() 1138 | { 1139 | if ($this->data['message']['chat']['type'] != 'private') { 1140 | return $this->data['message']['chat']['title']; 1141 | } 1142 | 1143 | return ''; 1144 | } 1145 | 1146 | /// Set a custom keyboard 1147 | 1148 | /** This object represents a custom keyboard with reply options 1149 | * \param $options Array of Array of String; Array of button rows, each represented by an Array of Strings 1150 | * \param $onetime Boolean Requests clients to hide the keyboard as soon as it's been used. Defaults to false. 1151 | * \param $resize Boolean Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. 1152 | * \param $selective Boolean Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. 1153 | * \return the requested keyboard as Json. 1154 | */ 1155 | public function buildKeyBoard(array $options, $onetime = false, $resize = false, $selective = true) 1156 | { 1157 | $replyMarkup = [ 1158 | 'keyboard' => $options, 1159 | 'one_time_keyboard' => $onetime, 1160 | 'resize_keyboard' => $resize, 1161 | 'selective' => $selective, 1162 | ]; 1163 | $encodedMarkup = json_encode($replyMarkup, true); 1164 | 1165 | return $encodedMarkup; 1166 | } 1167 | 1168 | /// Set an InlineKeyBoard 1169 | 1170 | /** This object represents an inline keyboard that appears right next to the message it belongs to. 1171 | * \param $options Array of Array of InlineKeyboardButton; Array of button rows, each represented by an Array of InlineKeyboardButton 1172 | * \return the requested keyboard as Json. 1173 | */ 1174 | public function buildInlineKeyBoard(array $options) 1175 | { 1176 | $replyMarkup = [ 1177 | 'inline_keyboard' => $options, 1178 | ]; 1179 | $encodedMarkup = json_encode($replyMarkup, true); 1180 | 1181 | return $encodedMarkup; 1182 | } 1183 | 1184 | /// Create an InlineKeyboardButton 1185 | 1186 | /** This object represents one button of an inline keyboard. You must use exactly one of the optional fields. 1187 | * \param $text String; Array of button rows, each represented by an Array of Strings 1188 | * \param $url String Optional. HTTP url to be opened when button is pressed 1189 | * \param $callback_data String Optional. Data to be sent in a callback query to the bot when button is pressed 1190 | * \param $switch_inline_query String Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted. 1191 | * \param $switch_inline_query_current_chat String Optional. Optional. If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted. 1192 | * \param $callback_game String Optional. Description of the game that will be launched when the user presses the button. 1193 | * \param $pay Boolean Optional. Specify True, to send a Pay button. 1194 | * \return the requested button as Array. 1195 | */ 1196 | public function buildInlineKeyboardButton( 1197 | $text, 1198 | $url = '', 1199 | $callback_data = '', 1200 | $switch_inline_query = null, 1201 | $switch_inline_query_current_chat = null, 1202 | $callback_game = '', 1203 | $pay = '' 1204 | ) { 1205 | $replyMarkup = [ 1206 | 'text' => $text, 1207 | ]; 1208 | if ($url != '') { 1209 | $replyMarkup['url'] = $url; 1210 | } elseif ($callback_data != '') { 1211 | $replyMarkup['callback_data'] = $callback_data; 1212 | } elseif (!is_null($switch_inline_query)) { 1213 | $replyMarkup['switch_inline_query'] = $switch_inline_query; 1214 | } elseif (!is_null($switch_inline_query_current_chat)) { 1215 | $replyMarkup['switch_inline_query_current_chat'] = $switch_inline_query_current_chat; 1216 | } elseif ($callback_game != '') { 1217 | $replyMarkup['callback_game'] = $callback_game; 1218 | } elseif ($pay != '') { 1219 | $replyMarkup['pay'] = $pay; 1220 | } 1221 | 1222 | return $replyMarkup; 1223 | } 1224 | 1225 | /// Create a KeyboardButton 1226 | 1227 | /** This object represents one button of an inline keyboard. You must use exactly one of the optional fields. 1228 | * \param $text String; Array of button rows, each represented by an Array of Strings 1229 | * \param $request_contact Boolean Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only 1230 | * \param $request_location Boolean Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only 1231 | * \return the requested button as Array. 1232 | */ 1233 | public function buildKeyboardButton($text, $request_contact = false, $request_location = false) 1234 | { 1235 | $replyMarkup = [ 1236 | 'text' => $text, 1237 | 'request_contact' => $request_contact, 1238 | 'request_location' => $request_location, 1239 | ]; 1240 | 1241 | return $replyMarkup; 1242 | } 1243 | 1244 | /// Hide a custom keyboard 1245 | 1246 | /** Upon receiving a message with this object, Telegram clients will hide the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button. 1247 | * \param $selective Boolean Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. 1248 | * \return the requested keyboard hide as Array. 1249 | */ 1250 | public function buildKeyBoardHide($selective = true) 1251 | { 1252 | $replyMarkup = [ 1253 | 'remove_keyboard' => true, 1254 | 'selective' => $selective, 1255 | ]; 1256 | $encodedMarkup = json_encode($replyMarkup, true); 1257 | 1258 | return $encodedMarkup; 1259 | } 1260 | 1261 | /// Display a reply interface to the user 1262 | /* Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot‘s message and tapped ’Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. 1263 | * \param $selective Boolean Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. 1264 | * \return the requested force reply as Array 1265 | */ 1266 | public function buildForceReply($selective = true) 1267 | { 1268 | $replyMarkup = [ 1269 | 'force_reply' => true, 1270 | 'selective' => $selective, 1271 | ]; 1272 | $encodedMarkup = json_encode($replyMarkup, true); 1273 | 1274 | return $encodedMarkup; 1275 | } 1276 | 1277 | // Payments 1278 | /// Send an invoice 1279 | 1280 | /** 1281 | * See sendInvoice for the input values 1282 | * \param $content the request parameters as array 1283 | * \return the JSON Telegram's reply. 1284 | */ 1285 | public function sendInvoice(array $content) 1286 | { 1287 | return $this->endpoint('sendInvoice', $content); 1288 | } 1289 | 1290 | /// Answer a shipping query 1291 | 1292 | /** 1293 | * See answerShippingQuery for the input values 1294 | * \param $content the request parameters as array 1295 | * \return the JSON Telegram's reply. 1296 | */ 1297 | public function answerShippingQuery(array $content) 1298 | { 1299 | return $this->endpoint('answerShippingQuery', $content); 1300 | } 1301 | 1302 | /// Answer a PreCheckout query 1303 | 1304 | /** 1305 | * See answerPreCheckoutQuery for the input values 1306 | * \param $content the request parameters as array 1307 | * \return the JSON Telegram's reply. 1308 | */ 1309 | public function answerPreCheckoutQuery(array $content) 1310 | { 1311 | return $this->endpoint('answerPreCheckoutQuery', $content); 1312 | } 1313 | 1314 | /// Set Passport data errors 1315 | 1316 | /** 1317 | * See setPassportDataErrors for the input values 1318 | * \param $content the request parameters as array 1319 | * \return the JSON Telegram's reply. 1320 | */ 1321 | public function setPassportDataErrors(array $content) 1322 | { 1323 | return $this->endpoint('setPassportDataErrors', $content); 1324 | } 1325 | 1326 | /// Send a Game 1327 | 1328 | /** 1329 | * See sendGame for the input values 1330 | * \param $content the request parameters as array 1331 | * \return the JSON Telegram's reply. 1332 | */ 1333 | public function sendGame(array $content) 1334 | { 1335 | return $this->endpoint('sendGame', $content); 1336 | } 1337 | 1338 | /// Send a video note 1339 | 1340 | /** 1341 | * See sendVideoNote for the input values 1342 | * \param $content the request parameters as array 1343 | * \return the JSON Telegram's reply. 1344 | */ 1345 | public function sendVideoNote(array $content) 1346 | { 1347 | return $this->endpoint('sendVideoNote', $content); 1348 | } 1349 | 1350 | /// Restrict Chat Member 1351 | 1352 | /** 1353 | * See restrictChatMember for the input values 1354 | * \param $content the request parameters as array 1355 | * \return the JSON Telegram's reply. 1356 | */ 1357 | public function restrictChatMember(array $content) 1358 | { 1359 | return $this->endpoint('restrictChatMember', $content); 1360 | } 1361 | 1362 | /// Promote Chat Member 1363 | 1364 | /** 1365 | * See promoteChatMember for the input values 1366 | * \param $content the request parameters as array 1367 | * \return the JSON Telegram's reply. 1368 | */ 1369 | public function promoteChatMember(array $content) 1370 | { 1371 | return $this->endpoint('promoteChatMember', $content); 1372 | } 1373 | 1374 | /// Set chat Administrator custom title 1375 | 1376 | /** 1377 | * See setChatAdministratorCustomTitle for the input values 1378 | * \param $content the request parameters as array 1379 | * \return the JSON Telegram's reply. 1380 | */ 1381 | public function setChatAdministratorCustomTitle(array $content) 1382 | { 1383 | return $this->endpoint('setChatAdministratorCustomTitle', $content); 1384 | } 1385 | 1386 | /// Ban a channel chat in a super group or channel 1387 | 1388 | /** 1389 | * See banChatSenderChat for the input values 1390 | * \param $content the request parameters as array 1391 | * \return the JSON Telegram's reply. 1392 | */ 1393 | public function banChatSenderChat(array $content) 1394 | { 1395 | return $this->endpoint('banChatSenderChat', $content); 1396 | } 1397 | 1398 | /// Unban a channel chat in a super group or channel 1399 | 1400 | /** 1401 | * See unbanChatSenderChat for the input values 1402 | * \param $content the request parameters as array 1403 | * \return the JSON Telegram's reply. 1404 | */ 1405 | public function unbanChatSenderChat(array $content) 1406 | { 1407 | return $this->endpoint('unbanChatSenderChat', $content); 1408 | } 1409 | 1410 | /// Set default chat permission for all members 1411 | 1412 | /** 1413 | * See setChatPermissions for the input values 1414 | * \param $content the request parameters as array 1415 | * \return the JSON Telegram's reply. 1416 | */ 1417 | public function setChatPermissions(array $content) 1418 | { 1419 | return $this->endpoint('setChatPermissions', $content); 1420 | } 1421 | 1422 | //// Export Chat Invite Link 1423 | 1424 | /** 1425 | * See exportChatInviteLink for the input values 1426 | * \param $content the request parameters as array 1427 | * \return the JSON Telegram's reply. 1428 | */ 1429 | public function exportChatInviteLink(array $content) 1430 | { 1431 | return $this->endpoint('exportChatInviteLink', $content); 1432 | } 1433 | 1434 | //// Create Chat Invite Link 1435 | 1436 | /** 1437 | * See createChatInviteLink for the input values 1438 | * \param $content the request parameters as array 1439 | * \return the JSON Telegram's reply. 1440 | */ 1441 | public function createChatInviteLink(array $content) 1442 | { 1443 | return $this->endpoint('createChatInviteLink', $content); 1444 | } 1445 | 1446 | //// Edit Chat Invite Link 1447 | 1448 | /** 1449 | * See editChatInviteLink for the input values 1450 | * \param $content the request parameters as array 1451 | * \return the JSON Telegram's reply. 1452 | */ 1453 | public function editChatInviteLink(array $content) 1454 | { 1455 | return $this->endpoint('editChatInviteLink', $content); 1456 | } 1457 | 1458 | //// Revoke Chat Invite Link 1459 | 1460 | /** 1461 | * See revokeChatInviteLink for the input values 1462 | * \param $content the request parameters as array 1463 | * \return the JSON Telegram's reply. 1464 | */ 1465 | public function revokeChatInviteLink(array $content) 1466 | { 1467 | return $this->endpoint('revokeChatInviteLink', $content); 1468 | } 1469 | 1470 | //// Approve chat join request 1471 | 1472 | /** 1473 | * See approveChatJoinRequest for the input values 1474 | * \param $content the request parameters as array 1475 | * \return the JSON Telegram's reply. 1476 | */ 1477 | public function approveChatJoinRequest(array $content) 1478 | { 1479 | return $this->endpoint('approveChatJoinRequest', $content); 1480 | } 1481 | 1482 | //// Decline chat join request 1483 | 1484 | /** 1485 | * See declineChatJoinRequest for the input values 1486 | * \param $content the request parameters as array 1487 | * \return the JSON Telegram's reply. 1488 | */ 1489 | public function declineChatJoinRequest(array $content) 1490 | { 1491 | return $this->endpoint('declineChatJoinRequest', $content); 1492 | } 1493 | 1494 | /// Set Chat Photo 1495 | 1496 | /** 1497 | * See setChatPhoto for the input values 1498 | * \param $content the request parameters as array 1499 | * \return the JSON Telegram's reply. 1500 | */ 1501 | public function setChatPhoto(array $content) 1502 | { 1503 | return $this->endpoint('setChatPhoto', $content); 1504 | } 1505 | 1506 | /// Delete Chat Photo 1507 | 1508 | /** 1509 | * See deleteChatPhoto for the input values 1510 | * \param $content the request parameters as array 1511 | * \return the JSON Telegram's reply. 1512 | */ 1513 | public function deleteChatPhoto(array $content) 1514 | { 1515 | return $this->endpoint('deleteChatPhoto', $content); 1516 | } 1517 | 1518 | /// Set Chat Title 1519 | 1520 | /** 1521 | * See setChatTitle for the input values 1522 | * \param $content the request parameters as array 1523 | * \return the JSON Telegram's reply. 1524 | */ 1525 | public function setChatTitle(array $content) 1526 | { 1527 | return $this->endpoint('setChatTitle', $content); 1528 | } 1529 | 1530 | /// Set Chat Description 1531 | 1532 | /** 1533 | * See setChatDescription for the input values 1534 | * \param $content the request parameters as array 1535 | * \return the JSON Telegram's reply. 1536 | */ 1537 | public function setChatDescription(array $content) 1538 | { 1539 | return $this->endpoint('setChatDescription', $content); 1540 | } 1541 | 1542 | /// Pin Chat Message 1543 | 1544 | /** 1545 | * See pinChatMessage for the input values 1546 | * \param $content the request parameters as array 1547 | * \return the JSON Telegram's reply. 1548 | */ 1549 | public function pinChatMessage(array $content) 1550 | { 1551 | return $this->endpoint('pinChatMessage', $content); 1552 | } 1553 | 1554 | /// Unpin Chat Message 1555 | 1556 | /** 1557 | * See unpinChatMessage for the input values 1558 | * \param $content the request parameters as array 1559 | * \return the JSON Telegram's reply. 1560 | */ 1561 | public function unpinChatMessage(array $content) 1562 | { 1563 | return $this->endpoint('unpinChatMessage', $content); 1564 | } 1565 | 1566 | /// Unpin All Chat Messages 1567 | 1568 | /** 1569 | * See unpinAllChatMessages for the input values 1570 | * \param $content the request parameters as array 1571 | * \return the JSON Telegram's reply. 1572 | */ 1573 | public function unpinAllChatMessages(array $content) 1574 | { 1575 | return $this->endpoint('unpinAllChatMessages', $content); 1576 | } 1577 | 1578 | /// Get Sticker Set 1579 | 1580 | /** 1581 | * See getStickerSet for the input values 1582 | * \param $content the request parameters as array 1583 | * \return the JSON Telegram's reply. 1584 | */ 1585 | public function getStickerSet(array $content) 1586 | { 1587 | return $this->endpoint('getStickerSet', $content); 1588 | } 1589 | 1590 | /// Upload Sticker File 1591 | 1592 | /** 1593 | * See uploadStickerFile for the input values 1594 | * \param $content the request parameters as array 1595 | * \return the JSON Telegram's reply. 1596 | */ 1597 | public function uploadStickerFile(array $content) 1598 | { 1599 | return $this->endpoint('uploadStickerFile', $content); 1600 | } 1601 | 1602 | /// Create New Sticker Set 1603 | 1604 | /** 1605 | * See createNewStickerSet for the input values 1606 | * \param $content the request parameters as array 1607 | * \return the JSON Telegram's reply. 1608 | */ 1609 | public function createNewStickerSet(array $content) 1610 | { 1611 | return $this->endpoint('createNewStickerSet', $content); 1612 | } 1613 | 1614 | /// Add Sticker To Set 1615 | 1616 | /** 1617 | * See addStickerToSet for the input values 1618 | * \param $content the request parameters as array 1619 | * \return the JSON Telegram's reply. 1620 | */ 1621 | public function addStickerToSet(array $content) 1622 | { 1623 | return $this->endpoint('addStickerToSet', $content); 1624 | } 1625 | 1626 | /// Set Sticker Position In Set 1627 | 1628 | /** 1629 | * See setStickerPositionInSet for the input values 1630 | * \param $content the request parameters as array 1631 | * \return the JSON Telegram's reply. 1632 | */ 1633 | public function setStickerPositionInSet(array $content) 1634 | { 1635 | return $this->endpoint('setStickerPositionInSet', $content); 1636 | } 1637 | 1638 | /// Delete Sticker From Set 1639 | 1640 | /** 1641 | * See deleteStickerFromSet for the input values 1642 | * \param $content the request parameters as array 1643 | * \return the JSON Telegram's reply. 1644 | */ 1645 | public function deleteStickerFromSet(array $content) 1646 | { 1647 | return $this->endpoint('deleteStickerFromSet', $content); 1648 | } 1649 | 1650 | /// Set Sticker Thumb From Set 1651 | 1652 | /** 1653 | * See setStickerSetThumb for the input values 1654 | * \param $content the request parameters as array 1655 | * \return the JSON Telegram's reply. 1656 | */ 1657 | public function setStickerSetThumb(array $content) 1658 | { 1659 | return $this->endpoint('setStickerSetThumb', $content); 1660 | } 1661 | 1662 | /// Delete a message 1663 | 1664 | /** 1665 | * See deleteMessage for the input values 1666 | * \param $content the request parameters as array 1667 | * \return the JSON Telegram's reply. 1668 | */ 1669 | public function deleteMessage(array $content) 1670 | { 1671 | return $this->endpoint('deleteMessage', $content); 1672 | } 1673 | 1674 | /// Receive incoming messages using polling 1675 | 1676 | /** Use this method to receive incoming updates using long polling. 1677 | * \param $offset Integer Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. 1678 | * \param $limit Integer Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100 1679 | * \param $timeout Integer Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling 1680 | * \param $update Boolean If true updates the pending message list to the last update received. Default to true. 1681 | * \return the updates as Array. 1682 | */ 1683 | public function getUpdates($offset = 0, $limit = 100, $timeout = 0, $update = true) 1684 | { 1685 | $content = ['offset' => $offset, 'limit' => $limit, 'timeout' => $timeout]; 1686 | $this->updates = $this->endpoint('getUpdates', $content); 1687 | if ($update) { 1688 | if (array_key_exists('result', $this->updates) && is_array($this->updates['result']) && count($this->updates['result']) >= 1) { //for CLI working. 1689 | $last_element_id = $this->updates['result'][count($this->updates['result']) - 1]['update_id'] + 1; 1690 | $content = ['offset' => $last_element_id, 'limit' => '1', 'timeout' => $timeout]; 1691 | $this->endpoint('getUpdates', $content); 1692 | } 1693 | } 1694 | 1695 | return $this->updates; 1696 | } 1697 | 1698 | /// Serve an update 1699 | 1700 | /** Use this method to use the bultin function like Text() or Username() on a specific update. 1701 | * \param $update Integer The index of the update in the updates array. 1702 | */ 1703 | public function serveUpdate($update) 1704 | { 1705 | $this->data = $this->updates['result'][$update]; 1706 | } 1707 | 1708 | /// Return current update type 1709 | 1710 | /** 1711 | * Return current update type `False` on failure. 1712 | * 1713 | * @return bool|string 1714 | */ 1715 | public function getUpdateType() 1716 | { 1717 | if ($this->update_type) { 1718 | return $this->update_type; 1719 | } 1720 | 1721 | $update = $this->data; 1722 | if (isset($update['inline_query'])) { 1723 | $this->update_type = self::INLINE_QUERY; 1724 | 1725 | return $this->update_type; 1726 | } 1727 | if (isset($update['callback_query'])) { 1728 | $this->update_type = self::CALLBACK_QUERY; 1729 | 1730 | return $this->update_type; 1731 | } 1732 | if (isset($update['edited_message'])) { 1733 | $this->update_type = self::EDITED_MESSAGE; 1734 | 1735 | return $this->update_type; 1736 | } 1737 | if (isset($update['message']['text'])) { 1738 | $this->update_type = self::MESSAGE; 1739 | 1740 | return $this->update_type; 1741 | } 1742 | if (isset($update['message']['photo'])) { 1743 | $this->update_type = self::PHOTO; 1744 | 1745 | return $this->update_type; 1746 | } 1747 | if (isset($update['message']['video'])) { 1748 | $this->update_type = self::VIDEO; 1749 | 1750 | return $this->update_type; 1751 | } 1752 | if (isset($update['message']['audio'])) { 1753 | $this->update_type = self::AUDIO; 1754 | 1755 | return $this->update_type; 1756 | } 1757 | if (isset($update['message']['voice'])) { 1758 | $this->update_type = self::VOICE; 1759 | 1760 | return $this->update_type; 1761 | } 1762 | if (isset($update['message']['contact'])) { 1763 | $this->update_type = self::CONTACT; 1764 | 1765 | return $this->update_type; 1766 | } 1767 | if (isset($update['message']['location'])) { 1768 | $this->update_type = self::LOCATION; 1769 | 1770 | return $this->update_type; 1771 | } 1772 | if (isset($update['message']['reply_to_message'])) { 1773 | $this->update_type = self::REPLY; 1774 | 1775 | return $this->update_type; 1776 | } 1777 | if (isset($update['message']['animation'])) { 1778 | $this->update_type = self::ANIMATION; 1779 | 1780 | return $this->update_type; 1781 | } 1782 | if (isset($update['message']['sticker'])) { 1783 | $this->update_type = self::STICKER; 1784 | 1785 | return $this->update_type; 1786 | } 1787 | if (isset($update['message']['document'])) { 1788 | $this->update_type = self::DOCUMENT; 1789 | 1790 | return $this->update_type; 1791 | } 1792 | if (isset($update['message']['new_chat_member'])) { 1793 | $this->update_type = self::NEW_CHAT_MEMBER; 1794 | 1795 | return $this->update_type; 1796 | } 1797 | if (isset($update['message']['left_chat_member'])) { 1798 | $this->update_type = self::LEFT_CHAT_MEMBER; 1799 | 1800 | return $this->update_type; 1801 | } 1802 | if (isset($update['my_chat_member'])) { 1803 | $this->update_type = self::MY_CHAT_MEMBER; 1804 | 1805 | return $this->update_type; 1806 | } 1807 | if (isset($update['channel_post'])) { 1808 | $this->update_type = self::CHANNEL_POST; 1809 | 1810 | return $this->update_type; 1811 | } 1812 | 1813 | return false; 1814 | } 1815 | 1816 | private function sendAPIRequest($url, array $content, $post = true) 1817 | { 1818 | if (isset($content['chat_id'])) { 1819 | $url = $url.'?chat_id='.$content['chat_id']; 1820 | unset($content['chat_id']); 1821 | } 1822 | $ch = curl_init(); 1823 | curl_setopt($ch, CURLOPT_URL, $url); 1824 | curl_setopt($ch, CURLOPT_HEADER, false); 1825 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 1826 | if ($post) { 1827 | curl_setopt($ch, CURLOPT_POST, 1); 1828 | curl_setopt($ch, CURLOPT_POSTFIELDS, $content); 1829 | } 1830 | // echo "inside curl if"; 1831 | if (!empty($this->proxy)) { 1832 | // echo "inside proxy if"; 1833 | if (array_key_exists('type', $this->proxy)) { 1834 | curl_setopt($ch, CURLOPT_PROXYTYPE, $this->proxy['type']); 1835 | } 1836 | 1837 | if (array_key_exists('auth', $this->proxy)) { 1838 | curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->proxy['auth']); 1839 | } 1840 | 1841 | if (array_key_exists('url', $this->proxy)) { 1842 | // echo "Proxy Url"; 1843 | curl_setopt($ch, CURLOPT_PROXY, $this->proxy['url']); 1844 | } 1845 | 1846 | if (array_key_exists('port', $this->proxy)) { 1847 | // echo "Proxy port"; 1848 | curl_setopt($ch, CURLOPT_PROXYPORT, $this->proxy['port']); 1849 | } 1850 | } 1851 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 1852 | $result = curl_exec($ch); 1853 | if ($result === false) { 1854 | $result = json_encode( 1855 | ['ok' => false, 'curl_error_code' => curl_errno($ch), 'curl_error' => curl_error($ch)] 1856 | ); 1857 | } 1858 | curl_close($ch); 1859 | if ($this->log_errors) { 1860 | if (class_exists('TelegramErrorLogger')) { 1861 | $loggerArray = ($this->getData() == null) ? [$content] : [$this->getData(), $content]; 1862 | TelegramErrorLogger::log(json_decode($result, true), $loggerArray); 1863 | } 1864 | } 1865 | 1866 | return $result; 1867 | } 1868 | } 1869 | 1870 | // Helper for Uploading file using CURL 1871 | if (!function_exists('curl_file_create')) { 1872 | function curl_file_create($filename, $mimetype = '', $postname = '') 1873 | { 1874 | return "@$filename;filename=" 1875 | .($postname ?: basename($filename)) 1876 | .($mimetype ? ";type=$mimetype" : ''); 1877 | } 1878 | } 1879 | -------------------------------------------------------------------------------- /Doxyfile: -------------------------------------------------------------------------------- 1 | # Doxyfile 1.8.10 2 | 3 | # This file describes the settings to be used by the documentation system 4 | # doxygen (www.doxygen.org) for a project. 5 | # 6 | # All text after a double hash (##) is considered a comment and is placed in 7 | # front of the TAG it is preceding. 8 | # 9 | # All text after a single hash (#) is considered a comment and will be ignored. 10 | # The format is: 11 | # TAG = value [value, ...] 12 | # For lists, items can also be appended using: 13 | # TAG += value [value, ...] 14 | # Values that contain spaces should be placed between quotes (\" \"). 15 | 16 | #--------------------------------------------------------------------------- 17 | # Project related configuration options 18 | #--------------------------------------------------------------------------- 19 | 20 | # This tag specifies the encoding used for all characters in the config file 21 | # that follow. The default is UTF-8 which is also the encoding used for all text 22 | # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv 23 | # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv 24 | # for the list of possible encodings. 25 | # The default value is: UTF-8. 26 | 27 | DOXYFILE_ENCODING = UTF-8 28 | 29 | # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by 30 | # double-quotes, unless you are using Doxywizard) that should identify the 31 | # project for which the documentation is generated. This name is used in the 32 | # title of most generated pages and in a few other places. 33 | # The default value is: My Project. 34 | 35 | PROJECT_NAME = TelegramBotPHP 36 | 37 | # The PROJECT_NUMBER tag can be used to enter a project or revision number. This 38 | # could be handy for archiving the generated documentation or if some version 39 | # control system is used. 40 | 41 | PROJECT_NUMBER = 42 | 43 | # Using the PROJECT_BRIEF tag one can provide an optional one line description 44 | # for a project that appears at the top of each page and should give viewer a 45 | # quick idea about the purpose of the project. Keep the description short. 46 | 47 | PROJECT_BRIEF = "A very simple PHP Telegram Bot API for sending messages" 48 | 49 | # With the PROJECT_LOGO tag one can specify a logo or an icon that is included 50 | # in the documentation. The maximum height of the logo should not exceed 55 51 | # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy 52 | # the logo to the output directory. 53 | 54 | PROJECT_LOGO = 55 | 56 | # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path 57 | # into which the generated documentation will be written. If a relative path is 58 | # entered, it will be relative to the location where doxygen was started. If 59 | # left blank the current directory will be used. 60 | 61 | OUTPUT_DIRECTORY = 62 | 63 | # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- 64 | # directories (in 2 levels) under the output directory of each output format and 65 | # will distribute the generated files over these directories. Enabling this 66 | # option can be useful when feeding doxygen a huge amount of source files, where 67 | # putting all generated files in the same directory would otherwise causes 68 | # performance problems for the file system. 69 | # The default value is: NO. 70 | 71 | CREATE_SUBDIRS = NO 72 | 73 | # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII 74 | # characters to appear in the names of generated files. If set to NO, non-ASCII 75 | # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode 76 | # U+3044. 77 | # The default value is: NO. 78 | 79 | ALLOW_UNICODE_NAMES = NO 80 | 81 | # The OUTPUT_LANGUAGE tag is used to specify the language in which all 82 | # documentation generated by doxygen is written. Doxygen will use this 83 | # information to generate all constant output in the proper language. 84 | # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, 85 | # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), 86 | # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, 87 | # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), 88 | # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, 89 | # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, 90 | # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, 91 | # Ukrainian and Vietnamese. 92 | # The default value is: English. 93 | 94 | OUTPUT_LANGUAGE = English 95 | 96 | # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member 97 | # descriptions after the members that are listed in the file and class 98 | # documentation (similar to Javadoc). Set to NO to disable this. 99 | # The default value is: YES. 100 | 101 | BRIEF_MEMBER_DESC = YES 102 | 103 | # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief 104 | # description of a member or function before the detailed description 105 | # 106 | # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 107 | # brief descriptions will be completely suppressed. 108 | # The default value is: YES. 109 | 110 | REPEAT_BRIEF = YES 111 | 112 | # This tag implements a quasi-intelligent brief description abbreviator that is 113 | # used to form the text in various listings. Each string in this list, if found 114 | # as the leading text of the brief description, will be stripped from the text 115 | # and the result, after processing the whole list, is used as the annotated 116 | # text. Otherwise, the brief description is used as-is. If left blank, the 117 | # following values are used ($name is automatically replaced with the name of 118 | # the entity):The $name class, The $name widget, The $name file, is, provides, 119 | # specifies, contains, represents, a, an and the. 120 | 121 | ABBREVIATE_BRIEF = "The $name class" \ 122 | "The $name widget" \ 123 | "The $name file" \ 124 | is \ 125 | provides \ 126 | specifies \ 127 | contains \ 128 | represents \ 129 | a \ 130 | an \ 131 | the 132 | 133 | # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 134 | # doxygen will generate a detailed section even if there is only a brief 135 | # description. 136 | # The default value is: NO. 137 | 138 | ALWAYS_DETAILED_SEC = NO 139 | 140 | # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 141 | # inherited members of a class in the documentation of that class as if those 142 | # members were ordinary class members. Constructors, destructors and assignment 143 | # operators of the base classes will not be shown. 144 | # The default value is: NO. 145 | 146 | INLINE_INHERITED_MEMB = NO 147 | 148 | # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path 149 | # before files name in the file list and in the header files. If set to NO the 150 | # shortest path that makes the file name unique will be used 151 | # The default value is: YES. 152 | 153 | FULL_PATH_NAMES = YES 154 | 155 | # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. 156 | # Stripping is only done if one of the specified strings matches the left-hand 157 | # part of the path. The tag can be used to show relative paths in the file list. 158 | # If left blank the directory from which doxygen is run is used as the path to 159 | # strip. 160 | # 161 | # Note that you can specify absolute paths here, but also relative paths, which 162 | # will be relative from the directory where doxygen is started. 163 | # This tag requires that the tag FULL_PATH_NAMES is set to YES. 164 | 165 | STRIP_FROM_PATH = 166 | 167 | # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the 168 | # path mentioned in the documentation of a class, which tells the reader which 169 | # header file to include in order to use a class. If left blank only the name of 170 | # the header file containing the class definition is used. Otherwise one should 171 | # specify the list of include paths that are normally passed to the compiler 172 | # using the -I flag. 173 | 174 | STRIP_FROM_INC_PATH = 175 | 176 | # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but 177 | # less readable) file names. This can be useful is your file systems doesn't 178 | # support long names like on DOS, Mac, or CD-ROM. 179 | # The default value is: NO. 180 | 181 | SHORT_NAMES = NO 182 | 183 | # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the 184 | # first line (until the first dot) of a Javadoc-style comment as the brief 185 | # description. If set to NO, the Javadoc-style will behave just like regular Qt- 186 | # style comments (thus requiring an explicit @brief command for a brief 187 | # description.) 188 | # The default value is: NO. 189 | 190 | JAVADOC_AUTOBRIEF = NO 191 | 192 | # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first 193 | # line (until the first dot) of a Qt-style comment as the brief description. If 194 | # set to NO, the Qt-style will behave just like regular Qt-style comments (thus 195 | # requiring an explicit \brief command for a brief description.) 196 | # The default value is: NO. 197 | 198 | QT_AUTOBRIEF = NO 199 | 200 | # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a 201 | # multi-line C++ special comment block (i.e. a block of //! or /// comments) as 202 | # a brief description. This used to be the default behavior. The new default is 203 | # to treat a multi-line C++ comment block as a detailed description. Set this 204 | # tag to YES if you prefer the old behavior instead. 205 | # 206 | # Note that setting this tag to YES also means that rational rose comments are 207 | # not recognized any more. 208 | # The default value is: NO. 209 | 210 | MULTILINE_CPP_IS_BRIEF = NO 211 | 212 | # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the 213 | # documentation from any documented member that it re-implements. 214 | # The default value is: YES. 215 | 216 | INHERIT_DOCS = YES 217 | 218 | # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new 219 | # page for each member. If set to NO, the documentation of a member will be part 220 | # of the file/class/namespace that contains it. 221 | # The default value is: NO. 222 | 223 | SEPARATE_MEMBER_PAGES = NO 224 | 225 | # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen 226 | # uses this value to replace tabs by spaces in code fragments. 227 | # Minimum value: 1, maximum value: 16, default value: 4. 228 | 229 | TAB_SIZE = 4 230 | 231 | # This tag can be used to specify a number of aliases that act as commands in 232 | # the documentation. An alias has the form: 233 | # name=value 234 | # For example adding 235 | # "sideeffect=@par Side Effects:\n" 236 | # will allow you to put the command \sideeffect (or @sideeffect) in the 237 | # documentation, which will result in a user-defined paragraph with heading 238 | # "Side Effects:". You can put \n's in the value part of an alias to insert 239 | # newlines. 240 | 241 | ALIASES = 242 | 243 | # This tag can be used to specify a number of word-keyword mappings (TCL only). 244 | # A mapping has the form "name=value". For example adding "class=itcl::class" 245 | # will allow you to use the command class in the itcl::class meaning. 246 | 247 | TCL_SUBST = 248 | 249 | # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 250 | # only. Doxygen will then generate output that is more tailored for C. For 251 | # instance, some of the names that are used will be different. The list of all 252 | # members will be omitted, etc. 253 | # The default value is: NO. 254 | 255 | OPTIMIZE_OUTPUT_FOR_C = YES 256 | 257 | # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or 258 | # Python sources only. Doxygen will then generate output that is more tailored 259 | # for that language. For instance, namespaces will be presented as packages, 260 | # qualified scopes will look different, etc. 261 | # The default value is: NO. 262 | 263 | OPTIMIZE_OUTPUT_JAVA = NO 264 | 265 | # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 266 | # sources. Doxygen will then generate output that is tailored for Fortran. 267 | # The default value is: NO. 268 | 269 | OPTIMIZE_FOR_FORTRAN = NO 270 | 271 | # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 272 | # sources. Doxygen will then generate output that is tailored for VHDL. 273 | # The default value is: NO. 274 | 275 | OPTIMIZE_OUTPUT_VHDL = NO 276 | 277 | # Doxygen selects the parser to use depending on the extension of the files it 278 | # parses. With this tag you can assign which parser to use for a given 279 | # extension. Doxygen has a built-in mapping, but you can override or extend it 280 | # using this tag. The format is ext=language, where ext is a file extension, and 281 | # language is one of the parsers supported by doxygen: IDL, Java, Javascript, 282 | # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: 283 | # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: 284 | # Fortran. In the later case the parser tries to guess whether the code is fixed 285 | # or free formatted code, this is the default for Fortran type files), VHDL. For 286 | # instance to make doxygen treat .inc files as Fortran files (default is PHP), 287 | # and .f files as C (default is Fortran), use: inc=Fortran f=C. 288 | # 289 | # Note: For files without extension you can use no_extension as a placeholder. 290 | # 291 | # Note that for custom extensions you also need to set FILE_PATTERNS otherwise 292 | # the files are not read by doxygen. 293 | 294 | EXTENSION_MAPPING = 295 | 296 | # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments 297 | # according to the Markdown format, which allows for more readable 298 | # documentation. See http://daringfireball.net/projects/markdown/ for details. 299 | # The output of markdown processing is further processed by doxygen, so you can 300 | # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in 301 | # case of backward compatibilities issues. 302 | # The default value is: YES. 303 | 304 | MARKDOWN_SUPPORT = YES 305 | 306 | # When enabled doxygen tries to link words that correspond to documented 307 | # classes, or namespaces to their corresponding documentation. Such a link can 308 | # be prevented in individual cases by putting a % sign in front of the word or 309 | # globally by setting AUTOLINK_SUPPORT to NO. 310 | # The default value is: YES. 311 | 312 | AUTOLINK_SUPPORT = YES 313 | 314 | # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 315 | # to include (a tag file for) the STL sources as input, then you should set this 316 | # tag to YES in order to let doxygen match functions declarations and 317 | # definitions whose arguments contain STL classes (e.g. func(std::string); 318 | # versus func(std::string) {}). This also make the inheritance and collaboration 319 | # diagrams that involve STL classes more complete and accurate. 320 | # The default value is: NO. 321 | 322 | BUILTIN_STL_SUPPORT = NO 323 | 324 | # If you use Microsoft's C++/CLI language, you should set this option to YES to 325 | # enable parsing support. 326 | # The default value is: NO. 327 | 328 | CPP_CLI_SUPPORT = NO 329 | 330 | # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: 331 | # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen 332 | # will parse them like normal C++ but will assume all classes use public instead 333 | # of private inheritance when no explicit protection keyword is present. 334 | # The default value is: NO. 335 | 336 | SIP_SUPPORT = NO 337 | 338 | # For Microsoft's IDL there are propget and propput attributes to indicate 339 | # getter and setter methods for a property. Setting this option to YES will make 340 | # doxygen to replace the get and set methods by a property in the documentation. 341 | # This will only work if the methods are indeed getting or setting a simple 342 | # type. If this is not the case, or you want to show the methods anyway, you 343 | # should set this option to NO. 344 | # The default value is: YES. 345 | 346 | IDL_PROPERTY_SUPPORT = YES 347 | 348 | # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 349 | # tag is set to YES then doxygen will reuse the documentation of the first 350 | # member in the group (if any) for the other members of the group. By default 351 | # all members of a group must be documented explicitly. 352 | # The default value is: NO. 353 | 354 | DISTRIBUTE_GROUP_DOC = NO 355 | 356 | # If one adds a struct or class to a group and this option is enabled, then also 357 | # any nested class or struct is added to the same group. By default this option 358 | # is disabled and one has to add nested compounds explicitly via \ingroup. 359 | # The default value is: NO. 360 | 361 | GROUP_NESTED_COMPOUNDS = NO 362 | 363 | # Set the SUBGROUPING tag to YES to allow class member groups of the same type 364 | # (for instance a group of public functions) to be put as a subgroup of that 365 | # type (e.g. under the Public Functions section). Set it to NO to prevent 366 | # subgrouping. Alternatively, this can be done per class using the 367 | # \nosubgrouping command. 368 | # The default value is: YES. 369 | 370 | SUBGROUPING = YES 371 | 372 | # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions 373 | # are shown inside the group in which they are included (e.g. using \ingroup) 374 | # instead of on a separate page (for HTML and Man pages) or section (for LaTeX 375 | # and RTF). 376 | # 377 | # Note that this feature does not work in combination with 378 | # SEPARATE_MEMBER_PAGES. 379 | # The default value is: NO. 380 | 381 | INLINE_GROUPED_CLASSES = NO 382 | 383 | # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions 384 | # with only public data fields or simple typedef fields will be shown inline in 385 | # the documentation of the scope in which they are defined (i.e. file, 386 | # namespace, or group documentation), provided this scope is documented. If set 387 | # to NO, structs, classes, and unions are shown on a separate page (for HTML and 388 | # Man pages) or section (for LaTeX and RTF). 389 | # The default value is: NO. 390 | 391 | INLINE_SIMPLE_STRUCTS = NO 392 | 393 | # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or 394 | # enum is documented as struct, union, or enum with the name of the typedef. So 395 | # typedef struct TypeS {} TypeT, will appear in the documentation as a struct 396 | # with name TypeT. When disabled the typedef will appear as a member of a file, 397 | # namespace, or class. And the struct will be named TypeS. This can typically be 398 | # useful for C code in case the coding convention dictates that all compound 399 | # types are typedef'ed and only the typedef is referenced, never the tag name. 400 | # The default value is: NO. 401 | 402 | TYPEDEF_HIDES_STRUCT = NO 403 | 404 | # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This 405 | # cache is used to resolve symbols given their name and scope. Since this can be 406 | # an expensive process and often the same symbol appears multiple times in the 407 | # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small 408 | # doxygen will become slower. If the cache is too large, memory is wasted. The 409 | # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range 410 | # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 411 | # symbols. At the end of a run doxygen will report the cache usage and suggest 412 | # the optimal cache size from a speed point of view. 413 | # Minimum value: 0, maximum value: 9, default value: 0. 414 | 415 | LOOKUP_CACHE_SIZE = 0 416 | 417 | #--------------------------------------------------------------------------- 418 | # Build related configuration options 419 | #--------------------------------------------------------------------------- 420 | 421 | # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in 422 | # documentation are documented, even if no documentation was available. Private 423 | # class members and static file members will be hidden unless the 424 | # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. 425 | # Note: This will also disable the warnings about undocumented members that are 426 | # normally produced when WARNINGS is set to YES. 427 | # The default value is: NO. 428 | 429 | EXTRACT_ALL = NO 430 | 431 | # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will 432 | # be included in the documentation. 433 | # The default value is: NO. 434 | 435 | EXTRACT_PRIVATE = NO 436 | 437 | # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal 438 | # scope will be included in the documentation. 439 | # The default value is: NO. 440 | 441 | EXTRACT_PACKAGE = NO 442 | 443 | # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be 444 | # included in the documentation. 445 | # The default value is: NO. 446 | 447 | EXTRACT_STATIC = NO 448 | 449 | # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined 450 | # locally in source files will be included in the documentation. If set to NO, 451 | # only classes defined in header files are included. Does not have any effect 452 | # for Java sources. 453 | # The default value is: YES. 454 | 455 | EXTRACT_LOCAL_CLASSES = YES 456 | 457 | # This flag is only useful for Objective-C code. If set to YES, local methods, 458 | # which are defined in the implementation section but not in the interface are 459 | # included in the documentation. If set to NO, only methods in the interface are 460 | # included. 461 | # The default value is: NO. 462 | 463 | EXTRACT_LOCAL_METHODS = NO 464 | 465 | # If this flag is set to YES, the members of anonymous namespaces will be 466 | # extracted and appear in the documentation as a namespace called 467 | # 'anonymous_namespace{file}', where file will be replaced with the base name of 468 | # the file that contains the anonymous namespace. By default anonymous namespace 469 | # are hidden. 470 | # The default value is: NO. 471 | 472 | EXTRACT_ANON_NSPACES = NO 473 | 474 | # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all 475 | # undocumented members inside documented classes or files. If set to NO these 476 | # members will be included in the various overviews, but no documentation 477 | # section is generated. This option has no effect if EXTRACT_ALL is enabled. 478 | # The default value is: NO. 479 | 480 | HIDE_UNDOC_MEMBERS = NO 481 | 482 | # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all 483 | # undocumented classes that are normally visible in the class hierarchy. If set 484 | # to NO, these classes will be included in the various overviews. This option 485 | # has no effect if EXTRACT_ALL is enabled. 486 | # The default value is: NO. 487 | 488 | HIDE_UNDOC_CLASSES = NO 489 | 490 | # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend 491 | # (class|struct|union) declarations. If set to NO, these declarations will be 492 | # included in the documentation. 493 | # The default value is: NO. 494 | 495 | HIDE_FRIEND_COMPOUNDS = NO 496 | 497 | # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any 498 | # documentation blocks found inside the body of a function. If set to NO, these 499 | # blocks will be appended to the function's detailed documentation block. 500 | # The default value is: NO. 501 | 502 | HIDE_IN_BODY_DOCS = NO 503 | 504 | # The INTERNAL_DOCS tag determines if documentation that is typed after a 505 | # \internal command is included. If the tag is set to NO then the documentation 506 | # will be excluded. Set it to YES to include the internal documentation. 507 | # The default value is: NO. 508 | 509 | INTERNAL_DOCS = NO 510 | 511 | # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file 512 | # names in lower-case letters. If set to YES, upper-case letters are also 513 | # allowed. This is useful if you have classes or files whose names only differ 514 | # in case and if your file system supports case sensitive file names. Windows 515 | # and Mac users are advised to set this option to NO. 516 | # The default value is: system dependent. 517 | 518 | CASE_SENSE_NAMES = NO 519 | 520 | # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with 521 | # their full class and namespace scopes in the documentation. If set to YES, the 522 | # scope will be hidden. 523 | # The default value is: NO. 524 | 525 | HIDE_SCOPE_NAMES = YES 526 | 527 | # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will 528 | # append additional text to a page's title, such as Class Reference. If set to 529 | # YES the compound reference will be hidden. 530 | # The default value is: NO. 531 | 532 | HIDE_COMPOUND_REFERENCE= NO 533 | 534 | # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of 535 | # the files that are included by a file in the documentation of that file. 536 | # The default value is: YES. 537 | 538 | SHOW_INCLUDE_FILES = YES 539 | 540 | # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each 541 | # grouped member an include statement to the documentation, telling the reader 542 | # which file to include in order to use the member. 543 | # The default value is: NO. 544 | 545 | SHOW_GROUPED_MEMB_INC = NO 546 | 547 | # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include 548 | # files with double quotes in the documentation rather than with sharp brackets. 549 | # The default value is: NO. 550 | 551 | FORCE_LOCAL_INCLUDES = NO 552 | 553 | # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the 554 | # documentation for inline members. 555 | # The default value is: YES. 556 | 557 | INLINE_INFO = YES 558 | 559 | # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the 560 | # (detailed) documentation of file and class members alphabetically by member 561 | # name. If set to NO, the members will appear in declaration order. 562 | # The default value is: YES. 563 | 564 | SORT_MEMBER_DOCS = YES 565 | 566 | # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief 567 | # descriptions of file, namespace and class members alphabetically by member 568 | # name. If set to NO, the members will appear in declaration order. Note that 569 | # this will also influence the order of the classes in the class list. 570 | # The default value is: NO. 571 | 572 | SORT_BRIEF_DOCS = NO 573 | 574 | # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the 575 | # (brief and detailed) documentation of class members so that constructors and 576 | # destructors are listed first. If set to NO the constructors will appear in the 577 | # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. 578 | # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief 579 | # member documentation. 580 | # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting 581 | # detailed member documentation. 582 | # The default value is: NO. 583 | 584 | SORT_MEMBERS_CTORS_1ST = NO 585 | 586 | # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy 587 | # of group names into alphabetical order. If set to NO the group names will 588 | # appear in their defined order. 589 | # The default value is: NO. 590 | 591 | SORT_GROUP_NAMES = NO 592 | 593 | # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by 594 | # fully-qualified names, including namespaces. If set to NO, the class list will 595 | # be sorted only by class name, not including the namespace part. 596 | # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 597 | # Note: This option applies only to the class list, not to the alphabetical 598 | # list. 599 | # The default value is: NO. 600 | 601 | SORT_BY_SCOPE_NAME = NO 602 | 603 | # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper 604 | # type resolution of all parameters of a function it will reject a match between 605 | # the prototype and the implementation of a member function even if there is 606 | # only one candidate or it is obvious which candidate to choose by doing a 607 | # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still 608 | # accept a match between prototype and implementation in such cases. 609 | # The default value is: NO. 610 | 611 | STRICT_PROTO_MATCHING = NO 612 | 613 | # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo 614 | # list. This list is created by putting \todo commands in the documentation. 615 | # The default value is: YES. 616 | 617 | GENERATE_TODOLIST = YES 618 | 619 | # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test 620 | # list. This list is created by putting \test commands in the documentation. 621 | # The default value is: YES. 622 | 623 | GENERATE_TESTLIST = YES 624 | 625 | # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug 626 | # list. This list is created by putting \bug commands in the documentation. 627 | # The default value is: YES. 628 | 629 | GENERATE_BUGLIST = YES 630 | 631 | # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) 632 | # the deprecated list. This list is created by putting \deprecated commands in 633 | # the documentation. 634 | # The default value is: YES. 635 | 636 | GENERATE_DEPRECATEDLIST= YES 637 | 638 | # The ENABLED_SECTIONS tag can be used to enable conditional documentation 639 | # sections, marked by \if ... \endif and \cond 640 | # ... \endcond blocks. 641 | 642 | ENABLED_SECTIONS = 643 | 644 | # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the 645 | # initial value of a variable or macro / define can have for it to appear in the 646 | # documentation. If the initializer consists of more lines than specified here 647 | # it will be hidden. Use a value of 0 to hide initializers completely. The 648 | # appearance of the value of individual variables and macros / defines can be 649 | # controlled using \showinitializer or \hideinitializer command in the 650 | # documentation regardless of this setting. 651 | # Minimum value: 0, maximum value: 10000, default value: 30. 652 | 653 | MAX_INITIALIZER_LINES = 30 654 | 655 | # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at 656 | # the bottom of the documentation of classes and structs. If set to YES, the 657 | # list will mention the files that were used to generate the documentation. 658 | # The default value is: YES. 659 | 660 | SHOW_USED_FILES = YES 661 | 662 | # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This 663 | # will remove the Files entry from the Quick Index and from the Folder Tree View 664 | # (if specified). 665 | # The default value is: YES. 666 | 667 | SHOW_FILES = YES 668 | 669 | # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces 670 | # page. This will remove the Namespaces entry from the Quick Index and from the 671 | # Folder Tree View (if specified). 672 | # The default value is: YES. 673 | 674 | SHOW_NAMESPACES = YES 675 | 676 | # The FILE_VERSION_FILTER tag can be used to specify a program or script that 677 | # doxygen should invoke to get the current version for each file (typically from 678 | # the version control system). Doxygen will invoke the program by executing (via 679 | # popen()) the command command input-file, where command is the value of the 680 | # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided 681 | # by doxygen. Whatever the program writes to standard output is used as the file 682 | # version. For an example see the documentation. 683 | 684 | FILE_VERSION_FILTER = 685 | 686 | # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed 687 | # by doxygen. The layout file controls the global structure of the generated 688 | # output files in an output format independent way. To create the layout file 689 | # that represents doxygen's defaults, run doxygen with the -l option. You can 690 | # optionally specify a file name after the option, if omitted DoxygenLayout.xml 691 | # will be used as the name of the layout file. 692 | # 693 | # Note that if you run doxygen from a directory containing a file called 694 | # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE 695 | # tag is left empty. 696 | 697 | LAYOUT_FILE = 698 | 699 | # The CITE_BIB_FILES tag can be used to specify one or more bib files containing 700 | # the reference definitions. This must be a list of .bib files. The .bib 701 | # extension is automatically appended if omitted. This requires the bibtex tool 702 | # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. 703 | # For LaTeX the style of the bibliography can be controlled using 704 | # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the 705 | # search path. See also \cite for info how to create references. 706 | 707 | CITE_BIB_FILES = 708 | 709 | #--------------------------------------------------------------------------- 710 | # Configuration options related to warning and progress messages 711 | #--------------------------------------------------------------------------- 712 | 713 | # The QUIET tag can be used to turn on/off the messages that are generated to 714 | # standard output by doxygen. If QUIET is set to YES this implies that the 715 | # messages are off. 716 | # The default value is: NO. 717 | 718 | QUIET = NO 719 | 720 | # The WARNINGS tag can be used to turn on/off the warning messages that are 721 | # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES 722 | # this implies that the warnings are on. 723 | # 724 | # Tip: Turn warnings on while writing the documentation. 725 | # The default value is: YES. 726 | 727 | WARNINGS = YES 728 | 729 | # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate 730 | # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag 731 | # will automatically be disabled. 732 | # The default value is: YES. 733 | 734 | WARN_IF_UNDOCUMENTED = YES 735 | 736 | # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for 737 | # potential errors in the documentation, such as not documenting some parameters 738 | # in a documented function, or documenting parameters that don't exist or using 739 | # markup commands wrongly. 740 | # The default value is: YES. 741 | 742 | WARN_IF_DOC_ERROR = YES 743 | 744 | # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that 745 | # are documented, but have no documentation for their parameters or return 746 | # value. If set to NO, doxygen will only warn about wrong or incomplete 747 | # parameter documentation, but not about the absence of documentation. 748 | # The default value is: NO. 749 | 750 | WARN_NO_PARAMDOC = NO 751 | 752 | # The WARN_FORMAT tag determines the format of the warning messages that doxygen 753 | # can produce. The string should contain the $file, $line, and $text tags, which 754 | # will be replaced by the file and line number from which the warning originated 755 | # and the warning text. Optionally the format may contain $version, which will 756 | # be replaced by the version of the file (if it could be obtained via 757 | # FILE_VERSION_FILTER) 758 | # The default value is: $file:$line: $text. 759 | 760 | WARN_FORMAT = "$file:$line: $text" 761 | 762 | # The WARN_LOGFILE tag can be used to specify a file to which warning and error 763 | # messages should be written. If left blank the output is written to standard 764 | # error (stderr). 765 | 766 | WARN_LOGFILE = 767 | 768 | #--------------------------------------------------------------------------- 769 | # Configuration options related to the input files 770 | #--------------------------------------------------------------------------- 771 | 772 | # The INPUT tag is used to specify the files and/or directories that contain 773 | # documented source files. You may enter file names like myfile.cpp or 774 | # directories like /usr/src/myproject. Separate the files or directories with 775 | # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING 776 | # Note: If this tag is empty the current directory is searched. 777 | 778 | INPUT = $(TRAVIS_BUILD_DIR) 779 | 780 | # This tag can be used to specify the character encoding of the source files 781 | # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses 782 | # libiconv (or the iconv built into libc) for the transcoding. See the libiconv 783 | # documentation (see: http://www.gnu.org/software/libiconv) for the list of 784 | # possible encodings. 785 | # The default value is: UTF-8. 786 | 787 | INPUT_ENCODING = UTF-8 788 | 789 | # If the value of the INPUT tag contains directories, you can use the 790 | # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and 791 | # *.h) to filter out the source-files in the directories. 792 | # 793 | # Note that for custom extensions or not directly supported extensions you also 794 | # need to set EXTENSION_MAPPING for the extension otherwise the files are not 795 | # read by doxygen. 796 | # 797 | # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, 798 | # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, 799 | # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, 800 | # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, 801 | # *.vhdl, *.ucf, *.qsf, *.as and *.js. 802 | 803 | FILE_PATTERNS = *.c \ 804 | *.cc \ 805 | *.cxx \ 806 | *.cpp \ 807 | *.c++ \ 808 | *.java \ 809 | *.ii \ 810 | *.ixx \ 811 | *.ipp \ 812 | *.i++ \ 813 | *.inl \ 814 | *.idl \ 815 | *.ddl \ 816 | *.odl \ 817 | *.h \ 818 | *.hh \ 819 | *.hxx \ 820 | *.hpp \ 821 | *.h++ \ 822 | *.cs \ 823 | *.d \ 824 | *.php \ 825 | *.php4 \ 826 | *.php5 \ 827 | *.phtml \ 828 | *.inc \ 829 | *.m \ 830 | *.markdown \ 831 | *.md \ 832 | *.mm \ 833 | *.dox \ 834 | *.py \ 835 | *.f90 \ 836 | *.f \ 837 | *.for \ 838 | *.tcl \ 839 | *.vhd \ 840 | *.vhdl \ 841 | *.ucf \ 842 | *.qsf \ 843 | *.as \ 844 | *.js 845 | 846 | # The RECURSIVE tag can be used to specify whether or not subdirectories should 847 | # be searched for input files as well. 848 | # The default value is: NO. 849 | 850 | RECURSIVE = YES 851 | 852 | # The EXCLUDE tag can be used to specify files and/or directories that should be 853 | # excluded from the INPUT source files. This way you can easily exclude a 854 | # subdirectory from a directory tree whose root is specified with the INPUT tag. 855 | # 856 | # Note that relative paths are relative to the directory from which doxygen is 857 | # run. 858 | 859 | EXCLUDE = 860 | 861 | # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or 862 | # directories that are symbolic links (a Unix file system feature) are excluded 863 | # from the input. 864 | # The default value is: NO. 865 | 866 | EXCLUDE_SYMLINKS = NO 867 | 868 | # If the value of the INPUT tag contains directories, you can use the 869 | # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 870 | # certain files from those directories. 871 | # 872 | # Note that the wildcards are matched against the file with absolute path, so to 873 | # exclude all test directories for example use the pattern */test/* 874 | 875 | EXCLUDE_PATTERNS = 876 | 877 | # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 878 | # (namespaces, classes, functions, etc.) that should be excluded from the 879 | # output. The symbol name can be a fully qualified name, a word, or if the 880 | # wildcard * is used, a substring. Examples: ANamespace, AClass, 881 | # AClass::ANamespace, ANamespace::*Test 882 | # 883 | # Note that the wildcards are matched against the file with absolute path, so to 884 | # exclude all test directories use the pattern */test/* 885 | 886 | EXCLUDE_SYMBOLS = 887 | 888 | # The EXAMPLE_PATH tag can be used to specify one or more files or directories 889 | # that contain example code fragments that are included (see the \include 890 | # command). 891 | 892 | EXAMPLE_PATH = 893 | 894 | # If the value of the EXAMPLE_PATH tag contains directories, you can use the 895 | # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and 896 | # *.h) to filter out the source-files in the directories. If left blank all 897 | # files are included. 898 | 899 | EXAMPLE_PATTERNS = * 900 | 901 | # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 902 | # searched for input files to be used with the \include or \dontinclude commands 903 | # irrespective of the value of the RECURSIVE tag. 904 | # The default value is: NO. 905 | 906 | EXAMPLE_RECURSIVE = NO 907 | 908 | # The IMAGE_PATH tag can be used to specify one or more files or directories 909 | # that contain images that are to be included in the documentation (see the 910 | # \image command). 911 | 912 | IMAGE_PATH = 913 | 914 | # The INPUT_FILTER tag can be used to specify a program that doxygen should 915 | # invoke to filter for each input file. Doxygen will invoke the filter program 916 | # by executing (via popen()) the command: 917 | # 918 | # 919 | # 920 | # where is the value of the INPUT_FILTER tag, and is the 921 | # name of an input file. Doxygen will then use the output that the filter 922 | # program writes to standard output. If FILTER_PATTERNS is specified, this tag 923 | # will be ignored. 924 | # 925 | # Note that the filter must not add or remove lines; it is applied before the 926 | # code is scanned, but not when the output code is generated. If lines are added 927 | # or removed, the anchors will not be placed correctly. 928 | 929 | INPUT_FILTER = 930 | 931 | # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 932 | # basis. Doxygen will compare the file name with each pattern and apply the 933 | # filter if there is a match. The filters are a list of the form: pattern=filter 934 | # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how 935 | # filters are used. If the FILTER_PATTERNS tag is empty or if none of the 936 | # patterns match the file name, INPUT_FILTER is applied. 937 | 938 | FILTER_PATTERNS = 939 | 940 | # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 941 | # INPUT_FILTER) will also be used to filter the input files that are used for 942 | # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). 943 | # The default value is: NO. 944 | 945 | FILTER_SOURCE_FILES = NO 946 | 947 | # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file 948 | # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and 949 | # it is also possible to disable source filtering for a specific pattern using 950 | # *.ext= (so without naming a filter). 951 | # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. 952 | 953 | FILTER_SOURCE_PATTERNS = 954 | 955 | # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that 956 | # is part of the input, its contents will be placed on the main page 957 | # (index.html). This can be useful if you have a project on for instance GitHub 958 | # and want to reuse the introduction page also for the doxygen output. 959 | 960 | USE_MDFILE_AS_MAINPAGE = 961 | 962 | #--------------------------------------------------------------------------- 963 | # Configuration options related to source browsing 964 | #--------------------------------------------------------------------------- 965 | 966 | # If the SOURCE_BROWSER tag is set to YES then a list of source files will be 967 | # generated. Documented entities will be cross-referenced with these sources. 968 | # 969 | # Note: To get rid of all source code in the generated output, make sure that 970 | # also VERBATIM_HEADERS is set to NO. 971 | # The default value is: NO. 972 | 973 | SOURCE_BROWSER = NO 974 | 975 | # Setting the INLINE_SOURCES tag to YES will include the body of functions, 976 | # classes and enums directly into the documentation. 977 | # The default value is: NO. 978 | 979 | INLINE_SOURCES = NO 980 | 981 | # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any 982 | # special comment blocks from generated source code fragments. Normal C, C++ and 983 | # Fortran comments will always remain visible. 984 | # The default value is: YES. 985 | 986 | STRIP_CODE_COMMENTS = YES 987 | 988 | # If the REFERENCED_BY_RELATION tag is set to YES then for each documented 989 | # function all documented functions referencing it will be listed. 990 | # The default value is: NO. 991 | 992 | REFERENCED_BY_RELATION = NO 993 | 994 | # If the REFERENCES_RELATION tag is set to YES then for each documented function 995 | # all documented entities called/used by that function will be listed. 996 | # The default value is: NO. 997 | 998 | REFERENCES_RELATION = NO 999 | 1000 | # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set 1001 | # to YES then the hyperlinks from functions in REFERENCES_RELATION and 1002 | # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will 1003 | # link to the documentation. 1004 | # The default value is: YES. 1005 | 1006 | REFERENCES_LINK_SOURCE = YES 1007 | 1008 | # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the 1009 | # source code will show a tooltip with additional information such as prototype, 1010 | # brief description and links to the definition and documentation. Since this 1011 | # will make the HTML file larger and loading of large files a bit slower, you 1012 | # can opt to disable this feature. 1013 | # The default value is: YES. 1014 | # This tag requires that the tag SOURCE_BROWSER is set to YES. 1015 | 1016 | SOURCE_TOOLTIPS = YES 1017 | 1018 | # If the USE_HTAGS tag is set to YES then the references to source code will 1019 | # point to the HTML generated by the htags(1) tool instead of doxygen built-in 1020 | # source browser. The htags tool is part of GNU's global source tagging system 1021 | # (see http://www.gnu.org/software/global/global.html). You will need version 1022 | # 4.8.6 or higher. 1023 | # 1024 | # To use it do the following: 1025 | # - Install the latest version of global 1026 | # - Enable SOURCE_BROWSER and USE_HTAGS in the config file 1027 | # - Make sure the INPUT points to the root of the source tree 1028 | # - Run doxygen as normal 1029 | # 1030 | # Doxygen will invoke htags (and that will in turn invoke gtags), so these 1031 | # tools must be available from the command line (i.e. in the search path). 1032 | # 1033 | # The result: instead of the source browser generated by doxygen, the links to 1034 | # source code will now point to the output of htags. 1035 | # The default value is: NO. 1036 | # This tag requires that the tag SOURCE_BROWSER is set to YES. 1037 | 1038 | USE_HTAGS = NO 1039 | 1040 | # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a 1041 | # verbatim copy of the header file for each class for which an include is 1042 | # specified. Set to NO to disable this. 1043 | # See also: Section \class. 1044 | # The default value is: YES. 1045 | 1046 | VERBATIM_HEADERS = YES 1047 | 1048 | # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the 1049 | # clang parser (see: http://clang.llvm.org/) for more accurate parsing at the 1050 | # cost of reduced performance. This can be particularly helpful with template 1051 | # rich C++ code for which doxygen's built-in parser lacks the necessary type 1052 | # information. 1053 | # Note: The availability of this option depends on whether or not doxygen was 1054 | # compiled with the --with-libclang option. 1055 | # The default value is: NO. 1056 | 1057 | CLANG_ASSISTED_PARSING = NO 1058 | 1059 | # If clang assisted parsing is enabled you can provide the compiler with command 1060 | # line options that you would normally use when invoking the compiler. Note that 1061 | # the include paths will already be set by doxygen for the files and directories 1062 | # specified with INPUT and INCLUDE_PATH. 1063 | # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. 1064 | 1065 | CLANG_OPTIONS = 1066 | 1067 | #--------------------------------------------------------------------------- 1068 | # Configuration options related to the alphabetical class index 1069 | #--------------------------------------------------------------------------- 1070 | 1071 | # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all 1072 | # compounds will be generated. Enable this if the project contains a lot of 1073 | # classes, structs, unions or interfaces. 1074 | # The default value is: YES. 1075 | 1076 | ALPHABETICAL_INDEX = YES 1077 | 1078 | # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in 1079 | # which the alphabetical index list will be split. 1080 | # Minimum value: 1, maximum value: 20, default value: 5. 1081 | # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. 1082 | 1083 | COLS_IN_ALPHA_INDEX = 5 1084 | 1085 | # In case all classes in a project start with a common prefix, all classes will 1086 | # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag 1087 | # can be used to specify a prefix (or a list of prefixes) that should be ignored 1088 | # while generating the index headers. 1089 | # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. 1090 | 1091 | IGNORE_PREFIX = 1092 | 1093 | #--------------------------------------------------------------------------- 1094 | # Configuration options related to the HTML output 1095 | #--------------------------------------------------------------------------- 1096 | 1097 | # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output 1098 | # The default value is: YES. 1099 | 1100 | GENERATE_HTML = YES 1101 | 1102 | # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a 1103 | # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of 1104 | # it. 1105 | # The default directory is: html. 1106 | # This tag requires that the tag GENERATE_HTML is set to YES. 1107 | 1108 | HTML_OUTPUT = 1109 | 1110 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each 1111 | # generated HTML page (for example: .htm, .php, .asp). 1112 | # The default value is: .html. 1113 | # This tag requires that the tag GENERATE_HTML is set to YES. 1114 | 1115 | HTML_FILE_EXTENSION = .html 1116 | 1117 | # The HTML_HEADER tag can be used to specify a user-defined HTML header file for 1118 | # each generated HTML page. If the tag is left blank doxygen will generate a 1119 | # standard header. 1120 | # 1121 | # To get valid HTML the header file that includes any scripts and style sheets 1122 | # that doxygen needs, which is dependent on the configuration options used (e.g. 1123 | # the setting GENERATE_TREEVIEW). It is highly recommended to start with a 1124 | # default header using 1125 | # doxygen -w html new_header.html new_footer.html new_stylesheet.css 1126 | # YourConfigFile 1127 | # and then modify the file new_header.html. See also section "Doxygen usage" 1128 | # for information on how to generate the default header that doxygen normally 1129 | # uses. 1130 | # Note: The header is subject to change so you typically have to regenerate the 1131 | # default header when upgrading to a newer version of doxygen. For a description 1132 | # of the possible markers and block names see the documentation. 1133 | # This tag requires that the tag GENERATE_HTML is set to YES. 1134 | 1135 | HTML_HEADER = 1136 | 1137 | # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each 1138 | # generated HTML page. If the tag is left blank doxygen will generate a standard 1139 | # footer. See HTML_HEADER for more information on how to generate a default 1140 | # footer and what special commands can be used inside the footer. See also 1141 | # section "Doxygen usage" for information on how to generate the default footer 1142 | # that doxygen normally uses. 1143 | # This tag requires that the tag GENERATE_HTML is set to YES. 1144 | 1145 | HTML_FOOTER = 1146 | 1147 | # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style 1148 | # sheet that is used by each HTML page. It can be used to fine-tune the look of 1149 | # the HTML output. If left blank doxygen will generate a default style sheet. 1150 | # See also section "Doxygen usage" for information on how to generate the style 1151 | # sheet that doxygen normally uses. 1152 | # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as 1153 | # it is more robust and this tag (HTML_STYLESHEET) will in the future become 1154 | # obsolete. 1155 | # This tag requires that the tag GENERATE_HTML is set to YES. 1156 | 1157 | HTML_STYLESHEET = 1158 | 1159 | # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined 1160 | # cascading style sheets that are included after the standard style sheets 1161 | # created by doxygen. Using this option one can overrule certain style aspects. 1162 | # This is preferred over using HTML_STYLESHEET since it does not replace the 1163 | # standard style sheet and is therefore more robust against future updates. 1164 | # Doxygen will copy the style sheet files to the output directory. 1165 | # Note: The order of the extra style sheet files is of importance (e.g. the last 1166 | # style sheet in the list overrules the setting of the previous ones in the 1167 | # list). For an example see the documentation. 1168 | # This tag requires that the tag GENERATE_HTML is set to YES. 1169 | 1170 | HTML_EXTRA_STYLESHEET = 1171 | 1172 | # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or 1173 | # other source files which should be copied to the HTML output directory. Note 1174 | # that these files will be copied to the base HTML output directory. Use the 1175 | # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these 1176 | # files. In the HTML_STYLESHEET file, use the file name only. Also note that the 1177 | # files will be copied as-is; there are no commands or markers available. 1178 | # This tag requires that the tag GENERATE_HTML is set to YES. 1179 | 1180 | HTML_EXTRA_FILES = 1181 | 1182 | # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen 1183 | # will adjust the colors in the style sheet and background images according to 1184 | # this color. Hue is specified as an angle on a colorwheel, see 1185 | # http://en.wikipedia.org/wiki/Hue for more information. For instance the value 1186 | # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 1187 | # purple, and 360 is red again. 1188 | # Minimum value: 0, maximum value: 359, default value: 220. 1189 | # This tag requires that the tag GENERATE_HTML is set to YES. 1190 | 1191 | HTML_COLORSTYLE_HUE = 220 1192 | 1193 | # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors 1194 | # in the HTML output. For a value of 0 the output will use grayscales only. A 1195 | # value of 255 will produce the most vivid colors. 1196 | # Minimum value: 0, maximum value: 255, default value: 100. 1197 | # This tag requires that the tag GENERATE_HTML is set to YES. 1198 | 1199 | HTML_COLORSTYLE_SAT = 100 1200 | 1201 | # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the 1202 | # luminance component of the colors in the HTML output. Values below 100 1203 | # gradually make the output lighter, whereas values above 100 make the output 1204 | # darker. The value divided by 100 is the actual gamma applied, so 80 represents 1205 | # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not 1206 | # change the gamma. 1207 | # Minimum value: 40, maximum value: 240, default value: 80. 1208 | # This tag requires that the tag GENERATE_HTML is set to YES. 1209 | 1210 | HTML_COLORSTYLE_GAMMA = 80 1211 | 1212 | # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 1213 | # page will contain the date and time when the page was generated. Setting this 1214 | # to YES can help to show when doxygen was last run and thus if the 1215 | # documentation is up to date. 1216 | # The default value is: NO. 1217 | # This tag requires that the tag GENERATE_HTML is set to YES. 1218 | 1219 | HTML_TIMESTAMP = NO 1220 | 1221 | # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 1222 | # documentation will contain sections that can be hidden and shown after the 1223 | # page has loaded. 1224 | # The default value is: NO. 1225 | # This tag requires that the tag GENERATE_HTML is set to YES. 1226 | 1227 | HTML_DYNAMIC_SECTIONS = NO 1228 | 1229 | # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries 1230 | # shown in the various tree structured indices initially; the user can expand 1231 | # and collapse entries dynamically later on. Doxygen will expand the tree to 1232 | # such a level that at most the specified number of entries are visible (unless 1233 | # a fully collapsed tree already exceeds this amount). So setting the number of 1234 | # entries 1 will produce a full collapsed tree by default. 0 is a special value 1235 | # representing an infinite number of entries and will result in a full expanded 1236 | # tree by default. 1237 | # Minimum value: 0, maximum value: 9999, default value: 100. 1238 | # This tag requires that the tag GENERATE_HTML is set to YES. 1239 | 1240 | HTML_INDEX_NUM_ENTRIES = 100 1241 | 1242 | # If the GENERATE_DOCSET tag is set to YES, additional index files will be 1243 | # generated that can be used as input for Apple's Xcode 3 integrated development 1244 | # environment (see: http://developer.apple.com/tools/xcode/), introduced with 1245 | # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a 1246 | # Makefile in the HTML output directory. Running make will produce the docset in 1247 | # that directory and running make install will install the docset in 1248 | # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at 1249 | # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html 1250 | # for more information. 1251 | # The default value is: NO. 1252 | # This tag requires that the tag GENERATE_HTML is set to YES. 1253 | 1254 | GENERATE_DOCSET = NO 1255 | 1256 | # This tag determines the name of the docset feed. A documentation feed provides 1257 | # an umbrella under which multiple documentation sets from a single provider 1258 | # (such as a company or product suite) can be grouped. 1259 | # The default value is: Doxygen generated docs. 1260 | # This tag requires that the tag GENERATE_DOCSET is set to YES. 1261 | 1262 | DOCSET_FEEDNAME = "Doxygen generated docs" 1263 | 1264 | # This tag specifies a string that should uniquely identify the documentation 1265 | # set bundle. This should be a reverse domain-name style string, e.g. 1266 | # com.mycompany.MyDocSet. Doxygen will append .docset to the name. 1267 | # The default value is: org.doxygen.Project. 1268 | # This tag requires that the tag GENERATE_DOCSET is set to YES. 1269 | 1270 | DOCSET_BUNDLE_ID = org.doxygen.Project 1271 | 1272 | # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify 1273 | # the documentation publisher. This should be a reverse domain-name style 1274 | # string, e.g. com.mycompany.MyDocSet.documentation. 1275 | # The default value is: org.doxygen.Publisher. 1276 | # This tag requires that the tag GENERATE_DOCSET is set to YES. 1277 | 1278 | DOCSET_PUBLISHER_ID = org.doxygen.Publisher 1279 | 1280 | # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. 1281 | # The default value is: Publisher. 1282 | # This tag requires that the tag GENERATE_DOCSET is set to YES. 1283 | 1284 | DOCSET_PUBLISHER_NAME = Publisher 1285 | 1286 | # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three 1287 | # additional HTML index files: index.hhp, index.hhc, and index.hhk. The 1288 | # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop 1289 | # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on 1290 | # Windows. 1291 | # 1292 | # The HTML Help Workshop contains a compiler that can convert all HTML output 1293 | # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML 1294 | # files are now used as the Windows 98 help format, and will replace the old 1295 | # Windows help format (.hlp) on all Windows platforms in the future. Compressed 1296 | # HTML files also contain an index, a table of contents, and you can search for 1297 | # words in the documentation. The HTML workshop also contains a viewer for 1298 | # compressed HTML files. 1299 | # The default value is: NO. 1300 | # This tag requires that the tag GENERATE_HTML is set to YES. 1301 | 1302 | GENERATE_HTMLHELP = NO 1303 | 1304 | # The CHM_FILE tag can be used to specify the file name of the resulting .chm 1305 | # file. You can add a path in front of the file if the result should not be 1306 | # written to the html output directory. 1307 | # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 1308 | 1309 | CHM_FILE = 1310 | 1311 | # The HHC_LOCATION tag can be used to specify the location (absolute path 1312 | # including file name) of the HTML help compiler (hhc.exe). If non-empty, 1313 | # doxygen will try to run the HTML help compiler on the generated index.hhp. 1314 | # The file has to be specified with full path. 1315 | # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 1316 | 1317 | HHC_LOCATION = 1318 | 1319 | # The GENERATE_CHI flag controls if a separate .chi index file is generated 1320 | # (YES) or that it should be included in the master .chm file (NO). 1321 | # The default value is: NO. 1322 | # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 1323 | 1324 | GENERATE_CHI = NO 1325 | 1326 | # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) 1327 | # and project file content. 1328 | # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 1329 | 1330 | CHM_INDEX_ENCODING = 1331 | 1332 | # The BINARY_TOC flag controls whether a binary table of contents is generated 1333 | # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it 1334 | # enables the Previous and Next buttons. 1335 | # The default value is: NO. 1336 | # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 1337 | 1338 | BINARY_TOC = NO 1339 | 1340 | # The TOC_EXPAND flag can be set to YES to add extra items for group members to 1341 | # the table of contents of the HTML help documentation and to the tree view. 1342 | # The default value is: NO. 1343 | # This tag requires that the tag GENERATE_HTMLHELP is set to YES. 1344 | 1345 | TOC_EXPAND = NO 1346 | 1347 | # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and 1348 | # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that 1349 | # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help 1350 | # (.qch) of the generated HTML documentation. 1351 | # The default value is: NO. 1352 | # This tag requires that the tag GENERATE_HTML is set to YES. 1353 | 1354 | GENERATE_QHP = NO 1355 | 1356 | # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify 1357 | # the file name of the resulting .qch file. The path specified is relative to 1358 | # the HTML output folder. 1359 | # This tag requires that the tag GENERATE_QHP is set to YES. 1360 | 1361 | QCH_FILE = 1362 | 1363 | # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help 1364 | # Project output. For more information please see Qt Help Project / Namespace 1365 | # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). 1366 | # The default value is: org.doxygen.Project. 1367 | # This tag requires that the tag GENERATE_QHP is set to YES. 1368 | 1369 | QHP_NAMESPACE = org.doxygen.Project 1370 | 1371 | # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt 1372 | # Help Project output. For more information please see Qt Help Project / Virtual 1373 | # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- 1374 | # folders). 1375 | # The default value is: doc. 1376 | # This tag requires that the tag GENERATE_QHP is set to YES. 1377 | 1378 | QHP_VIRTUAL_FOLDER = doc 1379 | 1380 | # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom 1381 | # filter to add. For more information please see Qt Help Project / Custom 1382 | # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- 1383 | # filters). 1384 | # This tag requires that the tag GENERATE_QHP is set to YES. 1385 | 1386 | QHP_CUST_FILTER_NAME = 1387 | 1388 | # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the 1389 | # custom filter to add. For more information please see Qt Help Project / Custom 1390 | # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- 1391 | # filters). 1392 | # This tag requires that the tag GENERATE_QHP is set to YES. 1393 | 1394 | QHP_CUST_FILTER_ATTRS = 1395 | 1396 | # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this 1397 | # project's filter section matches. Qt Help Project / Filter Attributes (see: 1398 | # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). 1399 | # This tag requires that the tag GENERATE_QHP is set to YES. 1400 | 1401 | QHP_SECT_FILTER_ATTRS = 1402 | 1403 | # The QHG_LOCATION tag can be used to specify the location of Qt's 1404 | # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the 1405 | # generated .qhp file. 1406 | # This tag requires that the tag GENERATE_QHP is set to YES. 1407 | 1408 | QHG_LOCATION = 1409 | 1410 | # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be 1411 | # generated, together with the HTML files, they form an Eclipse help plugin. To 1412 | # install this plugin and make it available under the help contents menu in 1413 | # Eclipse, the contents of the directory containing the HTML and XML files needs 1414 | # to be copied into the plugins directory of eclipse. The name of the directory 1415 | # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. 1416 | # After copying Eclipse needs to be restarted before the help appears. 1417 | # The default value is: NO. 1418 | # This tag requires that the tag GENERATE_HTML is set to YES. 1419 | 1420 | GENERATE_ECLIPSEHELP = NO 1421 | 1422 | # A unique identifier for the Eclipse help plugin. When installing the plugin 1423 | # the directory name containing the HTML and XML files should also have this 1424 | # name. Each documentation set should have its own identifier. 1425 | # The default value is: org.doxygen.Project. 1426 | # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. 1427 | 1428 | ECLIPSE_DOC_ID = org.doxygen.Project 1429 | 1430 | # If you want full control over the layout of the generated HTML pages it might 1431 | # be necessary to disable the index and replace it with your own. The 1432 | # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top 1433 | # of each HTML page. A value of NO enables the index and the value YES disables 1434 | # it. Since the tabs in the index contain the same information as the navigation 1435 | # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. 1436 | # The default value is: NO. 1437 | # This tag requires that the tag GENERATE_HTML is set to YES. 1438 | 1439 | DISABLE_INDEX = NO 1440 | 1441 | # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 1442 | # structure should be generated to display hierarchical information. If the tag 1443 | # value is set to YES, a side panel will be generated containing a tree-like 1444 | # index structure (just like the one that is generated for HTML Help). For this 1445 | # to work a browser that supports JavaScript, DHTML, CSS and frames is required 1446 | # (i.e. any modern browser). Windows users are probably better off using the 1447 | # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can 1448 | # further fine-tune the look of the index. As an example, the default style 1449 | # sheet generated by doxygen has an example that shows how to put an image at 1450 | # the root of the tree instead of the PROJECT_NAME. Since the tree basically has 1451 | # the same information as the tab index, you could consider setting 1452 | # DISABLE_INDEX to YES when enabling this option. 1453 | # The default value is: NO. 1454 | # This tag requires that the tag GENERATE_HTML is set to YES. 1455 | 1456 | GENERATE_TREEVIEW = NO 1457 | 1458 | # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that 1459 | # doxygen will group on one line in the generated HTML documentation. 1460 | # 1461 | # Note that a value of 0 will completely suppress the enum values from appearing 1462 | # in the overview section. 1463 | # Minimum value: 0, maximum value: 20, default value: 4. 1464 | # This tag requires that the tag GENERATE_HTML is set to YES. 1465 | 1466 | ENUM_VALUES_PER_LINE = 4 1467 | 1468 | # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used 1469 | # to set the initial width (in pixels) of the frame in which the tree is shown. 1470 | # Minimum value: 0, maximum value: 1500, default value: 250. 1471 | # This tag requires that the tag GENERATE_HTML is set to YES. 1472 | 1473 | TREEVIEW_WIDTH = 250 1474 | 1475 | # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to 1476 | # external symbols imported via tag files in a separate window. 1477 | # The default value is: NO. 1478 | # This tag requires that the tag GENERATE_HTML is set to YES. 1479 | 1480 | EXT_LINKS_IN_WINDOW = NO 1481 | 1482 | # Use this tag to change the font size of LaTeX formulas included as images in 1483 | # the HTML documentation. When you change the font size after a successful 1484 | # doxygen run you need to manually remove any form_*.png images from the HTML 1485 | # output directory to force them to be regenerated. 1486 | # Minimum value: 8, maximum value: 50, default value: 10. 1487 | # This tag requires that the tag GENERATE_HTML is set to YES. 1488 | 1489 | FORMULA_FONTSIZE = 10 1490 | 1491 | # Use the FORMULA_TRANPARENT tag to determine whether or not the images 1492 | # generated for formulas are transparent PNGs. Transparent PNGs are not 1493 | # supported properly for IE 6.0, but are supported on all modern browsers. 1494 | # 1495 | # Note that when changing this option you need to delete any form_*.png files in 1496 | # the HTML output directory before the changes have effect. 1497 | # The default value is: YES. 1498 | # This tag requires that the tag GENERATE_HTML is set to YES. 1499 | 1500 | FORMULA_TRANSPARENT = YES 1501 | 1502 | # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see 1503 | # http://www.mathjax.org) which uses client side Javascript for the rendering 1504 | # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX 1505 | # installed or if you want to formulas look prettier in the HTML output. When 1506 | # enabled you may also need to install MathJax separately and configure the path 1507 | # to it using the MATHJAX_RELPATH option. 1508 | # The default value is: NO. 1509 | # This tag requires that the tag GENERATE_HTML is set to YES. 1510 | 1511 | USE_MATHJAX = NO 1512 | 1513 | # When MathJax is enabled you can set the default output format to be used for 1514 | # the MathJax output. See the MathJax site (see: 1515 | # http://docs.mathjax.org/en/latest/output.html) for more details. 1516 | # Possible values are: HTML-CSS (which is slower, but has the best 1517 | # compatibility), NativeMML (i.e. MathML) and SVG. 1518 | # The default value is: HTML-CSS. 1519 | # This tag requires that the tag USE_MATHJAX is set to YES. 1520 | 1521 | MATHJAX_FORMAT = HTML-CSS 1522 | 1523 | # When MathJax is enabled you need to specify the location relative to the HTML 1524 | # output directory using the MATHJAX_RELPATH option. The destination directory 1525 | # should contain the MathJax.js script. For instance, if the mathjax directory 1526 | # is located at the same level as the HTML output directory, then 1527 | # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax 1528 | # Content Delivery Network so you can quickly see the result without installing 1529 | # MathJax. However, it is strongly recommended to install a local copy of 1530 | # MathJax from http://www.mathjax.org before deployment. 1531 | # The default value is: http://cdn.mathjax.org/mathjax/latest. 1532 | # This tag requires that the tag USE_MATHJAX is set to YES. 1533 | 1534 | MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest 1535 | 1536 | # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax 1537 | # extension names that should be enabled during MathJax rendering. For example 1538 | # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols 1539 | # This tag requires that the tag USE_MATHJAX is set to YES. 1540 | 1541 | MATHJAX_EXTENSIONS = 1542 | 1543 | # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces 1544 | # of code that will be used on startup of the MathJax code. See the MathJax site 1545 | # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an 1546 | # example see the documentation. 1547 | # This tag requires that the tag USE_MATHJAX is set to YES. 1548 | 1549 | MATHJAX_CODEFILE = 1550 | 1551 | # When the SEARCHENGINE tag is enabled doxygen will generate a search box for 1552 | # the HTML output. The underlying search engine uses javascript and DHTML and 1553 | # should work on any modern browser. Note that when using HTML help 1554 | # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) 1555 | # there is already a search function so this one should typically be disabled. 1556 | # For large projects the javascript based search engine can be slow, then 1557 | # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to 1558 | # search using the keyboard; to jump to the search box use + S 1559 | # (what the is depends on the OS and browser, but it is typically 1560 | # , /