This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation

Class Concrete5_Model_Package

Represents a package. A package is a grouping of Concrete functionality that can be "packaged" up and distributed and easily installed in one spot.

Concrete5_Library_Object
Extended by Object
Extended by Concrete5_Model_Package

Direct known subclasses

Package

Package: Utilities
License: MIT
Author: Andrew Embler andrew@concrete5.org
Link: http://www.concrete5.org
Located at core/models/package.php

Methods summary

public
public
public
public
public
public string
# getPackageDateInstalled( string $type = 'system' )

Gets the date the package was added to the system, if user is specified, returns in the current user's timezone

public
public
public
public
public
# getPackageCurrentlyInstalledVersion( )

Returns the currently installed package version. NOTE: This function only returns a value if getLocalUpgradeablePackages() has been called first!

public
public
public
public
public
public static
# installDB( $xmlFile )
public
# setupPackageLocalization( string $folder = NULL, string $locale = NULL, string|Zend_Translate $translate = 'current' )

Loads package translation files into zend translate

public
# getPackageItems( )

Returns an array of package items (e.g. blocks, themes)

public static string
# getPackageItemsCategoryDisplayName( string $categoryHandle, string $format = 'html' )

Returns the display name of a category of package items (localized and escaped accordingly to $format)

public static
# getItemName( $item )
public
# uninstall( )

Uninstalls the package. Removes any blocks, themes, or pages associated with the package.

protected
public
# swapContent( $options )
public
# testForInstall( $package, $testForAlreadyInstalled = true )
public
# mapError( $testResults )
public
public Package
# getByID( integer $pkgID )

returns a Package object for the given package id, null if not found

public Package
# getByHandle( string $pkgHandle )

returns a Package object for the given package handle, null if not found

public Package
# install( )
public
public
public
# upgrade( )
public static
public static
public static
# getLocalUpgradeablePackages( )

Returns an array of packages that have newer versions in the local packages directory than those which are in the Packages table. This means they're ready to be upgraded

public static
public
# backup( )

moves the current package's directory to the trash directory renamed with the package handle and a date code.

public
# restore( )

if a packate was just backed up by this instance of the package object and the packages/package handle directory doesn't exist, this will restore the package from the trash

public
# config( $cfKey, $getFullObject = false )
public
# saveConfig( $cfKey, $value )
public
# clearConfig( $cfKey )
public static
# getAvailablePackages( $filterInstalled = true )

Constants summary

integer E_PACKAGE_NOT_FOUND
# 1
integer E_PACKAGE_INSTALLED
# 2
integer E_PACKAGE_VERSION
# 3
integer E_PACKAGE_DOWNLOAD
# 4
integer E_PACKAGE_SAVE
# 5
integer E_PACKAGE_UNZIP
# 6
integer E_PACKAGE_INSTALL
# 7
integer E_PACKAGE_MIGRATE_BACKUP
# 8
integer E_PACKAGE_INVALID_APP_VERSION
# 20

Properties inherited from Concrete5_Library_Object

$error