Example #1
0
 /**
  * Constructor
  *
  * @param null|string                  $date null: now, string: date or datetime string as UTC, int: unix timestamp
  * @param null|string|int|DateTimeZone $tz   null: server offset, string: timezone string (e.g. UTC), int: offset in hours, DateTimeZone: PHP timezone
  * @param null|string                  $from Format to convert the date from
  * @param Config                       $config
  */
 public function __construct($date = null, $tz = null, $from = null, Config $config)
 {
     $this->config = $config;
     $this->init();
     if (!$date) {
         $date = 'now';
     }
     if (!$tz) {
         $tz = Application::CBFramework()->getCfg('user_timezone');
     }
     $tzCache = date_default_timezone_get();
     date_default_timezone_set('UTC');
     if (is_integer($date)) {
         $this->date = new DateTime();
         $this->date->setTimestamp($date);
     } else {
         if ($date == 'now') {
             $from = null;
         } elseif (is_numeric($date)) {
             $date = date('c', $date);
         }
         if ($from) {
             $this->date = new DateTime();
             $dateArray = date_parse_from_format($from, $date);
             $this->date->setDate($dateArray['year'], $dateArray['month'], $dateArray['day']);
             $this->date->setTime($dateArray['hour'], $dateArray['minute'], $dateArray['second']);
         } else {
             $this->date = new DateTime($date);
         }
     }
     date_default_timezone_set($tzCache);
     $this->setTimezone($tz);
     $this->from = $from;
 }
        case 'k':
            $memMax *= 1024;
            break;
    }
    if ($memMax < 48000000) {
        @ini_set('memory_limit', '48M');
    }
}
if (!is_readable(JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php')) {
    JFactory::getApplication()->enqueueMessage("Mandatory Community Builder package not installed!", 'error');
    return;
}
/** @noinspection PhpIncludeInspection */
include_once JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
/** @noinspection PhpIncludeInspection */
include_once Application::CBFramework()->getCfg('absolute_path') . '/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/cbpaidsubscriptions.class.php';
jimport('joomla.plugin.plugin');
$app = JFactory::getApplication();
$app->registerEvent('onAfterRoute', 'cbpaidSysPlugin_onAfterStart');
/**
 * CBSubs System Plugin class
 */
class cbpaidSysPlugin
{
    /**
     * Paid subscriptions manager
     * @var cbpaidSubscriptionsMgr
     */
    public $paidsubsManager = null;
    /**
     * Constructor