Please enable JavaScript to view this site.

The manual for the JobRouter developer

Navigation: SDK > Interfaces

PathsInterface

Scroll Prev Top Next More

Methods

 

Method

Parameters

Parameter description

Return

Description

getDataPath

[$relativePath: null|string = '']

[$processName: null|string = '']

[$processVersion: int|null = null]

Optional relative path inside the data path (default: empty string)

Optional process name (default: empty string)

Optional process version (default: null)

string

Returns the JobRouter data path.

getFunctionsPath

[$relativePath: null|string = '']

[$processName: null|string = '']

[$processVersion: int|null = null]

Optional relative path inside the functions path (default: empty string)

Optional process name (default: empty string)

Optional process version (default: null)

string

Returns the JobRouter functions path with the optional relative path, optional process name and there optional process version.

getJobRouterUrl

-

-

string

Returns the JobRouter URL with corresponding slash (/) at the end.

getOutputPath

[$relativePath: string = '']

Optional relative path inside the output path (default: empty string)

string

Returns the JobRouter output path.

getTempPath

[$relativePath: string = '']

Optional relative path inside the temp path (default: empty string)

string

Returns the JobRouter temp path.

getUploadPath

[$relativePath: string = '']

[$skipAssert: bool|null = false]

Optional relative path inside the upload path (default: empty string)

Optional to skip assertion (default: false)

string

Returns the JobRouter upload path.

Example

 

<?php

 

use JobRouter\Sdk\PathsInterface;

 

return function (PathsInterface $pathsInterface): void {

    echo '<h1 style="color: #fc0">JobRouter SDK paths interface example!</h1>';

 

    try {

        echo '<pre>JobRouter URL: ' . print_r($pathsInterface->getJobRouterUrl(), true) . '</pre>';

        echo '<pre>Data path: ' . print_r($pathsInterface->getDataPath('extra/data/path', 'Example_Proccess', '1'), true) . '</pre>';

        echo '<pre>Functions path: ' . print_r($pathsInterface->getFunctionsPath(), true) . '</pre>';

        echo '<pre>Temp path: ' . print_r($pathsInterface->getTempPath(), true) . '</pre>';

        echo '<pre>Upload path: ' . print_r($pathsInterface->getUploadPath(), true) . '</pre>';

 

    } catch (\IllegalFilesystemAccessException|\JobRouterException $e) {

        echo '<h3 style="color: #f44;">JobRouter Helper error!</h3>';

        echo '<p style="color: #f44;">Message: ' . $e->getMessage() .  '</p>';

    }

};

 

Response:

 

JobRouter SDK paths interface example!

 

JobRouter URL: http://localhost/jobrouter

Data path: /var/jobrouter/data/Example_Proccess/1/extra/data/path

Functions path: /var/jobrouter/functions/

Temp path: /var/jobrouter/output/temp/

Upload path: /var/jobrouter/uploads/