Documentation

GravCore extends AbstractPackageCollection
in package

Class GravCore

Table of Contents

Properties

$cache  : FilesystemCache
$items  : array<string|int, mixed>
$raw  : string
$repository  : string
$type  : string
$data  : array<string|int, mixed>
$date  : string
$min_php  : string|null
$version  : string

Methods

__call()  : mixed
Convert function calls for the existing keys into their values.
__clone()  : mixed
Clone the iterator.
__construct()  : mixed
AbstractPackageCollection constructor.
__toString()  : string
Convents iterator to a comma separated list.
append()  : $this
Append new elements to the list.
fetch()  : string
filter()  : $this
Filter elements from the list
first()  : mixed
Get the first item
getAssets()  : array<string|int, mixed>
Returns the list of assets associated to the latest version of Grav
getChangelog()  : array<string|int, mixed>
Returns the changelog list for each version of Grav
getDate()  : string
Return the release date of the latest Grav
getMinPHPVersion()  : string
Returns the minimum PHP version
getVersion()  : string
Returns the latest version of Grav available remotely
indexOf()  : string|int|false
isSymlink()  : bool
Is this installation symlinked?
isUpdatable()  : mixed
Determine if this version of Grav is eligible to be updated
last()  : mixed
Get the last item
nth()  : mixed|bool
Return nth item.
prev()  : mixed
Return previous item.
random()  : $this
Pick one or more random entries.
remove()  : void
Remove item from the list.
reverse()  : $this
Reverse the Iterator
shuffle()  : $this
Shuffle items.
slice()  : $this
Slice the list.
sort()  : $this|array<string|int, mixed>
Sorts elements from the list and returns a copy of the list in the proper order
toArray()  : array<string|int, mixed>
toJson()  : string

Properties

$items

protected array<string|int, mixed> $items = []

$repository

protected string $repository = 'https://getgrav.org/downloads/grav.json'

$data

private array<string|int, mixed> $data

Methods

__call()

Convert function calls for the existing keys into their values.

public __call(string $key, mixed $args) : mixed
Parameters
$key : string
$args : mixed
Attributes
#[ReturnTypeWillChange]

__clone()

Clone the iterator.

public __clone() : mixed
Attributes
#[ReturnTypeWillChange]

__construct()

AbstractPackageCollection constructor.

public __construct([bool $refresh = false ][, callable|null $callback = null ]) : mixed
Parameters
$refresh : bool = false
$callback : callable|null = null
Tags
throws
InvalidArgumentException

__toString()

Convents iterator to a comma separated list.

public __toString() : string
Attributes
#[ReturnTypeWillChange]
Return values
string

append()

Append new elements to the list.

public append(array<string|int, mixed>|Iterator $items) : $this
Parameters
$items : array<string|int, mixed>|Iterator

Items to be appended. Existing keys will be overridden with the new values.

Return values
$this

fetch()

public fetch([bool $refresh = false ][, callable|null $callback = null ]) : string
Parameters
$refresh : bool = false
$callback : callable|null = null
Return values
string

filter()

Filter elements from the list

public filter([callable|null $callback = null ]) : $this
Parameters
$callback : callable|null = null

A function the receives ($value, $key) and must return a boolean to indicate filter status

Return values
$this

first()

Get the first item

public first() : mixed

getAssets()

Returns the list of assets associated to the latest version of Grav

public getAssets() : array<string|int, mixed>
Return values
array<string|int, mixed>

list of assets

getChangelog()

Returns the changelog list for each version of Grav

public getChangelog([string|null $diff = null ]) : array<string|int, mixed>
Parameters
$diff : string|null = null

the version number to start the diff from

Return values
array<string|int, mixed>

changelog list for each version

getDate()

Return the release date of the latest Grav

public getDate() : string
Return values
string

getMinPHPVersion()

Returns the minimum PHP version

public getMinPHPVersion() : string
Return values
string

getVersion()

Returns the latest version of Grav available remotely

public getVersion() : string
Return values
string

indexOf()

public indexOf(mixed $needle) : string|int|false
Parameters
$needle : mixed

Searched value.

Return values
string|int|false

Key if found, otherwise false.

Is this installation symlinked?

public isSymlink() : bool
Return values
bool

isUpdatable()

Determine if this version of Grav is eligible to be updated

public isUpdatable() : mixed

last()

Get the last item

public last() : mixed

nth()

Return nth item.

public nth(int $key) : mixed|bool
Parameters
$key : int
Return values
mixed|bool

prev()

Return previous item.

public prev() : mixed

random()

Pick one or more random entries.

public random([int $num = 1 ]) : $this
Parameters
$num : int = 1

Specifies how many entries should be picked.

Return values
$this

remove()

Remove item from the list.

public remove(string $key) : void
Parameters
$key : string

reverse()

Reverse the Iterator

public reverse() : $this
Return values
$this

shuffle()

Shuffle items.

public shuffle() : $this
Return values
$this

slice()

Slice the list.

public slice(int $offset[, int|null $length = null ]) : $this
Parameters
$offset : int
$length : int|null = null
Return values
$this

sort()

Sorts elements from the list and returns a copy of the list in the proper order

public sort([callable|null $callback = null ][, bool $desc = false ]) : $this|array<string|int, mixed>
Parameters
$callback : callable|null = null
$desc : bool = false
Return values
$this|array<string|int, mixed>

        
On this page

Search results