Download the PHP package pithstudio/forrest without Composer

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

Omniphx/Forrest, Force.com REST API Client for Laravel 4

Latest Stable Version Total Downloads Latest Unstable Version License Build Status

Forrest is a Force.com REST API client for Laravel 4. It provides access to restricted Salesforce information via Oauth 2.0. REST is a lightweight alternative to the SOAP API and is useful for mobile users.

While this package is built for Laravel, it has been decoupled so that it can be extended into any framework or vanilla PHP application.

Installation

If you are upgrading to Version 1.0, be sure to re-publish your config file.

Forrest can be installed through composer. Open your composer.json file and add the following to the require key:

"omniphx/forrest": "1.*"

Next run composer update from the command line to install the package.

If you are using Laravel, add the service provider to your app/config/app.php file:

'Omniphx\Forrest\Providers\Laravel\ForrestServiceProvider'

Followed by the alias:

'Forrest' => 'Omniphx\Forrest\Providers\Laravel\Facades\Forrest'

Configuration

You will need a configuation file to add your creditials. Publish a config file using the artisan command:

You can find the config file in: app/config/omniphx/forrest/config.php

After you have set up am connected app (see below), update your config file with a consumerKey, consumerSecret, loginURL and callbackURI.

Getting Started

Setting up a Connected App

  1. Log into to your Salesforce org
  2. Click on Setup in the upper right-hand menu
  3. Under Build click Create > Apps
  4. Scroll to the bottom and click New under Connected Apps.
  5. Enter the following details for the remote application:
    • Connected App Name
    • API Name
    • Contact Email
    • Enable OAuth Settings under the API dropdown
    • Callback URL
    • Select access scope (If you need a refresh token, specify it here)
  6. Click Save

After saving, you will now be given a Consumer Key and Consumer Secret. Add those to your config file.

Setup

Forrest will come with the following routes included in it's package:

Web Server authentication flow
Username-Password authentication flow

Note: If you would like to customize the authentication process, these routes can be overwritten in your route.php file. Feel free to call the routes anything you like, but the callback must match what is configured in your Connected App settings and config file.

Custom login urls

Sometimes users will need to connect to a sandbox or custom url. To do this, simply pass the url as an argument for the authenticatation method:

Usage

Query a record

The callback function will store an encrypted authentication token in the user's session which can now be used to make API requests such as:

Result:

The default format is JSON, but it can be changed to XML

Create a new record

Records can be created using the following format.

Update a record

Update a record with the PUT method.

Upsert a record

Update a record with the PATCH method and if the external Id doesn't exist, it will insert a new record.

Delete a record

Delete a record with the DELETE method.

XML format

Change the request/response format to XML with the format key or make it default in your config file.

API Requests

With the exception of the search and query resources, all requests are made dynamically using method overloading. The available resources are stored in the user's session when they are authenticated.

First, determine which resources you have access to by calling:

or

Either will return the following array:

Next, you can call resources by referring to the specified key. For instance:

or

Resource urls can be extended by passing additional parameters into the first argument:

You can also add optional parameters to requests:

Additional API Requests

Refresh

If a refresh token is set, the server can refresh the access token on the user's behalf. Refresh tokens are only provided if you use the Web Server flow.

If you need a refresh token, be sure to specify this under access scope in your Connected App. You can also specify this in your configuration file by adding 'scope' => 'full refresh_token'. Setting scope access in the config file is optional, the default scope access is determined by your Salesforce org.

Revoke

This will revoke the authorization token. The session will continue to store a token, but it will become invalid.

Versions

Returns all currently supported versions. Includes the verison, label and link to each version's root:

Resources

Returns list of available resources for a specific API.

Identity

Returns information about the logged-in user.

Limits

Lists information about organizational limits. Available for API version 29.0 and later.

Note: this call is part of a pilot program and may not be availabe to all orgs without a request to Salesforce.

Describe

Describes all global objects availabe in the organization.

Query

Returns results for a specified SOQL query.

Query Explain

Returns details of how Salesforce will process your query. Available for API verison 30.0 or later.

Query All

Returns results for a specified SOQL query, but will also inlcude deleted records.

Search

Returns the specified SOSL query

Scope Order

Global search keeps track of which objects the user interacts with and arranges them when the user performs a global search. This call will return this ordered list of objects.

Search Layouts

Returns the search results layout for the objects in the query string. List should be formatted as a string, but delimited by a comma.

Suggested Articles

Returns a list of Salesforce Knowledge articles based on the a search query. Pass additional parameters into the second argument. Available for API verison 30.0 or later.

Salesforce Knowledge must be enabled for this to work.

Suggested Queries

Returns a list of suggested searches based on a search text query. Matches search queries that other users have performed in Salesforce Knowledge. Like Suggest Articles, additional parameters can be passed into the second argument with the parameters key. Available for API version 30.0 or later.

For a complete listing of API resources, refer to the Force.com REST API Developer's Guide

Custom Apex endpoints

If you create a custom API using Apex, you can use the custom() method for consuming them.

Additional options and parameters can be passed in like this:

Read Creating REST APIs using Apex REST for more information.


All versions of forrest with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
guzzlehttp/guzzle Version 4.2.2
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 pithstudio/forrest contains the following files

Loading the files please wait ....