com_pubdbInstallerScript - JoomlaPubDB/PubDB GitHub Wiki

Class: \com_pubdbInstallerScript

Namespace: [](../namespaces/default)


Summary:

Updates the database structure of the component


Constants

  • No constants found

Properties


Methods


Details

  • File: script.php
  • Package: Com_Pubdb
  • Class Hierarchy:
    • \com_pubdbInstallerScript

Tags

Tag Version Description
version Release: 0.2b
author Component Creator [email protected]
since 0.1b

Methods

public preflight() : boolean

public preflight(string  $type, mixed  $parent) : boolean

Summary

Method called before install/update the component. Note: This method won't be called during uninstall process.

Details:

Parameters:
Type Name Description
string $type Type of process [install
mixed $parent Object who called this method
Throws:
Type Description
\Exception

Returns: boolean - True if the process should continue, false otherwise

public install() : void

public install(mixed  $parent) : void

Summary

Method to install the component

Details:

Parameters:
Type Name Description
mixed $parent Object who called this method.

Returns: void

Tags
Tag Version Description
since 0.2b

public update() : void

public update(mixed  $parent) : void

Summary

Method to update the component

Details:

Parameters:
Type Name Description
mixed $parent Object who called this method.

Returns: void

public uninstall() : void

public uninstall(mixed  $parent) : void

Summary

Method to uninstall the component

Details:

Parameters:
Type Name Description
mixed $parent Object who called this method.

Returns: void

private installDb() : void

private installDb(mixed  $parent) : void

Summary

Method to update the DB of the component

Details:

Parameters:
Type Name Description
mixed $parent Object who started the upgrading process
Throws:
Type Description
\Exception

Returns: void

Tags
Tag Version Description
since 0.2b

private processTable() : void

private processTable(\JApplicationCms  $app, \SimpleXMLElement  $table) : void

Summary

Process a table

Details:

Parameters:
Type Name Description
\JApplicationCms $app Application object
\SimpleXMLElement $table Table to process

Returns: void

Tags
Tag Version Description
since 0.2b

private existsTable() : boolean

private existsTable(string  $table_name) : boolean

Summary

Checks if a certain exists on the current database

Details:

Parameters:
Type Name Description
string $table_name Name of the table

Returns: boolean - True if it exists, false if it does not.

private generateCreateTableStatement() : string

private generateCreateTableStatement(\SimpleXMLElement  $table) : string

Summary

Generates a 'CREATE TABLE' statement for the tables passed by argument.

Details:

Parameters:
Type Name Description
\SimpleXMLElement $table Table of the database

Returns: string - 'CREATE TABLE' statement

private generateColumnDeclaration() : string

private generateColumnDeclaration(\SimpleXMLElement  $field) : string

Summary

Generate a column declaration

Details:

Parameters:
Type Name Description
\SimpleXMLElement $field Field data

Returns: string - Column declaration

private getFieldType() : mixed

private getFieldType(\SimpleXMLElement  $field) : mixed

Summary

Generates SQL field type of a field.

Details:

Parameters:
Type Name Description
\SimpleXMLElement $field Field information

Returns: mixed - SQL string data type, false on failure.

private allowsLengthField() : boolean

private allowsLengthField(string  $field_type) : boolean

Summary

Check if a SQL type allows length values.

Details:

Parameters:
Type Name Description
string $field_type SQL type

Returns: boolean - True if it allows length values, false if it does not.

private executeFieldsUpdating() : void

private executeFieldsUpdating(\JApplicationCms  $app, \SimpleXMLElement  $table) : void

Summary

Updates all the fields related to a table.

Details:

Parameters:
Type Name Description
\JApplicationCms $app Application Object
\SimpleXMLElement $table Table information.

Returns: void

private processField() : void

private processField(\JApplicationCms  $app, string  $table_name, \SimpleXMLElement  $field) : void

Summary

Process a certain field.

Details:

Parameters:
Type Name Description
\JApplicationCms $app Application object
string $table_name The name of the table that contains the field.
\SimpleXMLElement $field Field Information.

Returns: void

private addField() : mixed

private addField(string  $table_name, \SimpleXMLElement  $field) : mixed

Summary

Add a field if it does not exists or modify it if it does.

Details:

Parameters:
Type Name Description
string $table_name Table name
\SimpleXMLElement $field Field Information

Returns: mixed - Constant on success(self::$MODIFIED | self::$NOT_MODIFIED), error message if an error occurred

private existsField() : boolean

private existsField(string  $table_name, string  $field_name) : boolean

Summary

Checks if a field exists on a table

Details:

Parameters:
Type Name Description
string $table_name Table name
string $field_name Field name

Returns: boolean - True if exists, false if it do

private needsToUpdate() : boolean

private needsToUpdate(string  $table_name, \SimpleXMLElement  $field) : boolean

Summary

Check if a field needs to be updated.

Details:

Parameters:
Type Name Description
string $table_name Table name
\SimpleXMLElement $field Field information

Returns: boolean - True if the field has to be updated, false otherwise

private generateChangeFieldStatement() : string

private generateChangeFieldStatement(string  $table_name, \SimpleXMLElement  $field) : string

Summary

Generates an change column statement

Details:

Parameters:
Type Name Description
string $table_name Table name
\SimpleXMLElement $field Field Information

Returns: string - Change column statement

private generateAddFieldStatement() : string

private generateAddFieldStatement(string  $table_name, \SimpleXMLElement  $field) : string

Summary

Generates an add column statement

Details:

Parameters:
Type Name Description
string $table_name Table name
\SimpleXMLElement $field Field Information

Returns: string - Add column statement

private installPlugins() : void

private installPlugins(mixed  $parent) : void

Summary

Installs plugins for this component

Details:

Parameters:
Type Name Description
mixed $parent Object who called the install/update method

Returns: void

private isAlreadyInstalled() : boolean

private isAlreadyInstalled(string  $type, string  $name, mixed  $folder = null) : boolean

Summary

Check if an extension is already installed in the system

Details:

Parameters:
Type Name Description
string $type Extension type
string $name Extension name
mixed $folder Extension folder(for plugins)

Returns: boolean

private installModules() : void

private installModules(mixed  $parent) : void

Summary

Installs plugins for this component

Details:

Parameters:
Type Name Description
mixed $parent Object who called the install/update method

Returns: void

private uninstallPlugins() : void

private uninstallPlugins(mixed  $parent) : void

Summary

Uninstalls plugins

Details:

Parameters:
Type Name Description
mixed $parent Object who called the uninstall method

Returns: void

private uninstallModules() : void

private uninstallModules(mixed  $parent) : void

Summary

Uninstalls plugins

Details:

Parameters:
Type Name Description
mixed $parent Object who called the uninstall method

Returns: void


Top Namespaces


Reports


This document was automatically generated from source code comments on 2020-07-13 using phpDocumentor and fr3nch13/phpdoc-markdown

⚠️ **GitHub.com Fallback** ⚠️