Download the PHP package emilianozublena/sheetsu-php without Composer

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

sheetsu-php

Installation

The Sheetsu PHP Library is available through Composer.

You can edit your composer.json file or just hit this command in your terminal

Usage

Instantianting the Sheetsu Client

You need to instantiate the main Sheetsu object and give the SheetID You can find this URL on Sheetsu Dashboard. Remember to use composer's autoload.

If you have HTTP Basic Authentication turned on for your API, you should pass key and secret here, like:

Initialize library

If you need, you can reinitialize (or initialize) the library after creation

Collection-Model

The Sheetsu PHP Library comes with a small implementation of a Collection abstract data type.

Models are units of Collections (in this case, each Model represents a Row of the given sheet).

Instead of giving arrays to the Sheetsu Client (for CRUD operations), you can do something like this:

Collections and Models are the 2 objects that you are going to get every time you call the api too.

Create

Link to docs

To add data to Google Spreadsheets, send an array, an array of arrays, or more simply, work with Models or Collections ;)

After call is made, returns a Response object.

Read

Link to docs

Read the whole sheet

Read function allows 2 parameters

search

Link to docs

To get rows that match search criteria, pass an array with criteria

Update

Link to docs

To update row(s), pass column name and its value which is used to find row(s) and an array or model with the data to update.

By default, PATCH request is sent, which is updating only values which are in the collection passed to the method. To send PUT request, pass 4th argument being true. Read more about the difference between PUT and PATCH in sheetsu docs.

Delete

Link to docs

To delete row(s), pass column name and its value which is used to find row(s).

Change Active Sheet

If you need to change the sheet you're working on, you can do it by using the sheet function and passing the new sheetsu id

You can also chain this function with others, like so:

Go back to using the whole spreadsheet again

If you need to use the whole spreadsheet is easy:

You can also chain this function with others, like so:

Response, Connection & Error Handling

The Sheetsu PHP Library handles the connection through the Connection class. This class uses cURL for making connections and uses the Response class as returns. The Response object is the one responsible for giving the collections, models or errors (or any other response from the last call) Error handling is also made through the Response object (Response uses the ErrorHandler class to abstract the try/catch block and is tightly coupled to the ErrorException php class)

Unit Testing with PHPUnit

This library has above 97% of code coverage. Some of the test are not using mock objects, this is in our to-do list and hope we'll be doing it so. The tests are prepared to be used with PHPUnit and the test suite is configured via XML, so you'll only need to execute PHPUnit in your forked version of this repo like so:

TODO


All versions of sheetsu-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
curl/curl Version ^1.5
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 emilianozublena/sheetsu-php contains the following files

Loading the files please wait ....