Skip to content

Instantly share code, notes, and snippets.

View ssv445's full-sized avatar

Shyam Verma ssv445

View GitHub Profile
@ssv445
ssv445 / vhost.py
Created October 26, 2013 04:49 — forked from fideloper/vhost.py
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
import getopt
#
# Show Usage, Output to STDERR
@ssv445
ssv445 / gist:3609373
Created September 3, 2012 13:35
PayPlans MySQL Query app : how to avoid few events during upgrades
class PayplansAppMysqlPeter extends PayplansAppMysqlquery
{
protected $_location = __FILE__;
public function onPayplansSubscriptionBeforeSave($prev, $new)
{
if(
!($prev && $prev->getStatus() == PayplansStatus::SUBSCRIPTION_ACTIVE) // it was not a previously active subs
&& $new->getStatus() == PayplansStatus::SUBSCRIPTION_ACTIVE // we are activating it
&& $new->getOrder()->getParam('upgrading_from',0) // its a upgrade