Download the PHP package reandimo/google-sheets-helper without Composer

On this page you can find all versions of the php package reandimo/google-sheets-helper. 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 google-sheets-helper

PHP Google Spreadsheets API Helper

Latest Stable Version License PHP Version Require

Google Spreadsheets API Helper - A bunch of functions to work easily with Google Sheets API

This library is a helper that encapsulate Google APIs Client Library for PHP (Documentation) for simple usage.


Outline


Requirements

This library requires the following:


Installation

Run Composer in your project:

composer require reandimo/google-sheets-helper

Then you could call it after Composer is loaded depending on your PHP framework:

Also, you can use putenv() to set credentials.json and token.json like this:

Now when you create a new instance, the class automatically detects the paths. This is the recommended way to do it.


Credentials

Google API Client needs to validate with 2 files credentials.json and token.json, the last one can be generated with a script included in the package called firstauth. You can use it to generate this file for the first time only to grant access to the API.

Execute in your project's root folder with php ./vendor/reandimo/google-sheets-helper/firstauth and follow the steps.

This is a 3 step script based on the quickstart.php mentioned in google's documentation (https://developers.google.com/sheets/api/quickstart/php).


Usage

Create Instance

Set sheet props

You can have multiple sheet instances just invoke the Helper as many times you want:

Get Values

Get values from range

Append Data

Append a single row

The function will return a number of rows updated as int. So you can check if it's done like this:

Append a range

Update Data

Update single cell

Update a range

Worksheets

Duplicate Worksheet

Change background color of a range

Misc

Calculate column index by the letters

If for some reason you need to calculate the column positions of a column by its letters, this is the way:

Tips

Some things aren't very clear in Google's documentation without diggin a lot so i'll be leaving tips here:

License

This Package is open source and released under MIT license. See the LICENSE file for more info.

Question? Issues?

Feel free to open issues for suggestions, questions, and issues.

Who's Behind

Renan Diaz, i'm dealing with PHP since 2017 & Google's API since 2019. Feel free to write me to my email (Please don't send any multi-level crap).


All versions of google-sheets-helper with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
google/apiclient Version ^2.12
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 reandimo/google-sheets-helper contains the following files

Loading the files please wait ....