本文整理汇总了PHP中DSC::loadLibrary方法的典型用法代码示例。如果您正苦于以下问题:PHP DSC::loadLibrary方法的具体用法?PHP DSC::loadLibrary怎么用?PHP DSC::loadLibrary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DSC
的用法示例。
在下文中一共展示了DSC::loadLibrary方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAfterInitialise
function onAfterInitialise()
{
jimport('joomla.filesystem.file');
if (!version_compare(JVERSION, '1.6.0', 'ge')) {
// Joomla! 1.5 code here
if (JFile::exists(JPATH_SITE . '/plugins/system/citruscart/citruscart.php')) {
$this->attemptInstallation();
}
}
// Determine Joomla! version
if (version_compare(JVERSION, '3.0', 'ge')) {
define('DSC_JVERSION', '30');
} else {
if (version_compare(JVERSION, '2.5', 'ge')) {
define('DSC_JVERSION', '25');
} else {
define('DSC_JVERSION', '15');
}
}
//TODO Clear out all DS in components, Define the DS constant under Joomla! 3.0
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
// Import Joomla! classes
jimport('joomla.application.component.controller');
jimport('joomla.application.component.model');
jimport('joomla.application.component.view');
// Get application
$mainframe = JFactory::getApplication();
// Load the Base classes
JLoader::register('DSCTableBase', JPATH_SITE . '/libraries/citruscart/library/compatibility/table.php');
JLoader::register('DSCControllerBase', JPATH_SITE . '/libraries/citruscart/library/compatibility/controller.php');
JLoader::register('DSCModelBase', JPATH_SITE . '/libraries/citruscart/library/compatibility/model.php');
JLoader::register('DSCViewBase', JPATH_SITE . '/libraries/citruscart/library/compatibility/view.php');
if (!class_exists('DSC')) {
if (!JFile::exists(JPATH_SITE . '/libraries/citruscart/citruscart.php')) {
return false;
}
require_once JPATH_SITE . '/libraries/citruscart/citruscart.php';
}
return DSC::loadLibrary();
}
示例2: getLibrary
/**
* Load the library -- installing it if necessary
*
* @return boolean result of install & load
*/
public function getLibrary()
{
if (!$this->checkPHPVersion()) {
$this->setError("You do not meet the minimum system requirements. You must have at least PHP version: " . $this->min_php_required . " but you are using " . PHP_VERSION);
return false;
}
jimport('joomla.filesystem.file');
if (!class_exists('DSC')) {
if (!JFile::exists(JPATH_SITE . '/libraries/dioscouri/dioscouri.php')) {
JModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_installer/models');
if ($this->install('library')) {
// if j15, move files
if (!version_compare(JVERSION, '1.6.0', 'ge')) {
// Joomla! 1.5 code here
if (JFile::exists(JPATH_SITE . '/plugins/system/dioscouri/dioscouri.php')) {
$this->manuallyInstallLibrary();
}
} else {
if (!$this->install('plugin')) {
$this->setError("Could not install Dioscouri System Plugin");
}
}
if (!$this->enablePlugin()) {
$this->setError("Could not enable the Dioscouri System Plugin");
}
if (JFile::exists(JPATH_SITE . '/libraries/dioscouri/dioscouri.php')) {
require_once JPATH_SITE . '/libraries/dioscouri/dioscouri.php';
if (!DSC::loadLibrary()) {
$this->setError("Could not load Dioscouri Library after installing it");
return false;
}
return true;
}
} else {
$this->setError("Could not install Dioscouri Library");
return false;
}
} else {
require_once JPATH_SITE . '/libraries/dioscouri/dioscouri.php';
if (!DSC::loadLibrary()) {
$this->setError("Could not load Dioscouri Library");
return false;
}
return true;
}
}
return true;
}