chancegarcia/box-api-v2-sdk

PHP SDK to interact with the box.com API

0.10.0 2024-04-13 22:41 UTC

This package is auto-updated.

Last update: 2024-09-13 23:26:47 UTC


README

Requires at least 5.6.10

php sdk for use with box.net v2 api (http://developers.box.com/)

Copyright (C) 2013-2016 Chance Garcia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

tasks:

  • v0.4.0
    • refactor Connection::getCurlData to return an HTTP Response object (use symfony/http-foundation)
      • method to turn curl header string into header array to set in Response object
      • method to determine status code given header string
      • Existing calls in the Client class must still only analyse the body response
    • Service class final methods analyze the Response object to determine error/response handling such as refresh token attempt
      • Deprecate Service::getFinalConnectionResult and add warning of removal in v0.5.0
  • v0.4.5
    • refactor Service::getFromBox to accept type mapped
    • refactor Service::sendUpdateToBox to accept type mapped
    • add Error class
      • add handling for 409 item_name_in_use error
      • factory to create errors
    • Fix StatusLine parsing (reason phrase Not Found shows up as Not)
  • v0.5.0
    • Add deprecation notice that the Client class will be removed. exact version removal undetermined
    • Add deprecation notice that the Collection class will be removed in v0.6.0 in favor of using doctrine/collections
    • use factories to create class returns instead passing class to map
    • methods to set CURLOPT_SSL_VERIFYPEER in Connection class
      • add deprecation notice that default value will be true in later release to allow time for migration from current behavior (false)
    • refactor
  • v0.6.0
    • go to full composer dependency mode
    • add composer doctrine/collections requirement
    • use existing OAuth2 for Box client library for our authentication
    • implement traits for mapping and logging in BaseModel, Model classes
    • implement Retry-After response header handling in abstract Service

tasks for version less than 0.4.0

  • Client class
    • Note: token information as well as client id and secret are set from outside source/storage
    • get access token given authorization code
    • refresh token
    • retrieve folder information from box given id
    • get array of folder items (json decoded format)
    • create new box folder
    • update folder information
    • get folder collaborators
    • add collaborator to a folder
    • create shared link for folder
    • copy box folder
    • create authorization header for connection class using token
    • destroy token
      • add error handling
    • auth query
      • build auth query uri
      • set auth header for connection
        • allow additional headers to be merged because of header overwrite
    • client id
    • client secret
  • Collaboration class
    • interface implemented
    • validate status
  • Collection class
    • figure out how to create dependency to an array collection library; not as separatable but better than maintaining our own/re-inventing the wheel
  • Connection class
    • interface implemented
    • ability to set additional curl opts
    • send GET request
    • return GET response
    • send PUT request
    • return PUT response
    • send POST request
    • return POST response
    • send DELETE request
    • return DELETE response
  • Token class
  • Folder class
    • interface implemented
  • User class
    • interface implemented
  • File class
    • interface implemented
  • Comment class
  • Event class
  • Shared Items interaction
    • create shared link (can be done via client)
  • Search
  • Task Class
  • Unit Tests
    • Regression for current implementation
    • TDD for future implementation