Documentation

PackageManager
in package

This is the main package manager.

Table of Contents

Properties

$subactions  : array<string|int, mixed>
$obj  : mixed
An instance of this class.
$packageget_subactions  : array<string|int, mixed>

Methods

browse()  : void
Browse a list of installed packages.
call()  : void
Convenience method to load() and execute() an instance of this class.
download()  : void
Download a package.
examineFile()  : void
Display one of the files in a package.
execute()  : void
Main dispatcher.
ftpTest()  : void
Test an FTP connection.
install()  : void
Apply another type of (avatar, language, etc.) package.
installTest()  : void
Test install a package.
list()  : void
List the files in a package.
list_getPackages()  : array<string|int, mixed>
Get a listing of all the packages
load()  : self
Instantiates this class, but never more than once.
options()  : void
Used when a temp FTP access is needed to package functions
PackagePermissionsAction()  : bool|null
Actually action the permission changes they want.
permissions()  : void
Allow the admin to reset permissions on files.
remove()  : void
Delete a package.
serverAdd()  : void
Add a package server to the list.
serverBrowse()  : void
Browse a server's list of packages.
serverRemove()  : void
Remove a server from the list.
servers()  : void
Load a list of package servers.
showOperations()  : void
List operations
updateBackwardCompatibility()  : void
Enables Config::$backward_compatibility if it is needed.
upload()  : void
Upload a new package to the directory.
__construct()  : mixed
Protected constructor in order to force instantiation via load()
build_special_files__recursive()  : void
Builds a list of special files recursively for a given path
count_directories__recursive()  : int
Counts all the directories under a given path
fetchPerms__recursive()  : void
Checks the permissions of all the areas that will be affected by the package

Properties

$subactions

public array<string|int, mixed> $subactions = [ // Sub-actions for working with package files. 'browse' => 'browse', 'remove' => 'remove', 'list' => 'list', 'ftptest' => 'ftpTest', 'install' => 'installTest', 'install2' => 'install', 'uninstall' => 'installTest', 'uninstall2' => 'install', 'options' => 'options', 'perms' => 'permissions', 'examine' => 'examineFile', 'showoperations' => 'showOperations', // Sub-actions for working with package servers. 'upload' => 'upload', 'download' => 'download', 'servers' => 'servers', 'serveradd' => 'serverAdd', 'serverremove' => 'serverRemove', 'serverbrowse' => 'serverBrowse', ]

Delegation makes the world... that is, the package manager go 'round.

$packageget_subactions

protected array<string|int, mixed> $packageget_subactions = ['upload' => 'upload', 'download' => 'download', 'servers' => 'servers', 'add' => 'serveradd', 'remove' => 'serverremove', 'browse' => 'serverbrowse']

For backward compatibility, maps the old names of some subactions that used to live in an obsolete PackageGet.php file to their new names.

Methods

browse()

Browse a list of installed packages.

public browse() : void

call()

Convenience method to load() and execute() an instance of this class.

public static call() : void

examineFile()

Display one of the files in a package.

public examineFile() : void

install()

Apply another type of (avatar, language, etc.) package.

public install() : void

installTest()

Test install a package.

public installTest() : void

list_getPackages()

Get a listing of all the packages

public list_getPackages(int $start, int $items_per_page, string $sort, string $params) : array<string|int, mixed>

Determines if the package is a mod, avatar, or language package and groups it accordingly. If a package is not recognised as one of the above, it is then put into a special group, "unknown".

Determines whether the package has been installed or not by checking it against .

Parameters
$start : int

The item to start with (not used here)

$items_per_page : int

The number of items to show per page (not used here)

$sort : string

A string indicating how to sort the results

$params : string

Type of packages

Return values
array<string|int, mixed>

An array of information about the packages

load()

Instantiates this class, but never more than once.

public static load() : self
Tags
todo

Add a reference to Utils::$context['instances'] as well?

Return values
self

An instance of this class.

options()

Used when a temp FTP access is needed to package functions

public options() : void

PackagePermissionsAction()

Actually action the permission changes they want.

public PackagePermissionsAction() : bool|null
Return values
bool|null

permissions()

Allow the admin to reset permissions on files.

public permissions() : void

serverAdd()

Add a package server to the list.

public serverAdd() : void

serverBrowse()

Browse a server's list of packages.

public serverBrowse() : void

serverRemove()

Remove a server from the list.

public serverRemove() : void

servers()

Load a list of package servers.

public servers() : void

showOperations()

List operations

public showOperations() : void

updateBackwardCompatibility()

Enables Config::$backward_compatibility if it is needed.

public updateBackwardCompatibility() : void

Once support for backward compatibility behaviours has been discontinued in a future version of SMF, this method can be removed.

upload()

Upload a new package to the directory.

public upload() : void

__construct()

Protected constructor in order to force instantiation via load()

protected __construct() : mixed

build_special_files__recursive()

Builds a list of special files recursively for a given path

protected build_special_files__recursive(string $path, array<string|int, mixed> &$data) : void
Parameters
$path : string
$data : array<string|int, mixed>

count_directories__recursive()

Counts all the directories under a given path

protected count_directories__recursive(string $dir) : int
Parameters
$dir : string
Return values
int

fetchPerms__recursive()

Checks the permissions of all the areas that will be affected by the package

protected fetchPerms__recursive(string $path, array<string|int, mixed> &$data, int $level) : void
Parameters
$path : string

The path to the directory to check permissions for

$data : array<string|int, mixed>

An array of data about the directory

$level : int

How far deep to go


        
On this page

Search results