Download the PHP package cnsdose/salesforce-php without Composer

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

Salesforce PHP SDK Build Status

Installation

  1. composer require cnsdose/salesforce-php
  2. Register service provider

    1. Laravel

    2. Lumen

    3. Others

      Laravel/Lumen is optional, as long as you can provide a config($key, $default) function, e.g.

  3. php artisan vendor:publish --provider='CNSDose\Salesforce\Providers\SalesforceProvider'

Configuration

See config/salesforce.php.

Records API (REST API)

Query Records

The query builder only supports a small subset of SOQL clauses currently.

Basic Usage

NOTE: salesforce-php does not support automatic quoting/escaping yet.

Resolving Relationships

Nested Query

Raw Query

Query by ID

This method retrieves all defined fields in Salesforce, even if they are not specified in the corresponding class or config/salesfore.php.

Create/Update/Delete Records

Create a record

Upsert/Delete a record

Conversion Rules

Conversion rules allows attributes to be automatically converted/formatted.

Built-In Rules

Built-in rules are registered at \CNSDose\Salesforce\Support\Conversion\BaseConversion::$conversions.

Some rules allow parameters, e.g. number:16,2 mean 16 digits to the left of decimal point and 2 to the right.

Custom Rules

  1. Create a class which is derived from \CNSDose\Salesforce\Support\Conversion\BaseConversion
  2. Implement required methods
    1. doDecode: post-processes data after downloaded from API
    2. doEncode: pre-process data before uploaded to API
  3. Register rule via \CNSDose\Salesforce\Support\Conversion\BaseConversion::registerRule
  4. Rule parameters: format rule_name:arg1,arg2 can be used to pass arguments to the corresponding class constructor, an example could be \CNSDose\Salesforce\Support\Conversion\Number

Custom Fields

Custom fields can be defined in config/salesforce.php. Custom fields take precedence over default fields in case of conflicts between names.

Example

Adding 3 custom fields, with conversion rules where applicable, to object Custom

Custom Objects

Models can be automatically generated for custom objects that have been defined in Salesforce via Artisan command salesforce:generate-record-model.

Example

Custom Type-Rule Mapping

One could use \CNSDose\Salesforce\Console\GenerateRecordModel::addTypeRule to map a Salesforce type to a PHP type/conversion rule for convenience.

Common mappings are already defined in GenerateRecordModel.

Metadata API (SOAP API)

Create/Read/Rename/Update/Upsert/Delete

How to use a different version of Salesforce APIs

  1. In Salesforce Lightning Experience, download Metadata WSDL from Setup | Integrations | API and save it in your project
  2. Update api_version and metadata_wsdl in configuration file
  3. Use commands salesforce:generate-metadata-model and salesforce:generate-record-model to generate models (update_models.sh in this library could be a good start)

All versions of salesforce-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.0
ext-json Version *
ext-soap Version *
ext-xmlreader Version *
guzzlehttp/guzzle Version ^6.3
firebase/php-jwt Version ^5.0
myclabs/php-enum Version ^1.6
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 cnsdose/salesforce-php contains the following files

Loading the files please wait ....