本文整理汇总了PHP中Pimcore_Resource::close方法的典型用法代码示例。如果您正苦于以下问题:PHP Pimcore_Resource::close方法的具体用法?PHP Pimcore_Resource::close怎么用?PHP Pimcore_Resource::close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore_Resource
的用法示例。
在下文中一共展示了Pimcore_Resource::close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: collectGarbage
/**
* foreces a garbage collection
* @static
* @return void
*/
public static function collectGarbage($keepItems = array())
{
// close mysql-connection
Pimcore_Resource::close();
$protectedItems = array("pimcore_config_system", "Zend_Locale", "pimcore_tag_block_current", "pimcore_tag_block_numeration", "pimcore_user", "Zend_Translate", "pimcore_admin_user", "pimcore_admin_initialized", "Pimcore_API_Plugin_Broker", "pimcore_config_website", "pimcore_editmode", "pimcore_error_document", "pimcore_site");
if (is_array($keepItems) && count($keepItems) > 0) {
$protectedItems = array_merge($protectedItems, $keepItems);
}
$registryBackup = array();
foreach ($protectedItems as $item) {
if (Zend_Registry::isRegistered($item)) {
$registryBackup[$item] = Zend_Registry::get($item);
}
}
Zend_Registry::_unsetInstance();
foreach ($registryBackup as $key => $value) {
Zend_Registry::set($key, $value);
}
Pimcore_Resource::reset();
}