PHPackages                             block-ops/directscale-sdk-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. [Framework](/categories/framework)
4. /
5. block-ops/directscale-sdk-php

ActiveLibrary[Framework](/categories/framework)

block-ops/directscale-sdk-php
=============================

Class Library For the DirectScale API

1.0.4(6y ago)021MITPHPPHP &gt;=5.6.0

Since Feb 9Pushed 6y agoCompare

[ Source](https://github.com/block-ops/directscale-sdk-php)[ Packagist](https://packagist.org/packages/block-ops/directscale-sdk-php)[ Docs](https://github.com/block-ops/directscale-sdk-php)[ RSS](/packages/block-ops-directscale-sdk-php/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (2)Versions (6)Used By (0)

PHP Framework for DirectScale
-----------------------------

[](#php-framework-for-directscale)

To create a connection, the current method is by creating a `define()` in your application which contains your API key.

This connection method will be updated as the framework matures, but for now it requires a `define()`. It's worth noting that setting `$env` to `'dev'` when creating the connection will set the connection to developer mode. In order to accommodate developer mode, you need to have a developer constant labelled `DIRECTSCALE_DEVAPIKEY`. You can also set the key manually in any version of the `Model`.

Also a note, the [Nubersoft Framework](https://github.com/rasclatt/nubersoft) is required for this framework.

Here is an example of fetching user data:

```
# Create define
define('DIRECTSCALE_APIKEY', 'your123prod456key543here210');
# Create instance
$DirectScale = new \DirectScale\User(54321);
# Get distributor details
print_r($DirectScale->getDistInfo());
```

### Example of common data functions:

[](#example-of-common-data-functions)

```
use \DirectScale\ {
	User,
	User\Subscription,
	Orders,
	Products,
	Stores
};

try {
	$User = new User('15F92');
	$Subscription =	new Subscription($User);
	$Orders = new Orders($User);
	$Products = new Products();
	$Stores = new Stores($Products);

	print_r([
		# Notice here that the autoship is appended to the user data
		# when creating instance of Subscription
		$User->getData(),
		# This will just fetch the autoship by itself
		$Subscription->getOrder(),
		# Fetches a list of all products
		$Products->get(),
		# Fetches a specific sku
		$Products->getBySku('EXAMPLESKU123'),
		# Fetches the store regions
		$Stores->getRegions(),
		# Fetches the store cateories
		$Stores->getCategories()
	]);
}
catch(\DirectScale\Exception $e) {
	# It is worth noting that getting a single product by sku requires the "optional" params
	# or it will return an error from DirectScale
	echo $e->getErrorTransactionId();
}
```

Setting Developer Mode
----------------------

[](#setting-developer-mode)

Before instanciating, use the static method with `dev` as the parameter:

```
use \DirectScale\ {
    Model as Connection,
    User
};
# You will need a "dev" version of the API key
define('DIRECTSCALE_DEVAPIKEY', 'your123dev456key654here321');
# You can also save your regular key
define('DIRECTSCALE_APIKEY', 'your123prod456key543here210');
# Set the dev mode here
Connection::setMode('dev'); # getDistInfo();
# Write out the api url
echo $User->getConnection()->getUrl();
```

This should produce the `dev` url:

```
https://dsapi-dev.directscale.com/v1/customers/?backofficeid=12345

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~12 days

Total

5

Last Release

2231d ago

Major Versions

0.0.4 → 1.0.42020-03-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d3360c141d1d4e372beb273efc69218d006e75c402523d1e1ef1aa7f65343f8?d=identicon)[block-ops](/maintainers/block-ops)

---

Top Contributors

[![rasclatt](https://avatars.githubusercontent.com/u/11168189?v=4)](https://github.com/rasclatt "rasclatt (36 commits)")

---

Tags

apiframeworkmlmDirectScale

### Embed Badge

![Health badge](/badges/block-ops-directscale-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/block-ops-directscale-sdk-php/health.svg)](https://phpackages.com/packages/block-ops-directscale-sdk-php)
```

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

41.5k328.9k1](/packages/ccxt-ccxt)[lanin/laravel-api-debugger

Easily debug your JSON API.

2311.8M](/packages/lanin-laravel-api-debugger)[gotzmann/comet

Modern PHP framework for building blazing fast REST APIs and microservices

68816.2k1](/packages/gotzmann-comet)[psx/psx

PHP REST API Framework

17112.6k2](/packages/psx-psx)[abydahana/aksara

Aksara is a CodeIgniter based CRUD Toolkit you can use to build complex applications become shorter, secure and more reliable just in a few lines of code. Serving both CMS or Framework, produce both HEADLESS (RESTful API) or TRADITIONAL (Browser Based), just by writing single controller. Yet it's reusable, scalable and ready to use!

1121.2k](/packages/abydahana-aksara)

PHPackages © 2026

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