Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | List of all members
eZPackage Class Reference

Maintains eZ Publish packages. More...

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

## Static Public Member Functions
static | typeList ()
static | stateList ()
static | create ( $name, $parameters=array(), $repositoryPath=false, $repositoryID=false)
static | canUsePolicyFunction ( $functionName)
static | fetchMaintainerRoleIDList ( $packageType=false, $checkRoles=false)
static | fetchMaintainerRoleList ( $packageType=false, $checkRoles=false)
static | maintainerRoleListForRoles ()
static | maintainerRoleName ( $roleID)
static | md5sum ( $file)
static | removeFiles ( $path)
static | import ( $archiveName, &$packageName, $dbAvailable=true, $repositoryID=false)
static | suffix ()
static | applyStorageFilePermissions ( $filename)
static | storeDOM ( $filename, $dom)
static | fetchFromFile ( $filename)
static | fetch ( $packageName, $packagePath=false, $repositoryID=false, $dbAvailable=true)
static | useCache ()
static | temporaryExportPath ()
static | temporaryImportPath ()
static | repositoryPath ()
static | cacheDirectory ()
static | definitionFilename ()
static | documentDirectory ()
static | filesDirectory ()
static | settingsDirectory ()
static | packageRepositories ( $parameters=array())
static | repositoryInformation ( $repositoryID)
static | systemRepositoryInformation ()
static | fetchPackages ( $parameters=array(), $filterArray=array())
static | packageHandler ( $handlerName)
| getVersion ()
static | languageInfoFromPackageList ( $packageNameList, $withLanguageNames=false)
static | isValidName ( $packageName, &$transformedPackageName=null)

## Public Attributes
| $RepositoryPath
| $RepositoryInformation
| $PolicyCache
| $InstallData
const | VERSION = '3.5.2'
const | DEVELOPMENT = false
const | USE_CACHE = true
const | CACHE_CODE_DATE = 1069339607
const | STATUS_ALREADY_EXISTS = 1
const | STATUS_INVALID_NAME = 2
const | NON_INTERACTIVE = -1
| $isInstalled = false
| $Parameters

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

## Static Private Member Functions
static | storeString ( $filename, $data)
static | fetchDOMFromFile ( $filename)
static | fetchFromCache ( $packagePath, $packageModification, &$cacheExpired)
static | simpleFilesDirectory ()

## Detailed Description

Maintains eZ Publish packages.

Definition at line 19 of file ezpackage.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZPackage::__construct | ( |  | $parameters = `array()`,
|  |  | $repositoryPath = `false`
| ) |  |

Constructor

Parameters

  array | $parameters |
  string | bool | $repositoryPath |

Definition at line 41 of file ezpackage.php.

References repositoryPath(), and setParameters().

## Member Function Documentation

## ◆ appendChange()

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

Definition at line 491 of file ezpackage.php.

Referenced by parseDOMTree().

## ◆ appendDependency()

eZPackage::appendDependency | ( |  | $dependencySection,
|  |  | $parameters
| ) |  |

Appends a new dependency item to the section $dependencySection.

Parameters

  $dependencySection | Can be one of `provides`, `requires`, `obsoletes`, `conflicts`
  $parameters | A list of data specific to the dependency type.

Definition at line 758 of file ezpackage.php.

Referenced by appendProvides(), and parseDependencyTree().

## ◆ appendDocument()

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

Definition at line 467 of file ezpackage.php.

References eZFile\create(), documentDirectory(), and path().

Referenced by parseDOMTree().

## ◆ appendFile()

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 670 of file ezpackage.php.

References eZDir\copy(), eZFileHandler\copy(), filesDirectory(), md5sum(), eZDir\mkdir(), path(), and eZDir\temporaryFileRegexp().

Referenced by parseDOMTree().

## ◆ appendGroup()

eZPackage::appendGroup | ( |  | $name | ) |

Definition at line 485 of file ezpackage.php.

## ◆ appendInstall()

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

Definition at line 883 of file ezpackage.php.

References eZDir\mkdir(), path(), and storeDOM().

Referenced by parseInstallTree().

## ◆ appendMaintainer()

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

Definition at line 460 of file ezpackage.php.

Referenced by parseDOMTree().

## ◆ appendProvides()

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 741 of file ezpackage.php.

References appendDependency().

## ◆ appendSimpleFile()

eZPackage::appendSimpleFile | ( |  | $key,
|  |  | $filepath
| ) |  |

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

Parameters

  key |
  file | path

Definition at line 2846 of file ezpackage.php.

References eZFileHandler\copy(), eZDir\dirpath(), eZClusterFileHandler\instance(), eZDir\mkdir(), path(), simpleFilesDirectory(), and eZFile\suffix().

## ◆ applyStorageFilePermissions()

static eZPackage::applyStorageFilePermissions | ( |  | $filename | ) |
| static

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

Definition at line 1237 of file ezpackage.php.

Referenced by storeDOM(), and storeString().

## ◆ attribute()

eZPackage::attribute | ( |  | $attributeName | ) |

Returns
  the value of the attribute named $attributeName.

Definition at line 237 of file ezpackage.php.

References $isInstalled, canExport(), canImport(), canInstall(), canRead(), currentRepositoryInformation(), fileCount(), thumbnailList(), and eZDebug\writeError().

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

## ◆ attributes()

eZPackage::attributes | ( |  | ) |

Returns
  the attributes for this package.

Definition at line 183 of file ezpackage.php.

Referenced by hasAttribute().

## ◆ cacheDirectory()

static eZPackage::cacheDirectory | ( |  | ) |
| static

Returns
  the name of the cache directory for cached package data.

Definition at line 1518 of file ezpackage.php.

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

## ◆ canExport()

eZPackage::canExport | ( |  | ) |

Definition at line 314 of file ezpackage.php.

References canUsePackagePolicyFunction().

Referenced by attribute().

## ◆ canImport()

eZPackage::canImport | ( |  | ) |

Definition at line 319 of file ezpackage.php.

References canUsePackagePolicyFunction().

Referenced by attribute().

## ◆ canInstall()

eZPackage::canInstall | ( |  | ) |

Definition at line 324 of file ezpackage.php.

References canUsePackagePolicyFunction().

Referenced by attribute().

## ◆ canRead()

eZPackage::canRead | ( |  | ) |

Definition at line 309 of file ezpackage.php.

References canUsePackagePolicyFunction().

Referenced by attribute().

## ◆ canUsePackagePolicyFunction()

eZPackage::canUsePackagePolicyFunction | ( |  | $functionName | ) |

Definition at line 329 of file ezpackage.php.

References attribute(), and eZUser\currentUser().

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

## ◆ canUsePolicyFunction()

static eZPackage::canUsePolicyFunction | ( |  | $functionName | ) |
| static

Definition at line 298 of file ezpackage.php.

References eZUser\currentUser().

## ◆ create()

static eZPackage::create | ( |  | $name,
|  |  | $parameters = `array()`,
|  |  | $repositoryPath = `false`,
|  |  | $repositoryID = `false`
| ) |  |
| static

Parameters

  $repositoryID | The id (string) of the repository to create the package in. If `false` it will use the `local` repository.

Definition at line 165 of file ezpackage.php.

Referenced by eZPackageCreationHandler\createPackage().

## ◆ createDependencyText()

eZPackage::createDependencyText | ( |  | $cli,
|  |  | $dependencyItem,
|  |  | $dependencySection
| ) |  |

Definition at line 773 of file ezpackage.php.

References dependencyOperatorText(), and packageHandler().

## ◆ createDependencyTree()

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

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

Parameters

  $dependencyType | Is either `'provide'`, `'require'`, `'obsolete'` or `'conflict'`

Definition at line 2782 of file ezpackage.php.

References packageHandler().

Referenced by domStructure().

## ◆ createInstallTree()

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

  $installType | Is either `'install'` or `'uninstall'`

Definition at line 2740 of file ezpackage.php.

References packageHandler().

Referenced by domStructure().

## ◆ currentRepositoryInformation()

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 1679 of file ezpackage.php.

References $RepositoryInformation.

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

## ◆ currentRepositoryPath()

eZPackage::currentRepositoryPath | ( |  | ) |

Returns
  the path to the current repository.

Definition at line 1468 of file ezpackage.php.

References $RepositoryPath, and currentRepositoryInformation().

Referenced by path().

## ◆ defaultLanguageMap()

eZPackage::defaultLanguageMap | ( |  | ) |

Definition at line 3066 of file ezpackage.php.

References languageInfo().

## ◆ definitionFilename()

static eZPackage::definitionFilename | ( |  | ) |
| static

Returns
  the name of the package definition file.

Definition at line 1527 of file ezpackage.php.

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

## ◆ dependencyItems()

eZPackage::dependencyItems | ( |  | $dependencySection,
|  |  | $parameters = `false`
| ) |  |

Returns
  an array with dependency items which match the specified criterias.

Definition at line 806 of file ezpackage.php.

## ◆ dependencyOperatorText()

eZPackage::dependencyOperatorText | ( |  | $dependencyItem | ) |

Definition at line 768 of file ezpackage.php.

Referenced by createDependencyText().

## ◆ documentDirectory()

static eZPackage::documentDirectory | ( |  | ) |
| static

Returns
  the name of the documents directory for cached package data.

Definition at line 1536 of file ezpackage.php.

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

## ◆ domStructure()

& eZPackage::domStructure | ( |  | ) |

Returns
  the dom document of the package.

Definition at line 2306 of file ezpackage.php.

References attribute(), createDependencyTree(), createInstallTree(), DEVELOPMENT, and VERSION.

Referenced by storeToFile(), and toString().

## ◆ exportName()

eZPackage::exportName | ( |  | ) |

Returns
  the file name for an exported archive of the current package

Definition at line 1220 of file ezpackage.php.

References attribute(), and suffix().

## ◆ exportToArchive()

eZPackage::exportToArchive | ( |  | $archivePath | ) |

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

Definition at line 1046 of file ezpackage.php.

References attribute(), eZDir\copy(), documentDirectory(), filesDirectory(), path(), eZDir\recursiveList(), removeFiles(), settingsDirectory(), simpleFilesDirectory(), storePackageFile(), and temporaryExportPath().

## ◆ fetch()

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

  $repositoryID | Determines 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.
  $dbAvailable | Do 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 1358 of file ezpackage.php.

References cacheDirectory(), definitionFilename(), fetchFromCache(), fetchFromFile(), packageRepositories(), and useCache().

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

## ◆ fetchDependentPackages()

eZPackage::fetchDependentPackages | ( |  | $dependencyType,
|  | & | $failedList
| ) |  |

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

Parameters

  $dependencyType | is the name of a dependency sub-node. (ie. 'provides', 'requires' etc...)

Definition at line 1568 of file ezpackage.php.

References fetch().

## ◆ fetchDOMFromFile()

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 1302 of file ezpackage.php.

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

## ◆ fetchFromCache()

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

Definition at line 1423 of file ezpackage.php.

References $InstallData, $Parameters, $RepositoryPath, CACHE_CODE_DATE, and cacheDirectory().

Referenced by fetch(), and fetchPackages().

## ◆ fetchFromFile()

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 1328 of file ezpackage.php.

References fetchDOMFromFile().

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

## ◆ fetchMaintainerRoleIDList()

static eZPackage::fetchMaintainerRoleIDList | ( |  | $packageType = `false`,
|  |  | $checkRoles = `false`
| ) |  |
| static

Definition at line 371 of file ezpackage.php.

References eZUser\currentUser().

Referenced by eZPackageCreationHandler\checkPackageMaintainer(), and fetchMaintainerRoleList().

## ◆ fetchMaintainerRoleList()

static eZPackage::fetchMaintainerRoleList | ( |  | $packageType = `false`,
|  |  | $checkRoles = `false`
| ) |  |
| static

Definition at line 421 of file ezpackage.php.

References fetchMaintainerRoleIDList(), and maintainerRoleName().

## ◆ fetchPackages()

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 1690 of file ezpackage.php.

References cacheDirectory(), definitionFilename(), fetchFromCache(), fetchFromFile(), packageRepositories(), and useCache().

## ◆ fileCount()

eZPackage::fileCount | ( |  | ) |

Definition at line 660 of file ezpackage.php.

Referenced by attribute().

## ◆ fileItemPath()

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

Definition at line 612 of file ezpackage.php.

References attribute(), currentRepositoryInformation(), and filesDirectory().

## ◆ fileList()

eZPackage::fileList | ( |  | $collectionName | ) |

Definition at line 635 of file ezpackage.php.

Referenced by thumbnailList().

## ◆ filesDirectory()

static eZPackage::filesDirectory | ( |  | ) |
| static

Returns
  the name of the documents directory for cached package data.

Definition at line 1545 of file ezpackage.php.

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

## ◆ fileStorePath()

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

Definition at line 539 of file ezpackage.php.

References eZDir\path().

## ◆ getInstallState()

eZPackage::getInstallState | ( |  | ) |

Definition at line 2936 of file ezpackage.php.

References getVersion(), eZDB\instance(), and isInstalled().

Referenced by setInstalled().

## ◆ getVersion()

eZPackage::getVersion | ( |  | ) |
| static

Returns package version.

Combines package version number and release number.

Returns
  Package version (string).

Definition at line 2898 of file ezpackage.php.

Referenced by getInstallState(), and setInstalled().

## ◆ groupDependencyItemsByType()

eZPackage::groupDependencyItemsByType | ( |  | $dependencyItems | ) |

Definition at line 791 of file ezpackage.php.

## ◆ hasAttribute()

eZPackage::hasAttribute | ( |  | $attributeName | ) |

Returns
  `true` if the attribute named $attributeName exists.

Definition at line 229 of file ezpackage.php.

References attributes().

## ◆ import()

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

Imports a package from a gzip compressed tarball file

Parameters

  string | $archiveName | Path to the archive file
  string | $packageName | Package name
  bool | $dbAvailable |
  bool | $repositoryID |

Returns
  eZPackage The eZPackage object if successfull, or one of the STATUS_* class constants if an error occurs

Definition at line 1113 of file ezpackage.php.

References definitionFilename(), fetch(), fetchFromFile(), eZDir\mkdir(), eZDir\path(), removeFiles(), repositoryPath(), STATUS_ALREADY_EXISTS, STATUS_INVALID_NAME, temporaryImportPath(), and eZDebug\writeError().

## ◆ install()

eZPackage::install | ( | & | $installParameters | ) |

Installs all items in the package

Parameters

  array | $installParameters |

Returns
  bool true if all items installed correctly, false otherwise

Definition at line 1868 of file ezpackage.php.

References installItem(), setInstalled(), and eZDebug\writeDebug().

## ◆ installItem()

eZPackage::installItem | ( |  | $item,
|  | & | $installParameters
| ) |  |

Install specified install item in package

Parameters

  Item | index
  parameters |

Definition at line 1813 of file ezpackage.php.

References fetchDOMFromFile(), packageHandler(), path(), and eZDebug\writeError().

Referenced by install().

## ◆ installItemsList()

eZPackage::installItemsList | ( |  | $type = `false`,
|  |  | $os = `false`,
|  |  | $name = `false`,
|  |  | $isInstall = `true`
| ) |  |

Returns
  an array with install items which match the specified criterias.

Definition at line 844 of file ezpackage.php.

Referenced by languageInfo(), and uninstall().

## ◆ isInstalled()

eZPackage::isInstalled | ( |  | ) |

Definition at line 2931 of file ezpackage.php.

References $isInstalled.

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

## ◆ isValidName()

static eZPackage::isValidName | ( |  | $packageName,
|  | & | $transformedPackageName = `null`
| ) |  |
| static

Checks if a package name is valid

Parameters

  string | $packageName | the package name
  string | $transformedPackageName | the package name, transformed to be valid

Returns
  boolean true if the package name is valid, false if not

Definition at line 3086 of file ezpackage.php.

References eZCharTransform\instance().

## ◆ languageInfo()

eZPackage::languageInfo | ( |  | $withLanguageNames = `false` | ) |

Fetch info about languages for package.

Definition at line 3003 of file ezpackage.php.

References eZContentLanguage\fetchByLocale(), installItemsList(), and packageHandler().

Referenced by defaultLanguageMap().

## ◆ languageInfoFromPackageList()

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 2965 of file ezpackage.php.

References fetch(), and eZDebug\writeWarning().

## ◆ maintainerRoleListForRoles()

static eZPackage::maintainerRoleListForRoles | ( |  | ) |
| static

Definition at line 434 of file ezpackage.php.

References maintainerRoleName().

## ◆ maintainerRoleName()

static eZPackage::maintainerRoleName | ( |  | $roleID | ) |
| static

Definition at line 448 of file ezpackage.php.

References ezpI18n\tr().

Referenced by fetchMaintainerRoleList(), and maintainerRoleListForRoles().

## ◆ md5sum()

static eZPackage::md5sum | ( |  | $file | ) |
| static

Definition at line 509 of file ezpackage.php.

References eZDebug\writeError().

Referenced by appendFile().

## ◆ packageHandler()

static eZPackage::packageHandler | ( |  | $handlerName | ) |
| static

Returns
  the package handler object for the handler named $handlerName.

Definition at line 2806 of file ezpackage.php.

References eZExtension\getHandlerClass().

Referenced by createDependencyText(), createDependencyTree(), createInstallTree(), eZContentClassPackageCreator\finalize(), eZContentObjectPackageCreator\finalize(), eZExtensionPackageCreator\finalize(), installItem(), languageInfo(), parseDependencyTree(), parseInstallTree(), and uninstallItem().

## ◆ packageRepositories()

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 1605 of file ezpackage.php.

References eZDir\findSubitems(), repositoryPath(), and ezpI18n\tr().

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

## ◆ parseDependencyTree()

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

Definition at line 2248 of file ezpackage.php.

References appendDependency(), and packageHandler().

Referenced by parseDOMTree().

## ◆ parseDOMTree()

eZPackage::parseDOMTree | ( | DOMDocument | $dom | ) |
| private

Definition at line 1973 of file ezpackage.php.

References appendChange(), appendDocument(), appendFile(), appendMaintainer(), eZCharTransform\instance(), parseDependencyTree(), parseInstallTree(), setPackager(), setParameters(), and setRelease().

## ◆ parseInstallTree()

eZPackage::parseInstallTree | ( |  | $installList,
|  |  | $isInstall
| ) |  |
| private

Definition at line 2278 of file ezpackage.php.

References appendInstall(), and packageHandler().

Referenced by parseDOMTree().

## ◆ path()

eZPackage::path | ( |  | ) |

Returns
  the full path to this package.

Definition at line 1458 of file ezpackage.php.

References attribute(), and currentRepositoryPath().

Referenced by appendDocument(), appendFile(), appendInstall(), appendSimpleFile(), exportToArchive(), installItem(), remove(), simpleFilePath(), store(), and uninstallItem().

## ◆ remove()

eZPackage::remove | ( |  | ) |

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

Definition at line 53 of file ezpackage.php.

References path(), eZDir\recursiveDelete(), and setInstalled().

## ◆ removeFiles()

static eZPackage::removeFiles | ( |  | $path | ) |
| static

Recursively deletes $path

Definition at line 1035 of file ezpackage.php.

References eZDir\recursiveDelete().

Referenced by exportToArchive(), and import().

## ◆ repositoryInformation()

static eZPackage::repositoryInformation | ( |  | $repositoryID | ) |
| static

Returns
  information on the repository with ID $repositoryID or `false` if does not exist.

Definition at line 1642 of file ezpackage.php.

References packageRepositories().

Referenced by systemRepositoryInformation().

## ◆ repositoryPath()

static eZPackage::repositoryPath | ( |  | ) |
| static

Returns
  the path to the package repository.

Definition at line 1504 of file ezpackage.php.

References eZDir\path().

Referenced by __construct(), import(), and packageRepositories().

## ◆ setAttribute()

eZPackage::setAttribute | ( |  | $attributeName,
|  |  | $attributeValue
| ) |  |

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

Definition at line 207 of file ezpackage.php.

## ◆ setCurrentRepositoryInformation()

eZPackage::setCurrentRepositoryInformation | ( |  | $information | ) |

Sets the current repository information for the package.

See also
  currentRepositoryInformation, packageRepositories

Definition at line 1668 of file ezpackage.php.

## ◆ setInstalled()

eZPackage::setInstalled | ( |  | $installed = `true` | ) |

Sets installed/uninstalled state of the package

Parameters

  installed |

Definition at line 2907 of file ezpackage.php.

References getInstallState(), getVersion(), eZDB\instance(), and isInstalled().

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

## ◆ setPackager()

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

Sets the packager of this release.

Definition at line 927 of file ezpackage.php.

Referenced by parseDOMTree().

## ◆ setParameters()

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

Definition at line 66 of file ezpackage.php.

References DEVELOPMENT.

Referenced by __construct(), and parseDOMTree().

## ◆ setRelease()

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

  $version | The version number, eg. 1.0, 2.3.5
  $release | The release number, usually starts at 1 and increments for updates on the same version
  $timestamp | The timestamp of the release
  $licence | The licence of the package, eg. GPL, LGPL etc.
  $state | The sate of the release, e.g alpha, beta, stable etc.

Definition at line 945 of file ezpackage.php.

Referenced by parseDOMTree().

## ◆ settingsDirectory()

static eZPackage::settingsDirectory | ( |  | ) |
| static

Definition at line 1559 of file ezpackage.php.

Referenced by exportToArchive().

## ◆ simpleFilePath()

eZPackage::simpleFilePath | ( |  | $fileKey | ) |

Get complete path to file by file key

Parameters

  file | key

Returns
  complete file path

Definition at line 2876 of file ezpackage.php.

References path().

## ◆ simpleFilesDirectory()

static eZPackage::simpleFilesDirectory | ( |  | ) |
| static private

Get local simple file path

Definition at line 1554 of file ezpackage.php.

Referenced by appendSimpleFile(), and exportToArchive().

## ◆ stateList()

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 144 of file ezpackage.php.

## ◆ store()

eZPackage::store | ( |  | ) |

Stores the current package in the repository.

Definition at line 1007 of file ezpackage.php.

References path(), and storePackageFile().

## ◆ storeCache()

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 986 of file ezpackage.php.

References CACHE_CODE_DATE, and eZDir\mkdir().

Referenced by storePackageFile().

## ◆ storeDOM()

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

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

Definition at line 1247 of file ezpackage.php.

References applyStorageFilePermissions(), eZDebug\writeError(), and eZDebugSetting\writeNotice().

Referenced by appendInstall(), and storeToFile().

## ◆ storePackageFile()

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

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

Definition at line 1016 of file ezpackage.php.

References cacheDirectory(), definitionFilename(), eZDir\mkdir(), storeCache(), storeString(), and toString().

Referenced by exportToArchive(), and store().

## ◆ storeString()

static eZPackage::storeString | ( |  | $filename,
|  |  | $data
| ) |  |
| static private

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

Returns
  `true` if successful.

Definition at line 1274 of file ezpackage.php.

References applyStorageFilePermissions(), eZDebug\writeError(), and eZDebugSetting\writeNotice().

Referenced by storePackageFile().

## ◆ storeToFile()

eZPackage::storeToFile | ( |  | $filename | ) |

Stores the current package to the file $filename.

Definition at line 1228 of file ezpackage.php.

References domStructure(), and storeDOM().

## ◆ suffix()

static eZPackage::suffix | ( |  | ) |
| static

Returns
  the suffix for all package files.

Definition at line 1212 of file ezpackage.php.

Referenced by exportName().

## ◆ systemRepositoryInformation()

static eZPackage::systemRepositoryInformation | ( |  | ) |
| static

Returns
  information on the eZ system repository or `false` if does not exist.

Definition at line 1657 of file ezpackage.php.

References repositoryInformation().

## ◆ temporaryExportPath()

static eZPackage::temporaryExportPath | ( |  | ) |
| static

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

Definition at line 1480 of file ezpackage.php.

References eZSys\cacheDirectory(), eZUser\currentUserID(), and eZDir\path().

Referenced by exportToArchive().

## ◆ temporaryImportPath()

static eZPackage::temporaryImportPath | ( |  | ) |
| static

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

Definition at line 1492 of file ezpackage.php.

References eZSys\cacheDirectory(), and eZDir\path().

Referenced by import().

## ◆ thumbnailList()

eZPackage::thumbnailList | ( |  | $collectionName | ) |

Definition at line 643 of file ezpackage.php.

References fileList().

Referenced by attribute().

## ◆ toString()

eZPackage::toString | ( |  | ) |
| private

Returns
  the package as a string, the string is in xml format.

Definition at line 974 of file ezpackage.php.

References domStructure().

Referenced by storePackageFile().

## ◆ typeList()

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 122 of file ezpackage.php.

## ◆ uninstall()

eZPackage::uninstall | ( |  | $uninstallParameters = `array()` | ) |

Install all install items in package

Definition at line 1946 of file ezpackage.php.

References installItemsList(), isInstalled(), setInstalled(), and uninstallItem().

## ◆ uninstallItem()

eZPackage::uninstallItem | ( |  | $item,
|  | & | $uninstallParameters
| ) |  |

Definition at line 1888 of file ezpackage.php.

References fetchDOMFromFile(), packageHandler(), path(), and eZDebug\writeError().

Referenced by uninstall().

## ◆ useCache()

static eZPackage::useCache | ( |  | ) |
| static

Definition at line 1415 of file ezpackage.php.

References USE_CACHE.

Referenced by fetch(), and fetchPackages().

## Member Data Documentation

## ◆ $InstallData

eZPackage::$InstallData

Definition at line 24 of file ezpackage.php.

Referenced by fetchFromCache().

## ◆ $isInstalled

eZPackage::$isInstalled = false

Definition at line 3095 of file ezpackage.php.

Referenced by attribute(), and isInstalled().

## ◆ $Parameters

eZPackage::$Parameters

All interal data

Definition at line 3098 of file ezpackage.php.

Referenced by fetchFromCache().

## ◆ $PolicyCache

eZPackage::$PolicyCache

Definition at line 23 of file ezpackage.php.

## ◆ $RepositoryInformation

eZPackage::$RepositoryInformation

Definition at line 22 of file ezpackage.php.

Referenced by currentRepositoryInformation().

## ◆ $RepositoryPath

eZPackage::$RepositoryPath

Definition at line 21 of file ezpackage.php.

Referenced by currentRepositoryPath(), and fetchFromCache().

## ◆ CACHE_CODE_DATE

const eZPackage::CACHE_CODE_DATE = 1069339607

Definition at line 28 of file ezpackage.php.

Referenced by fetchFromCache(), and storeCache().

## ◆ DEVELOPMENT

const eZPackage::DEVELOPMENT = false

Definition at line 26 of file ezpackage.php.

Referenced by domStructure(), and setParameters().

## ◆ NON_INTERACTIVE

const eZPackage::NON_INTERACTIVE = -1

Definition at line 33 of file ezpackage.php.

Referenced by eZPackageHandler\errorChoosenAction(), eZContentClassPackageHandler\install(), eZExtensionPackageHandler\install(), and eZContentObjectTreeNode\unserialize().

## ◆ STATUS_ALREADY_EXISTS

const eZPackage::STATUS_ALREADY_EXISTS = 1

Definition at line 30 of file ezpackage.php.

Referenced by import().

## ◆ STATUS_INVALID_NAME

const eZPackage::STATUS_INVALID_NAME = 2

Definition at line 31 of file ezpackage.php.

Referenced by import().

## ◆ USE_CACHE

const eZPackage::USE_CACHE = true

Definition at line 27 of file ezpackage.php.

Referenced by useCache().

## ◆ VERSION

const eZPackage::VERSION = '3.5.2'

Definition at line 25 of file ezpackage.php.

Referenced by domStructure().

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

- ezpackage.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.