Properties

$userargent

$userargent : string

Type

string — The useragent-name defined by the api-user.

$spiget

$spiget : string

Type

string — The url of the spiget-api.

$throwExceptions

$throwExceptions : boolean

Type

boolean — Used to toggle exception throwing.

Methods

getAuthor()

getAuthor(  $author) : array

Get a authors detailed record.

Parameters

$author

string The name or id of the author.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getAuthorList()

getAuthorList(integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a list of authors.

Parameters

integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getAuthorReviews()

getAuthorReviews(string  $author, integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get the reviews of an specific author.

Parameters

string $author

The authors name or id.

integer $size

The results max. size.

integer $page

The page you want to get.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getAuthorResources()

getAuthorResources(string  $author, integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get the resources of an specific author.

Parameters

string $author

The authors name or id.

integer $size

The results max. size.

integer $page

The page you want to get.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getCategoryList()

getCategoryList(integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a list of categories.

Parameters

integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getCategory()

getCategory(string  $category) : array

Get detailed information about an specific category.

Parameters

string $category

The name or id of the category.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getCategoryResources()

getCategoryResources(  $category, integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a list of resources of an specific category.

Parameters

$category
integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getResource()

getResource(  $resource) : array

Get detailed information about an specific resource.

Parameters

$resource

string The resource.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getResourceAuthor()

getResourceAuthor(  $resource) : array

Get detailed information about the author of an specific resource.

Parameters

$resource

string The resource.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getResourceReviews()

getResourceReviews(string  $resource, integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a list of resource-reviews of an specific resource.

Parameters

string $resource

The resource you want to read the reviews of.

integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getResourceUpdates()

getResourceUpdates(string  $resource, integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a list of updates for an specific resource.

Parameters

string $resource

The resource you want get the list for.

integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getResourceVersionList()

getResourceVersionList(string  $resource, integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a resources versions.

Parameters

string $resource

The resource you want get the versions of.

integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getSearchResource()

getSearchResource(string  $resource, integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a resource-search results.

.

Parameters

string $resource

The resource-name you're looking for..

integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getResourceList()

getResourceList(integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a list of resources.

Parameters

integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getFreeResourceList()

getFreeResourceList(integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a list of free resources.

Parameters

integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getPremiumResourceList()

getPremiumResourceList(integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a list of premium resources.

Parameters

integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getNewResourceList()

getNewResourceList(integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a list of the newest resources.

Parameters

integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getResourcesForVersion()

getResourcesForVersion(  $version,   $method = 'any', integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get a list of resources for an specific version of minecraft/spigot.

Parameters

$version
$method
integer $size

The size of the list.

integer $page

The page of the list.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getSearchAuthors()

getSearchAuthors(string  $author, string  $field = SPIGET4PHP_DEFAULT, integer  $size = SPIGET4PHP_DEFAULT, integer  $page = SPIGET4PHP_DEFAULT, string  $sort = SPIGET4PHP_DEFAULT, array  $fields = SPIGET4PHP_DEFAULT) : array

Get the search-result for an specific username.

Parameters

string $author

The authors name or id.

string $field

The field you want to search in.

integer $size

The results max. size.

integer $page

The page you want to get.

string $sort

Sort the list with + for ascending and - for descending in front of the field you want to sort by.

array $fields

The fields you want to receive.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

getAPIStatus()

getAPIStatus() : array

Get the api-status.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array

setThrowExceptions()

setThrowExceptions(  $enabled) 

Set the throw-exceptions option.

Parameters

$enabled

bool Enabled or disabled.

isThrowingExceptions()

isThrowingExceptions() : boolean

To enable or disable exception throwing use the setThrowExceptions function.

Returns

boolean —

True if throwing exceptions is enabled.

getInstance()

getInstance(string  $useragent = 'Spiget4PHP') : \de\m4taiori\spiget4php\SpigetAPI

Get the current instance of the api-wrapper or create a new one.

Parameters

string $useragent

The name of the wrappers-useragent.

Returns

\de\m4taiori\spiget4php\SpigetAPI

__construct()

__construct(  $useragent) 

SpigetAPI constructor.

Parameters

$useragent

string The useragent-name you want to use.

getResult()

getResult(  $function,   $args = array(),   $post = false) : array

Get the result of an api-request.

Parameters

$function

string The rest-function you want to access.

$args

array Assoc containing the arguments transmitted within the url.

$post

bool Use post instead of get.

Throws

\de\m4taiori\spiget4php\exceptions\SpigetException

Returns

array