Documentation

PageSystemValidatorCommand extends GravCommand
in package

Class PageSystemValidatorCommand

Table of Contents

Properties

$argv  : string
$grav  : Grav
$input  : InputInterface
$local_config  : array<string|int, mixed>
$output  : SymfonyStyle
$tests  : array<string|int, mixed>
$pages_initialized  : bool
$plugins_initialized  : bool
$themes_initialized  : bool

Methods

addOption()  : $this
Adds an option.
clearCache()  : int
composerUpdate()  : string|false
getInput()  : InputInterface
getIO()  : SymfonyStyle
invalidateCache()  : void
isGravInstance()  : void
loadLocalConfig()  : string|false
Load the local config file
setupConsole()  : void
Set colors style definition for the formatter.
configure()  : void
execute()  : int
initializeGrav()  : $this
Initialize Grav.
initializePages()  : $this
Properly initialize pages.
initializePlugins()  : $this
Properly initialize plugins.
initializeThemes()  : $this
Properly initialize themes.
serve()  : int
Override with your implementation.
setLanguage()  : $this
Set language to be used in CLI.
setupGrav()  : void
check()  : array<string|int, mixed>
getFile()  : CompiledYamlFile
record()  : array<string|int, mixed>
recordRow()  : array<string|int, mixed>

Properties

$local_config

protected array<string|int, mixed> $local_config

$tests

protected array<string|int, mixed> $tests = [ // Content 'header' => [[]], 'summary' => [[], [200], [200, true]], 'content' => [[]], 'getRawContent' => [[]], 'rawMarkdown' => [[]], 'value' => [ ['content'], ['route'], ['order'], ['ordering'], ['folder'], ['slug'], ['name'], /*['frontmatter'],*/ ['header.menu'], ['header.slug'], ], 'title' => [[]], 'menu' => [[]], 'visible' => [[]], 'published' => [[]], 'publishDate' => [[]], 'unpublishDate' => [[]], 'process' => [[]], 'slug' => [[]], 'order' => [[]], //'id' => [[]], 'modified' => [[]], 'lastModified' => [[]], 'folder' => [[]], 'date' => [[]], 'dateformat' => [[]], 'taxonomy' => [[]], 'shouldProcess' => [['twig'], ['markdown']], 'isPage' => [[]], 'isDir' => [[]], 'exists' => [[]], // Forms 'forms' => [[]], // Routing 'urlExtension' => [[]], 'routable' => [[]], 'link' => [[], [false], [true]], 'permalink' => [[]], 'canonical' => [[], [false], [true]], 'url' => [[], [true], [true, true], [true, true, false], [false, false, true, false]], 'route' => [[]], 'rawRoute' => [[]], 'routeAliases' => [[]], 'routeCanonical' => [[]], 'redirect' => [[]], 'relativePagePath' => [[]], 'path' => [[]], //'folder' => [[]], 'parent' => [[]], 'topParent' => [[]], 'currentPosition' => [[]], 'active' => [[]], 'activeChild' => [[]], 'home' => [[]], 'root' => [[]], // Translations 'translatedLanguages' => [[], [false], [true]], 'untranslatedLanguages' => [[], [false], [true]], 'language' => [[]], // Legacy 'raw' => [[]], 'frontmatter' => [[]], 'httpResponseCode' => [[]], 'httpHeaders' => [[]], 'blueprintName' => [[]], 'name' => [[]], 'childType' => [[]], 'template' => [[]], 'templateFormat' => [[]], 'extension' => [[]], 'expires' => [[]], 'cacheControl' => [[]], 'ssl' => [[]], 'metadata' => [[]], 'eTag' => [[]], 'filePath' => [[]], 'filePathClean' => [[]], 'orderDir' => [[]], 'orderBy' => [[]], 'orderManual' => [[]], 'maxCount' => [[]], 'modular' => [[]], 'modularTwig' => [[]], //'children' => [[]], 'isFirst' => [[]], 'isLast' => [[]], 'prevSibling' => [[]], 'nextSibling' => [[]], 'adjacentSibling' => [[]], 'ancestor' => [[]], //'inherited' => [[]], //'inheritedField' => [[]], 'find' => [['/']], //'collection' => [[]], //'evaluate' => [[]], 'folderExists' => [[]], ]

$pages_initialized

private bool $pages_initialized = false

$plugins_initialized

private bool $plugins_initialized = false

$themes_initialized

private bool $themes_initialized = false

Methods

addOption()

Adds an option.

public addOption(string $name[, string|array<string|int, mixed>|null $shortcut = null ][, int|null $mode = null ][, string $description = '' ][, string|array<string|int, string>|int|bool|null $default = null ]) : $this
Parameters
$name : string

The option name

$shortcut : string|array<string|int, mixed>|null = null

The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts

$mode : int|null = null

The option mode: One of the InputOption::VALUE_* constants

$description : string = ''

A description text

$default : string|array<string|int, string>|int|bool|null = null

The default value (must be null for InputOption::VALUE_NONE)

Tags
throws
InvalidArgumentException

If option mode is invalid or incompatible

Return values
$this

clearCache()

public clearCache([array<string|int, mixed> $all = [] ]) : int
Parameters
$all : array<string|int, mixed> = []
Tags
throws
Exception
Return values
int

composerUpdate()

public composerUpdate(string $path[, string $action = 'install' ]) : string|false
Parameters
$path : string
$action : string = 'install'
Return values
string|false

getInput()

public getInput() : InputInterface
Return values
InputInterface

getIO()

public getIO() : SymfonyStyle
Return values
SymfonyStyle

isGravInstance()

public isGravInstance(string $path) : void
Parameters
$path : string

loadLocalConfig()

Load the local config file

public loadLocalConfig() : string|false
Return values
string|false

The local config file name. false if local config does not exist

setupConsole()

Set colors style definition for the formatter.

public setupConsole(InputInterface $input, OutputInterface $output) : void
Parameters
$input : InputInterface
$output : OutputInterface

execute()

protected execute(InputInterface $input, OutputInterface $output) : int
Parameters
$input : InputInterface
$output : OutputInterface
Return values
int

initializeGrav()

Initialize Grav.

protected final initializeGrav() : $this
  • Load configuration
  • Initialize logger
  • Disable debugger
  • Set timezone, locale
  • Load plugins (call PluginsLoadedEvent)
  • Set Pages and Users type to be used in the site

Safe to be called multiple times.

Return values
$this

initializePages()

Properly initialize pages.

protected final initializePages() : $this
  • call $this->initializeThemes()
  • initialize assets (call onAssetsInitialized event)
  • initialize twig (calls the twig events)
  • initialize pages (calls onPagesInitialized event)

Safe to be called multiple times.

Return values
$this

initializePlugins()

Properly initialize plugins.

protected final initializePlugins() : $this
  • call $this->initializeGrav()
  • call onPluginsInitialized event

Safe to be called multiple times.

Return values
$this

initializeThemes()

Properly initialize themes.

protected final initializeThemes() : $this
  • call $this->initializePlugins()
  • initialize theme (call onThemeInitialized event)

Safe to be called multiple times.

Return values
$this

setLanguage()

Set language to be used in CLI.

protected final setLanguage([string|null $code = null ]) : $this
Parameters
$code : string|null = null
Return values
$this

check()

private check(array<string|int, mixed> $old, array<string|int, mixed> $new) : array<string|int, mixed>
Parameters
$old : array<string|int, mixed>
$new : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results