本文整理汇总了PHP中eZPackage::packageHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP eZPackage::packageHandler方法的具体用法?PHP eZPackage::packageHandler怎么用?PHP eZPackage::packageHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZPackage
的用法示例。
在下文中一共展示了eZPackage::packageHandler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: finalize
function finalize(&$package, $http, &$persistentData)
{
$this->createPackage($package, $http, $persistentData, $cleanupFiles);
$classHandler = eZPackage::packageHandler('ezcontentclass');
$classList = $persistentData['classlist'];
foreach ($classList as $classID) {
$classHandler->addClass($package, $classID);
}
$package->setAttribute('is_active', true);
$package->store();
}
示例2: finalize
function finalize(&$package, $http, &$persistentData)
{
$this->createPackage($package, $http, $persistentData, $cleanupFiles, false);
$extensionHandler = eZPackage::packageHandler('ezextension');
$extensionList = $persistentData['extensionlist'];
foreach ($extensionList as $extensionName) {
$extensionHandler->addExtension($package, $extensionName);
}
$package->setAttribute('is_active', true);
$package->store();
}
示例3: elseif
{
// If this is an unhandled error, we are skipping this item
$currentItem++;
}
$doItemInstall = true;
}
elseif ( $module->isCurrentAction( 'UninstallPackage' ) )
{
$doItemInstall = true;
}
else
{
$uninstallElements = array();
foreach ( $uninstallItems as $uninstallItem )
{
$handler = eZPackage::packageHandler( $uninstallItem['type'] );
if ( $handler )
{
$uninstallElement = $handler->explainInstallItem( $package, $uninstallItem );
if ( $uninstallElement )
{
if ( isset( $uninstallElement[0] ) )
$uninstallElements = array_merge( $uninstallElements, $uninstallElement );
else
$uninstallElements[] = $uninstallElement;
}
}
}
$templateName = "design:package/uninstall.tpl";
示例4: languageInfo
function languageInfo($withLanguageNames = false)
{
$langaugeInfo = array();
$classHandler = eZPackage::packageHandler('ezcontentclass');
$objectHandler = eZPackage::packageHandler('ezcontentobject');
$explainClassInfo = array('language_info');
$packageItems = $this->installItemsList();
foreach ($packageItems as $item) {
$itemLanguageInfo = array();
if ($item['type'] == 'ezcontentclass') {
$classInfo = $classHandler->explainInstallItem($this, $item, $explainClassInfo);
$itemLanguageInfo = isset($classInfo['language_info']) ? $classInfo['language_info'] : array();
} else {
if ($item['type'] == 'ezcontentobject') {
$objectsInfo = $objectHandler->explainInstallItem($this, $item);
// merge objects info
foreach ($objectsInfo as $objectInfo) {
$objectLanguages = isset($objectInfo['language_info']) ? $objectInfo['language_info'] : array();
foreach ($objectLanguages as $objectLanguage) {
if (!in_array($objectLanguage, $itemLanguageInfo)) {
$itemLanguageInfo[] = $objectLanguage;
}
}
}
}
}
// merge class and objects infos
foreach ($itemLanguageInfo as $languageLocale) {
if (!in_array($languageLocale, $langaugeInfo)) {
$langaugeInfo[] = $languageLocale;
}
}
}
if ($withLanguageNames) {
$langaugeInfoWithNames = array();
foreach ($langaugeInfo as $languageLocale) {
$language = eZContentLanguage::fetchByLocale($languageLocale);
$languageName = $language->attribute('name');
$langaugeInfoWithNames[$languageLocale] = $languageName;
}
$langaugeInfo = $langaugeInfoWithNames;
}
return $langaugeInfo;
}