Updater
extends Controller
in package
Description of Updater
Table of Contents
Constants
- CORE_ZIP_FOLDER : mixed = 'facturascripts'
- UPDATE_CORE_URL : mixed = 'https://facturascripts.com/DownloadBuild'
Properties
- $coreUpdateWarnings : array<string|int, mixed>
- $empresa : Empresa
- Empresa seleccionada.
- $justRegistered : bool
- $multiRequestProtection : MultiRequestProtection
- $permissions : ControllerPermissions
- Permisos del usuario sobre este controlador.
- $request : Request
- Petición de la que podemos obtener datos.
- $telemetryManager : Telemetry
- $title : string
- Título de la página.
- $updaterItems : array<string|int, mixed>
- $uri : string
- URI dada, por defecto vacía.
- $user : User|false
- Usuario que ha iniciado sesión.
- $dataBase : DataBase
- Proporciona acceso directo a la base de datos.
- $response : Response
- Objeto de respuesta HTTP.
Methods
- __construct() : mixed
- Inicializa todos los objetos y propiedades.
- addExtension() : mixed
- getCoreVersion() : float
- getPageData() : array<string|int, mixed>
- Devuelve los datos básicos de esta página (nombre, título, icono, menú, etc.).
- getTemplate() : string|false
- Devuelve la plantilla a usar para este controlador.
- getUpdateItems() : array<string|int, mixed>
- hasErrorFiles() : bool
- pipe() : mixed
- pipeFalse() : bool
- privateCore() : mixed
- Ejecuta la lógica privada del controlador.
- publicCore() : mixed
- Ejecuta la parte pública del controlador.
- redirect() : mixed
- Redirige a una url o controlador.
- request() : Request
- run() : void
- setTemplate() : bool
- Establece la plantilla a usar para este controlador.
- url() : string
- Devuelve la URL del controlador actual.
- db() : DataBase
- execAction() : void
- getClassName() : string
- Devuelve el nombre del controlador.
- response() : Response
- setCompany() : void
- Selecciona la empresa indicada, salvo que esté vacía o ya sea la cargada.
- validateFormToken() : bool
- Comprueba el token de la petición. Devuelve un error si: - el token no existe - el token no es válido - el token está duplicado
- cancelAction() : void
- Remove downloaded file.
- deleteCrashFilesAction() : void
- disableBetaUpdatesAction() : void
- downloadAction() : void
- Download selected update.
- getUpdateItemsCore() : array<string|int, mixed>
- getUpdateItemsPlugin() : array<string|int, mixed>
- notWritableFolders() : array<string|int, mixed>
- postUpdateAction() : void
- sendCrashFilesAction() : 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
= []
$empresa
Empresa seleccionada.
public
Empresa
$empresa
$justRegistered
public
bool
$justRegistered
= false
$multiRequestProtection
public
MultiRequestProtection
$multiRequestProtection
$permissions
Permisos del usuario sobre este controlador.
public
ControllerPermissions
$permissions
$request
Petición de la que podemos obtener datos.
public
Request
$request
$telemetryManager
public
Telemetry
$telemetryManager
$title
Título de la página.
public
string
$title
título de la página.
$updaterItems
public
array<string|int, mixed>
$updaterItems
= []
$uri
URI dada, por defecto vacía.
public
string
$uri
$user
Usuario que ha iniciado sesión.
public
User|false
$user
= false
$dataBase
Proporciona acceso directo a la base de datos.
protected
DataBase
$dataBase
$response
Objeto de respuesta HTTP.
protected
Response
$response
Methods
__construct()
Inicializa todos los objetos y propiedades.
public
__construct(string $className[, string $uri = '' ]) : mixed
Parameters
- $className : string
- $uri : string = ''
addExtension()
public
static addExtension(mixed $extension) : mixed
Parameters
- $extension : mixed
getCoreVersion()
public
static getCoreVersion() : float
Return values
floatgetPageData()
Devuelve los datos básicos de esta página (nombre, título, icono, menú, etc.).
public
getPageData() : array<string|int, mixed>
Esta función solamente sirve para eso. No se debe añadir aquí ningún otro código, ya que en este punto el usuario ni siquiera se ha logueado todavía.
Return values
array<string|int, mixed>getTemplate()
Devuelve la plantilla a usar para este controlador.
public
getTemplate() : string|false
Return values
string|falsegetUpdateItems()
public
static getUpdateItems() : array<string|int, mixed>
Return values
array<string|int, mixed>hasErrorFiles()
public
hasErrorFiles() : bool
Return values
boolpipe()
public
pipe(string $name, array<string|int, mixed> ...$arguments) : mixed
Parameters
- $name : string
- $arguments : array<string|int, mixed>
pipeFalse()
public
pipeFalse(string $name, array<string|int, mixed> ...$arguments) : bool
Parameters
- $name : string
- $arguments : array<string|int, mixed>
Return values
boolprivateCore()
Ejecuta la lógica privada del controlador.
public
privateCore(Response &$response, User $user, ControllerPermissions $permissions) : mixed
Parameters
- $response : Response
- $user : User
- $permissions : ControllerPermissions
publicCore()
Ejecuta la parte pública del controlador.
public
publicCore(Response &$response) : mixed
Parameters
- $response : Response
redirect()
Redirige a una url o controlador.
public
redirect(string $url[, int $delay = 0 ]) : mixed
Parameters
- $url : string
- $delay : int = 0
request()
public
request() : Request
Return values
Requestrun()
public
run() : void
setTemplate()
Establece la plantilla a usar para este controlador.
public
setTemplate(string|false $template) : bool
Parameters
- $template : string|false
Return values
boolurl()
Devuelve la URL del controlador actual.
public
url() : string
Return values
stringdb()
protected
db() : DataBase
Return values
DataBaseexecAction()
protected
execAction(string $action) : void
Parameters
- $action : string
getClassName()
Devuelve el nombre del controlador.
protected
getClassName() : string
Return values
stringresponse()
protected
response() : Response
Return values
ResponsesetCompany()
Selecciona la empresa indicada, salvo que esté vacía o ya sea la cargada.
protected
setCompany(int|null $idempresa) : void
Parameters
- $idempresa : int|null
validateFormToken()
Comprueba el token de la petición. Devuelve un error si: - el token no existe - el token no es válido - el token está duplicado
protected
validateFormToken() : bool
Return values
boolcancelAction()
Remove downloaded file.
private
cancelAction() : void
deleteCrashFilesAction()
private
deleteCrashFilesAction() : void
disableBetaUpdatesAction()
private
disableBetaUpdatesAction() : void
downloadAction()
Download selected update.
private
downloadAction() : void
getUpdateItemsCore()
private
static getUpdateItemsCore() : array<string|int, mixed>
Return values
array<string|int, mixed>getUpdateItemsPlugin()
private
static getUpdateItemsPlugin(Plugin $plugin) : array<string|int, mixed>
Parameters
- $plugin : Plugin
Return values
array<string|int, mixed>notWritableFolders()
private
notWritableFolders() : array<string|int, mixed>
Return values
array<string|int, mixed>postUpdateAction()
private
postUpdateAction() : void
sendCrashFilesAction()
private
sendCrashFilesAction() : void
setCoreWarnings()
private
setCoreWarnings() : void
updateAction()
Extract zip file and update all files.
private
updateAction() : void
updateCore()
private
updateCore(ZipArchive $zip, string $fileName) : bool
Parameters
- $zip : ZipArchive
- $fileName : string
Return values
boolupdatePlugin()
private
updatePlugin(ZipArchive $zip, string $fileName) : bool
Parameters
- $zip : ZipArchive
- $fileName : string
Return values
boolwillItWorkOnNewCore()
private
willItWorkOnNewCore(Plugin $plugin, float $newCore) : bool
Parameters
- $plugin : Plugin
- $newCore : float