Download the PHP package s0d3s/tg-long-req without Composer

On this page you can find all versions of the php package s0d3s/tg-long-req. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tg-long-req

TG LONG REQUEST

What is this?

This is a small help-oriented class for creating tg bots. It helps with the creation and navigation in the menu telegram bot


Это небольшой класс для телеграм ботов. Он помогает в создании меню и дальнейшей навигации в нём.

Abstract exemple

INSTALL

via composer

(add this to section "require" in your composer.json)

{
  "require" : {  
    "s0d3s/tg-long-req": ">=1"   
  }
}

and

include_once('path/to/autoload.php');
use s0d3s\TgLongReq;

manual

Copy the "TgLongReq.php" to the project dir and:

include_once('TgLongReq.php');
use s0d3s\TgLongReq;

Simple use

  1. Create a TgLongReq obj

    $tg_req = TgLongReq ( 'user_id', 'req_func list' /optinal/ , 'user_request_dir', tg_api_key, tg_api_result );

    Var Type Caption
    $user_id STRING Telegram user id
    $req_func ARRAY Requests and functions association table
    $usr_req_dir STR Path to general request dir **
    $tg_api_key SOMETH/* irazasyed/telegram-bot-sdk Api() object*
    $tg_api_result SOMETH/* Api()->getWebhookUpdates()

*It could be something else, or be null. **Temporary requests from users will be stored in this folder.


  1. Create request

$tg_req->reqCreate('req_name'); *

*This parameter depends only on you (this name should be in the association table)


  1. Save and restore temprorary data

    • saving

For store (temporary) data, you can use "saveToTemp", the function accepts any data types and saves it as json string

$tg_req->saveToTemp(\$some_data);

.

$some_array = array(); $some_array = \$tg_req->getFromTemp(\$hold_it==false);*

* If needed, you can leave a temporary file until the next used, for this pass to function "true"(bool)


  1. Check the existence of the request

$tg_req->reqCheck(); //return true if exists, else false

  1. Delete user request

$tg_req->reqDel();

  1. Handling request

$tg_req->reqHand(); //This method will call the corresponding function from the association table.

  1. NOTES
    • Association table is array('req_name'=>'func_name')
    • Functions specified in the table may not process passed parameters

Some examples you can find at ./exmp


All versions of tg-long-req with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package s0d3s/tg-long-req contains the following files

Loading the files please wait ....