Code Monkey home page Code Monkey logo

thinq-php's Introduction

thinq-php

Latest Stable Version Total Downloads License CodeFactor

PHP Library Intended to Interact with Thinq's API

Installation

composer require dutchie027/thinq

Usage

// require the composer library
require_once ('vendor/autoload.php');

//make the connction to the API for use
$api = new dutchie027\Thinq\API(THINQ_USER, THINQ_TOKEN);

...

Requirements

The libarary assumes you have three defined variables:

define ('THINQ_USER', 'myUserName');
define ('THINQ_TOKEN', '867530986753098675309');
define ('THINQ_ACCOUNT_ID', '12345678');

in order to work properly. THINQ_USER and THINQ_TOKEN are fed to the API as parameters for login and header information. THINQ_ACCOUNT_ID is used in making URLs on the back end. These constants can be defined in your script or they can be imported or included in a constant file (preferred).

General Information

Class Listing

The library has the following classes:

Class Information

API

The main connection requires at minimum, a username and token.

Once you have a user and token, you can simply connect with it or you can add options

// Ensure we have the composer libraries
require_once ('vendor/autoload.php');

// Instantiate with defaults
$api = new dutchie027\Thinq\API(THINQ_USER, THINQ_TOKEN);

// Instantiate without defaults, this allows you to change things
// like log location, directory, the tag and possible future settings.
$settings = [
  'log_dir' => '/tmp',
  'log_name' => 'thinqi',
  'log_tag' => 'thinq-api',
  'log_level' => 'error'
];

$api = new dutchie027\Thinq\API(THINQ_USER, THINQ_TOKEN, $settings);

Settings

The default settings are fine, however you might want to override the defaults or use your own.NOTE: All settings are optional and you don't need to provide any.

Field Type Description Default Value
log_dir string The directory where the log file is stored sys_get_temp_dir()
log_name string The name of the log file that is created in log_dir. If you don't put .log at the end, it will append it 6 random characters + time() + .log
log_tag string If you share this log file with other applications, this is the tag used in the log file thinq
log_level string The level of logging the application will do. This must be either debug, info, notice, warning, critical or error. If it is not one of those values it will fail to the default warning

To-Do

  • Bring in more of the function(s) from Thinq
  • Document the class(es) with proper doc blocks better
  • Clean up the code a bit more
  • Stuff I'm obviously missing...

Contributing

If you're having problems, spot a bug, or have a feature suggestion, file an issue. If you want, feel free to fork the package and make a pull request. This is a work in progresss as I get more info and further test the API.

thinq-php's People

Contributors

dependabot[bot] avatar dutchie027 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.