本文整理汇总了PHP中Citruscart::getVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Citruscart::getVersion方法的具体用法?PHP Citruscart::getVersion怎么用?PHP Citruscart::getVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Citruscart
的用法示例。
在下文中一共展示了Citruscart::getVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendBug
/**
* Submits a bug report to Citruscart.
* Thanks so much! They really help improve the product!
*/
function sendBug()
{
$mainframe = JFactory::getApplication();
//$body = JRequest::getVar('body');
$body = $mainframe->input->getString('body');
//$name = JRequest::getVar('title');
$name = $mainframe->input->getString('title');
$body .= "\n\n Project: Citruscart";
$body .= "\n Tracker: Bug";
$body .= "\n Affected Version: " . Citruscart::getVersion();
$doc = JDocument::getInstance('raw');
ob_start();
//$option = JRequest::get('option');
$option = $app->input->get('option');
$db = JFactory::getDBO();
$path = JPATH_ADMINISTRATOR . '/components/com_admin/';
require_once $path . 'admin.admin.html.php';
$path .= 'tmpl/';
require_once $path . 'sysinfo_system.php';
require_once $path . 'sysinfo_directory.php';
require_once $path . 'sysinfo_phpinfo.php';
require_once $path . 'sysinfo_phpsettings.php';
require_once $path . 'sysinfo_config.php';
jimport('joomla.filesystem.file');
$contents = ob_get_contents();
ob_end_clean();
$doc->setBuffer($contents);
$contents = $doc->render();
$sitename = $config->get('sitename', $mainframe->getCfg('sitename'));
// write file with info
$config = JFactory::getConfig();
$filename = 'system_info_' . $sitename . '.html';
$file = JPATH_SITE . '/tmp/' . $filename;
JFile::write($file, $contents);
$mailer = JFactory::getMailer();
$success = false;
// For now, bug submission goes to info@Citruscart.com,
// but in the future, it will go to projects@Citruscart.com
// (once we get the Redmine auto-create working properly
// and format the subject/body of the email properly)
$mailer->addRecipient('projects@citruscart.com');
$mailer->setSubject($name);
$mailfrom = $config->get('emails_defaultemail', $mainframe->getCfg('mailfrom'));
$fromname = $config->get('emails_defaultname', $mainframe->getCfg('fromname'));
// check user mail format type, default html
$mailer->setBody($body);
$mailer->addAttachment($file);
$sender = array($mailfrom, $fromname);
$mailer->setSender($sender);
$sent = $mailer->send();
if ($sent == '1') {
$success = true;
}
JFile::delete($file);
if ($success) {
$msg = JText::_('COM_CITRUSCART_BUG_SUBMIT_OK');
$msgtype = 'message';
} else {
$msg = JText::_('COM_CITRUSCART_BUG_SUBMIT_FAIL');
$msgtype = 'notice';
}
$mainframe->redirect(JRoute::_('index.php?option=com_citruscart&view=dashboard'), $msg, $msgtype);
}