本文整理汇总了PHP中getShopBasePath函数的典型用法代码示例。如果您正苦于以下问题:PHP getShopBasePath函数的具体用法?PHP getShopBasePath怎么用?PHP getShopBasePath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getShopBasePath函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetSmarty
/**
* @covers chromephp_oxutilsview::getSmarty
*/
public function testGetSmarty()
{
$sTest = getShopBasePath() . 'modules/debugax/smarty';
$oTestClass = $this->getMock('chromephp_oxutilsview', array('_debugaxGetPluginDirectories'));
$oTestClass->expects($this->once())->method('_debugaxGetPluginDirectories')->will($this->returnValue($sTest));
$this->assertTrue($oTestClass->getSmarty() instanceof Smarty);
}
示例2: testGetFileContents
/**
* Testing Utilities::getFileContents()
*
* @return null
*/
public function testGetFileContents()
{
$sLicenseFile = "lizenz.txt";
$sFilePath = getShopBasePath() . "Setup/En/{$sLicenseFile}";
$oUtils = new Utilities();
$this->assertEquals(file_get_contents($sFilePath), $oUtils->getFileContents($sFilePath));
}
示例3: init
/**
* {@inheritdoc}
*
* @return null|void
*/
public function init()
{
// Duplicated init protection
if ($this->_blInit) {
return;
}
$this->_blInit = true;
$this->_loadVarsFromFile();
include getShopBasePath() . 'core/oxconfk.php';
$this->_setDefaults();
try {
$sShopID = $this->getShopId();
$blConfigLoaded = $this->_loadVarsFromDb($sShopID);
// loading shop config
if (empty($sShopID) || !$blConfigLoaded) {
/** @var oxConnectionException $oEx */
$oEx = oxNew("oxConnectionException");
$oEx->setMessage("Unable to load shop config values from database");
throw $oEx;
}
// loading theme config options
$this->_loadVarsFromDb($sShopID, null, oxConfig::OXMODULE_THEME_PREFIX . $this->getConfigParam('sTheme'));
// checking if custom theme (which has defined parent theme) config options should be loaded over parent theme (#3362)
if ($this->getConfigParam('sCustomTheme')) {
$this->_loadVarsFromDb($sShopID, null, oxConfig::OXMODULE_THEME_PREFIX . $this->getConfigParam('sCustomTheme'));
}
// loading modules config
$this->_loadVarsFromDb($sShopID, null, oxConfig::OXMODULE_MODULE_PREFIX);
$aOnlyMainShopVars = array('blMallUsers', 'aSerials', 'IMD', 'IMA', 'IMS');
$this->_loadVarsFromDb($this->getBaseShopId(), $aOnlyMainShopVars);
} catch (oxConnectionException $oEx) {
$oEx->debugOut();
oxRegistry::getUtils()->showMessageAndExit($oEx->getString());
}
}
示例4: init
public function init()
{
if ($this->_blInit) {
return;
}
$this->_blInit = true;
$this->_loadVarsFromFile();
include getShopBasePath() . 'Core/oxconfk.php';
$this->_setDefaults();
}
示例5: getDirectoryPath
/**
* Forms path to edition directory.
*
* @return string
*/
public function getDirectoryPath()
{
$path = rtrim(getShopBasePath(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
if ($this->getEditionSelector()->isEnterprise()) {
$path .= static::EDITIONS_DIRECTORY . DIRECTORY_SEPARATOR . static::ENTERPRISE_DIRECTORY . DIRECTORY_SEPARATOR;
}
if ($this->getEditionSelector()->isProfessional()) {
$path .= static::EDITIONS_DIRECTORY . DIRECTORY_SEPARATOR . static::PROFESSIONAL_DIRECTORY . DIRECTORY_SEPARATOR;
}
return $path;
}
示例6: setUp
/**
* Prepares test suite.
*/
protected function setUp()
{
parent::setUp();
$invoicePdfOrderClass = getShopBasePath() . 'modules/oe/invoicepdf/controllers/admin/invoicepdforder_overview.php';
if (!file_exists($invoicePdfOrderClass)) {
$this->markTestSkipped('These tests only work when invoicePDF module is present.');
}
if (!class_exists('InvoicepdfOrder_Overview', false)) {
class_alias('Order_Overview', 'InvoicepdfOrder_Overview_parent');
require_once $invoicePdfOrderClass;
}
}
示例7: getText
/**
* Translates passed index
*
* @param string $sTextIdent translation index
*
* @return string
*/
public function getText($sTextIdent)
{
if ($this->_aLangData === null) {
$this->_aLangData = array();
$sLangFilePath = getShopBasePath() . EditionPathProvider::SETUP_DIRECTORY . '/' . ucfirst($this->getLanguage()) . '/lang.php';
if (file_exists($sLangFilePath) && is_readable($sLangFilePath)) {
$aLang = array();
include $sLangFilePath;
$this->_aLangData = array_merge($aLang, $this->getAdditionalMessages());
}
}
return isset($this->_aLangData[$sTextIdent]) ? $this->_aLangData[$sTextIdent] : null;
}
示例8: debugaxAutoload
function debugaxAutoload($sClass)
{
$sClass = basename($sClass);
$sBasePath = getShopBasePath();
$sClass = strtolower($sClass);
$aClassDirs = array($sBasePath . 'modules/debugax/', $sBasePath . 'modules/debugax/Admin/', $sBasePath . 'modules/debugax/Admin/chromephp/', $sBasePath . 'modules/debugax/Admin/helper/', $sBasePath . 'modules/debugax/core/', $sBasePath . 'modules/debugax/view/');
foreach ($aClassDirs as $sDir) {
$sFilename = $sDir . strtolower($sClass) . '.php';
if (file_exists($sFilename)) {
include $sFilename;
return;
}
}
}
示例9: setUp
/**
* Prepares test suite.
*/
protected function setUp()
{
parent::setUp();
$invoicePdfOrderClass = getShopBasePath() . 'modules/oe/invoicepdf/models/invoicepdfoxorder.php';
if ($this->getTestConfig()->getShopEdition() == 'EE' || !file_exists($invoicePdfOrderClass)) {
$this->markTestSkipped('These tests only work when invoicePDF module is present.');
}
if (!class_exists('InvoicepdfOxOrder', false)) {
class_alias('oxOrder', 'InvoicepdfOxOrder_parent');
require_once getShopBasePath() . 'modules/oe/invoicepdf/models/invoicepdfoxorder.php';
require_once getShopBasePath() . 'modules/oe/invoicepdf/models/invoicepdfblock.php';
require_once getShopBasePath() . 'modules/oe/invoicepdf/models/invoicepdfarticlesummary.php';
require_once getShopBasePath() . 'Core/oxpdf.php';
}
}
示例10: render
/**
* Executes parent method parent::render(), cretes oxstatistic object,
* passes it's data to Smarty engine and returns name of template file
* "statistic_main.tpl".
*
* @return string
*/
public function render()
{
$myConfig = $this->getConfig();
$oLang = oxRegistry::getLang();
parent::render();
$soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
$aReports = array();
if ($soxId != "-1" && isset($soxId)) {
// load object
$oStat = oxNew("oxstatistic");
$oStat->load($soxId);
$aReports = $oStat->getReports();
$this->_aViewData["edit"] = $oStat;
}
// setting all reports data: check for reports and load them
$sPath = getShopBasePath() . "application/controllers/admin/reports";
$iLanguage = (int) oxRegistry::getConfig()->getRequestParameter("editlanguage");
$aAllreports = array();
$aReportFiles = glob($sPath . "/*.php");
foreach ($aReportFiles as $sFile) {
if (is_file($sFile) && !is_dir($sFile)) {
$sConst = strtoupper(str_replace('.php', '', basename($sFile)));
// skipping base report class
if ($sConst == 'REPORT_BASE') {
continue;
}
include $sFile;
$oItem = new stdClass();
$oItem->filename = basename($sFile);
$oItem->name = $oLang->translateString($sConst, $iLanguage);
$aAllreports[] = $oItem;
}
}
// setting reports data
oxRegistry::getSession()->setVariable("allstat_reports", $aAllreports);
oxRegistry::getSession()->setVariable("stat_reports_{$soxId}", $aReports);
// passing assigned reports count
if (is_array($aReports)) {
$this->_aViewData['ireports'] = count($aReports);
}
if (oxRegistry::getConfig()->getRequestParameter("aoc")) {
$oStatisticMainAjax = oxNew('statistic_main_ajax');
$this->_aViewData['oxajax'] = $oStatisticMainAjax->getColumns();
return "popups/statistic_main.tpl";
}
return "statistic_main.tpl";
}
示例11: getDirectoryPath
/**
* Returns path to edition directory. If no additional editions are found, returns base path.
*
* @return string
*/
public function getDirectoryPath()
{
if (Registry::instanceExists('oxConfigFile')) {
$configFile = Registry::get('oxConfigFile');
} else {
$configFile = new ConfigFile(getShopBasePath() . '/config.inc.php');
Registry::set('oxConfigFile', $configFile);
}
$editionsPath = $configFile->getVar('vendorDirectory') . '/' . static::EDITIONS_DIRECTORY;
$path = getShopBasePath();
if ($this->getEditionSelector()->isEnterprise()) {
$path = $editionsPath . '/' . static::ENTERPRISE_DIRECTORY;
} elseif ($this->getEditionSelector()->isProfessional()) {
$path = $editionsPath . '/' . static::PROFESSIONAL_DIRECTORY;
}
return realpath($path) . DIRECTORY_SEPARATOR;
}
示例12: render
/**
* Executes parent method parent::render(), cretes oxstatistic object,
* passes it's data to Smarty engine and returns name of template file
* "statistic_main.tpl".
*
* @return string
*/
public function render()
{
$myConfig = $this->getConfig();
$oLang = oxLang::getInstance();
parent::render();
$soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
$aReports = array();
if ($soxId != "-1" && isset($soxId)) {
// load object
$oStat = oxNew("oxstatistic");
$oStat->load($soxId);
$aReports = $oStat->getReports();
$this->_aViewData["edit"] = $oStat;
}
// setting all reports data: check for reports and load them
$sPath = getShopBasePath() . $myConfig->getConfigParam('sAdminDir') . "/reports";
$iLanguage = (int) oxConfig::getParameter("editlanguage");
$aAllreports = array();
$aReportFiles = glob($sPath . "/*.php");
foreach ($aReportFiles as $sFile) {
if (is_file($sFile) && !is_dir($sFile)) {
$sConst = strtoupper(str_replace('.php', '', basename($sFile)));
// skipping base report class
if ($sConst == 'REPORT_BASE') {
continue;
}
include $sFile;
$oItem = new oxStdClass();
$oItem->filename = basename($sFile);
$oItem->name = $oLang->translateString($sConst, $iLanguage);
$aAllreports[] = $oItem;
}
}
// setting reports data
oxSession::setVar("allstat_reports", $aAllreports);
oxSession::setVar("stat_reports_{$soxId}", $aReports);
// passing assigned reports count
$this->_aViewData['ireports'] = count($aReports);
if (oxConfig::getParameter("aoc")) {
$aColumns = array();
include_once 'inc/' . strtolower(__CLASS__) . '.inc.php';
$this->_aViewData['oxajax'] = $aColumns;
return "popups/statistic_main.tpl";
}
return "statistic_main.tpl";
}
示例13: getFilePath
/**
* Tries to find file path for given class. Returns empty string on path not found.
*
* @param string $class
*
* @return string
*/
protected function getFilePath($class)
{
$filePath = '';
$moduleFiles = oxUtilsObject::getInstance()->getModuleVar('aModuleFiles');
if (is_array($moduleFiles)) {
$basePath = getShopBasePath();
foreach ($moduleFiles as $moduleId => $classPaths) {
if ($this->isModuleActive($moduleId) && array_key_exists($class, $classPaths)) {
$moduleFilePath = $basePath . 'modules/' . $classPaths[$class];
if (file_exists($moduleFilePath)) {
$filePath = $moduleFilePath;
}
}
}
}
return $filePath;
}
示例14: downloadConnector
/**
* Retrieves connector filename, the contents and saves it to shop directory. Returns connector $sFileName.
*
* @param string $sUsername eFire External Transaction username
* @param string $sPassword eFire External Transaction password
* @param string $sShopVersion eShop version
* @param bool $blSaveCredentials whether to save username and password to config for later use
*
* @return string
*/
public function downloadConnector($sUsername, $sPassword, $sShopVersion, $blSaveCredentials)
{
if ($blSaveCredentials) {
$this->getConfig()->saveShopConfVar('str', 'sEfiUsername', $sUsername);
$this->getConfig()->saveShopConfVar('str', 'sEfiPassword', $sPassword);
} else {
$this->getConfig()->saveShopConfVar('str', 'sEfiUsername', null);
$this->getConfig()->saveShopConfVar('str', 'sEfiPassword', null);
}
$this->_init($sUsername, $sPassword);
$sFileName = getShopBasePath() . "core/" . strtolower(basename($this->_getConnectorClassName($sShopVersion))) . ".php";
$sFileContents = $this->_getConnectorContents($sShopVersion);
//writing to file
$fOut = fopen($sFileName, "w");
if (!fputs($fOut, $sFileContents)) {
throw new oxException('EXCEPTION_COULDNOTWRITETOFILE');
}
fclose($fOut);
//remove possible old connector from the main shop dir
if (file_exists(getShopBasePath() . "oxefi.php")) {
unlink(getShopBasePath() . "oxefi.php");
}
return $sFileName;
}
示例15: getShopBasePath
<?php
/**
* Barzahlen Payment Module (OXID eShop)
*
* @copyright Copyright (c) 2015 Cash Payment Solutions GmbH (https://www.barzahlen.de)
* @author Alexander Diebler
* @license http://opensource.org/licenses/GPL-3.0 GNU General Public License, version 3 (GPL-3.0)
*/
require_once getShopBasePath() . 'modules/bz_barzahlen/api/loader.php';
/**
* Callback Controller
* Reachable from outside to handle HTTP push notifications on status changes
* for Barzahlen transactions.
*/
class bz_barzahlen_callback extends oxView
{
/**
* HTTP Header Codes
*/
const STATUS_OK = 200;
const STATUS_BAD_REQUEST = 400;
/**
* Transaction status codes.
*/
const STATE_PENDING = "pending";
const STATE_PAID = "paid";
const STATE_EXPIRED = "expired";
const STATE_REFUND_COMPLETED = "refund_completed";
const STATE_REFUND_EXPIRED = "refund_expired";
/**