eZPublish  3.8
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)
 
 canUsePolicyFunction ($functionName)
 
 create ($name, $parameters=array(), $repositoryPath=false, $repositoryID=false)
 
 createDependencyText (&$cli, $dependencyItem, $dependencySection)
 
 createDependencyTree (&$dependenciesNode, $dependencyType, $list)
 
 currentRepositoryInformation ()
 
 currentRepositoryPath ()
 
 dependencyItems ($dependencySection, $parameters=false)
 
 dependencyOperatorText ($dependencyItem)
 
domStructure ()
 
 exportName ()
 
 exportToArchive ($archivePath)
 
 eZPackage ($parameters=array(), $repositoryPath=false)
 
 fetchDependentPackages ($dependencyType, &$failedList)
 
 fetchMaintainerRoleIDList ($packageType=false, $checkRoles=false)
 
 fetchMaintainerRoleList ($packageType=false, $checkRoles=false)
 
 fetchPackages ($parameters=array(), $filterArray=array())
 
 fileCount ()
 
 fileItemPath ($fileItem, $collectionName, $path=false)
 
 fileList ($collectionName)
 
 fileStorePath ($fileItem, $collectionName, $path=false, $installVariables=array())
 
 getInstallState ()
 
 groupDependencyItemsByType ($dependencyItems)
 
 hasAttribute ($attributeName)
 
import ($archiveName, &$packageName, $dbAvailable=true, $repositoryID=false)
 
 install (&$installParameters)
 
 installItem ($item, &$installParameters)
 
 installItemsList ($type=false, $os=false, $name=false, $isInstall=true)
 
 isInstalled ()
 
 maintainerRoleListForRoles ()
 
 maintainerRoleName ($roleID)
 
 md5sum ($file)
 
packageHandler ($handlerName)
 
 path ()
 
 remove ()
 
 removeFiles ($path)
 
 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)
 
 settingsDirectory ()
 
 simpleFilePath ($fileKey)
 
 store ()
 
 storeDOM ($filename, $dom)
 
 storePackageFile ($path, $storeCache=true)
 
 storeToFile ($filename)
 
 thumbnailList ($collectionName)
 
 typeList ()
 
 uninstall ($uninstallParameters=array())
 
 uninstallItem ($item, &$uninstallParameters)
 
 useCache ()
 

Static Public Member Functions

 cacheDirectory ()
 
 definitionFilename ()
 
 documentDirectory ()
 
 fetch ($packageName, $packagePath=false, $repositoryID=false, $dbAvailable=true)
 
 fetchFromFile ($filename)
 
 filesDirectory ()
 
 getVersion ()
 Returns package version. More...
 
 packageRepositories ($parameters=array())
 
 repositoryInformation ($repositoryID)
 
 repositoryPath ()
 
 stateList ()
 
 suffix ()
 
 temporaryExportPath ()
 
 temporaryImportPath ()
 

Public Attributes

 $isInstalled = false
 

Private Member Functions

 createInstallTree (&$installNode, &$dom, $list, $installType)
 
fetchDOMFromFile ($filename)
 
 fetchFromCache ($packagePath, $packageModification, &$cacheExpired)
 
 parseDependencyTree (&$dependenciesList, $dependencySection)
 
parseDOMTree (&$dom)
 
 parseInstallTree ($installList, $isInstall)
 
 setParameters ($parameters=array())
 
 simpleFilesDirectory ()
 
 storeCache ($directory=false)
 
 toString ($export=false)
 

Static Private Member Functions

 storeString ($filename, $data)
 

Private Attributes

 $Parameters
 All interal data. More...
 

Detailed Description

Maintains eZ publish packages.

package The package manager system

Member Function Documentation

eZPackage::appendChange (   $person,
  $email,
  $changes,
  $release = false,
  $timestamp = null 
)
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.
eZPackage::appendDocument (   $name,
  $mimeType = false,
  $os = false,
  $audience = false,
  $create = false,
  $data = false 
)
eZPackage::appendFile (   $file,
  $type,
  $role,
  $design,
  $filePath,
  $collection,
  $subDirectory = null,
  $md5 = null,
  $copyFile = false,
  $modified = null,
  $fileType = false,
  $roleValue = false,
  $variableName = false,
  $packagePath = false 
)
eZPackage::appendGroup (   $name)
eZPackage::appendInstall (   $type,
  $name,
  $os = false,
  $isInstall = true,
  $filename = false,
  $subdirectory = false,
  $parameters = false 
)
eZPackage::appendMaintainer (   $name,
  $email,
  $role = false 
)
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
& eZPackage::attribute (   $attributeName)
Returns
the value of the attribute named $attributeName.
eZPackage::attributes ( )
Returns
the attribuets for this package.
eZPackage::cacheDirectory ( )
static
Returns
the name of the cache directory for cached package data.
eZPackage::canExport ( )
eZPackage::canImport ( )
eZPackage::canInstall ( )
eZPackage::canRead ( )
eZPackage::canUsePackagePolicyFunction (   $functionName)
eZPackage::create (   $name,
  $parameters = array(),
  $repositoryPath = false,
  $repositoryID = false 
)
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'
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'
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.
eZPackage::currentRepositoryPath ( )
Returns
the path to the current repository.
eZPackage::definitionFilename ( )
static
Returns
the name of the package definition file.
eZPackage::dependencyItems (   $dependencySection,
  $parameters = false 
)
Returns
an array with dependency items which match the specified criterias.
eZPackage::dependencyOperatorText (   $dependencyItem)
eZPackage::documentDirectory ( )
static
Returns
the name of the documents directory for cached package data.

Referenced by eZPackageOperator\modify().

& eZPackage::domStructure ( )
Returns
the dom document of the package.
eZPackage::exportName ( )
eZPackage::exportToArchive (   $archivePath)
eZPackage::eZPackage (   $parameters = array(),
  $repositoryPath = false 
)

Constructor

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(), eZPackageFunctionCollection\fetchDependentPackageList(), eZPackageType\fetchObjectAttributeHTTPInput(), eZPackageFunctionCollection\fetchPackage(), eZStepCreateSites\initializePackage(), 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...)
& eZPackage::fetchDOMFromFile (   $filename)
private

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

eZPackage::fetchFromCache (   $packagePath,
  $packageModification,
$cacheExpired 
)
private
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.
eZPackage::fetchMaintainerRoleIDList (   $packageType = false,
  $checkRoles = false 
)
eZPackage::fetchMaintainerRoleList (   $packageType = false,
  $checkRoles = false 
)
eZPackage::fetchPackages (   $parameters = array(),
  $filterArray = array() 
)
eZPackage::fileCount ( )
eZPackage::fileItemPath (   $fileItem,
  $collectionName,
  $path = false 
)
eZPackage::fileList (   $collectionName)
eZPackage::filesDirectory ( )
static
Returns
the name of the documents directory for cached package data.
eZPackage::fileStorePath (   $fileItem,
  $collectionName,
  $path = false,
  $installVariables = array() 
)
eZPackage::getInstallState ( )
eZPackage::getVersion ( )
static

Returns package version.

Combines package version number and release number.

Returns
Package version (string).
eZPackage::groupDependencyItemsByType (   $dependencyItems)
eZPackage::hasAttribute (   $attributeName)
Returns
true if the attribute named $attributeName exists.
& eZPackage::import (   $archiveName,
$packageName,
  $dbAvailable = true,
  $repositoryID = false 
)
eZPackage::install ( $installParameters)

Install all install items in package

eZPackage::installItem (   $item,
$installParameters 
)

Install specified install item in package

Parameters
Itemindex
parameters
eZPackage::installItemsList (   $type = false,
  $os = false,
  $name = false,
  $isInstall = true 
)
Returns
an array with install items which match the specified criterias.
eZPackage::isInstalled ( )
eZPackage::maintainerRoleListForRoles ( )
eZPackage::maintainerRoleName (   $roleID)
eZPackage::md5sum (   $file)
& eZPackage::packageHandler (   $handlerName)
Returns
the package handler object for the handler named $handlerName.

Referenced by eZContentClassPackageCreator\finalize(), and eZContentObjectPackageCreator\finalize().

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 eZPackageFunctionCollection\fetchRepositoryList().

eZPackage::parseDependencyTree ( $dependenciesList,
  $dependencySection 
)
private
& eZPackage::parseDOMTree ( $dom)
private
eZPackage::parseInstallTree (   $installList,
  $isInstall 
)
private
eZPackage::path ( )
Returns
the full path to this package.

Referenced by remove().

eZPackage::remove ( )

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

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

Referenced by eZPackage().

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 remove().

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

Sets the packager of this release.

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

Referenced by eZPackage().

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.
eZPackage::settingsDirectory ( )
eZPackage::simpleFilePath (   $fileKey)

Get complete path to file by file key

Parameters
filekey
Returns
complete file path
eZPackage::simpleFilesDirectory ( )
private

Get local simple file path

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.

eZPackage::storeDOM (   $filename,
  $dom 
)

Stores the DOM tree $dom to the file $filename. The DOM tree will be turned into a string before being stored.

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

Stores the current package definition file.

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

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

Returns
true if successful.
eZPackage::storeToFile (   $filename)

Stores the current package to the file $filename.

eZPackage::suffix ( )
static
Returns
the suffix for all package files.
eZPackage::temporaryExportPath ( )
static
Returns
the directory name for temporary export packages, used in conjunction with eZSys::cacheDirectory().
eZPackage::temporaryImportPath ( )
static
Returns
the directory name for temporary import packages, used in conjunction with eZSys::cacheDirectory().
eZPackage::thumbnailList (   $collectionName)
eZPackage::toString (   $export = false)
private
Returns
the package as a string, the string is in xml format.
eZPackage::typeList ( )

Removes some temporary variables.

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

Install all install items in package

eZPackage::uninstallItem (   $item,
$uninstallParameters 
)
eZPackage::useCache ( )

Member Data Documentation

eZPackage::$isInstalled = false
eZPackage::$Parameters
private

All interal data.


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