FacturaScripts

Updater extends Controller
in package

Description of Updater

Tags
author

Carlos García Gómez [email protected]

Table of Contents

CORE_ZIP_FOLDER  = 'facturascripts'
UPDATE_CORE_URL  = 'https://facturascripts.com/DownloadBuild'
$coreUpdateWarnings  : array<string|int, mixed>
$empresa  : Empresa
Selected company.
$multiRequestProtection  : MultiRequestProtection
$permissions  : ControllerPermissions
User permissions on this controller.
$request  : Request
Request on which we can get data.
$telemetryManager  : TelemetryManager
$title  : string
Title of the page.
$updaterItems  : array<string|int, mixed>
$uri  : string
Given uri, default is empty.
$user  : User|false
User logged in.
$dataBase  : DataBase
It provides direct access to the database.
$response  : Response
HTTP Response object.
$className  : string
Name of the class of the controller (although its in inheritance from this class, the name of the final class we will have here)
$template  : string|false
Name of the file for the template.
__construct()  : mixed
Initialize all objects and properties.
addExtension()  : mixed
getCoreVersion()  : float
getPageData()  : array<string|int, mixed>
Return the basic data for this page.
getTemplate()  : string|false
Return the template to use for this controller.
pipe()  : mixed
pipeFalse()  : bool
privateCore()  : mixed
Runs the controller's private logic.
publicCore()  : mixed
Execute the public part of the controller.
redirect()  : mixed
Redirect to an url or controller.
run()  : void
setTemplate()  : bool
Set the template to use for this controller.
toolBox()  : ToolBox
url()  : string
Return the URL of the actual controller.
execAction()  : void
getClassName()  : string
Return the name of the controller.
validateFormToken()  : bool
Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated
auth()  : bool
cancelAction()  : void
Remove downloaded file.
checkPhpVersion()  : void
downloadAction()  : void
Download selected update.
getUpdateItems()  : array<string|int, mixed>
getUpdateItemsCore()  : array<string|int, mixed>
getUpdateItemsPlugin()  : array<string|int, mixed>
postUpdateAction()  : void
setCoreWarnings()  : void
updateAction()  : void
Extract zip file and update all files.
updateCore()  : bool
updatePlugin()  : bool
willItWorkOnNewCore()  : bool

Constants

CORE_ZIP_FOLDER

public mixed CORE_ZIP_FOLDER = 'facturascripts'

UPDATE_CORE_URL

public mixed UPDATE_CORE_URL = 'https://facturascripts.com/DownloadBuild'

Properties

$coreUpdateWarnings

public array<string|int, mixed> $coreUpdateWarnings = []

$request

Request on which we can get data.

public Request $request

$title

Title of the page.

public string $title

título de la página.

$updaterItems

public array<string|int, mixed> $updaterItems = []

$uri

Given uri, default is empty.

public string $uri

$response

HTTP Response object.

protected Response $response

$className

Name of the class of the controller (although its in inheritance from this class, the name of the final class we will have here)

private string $className

CLASS

$template

Name of the file for the template.

private string|false $template

nombre_archivo.html.twig

Methods

__construct()

Initialize all objects and properties.

public __construct(string $className[, string $uri = '' ]) : mixed
Parameters
$className : string
$uri : string = ''
Return values
mixed

addExtension()

public static addExtension(mixed $extension) : mixed
Parameters
$extension : mixed
Return values
mixed

getCoreVersion()

public getCoreVersion() : float
Return values
float

getPageData()

Return the basic data for this page.

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

getTemplate()

Return the template to use for this controller.

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

pipe()

public pipe(string $name, array<string|int, mixed> ...$arguments) : mixed
Parameters
$name : string
$arguments : array<string|int, mixed>
Return values
mixed

pipeFalse()

public pipeFalse(string $name, array<string|int, mixed> ...$arguments) : bool
Parameters
$name : string
$arguments : array<string|int, mixed>
Return values
bool

publicCore()

Execute the public part of the controller.

public publicCore(Response &$response) : mixed
Parameters
$response : Response
Return values
mixed

redirect()

Redirect to an url or controller.

public redirect(string $url, int $delay) : mixed
Parameters
$url : string
$delay : int
Return values
mixed

run()

public run() : void
Return values
void

setTemplate()

Set the template to use for this controller.

public setTemplate(string|false $template) : bool
Parameters
$template : string|false
Return values
bool

url()

Return the URL of the actual controller.

public url() : string
Return values
string

execAction()

protected execAction(string $action) : void
Parameters
$action : string
Return values
void

getClassName()

Return the name of the controller.

protected getClassName() : string
Return values
string

validateFormToken()

Check request token. Returns an error if: - the token does not exist - the token is invalid - the token is duplicated

protected validateFormToken() : bool
Return values
bool

auth()

private auth() : bool
Return values
bool

cancelAction()

Remove downloaded file.

private cancelAction() : void
Return values
void

checkPhpVersion()

private checkPhpVersion(float $min) : void
Parameters
$min : float
Return values
void

downloadAction()

Download selected update.

private downloadAction() : void
Return values
void

getUpdateItems()

private getUpdateItems() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUpdateItemsCore()

private getUpdateItemsCore() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUpdateItemsPlugin()

private getUpdateItemsPlugin(Plugin $plugin) : array<string|int, mixed>
Parameters
$plugin : Plugin
Return values
array<string|int, mixed>

postUpdateAction()

private postUpdateAction() : void
Return values
void

setCoreWarnings()

private setCoreWarnings() : void
Return values
void

updateAction()

Extract zip file and update all files.

private updateAction() : void
Return values
void

updateCore()

private updateCore(ZipArchive $zip, string $fileName) : bool
Parameters
$zip : ZipArchive
$fileName : string
Return values
bool

updatePlugin()

private updatePlugin(ZipArchive $zip, string $fileName) : bool
Parameters
$zip : ZipArchive
$fileName : string
Return values
bool

willItWorkOnNewCore()

private willItWorkOnNewCore(Plugin $plugin, float $newCore) : bool
Parameters
$plugin : Plugin
$newCore : float
Return values
bool

Search results