eZPublishCommunityProject(LegacyStack)  2013.5
eZPackage Class Reference

Maintains eZ Publish packages. More...

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)
 Installs all items in the package. More...
 
 installItem ($item, &$installParameters)
 
 installItemsList ($type=false, $os=false, $name=false, $isInstall=true)
 
 isInstalled ()
 
 languageInfo ($withLanguageNames=false)
 
 path ()
 
 remove ()
 Removes the package directory and all it's subfiles/directories. More...
 
 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. More...
 
static import ($archiveName, &$packageName, $dbAvailable=true, $repositoryID=false)
 Imports a package from a gzip compressed tarball file. More...
 
static isValidName ($packageName, &$transformedPackageName=null)
 Checks if a package name is valid. More...
 
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 systemRepositoryInformation ()
 
static temporaryExportPath ()
 
static temporaryImportPath ()
 
static typeList ()
 
static useCache ()
 

Public Attributes

 $isInstalled = false
 
 $Parameters
 All interal data. More...
 
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.

Member Function Documentation

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

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.

Referenced by appendProvides(), and parseDependencyTree().

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

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 
)

Referenced by parseDOMTree().

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

Referenced by parseInstallTree().

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

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.
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
static eZPackage::applyStorageFilePermissions (   $filename)
static

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

Referenced by storeDOM(), and storeString().

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

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

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

Referenced by hasAttribute().

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

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

eZPackage::canExport ( )

Referenced by attribute().

eZPackage::canImport ( )

Referenced by attribute().

eZPackage::canInstall ( )

Referenced by attribute().

eZPackage::canRead ( )

Referenced by attribute().

eZPackage::canUsePackagePolicyFunction (   $functionName)
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.

Referenced by eZPackageCreationHandler\createPackage().

eZPackage::createDependencyText (   $cli,
  $dependencyItem,
  $dependencySection 
)
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'

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'

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.

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

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

Referenced by path().

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

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

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

Referenced by createDependencyText().

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

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

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

Referenced by storeToFile(), and toString().

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

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

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

Constructor

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.

Referenced by eZStepSiteTypes\display(), eZStepSiteTypes\downloadAndImportPackage(), eZStepSiteTypes\downloadDependantPackages(), downloadPackages(), eZPackageFunctionCollection\fetchDependentPackageList(), fetchDependentPackages(), eZPackageType\fetchObjectAttributeHTTPInput(), eZPackageFunctionCollection\fetchPackage(), import(), eZStepPackageLanguageOptions\init(), eZStepSiteTypes\init(), eZStepCreateSites\initializePackage(), installPackages(), languageInfoFromPackageList(), eZPackageType\objectAttributeContent(), eZStepSiteTypes\processPostData(), eZStepInstaller\selectSiteType(), 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...)
static eZPackage::fetchDOMFromFile (   $filename)
staticprivate

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

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

static eZPackage::fetchFromCache (   $packagePath,
  $packageModification,
$cacheExpired 
)
staticprivate

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.

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

static eZPackage::fetchMaintainerRoleIDList (   $packageType = false,
  $checkRoles = false 
)
static
static eZPackage::fetchMaintainerRoleList (   $packageType = false,
  $checkRoles = false 
)
static
static eZPackage::fetchPackages (   $parameters = array(),
  $filterArray = array() 
)
static
eZPackage::fileCount ( )

Referenced by attribute().

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

Referenced by thumbnailList().

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

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

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

Referenced by setInstalled().

eZPackage::getVersion ( )
static

Returns package version.

Combines package version number and release number.

Returns
Package version (string).

Referenced by getInstallState(), and setInstalled().

eZPackage::groupDependencyItemsByType (   $dependencyItems)
eZPackage::hasAttribute (   $attributeName)
Returns
true if the attribute named $attributeName exists.
static eZPackage::import (   $archiveName,
$packageName,
  $dbAvailable = true,
  $repositoryID = false 
)
static

Imports a package from a gzip compressed tarball file.

Parameters
string$archiveNamePath to the archive file
string$packageNamePackage name
bool$dbAvailable
bool$repositoryID
Returns
eZPackage The eZPackage object if successfull, or one of the STATUS_* class constants if an error occurs

Referenced by eZStepSiteTypes\downloadAndImportPackage(), downloadPackages(), and eZStepSiteTypes\uploadPackage().

eZPackage::install ( $installParameters)

Installs all items in the package.

Parameters
array$installParameters
Returns
bool true if all items installed correctly, false otherwise
eZPackage::installItem (   $item,
$installParameters 
)

Install specified install item in package

Parameters
Itemindex
parameters

Referenced by install().

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

Referenced by languageInfo(), and uninstall().

eZPackage::isInstalled ( )
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
eZPackage::languageInfo (   $withLanguageNames = false)

Fetch info about languages for package.

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", ... );

Referenced by eZStepPackageLanguageOptions\init().

static eZPackage::maintainerRoleListForRoles ( )
static
static eZPackage::maintainerRoleName (   $roleID)
static
static eZPackage::md5sum (   $file)
static

Referenced by appendFile().

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.

Referenced by fetch(), fetchPackages(), eZPackageFunctionCollection\fetchRepositoryList(), and repositoryInformation().

eZPackage::parseDependencyTree (   $dependenciesList,
  $dependencySection 
)
private

Referenced by parseDOMTree().

eZPackage::parseDOMTree ( DOMDocument  $dom)
private
eZPackage::parseInstallTree (   $installList,
  $isInstall 
)
private

Referenced by parseDOMTree().

eZPackage::path ( )
eZPackage::remove ( )

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

static eZPackage::removeFiles (   $path)
static

Recursively deletes $path

Referenced by exportToArchive(), and import().

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

Referenced by systemRepositoryInformation().

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

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

eZPackage::setAttribute (   $attributeName,
  $attributeValue 
)

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

eZPackage::setCurrentRepositoryInformation (   $information)

Sets the current repository information for the package.

See Also
currentRepositoryInformation, packageRepositories
eZPackage::setInstalled (   $installed = true)

Sets installed/uninstalled state of the package

Parameters
installed

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

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

Sets the packager of this release.

Referenced by parseDOMTree().

eZPackage::setParameters (   $parameters = array())
private

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.

Referenced by parseDOMTree().

static eZPackage::settingsDirectory ( )
static

Referenced by exportToArchive().

eZPackage::simpleFilePath (   $fileKey)

Get complete path to file by file key

Parameters
filekey
Returns
complete file path
static eZPackage::simpleFilesDirectory ( )
staticprivate

Get local simple file path

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.
eZPackage::store ( )

Stores the current package in the repository.

eZPackage::storeCache (   $directory = false)
private

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

Referenced by storePackageFile().

static eZPackage::storeDOM (   $filename,
  $dom 
)
static

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

Referenced by appendInstall(), and storeToFile().

eZPackage::storePackageFile (   $path,
  $storeCache = true 
)

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

Referenced by exportToArchive(), and store().

static eZPackage::storeString (   $filename,
  $data 
)
staticprivate

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

Returns
true if successful.

Referenced by storePackageFile().

eZPackage::storeToFile (   $filename)

Stores the current package to the file $filename.

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

Referenced by exportName().

static eZPackage::systemRepositoryInformation ( )
static
Returns
information on the eZ system repository or false if does not exist.

Referenced by eZStepSiteTypes\retrieveRemotePackagesList().

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

Referenced by exportToArchive().

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

Referenced by import().

eZPackage::thumbnailList (   $collectionName)

Referenced by attribute().

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

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.
eZPackage::uninstall (   $uninstallParameters = array())

Install all install items in package

eZPackage::uninstallItem (   $item,
$uninstallParameters 
)

Referenced by uninstall().

static eZPackage::useCache ( )
static

Referenced by fetch(), and fetchPackages().

Member Data Documentation

eZPackage::$isInstalled = false

Referenced by attribute(), and isInstalled().

eZPackage::$Parameters

All interal data.

Referenced by fetchFromCache().

const eZPackage::CACHE_CODE_DATE = 1069339607

Referenced by fetchFromCache(), and storeCache().

const eZPackage::DEVELOPMENT = false

Referenced by domStructure(), and setParameters().

const eZPackage::STATUS_ALREADY_EXISTS = 1
const eZPackage::STATUS_INVALID_NAME = 2
const eZPackage::USE_CACHE = true

Referenced by useCache().

const eZPackage::VERSION = '3.5.2'

Referenced by domStructure().


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