本文整理汇总了PHP中CBLib\Application\Application::CBFramework方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::CBFramework方法的具体用法?PHP Application::CBFramework怎么用?PHP Application::CBFramework使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBLib\Application\Application
的用法示例。
在下文中一共展示了Application::CBFramework方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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;
}
示例2:
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