eZ Publish  [4.2]
eZPackage Class Reference

Maintains eZ Publish packages. More...

List of all members.

Public Member Functions

 appendChange ($person, $email, $changes, $release=false, $timestamp=null)
 appendDependency ($dependencySection, $parameters)
 appendDocument ($name, $mimeType=false, $os=false, $audience=false, $create=false, $data=false)
 appendFile ($file, $type, $role, $design, $filePath, $collection, $subDirectory=null, $md5=null, $copyFile=false, $modified=null, $fileType=false, $roleValue=false, $variableName=false, $packagePath=false)
 appendGroup ($name)
 appendInstall ($type, $name, $os=false, $isInstall=true, $filename=false, $subdirectory=false, $parameters=false)
 appendMaintainer ($name, $email, $role=false)
 appendProvides ($type, $name, $value, $parameters=false)
 appendSimpleFile ($key, $filepath)
 attribute ($attributeName)
 attributes ()
 canExport ()
 canImport ()
 canInstall ()
 canRead ()
 canUsePackagePolicyFunction ($functionName)
 createDependencyText ($cli, $dependencyItem, $dependencySection)
 createDependencyTree (&$dependenciesNode, $dependencyType, $list)
 currentRepositoryInformation ()
 currentRepositoryPath ()
 defaultLanguageMap ()
 dependencyItems ($dependencySection, $parameters=false)
 dependencyOperatorText ($dependencyItem)
domStructure ()
 exportName ()
 exportToArchive ($archivePath)
 eZPackage ($parameters=array(), $repositoryPath=false)
 fetchDependentPackages ($dependencyType, &$failedList)
 fileCount ()
 fileItemPath ($fileItem, $collectionName, $path=false)
 fileList ($collectionName)
 fileStorePath ($fileItem, $collectionName, $path=false, $installVariables=array())
 getInstallState ()
 groupDependencyItemsByType ($dependencyItems)
 hasAttribute ($attributeName)
 install (&$installParameters)
 installItem ($item, &$installParameters)
 installItemsList ($type=false, $os=false, $name=false, $isInstall=true)
 isInstalled ()
 languageInfo ($withLanguageNames=false)
 path ()
 remove ()
 setAttribute ($attributeName, $attributeValue)
 setCurrentRepositoryInformation ($information)
 setInstalled ($installed=true)
 setPackager ($timestamp=false, $host=false, $packager=false)
 setRelease ($version=false, $release=false, $timestamp=false, $licence=false, $state=false)
 simpleFilePath ($fileKey)
 store ()
 storePackageFile ($path, $storeCache=true)
 storeToFile ($filename)
 thumbnailList ($collectionName)
 uninstall ($uninstallParameters=array())
 uninstallItem ($item, &$uninstallParameters)

Static Public Member Functions

static applyStorageFilePermissions ($filename)
static cacheDirectory ()
static canUsePolicyFunction ($functionName)
static create ($name, $parameters=array(), $repositoryPath=false, $repositoryID=false)
static definitionFilename ()
static documentDirectory ()
static fetch ($packageName, $packagePath=false, $repositoryID=false, $dbAvailable=true)
static fetchFromFile ($filename)
static fetchMaintainerRoleIDList ($packageType=false, $checkRoles=false)
static fetchMaintainerRoleList ($packageType=false, $checkRoles=false)
static fetchPackages ($parameters=array(), $filterArray=array())
static filesDirectory ()
 getVersion ()
 Returns package version.
static import ($archiveName, &$packageName, $dbAvailable=true, $repositoryID=false)
static isValidName ($packageName, &$transformedPackageName=null)
 Checks if a package name is valid.
static languageInfoFromPackageList ($packageNameList, $withLanguageNames=false)
static maintainerRoleListForRoles ()
static maintainerRoleName ($roleID)
static md5sum ($file)
static packageHandler ($handlerName)
static packageRepositories ($parameters=array())
static removeFiles ($path)
static repositoryInformation ($repositoryID)
static repositoryPath ()
static settingsDirectory ()
static stateList ()
static storeDOM ($filename, $dom)
static suffix ()
static temporaryExportPath ()
static temporaryImportPath ()
static typeList ()
static useCache ()

Public Attributes

 $isInstalled = false
 $Parameters
 All interal data.
const CACHE_CODE_DATE = 1069339607
const DEVELOPMENT = false
const NON_INTERACTIVE = -1
const STATUS_ALREADY_EXISTS = 1
const STATUS_INVALID_NAME = 2
const USE_CACHE = true
const VERSION = '3.5.2'

Private Member Functions

 createInstallTree ($installNode, $dom, $list, $installType)
 parseDependencyTree ($dependenciesList, $dependencySection)
 parseDOMTree (DOMDocument $dom)
 parseInstallTree ($installList, $isInstall)
 setParameters ($parameters=array())
 storeCache ($directory=false)
 toString ()

Static Private Member Functions

static fetchDOMFromFile ($filename)
static fetchFromCache ($packagePath, $packageModification, &$cacheExpired)
static simpleFilesDirectory ()
static storeString ($filename, $data)

Detailed Description

Maintains eZ Publish packages.

Definition at line 42 of file ezpackage.php.


Member Function Documentation

eZPackage::appendChange ( person,
email,
changes,
release = false,
timestamp = null 
)

Definition at line 508 of file ezpackage.php.

Referenced by parseDOMTree().

eZPackage::appendDependency ( dependencySection,
parameters 
)

Appends a new dependency item to the section $dependencySection.

Parameters:
$dependencySectionCan be one of provides, requires, obsoletes, conflicts
$parametersA list of data specific to the dependency type.

Definition at line 775 of file ezpackage.php.

Referenced by appendProvides(), and parseDependencyTree().

eZPackage::appendDocument ( name,
mimeType = false,
os = false,
audience = false,
create = false,
data = false 
)

Definition at line 484 of file ezpackage.php.

Referenced by parseDOMTree().

eZPackage::appendFile ( file,
type,
role,
design,
filePath,
collection,
subDirectory = null,
md5 = null,
copyFile = false,
modified = null,
fileType = false,
roleValue = false,
variableName = false,
packagePath = false 
)

Definition at line 687 of file ezpackage.php.

Referenced by parseDOMTree().

eZPackage::appendGroup ( name)

Definition at line 502 of file ezpackage.php.

eZPackage::appendInstall ( type,
name,
os = false,
isInstall = true,
filename = false,
subdirectory = false,
parameters = false 
)

Definition at line 900 of file ezpackage.php.

Referenced by parseInstallTree().

eZPackage::appendMaintainer ( name,
email,
role = false 
)

Definition at line 477 of file ezpackage.php.

Referenced by parseDOMTree().

eZPackage::appendProvides ( type,
name,
value,
parameters = false 
)

Appends a new provides dependency.

Note:
This function is only a convenience function to the general appendDependency() function.

Definition at line 758 of file ezpackage.php.

eZPackage::appendSimpleFile ( key,
filepath 
)

Append File to package assosiated with key. The file will be available during installation using the same key.

Parameters:
key
filepath

Definition at line 2833 of file ezpackage.php.

static eZPackage::applyStorageFilePermissions ( filename) [static]

Applies the storage file permissions specified in site.ini to the file $filename

Definition at line 1246 of file ezpackage.php.

Referenced by storeDOM(), and storeString().

eZPackage::attribute ( attributeName)
Returns:
the value of the attribute named $attributeName.

Definition at line 253 of file ezpackage.php.

Referenced by canUsePackagePolicyFunction(), domStructure(), exportName(), exportToArchive(), fileItemPath(), and path().

eZPackage::attributes ( )
Returns:
the attributes for this package.

Definition at line 199 of file ezpackage.php.

Referenced by hasAttribute().

static eZPackage::cacheDirectory ( ) [static]
Returns:
the name of the cache directory for cached package data.

Definition at line 1527 of file ezpackage.php.

Referenced by fetch(), fetchFromCache(), fetchPackages(), and storePackageFile().

eZPackage::canExport ( )

Definition at line 330 of file ezpackage.php.

Referenced by attribute().

eZPackage::canImport ( )

Definition at line 335 of file ezpackage.php.

Referenced by attribute().

eZPackage::canInstall ( )

Definition at line 340 of file ezpackage.php.

Referenced by attribute().

eZPackage::canRead ( )

Definition at line 325 of file ezpackage.php.

Referenced by attribute().

eZPackage::canUsePackagePolicyFunction ( functionName)

Definition at line 345 of file ezpackage.php.

Referenced by canExport(), canImport(), canInstall(), and canRead().

static eZPackage::canUsePolicyFunction ( functionName) [static]

Definition at line 314 of file ezpackage.php.

static eZPackage::create ( name,
parameters = array(),
repositoryPath = false,
repositoryID = false 
) [static]
Parameters:
$repositoryIDThe id (string) of the repository to create the package in. If false it will use the local repository.

Definition at line 181 of file ezpackage.php.

Referenced by appendDocument(), and eZPackageCreationHandler\createPackage().

eZPackage::createDependencyText ( cli,
dependencyItem,
dependencySection 
)

Definition at line 790 of file ezpackage.php.

eZPackage::createDependencyTree ( &$  dependenciesNode,
dependencyType,
list 
)

Creates dependency xml elements as child of $dependenciesNode. The dependency elements are take from $list.

Parameters:
$dependencyTypeIs either 'provide', 'require', 'obsolete' or 'conflict'

Definition at line 2769 of file ezpackage.php.

Referenced by domStructure().

eZPackage::createInstallTree ( installNode,
dom,
list,
installType 
) [private]

Creates xml elements as children of the main node $installNode. The install elements are taken from $list.

Parameters:
$installTypeIs either 'install' or 'uninstall'

Definition at line 2727 of file ezpackage.php.

Referenced by domStructure().

eZPackage::currentRepositoryInformation ( )
Returns:
the current repository information for the package, this will contain information of where the package was found. See packageRepositories too see what the information will contain.
Note:
The return information can be null in some cases when the package is not properly initialized.

Definition at line 1678 of file ezpackage.php.

Referenced by attribute(), currentRepositoryPath(), and fileItemPath().

eZPackage::currentRepositoryPath ( )
Returns:
the path to the current repository.

Definition at line 1477 of file ezpackage.php.

Referenced by path().

eZPackage::defaultLanguageMap ( )

Definition at line 3053 of file ezpackage.php.

static eZPackage::definitionFilename ( ) [static]
Returns:
the name of the package definition file.

Definition at line 1536 of file ezpackage.php.

Referenced by fetch(), fetchPackages(), import(), and storePackageFile().

eZPackage::dependencyItems ( dependencySection,
parameters = false 
)
Returns:
an array with dependency items which match the specified criterias.

Definition at line 823 of file ezpackage.php.

eZPackage::dependencyOperatorText ( dependencyItem)

Definition at line 785 of file ezpackage.php.

Referenced by createDependencyText().

static eZPackage::documentDirectory ( ) [static]
Returns:
the name of the documents directory for cached package data.

Definition at line 1545 of file ezpackage.php.

Referenced by appendDocument(), exportToArchive(), and eZPackageOperator\modify().

& eZPackage::domStructure ( )
Returns:
the dom document of the package.

Definition at line 2293 of file ezpackage.php.

Referenced by storeToFile(), and toString().

eZPackage::exportName ( )
Returns:
the file name for an exported archive of the current package

Definition at line 1229 of file ezpackage.php.

eZPackage::exportToArchive ( archivePath)

Exports the package as a gzip compressed tarball to the directory $archivePath

Definition at line 1063 of file ezpackage.php.

eZPackage::eZPackage ( parameters = array(),
repositoryPath = false 
)

Constructor

Definition at line 57 of file ezpackage.php.

Referenced by create(), fetchFromCache(), and fetchFromFile().

static eZPackage::fetch ( packageName,
packagePath = false,
repositoryID = false,
dbAvailable = true 
) [static]

Tries to load the package named $packageName from the repository and returns the package object.

Parameters:
$repositoryIDDetermines in which repositories the package should be searched for, if set to true it means only look in local packages, false means look in all repositories.
$dbAvailableDo we have a database to fetch additional package info, like installed state. (false in setup wizard)
Returns:
false if no package could be found.

Definition at line 1367 of file ezpackage.php.

Referenced by downloadPackages(), fetchDependentPackages(), eZPackageType\fetchObjectAttributeHTTPInput(), import(), installPackages(), languageInfoFromPackageList(), eZPackageType\objectAttributeContent(), and eZPackageCreationHandler\validatePackageInformation().

eZPackage::fetchDependentPackages ( dependencyType,
&$  failedList 
)

Locates all dependent packages in the repository and returns an array with eZPackage objects.

Parameters:
$dependencyTypeis the name of a dependency sub-node. (ie. 'provides', 'requires' etc...)

Definition at line 1577 of file ezpackage.php.

static eZPackage::fetchDOMFromFile ( filename) [static, private]

Loads the contents of the file $filename and parses it into a DOM tree. The DOM tree is returned.

Definition at line 1311 of file ezpackage.php.

Referenced by fetchFromFile(), installItem(), and uninstallItem().

static eZPackage::fetchFromCache ( packagePath,
packageModification,
&$  cacheExpired 
) [static, private]

Definition at line 1432 of file ezpackage.php.

Referenced by fetch(), and fetchPackages().

static eZPackage::fetchFromFile ( filename) [static]

Tries to load the package definition from file $filename and create a package object from it.

Returns:
false if it could be fetched.

Definition at line 1337 of file ezpackage.php.

Referenced by fetch(), fetchPackages(), and import().

static eZPackage::fetchMaintainerRoleIDList ( packageType = false,
checkRoles = false 
) [static]
static eZPackage::fetchMaintainerRoleList ( packageType = false,
checkRoles = false 
) [static]

Definition at line 437 of file ezpackage.php.

static eZPackage::fetchPackages ( parameters = array(),
filterArray = array() 
) [static]

Locates all packages in the repository and returns an array with eZPackage objects.

Parameters:
parameters
filterArray

Definition at line 1689 of file ezpackage.php.

eZPackage::fileCount ( )

Definition at line 677 of file ezpackage.php.

Referenced by attribute().

eZPackage::fileItemPath ( fileItem,
collectionName,
path = false 
)

Definition at line 629 of file ezpackage.php.

eZPackage::fileList ( collectionName)

Definition at line 652 of file ezpackage.php.

Referenced by thumbnailList().

static eZPackage::filesDirectory ( ) [static]
Returns:
the name of the documents directory for cached package data.

Definition at line 1554 of file ezpackage.php.

Referenced by appendFile(), exportToArchive(), and fileItemPath().

eZPackage::fileStorePath ( fileItem,
collectionName,
path = false,
installVariables = array() 
)

Definition at line 556 of file ezpackage.php.

eZPackage::getInstallState ( )

Definition at line 2923 of file ezpackage.php.

Referenced by setInstalled().

eZPackage::getVersion ( ) [static]

Returns package version.

Combines package version number and release number.

Returns:
Package version (string).

Definition at line 2885 of file ezpackage.php.

Referenced by getInstallState(), and setInstalled().

eZPackage::groupDependencyItemsByType ( dependencyItems)

Definition at line 808 of file ezpackage.php.

eZPackage::hasAttribute ( attributeName)
Returns:
true if the attribute named $attributeName exists.

Definition at line 245 of file ezpackage.php.

static eZPackage::import ( archiveName,
&$  packageName,
dbAvailable = true,
repositoryID = false 
) [static]

Imports a package from a gzip compressed tarball file $archiveName

Definition at line 1122 of file ezpackage.php.

Referenced by downloadPackages().

eZPackage::install ( &$  installParameters)

Install all install items in package

Definition at line 1863 of file ezpackage.php.

eZPackage::installItem ( item,
&$  installParameters 
)

Install specified install item in package

Parameters:
Itemindex
parameters

Definition at line 1812 of file ezpackage.php.

Referenced by install().

eZPackage::installItemsList ( type = false,
os = false,
name = false,
isInstall = true 
)
Returns:
an array with install items which match the specified criterias.

Definition at line 861 of file ezpackage.php.

Referenced by languageInfo().

eZPackage::isInstalled ( )

Definition at line 2918 of file ezpackage.php.

Referenced by attribute(), getInstallState(), setInstalled(), and uninstall().

static eZPackage::isValidName ( packageName,
&$  transformedPackageName = null 
) [static]

Checks if a package name is valid.

Parameters:
string$packageNamethe package name
string$transformedPackageNamethe package name, transformed to be valid
Returns:
boolean true if the package name is valid, false if not

Definition at line 3073 of file ezpackage.php.

eZPackage::languageInfo ( withLanguageNames = false)

Fetch info about languages for package.

Definition at line 2990 of file ezpackage.php.

Referenced by defaultLanguageMap().

static eZPackage::languageInfoFromPackageList ( packageNameList,
withLanguageNames = false 
) [static]

Fetch info about languages for packages specified in $packageNameList. Return ex: array( 'eng-GB', 'rus-RU', ... ); if $withLanguageNames == true array( 'eng-GB' => "English", 'rus-RU' => "Russian", ... );

Definition at line 2952 of file ezpackage.php.

static eZPackage::maintainerRoleListForRoles ( ) [static]

Definition at line 450 of file ezpackage.php.

static eZPackage::maintainerRoleName ( roleID) [static]

Definition at line 464 of file ezpackage.php.

Referenced by fetchMaintainerRoleList(), and maintainerRoleListForRoles().

static eZPackage::md5sum ( file) [static]

Definition at line 526 of file ezpackage.php.

Referenced by appendFile().

static eZPackage::packageHandler ( handlerName) [static]
static eZPackage::packageRepositories ( parameters = array()) [static]
Returns:
an array with repositories which can contain packages.

Each repository entry is an array with the following keys.

  • path The path to the repository relative from the eZ Publish installation
  • id Unique identifier for this repository
  • name Human readable string identifying this repository, the name is translatable
  • type What kind of repository, currently supports local or global.

Definition at line 1614 of file ezpackage.php.

Referenced by fetch(), fetchPackages(), and repositoryInformation().

eZPackage::parseDependencyTree ( dependenciesList,
dependencySection 
) [private]

Definition at line 2235 of file ezpackage.php.

Referenced by parseDOMTree().

eZPackage::parseDOMTree ( DOMDocument $  dom) [private]

Definition at line 1968 of file ezpackage.php.

eZPackage::parseInstallTree ( installList,
isInstall 
) [private]

Definition at line 2265 of file ezpackage.php.

Referenced by parseDOMTree().

eZPackage::remove ( )

Removes the package directory and all it's subfiles/directories.

Definition at line 69 of file ezpackage.php.

static eZPackage::removeFiles ( path) [static]

Recursively deletes $path

Definition at line 1052 of file ezpackage.php.

Referenced by exportToArchive(), and import().

static eZPackage::repositoryInformation ( repositoryID) [static]
Returns:
information on the repository with ID $repositoryID or false if does not exist.

Definition at line 1652 of file ezpackage.php.

static eZPackage::repositoryPath ( ) [static]
Returns:
the path to the package repository.

Definition at line 1513 of file ezpackage.php.

Referenced by downloadPackages(), eZPackage(), import(), installScriptDir(), and packageRepositories().

eZPackage::setAttribute ( attributeName,
attributeValue 
)

Sets the attribute named $attributeName to have the value $attributeValue.

Definition at line 223 of file ezpackage.php.

eZPackage::setCurrentRepositoryInformation ( information)

Sets the current repository information for the package.

See also:
currentRepositoryInformation, packageRepositories

Definition at line 1667 of file ezpackage.php.

eZPackage::setInstalled ( installed = true)

Sets installed/uninstalled state of the package

Parameters:
installed

Definition at line 2894 of file ezpackage.php.

Referenced by install(), remove(), and uninstall().

eZPackage::setPackager ( timestamp = false,
host = false,
packager = false 
)

Sets the packager of this release.

Definition at line 944 of file ezpackage.php.

Referenced by parseDOMTree().

eZPackage::setParameters ( parameters = array()) [private]

Definition at line 82 of file ezpackage.php.

Referenced by eZPackage(), and parseDOMTree().

eZPackage::setRelease ( version = false,
release = false,
timestamp = false,
licence = false,
state = false 
)

Sets various release information. If the value is set to false it is not updated.

Parameters:
$versionThe version number, eg. 1.0, 2.3.5
$releaseThe release number, usually starts at 1 and increments for updates on the same version
$timestampThe timestamp of the release
$licenceThe licence of the package, eg. GPL, LGPL etc.
$stateThe sate of the release, e.g alpha, beta, stable etc.

Definition at line 962 of file ezpackage.php.

Referenced by parseDOMTree().

static eZPackage::settingsDirectory ( ) [static]

Definition at line 1568 of file ezpackage.php.

Referenced by exportToArchive().

eZPackage::simpleFilePath ( fileKey)

Get complete path to file by file key

Parameters:
filekey
Returns:
complete file path

Definition at line 2863 of file ezpackage.php.

static eZPackage::simpleFilesDirectory ( ) [static, private]

Get local simple file path

Definition at line 1563 of file ezpackage.php.

Referenced by appendSimpleFile(), and exportToArchive().

static eZPackage::stateList ( ) [static]
Returns:
An associative array with the possible states for a package. Each entry contains an id and a name key.

Definition at line 160 of file ezpackage.php.

eZPackage::store ( )

Stores the current package in the repository.

Definition at line 1024 of file ezpackage.php.

eZPackage::storeCache ( directory = false) [private]

Stores a cached version of the package in the cache directory under the repository for the package.

Definition at line 1003 of file ezpackage.php.

Referenced by storePackageFile().

static eZPackage::storeDOM ( filename,
dom 
) [static]

Stores the DOM tree $dom to the file $filename.

Definition at line 1256 of file ezpackage.php.

Referenced by appendInstall(), and storeToFile().

eZPackage::storePackageFile ( path,
storeCache = true 
)

Stores the current package definition file to the directory $path.

Definition at line 1033 of file ezpackage.php.

Referenced by exportToArchive(), and store().

static eZPackage::storeString ( filename,
data 
) [static, private]

Stores the string data $data into the file $filename.

Returns:
true if successful.

Definition at line 1283 of file ezpackage.php.

Referenced by storePackageFile().

eZPackage::storeToFile ( filename)

Stores the current package to the file $filename.

Definition at line 1237 of file ezpackage.php.

static eZPackage::suffix ( ) [static]
Returns:
the suffix for all package files.

Definition at line 1221 of file ezpackage.php.

Referenced by appendSimpleFile(), and exportName().

static eZPackage::temporaryExportPath ( ) [static]
Returns:
the directory name for temporary export packages, used in conjunction with eZSys::cacheDirectory().

Definition at line 1489 of file ezpackage.php.

Referenced by exportToArchive().

static eZPackage::temporaryImportPath ( ) [static]
Returns:
the directory name for temporary import packages, used in conjunction with eZSys::cacheDirectory().

Definition at line 1501 of file ezpackage.php.

Referenced by import().

eZPackage::thumbnailList ( collectionName)

Definition at line 660 of file ezpackage.php.

Referenced by attribute().

eZPackage::toString ( ) [private]
Returns:
the package as a string, the string is in xml format.

Definition at line 991 of file ezpackage.php.

Referenced by storePackageFile().

static eZPackage::typeList ( ) [static]
Returns:
An associative array with the possible types for a package. Each entry contains an id and a name key.

Definition at line 138 of file ezpackage.php.

eZPackage::uninstall ( uninstallParameters = array())

Install all install items in package

Definition at line 1941 of file ezpackage.php.

eZPackage::uninstallItem ( item,
&$  uninstallParameters 
)

Definition at line 1883 of file ezpackage.php.

Referenced by uninstall().

static eZPackage::useCache ( ) [static]

Definition at line 1424 of file ezpackage.php.

Referenced by fetch(), and fetchPackages().


Member Data Documentation

eZPackage::$isInstalled = false

Definition at line 3082 of file ezpackage.php.

eZPackage::$Parameters

All interal data.

Definition at line 3085 of file ezpackage.php.

Referenced by fetchFromCache().

const eZPackage::CACHE_CODE_DATE = 1069339607

Definition at line 47 of file ezpackage.php.

Referenced by fetchFromCache(), and storeCache().

const eZPackage::DEVELOPMENT = false

Definition at line 45 of file ezpackage.php.

Referenced by domStructure(), and setParameters().

Definition at line 49 of file ezpackage.php.

Referenced by import().

Definition at line 50 of file ezpackage.php.

Referenced by import().

const eZPackage::USE_CACHE = true

Definition at line 46 of file ezpackage.php.

Referenced by useCache().

const eZPackage::VERSION = '3.5.2'

Definition at line 44 of file ezpackage.php.

Referenced by domStructure().


The documentation for this class was generated from the following file: