当前位置: 首页>>代码示例>>PHP>>正文


PHP eZContentObjectVersion::removeVersions方法代码示例

本文整理汇总了PHP中eZContentObjectVersion::removeVersions方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentObjectVersion::removeVersions方法的具体用法?PHP eZContentObjectVersion::removeVersions怎么用?PHP eZContentObjectVersion::removeVersions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZContentObjectVersion的用法示例。


在下文中一共展示了eZContentObjectVersion::removeVersions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$ini = eZINI::instance('content.ini');
$internalDraftsCleanUpLimit = $ini->hasVariable('VersionManagement', 'InternalDraftsCleanUpLimit') ? $ini->variable('VersionManagement', 'InternalDraftsCleanUpLimit') : 0;
$durationSetting = $ini->hasVariable('VersionManagement', 'InternalDraftsDuration') ? $ini->variable('VersionManagement', 'InternalDraftsDuration') : array('hours' => 24);
// by default, only remove drafts older than 1 day
$isDurationSet = false;
$duration = 0;
if (is_array($durationSetting)) {
    if (isset($durationSetting['days']) and is_numeric($durationSetting['days'])) {
        $duration += $durationSetting['days'] * 60 * 60 * 24;
        $isDurationSet = true;
    }
    if (isset($durationSetting['hours']) and is_numeric($durationSetting['hours'])) {
        $duration += $durationSetting['hours'] * 60 * 60;
        $isDurationSet = true;
    }
    if (isset($durationSetting['minutes']) and is_numeric($durationSetting['minutes'])) {
        $duration += $durationSetting['minutes'] * 60;
        $isDurationSet = true;
    }
    if (isset($durationSetting['seconds']) and is_numeric($durationSetting['seconds'])) {
        $duration += $durationSetting['seconds'];
        $isDurationSet = true;
    }
}
if ($isDurationSet) {
    $expiryTime = time() - $duration;
    $processedCount = eZContentObjectVersion::removeVersions(eZContentObjectVersion::STATUS_INTERNAL_DRAFT, $internalDraftsCleanUpLimit, $expiryTime);
    $cli->output("Cleaned up " . $processedCount . " internal drafts");
} else {
    $cli->output("Lifetime is not set for internal drafts (see your ini-settings, content.ini, VersionManagement section).");
}
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:internal_drafts_cleanup.php

示例2: array

// Cleaning up usual drafts
$ini = eZINI::instance('content.ini');
$draftsCleanUpLimit = $ini->hasVariable('VersionManagement', 'DraftsCleanUpLimit') ? $ini->variable('VersionManagement', 'DraftsCleanUpLimit') : 0;
$durationSetting = $ini->hasVariable('VersionManagement', 'DraftsDuration') ? $ini->variable('VersionManagement', 'DraftsDuration') : array('days' => 90);
$isDurationSet = false;
$duration = 0;
if (is_array($durationSetting)) {
    if (isset($durationSetting['days']) and is_numeric($durationSetting['days'])) {
        $duration += $durationSetting['days'] * 60 * 60 * 24;
        $isDurationSet = true;
    }
    if (isset($durationSetting['hours']) and is_numeric($durationSetting['hours'])) {
        $duration += $durationSetting['hours'] * 60 * 60;
        $isDurationSet = true;
    }
    if (isset($durationSetting['minutes']) and is_numeric($durationSetting['minutes'])) {
        $duration += $durationSetting['minutes'] * 60;
        $isDurationSet = true;
    }
    if (isset($durationSetting['seconds']) and is_numeric($durationSetting['seconds'])) {
        $duration += $durationSetting['seconds'];
        $isDurationSet = true;
    }
}
if ($isDurationSet) {
    $expiryTime = time() - $duration;
    $processedCount = eZContentObjectVersion::removeVersions(eZContentObjectVersion::STATUS_DRAFT, $draftsCleanUpLimit, $expiryTime);
    $cli->output("Cleaned up " . $processedCount . " drafts");
} else {
    $cli->output("Lifetime is not set for user's drafts (see your ini-settings, content.ini, VersionManagement section).");
}
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:31,代码来源:old_drafts_cleanup.php

示例3: removeVersions

 /**
  * @param int|bool $versionStatus
  * @deprecated This method is left here only for backward compatibility. Use eZContentObjectVersion::removeVersions() method instead.
  */
 static function removeVersions( $versionStatus = false )
 {
     eZContentObjectVersion::removeVersions( $versionStatus );
 }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:8,代码来源:ezcontentobject.php

示例4:

    if ($dbUser !== false) {
        $params['user'] = $dbUser;
        $params['password'] = '';
    }
    if ($dbPassword !== false) {
        $params['password'] = $dbPassword;
    }
    if ($dbName !== false) {
        $params['database'] = $dbName;
    }
    $db = eZDB::instance($dbImpl, $params, true);
    eZDB::setInstance($db);
}
$db->setIsSQLOutputEnabled($showSQL);
if ($flatten['contentobject']) {
    $cli->output("Removing non-published content object versions");
    eZContentObjectVersion::removeVersions();
}
if ($flatten['contentclass']) {
    $cli->output("Removing temporary content classes");
    eZContentClass::removeTemporary();
}
if ($flatten['workflow']) {
    $cli->output("Removing temporary workflows");
    eZWorkflow::removeTemporary();
}
if ($flatten['role']) {
    $cli->output("Removing temporary roles");
    eZRole::removeTemporary();
}
$script->shutdown();
开发者ID:nfrp,项目名称:ezpublish,代码行数:31,代码来源:flatten.php


注:本文中的eZContentObjectVersion::removeVersions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。