/** * @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); }
/** * 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)); }
/** * {@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()); } }
public function init() { if ($this->_blInit) { return; } $this->_blInit = true; $this->_loadVarsFromFile(); include getShopBasePath() . 'Core/oxconfk.php'; $this->_setDefaults(); }
/** * 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; }
/** * 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; } }
/** * 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; }
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; } } }
/** * 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'; } }
/** * 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"; }
/** * 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; }
/** * 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"; }
/** * 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; }
/** * 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; }
<?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"; /**
/** * return path to the requested module file * * @param string $sModule module name (directory name in modules dir) * @param string $sFile file name to lookup * * @throws oxFileException * * @return string */ public function getModulePath($sModule, $sFile = '') { if (!$sFile || $sFile[0] != '/') { $sFile = '/' . $sFile; } $sFile = rtrim(getShopBasePath(), '/') . '/modules/' . basename($sModule) . $sFile; if (file_exists($sFile) || is_dir($sFile)) { return $sFile; } $oEx = oxNew("oxFileException", "Requested file not found for module {$sModule} ({$sFile})"); $oEx->debugOut(); throw $oEx; }
/** * cached getter: check root directory php file names for them not to be in 1st part of seo url * because then apache will execute that php file instead of url parser * * @return array */ protected function _getReservedEntryKeys() { if (!isset(self::$_aReservedEntryKeys) || !is_array(self::$_aReservedEntryKeys)) { $sDir = getShopBasePath(); self::$_aReservedEntryKeys = array_map('preg_quote', self::$_aReservedWords, array('#')); $oStr = getStr(); foreach (glob("{$sDir}/*") as $sFile) { if ($oStr->preg_match('/^(.+)\\.php[0-9]*$/i', basename($sFile), $aMatches)) { self::$_aReservedEntryKeys[] = preg_quote($aMatches[0], '#'); self::$_aReservedEntryKeys[] = preg_quote($aMatches[1], '#'); } elseif (is_dir($sFile)) { self::$_aReservedEntryKeys[] = preg_quote(basename($sFile), '#'); } } self::$_aReservedEntryKeys = array_unique(self::$_aReservedEntryKeys); } return self::$_aReservedEntryKeys; }
/** * Sets path to PHPMailer plugins * * @return null */ protected function _setMailerPluginDir() { $this->set("PluginDir", getShopBasePath() . "core/phpmailer/"); }
/** * Checks if permissions on servers are correctly setup * * @param string $sPath check path [optional] * @param int $iMinPerm min permission level, default 777 [optional] * * @return int */ public function checkServerPermissions($sPath = null, $iMinPerm = 777) { $sVerPrefix = ''; clearstatcache(); $sPath = $sPath ? $sPath : getShopBasePath(); // special config file check $sFullPath = $sPath . "config.inc.php"; if (!is_readable($sFullPath) || $this->isAdmin() && is_writable($sFullPath) || !$this->isAdmin() && !is_writable($sFullPath)) { return 0; } $sTmp = "{$sPath}/tmp/"; if (class_exists('oxConfig')) { $sCfgTmp = $this->getConfig()->getConfigParam('sCompileDir'); if (strpos($sCfgTmp, '<sCompileDir_') === false) { $sTmp = $sCfgTmp; } } $aPathsToCheck = array($sPath . 'out/pictures/promo/', $sPath . 'out/pictures/master/', $sPath . 'out/pictures/generated/', $sPath . 'out/pictures/media/', $sPath . 'out/media/', $sPath . 'log/', $sTmp); $iModStat = 2; $sPathToCheck = reset($aPathsToCheck); while ($sPathToCheck) { // missing file/folder? if (!file_exists($sPathToCheck)) { $iModStat = 0; break; } if (is_dir($sPathToCheck)) { // adding subfolders $aSubF = glob($sPathToCheck . "*", GLOB_ONLYDIR); if (is_array($aSubF)) { foreach ($aSubF as $sNewFolder) { $aPathsToCheck[] = $sNewFolder . "/"; } } } // testing if file permissions >= $iMinPerm //if ( ( (int) substr( decoct( fileperms( $sFullPath ) ), 2 ) ) < $iMinPerm ) { if (!is_readable($sPathToCheck) || !is_writable($sPathToCheck)) { $iModStat = 0; break; } $sPathToCheck = next($aPathsToCheck); } return $iModStat; }
// Remove standard gallery with javascript $axZm['removeMorePics'] = true; // Paths changed for oxid ver. 4.5+ $axZm['oxid4.5'] = version_compare($axZm['oxConfig']->getVersion(), 4.5) >= 0 ? true : false; // Get all images $axZm['pictures'] = $this->_tpl_vars['oView']->getPictures(); $axZm['icons'] = $this->_tpl_vars['oView']->getIcons(); if (!empty($axZm['pictures'])) { foreach ($axZm['pictures'] as $k => $v) { $axZm['masterImg'][$k] = str_replace($axZm['sShopURL'], '', $v); $axZm['imgSize'][$k] = getimagesize(getShopBasePath() . $axZm['masterImg'][$k]); $axZm['masterImg'][$k] = str_replace('out/pictures', '', $axZm['masterImg'][$k]); $zoomData[$k]['f'] = basename($axZm['masterImg'][$k]); $zoomData[$k]['p'] = dirname($axZm['masterImg'][$k]); if ($axZm['oxid4.5']) { $zoomData[$k]['p'] = str_replace('out/pictures/master', '', str_replace(getShopBasePath(), '', $axZm['oxConfig']->getMasterPictureDir()) . 'product/' . $k . '/'); } } $zoomData = strtr(base64_encode(addslashes(gzcompress(serialize($zoomData), 9))), '+/=', '-_,'); } else { $axZm['noPictures'] = true; } // Image title $axZm['imgAlt'] = strip_tags($this->_tpl_vars['product']->oxarticles__oxtitle->value); if ($this->_tpl_vars['oxarticles__oxvarselect']->value) { $axZm['imgAlt'] .= ' ' . $this->_tpl_vars['oxarticles__oxvarselect']->value; } // Preview image echo '<div class="picture axZmContainer" style="width: ' . $axZm['detailSize'][0] . 'px; height: ' . $axZm['detailSize'][1] . 'px">'; echo '<div id="axZm-product-image" style="position: absolute; height: ' . $axZm['detailSize'][1] . 'px; width: ' . $axZm['detailSize'][0] . 'px;">'; echo '<a href="javascript: void(0)" id="axZm-product-link" style="margin: 0px; padding: 0px; position: absolute; z-index: 1; display: block; width: ' . $axZm['detailSize'][0] . 'px; height: ' . $axZm['detailSize'][1] . 'px;">';
/** * If demo data installation is OFF, tries to delete demo pictures also * checks if setup deletion is ON and deletes setup files if possible, * return deletion status * * @return bool */ public function isDeletedSetup() { //finalizing installation $blDeleted = true; /** @var Session $oSession */ $oSession = $this->getInstance("Session"); /** @var Utilities $oUtils */ $oUtils = $this->getInstance("Utilities"); $sPath = getShopBasePath(); $aDemoConfig = $oSession->getSessionParam("aDB"); if (!isset($aDemoConfig['dbiDemoData']) || $aDemoConfig['dbiDemoData'] != '1') { // "/generated" cleanup $oUtils->removeDir($sPath . "out/pictures/generated", true); // "/master" cleanup, leaving nopic $oUtils->removeDir($sPath . "out/pictures/master", true, 1, array("nopic.jpg")); } $aSetupConfig = $oSession->getSessionParam("aSetupConfig"); if (isset($aSetupConfig['blDelSetupDir']) && $aSetupConfig['blDelSetupDir']) { // removing setup files $blDeleted = $oUtils->removeDir($sPath . EditionPathProvider::SETUP_DIRECTORY, true); } return $blDeleted; }
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OXID eShop Community Edition. If not, see <http://www.gnu.org/licenses/>. * * @link http://www.oxid-esales.com * @package core * @copyright (C) OXID eSales AG 2003-2012 * @version OXID eShop CE * @version SVN: $Id: oxutilspic.php 51431 2012-11-06 15:29:38Z aurimas.gladutis $ */ /** * Including pictures generator functions file */ require_once getShopBasePath() . "core/utils/oxpicgenerator.php"; /** * Image manipulation class */ class oxUtilsPic extends oxSuperCfg { /** * Image types 'enum' * * @var array */ protected $_aImageTypes = array("GIF" => IMAGETYPE_GIF, "JPG" => IMAGETYPE_JPEG, "PNG" => IMAGETYPE_PNG, "JPEG" => IMAGETYPE_JPEG); /** * oxUtils class instance. * * @var oxutilspic
/** * Return full path of root dir where download files are stored * * @return string */ protected function _getBaseDownloadDirPath() { $sConfigValue = oxRegistry::getConfig()->getConfigParam('sDownloadsDir'); //Unix full path is set if ($sConfigValue && $sConfigValue[0] == DIR_SEP) { return $sConfigValue; } //relative path is set if ($sConfigValue) { $sPath = getShopBasePath() . DIR_SEP . $sConfigValue; return $sPath; } //no path is set $sPath = getShopBasePath() . "/out/downloads/"; return $sPath; }
/** * Send mail about error to admin and write log file * * @param null $oECommers * @param null $sMsg */ protected function _errorWriteMsg($oECommers = null, $sMsg = null) { zsDb::setNewConnection(); zsDb::getDb(zsDb::FETCH_MODE_ASSOC); /* $this->_sendNotificationLetter( $this->_oOrderCheck, true ); */ zsDb::setNewConnection(); zsDb::getDb(zsDb::FETCH_MODE_ASSOC, true); $fStream = fopen(getShopBasePath() . DIR_SEP . 'log/exportcomm.log', 'a'); if ($oECommers != null) { $sErrorMsg = date('Y.m.d H:i:s') . " Problem with export - " . $oECommers->getClassNameECommerce() . "\nText error: " . $oECommers->getErroMsqECommerce(); } else { $sErrorMsg = $sMsg; } fprintf($fStream, $sErrorMsg . "\n "); }
return $this->_sTime; } return parent::getTime(); } } // Utility class require_once getShopBasePath() . 'core/oxutils.php'; // Standard class require_once getShopBasePath() . 'core/oxstdclass.php'; // Database managing class. require_once getShopBasePath() . 'core/adodblite/adodb.inc.php'; // Session managing class. require_once getShopBasePath() . 'core/oxsession.php'; // Database session managing class. // included in session file if needed - require_once( getShopBasePath() . 'core/adodb/session/adodb-session.php'); // DB managing class. //require_once( getShopBasePath() . 'core/adodb/drivers/adodb-mysql.inc.php'); require_once getShopBasePath() . 'core/oxconfig.php'; require_once getShopBasePath() . 'modules/functions.php'; function initDbDump() { static $done = false; if ($done) { throw new Exception("init already done"); } include_once 'unit/dbMaintenance.php'; $dbM = new dbMaintenance(); $dbM->dumpDB(); $done = true; } initDbDump();
/** * Test for oxFiles::getStoreLocation() */ public function testGetStoreLocationNotSet() { $oFile = $this->getMock('oxFile', array('_getFileLocation')); $oFile->expects($this->once())->method('_getFileLocation')->will($this->returnValue('fileName')); $this->assertEquals(getShopBasePath() . '/out/downloads/fileName', $oFile->getStoreLocation()); }
public function testGetLangTranslationArrayModuleFile() { oxRegistry::getUtils()->oxResetFileCache(); //writing a test file $sFileContents = '<?php $aLang = array( "charset" => "UTF-8", "TESTKEY" => "testVal");'; $sFileName = getShopBasePath() . "/Application/views/azure/de/my_lang.php"; $sShopId = $this->getConfig()->getShopId(); $sCacheKey = "languagefiles__0_{$sShopId}"; oxRegistry::getUtils()->toFileCache($sCacheKey, null); file_put_contents($sFileName, $sFileContents); $oSubj = $this->getProxyClass("oxLang"); $aTrArray = $oSubj->UNITgetLangTranslationArray(); $this->assertTrue(isset($aTrArray["TESTKEY"])); //cleaning up $this->assertTrue(file_exists($sFileName)); unlink($sFileName); $this->assertFalse(file_exists($sFileName)); $this->assertEquals("testVal", $aTrArray["TESTKEY"]); oxRegistry::getUtils()->toFileCache($sCacheKey, null); }
/** * Returns build revision number or false on read error. * * @return int */ public function getRevision() { try { $sFileName = getShopBasePath() . "/pkg.rev"; $iRev = (int) trim(@file_get_contents($sFileName)); } catch (Exception $e) { return false; } if (!$iRev) { return false; } return $iRev; }
* the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * OXID eSales PayPal module is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OXID eSales PayPal module. If not, see <http://www.gnu.org/licenses/>. * * @link http://www.oxid-esales.com * @copyright (C) OXID eSales AG 2003-2014 */ if (!class_exists('oePayPalExtensionChecker')) { require_once getShopBasePath() . 'modules/oe/oepaypal/core/oepaypalextensionchecker.php'; } /** * Class defines what module does on Shop events. */ class oePayPalEvents { /** * Add additional fields: payment status, captured amount, refunded amount in oxOrder table */ public static function addOrderTable() { $sSql = "CREATE TABLE IF NOT EXISTS `oepaypal_order` (\n `OEPAYPAL_ORDERID` char(32) character set latin1 collate latin1_general_ci NOT NULL,\n `OEPAYPAL_PAYMENTSTATUS` enum('pending','completed','failed','canceled') NOT NULL DEFAULT 'pending',\n `OEPAYPAL_CAPTUREDAMOUNT` decimal(9,2) NOT NULL,\n `OEPAYPAL_REFUNDEDAMOUNT` decimal(9,2) NOT NULL,\n `OEPAYPAL_VOIDEDAMOUNT` decimal(9,2) NOT NULL,\n `OEPAYPAL_TOTALORDERSUM` decimal(9,2) NOT NULL,\n `OEPAYPAL_CURRENCY` varchar(32) NOT NULL,\n `OEPAYPAL_TRANSACTIONMODE` enum('Sale','Authorization') NOT NULL DEFAULT 'Sale',\n `OEPAYPAL_TIMESTAMP` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,\n PRIMARY KEY (`OEPAYPAL_ORDERID`),\n KEY `OEPAYPAL_PAYMENTSTATUS` (`OEPAYPAL_PAYMENTSTATUS`)\n ) ENGINE=InnoDB;"; oxDb::getDb()->execute($sSql); } /**
/** * Includes image utils */ function includeImageUtils() { include_once getShopBasePath() . "Core/utils/oxpicgenerator.php"; }