Download the PHP package tuefekci/deta without Composer
On this page you can find all versions of the php package tuefekci/deta. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package deta
Deta PHP
This is a PHP client for the Deta API.
Explore the Client Deta Space via https://deta.space/discovery/@tuefekci/phpsandbox
Installation
You can install the package via composer:
Usage
To use the Deta client, first create an instance of the Deta
class, passing in your project ID and API key:
If you have set ENV Variables or are in a Deta Micro you can leave the keys out.
Then, you can use the base
method to get a reference to a base in your project:
You can then use the methods on the base to interact with the items stored in the base:
Similarly, you can use the drive
method to get a reference to a drive in your project:
And then use the methods on the drive to interact with the files stored in the drive:
Documentation for Deta-PHP
classes and files
This repository contains Deta-PHP
, which is a PHP SDK for interacting with the Deta API. The SDK contains the following files and classes:
deta.php
This file contains the Deta
class, which is used to instantiate a Deta client. The Deta
class constructor takes the following parameters:
project_id
: the Deta project IDapi_key
: the Deta project API keyoptions
: an optional array of options for the Guzzle HTTP client
The Deta
class provides the following methods:
base($base_name)
: creates and returns a newBase
instancedrive($drive_name)
: creates and returns a newDrive
instance
base.php
This file contains the Base
class, which provides methods for interacting with Deta Base. The Base
class constructor takes a single parameter, which is an instance of the Guzzle HTTP client.
The Base
class provides the following methods:
put($items)
: adds or updates items in the baseget($key)
: retrieves an item from the base by keydelete($key)
: deletes an item from the base by keyinsert($item)
: adds a new item to the baseupdate($key, $set = null, $increment = null, $append = null, $delete = null)
: updates an item in the base by keyquery($query = null, $limit = null, $last = null)
: queries the base
drive.php
This file contains the Drive
class, which provides methods for interacting with Deta Drive. The Drive
class constructor takes a single parameter, which is an instance of the Guzzle HTTP client.
The Drive
class provides the following methods:
put($name, $content, $content_type = null)
: uploads a new file to Deta DriveinitializeChunkedUpload($name)
: initiates a chunked upload to Deta DriveuploadChunkedPart($upload_id, $name, $part, $content)
: uploads a part of a chunked upload to Deta DriveendChunkedUpload($upload_id, $name)
: ends a chunked upload to Deta DriveabortChunkedUpload($upload_id, $name)
: aborts a chunked upload to Deta Driveget($name)
: retrieves a file from Deta Drivelist($limit = null, $prefix = null, $last = null)
: lists files in Deta Drivedelete($name)
: deletes a file from Deta Drive by name
Namespace
All classes are defined in the tuefekci\deta
namespace. To use the SDK in your PHP code, include the following statement:
License
The MIT License (MIT). Please see License File for more information.