\apex\app\pkgupgrade

Handles all upgrade functions, including create upgrade point, publish, download, install, and rollback.

Summary

Methods
Properties
Constants
create()
create_file_hash()
compile()
publish()
install()
rollback()
No public properties found
No constants found
add_single_file_hash()
compile_component()
compile_single_file()
install_from_zip()
rollback_single()
$upgrade_dir
$file_num
$toc
$file_hash
$components
N/A
No private methods found
No private properties found
N/A

Properties

$upgrade_dir

$upgrade_dir :

Type

$file_num

$file_num :

Type

$toc

$toc :

Type

$file_hash

$file_hash :

Type

$components

$components :

Type

Methods

create()

create(string  $pkg_alias,string  $version = ''): integer

Create upgrade point

Create a new upgrade point. Upon creation, all files within the package will be hashed, then upon publication, all modified files will be included.

Parameters

string $pkg_alias

The alias of the package to create upgrade point for

string $version

The version of the upgrade. Optional, if blank increments the third element of the current package version by 1.

Returns

integer —

The ID# of the newly created upgrade point

create_file_hash()

create_file_hash(integer  $upgrade_id)

Create SHA1 file hash

Create a SHA1 hash of all files pertaining to the package. This is used for upgrades, as it hashes ( all files upon creating an upgrade point, then checks against the current hashes when publish the upgrade to see which files were modified.

Parameters

integer $upgrade_id

The ID# of the upgrade files are being hashed for.

compile()

compile(integer  $upgrade_id): \apex\app\pkg\Returns

Compile upgrade

Compiles an upgrade. Goes through the SHA1 hashes created against each file when the upgrade point was created, and determines which components / files have been added, updated, and deleted. Compiles them as necessary to be uploaded to the repository.

Parameters

integer $upgrade_id

The ID# from the 'internal_upgrades' file which to compile

Returns

\apex\app\pkg\Returns —

the filename or the zip archive, which is stored in the system tmp directory.

publish()

publish(string  $upgrade_id)

Publish upgrade

Publishes an upgrade to the appropriate repository

Parameters

string $upgrade_id

The ID# from the 'internal_upgrades' of the upgrade to publish.

install()

install(string  $pkg_alias): string

Install upgrades for a specified package

Parameters

string $pkg_alias

The alias of the package to upgrade

Returns

string —

The new vesion the package was upgraded to

rollback()

rollback(string  $pkg_alias,string  $version)

Rollback upgrades

Parameters

string $pkg_alias

The alias of the package to rollback

string $version

The version to rollback to

add_single_file_hash()

add_single_file_hash(integer  $upgrade_id,string  $file)

Add single file hash

Parameters

integer $upgrade_id

The ID# of the upgrade

string $file

The file to add, relative to the installation directory

compile_component()

compile_component(array  $row)

Compile single component

Compile a single component. Will get the .php file of component, and check to see whether or not it is updated or added, and process accordingly.

Parameters

array $row

The database row from 'internal_components' table

compile_single_file()

compile_single_file(string  $file)

Compile single file

Compile a single file. Checks the current SHA1 hash against the one stroed upon upgrade point creation, and adds file to upgrade if needed.

Parameters

string $file

Filename to check, relative to installation directory.

install_from_zip()

install_from_zip(string  $pkg_alias,string  $version,string  $zip_file)

Install single upgrade from zip file

Parameters

string $pkg_alias

The alias of the package upgrade is being installed for

string $version

The new version of the zip file

string $zip_file

The location of the zip file

rollback_single()

rollback_single(string  $pkg_alias,string  $version)

Rollback a single upgrade

Parameters

string $pkg_alias

The alias of the package to rollback

string $version

The single version number being rolled back