Skip to content

Instantly share code, notes, and snippets.

View RabeaWahab's full-sized avatar
🎯

Rabea Abdelwahab RabeaWahab

🎯
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<config>
<placeholders>
<cmsblock_tag>
<block>cms/block</block>
<placeholder>HTML_CMS_CACHED_ID</placeholder>
<container>Packagename_Modulename_Model_Punchhole</container>
<cache_lifetime>86400</cache_lifetime>
</cmsblock_tag>
<widget_tag>
public function couponPostAction()
{
/**
* No reason continue with empty shopping cart
*/
if ($this->_expireAjax()) {
return;
}
check process redis with pidfile /var/run/redis/redis.pid
start program = “/etc/init.d/redis start”
stop program = “/etc/init.d/redis stop”
if failed host 127.0.0.1 port 6379 then restart
if 5 restarts within 5 cycles then alert
<?php
use UnitedPrototype\GoogleAnalytics;
// initiate the tracker
$tracker = new GoogleAnalytics\Tracker($accountId, $account_domain);
// Assemble Visitor information
// (could also get unserialized from database)
$visitor = new GoogleAnalytics\Visitor();
$visitor->setIpAddress($_SERVER['REMOTE_ADDR']);
<requestHandler name="/select" class="solr.SearchHandler">
<!-- default values for query parameters can be specified, these
will be overridden by parameters in the request
-->
<lst name="defaults">
<str name="echoParams">explicit</str>
<int name="rows">10</int>
<str name="df">text</str>
<str name="defType">edismax</str>
<str name="fl">*</str>
<uniqueKey>id</uniqueKey>
<field name="film_title" type="text_general" indexed="true" stored="true" />
<field name="film_description" type="text_general" indexed="true" stored="true" />
<field name="film_category" type="text_general" indexed="true" stored="true" />
<field name="film_length" type="text_general" indexed="true" stored="true" />
<field name="film_rating" type="text_general" indexed="true" stored="true" />
<field name="film_actors" type="text_general" indexed="true" stored="true" />
<core_block_abstract_to_html_before>
<observers>
<cms_checker>
<type>Singleton</type>
<method>enableCmsBlockCaching</method>
<class>Packagename_Modulename_Model_Observer</class>
</cms_checker>
</observers>
</core_block_abstract_to_html_before>
<?php
class Packagename_Modulename_Model_Punchhole2 extends Enterprise_PageCache_Model_Container_Abstract
{
protected function _getIdentifier()
{
return $this->_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER, '');
}
/**
* Get cache identifier
<?php
class Packagename_Modulename_Model_Punchhole extends Enterprise_PageCache_Model_Container_Abstract
{
protected function _getIdentifier()
{
return $this->_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER, '');
}
/**
* Get cache identifier