Download the PHP package sudiptochoudhury/php-time-doctor without Composer

On this page you can find all versions of the php package sudiptochoudhury/php-time-doctor. 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 php-time-doctor

php-time-doctor

PHP API Client for Time Doctor

Read all about Time Doctor API from timedoctor.com

Installation

Requirements

Install With Composer

You can install the library via Composer by adding the following line to the require block of your composer.json file (replace dev-master with the latest stable version):

or run the following command:

Setting up

Authenticate

Below are two OAuth2.0 strategies you can choose when implementing this.

Before this, you need to register your Time Doctor Application as described here, setup redirect_url and get the client_id, client_secret from the application.

For Web Server based/Desktop/Native applications

Authorization Code Grant flow: This flow is useful if you have your own server for your app (most common for traditional web apps, as well as native desktop and mobile apps).

Step 1 - Get Code

This will open authentication portal of your Time Doctor Application and on successful authentication redirect to the given redirect_url (an url of your main application) (provided that this url is registered in your Time Doctor Application) with a code in it's querystring.

Your site's code should collect and store this code for the next step.

Step 2 - Generate access_token

You will receive a set of values similar to the one give below:

Store the access_token and refresh_token for future use.

access_token will be required in all Time Doctor API calls, while refresh_token will be needed to re-generate access token on expiration. access_token has a limited life span as shown by expires_in (in seconds) property of the received data. The expires_in shown in the example data above calculated to 5 days.

The step below shows how to re-generate access_token on expiration.

Retrieve access_token on expiration using Refresh Token

For Web Server-less applications

Implicit Grant flow: Useful when you don't have your own server for your app (suitable for in-browser web apps, such as single-site apps written in JavaScript that cannot make arbitrary GET requests to our public API).

Use

All you need to do is to pass TimeDoctor access_token to the constructor.

Additionally, you can set a logger via log property.

You can use client property to forward to GuzzleHttp\Client constructor.

If you wish to tap into request and response handler stacks use settings instead of using client's handlers property.

How to use

Next, call the desired method from the table given below. In most methods you may need to pass parameters. The parameters are to be passed as an associative array.

Examples:

Available API Methods

Method Parameters Description
getCompanies(array = []) Returns the user's account(s)
getProjects(array) offset limit all Returns a collection of a user's projects
getUsers(array) company_id emails include_manager Returns a collection of the company's users
getUser(array) company_id, user_id Returns info about a user
getUserTasks(array) company_id user_id offset limit status latest_first Returns a collection of a user's tasks
getUserTask(array) company_id user_id task_id Returns info about a user's task
getWorklogs(array) company_id start_date end_date offset limit user_ids project_ids task_ids fields breaks_only consolidated last_modified Returns a collection of all user's worklogs under the given company Id

Available OAuth API Methods

Method Parameters Description
getAuthCode(array)
getToken(array)
refreshToken(array)
getAuthToken(array)

All versions of php-time-doctor with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
sudiptochoudhury/php-api-client-forge Version dev-master
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 sudiptochoudhury/php-time-doctor contains the following files

Loading the files please wait ....