2017 © Pedro Peláez
 

library quickbase

A lightweight, very flexible QuickBase API

image

tflanagan/quickbase

A lightweight, very flexible QuickBase API

  • Wednesday, August 2, 2017
  • by tflanagan
  • Repository
  • 5 Watchers
  • 14 Stars
  • 1,371 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 30 Versions
  • 2 % Grown

The README.md

php-quickbase

License Latest Stable Version Total Downloads Build Status, (*1)

A lightweight, very flexible QuickBase API, (*2)

JavaScript (Node.js + Browser) Version, (*3)

Install

$ composer require tflanagan/quickbase

Example

try {
    $qb = new \QuickBase\QuickBase(array(
        'realm' => 'www',
        'appToken' => '****',
        // 'userToken' => '****'
    ));

    // If using user tokens, you do not need to call API_Authenticate

    $qb->api('API_Authenticate', array(
        'username' => '****',
        'password' => '****'
    ));

    $response = $qb->api('API_DoQuery', array(
        'dbid' => '*****',
        'clist' => '3.12',
        'options' => 'num-5'
    ));

    foreach($response['table']['records'] as $record){
        $qb->api('API_EditRecord', array(
            'dbid' => '*****',
            'rid' => $record[3],
            'fields' => array(
                array( 'fid' => 12, 'value' => $record[12])
            )
        ));
    }

    $results = $qb->api(array(
        array(
            'action' => 'API_DoQuery',
            'options' => array(
                'dbid' => '*****',
                'clist' => '3.12',
                'options' => 'num-5'
            )
        ),
        array(
            'action' => 'API_DoQuery',
            'options' => array(
                'dbid' => '*****',
                'clist' => '3.12',
                'options' => 'num-5'
            )
        )
    ));

    var_dump($results[0]); // First DoQuery
    var_dump($results[1]); // Second DoQuery
}catch(\QuickBase\QuickBaseError $err){
    echo '('.$err->getCode().') '.$err->getMessage().'. '.$err->getDetails();
}

Class

class \QuickBase\QuickBase {

    public cURL multi $mch;
    public array $chs;

    private $defaults;

    final public api($action[, $options = array()]);
    final public api($actions = array());

    final public static genCH();

}

class \QuickBase\QuickBaseError extends \Exception {

    protected int $code;
    protected string $message;
    protected string $details;

    protected int $line;
    protected string $file;

    final public getCode(void);
    final public getMessage(void);
    final public getDetails(void);

    final public getLine(void);
    final public getFile(void);

}

class \QuickBase\QuickBaseQuery {

    public QuickBase $parent;
    public string $action;
    public array $settings;
    public array $options;
    public array $response;

    private int $nErrors;

    protected string $payload;

    final public actionRequest();
    final public actionResponse();
    final public addFlags();
    final public constructPayload();
    final public checkForAndHandleError();
    final public finalize();
    final public prepareCH();
    final public processCH();
    final public processOptions();

    final public static arr2Obj(&$arr[, $return = false]);
    final public static arr2Xml($arr, &$xml);
    final public static cleanXml2Arr(&$arr);
    final public static parseCURLHeaders(&$headers);
    final public static xml2Arr($xml, &$arr);

}

class \QuickBase\QuickBaseRequest {

    final public static API_[Authenticate, DoQuery, etc](&$query);

}

class \QuickBase\QuickBaseResponse {

    final public static API_[Authenticate, DoQuery, etc](&$query, &$results);

}

class \QuickBase\QuickBaseOption {

    final public static [clist, fields, etc]($val);

}

Error Handling

php-quickbase throws exceptions whenever an error is detected. You do not have to manually check for QuickBase errors, just wrap your code in try/catch's and you're good to go!, (*4)

try {
    // QuickBase API Calls Here
}catch(\QuickBase\QuickBaseError $err){
    echo '('.$err->getCode().') '.$err->getMessage().'. '.$err->getDetails();

    /*
     * class \QuickBase\QuickBaseError extends \Exception {
     *
     *  protected int $code;
     *  protected string $message;
     *  protected string $details;
     *
     *  protected int $line;
     *  protected string $file;
     *
     *  final public getCode(void);
     *  final public getMessage(void);
     *  final public getDetails(void);
     *
     *  final public getLine(void);
     *  final public getFile(void);
     *
     * }
    */
}

License

Copyright 2015 Tristian Flanagan, (*5)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at, (*6)

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License., (*7)

The Versions

02/08 2017

dev-master

9999999-dev https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

02/08 2017

v2.0.7

2.0.7.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

03/02 2017

v2.0.6

2.0.6.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

03/02 2017

v2.0.5

2.0.5.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

03/02 2017

v2.0.4

2.0.4.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

12/12 2016

v2.0.3

2.0.3.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

01/11 2016

v2.0.2

2.0.2.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

01/11 2016

v2.0.1

2.0.1.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

29/09 2016

v2.0.0

2.0.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

09/08 2016

v1.3.5

1.3.5.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

04/08 2016

v1.3.4

1.3.4.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

02/08 2016

v1.3.3

1.3.3.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

01/08 2016

v1.3.2

1.3.2.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

01/08 2016

v1.3.1

1.3.1.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

08/07 2016

v1.3.0

1.3.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

14/04 2016

v1.2.2

1.2.2.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

06/03 2016

v1.2.1

1.2.1.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

03/03 2016

v1.2.0

1.2.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

01/03 2016

v1.1.0

1.1.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

19/01 2016

v1.0.0

1.0.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

19/01 2016

v0.6.0

0.6.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

15/01 2016

v0.5.0

0.5.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

10/11 2015

v0.4.1

0.4.1.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

05/11 2015

v0.4.0

0.4.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

30/10 2015

v0.3.0

0.3.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

28/10 2015

v0.2.0

0.2.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

27/10 2015

v0.1.2

0.1.2.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

27/10 2015

v0.1.1

0.1.1.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

26/10 2015

0.1.0

0.1.0.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *
  • ext-xml *

 

api quickbase qb

24/10 2015

0.0.1

0.0.1.0 https://github.com/tflanagan/php-quickbase

A lightweight, very flexible QuickBase API

  Sources   Download

Apache-2.0

The Requires

  • php >=5.4.0
  • ext-curl *

 

api quickbase qb