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
$cache
protected
FilesystemCache
$cache
$items
protected
array<string|int, mixed>
$items
= []
$raw
protected
string
$raw
The cached data previously fetched
$repository
protected
string
$repository
= 'https://getgrav.org/downloads/grav.json'
$type
protected
string
$type
$data
private
array<string|int, mixed>
$data
$date
private
string
$date
$min_php
private
string|null
$min_php
$version
private
string
$version
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
__toString()
Convents iterator to a comma separated list.
public
__toString() : string
Attributes
- #[ReturnTypeWillChange]
Return values
stringappend()
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
$thisfetch()
public
fetch([bool $refresh = false ][, callable|null $callback = null ]) : string
Parameters
- $refresh : bool = false
- $callback : callable|null = null
Return values
stringfilter()
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
$thisfirst()
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
stringgetMinPHPVersion()
Returns the minimum PHP version
public
getMinPHPVersion() : string
Return values
stringgetVersion()
Returns the latest version of Grav available remotely
public
getVersion() : string
Return values
stringindexOf()
public
indexOf(mixed $needle) : string|int|false
Parameters
- $needle : mixed
-
Searched value.
Return values
string|int|false —Key if found, otherwise false.
isSymlink()
Is this installation symlinked?
public
isSymlink() : bool
Return values
boolisUpdatable()
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|boolprev()
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
$thisremove()
Remove item from the list.
public
remove(string $key) : void
Parameters
- $key : string
reverse()
Reverse the Iterator
public
reverse() : $this
Return values
$thisshuffle()
Shuffle items.
public
shuffle() : $this
Return values
$thisslice()
Slice the list.
public
slice(int $offset[, int|null $length = null ]) : $this
Parameters
- $offset : int
- $length : int|null = null
Return values
$thissort()
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>toArray()
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toJson()
public
toJson() : string