PHPackages                             uuf6429/force.com-toolkit-for-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. uuf6429/force.com-toolkit-for-php

ActiveComposer-plugin[API Development](/categories/api)

uuf6429/force.com-toolkit-for-php
=================================

A wrapper for the Force.com Web Services SOAP API

v27.0.3(11y ago)124.1k11BSD-3-ClausePHP

Since Jul 9Pushed 7y ago4 watchersCompare

[ Source](https://github.com/uuf6429/Force.com-Toolkit-for-PHP)[ Packagist](https://packagist.org/packages/uuf6429/force.com-toolkit-for-php)[ RSS](/packages/uuf6429-forcecom-toolkit-for-php/feed)WikiDiscussions Major-refactor Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (1)

Force.com Toolkit for PHP
=========================

[](#forcecom-toolkit-for-php)

[![Build Status](https://camo.githubusercontent.com/57c8ac1bdb5a3378989656578ba018dfff555dfb684ff98d1b1df4ab55ffc8cd/68747470733a2f2f7472617669732d63692e6f72672f757566363432392f466f7263652e636f6d2d546f6f6c6b69742d666f722d5048502e7376673f6272616e63683d4d616a6f722d7265666163746f72)](https://travis-ci.org/uuf6429/Force.com-Toolkit-for-PHP)[![Minimum PHP Version](https://camo.githubusercontent.com/4cbdbfeca62402b9ca3d48503f2bf66fc9809569bcd6de47196d39fecff71e72/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/b9bb2882c590c136f1734be8992c34d4481973a981f68c9653293d4e0a0bcbc5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d425344253230332d2d436c617573652d6f72616e67652e737667)](LICENSE)[![Coverage](https://camo.githubusercontent.com/009150bcbe856564fa4d12b4627783a45744cf292de586ad421519c3541ff0dd/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f6d65747269633d636f7665726167652670726f6a6563743d466f7263652e636f6d2d546f6f6c6b69742d666f722d5048502533414d616a6f722d7265666163746f72)](https://sonarcloud.io/dashboard?id=Force.com-Toolkit-for-PHP%3AMajor-refactor)[![Packagist](https://camo.githubusercontent.com/31c278729adfa2522cbfc1a0cbb1e2b28e463e981005334aa8604703c828135c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f757566363432392f466f7263652e636f6d2d546f6f6c6b69742d666f722d5048502e737667)](https://packagist.org/packages/uuf6429/Force.com-Toolkit-for-PHP)

The Force.com PHP Toolkit provides an easy-to-use wrapper for the Force.com Web Services SOAP API, presenting SOAP client implementations for both the enterprise and partner WSDLs.

See the [getting started guide](https://developer.salesforce.com/page/PHP_Toolkit_13.0_Getting_Started) for sample code to create, retrieve, update and delete records in the Force.com database.

Upgrade
-------

[](#upgrade)

This newer version of the library is a major rewrite.

Migration should not be dificult since the public interface stayed the same or changed slightly (eg; some global constants are now class constants).

Here's an overview of what changed:

- **More Composer:** Requirements such as PHP extensions and 3rd-party PHP packages are now served through composer. This means once you install your extension with Composer, you won't have any further dependencies issues.
- **Namespacing:** Everything is now under `SForce` namespace. In particular this solves issues were very generic class names caused conflicts.
- **Cleaner Global Scope:** Since everything was moved to the namespace, things like constants or variables have also moved.
- **PSR-2:** Updated coding standard, also increases code quality. In particular, every class has its own file now.
- **Better Dev Env:** Contributing has become even easier. Code style is fixed automatically, running tests is easier, continuous test runs etc.
- **Bug Fixes:** Huge amount of bugs have been fixed: whitespace in output from some files, missing variables, redundant arguments, incorrect method calls etc...
- [**Schema Generator:**](#schema-generator) A tool for generating a rough DDL schema which you can use in your IDE to help writing SOQL queries.
- **Badges:** Now you can quickly get an overview of the project just by looking at the summary.
- [**Custom API Version:**](#wsdl-sources) You can use your own WSDL sources, which means you can use a different API version, potentially with access to more API entities.

These changes come at a cost. The minimum supported PHP version is PHP 5.6. It *might* work with older versions, but no guarantees. You should upgrade immediately if you are still using an [unsupported PHP version](http://php.net/supported-versions.php).

Installation
------------

[](#installation)

The easist way to include this library in your project is to use [Composer](getcomposer.org/):

```
composer require uuf6429/Force.com-Toolkit-for-PHP
```

Alternatively, the library can be loaded by any [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloader.

**Important:** This library generates classes from WSDL inside `src/SForce/Wsdl` by default. Please see [WSDL Class Path](#wsdl-class-path) section to change this behaviour.

Features
--------

[](#features)

### WSDL Sources

[](#wsdl-sources)

The WSDL can be customized for your desired version and source. You can either provide your own WSDL file(s) or having your own code providing these.

**Note:** This library relies on one specific WSDL source, so for example, you cannot connect to two (or more) API endpoints with different WSDL sources. In this case, pick a common API level and use it for all.

To use your own WSDL source, first you have to add an "extras" entry to your `composer.json` and then you need to pass the correct WSDL path to `$client->createConnection($wsdl)`. Here are a few `composer.json` examples:

- A class with a static method that returns a list of sources (as strings) ```
    {
        "extra": {
            "sforce-wsdl-source": "MyWsdlSource::getSource"
        }
    }
    ```
- A function that returns a list of sources (as strings) ```
    {
        "extra": {
            "sforce-wsdl-source": "myproject_get_wsdl_source"
        }
    }
    ```
- A list of URLs (must be accessible by composer) ```
    {
        "extra": {
            "sforce-wsdl-source": [
                "https://my-sforce.com/soap/enterprise.wsdl",
                "https://my-sforce.com/soap/partner.wsdl",
                "https://my-sforce.com/soap/metadata.wsdl"
            ]
        }
    }
    ```
- A list of local files (relative to project root) ```
    {
        "extra": {
            "sforce-wsdl-source": [
                "src/SForce/Wsdl/enterprise.wsdl",
                "src/SForce/Wsdl/partner.wsdl",
                "src/SForce/Wsdl/metadata.wsdl"
            ]
        }
    }
    ```

### WSDL Class Path

[](#wsdl-class-path)

As mentioned in the previous section, some classes are generated from the SOAP WSDL, even if the default settings are used. By default, these classes will end up in `src/SForce/Wsdl` of your project, however this can be changed via `composer.json`:

```
{
    "extra": {
        "sforce-wsdl-classpath": "cache/SForce"
    }
}
```

- **Note 1:** The autoloader is automatically updated to point to the class path. You don't need to change it yourself. In other words: class are loaded automatically.
- **Note 2:** Every time you change the location, make sure to delete the generated files from the previous location. The generator cannot clean up for you since it won't know about the previous location.

### Schema Generator

[](#schema-generator)

The [SchemaGen class](src/SchemaGen.php) is a simple tool that generates a rough DDL for the SOAP API. You can use the generated SQL schema file inside your IDE as a "DDL Data Source" (eg, in PhpStorm). This allows the IDE to suggest useful information when you're writing your SOQL queries. Here's how it looks like:

[![SchemaGen](https://camo.githubusercontent.com/227ae2836b9e499e39522fd6930b9861c2fced96fcdc6f0f348cbec58e659d50/68747470733a2f2f696d6766792e6d652f696d616765732f696d616765366237623063326662333233396238322e706e67)](https://camo.githubusercontent.com/227ae2836b9e499e39522fd6930b9861c2fced96fcdc6f0f348cbec58e659d50/68747470733a2f2f696d6766792e6d652f696d616765732f696d616765366237623063326662333233396238322e706e67)

Testing
-------

[](#testing)

Unit tests only require PHPUnit (installed by default via Composer), so you can simply run the following:

```
vendor/bin/phpunit test/Unit
```

Integration tests require a real SalesForce account and you need to provide the credentials as environment variables:

```
SALESFORCE_USER="john@doe.com"
SALESFORCE_PASS="Som3p4ssw0rd"
SALESFORCE_TOKEN="b0dca2fa0b3ef1a5bf5ba9dd6bdf0fca"
vendor/bin/phpunit test/Integration
```

TODO
----

[](#todo)

- Convert documentation to markdown
    - Point "getting started" link in readme to docs
- Use proper namespacing
- Add dependencies to composer (eg, ext-soap)
- Create tests
- Run tests against a developer edition
- Check and set up code coverage
- Final cleanup commit
    - replace `uuf6429` with `developerforce` (eg; readme, composer)
    - replace `Major-refactor` with `master` (eg; badges)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 68.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~257 days

Total

2

Last Release

4074d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/450767af6ef832ad662c169bf718d6d25c025c08b2d91b810959d190bccebba1?d=identicon)[uuf6429](/maintainers/uuf6429)

---

Top Contributors

[![uuf6429](https://avatars.githubusercontent.com/u/230049?v=4)](https://github.com/uuf6429 "uuf6429 (31 commits)")[![MarijnKoesen](https://avatars.githubusercontent.com/u/711208?v=4)](https://github.com/MarijnKoesen "MarijnKoesen (3 commits)")[![craigmarvelley](https://avatars.githubusercontent.com/u/265907?v=4)](https://github.com/craigmarvelley "craigmarvelley (3 commits)")[![MidnightLightning](https://avatars.githubusercontent.com/u/250250?v=4)](https://github.com/MidnightLightning "MidnightLightning (3 commits)")[![dcarroll](https://avatars.githubusercontent.com/u/116254?v=4)](https://github.com/dcarroll "dcarroll (2 commits)")[![sergoslav](https://avatars.githubusercontent.com/u/621072?v=4)](https://github.com/sergoslav "sergoslav (1 commits)")[![elidemayo](https://avatars.githubusercontent.com/u/1295393?v=4)](https://github.com/elidemayo "elidemayo (1 commits)")[![hjensen](https://avatars.githubusercontent.com/u/439705?v=4)](https://github.com/hjensen "hjensen (1 commits)")

### Embed Badge

![Health badge](/badges/uuf6429-forcecom-toolkit-for-php/health.svg)

```
[![Health](https://phpackages.com/badges/uuf6429-forcecom-toolkit-for-php/health.svg)](https://phpackages.com/packages/uuf6429-forcecom-toolkit-for-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
