本文整理汇总了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).");
}
示例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).");
}
示例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 );
}
示例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();