本文整理匯總了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;
}