本文整理汇总了PHP中CacheControl类的典型用法代码示例。如果您正苦于以下问题:PHP CacheControl类的具体用法?PHP CacheControl怎么用?PHP CacheControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CacheControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform
/**
* Carries out the specified action
*/
function perform()
{
// fetch the category we're trying to update
$this->_categoryId = $this->_request->getValue("linkCategoryId");
$this->_categoryName = Textfilter::filterAllHTML($this->_request->getValue("linkCategoryName"));
$categories = new MyLinksCategories();
$category = $categories->getMyLinksCategory($this->_categoryId, $this->_blogInfo->getId());
if (!$category) {
$this->_view = new AdminLinkCategoriesListView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_fetching_link_category"));
$this->setCommonData();
return false;
}
// update the fields
$category->setName($this->_categoryName);
$this->notifyEvent(EVENT_PRE_LINK_CATEGORY_UPDATE, array("linkcategory" => &$category));
if (!$categories->updateMyLinksCategory($category)) {
$this->_view = new AdminLinkCategoriesListView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_updating_link_category"));
$this->setCommonData();
return false;
}
$this->notifyEvent(EVENT_POST_LINK_CATEGORY_UPDATE, array("linkcategory" => &$category));
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
$this->_view = new AdminLinkCategoriesListView($this->_blogInfo);
$this->_view->setSuccessMessage($this->_locale->pr("link_category_updated_ok", $category->getName()));
$this->setCommonData();
// better to return true if everything fine
return true;
}
示例2: perform
function perform()
{
// fetch the data
$this->_newFilteredContent = $this->_request->getValue("filteredContent");
$this->_reason = $this->_request->getValue("reason");
// create the dao object and add the info to the db
$filteredContents = new FilteredContents();
$filteredContent = new FilteredContent($this->_newFilteredContent, $this->_blogInfo->getId(), $this->_reason);
// throw the pre-event
$this->notifyEvent(EVENT_PRE_FILTERED_CONTENT_ADD, array("content" => &$filteredContent));
// and add the filtered content to the database
$result = $filteredContents->addBlogFilteredContent($filteredContent);
// and give some feedback to the user
if (!$result) {
$this->_view = new AdminNewBlogFilteredContentView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_adding_blocked_content"));
$this->setCommonData();
return false;
}
$this->notifyEvent(EVENT_POST_FILTERED_CONTENT_ADD, array("content" => &$filteredContent));
$this->_view = new AdminBlogFilteredContentView($this->_blogInfo);
$this->_view->setSuccessMessage($this->_locale->tr("blocked_content_added_ok"));
$this->setCommonData();
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId());
// better to return true if everything fine
return true;
}
示例3: perform
/**
* Carries out the specified action
*/
function perform()
{
// load the resource
$resourceId = $this->_request->getValue("resourceId");
$resources = new GalleryResources();
// initialize the view we're going to use
$this->_view = new AdminResourcesListView($this->_blogInfo);
// fetch the resource first, to get some info about it
$resource = $resources->getResource($resourceId, $this->_blogInfo->getId());
if (!$resource) {
$this->_view->setErrorMessage($this->_locale->tr("error_fetching_resource"));
$this->setCommonData();
return false;
}
// if the resource was loaded ok...
$this->notifyEvent(EVENT_PRE_RESOURCE_DELETE, array("resource" => &$resource));
// remove it
$res = $resources->deleteResource($resourceId, $this->_blogInfo->getId());
if ($res) {
$this->_view->setSuccessMessage($this->_locale->pr("resource_deleted_ok", $resource->getFileName()));
$this->notifyEvent(EVENT_PRE_RESOURCE_DELETE, array("resource" => &$resource));
// clear the cache if everything went fine
CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
} else {
$this->_view->setErrorMessage($this->_locale->pr("error_deleting_resource", $resource->getFileName()));
}
// return the view
$this->setCommonData();
// better to return true if everything fine
return true;
}
示例4: perform
/**
* Carries out the specified action
*/
function perform()
{
// fetch our data
$this->_albumName = Textfilter::filterAllHTML($this->_request->getValue("albumName"));
$this->_albumDescription = Textfilter::filterAllHTML($this->_request->getValue("albumDescription"));
$this->_parentId = $this->_request->getValue("parentId");
$showAlbum = $this->_request->getValue("showAlbum") ? 1 : 0;
// create the album
$albums = new GalleryAlbums();
$t = new Timestamp();
$album = new GalleryAlbum($this->_blogInfo->getId(), $this->_albumName, $this->_albumDescription, GALLERY_RESOURCE_PREVIEW_AVAILABLE, $this->_parentId, $t->getTimestamp(), array(), $showAlbum);
$this->notifyEvent(EVENT_PRE_ALBUM_ADD, array("album" => &$album));
// and add it to the database
$result = $albums->addAlbum($album);
$this->_view = new AdminResourcesListView($this->_blogInfo, array("albumId" => $this->_parentId));
if ($result) {
$this->_view->setSuccessMessage($this->_locale->pr("album_added_ok", $album->getName()));
$this->notifyEvent(EVENT_POST_ALBUM_ADD, array("album" => &$album));
// clear the cache if everything went fine
CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
} else {
$this->_view->setErrorMessage($this->_locale->tr("error_adding_album"));
}
$this->setCommonData();
// better to return true if everything fine
return true;
}
示例5: perform
function perform()
{
// // update the plugin configurations to blog setting
$blogSettings = $this->_blogInfo->getSettings();
$blogSettings->setValue("plugin_authimage_enabled", $this->_pluginEnabled);
$blogSettings->setValue("plugin_authimage_length", $this->_length);
$blogSettings->setValue("plugin_authimage_key", $this->_key);
$blogSettings->setValue("plugin_authimage_expiredtime", $this->_expiredTime);
$blogSettings->setValue("plugin_authimage_default", $this->_default);
$this->_blogInfo->setSettings($blogSettings);
// save the blogs settings
$blogs = new Blogs();
if (!$blogs->updateBlog($this->_blogInfo->getId(), $this->_blogInfo)) {
$this->_view = new PluginAuthImageConfigView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_updating_settings"));
$this->setCommonData();
return false;
}
// if everything went ok...
$this->_blogInfo->setSettings($blogSettings);
$this->_session->setValue("blogInfo", $this->_blogInfo);
$this->saveSession();
$this->_view = new PluginAuthImageConfigView($this->_blogInfo);
$this->_view->setSuccessMessage($this->_locale->tr("authimage_settings_saved_ok"));
$this->setCommonData();
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId());
return true;
}
示例6: perform
function perform()
{
// update the plugin configurations to blog setting
$config =& Config::getConfig();
$config->setValue("plugin_moblog_mailserver", $this->_mailServer);
$config->setValue("plugin_moblog_port", $this->_port);
$config->setValue("plugin_moblog_username", $this->_userName);
$config->setValue("plugin_moblog_password", $this->_password);
$config->setValue("plugin_moblog_pseudobatch", $this->_pseudoBatch);
if (!$config->save()) {
$this->_view = new AdminMoblogBatchPluginSettingsView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_updating_settings"));
$this->setCommonData();
return false;
}
// if everything went ok...
$this->_session->setValue("blogInfo", $this->_blogInfo);
$this->saveSession();
$this->_view = new AdminMoblogBatchPluginSettingsView($this->_blogInfo);
$this->_view->setSuccessMessage($this->_locale->tr("moblog_settings_saved_ok"));
$this->setCommonData();
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId());
return true;
}
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:25,代码来源:adminmoblogbatchpluginupdatesettingsaction.class.php
示例7: perform
function perform()
{
// fetch the data
$this->_filteredContentRule = $this->_request->getValue("filteredContent");
$this->_reason = $this->_request->getValue("reason");
// create the dao object and add the info to the db
$filteredContents = new FilteredContents();
$content = $filteredContents->getBlogFilteredContent($this->_contentId, 0);
// check if we could find the information, or give up otherwise...
if (!$content) {
$this->_view = new AdminFilteredContentView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_fetching_filtered_content"));
$this->setCommonData();
return false;
}
$content->setRegExp($this->_filteredContentRule);
$content->setReason($this->_reason);
$this->notifyEvent(EVENT_PRE_FILTERED_CONTENT_UPDATE, array("content" => &$content));
$result = $filteredContents->updateFilteredContent($content);
// and give some feedback to the user
if (!$result) {
$this->_view = new AdminFilteredContentView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_updating_blocked_content"));
$this->setCommonData();
return false;
}
$this->notifyEvent(EVENT_POST_FILTERED_CONTENT_UPDATE, array("content" => &$content));
$this->_view = new AdminFilteredContentView($this->_blogInfo);
$this->_view->setSuccessMessage($this->_locale->tr("blocked_content_updated_ok"));
$this->setCommonData();
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId());
return true;
}
示例8: perform
/**
* Carries out the specified action
*/
function perform()
{
// load the resource
$this->_resourceDescription = Textfilter::filterAllHTML($this->_request->getValue("resourceDescription"));
$this->_albumId = $this->_request->getValue("albumId");
$this->_resourceId = $this->_request->getValue("resourceId");
$resources = new GalleryResources();
$resource = $resources->getResource($this->_resourceId, $this->_blogInfo->getId());
// update the fields we'd like to update
$resource->setAlbumId($this->_albumId);
$resource->setDescription($this->_resourceDescription);
// send the event
$this->notifyEvent(EVENT_PRE_RESOURCE_UPDATE, array("resource" => &$resource));
// and update it in the db
$result = $resources->updateResource($resource);
if (!$result) {
$this->_view = new AdminResourcesListView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_updating_resource"));
} else {
// check which submit button was pressed
if ($this->_request->getValue("regenerate") != "") {
return Controller::setForwardAction("regeneratePreview");
}
$this->_view = new AdminResourcesListView($this->_blogInfo);
$this->_view->setSuccessMessage($this->_locale->pr("resource_updated_ok", $resource->getFileName()));
$this->notifyEvent(EVENT_POST_RESOURCE_UPDATE, array("resource" => &$resource));
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
}
$this->setCommonData();
// better to return true if everything fine
return true;
}
示例9: perform
/**
* Carries out the specified action
*/
function perform()
{
// // update the plugin configurations to blog setting
$blogSettings = $this->_blogInfo->getSettings();
$blogSettings->setValue("plugin_moderate_enabled", $this->_pluginEnabled);
$this->_blogInfo->setSettings($blogSettings);
// save the blogs settings
$blogs = new Blogs();
if (!$blogs->updateBlog($this->_blogInfo->getId(), $this->_blogInfo)) {
$this->_view = new AdminModeratePluginSettingsView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_updating_settings"));
$this->setCommonData();
return false;
}
// if everything went ok...
$this->_blogInfo->setSettings($blogSettings);
$this->_session->setValue("blogInfo", $this->_blogInfo);
$this->saveSession();
$this->_view = new AdminModeratePluginSettingsView($this->_blogInfo);
$this->_view->setSuccessMessage($this->_locale->tr("moderate_settings_saved_ok"));
$this->setCommonData();
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId());
return true;
}
开发者ID:BackupTheBerlios,项目名称:plogfr-svn,代码行数:28,代码来源:adminmoderatepluginupdatesettingsaction.class.php
示例10: perform
function perform()
{
// fetch the data
$this->_ip1 = $this->_request->getValue("ip1");
$this->_ip2 = $this->_request->getValue("ip2");
$this->_ip3 = $this->_request->getValue("ip3");
$this->_ip4 = $this->_request->getValue("ip4");
$this->_hostIp = $this->_ip1 . "." . $this->_ip2 . "." . $this->_ip3 . "." . $this->_ip4;
$this->_mask = $this->_request->getValue("mask");
$this->_blockType = $this->_request->getValue("blockType");
$this->_reason = $this->_request->getValue("reason");
// create the dao object and add the info to the db
$blockedHosts = new BlockedHosts();
$t = new Timestamp();
$blockedHost = new BlockedHost($this->_hostIp, $this->_mask, $this->_reason, $t->getTimestamp(), GLOBALLY_BLOCKED_HOST, $this->_blockType, BLOCK_BLACKLIST);
$this->notifyEvent(EVENT_PRE_BLOCK_HOST_ADD, array("host" => &$blockedHost));
$result = $blockedHosts->add($blockedHost);
// and give some feedback to the user
if (!$result) {
$this->_view = new AdminNewBlockedHostView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_adding_blocked_host"));
$this->setCommonData();
return false;
}
$this->notifyEvent(EVENT_POST_BLOCK_HOST_ADD, array("host" => &$blockedHost));
$this->_view = new AdminBlockedHostsView($this->_blogInfo);
$this->_view->setSuccessMessage($this->_locale->tr("blocked_host_updated_ok"));
$this->setCommonData();
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId());
return true;
}
示例11: perform
function perform()
{
// create the view
$this->_view = new AdminResourcesListView($this->_blogInfo);
// fetch the parameters
$this->_resourceIds = $this->_request->getValue("resourceIds");
$this->_albumIds = $this->_request->getValue("albumIds");
// make sure that we're dealing with arrays!
if (!is_array($this->_resourceIds)) {
$this->_resourceIds = array();
}
if (!is_array($this->_albumIds)) {
$this->_albumIds = array();
}
// remove the items, if any
$this->_deleteAlbums();
$this->_deleteResources();
// put error and success messages (if any) into the view
if ($this->_successMessage != "") {
$this->_view->setSuccessMessage($this->_successMessage);
}
if ($this->_errorMessage != "") {
$this->_view->setErrorMessage($this->_errorMessage);
}
$this->setCommonData();
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
// better to return true if everything fine
return true;
}
示例12: perform
/**
* Carries out the specified action
*/
function perform()
{
// fetch the data
$this->_linkName = Textfilter::filterAllHTML($this->_request->getValue("linkName"));
$this->_linkUrl = Textfilter::filterAllHTML($this->_request->getValue("linkUrl"));
$this->_linkCategoryId = $this->_request->getValue("linkCategoryId");
$this->_linkDescription = Textfilter::filterAllHTML($this->_request->getValue("linkDescription"));
$this->_linkRss = Textfilter::filterAllHTML($this->_request->getValue("linkRssFeed"));
$this->_properties = array();
// adds the new link to the database
$myLinks = new MyLinks();
$myLink = new MyLink($this->_linkName, $this->_linkDescription, $this->_linkUrl, $this->_blogInfo->getId(), $this->_linkCategoryId, 0, $this->_linkRss, $this->_properties);
$this->notifyEvent(EVENT_PRE_LINK_ADD, array("link" => &$link));
if (!$myLinks->addMyLink($myLink, $this->_blogInfo->getId())) {
$this->_view = new AdminNewLinkView($this->_blogInfo);
$this->_view->setErrorMessage($this->_locale->tr("error_adding_link"));
$this->setCommonData();
return false;
}
$this->notifyEvent(EVENT_POST_LINK_ADD, array("link" => &$link));
$this->_view = new AdminLinksListView($this->_blogInfo);
$this->_view->setSuccessMessage($this->_locale->pr("link_added_ok", $myLink->getName()));
$this->setCommonData();
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId(), false);
// better to return true if everything fine
return true;
}
示例13: deleteSidebarModuleOrderData
function deleteSidebarModuleOrderData($dataArray, $sidebarNumber, $modulePos)
{
$gCacheStorage = globalCacheStorage::getInstance();
if (!isset($dataArray[$sidebarNumber])) {
$dataArray[$sidebarNumber] = array();
}
array_splice($dataArray[$sidebarNumber], $modulePos, 1);
CacheControl::flushSkin();
$gCacheStorage->purge();
return $dataArray;
}
示例14: _rejectComments
/**
* rejects the comments, and removes from the database from the db
*/
function _rejectComments()
{
$comments = new UnmoderatedComments();
foreach ($this->_updateComments as $commentId) {
$comments->deleteComment($commentId);
}
$this->_view = new AdminUnmoderatedCommentsview($this->_blogInfo);
$this->_view->setSuccessMessage($this->_locale->tr("moderate_comments_rejected_ok"));
$this->setCommonData();
// clear the cache
CacheControl::resetBlogCache($this->_blogInfo->getId());
return true;
}
示例15: _deletePosts
/**
* Carries out the specified action
*/
function _deletePosts()
{
// delete the post (it is not physically deleted but rather, we set
// the status field to 'DELETED'
$articles = new Articles();
$errorMessage = "";
$successMessage = "";
$totalOk = 0;
foreach ($this->_postIds as $postId) {
// get the post
$post = $articles->getBlogArticle($postId, $this->_blogInfo->getId());
if ($post) {
// fire the event
$this->notifyEvent(EVENT_PRE_POST_DELETE, array("article" => &$post));
//
// the next if-else branch allows a site administrator or the blog owner to remove
// anybody's articles. If not, then users can only remove their own articles
//
if ($this->_userInfo->isSiteAdmin() || $this->_blogInfo->getOwner() == $this->_userInfo->getId()) {
$result = $articles->deleteArticle($postId, $post->getUser(), $this->_blogInfo->getId(), false);
} else {
$result = $articles->deleteArticle($postId, $this->_userInfo->getId(), $this->_blogInfo->getId(), false);
}
if (!$result) {
$errorMessage .= $this->_locale->pr("error_deleting_article", $post->getTopic()) . "<br/>";
} else {
$totalOk++;
if ($totalOk < 2) {
$successMessage .= $this->_locale->pr("article_deleted_ok", $post->getTopic()) . "<br/>";
} else {
$successMessage = $this->_locale->pr("articles_deleted_ok", $totalOk);
}
// fire the post event
$this->notifyEvent(EVENT_POST_POST_DELETE, array("article" => &$post));
}
} else {
$errorMessage .= $this->_locale->pr("error_deleting_article2", $postId) . "<br/>";
}
}
// clean up the cache
CacheControl::resetBlogCache($this->_blogInfo->getId());
$this->_view = new AdminPostsListView($this->_blogInfo);
if ($errorMessage != "") {
$this->_view->setErrorMessage($errorMessage);
}
if ($successMessage != "") {
$this->_view->setSuccessMessage($successMessage);
}
$this->setCommonData();
return true;
}