Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZPackageCreationHandler Class Reference
The package manager system

The class eZPackageCreationHandler does. More...

Inheritance diagram for eZPackageCreationHandler:

## Public Member Functions
| __construct ( $id, $name, $steps)
| generateStepMap ( $package, &$persistentData)
| attributes ()
| hasAttribute ( $name)
| attribute ( $name)
| initializeStepMethodMap ()
| loadStepMethodMap ()
| validateStepMethodMap ()
| commitStepMethodMap ()
& | stepMap ()
| stepTemplate ( $step)
| initializeStep ( $package, $http, $step, &$persistentData, $tpl)
| loadStep ( $package, $http, $currentStepID, &$persistentData, $tpl, &$module)
| validateStep ( $package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
| validateAndAdvanceStep ( $package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
| commitStep ( $package, $http, $step, &$persistentData, $tpl)
| finalize (&$package, $http, &$persistentData)
| packageInstallType ( $package, &$persistentData)
| packageInitialState ( $package, &$persistentData)
| initialChangelogEntry ( $package, $http, $step, &$persistentData, $tpl)
| packageType ( $package, &$persistentData)
| createPackage (&$package, $http, &$persistentData, &$cleanupFiles, $storePackage=true)
| generatePackageInformation (&$packageInformation, $package, $http, $step, &$persistentData)
| initializePackageInformation ( $package, $http, $step, &$persistentData, $tpl)
| validatePackageInformation ( $package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
| commitPackageInformation ( $package, $http, $step, &$persistentData, $tpl)
| initializePackageChangelog ( $package, $http, $step, &$persistentData, $tpl)
| validatePackageChangelog ( $package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
| commitPackageChangelog ( $package, $http, $step, &$persistentData, $tpl)
| initializePackageMaintainer ( $package, $http, $step, &$persistentData, $tpl)
| validatePackageMaintainer ( $package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
| commitPackageMaintainer ( $package, $http, $step, &$persistentData, $tpl)
| checkPackageMaintainer ( $package, &$persistentData)
| initializePackageThumbnail ( $package, $http, $step, &$persistentData, $tpl)
| validatePackageThumbnail ( $package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
| commitPackageThumbnail ( $package, $http, $step, &$persistentData, $tpl)

## Static Public Member Functions
static | creatorLimitationList ()
static & | creatorList ( $checkRoles=false)
static | instance ( $handlerName)
| packageInformationStep ()
| packageMaintainerStep ()
| packageChangelogStep ()
| packageThumbnailStep ()
static | httpFileIsImage ( $httpFileName, &$errorList)
static | appendLicence ( $package)

## Public Attributes
| $Attributes
| $InitializeStepMethodMap
| $ValidateStepMethodMap
| $CommitStepMethodMap
| $LoadStepMethodMap
| $StepMap

## Detailed Description

The class eZPackageCreationHandler does.

Definition at line 18 of file ezpackagecreationhandler.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZPackageCreationHandler::__construct | ( |  | $id,
|  |  | $name,
|  |  | $steps
| ) |  |

Constructor

Parameters

  int | $id |
  string | $name |
  array | $steps |

Definition at line 33 of file ezpackagecreationhandler.php.

## Member Function Documentation

## ◆ appendLicence()

static eZPackageCreationHandler::appendLicence | ( |  | $package | ) |
| static

Appends the GPL licence file to the package object $package.

Definition at line 1000 of file ezpackagecreationhandler.php.

Referenced by createPackage().

## ◆ attribute()

eZPackageCreationHandler::attribute | ( |  | $name | ) |

Definition at line 114 of file ezpackagecreationhandler.php.

References eZDebug\writeError().

Referenced by generateStepMap(), and stepTemplate().

## ◆ attributes()

eZPackageCreationHandler::attributes | ( |  | ) |

Definition at line 104 of file ezpackagecreationhandler.php.

## ◆ checkPackageMaintainer()

eZPackageCreationHandler::checkPackageMaintainer | ( |  | $package,
|  | & | $persistentData
| ) |  |

Checks if the maintainer step is required and return `true` if so, otherwise `false`. The maintainer step is not required if the user has no maintainer roles to use or if the package already has a maintainer with the same name as the current user.

Definition at line 893 of file ezpackagecreationhandler.php.

References eZUser\currentUser(), eZPackage\fetchMaintainerRoleIDList(), and packageType().

## ◆ commitPackageChangelog()

eZPackageCreationHandler::commitPackageChangelog | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

Parses the changelog entry text and turns into an array with change entries.

Definition at line 794 of file ezpackagecreationhandler.php.

## ◆ commitPackageInformation()

eZPackageCreationHandler::commitPackageInformation | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

Commits package information.

Definition at line 722 of file ezpackagecreationhandler.php.

## ◆ commitPackageMaintainer()

eZPackageCreationHandler::commitPackageMaintainer | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

Commits maintainer step data. Does nothing for now.

Definition at line 883 of file ezpackagecreationhandler.php.

## ◆ commitPackageThumbnail()

eZPackageCreationHandler::commitPackageThumbnail | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

Commits thumbnail step data. Does nothing for now.

Definition at line 992 of file ezpackagecreationhandler.php.

## ◆ commitStep()

eZPackageCreationHandler::commitStep | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

This is called after a step has validated it's information. It can be used to put values in the $persistentData variable for later retrieval.

Definition at line 247 of file ezpackagecreationhandler.php.

References commitStepMethodMap().

## ◆ commitStepMethodMap()

eZPackageCreationHandler::commitStepMethodMap | ( |  | ) |

Definition at line 140 of file ezpackagecreationhandler.php.

References $CommitStepMethodMap.

Referenced by commitStep().

## ◆ createPackage()

eZPackageCreationHandler::createPackage | ( | & | $package,
|  |  | $http,
|  | & | $persistentData,
|  | & | $cleanupFiles,
|  |  | $storePackage = `true`
| ) |  |

Creates a new package in $package and initializes it with the basic data. The information is taken from the $persistentData which must be filled in prior to this function is called.

Returns
  `true` if the package was created or `false` if it was only re-initialized.

See also
  packageType, packageInitialState and packageInstallType

Definition at line 493 of file ezpackagecreationhandler.php.

References appendLicence(), eZPackage\create(), packageInitialState(), packageInstallType(), and packageType().

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

## ◆ creatorLimitationList()

static eZPackageCreationHandler::creatorLimitationList | ( |  | ) |
| static

Returns
  a list of the available creators usable as a limitation in the role system.

Definition at line 273 of file ezpackagecreationhandler.php.

References creatorList().

## ◆ creatorList()

static& eZPackageCreationHandler::creatorList | ( |  | $checkRoles = `false` | ) |
| static

Returns
  a list of the available creators.

Definition at line 289 of file ezpackagecreationhandler.php.

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

Referenced by creatorLimitationList().

## ◆ finalize()

eZPackageCreationHandler::finalize | ( | & | $package,
|  |  | $http,
|  | & | $persistentData
| ) |  |

Finalizes the creation process with the gathered information. This is usually the function that creates the package and adds the proper elements.

Reimplemented in eZStylePackageCreator, eZExtensionPackageCreator, eZContentObjectPackageCreator, and eZContentClassPackageCreator.

Definition at line 265 of file ezpackagecreationhandler.php.

## ◆ generatePackageInformation()

eZPackageCreationHandler::generatePackageInformation | ( | & | $packageInformation,
|  |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData
| ) |  |

This is called on the package information step to initialize the name, summary and description fields. Reimplementing this function allows the creator to fill in some default values for the information fields.

Note
  The default does nothing.

Reimplemented in eZStylePackageCreator, eZExtensionPackageCreator, eZContentObjectPackageCreator, and eZContentClassPackageCreator.

Definition at line 603 of file ezpackagecreationhandler.php.

Referenced by initializePackageInformation().

## ◆ generateStepMap()

eZPackageCreationHandler::generateStepMap | ( |  | $package,
|  | & | $persistentData
| ) |  |

Will go over the steps and make sure that:

- The next and previous links are correct

- Steps that aren't needed are removed

  It will also make sure that steps can be looked up by their ID.

Definition at line 53 of file ezpackagecreationhandler.php.

References $StepMap, and attribute().

## ◆ hasAttribute()

eZPackageCreationHandler::hasAttribute | ( |  | $name | ) |

Definition at line 109 of file ezpackagecreationhandler.php.

## ◆ httpFileIsImage()

static eZPackageCreationHandler::httpFileIsImage | ( |  | $httpFileName,
|  | & | $errorList
| ) |  |
| static

Check if the HTTP file is an image.

Definition at line 959 of file ezpackagecreationhandler.php.

References eZMimeType\findByURL(), and ezpI18n\tr().

## ◆ initialChangelogEntry()

eZPackageCreationHandler::initialChangelogEntry | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

Returns
  The initial changelog entry for a package. It is possible to get different initial texts by reimplementing this function.

Note
  This function is called from initializePackageChangelog()

Definition at line 464 of file ezpackagecreationhandler.php.

Referenced by initializePackageChangelog().

## ◆ initializePackageChangelog()

eZPackageCreationHandler::initializePackageChangelog | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

Initializes the package changelog step with some values taken from the current users and the funcvtion initialChangelogEntry().

Definition at line 730 of file ezpackagecreationhandler.php.

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

## ◆ initializePackageInformation()

eZPackageCreationHandler::initializePackageInformation | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

Initializes the package information step with some default values. It will call generatePackageInformation() after the values are initialized.

Definition at line 611 of file ezpackagecreationhandler.php.

References eZUser\currentUser(), generatePackageInformation(), and eZCharTransform\instance().

## ◆ initializePackageMaintainer()

eZPackageCreationHandler::initializePackageMaintainer | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

Initializes the package maintainer step with some values taken from the current user.

Definition at line 831 of file ezpackagecreationhandler.php.

References eZUser\currentUser().

## ◆ initializePackageThumbnail()

eZPackageCreationHandler::initializePackageThumbnail | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

Initializes the package thumbnail step.

Definition at line 923 of file ezpackagecreationhandler.php.

## ◆ initializeStep()

eZPackageCreationHandler::initializeStep | ( |  | $package,
|  |  | $http,
|  |  | $step,
|  | & | $persistentData,
|  |  | $tpl
| ) |  |

This is called the first time the step is entered (ie. not on validations) and can be used to fill in values in the $persistentData variable for use in the template or later retrieval.

Definition at line 171 of file ezpackagecreationhandler.php.

References initializeStepMethodMap().

## ◆ initializeStepMethodMap()

eZPackageCreationHandler::initializeStepMethodMap | ( |  | ) |

Definition at line 125 of file ezpackagecreationhandler.php.

References $InitializeStepMethodMap.

Referenced by initializeStep().

## ◆ instance()

static eZPackageCreationHandler::instance | ( |  | $handlerName | ) |
| static

Returns a shared instance of the eZPackageCreationHandler class pr $handlerName as defined in package.ini[CreationSettings]HandlerAlias

Parameters

  string | $handlerName |

Returns
  eZPackageCreationHandler

Definition at line 346 of file ezpackagecreationhandler.php.

References eZExtension\getHandlerClass().

Referenced by creatorList().

## ◆ loadStep()

eZPackageCreationHandler::loadStep | ( |  | $package,
|  |  | $http,
|  |  | $currentStepID,
|  | & | $persistentData,
|  |  | $tpl,
|  | & | $module
| ) |  |

Called each time a step is loaded, and can be used to fetch and process input data in each step.

Definition at line 187 of file ezpackagecreationhandler.php.

References loadStepMethodMap().

## ◆ loadStepMethodMap()

eZPackageCreationHandler::loadStepMethodMap | ( |  | ) |

Definition at line 130 of file ezpackagecreationhandler.php.

References $LoadStepMethodMap.

Referenced by loadStep().

## ◆ packageChangelogStep()

eZPackageCreationHandler::packageChangelogStep | ( |  | ) |
| static

Returns
  A ready to use creation step which takes care of reading in a changelog entry.

Definition at line 409 of file ezpackagecreationhandler.php.

References ezpI18n\tr().

Referenced by eZContentClassPackageCreator\__construct(), eZContentObjectPackageCreator\__construct(), eZExtensionPackageCreator\__construct(), and eZStylePackageCreator\__construct().

## ◆ packageInformationStep()

eZPackageCreationHandler::packageInformationStep | ( |  | ) |
| static

Returns
  A ready to use creation step which takes care of package information.

Definition at line 378 of file ezpackagecreationhandler.php.

References ezpI18n\tr().

Referenced by eZContentClassPackageCreator\__construct(), eZContentObjectPackageCreator\__construct(), eZExtensionPackageCreator\__construct(), and eZStylePackageCreator\__construct().

## ◆ packageInitialState()

eZPackageCreationHandler::packageInitialState | ( |  | $package,
|  | & | $persistentData
| ) |  |

Returns
  the initial state of the package.

The state of a package generally tells how stable a package is, see eZPackage::stateList() for more information on possible states.

Note
  The default returns `'alpha'`

Reimplemented in eZStylePackageCreator, eZExtensionPackageCreator, eZContentObjectPackageCreator, and eZContentClassPackageCreator.

Definition at line 453 of file ezpackagecreationhandler.php.

Referenced by createPackage().

## ◆ packageInstallType()

eZPackageCreationHandler::packageInstallType | ( |  | $package,
|  | & | $persistentData
| ) |  |

Returns
  the type installation this package uses.

This method is called from the createPackage() method and will return `'install'` by default. If you want the creator to have a different install type reimplement this function in the creator.

Reimplemented in eZStylePackageCreator, and eZExtensionPackageCreator.

Definition at line 441 of file ezpackagecreationhandler.php.

Referenced by createPackage().

## ◆ packageMaintainerStep()

eZPackageCreationHandler::packageMaintainerStep | ( |  | ) |
| static

Returns
  A ready to use creation step which takes care of reading in maintainer information.

Definition at line 393 of file ezpackagecreationhandler.php.

References ezpI18n\tr().

Referenced by eZContentClassPackageCreator\__construct(), eZContentObjectPackageCreator\__construct(), eZExtensionPackageCreator\__construct(), and eZStylePackageCreator\__construct().

## ◆ packageThumbnailStep()

eZPackageCreationHandler::packageThumbnailStep | ( |  | ) |
| static

Returns
  A ready to use creation step which takes care of fetching a thumbnail image.

Definition at line 424 of file ezpackagecreationhandler.php.

References ezpI18n\tr().

Referenced by eZStylePackageCreator\__construct().

## ◆ packageType()

eZPackageCreationHandler::packageType | ( |  | $package,
|  | & | $persistentData
| ) |  |

Returns
  The package type taken from $package if the package exists, otherwise `false`. If the creator should have a specific package type this function should be reimplemented. See eZPackage::typeList() for more information on available types.

Note
  This function is called from createPackage and checkPackageMaintainer()

Reimplemented in eZStylePackageCreator, eZExtensionPackageCreator, eZContentObjectPackageCreator, and eZContentClassPackageCreator.

Definition at line 477 of file ezpackagecreationhandler.php.

Referenced by checkPackageMaintainer(), and createPackage().

## ◆ stepMap()

& eZPackageCreationHandler::stepMap | ( |  | ) |

Returns
  a process step map which has proper next/previous links, method maps and allows lookup of steps by ID.

Definition at line 149 of file ezpackagecreationhandler.php.

References $StepMap.

## ◆ stepTemplate()

eZPackageCreationHandler::stepTemplate | ( |  | $step | ) |

Definition at line 154 of file ezpackagecreationhandler.php.

References attribute().

## ◆ validateAndAdvanceStep()

eZPackageCreationHandler::validateAndAdvanceStep | ( |  | $package,
|  |  | $http,
|  |  | $currentStepID,
|  | & | $stepMap,
|  | & | $persistentData,
|  | & | $errorList
| ) |  |

Definition at line 229 of file ezpackagecreationhandler.php.

References validateStepMethodMap().

Referenced by validateStep().

## ◆ validatePackageChangelog()

eZPackageCreationHandler::validatePackageChangelog | ( |  | $package,
|  |  | $http,
|  |  | $currentStepID,
|  | & | $stepMap,
|  | & | $persistentData,
|  | & | $errorList
| ) |  |

Checks if the POST variables contains a name and email for the changelog person and the changelog field contains some text.

Definition at line 753 of file ezpackagecreationhandler.php.

References ezpI18n\tr().

## ◆ validatePackageInformation()

eZPackageCreationHandler::validatePackageInformation | ( |  | $package,
|  |  | $http,
|  |  | $currentStepID,
|  | & | $stepMap,
|  | & | $persistentData,
|  | & | $errorList
| ) |  |

Reads in the package information values from POST variables and makes sure that the package name and package summary is filled in, the version is in correct format and that a package does not already exists with the same name.

Definition at line 641 of file ezpackagecreationhandler.php.

References eZPackage\fetch(), eZCharTransform\instance(), and ezpI18n\tr().

## ◆ validatePackageMaintainer()

eZPackageCreationHandler::validatePackageMaintainer | ( |  | $package,
|  |  | $http,
|  |  | $currentStepID,
|  | & | $stepMap,
|  | & | $persistentData,
|  | & | $errorList
| ) |  |

Checks if the POST variables has a name and email for the person.

Definition at line 848 of file ezpackagecreationhandler.php.

References ezpI18n\tr().

## ◆ validatePackageThumbnail()

eZPackageCreationHandler::validatePackageThumbnail | ( |  | $package,
|  |  | $http,
|  |  | $currentStepID,
|  | & | $stepMap,
|  | & | $persistentData,
|  | & | $errorList
| ) |  |

Checks if the POST variables has a proper thumbnail image.

Definition at line 931 of file ezpackagecreationhandler.php.

References eZHTTPFile\canFetch(), eZMimeType\changeDirectoryPath(), eZHTTPFile\fetch(), eZMimeType\findByFileContents(), eZSys\storageDirectory(), and ezpI18n\tr().

## ◆ validateStep()

eZPackageCreationHandler::validateStep | ( |  | $package,
|  |  | $http,
|  |  | $currentStepID,
|  | & | $stepMap,
|  | & | $persistentData,
|  | & | $errorList
| ) |  |

This is called after a step is finished. Reimplement this function to validate the step values and give back errors.

Returns
  `false` if the next step should not be fetched (ie. errors) or `true` if the all is OK and the next step should be fetched. It is also possible to return a step identifier, in which case this will be the next step.

Definition at line 208 of file ezpackagecreationhandler.php.

References validateAndAdvanceStep().

## ◆ validateStepMethodMap()

eZPackageCreationHandler::validateStepMethodMap | ( |  | ) |

Definition at line 135 of file ezpackagecreationhandler.php.

References $ValidateStepMethodMap.

Referenced by validateAndAdvanceStep().

## Member Data Documentation

## ◆ $Attributes

eZPackageCreationHandler::$Attributes

Definition at line 20 of file ezpackagecreationhandler.php.

## ◆ $CommitStepMethodMap

eZPackageCreationHandler::$CommitStepMethodMap

Definition at line 23 of file ezpackagecreationhandler.php.

Referenced by commitStepMethodMap().

## ◆ $InitializeStepMethodMap

eZPackageCreationHandler::$InitializeStepMethodMap

Definition at line 21 of file ezpackagecreationhandler.php.

Referenced by initializeStepMethodMap().

## ◆ $LoadStepMethodMap

eZPackageCreationHandler::$LoadStepMethodMap

Definition at line 24 of file ezpackagecreationhandler.php.

Referenced by loadStepMethodMap().

## ◆ $StepMap

eZPackageCreationHandler::$StepMap

Definition at line 25 of file ezpackagecreationhandler.php.

Referenced by generateStepMap(), and stepMap().

## ◆ $ValidateStepMethodMap

eZPackageCreationHandler::$ValidateStepMethodMap

Definition at line 22 of file ezpackagecreationhandler.php.

Referenced by validateStepMethodMap().

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

- ezpackagecreationhandler.php

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