\apex\devkit\workerrepo_uploads

Handles chunked uploads to the repository.

Summary

Methods
Properties
Constants
get_zipfile()
check_auth()
check_access()
add_access()
render_package()
add_onetime_download()
verify_envato_purchase()
chunk_uploaded()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
noauth()
noaccess()
No private properties found
N/A

Methods

get_zipfile()

get_zipfile(string  $alias,integer  $repo_id,string  $type = 'package',string  $version = '',boolean  $is_upgrade = false): string

Get package zip file location

Parameters

string $alias

The package alias

integer $repo_id

The ID# of the repository

string $type

The type -- 'package' or 'theme'

string $version

Optional version, defaults to 'atest.zip' if blank.

boolean $is_upgrade

Whether or not this is for an upgrade

Returns

string —

The full location of the zip file

check_auth()

check_auth(boolean  $require_login = false): mixed

Check authentication of user

Parameters

boolean $require_login

Whether or not authentication is required. Throws exception if true, and no authentication.

Returns

mixed —

The userid if successful, false otherwise.

check_access()

check_access(integer  $userid,string  $pkghash,string  $access = 'read',boolean  $require_access = false): boolean

Check if user has access to a package / theme

Parameters

integer $userid

The ID# of the user

string $pkghash

The unique pkghash of the package / theme

string $access

The type of access, must be 'read' or 'write', and defaults to 'read'.

boolean $require_access

If true and no access, throws an exception. Otherwise, returns false.

Returns

boolean —

Whether or not the user has access to the specified package.

add_access()

add_access(integer  $userid,string  $pkghash,string  $type = 'read',integer  $licenses = 1)

Add access to a package / theme

Parameters

integer $userid

The userid to add access to

string $pkghash

The unique 'pkghash' of the package / theme

string $type

The type of access to add -- 'read', 'write' or 'admin'

integer $licenses

The number of server licenses to add. Defaults to 1.

render_package()

render_package(array  $row)

Render a package for display to the web browser.

Parameters

array $row

The row from the 'repo_packages' table

add_onetime_download()

add_onetime_download(integer  $repo_id,string  $type,string  $alias): string

Add one-time downline

Parameters

integer $repo_id

The ID# of the repo to download from

string $type

The type of download, theme or package

string $alias

The alias fo the package / theme to download

Returns

string —

The full URL of the download link.

verify_envato_purchase()

verify_envato_purchase(string  $envato_username,string  $purchase_code,string  $item_id)

Check Envata purchase code

Parameters

string $envato_username

The Envato username to user

string $purchase_code

The purchase code to verify.

string $item_id

The ThemeForest item ID to verify with the purchase.

noauth()

noauth(boolean  $require_login)

Process invalid login, and throw exception if authentication required, or simply return false otherwise.

Parameters

boolean $require_login

Whether or not authentication is required.

noaccess()

noaccess(boolean  $require_access)

Process a noaccess error to package / theme.

Throws an exception if access is required, and otherwise returns false.

Parameters

boolean $require_access

Whether or not access is required.