repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
OXID-eSales/oxideshop_ce | source/Core/UtilsObject.php | UtilsObject.oxNew | public function oxNew($className)
{
$arguments = func_get_args();
array_shift($arguments);
$argumentsCount = count($arguments);
$shouldUseCache = $this->shouldCacheObject($className, $arguments);
if (!\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($className)) {
$className = strtolower($className);
}
//Get storage key as the class might be aliased.
$storageKey = Registry::getStorageKey($className);
//UtilsObject::$_aClassInstances is only intended to be used in unit tests.
if (defined('OXID_PHP_UNIT') && isset(static::$_aClassInstances[$storageKey])) {
return static::$_aClassInstances[$storageKey];
}
if (!defined('OXID_PHP_UNIT') && $shouldUseCache) {
$cacheKey = ($argumentsCount) ? $storageKey . md5(serialize($arguments)) : $storageKey;
if (isset(static::$_aInstanceCache[$cacheKey])) {
return clone static::$_aInstanceCache[$cacheKey];
}
}
if (!defined('OXID_PHP_UNIT') && isset($this->_aClassNameCache[$className])) {
$realClassName = $this->_aClassNameCache[$className];
} else {
$realClassName = $this->getClassName($className);
//expect __autoload() (oxfunctions.php) to do its job when class_exists() is called
if (!class_exists($realClassName)) {
$exception = new \OxidEsales\Eshop\Core\Exception\SystemComponentException();
/** Use setMessage here instead of passing it in constructor in order to test exception message */
$exception->setMessage('EXCEPTION_SYSTEMCOMPONENT_CLASSNOTFOUND' . ' ' . $realClassName);
throw $exception;
}
$this->_aClassNameCache[$className] = $realClassName;
}
$object = new $realClassName(...$arguments);
if (isset($cacheKey) && $shouldUseCache && $object instanceof \OxidEsales\Eshop\Core\Model\BaseModel) {
static::$_aInstanceCache[$cacheKey] = clone $object;
}
return $object;
} | php | public function oxNew($className)
{
$arguments = func_get_args();
array_shift($arguments);
$argumentsCount = count($arguments);
$shouldUseCache = $this->shouldCacheObject($className, $arguments);
if (!\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($className)) {
$className = strtolower($className);
}
//Get storage key as the class might be aliased.
$storageKey = Registry::getStorageKey($className);
//UtilsObject::$_aClassInstances is only intended to be used in unit tests.
if (defined('OXID_PHP_UNIT') && isset(static::$_aClassInstances[$storageKey])) {
return static::$_aClassInstances[$storageKey];
}
if (!defined('OXID_PHP_UNIT') && $shouldUseCache) {
$cacheKey = ($argumentsCount) ? $storageKey . md5(serialize($arguments)) : $storageKey;
if (isset(static::$_aInstanceCache[$cacheKey])) {
return clone static::$_aInstanceCache[$cacheKey];
}
}
if (!defined('OXID_PHP_UNIT') && isset($this->_aClassNameCache[$className])) {
$realClassName = $this->_aClassNameCache[$className];
} else {
$realClassName = $this->getClassName($className);
//expect __autoload() (oxfunctions.php) to do its job when class_exists() is called
if (!class_exists($realClassName)) {
$exception = new \OxidEsales\Eshop\Core\Exception\SystemComponentException();
/** Use setMessage here instead of passing it in constructor in order to test exception message */
$exception->setMessage('EXCEPTION_SYSTEMCOMPONENT_CLASSNOTFOUND' . ' ' . $realClassName);
throw $exception;
}
$this->_aClassNameCache[$className] = $realClassName;
}
$object = new $realClassName(...$arguments);
if (isset($cacheKey) && $shouldUseCache && $object instanceof \OxidEsales\Eshop\Core\Model\BaseModel) {
static::$_aInstanceCache[$cacheKey] = clone $object;
}
return $object;
} | [
"public",
"function",
"oxNew",
"(",
"$",
"className",
")",
"{",
"$",
"arguments",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(",
"$",
"arguments",
")",
";",
"$",
"argumentsCount",
"=",
"count",
"(",
"$",
"arguments",
")",
";",
"$",
"shouldUseCa... | Creates and returns new object. If creation is not available, dies and outputs
error message.
@param string $className Name of class
@throws SystemComponentException in case that class does not exists
@return object | [
"Creates",
"and",
"returns",
"new",
"object",
".",
"If",
"creation",
"is",
"not",
"available",
"dies",
"and",
"outputs",
"error",
"message",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsObject.php#L192-L237 | train |
OXID-eSales/oxideshop_ce | source/Core/UtilsObject.php | UtilsObject.getClassName | public function getClassName($classAlias)
{
$classNameProvider = $this->getClassNameProvider();
$class = $classNameProvider->getClassName($classAlias);
/**
* Backwards compatibility for ox... classes,
* when a class is instance build upon the unified namespace
*/
if ($class == $classAlias) {
$classAlias = $classNameProvider->getClassAliasName($class);
}
return $this->getModuleChainsGenerator()->createClassChain($class, $classAlias);
} | php | public function getClassName($classAlias)
{
$classNameProvider = $this->getClassNameProvider();
$class = $classNameProvider->getClassName($classAlias);
/**
* Backwards compatibility for ox... classes,
* when a class is instance build upon the unified namespace
*/
if ($class == $classAlias) {
$classAlias = $classNameProvider->getClassAliasName($class);
}
return $this->getModuleChainsGenerator()->createClassChain($class, $classAlias);
} | [
"public",
"function",
"getClassName",
"(",
"$",
"classAlias",
")",
"{",
"$",
"classNameProvider",
"=",
"$",
"this",
"->",
"getClassNameProvider",
"(",
")",
";",
"$",
"class",
"=",
"$",
"classNameProvider",
"->",
"getClassName",
"(",
"$",
"classAlias",
")",
"... | Returns name of class file, according to class name.
@param string $classAlias Class name
@return string | [
"Returns",
"name",
"of",
"class",
"file",
"according",
"to",
"class",
"name",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/UtilsObject.php#L256-L270 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/AttributeCategory.php | AttributeCategory.render | public function render()
{
parent::render();
$soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
if (isset($soxId) && $soxId != "-1") {
// load object
$oAttr = oxNew(\OxidEsales\Eshop\Application\Model\Attribute::class);
$oAttr->load($soxId);
$this->_aViewData["edit"] = $oAttr;
}
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc")) {
$oAttributeCategoryAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\AttributeCategoryAjax::class);
$this->_aViewData['oxajax'] = $oAttributeCategoryAjax->getColumns();
return "popups/attribute_category.tpl";
}
return "attribute_category.tpl";
} | php | public function render()
{
parent::render();
$soxId = $this->_aViewData["oxid"] = $this->getEditObjectId();
if (isset($soxId) && $soxId != "-1") {
// load object
$oAttr = oxNew(\OxidEsales\Eshop\Application\Model\Attribute::class);
$oAttr->load($soxId);
$this->_aViewData["edit"] = $oAttr;
}
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc")) {
$oAttributeCategoryAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\AttributeCategoryAjax::class);
$this->_aViewData['oxajax'] = $oAttributeCategoryAjax->getColumns();
return "popups/attribute_category.tpl";
}
return "attribute_category.tpl";
} | [
"public",
"function",
"render",
"(",
")",
"{",
"parent",
"::",
"render",
"(",
")",
";",
"$",
"soxId",
"=",
"$",
"this",
"->",
"_aViewData",
"[",
"\"oxid\"",
"]",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$"... | Loads Attribute categories info, passes it to Smarty engine and
returns name of template file "attribute_main.tpl".
@return string | [
"Loads",
"Attribute",
"categories",
"info",
"passes",
"it",
"to",
"Smarty",
"engine",
"and",
"returns",
"name",
"of",
"template",
"file",
"attribute_main",
".",
"tpl",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/AttributeCategory.php#L25-L46 | train |
OXID-eSales/oxideshop_ce | source/Core/SystemEventHandler.php | SystemEventHandler.getOnlineLicenseCheck | public function getOnlineLicenseCheck()
{
if (!$this->onlineLicenseCheck) {
/** @var \OxidEsales\Eshop\Core\Curl $curl */
$curl = oxNew(\OxidEsales\Eshop\Core\Curl::class);
/** @var \OxidEsales\Eshop\Core\OnlineServerEmailBuilder $emailBuilder */
$emailBuilder = oxNew(\OxidEsales\Eshop\Core\OnlineServerEmailBuilder::class);
/** @var \OxidEsales\Eshop\Core\SimpleXml $simpleXml */
$simpleXml = oxNew(\OxidEsales\Eshop\Core\SimpleXml::class);
/** @var \OxidEsales\Eshop\Core\OnlineLicenseCheckCaller $licenseCaller */
$licenseCaller = oxNew(\OxidEsales\Eshop\Core\OnlineLicenseCheckCaller::class, $curl, $emailBuilder, $simpleXml);
/** @var \OxidEsales\Eshop\Core\UserCounter $userCounter */
$userCounter = oxNew(\OxidEsales\Eshop\Core\UserCounter::class);
/** @var \OxidEsales\Eshop\Core\Service\ApplicationServerExporter $appServerExporter */
$appServerExporter = $this->getApplicationServerExporter();
/** @var \OxidEsales\Eshop\Core\OnlineLicenseCheck $OLC */
$OLC = oxNew(\OxidEsales\Eshop\Core\OnlineLicenseCheck::class, $licenseCaller);
$OLC->setAppServerExporter($appServerExporter);
$OLC->setUserCounter($userCounter);
$this->setOnlineLicenseCheck($OLC);
}
return $this->onlineLicenseCheck;
} | php | public function getOnlineLicenseCheck()
{
if (!$this->onlineLicenseCheck) {
/** @var \OxidEsales\Eshop\Core\Curl $curl */
$curl = oxNew(\OxidEsales\Eshop\Core\Curl::class);
/** @var \OxidEsales\Eshop\Core\OnlineServerEmailBuilder $emailBuilder */
$emailBuilder = oxNew(\OxidEsales\Eshop\Core\OnlineServerEmailBuilder::class);
/** @var \OxidEsales\Eshop\Core\SimpleXml $simpleXml */
$simpleXml = oxNew(\OxidEsales\Eshop\Core\SimpleXml::class);
/** @var \OxidEsales\Eshop\Core\OnlineLicenseCheckCaller $licenseCaller */
$licenseCaller = oxNew(\OxidEsales\Eshop\Core\OnlineLicenseCheckCaller::class, $curl, $emailBuilder, $simpleXml);
/** @var \OxidEsales\Eshop\Core\UserCounter $userCounter */
$userCounter = oxNew(\OxidEsales\Eshop\Core\UserCounter::class);
/** @var \OxidEsales\Eshop\Core\Service\ApplicationServerExporter $appServerExporter */
$appServerExporter = $this->getApplicationServerExporter();
/** @var \OxidEsales\Eshop\Core\OnlineLicenseCheck $OLC */
$OLC = oxNew(\OxidEsales\Eshop\Core\OnlineLicenseCheck::class, $licenseCaller);
$OLC->setAppServerExporter($appServerExporter);
$OLC->setUserCounter($userCounter);
$this->setOnlineLicenseCheck($OLC);
}
return $this->onlineLicenseCheck;
} | [
"public",
"function",
"getOnlineLicenseCheck",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"onlineLicenseCheck",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Core\\Curl $curl */",
"$",
"curl",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
... | OLC dependency getter
@return \OxidEsales\Eshop\Core\OnlineLicenseCheck | [
"OLC",
"dependency",
"getter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SystemEventHandler.php#L44-L74 | train |
OXID-eSales/oxideshop_ce | source/Core/SystemEventHandler.php | SystemEventHandler.getApplicationServerExporter | protected function getApplicationServerExporter()
{
$appServerService = $this->getAppServerService();
return oxNew(\OxidEsales\Eshop\Core\Service\ApplicationServerExporter::class, $appServerService);
} | php | protected function getApplicationServerExporter()
{
$appServerService = $this->getAppServerService();
return oxNew(\OxidEsales\Eshop\Core\Service\ApplicationServerExporter::class, $appServerService);
} | [
"protected",
"function",
"getApplicationServerExporter",
"(",
")",
"{",
"$",
"appServerService",
"=",
"$",
"this",
"->",
"getAppServerService",
"(",
")",
";",
"return",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Service",
"\\",
"Appl... | ApplicationServerExporter dependency setter
@return \OxidEsales\Eshop\Core\Service\ApplicationServerExporterInterface | [
"ApplicationServerExporter",
"dependency",
"setter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SystemEventHandler.php#L81-L85 | train |
OXID-eSales/oxideshop_ce | source/Core/SystemEventHandler.php | SystemEventHandler.getOnlineModuleVersionNotifier | public function getOnlineModuleVersionNotifier()
{
if (!$this->onlineModuleVersionNotifier) {
/** @var \OxidEsales\Eshop\Core\Curl $curl */
$curl = oxNew(\OxidEsales\Eshop\Core\Curl::class);
/** @var \OxidEsales\Eshop\Core\OnlineServerEmailBuilder $mailBuilder */
$mailBuilder = oxNew(\OxidEsales\Eshop\Core\OnlineServerEmailBuilder::class);
/** @var \OxidEsales\Eshop\Core\SimpleXml $simpleXml */
$simpleXml = oxNew(\OxidEsales\Eshop\Core\SimpleXml::class);
/** @var \OxidEsales\Eshop\Core\OnlineModuleVersionNotifierCaller $onlineModuleVersionNotifierCaller */
$onlineModuleVersionNotifierCaller = oxNew(
\OxidEsales\Eshop\Core\OnlineModuleVersionNotifierCaller::class,
$curl,
$mailBuilder,
$simpleXml
);
/** @var \OxidEsales\Eshop\Core\Module\ModuleList $moduleList */
$moduleList = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
$moduleList->getModulesFromDir(\OxidEsales\Eshop\Core\Registry::getConfig()->getModulesDir());
/** @var \OxidEsales\Eshop\Core\OnlineModuleVersionNotifier $onlineModuleVersionNotifier */
$onlineModuleVersionNotifier = oxNew(
\OxidEsales\Eshop\Core\OnlineModuleVersionNotifier::class,
$onlineModuleVersionNotifierCaller,
$moduleList
);
$this->setOnlineModuleVersionNotifier($onlineModuleVersionNotifier);
}
return $this->onlineModuleVersionNotifier;
} | php | public function getOnlineModuleVersionNotifier()
{
if (!$this->onlineModuleVersionNotifier) {
/** @var \OxidEsales\Eshop\Core\Curl $curl */
$curl = oxNew(\OxidEsales\Eshop\Core\Curl::class);
/** @var \OxidEsales\Eshop\Core\OnlineServerEmailBuilder $mailBuilder */
$mailBuilder = oxNew(\OxidEsales\Eshop\Core\OnlineServerEmailBuilder::class);
/** @var \OxidEsales\Eshop\Core\SimpleXml $simpleXml */
$simpleXml = oxNew(\OxidEsales\Eshop\Core\SimpleXml::class);
/** @var \OxidEsales\Eshop\Core\OnlineModuleVersionNotifierCaller $onlineModuleVersionNotifierCaller */
$onlineModuleVersionNotifierCaller = oxNew(
\OxidEsales\Eshop\Core\OnlineModuleVersionNotifierCaller::class,
$curl,
$mailBuilder,
$simpleXml
);
/** @var \OxidEsales\Eshop\Core\Module\ModuleList $moduleList */
$moduleList = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
$moduleList->getModulesFromDir(\OxidEsales\Eshop\Core\Registry::getConfig()->getModulesDir());
/** @var \OxidEsales\Eshop\Core\OnlineModuleVersionNotifier $onlineModuleVersionNotifier */
$onlineModuleVersionNotifier = oxNew(
\OxidEsales\Eshop\Core\OnlineModuleVersionNotifier::class,
$onlineModuleVersionNotifierCaller,
$moduleList
);
$this->setOnlineModuleVersionNotifier($onlineModuleVersionNotifier);
}
return $this->onlineModuleVersionNotifier;
} | [
"public",
"function",
"getOnlineModuleVersionNotifier",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"onlineModuleVersionNotifier",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Core\\Curl $curl */",
"$",
"curl",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
... | OnlineModuleVersionNotifier dependency getter
@return \OxidEsales\Eshop\Core\OnlineModuleVersionNotifier | [
"OnlineModuleVersionNotifier",
"dependency",
"getter"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SystemEventHandler.php#L102-L137 | train |
OXID-eSales/oxideshop_ce | source/Core/SystemEventHandler.php | SystemEventHandler.validateOnline | protected function validateOnline()
{
try {
$appServerService = $this->getAppServerService();
if ($this->getConfig()->isAdmin()) {
$appServerService->updateAppServerInformationInAdmin();
} else {
$appServerService->updateAppServerInformationInFrontend();
}
if ($this->isSendingShopDataEnabled() && !\OxidEsales\Eshop\Core\Registry::getUtils()->isSearchEngine()) {
$this->sendShopInformation();
}
} catch (Exception $exception) {
\OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]);
}
} | php | protected function validateOnline()
{
try {
$appServerService = $this->getAppServerService();
if ($this->getConfig()->isAdmin()) {
$appServerService->updateAppServerInformationInAdmin();
} else {
$appServerService->updateAppServerInformationInFrontend();
}
if ($this->isSendingShopDataEnabled() && !\OxidEsales\Eshop\Core\Registry::getUtils()->isSearchEngine()) {
$this->sendShopInformation();
}
} catch (Exception $exception) {
\OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]);
}
} | [
"protected",
"function",
"validateOnline",
"(",
")",
"{",
"try",
"{",
"$",
"appServerService",
"=",
"$",
"this",
"->",
"getAppServerService",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"isAdmin",
"(",
")",
")",
"{",
"$",
... | Check if shop is valid online. | [
"Check",
"if",
"shop",
"is",
"valid",
"online",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SystemEventHandler.php#L174-L190 | train |
OXID-eSales/oxideshop_ce | source/Core/SystemEventHandler.php | SystemEventHandler.sendShopInformation | protected function sendShopInformation()
{
if ($this->needToSendShopInformation()) {
$onlineLicenseCheck = $this->getOnlineLicenseCheck();
$onlineLicenseCheck->validateShopSerials();
$this->updateNextCheckTime();
}
} | php | protected function sendShopInformation()
{
if ($this->needToSendShopInformation()) {
$onlineLicenseCheck = $this->getOnlineLicenseCheck();
$onlineLicenseCheck->validateShopSerials();
$this->updateNextCheckTime();
}
} | [
"protected",
"function",
"sendShopInformation",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"needToSendShopInformation",
"(",
")",
")",
"{",
"$",
"onlineLicenseCheck",
"=",
"$",
"this",
"->",
"getOnlineLicenseCheck",
"(",
")",
";",
"$",
"onlineLicenseCheck",
... | Sends shop information to oxid servers. | [
"Sends",
"shop",
"information",
"to",
"oxid",
"servers",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SystemEventHandler.php#L205-L212 | train |
OXID-eSales/oxideshop_ce | source/Core/SystemEventHandler.php | SystemEventHandler.updateNextCheckTime | private function updateNextCheckTime()
{
$hourToCheck = $this->getCheckTime();
/** @var \OxidEsales\Eshop\Core\UtilsDate $utilsDate */
$utilsDate = \OxidEsales\Eshop\Core\Registry::getUtilsDate();
$nextCheckTime = $utilsDate->formTime('tomorrow', $hourToCheck);
$this->getConfig()->saveSystemConfigParameter('str', 'sOnlineLicenseNextCheckTime', $nextCheckTime);
} | php | private function updateNextCheckTime()
{
$hourToCheck = $this->getCheckTime();
/** @var \OxidEsales\Eshop\Core\UtilsDate $utilsDate */
$utilsDate = \OxidEsales\Eshop\Core\Registry::getUtilsDate();
$nextCheckTime = $utilsDate->formTime('tomorrow', $hourToCheck);
$this->getConfig()->saveSystemConfigParameter('str', 'sOnlineLicenseNextCheckTime', $nextCheckTime);
} | [
"private",
"function",
"updateNextCheckTime",
"(",
")",
"{",
"$",
"hourToCheck",
"=",
"$",
"this",
"->",
"getCheckTime",
"(",
")",
";",
"/** @var \\OxidEsales\\Eshop\\Core\\UtilsDate $utilsDate */",
"$",
"utilsDate",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Co... | Update when shop was checked last time with white noise.
White noise is used to separate call time for different shop. | [
"Update",
"when",
"shop",
"was",
"checked",
"last",
"time",
"with",
"white",
"noise",
".",
"White",
"noise",
"is",
"used",
"to",
"separate",
"call",
"time",
"for",
"different",
"shop",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SystemEventHandler.php#L239-L248 | train |
OXID-eSales/oxideshop_ce | source/Core/SystemEventHandler.php | SystemEventHandler.getAppServerService | protected function getAppServerService()
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$appServerDao = oxNew(\OxidEsales\Eshop\Core\Dao\ApplicationServerDao::class, $database, $config);
$utilsServer = oxNew(\OxidEsales\Eshop\Core\UtilsServer::class);
$appServerService = oxNew(
\OxidEsales\Eshop\Core\Service\ApplicationServerService::class,
$appServerDao,
$utilsServer,
\OxidEsales\Eshop\Core\Registry::get("oxUtilsDate")->getTime()
);
return $appServerService;
} | php | protected function getAppServerService()
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$appServerDao = oxNew(\OxidEsales\Eshop\Core\Dao\ApplicationServerDao::class, $database, $config);
$utilsServer = oxNew(\OxidEsales\Eshop\Core\UtilsServer::class);
$appServerService = oxNew(
\OxidEsales\Eshop\Core\Service\ApplicationServerService::class,
$appServerDao,
$utilsServer,
\OxidEsales\Eshop\Core\Registry::get("oxUtilsDate")->getTime()
);
return $appServerService;
} | [
"protected",
"function",
"getAppServerService",
"(",
")",
"{",
"$",
"config",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"database",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
... | Gets application server service.
@return \OxidEsales\Eshop\Core\Service\ApplicationServerServiceInterface | [
"Gets",
"application",
"server",
"service",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/SystemEventHandler.php#L306-L321 | train |
OXID-eSales/oxideshop_ce | source/Core/EmailBuilder.php | EmailBuilder.buildEmail | protected function buildEmail()
{
$email = $this->getEmailObject();
$email->setSubject($this->getSubject());
$email->setRecipient($this->getRecipient());
$email->setFrom($this->getSender());
$email->setBody($this->getBody());
return $email;
} | php | protected function buildEmail()
{
$email = $this->getEmailObject();
$email->setSubject($this->getSubject());
$email->setRecipient($this->getRecipient());
$email->setFrom($this->getSender());
$email->setBody($this->getBody());
return $email;
} | [
"protected",
"function",
"buildEmail",
"(",
")",
"{",
"$",
"email",
"=",
"$",
"this",
"->",
"getEmailObject",
"(",
")",
";",
"$",
"email",
"->",
"setSubject",
"(",
"$",
"this",
"->",
"getSubject",
"(",
")",
")",
";",
"$",
"email",
"->",
"setRecipient",... | Builds and returns the email object
@return \OxidEsales\Eshop\Core\Email | [
"Builds",
"and",
"returns",
"the",
"email",
"object"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/EmailBuilder.php#L37-L47 | train |
OXID-eSales/oxideshop_ce | source/Core/EmailBuilder.php | EmailBuilder.getShopInfoAddress | protected function getShopInfoAddress()
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$activeShop = $config->getActiveShop();
return $activeShop->getFieldData('oxinfoemail');
} | php | protected function getShopInfoAddress()
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$activeShop = $config->getActiveShop();
return $activeShop->getFieldData('oxinfoemail');
} | [
"protected",
"function",
"getShopInfoAddress",
"(",
")",
"{",
"$",
"config",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"activeShop",
"=",
"$",
"config",
"->",
"getActiveShop",
"(",
")",
... | Returns active shop info email address.
@return string | [
"Returns",
"active",
"shop",
"info",
"email",
"address",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/EmailBuilder.php#L102-L107 | train |
OXID-eSales/oxideshop_ce | source/Core/EmailBuilder.php | EmailBuilder.getEmailOriginMessage | protected function getEmailOriginMessage()
{
$lang = \OxidEsales\Eshop\Core\Registry::getLang();
$shopUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sShopURL');
return "<br>" . sprintf(
$lang->translateString(
'SHOP_EMAIL_ORIGIN_MESSAGE',
null,
true
),
$shopUrl
);
} | php | protected function getEmailOriginMessage()
{
$lang = \OxidEsales\Eshop\Core\Registry::getLang();
$shopUrl = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sShopURL');
return "<br>" . sprintf(
$lang->translateString(
'SHOP_EMAIL_ORIGIN_MESSAGE',
null,
true
),
$shopUrl
);
} | [
"protected",
"function",
"getEmailOriginMessage",
"(",
")",
"{",
"$",
"lang",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
";",
"$",
"shopUrl",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\... | Returns the message with email origin information.
@return string | [
"Returns",
"the",
"message",
"with",
"email",
"origin",
"information",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/EmailBuilder.php#L114-L127 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ArticleUserdef.php | ArticleUserdef.render | public function render()
{
parent::render();
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$this->_aViewData["edit"] = $oArticle;
$soxId = $this->getEditObjectId();
if (isset($soxId) && $soxId != "-1") {
if ($oArticle->isDerived()) {
$this->_aViewData['readonly'] = true;
}
// load object
$oArticle->load($soxId);
}
return "article_userdef.tpl";
} | php | public function render()
{
parent::render();
$oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$this->_aViewData["edit"] = $oArticle;
$soxId = $this->getEditObjectId();
if (isset($soxId) && $soxId != "-1") {
if ($oArticle->isDerived()) {
$this->_aViewData['readonly'] = true;
}
// load object
$oArticle->load($soxId);
}
return "article_userdef.tpl";
} | [
"public",
"function",
"render",
"(",
")",
"{",
"parent",
"::",
"render",
"(",
")",
";",
"$",
"oArticle",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Article",
"::",
"class",
")",
";",
"$",
"this",
... | Loads article data from DB, passes it to Smarty engine, returns name
of template file "article_userdef.tpl".
@return string | [
"Loads",
"article",
"data",
"from",
"DB",
"passes",
"it",
"to",
"Smarty",
"engine",
"returns",
"name",
"of",
"template",
"file",
"article_userdef",
".",
"tpl",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ArticleUserdef.php#L20-L38 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.removeDir | public function removeDir($sPath, $blDeleteSuccess, $iMode = 0, $aSkipFiles = [], $aSkipFolders = [])
{
if (is_file($sPath) || is_dir($sPath)) {
// setting path to remove
$d = dir($sPath);
$d->handle;
while (false !== ($sEntry = $d->read())) {
if ($sEntry != "." && $sEntry != "..") {
$sFilePath = $sPath . "/" . $sEntry;
if (is_file($sFilePath)) {
if (!in_array(basename($sFilePath), $aSkipFiles)) {
$blDeleteSuccess = $blDeleteSuccess * @unlink($sFilePath);
}
} elseif (is_dir($sFilePath)) {
// removing direcotry contents
$this->removeDir($sFilePath, $blDeleteSuccess, $iMode, $aSkipFiles, $aSkipFolders);
if ($iMode === 0 && !in_array(basename($sFilePath), $aSkipFolders)) {
$blDeleteSuccess = $blDeleteSuccess * @rmdir($sFilePath);
}
} else {
// there are some other objects ?
$blDeleteSuccess = $blDeleteSuccess * false;
}
}
}
$d->close();
} else {
$blDeleteSuccess = false;
}
return $blDeleteSuccess;
} | php | public function removeDir($sPath, $blDeleteSuccess, $iMode = 0, $aSkipFiles = [], $aSkipFolders = [])
{
if (is_file($sPath) || is_dir($sPath)) {
// setting path to remove
$d = dir($sPath);
$d->handle;
while (false !== ($sEntry = $d->read())) {
if ($sEntry != "." && $sEntry != "..") {
$sFilePath = $sPath . "/" . $sEntry;
if (is_file($sFilePath)) {
if (!in_array(basename($sFilePath), $aSkipFiles)) {
$blDeleteSuccess = $blDeleteSuccess * @unlink($sFilePath);
}
} elseif (is_dir($sFilePath)) {
// removing direcotry contents
$this->removeDir($sFilePath, $blDeleteSuccess, $iMode, $aSkipFiles, $aSkipFolders);
if ($iMode === 0 && !in_array(basename($sFilePath), $aSkipFolders)) {
$blDeleteSuccess = $blDeleteSuccess * @rmdir($sFilePath);
}
} else {
// there are some other objects ?
$blDeleteSuccess = $blDeleteSuccess * false;
}
}
}
$d->close();
} else {
$blDeleteSuccess = false;
}
return $blDeleteSuccess;
} | [
"public",
"function",
"removeDir",
"(",
"$",
"sPath",
",",
"$",
"blDeleteSuccess",
",",
"$",
"iMode",
"=",
"0",
",",
"$",
"aSkipFiles",
"=",
"[",
"]",
",",
"$",
"aSkipFolders",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"sPath",
")",
... | Recursively removes given path files and folders
@param string $sPath path to remove
@param bool $blDeleteSuccess removal state marker
@param int $iMode remove mode: 0 files and folders, 1 - files only
@param array $aSkipFiles files which should not be deleted (default null)
@param array $aSkipFolders folders which should not be deleted (default null)
@return bool | [
"Recursively",
"removes",
"given",
"path",
"files",
"and",
"folders"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L85-L117 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities._extractPath | protected function _extractPath($aPath)
{
$sExtPath = '';
$blBuildPath = false;
for ($i = count($aPath); $i > 0; $i--) {
$sDir = $aPath[$i - 1];
if ($blBuildPath) {
$sExtPath = $sDir . '/' . $sExtPath;
}
if (stristr($sDir, EditionPathProvider::SETUP_DIRECTORY)) {
$blBuildPath = true;
}
}
return $sExtPath;
} | php | protected function _extractPath($aPath)
{
$sExtPath = '';
$blBuildPath = false;
for ($i = count($aPath); $i > 0; $i--) {
$sDir = $aPath[$i - 1];
if ($blBuildPath) {
$sExtPath = $sDir . '/' . $sExtPath;
}
if (stristr($sDir, EditionPathProvider::SETUP_DIRECTORY)) {
$blBuildPath = true;
}
}
return $sExtPath;
} | [
"protected",
"function",
"_extractPath",
"(",
"$",
"aPath",
")",
"{",
"$",
"sExtPath",
"=",
"''",
";",
"$",
"blBuildPath",
"=",
"false",
";",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"aPath",
")",
";",
"$",
"i",
">",
"0",
";",
"$",
"i",
"-... | Extracts install path
@param array $aPath path info array
@return string | [
"Extracts",
"install",
"path"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L126-L141 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.updateConfigFile | public function updateConfigFile($parameters)
{
$configFile = '';
$language = $this->getInstance("Language");
if (isset($parameters['sShopDir'])) {
$configFile = $parameters['sShopDir'] . "/config.inc.php";
}
$this->handleMissingConfigFileException($configFile);
clearstatcache();
// Make config file writable, as it may be write protected
@chmod($configFile, getDefaultFileMode());
if (!$configFileContent = file_get_contents($configFile)) {
throw new Exception(sprintf($language->getText('ERROR_COULD_NOT_OPEN_CONFIG_FILE'), $configFile));
}
// overwriting settings
foreach ($parameters as $configOption => $value) {
$search = ["\'", "'" ];
$replace = ["\\\'", "\'"];
$escapedValue = str_replace($search, $replace, $value);
$configFileContent = str_replace("<{$configOption}>", $escapedValue, $configFileContent);
}
if (!file_put_contents($configFile, $configFileContent)) {
throw new Exception(sprintf($language->getText('ERROR_CONFIG_FILE_IS_NOT_WRITABLE'), $configFile));
}
// Make config file read-only, this is our recomnedation for config.inc.php
@chmod($configFile, getDefaultConfigFileMode());
} | php | public function updateConfigFile($parameters)
{
$configFile = '';
$language = $this->getInstance("Language");
if (isset($parameters['sShopDir'])) {
$configFile = $parameters['sShopDir'] . "/config.inc.php";
}
$this->handleMissingConfigFileException($configFile);
clearstatcache();
// Make config file writable, as it may be write protected
@chmod($configFile, getDefaultFileMode());
if (!$configFileContent = file_get_contents($configFile)) {
throw new Exception(sprintf($language->getText('ERROR_COULD_NOT_OPEN_CONFIG_FILE'), $configFile));
}
// overwriting settings
foreach ($parameters as $configOption => $value) {
$search = ["\'", "'" ];
$replace = ["\\\'", "\'"];
$escapedValue = str_replace($search, $replace, $value);
$configFileContent = str_replace("<{$configOption}>", $escapedValue, $configFileContent);
}
if (!file_put_contents($configFile, $configFileContent)) {
throw new Exception(sprintf($language->getText('ERROR_CONFIG_FILE_IS_NOT_WRITABLE'), $configFile));
}
// Make config file read-only, this is our recomnedation for config.inc.php
@chmod($configFile, getDefaultConfigFileMode());
} | [
"public",
"function",
"updateConfigFile",
"(",
"$",
"parameters",
")",
"{",
"$",
"configFile",
"=",
"''",
";",
"$",
"language",
"=",
"$",
"this",
"->",
"getInstance",
"(",
"\"Language\"",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"parameters",
"[",
"'sShop... | Updates config.inc.php file contents.
@param array $parameters Configuration parameters as submitted by the user
@throws Exception File can't be found, opened for reading or written. | [
"Updates",
"config",
".",
"inc",
".",
"php",
"file",
"contents",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L181-L211 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.handleMissingConfigFileException | private function handleMissingConfigFileException($pathToConfigFile)
{
if (!file_exists($pathToConfigFile)) {
$language = $this->getLanguageInstance();
throw new Exception(sprintf($language->getText('ERROR_COULD_NOT_OPEN_CONFIG_FILE'), $pathToConfigFile));
}
} | php | private function handleMissingConfigFileException($pathToConfigFile)
{
if (!file_exists($pathToConfigFile)) {
$language = $this->getLanguageInstance();
throw new Exception(sprintf($language->getText('ERROR_COULD_NOT_OPEN_CONFIG_FILE'), $pathToConfigFile));
}
} | [
"private",
"function",
"handleMissingConfigFileException",
"(",
"$",
"pathToConfigFile",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"pathToConfigFile",
")",
")",
"{",
"$",
"language",
"=",
"$",
"this",
"->",
"getLanguageInstance",
"(",
")",
";",
"throw... | Throws an exception in case config file is missing.
This is necessary to suppress PHP warnings during Setup. With the help of exception this problem is
caught and displayed properly.
@param string $pathToConfigFile File path to eShop configuration file.
@throws Exception Config file is missing. | [
"Throws",
"an",
"exception",
"in",
"case",
"config",
"file",
"is",
"missing",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L223-L230 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.updateHtaccessFile | public function updateHtaccessFile($aParams, $sSubFolder = "")
{
/** @var \OxidEsales\EshopCommunity\Setup\Language $oLang */
$oLang = $this->getInstance("Language");
// preparing rewrite base param
if (!isset($aParams["sBaseUrlPath"]) || !$aParams["sBaseUrlPath"]) {
$aParams["sBaseUrlPath"] = "";
}
if ($sSubFolder) {
$sSubFolder = $this->preparePath("/" . $sSubFolder);
}
$aParams["sBaseUrlPath"] = trim($aParams["sBaseUrlPath"] . $sSubFolder, "/");
$aParams["sBaseUrlPath"] = "/" . $aParams["sBaseUrlPath"];
$sHtaccessPath = $this->preparePath($aParams["sShopDir"]) . $sSubFolder . "/.htaccess";
clearstatcache();
if (!file_exists($sHtaccessPath)) {
throw new Exception(sprintf($oLang->getText('ERROR_COULD_NOT_FIND_FILE'), $sHtaccessPath), Utilities::ERROR_COULD_NOT_FIND_FILE);
}
@chmod($sHtaccessPath, getDefaultFileMode());
if (is_readable($sHtaccessPath) && ($fp = fopen($sHtaccessPath, "r"))) {
$sHtaccessFile = fread($fp, filesize($sHtaccessPath));
fclose($fp);
} else {
throw new Exception(sprintf($oLang->getText('ERROR_COULD_NOT_READ_FILE'), $sHtaccessPath), Utilities::ERROR_COULD_NOT_READ_FILE);
}
// overwriting settings
$sHtaccessFile = preg_replace("/RewriteBase.*/", "RewriteBase " . $aParams["sBaseUrlPath"], $sHtaccessFile);
if (is_writable($sHtaccessPath) && ($fp = fopen($sHtaccessPath, "w"))) {
fwrite($fp, $sHtaccessFile);
fclose($fp);
} else {
// error ? strange !?
throw new Exception(sprintf($oLang->getText('ERROR_COULD_NOT_WRITE_TO_FILE'), $sHtaccessPath), Utilities::ERROR_COULD_NOT_WRITE_TO_FILE);
}
} | php | public function updateHtaccessFile($aParams, $sSubFolder = "")
{
/** @var \OxidEsales\EshopCommunity\Setup\Language $oLang */
$oLang = $this->getInstance("Language");
// preparing rewrite base param
if (!isset($aParams["sBaseUrlPath"]) || !$aParams["sBaseUrlPath"]) {
$aParams["sBaseUrlPath"] = "";
}
if ($sSubFolder) {
$sSubFolder = $this->preparePath("/" . $sSubFolder);
}
$aParams["sBaseUrlPath"] = trim($aParams["sBaseUrlPath"] . $sSubFolder, "/");
$aParams["sBaseUrlPath"] = "/" . $aParams["sBaseUrlPath"];
$sHtaccessPath = $this->preparePath($aParams["sShopDir"]) . $sSubFolder . "/.htaccess";
clearstatcache();
if (!file_exists($sHtaccessPath)) {
throw new Exception(sprintf($oLang->getText('ERROR_COULD_NOT_FIND_FILE'), $sHtaccessPath), Utilities::ERROR_COULD_NOT_FIND_FILE);
}
@chmod($sHtaccessPath, getDefaultFileMode());
if (is_readable($sHtaccessPath) && ($fp = fopen($sHtaccessPath, "r"))) {
$sHtaccessFile = fread($fp, filesize($sHtaccessPath));
fclose($fp);
} else {
throw new Exception(sprintf($oLang->getText('ERROR_COULD_NOT_READ_FILE'), $sHtaccessPath), Utilities::ERROR_COULD_NOT_READ_FILE);
}
// overwriting settings
$sHtaccessFile = preg_replace("/RewriteBase.*/", "RewriteBase " . $aParams["sBaseUrlPath"], $sHtaccessFile);
if (is_writable($sHtaccessPath) && ($fp = fopen($sHtaccessPath, "w"))) {
fwrite($fp, $sHtaccessFile);
fclose($fp);
} else {
// error ? strange !?
throw new Exception(sprintf($oLang->getText('ERROR_COULD_NOT_WRITE_TO_FILE'), $sHtaccessPath), Utilities::ERROR_COULD_NOT_WRITE_TO_FILE);
}
} | [
"public",
"function",
"updateHtaccessFile",
"(",
"$",
"aParams",
",",
"$",
"sSubFolder",
"=",
"\"\"",
")",
"{",
"/** @var \\OxidEsales\\EshopCommunity\\Setup\\Language $oLang */",
"$",
"oLang",
"=",
"$",
"this",
"->",
"getInstance",
"(",
"\"Language\"",
")",
";",
"/... | Updates default htaccess file with user defined params
@param array $aParams various setup parameters
@param string $sSubFolder in case you need to update non default, but e.g. admin file, you must add its folder
@throws Exception when .htaccess file is not accessible/readable. | [
"Updates",
"default",
"htaccess",
"file",
"with",
"user",
"defined",
"params"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L240-L281 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.canHtaccessFileBeUpdated | public function canHtaccessFileBeUpdated()
{
try {
$defaultPathParameters = $this->getDefaultPathParams();
$defaultPathParameters['sBaseUrlPath'] = $this->extractRewriteBase($defaultPathParameters['sShopURL']);
$this->updateHtaccessFile($defaultPathParameters);
} catch (Exception $exception) {
return false;
}
return true;
} | php | public function canHtaccessFileBeUpdated()
{
try {
$defaultPathParameters = $this->getDefaultPathParams();
$defaultPathParameters['sBaseUrlPath'] = $this->extractRewriteBase($defaultPathParameters['sShopURL']);
$this->updateHtaccessFile($defaultPathParameters);
} catch (Exception $exception) {
return false;
}
return true;
} | [
"public",
"function",
"canHtaccessFileBeUpdated",
"(",
")",
"{",
"try",
"{",
"$",
"defaultPathParameters",
"=",
"$",
"this",
"->",
"getDefaultPathParams",
"(",
")",
";",
"$",
"defaultPathParameters",
"[",
"'sBaseUrlPath'",
"]",
"=",
"$",
"this",
"->",
"extractRe... | Returns true if htaccess file can be updated by setup process.
Functionality is tested via:
`Acceptance/Frontend/ShopSetUpTest.php::testInstallShopCantContinueDueToHtaccessProblem`
@return bool | [
"Returns",
"true",
"if",
"htaccess",
"file",
"can",
"be",
"updated",
"by",
"setup",
"process",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L291-L302 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.getRequestVar | public function getRequestVar($sVarName, $sRequestType = null)
{
$sValue = null;
switch ($sRequestType) {
case 'post':
if (isset($_POST[$sVarName])) {
$sValue = $_POST[$sVarName];
}
break;
case 'get':
if (isset($_GET[$sVarName])) {
$sValue = $_GET[$sVarName];
}
break;
case 'cookie':
if (isset($_COOKIE[$sVarName])) {
$sValue = $_COOKIE[$sVarName];
}
break;
default:
if ($sValue === null) {
$sValue = $this->getRequestVar($sVarName, 'post');
}
if ($sValue === null) {
$sValue = $this->getRequestVar($sVarName, 'get');
}
if ($sValue === null) {
$sValue = $this->getRequestVar($sVarName, 'cookie');
}
break;
}
return $sValue;
} | php | public function getRequestVar($sVarName, $sRequestType = null)
{
$sValue = null;
switch ($sRequestType) {
case 'post':
if (isset($_POST[$sVarName])) {
$sValue = $_POST[$sVarName];
}
break;
case 'get':
if (isset($_GET[$sVarName])) {
$sValue = $_GET[$sVarName];
}
break;
case 'cookie':
if (isset($_COOKIE[$sVarName])) {
$sValue = $_COOKIE[$sVarName];
}
break;
default:
if ($sValue === null) {
$sValue = $this->getRequestVar($sVarName, 'post');
}
if ($sValue === null) {
$sValue = $this->getRequestVar($sVarName, 'get');
}
if ($sValue === null) {
$sValue = $this->getRequestVar($sVarName, 'cookie');
}
break;
}
return $sValue;
} | [
"public",
"function",
"getRequestVar",
"(",
"$",
"sVarName",
",",
"$",
"sRequestType",
"=",
"null",
")",
"{",
"$",
"sValue",
"=",
"null",
";",
"switch",
"(",
"$",
"sRequestType",
")",
"{",
"case",
"'post'",
":",
"if",
"(",
"isset",
"(",
"$",
"_POST",
... | Returns variable from request
@param string $sVarName variable name
@param string $sRequestType request type - "post", "get", "cookie" [optional]
@return mixed | [
"Returns",
"variable",
"from",
"request"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L326-L361 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.getFileContents | public function getFileContents($sFile)
{
$sContents = null;
if (file_exists($sFile) && is_readable($sFile)) {
$sContents = file_get_contents($sFile);
}
return $sContents;
} | php | public function getFileContents($sFile)
{
$sContents = null;
if (file_exists($sFile) && is_readable($sFile)) {
$sContents = file_get_contents($sFile);
}
return $sContents;
} | [
"public",
"function",
"getFileContents",
"(",
"$",
"sFile",
")",
"{",
"$",
"sContents",
"=",
"null",
";",
"if",
"(",
"file_exists",
"(",
"$",
"sFile",
")",
"&&",
"is_readable",
"(",
"$",
"sFile",
")",
")",
"{",
"$",
"sContents",
"=",
"file_get_contents",... | Returns file contents if file is readable
@param string $sFile path to file
@return string | mixed | [
"Returns",
"file",
"contents",
"if",
"file",
"is",
"readable"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L383-L391 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.extractRewriteBase | public function extractRewriteBase($sUrl)
{
$sPath = "/";
if (($aPathInfo = @parse_url($sUrl)) !== false) {
if (isset($aPathInfo["path"])) {
$sPath = $this->preparePath($aPathInfo["path"]);
}
}
return $sPath;
} | php | public function extractRewriteBase($sUrl)
{
$sPath = "/";
if (($aPathInfo = @parse_url($sUrl)) !== false) {
if (isset($aPathInfo["path"])) {
$sPath = $this->preparePath($aPathInfo["path"]);
}
}
return $sPath;
} | [
"public",
"function",
"extractRewriteBase",
"(",
"$",
"sUrl",
")",
"{",
"$",
"sPath",
"=",
"\"/\"",
";",
"if",
"(",
"(",
"$",
"aPathInfo",
"=",
"@",
"parse_url",
"(",
"$",
"sUrl",
")",
")",
"!==",
"false",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
... | Extracts rewrite base path from url
@param string $sUrl user defined shop install url
@return string | [
"Extracts",
"rewrite",
"base",
"path",
"from",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L412-L422 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.executeExternalDatabaseMigrationCommand | public function executeExternalDatabaseMigrationCommand(ConsoleOutput $output = null, Facts $facts = null)
{
$migrations = $this->createMigrations($facts);
$migrations->setOutput($output);
$command = Migrations::MIGRATE_COMMAND;
$migrations->execute($command);
} | php | public function executeExternalDatabaseMigrationCommand(ConsoleOutput $output = null, Facts $facts = null)
{
$migrations = $this->createMigrations($facts);
$migrations->setOutput($output);
$command = Migrations::MIGRATE_COMMAND;
$migrations->execute($command);
} | [
"public",
"function",
"executeExternalDatabaseMigrationCommand",
"(",
"ConsoleOutput",
"$",
"output",
"=",
"null",
",",
"Facts",
"$",
"facts",
"=",
"null",
")",
"{",
"$",
"migrations",
"=",
"$",
"this",
"->",
"createMigrations",
"(",
"$",
"facts",
")",
";",
... | Calls external database migration command.
@param ConsoleOutput $output Add a possibility to provide a custom output handler.
@param Facts|null $facts A possible facts mock | [
"Calls",
"external",
"database",
"migration",
"command",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L455-L463 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.checkDbExists | public function checkDbExists($database)
{
try {
$databaseExists = true;
$database->execSql("select * from oxconfig");
} catch (Exception $exception) {
$databaseExists = false;
}
return $databaseExists;
} | php | public function checkDbExists($database)
{
try {
$databaseExists = true;
$database->execSql("select * from oxconfig");
} catch (Exception $exception) {
$databaseExists = false;
}
return $databaseExists;
} | [
"public",
"function",
"checkDbExists",
"(",
"$",
"database",
")",
"{",
"try",
"{",
"$",
"databaseExists",
"=",
"true",
";",
"$",
"database",
"->",
"execSql",
"(",
"\"select * from oxconfig\"",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
"exception",
")",
... | Check if database is up and running
@param Database $database
@return bool | [
"Check",
"if",
"database",
"is",
"up",
"and",
"running"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L493-L503 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.getActiveEditionDemodataPackagePath | public function getActiveEditionDemodataPackagePath()
{
$facts = new Facts();
return $this->getVendorDirectory()
. EditionRootPathProvider::EDITIONS_DIRECTORY
. DIRECTORY_SEPARATOR
. sprintf(self::DEMODATA_PACKAGE_NAME, strtolower($facts->getEdition()));
} | php | public function getActiveEditionDemodataPackagePath()
{
$facts = new Facts();
return $this->getVendorDirectory()
. EditionRootPathProvider::EDITIONS_DIRECTORY
. DIRECTORY_SEPARATOR
. sprintf(self::DEMODATA_PACKAGE_NAME, strtolower($facts->getEdition()));
} | [
"public",
"function",
"getActiveEditionDemodataPackagePath",
"(",
")",
"{",
"$",
"facts",
"=",
"new",
"Facts",
"(",
")",
";",
"return",
"$",
"this",
"->",
"getVendorDirectory",
"(",
")",
".",
"EditionRootPathProvider",
"::",
"EDITIONS_DIRECTORY",
".",
"DIRECTORY_S... | Return full path to demodata package based on current eShop edition.
@return string | [
"Return",
"full",
"path",
"to",
"demodata",
"package",
"based",
"on",
"current",
"eShop",
"edition",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L571-L579 | train |
OXID-eSales/oxideshop_ce | source/Setup/Utilities.php | Utilities.getLicenseContent | public function getLicenseContent($languageId)
{
$licensePathElements = [
$this->getSetupDirectory(),
ucfirst($languageId),
self::LICENSE_TEXT_FILENAME
];
$licensePath = implode(DIRECTORY_SEPARATOR, $licensePathElements);
$licenseContent = $this->getFileContents($licensePath);
return $licenseContent;
} | php | public function getLicenseContent($languageId)
{
$licensePathElements = [
$this->getSetupDirectory(),
ucfirst($languageId),
self::LICENSE_TEXT_FILENAME
];
$licensePath = implode(DIRECTORY_SEPARATOR, $licensePathElements);
$licenseContent = $this->getFileContents($licensePath);
return $licenseContent;
} | [
"public",
"function",
"getLicenseContent",
"(",
"$",
"languageId",
")",
"{",
"$",
"licensePathElements",
"=",
"[",
"$",
"this",
"->",
"getSetupDirectory",
"(",
")",
",",
"ucfirst",
"(",
"$",
"languageId",
")",
",",
"self",
"::",
"LICENSE_TEXT_FILENAME",
"]",
... | Returns the contents of license agreement in requested language.
@param string $languageId
@return string | [
"Returns",
"the",
"contents",
"of",
"license",
"agreement",
"in",
"requested",
"language",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Setup/Utilities.php#L587-L599 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl._executeMaintenanceTasks | protected function _executeMaintenanceTasks()
{
if (isset($this->_blMainTasksExecuted)) {
return;
}
startProfile('executeMaintenanceTasks');
oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class)->updateUpcomingPrices();
stopProfile('executeMaintenanceTasks');
} | php | protected function _executeMaintenanceTasks()
{
if (isset($this->_blMainTasksExecuted)) {
return;
}
startProfile('executeMaintenanceTasks');
oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class)->updateUpcomingPrices();
stopProfile('executeMaintenanceTasks');
} | [
"protected",
"function",
"_executeMaintenanceTasks",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_blMainTasksExecuted",
")",
")",
"{",
"return",
";",
"}",
"startProfile",
"(",
"'executeMaintenanceTasks'",
")",
";",
"oxNew",
"(",
"\\",
"OxidEsal... | Executes regular maintenance functions..
@return null | [
"Executes",
"regular",
"maintenance",
"functions",
".."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L316-L325 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl._initializeViewObject | protected function _initializeViewObject($class, $function, $parameters = null, $viewsChain = null)
{
$classKey = Registry::getControllerClassNameResolver()->getIdByClassName($class);
$classKey = !is_null($classKey) ? $classKey : $class; //fallback
/** @var FrontendController $view */
$view = oxNew($class);
$view->setClassKey($classKey);
$view->setFncName($function);
$view->setViewParameters($parameters);
\OxidEsales\Eshop\Core\Registry::getConfig()->setActiveView($view);
$this->onViewCreation($view);
$view->init();
return $view;
} | php | protected function _initializeViewObject($class, $function, $parameters = null, $viewsChain = null)
{
$classKey = Registry::getControllerClassNameResolver()->getIdByClassName($class);
$classKey = !is_null($classKey) ? $classKey : $class; //fallback
/** @var FrontendController $view */
$view = oxNew($class);
$view->setClassKey($classKey);
$view->setFncName($function);
$view->setViewParameters($parameters);
\OxidEsales\Eshop\Core\Registry::getConfig()->setActiveView($view);
$this->onViewCreation($view);
$view->init();
return $view;
} | [
"protected",
"function",
"_initializeViewObject",
"(",
"$",
"class",
",",
"$",
"function",
",",
"$",
"parameters",
"=",
"null",
",",
"$",
"viewsChain",
"=",
"null",
")",
"{",
"$",
"classKey",
"=",
"Registry",
"::",
"getControllerClassNameResolver",
"(",
")",
... | Initialize and return view object.
@param string $class View class
@param string $function Function name
@param array $parameters Parameters array
@param array $viewsChain Array of views names that should be initialized also
@return FrontendController | [
"Initialize",
"and",
"return",
"view",
"object",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L376-L395 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl._canExecuteFunction | protected function _canExecuteFunction($view, $function)
{
$canExecute = true;
if (method_exists($view, $function)) {
$reflectionMethod = new ReflectionMethod($view, $function);
if (!$reflectionMethod->isPublic()) {
$canExecute = false;
}
}
return $canExecute;
} | php | protected function _canExecuteFunction($view, $function)
{
$canExecute = true;
if (method_exists($view, $function)) {
$reflectionMethod = new ReflectionMethod($view, $function);
if (!$reflectionMethod->isPublic()) {
$canExecute = false;
}
}
return $canExecute;
} | [
"protected",
"function",
"_canExecuteFunction",
"(",
"$",
"view",
",",
"$",
"function",
")",
"{",
"$",
"canExecute",
"=",
"true",
";",
"if",
"(",
"method_exists",
"(",
"$",
"view",
",",
"$",
"function",
")",
")",
"{",
"$",
"reflectionMethod",
"=",
"new",... | Check if method can be executed.
@param FrontendController $view View object to check if its method can be executed.
@param string $function Method to check if it can be executed.
@return bool | [
"Check",
"if",
"method",
"can",
"be",
"executed",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L414-L425 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl._getFormattedErrors | protected function _getFormattedErrors($controllerName)
{
$errors = $this->_getErrors($controllerName);
$formattedErrors = [];
if (is_array($errors) && count($errors)) {
foreach ($errors as $location => $ex2) {
foreach ($ex2 as $key => $er) {
$error = unserialize($er);
$formattedErrors[$location][$key] = $error->getOxMessage();
}
}
}
return $formattedErrors;
} | php | protected function _getFormattedErrors($controllerName)
{
$errors = $this->_getErrors($controllerName);
$formattedErrors = [];
if (is_array($errors) && count($errors)) {
foreach ($errors as $location => $ex2) {
foreach ($ex2 as $key => $er) {
$error = unserialize($er);
$formattedErrors[$location][$key] = $error->getOxMessage();
}
}
}
return $formattedErrors;
} | [
"protected",
"function",
"_getFormattedErrors",
"(",
"$",
"controllerName",
")",
"{",
"$",
"errors",
"=",
"$",
"this",
"->",
"_getErrors",
"(",
"$",
"controllerName",
")",
";",
"$",
"formattedErrors",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
... | Format error messages from _getErrors and return as array.
@param string $controllerName a class name
@return array | [
"Format",
"error",
"messages",
"from",
"_getErrors",
"and",
"return",
"as",
"array",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L434-L448 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl._render | protected function _render($view)
{
// get Smarty is important here as it sets template directory correct
$smarty = \OxidEsales\Eshop\Core\Registry::getUtilsView()->getSmarty();
// render it
$templateName = $view->render();
// check if template dir exists
$templateFile = \OxidEsales\Eshop\Core\Registry::getConfig()->getTemplatePath($templateName, $this->isAdmin());
if (!file_exists($templateFile)) {
$ex = oxNew(\OxidEsales\Eshop\Core\Exception\SystemComponentException::class);
$ex->setMessage('EXCEPTION_SYSTEMCOMPONENT_TEMPLATENOTFOUND' . ' ' . $templateName);
$ex->setComponent($templateName);
$templateName = "message/exception.tpl";
if ($this->_isDebugMode()) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($ex);
}
\OxidEsales\Eshop\Core\Registry::getLogger()->error($ex->getMessage(), [$ex]);
}
// Output processing. This is useful for modules. As sometimes you may want to process output manually.
$outputManager = $this->_getOutputManager();
$viewData = $outputManager->processViewArray($view->getViewData(), $view->getClassName());
$view->setViewData($viewData);
//add all exceptions to display
$errors = $this->_getErrors($view->getClassName());
if (is_array($errors) && count($errors)) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->passAllErrorsToView($viewData, $errors);
}
foreach (array_keys($viewData) as $viewName) {
$smarty->assign($viewName, $viewData[$viewName]);
}
// passing current view object to smarty
$smarty->oxobject = $view;
$output = $this->fetchSmartyOutput($smarty, $templateName, $view->getViewId());
//Output processing - useful for modules as sometimes you may want to process output manually.
$output = $outputManager->process($output, $view->getClassName());
return $outputManager->addVersionTags($output);
} | php | protected function _render($view)
{
// get Smarty is important here as it sets template directory correct
$smarty = \OxidEsales\Eshop\Core\Registry::getUtilsView()->getSmarty();
// render it
$templateName = $view->render();
// check if template dir exists
$templateFile = \OxidEsales\Eshop\Core\Registry::getConfig()->getTemplatePath($templateName, $this->isAdmin());
if (!file_exists($templateFile)) {
$ex = oxNew(\OxidEsales\Eshop\Core\Exception\SystemComponentException::class);
$ex->setMessage('EXCEPTION_SYSTEMCOMPONENT_TEMPLATENOTFOUND' . ' ' . $templateName);
$ex->setComponent($templateName);
$templateName = "message/exception.tpl";
if ($this->_isDebugMode()) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($ex);
}
\OxidEsales\Eshop\Core\Registry::getLogger()->error($ex->getMessage(), [$ex]);
}
// Output processing. This is useful for modules. As sometimes you may want to process output manually.
$outputManager = $this->_getOutputManager();
$viewData = $outputManager->processViewArray($view->getViewData(), $view->getClassName());
$view->setViewData($viewData);
//add all exceptions to display
$errors = $this->_getErrors($view->getClassName());
if (is_array($errors) && count($errors)) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->passAllErrorsToView($viewData, $errors);
}
foreach (array_keys($viewData) as $viewName) {
$smarty->assign($viewName, $viewData[$viewName]);
}
// passing current view object to smarty
$smarty->oxobject = $view;
$output = $this->fetchSmartyOutput($smarty, $templateName, $view->getViewId());
//Output processing - useful for modules as sometimes you may want to process output manually.
$output = $outputManager->process($output, $view->getClassName());
return $outputManager->addVersionTags($output);
} | [
"protected",
"function",
"_render",
"(",
"$",
"view",
")",
"{",
"// get Smarty is important here as it sets template directory correct",
"$",
"smarty",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsView",
"(",
")",
"->",
"get... | Render BaseController object.
@param FrontendController $view view object to render
@return string | [
"Render",
"BaseController",
"object",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L457-L504 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl._getOutputManager | protected function _getOutputManager()
{
if (!$this->_oOutput) {
$this->_oOutput = oxNew(\OxidEsales\Eshop\Core\Output::class);
}
return $this->_oOutput;
} | php | protected function _getOutputManager()
{
if (!$this->_oOutput) {
$this->_oOutput = oxNew(\OxidEsales\Eshop\Core\Output::class);
}
return $this->_oOutput;
} | [
"protected",
"function",
"_getOutputManager",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_oOutput",
")",
"{",
"$",
"this",
"->",
"_oOutput",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Output",
"::",
"class",
")",... | Return output handler.
@return oxOutput | [
"Return",
"output",
"handler",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L525-L532 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl._getErrors | protected function _getErrors($currentControllerName)
{
if (null === $this->_aErrors) {
$this->_aErrors = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('Errors');
$this->_aControllerErrors = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('ErrorController');
if (null === $this->_aErrors) {
$this->_aErrors = [];
}
$this->_aAllErrors = $this->_aErrors;
}
// resetting errors of current controller or widget from session
if (is_array($this->_aControllerErrors) && !empty($this->_aControllerErrors)) {
foreach ($this->_aControllerErrors as $errorName => $controllerName) {
if ($controllerName == $currentControllerName) {
unset($this->_aAllErrors[$errorName]);
unset($this->_aControllerErrors[$errorName]);
}
}
} else {
$this->_aAllErrors = [];
}
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('ErrorController', $this->_aControllerErrors);
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('Errors', $this->_aAllErrors);
return $this->_aErrors;
} | php | protected function _getErrors($currentControllerName)
{
if (null === $this->_aErrors) {
$this->_aErrors = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('Errors');
$this->_aControllerErrors = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('ErrorController');
if (null === $this->_aErrors) {
$this->_aErrors = [];
}
$this->_aAllErrors = $this->_aErrors;
}
// resetting errors of current controller or widget from session
if (is_array($this->_aControllerErrors) && !empty($this->_aControllerErrors)) {
foreach ($this->_aControllerErrors as $errorName => $controllerName) {
if ($controllerName == $currentControllerName) {
unset($this->_aAllErrors[$errorName]);
unset($this->_aControllerErrors[$errorName]);
}
}
} else {
$this->_aAllErrors = [];
}
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('ErrorController', $this->_aControllerErrors);
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('Errors', $this->_aAllErrors);
return $this->_aErrors;
} | [
"protected",
"function",
"_getErrors",
"(",
"$",
"currentControllerName",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_aErrors",
")",
"{",
"$",
"this",
"->",
"_aErrors",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
... | Return page errors array.
@param string $currentControllerName Class name
@return array | [
"Return",
"page",
"errors",
"array",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L541-L566 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl._runOnce | protected function _runOnce()
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
//Ensures config values are available, database connection is established,
//session is started, a possible SeoUrl is decoded, globals and environment variables are set.
$config->init();
error_reporting($this->_getErrorReportingLevel());
$runOnceExecuted = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('blRunOnceExecuted');
if (!$runOnceExecuted && !$this->isAdmin() && $config->isProductiveMode()) {
// check if setup is still there
if (file_exists($config->getConfigParam('sShopDir') . '/Setup/index.php')) {
$tpl = 'message/err_setup.tpl';
$activeView = oxNew(\OxidEsales\Eshop\Application\Controller\FrontendController::class);
$smarty = \OxidEsales\Eshop\Core\Registry::getUtilsView()->getSmarty();
$smarty->assign('oView', $activeView);
$smarty->assign('oViewConf', $activeView->getViewConfig());
\OxidEsales\Eshop\Core\Registry::getUtils()->showMessageAndExit($smarty->fetch($tpl));
}
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('blRunOnceExecuted', true);
}
} | php | protected function _runOnce()
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
//Ensures config values are available, database connection is established,
//session is started, a possible SeoUrl is decoded, globals and environment variables are set.
$config->init();
error_reporting($this->_getErrorReportingLevel());
$runOnceExecuted = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('blRunOnceExecuted');
if (!$runOnceExecuted && !$this->isAdmin() && $config->isProductiveMode()) {
// check if setup is still there
if (file_exists($config->getConfigParam('sShopDir') . '/Setup/index.php')) {
$tpl = 'message/err_setup.tpl';
$activeView = oxNew(\OxidEsales\Eshop\Application\Controller\FrontendController::class);
$smarty = \OxidEsales\Eshop\Core\Registry::getUtilsView()->getSmarty();
$smarty->assign('oView', $activeView);
$smarty->assign('oViewConf', $activeView->getViewConfig());
\OxidEsales\Eshop\Core\Registry::getUtils()->showMessageAndExit($smarty->fetch($tpl));
}
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('blRunOnceExecuted', true);
}
} | [
"protected",
"function",
"_runOnce",
"(",
")",
"{",
"$",
"config",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"//Ensures config values are available, database connection is established,",
"//session is start... | This function is only executed one time here we perform checks if we
only need once per session. | [
"This",
"function",
"is",
"only",
"executed",
"one",
"time",
"here",
"we",
"perform",
"checks",
"if",
"we",
"only",
"need",
"once",
"per",
"session",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L572-L596 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl.formMonitorMessage | protected function formMonitorMessage($view)
{
$debugInfo = oxNew(\OxidEsales\Eshop\Core\DebugInfo::class);
$debugLevel = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iDebug');
$message = '';
// Outputting template params
if ($debugLevel == 4) {
$message .= $debugInfo->formatTemplateData($view->getViewData());
}
// Output timing
$this->_dTimeEnd = microtime(true);
$message .= $debugInfo->formatMemoryUsage();
$message .= $debugInfo->formatTimeStamp();
$message .= $debugInfo->formatExecutionTime($this->getTotalTime());
return $message;
} | php | protected function formMonitorMessage($view)
{
$debugInfo = oxNew(\OxidEsales\Eshop\Core\DebugInfo::class);
$debugLevel = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iDebug');
$message = '';
// Outputting template params
if ($debugLevel == 4) {
$message .= $debugInfo->formatTemplateData($view->getViewData());
}
// Output timing
$this->_dTimeEnd = microtime(true);
$message .= $debugInfo->formatMemoryUsage();
$message .= $debugInfo->formatTimeStamp();
$message .= $debugInfo->formatExecutionTime($this->getTotalTime());
return $message;
} | [
"protected",
"function",
"formMonitorMessage",
"(",
"$",
"view",
")",
"{",
"$",
"debugInfo",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DebugInfo",
"::",
"class",
")",
";",
"$",
"debugLevel",
"=",
"\\",
"OxidEsales",
"\\",
... | Forms message for displaying monitoring information on the bottom of the page.
@param FrontendController $view
@return string | [
"Forms",
"message",
"for",
"displaying",
"monitoring",
"information",
"on",
"the",
"bottom",
"of",
"the",
"page",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L704-L725 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl._handleCookieException | protected function _handleCookieException($exception)
{
if ($this->_isDebugMode()) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($exception);
}
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl() . 'cl=start', true, 302);
} | php | protected function _handleCookieException($exception)
{
if ($this->_isDebugMode()) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($exception);
}
\OxidEsales\Eshop\Core\Registry::getUtils()->redirect(\OxidEsales\Eshop\Core\Registry::getConfig()->getShopHomeUrl() . 'cl=start', true, 302);
} | [
"protected",
"function",
"_handleCookieException",
"(",
"$",
"exception",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_isDebugMode",
"(",
")",
")",
"{",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsView",
"(",
")",
"->",
... | Redirect to start page, in debug mode shows error message.
@param \OxidEsales\Eshop\Core\Exception\StandardException $exception Exception | [
"Redirect",
"to",
"start",
"page",
"in",
"debug",
"mode",
"shows",
"error",
"message",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L763-L769 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl._handleBaseException | protected function _handleBaseException($exception)
{
$this->logException($exception);
if ($this->_isDebugMode()) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($exception);
$this->_process('exceptionError', 'displayExceptionError');
}
} | php | protected function _handleBaseException($exception)
{
$this->logException($exception);
if ($this->_isDebugMode()) {
\OxidEsales\Eshop\Core\Registry::getUtilsView()->addErrorToDisplay($exception);
$this->_process('exceptionError', 'displayExceptionError');
}
} | [
"protected",
"function",
"_handleBaseException",
"(",
"$",
"exception",
")",
"{",
"$",
"this",
"->",
"logException",
"(",
"$",
"exception",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_isDebugMode",
"(",
")",
")",
"{",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\... | Handling other not caught exceptions.
@param \OxidEsales\Eshop\Core\Exception\StandardException $exception | [
"Handling",
"other",
"not",
"caught",
"exceptions",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L812-L820 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl.reportDatabaseConnectionException | protected function reportDatabaseConnectionException(DatabaseConnectionException $exception)
{
/**
* If the shop is not in debug mode, a "shop offline" warning is send to the shop admin.
* In order not to spam the shop admin, the warning will be sent in a certain interval of time.
*/
if ($this->messageWasSentWithinThreshold() || $this->_isDebugMode()) {
return;
}
$result = $this->sendOfflineWarning($exception);
if ($result) {
file_put_contents($this->offlineWarningTimestampFile, time());
}
} | php | protected function reportDatabaseConnectionException(DatabaseConnectionException $exception)
{
/**
* If the shop is not in debug mode, a "shop offline" warning is send to the shop admin.
* In order not to spam the shop admin, the warning will be sent in a certain interval of time.
*/
if ($this->messageWasSentWithinThreshold() || $this->_isDebugMode()) {
return;
}
$result = $this->sendOfflineWarning($exception);
if ($result) {
file_put_contents($this->offlineWarningTimestampFile, time());
}
} | [
"protected",
"function",
"reportDatabaseConnectionException",
"(",
"DatabaseConnectionException",
"$",
"exception",
")",
"{",
"/**\n * If the shop is not in debug mode, a \"shop offline\" warning is send to the shop admin.\n * In order not to spam the shop admin, the warning will b... | Notify the shop owner about database connection problems.
This method forms part of the exception handling process. Any further exceptions must be caught.
@param DatabaseConnectionException $exception Database connection exception to report
@return null | [
"Notify",
"the",
"shop",
"owner",
"about",
"database",
"connection",
"problems",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L846-L860 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl.messageWasSentWithinThreshold | protected function messageWasSentWithinThreshold()
{
$wasSentWithinThreshold = false;
/** @var int $threshold Threshold in seconds */
$threshold = Registry::get(\OxidEsales\Eshop\Core\ConfigFile::class)->getVar('offlineWarningInterval');
if (file_exists($this->offlineWarningTimestampFile)) {
$lastSentTimestamp = (int) file_get_contents($this->offlineWarningTimestampFile);
$lastSentBefore = time() - $lastSentTimestamp;
if ($lastSentBefore < $threshold) {
$wasSentWithinThreshold = true;
}
}
return $wasSentWithinThreshold;
} | php | protected function messageWasSentWithinThreshold()
{
$wasSentWithinThreshold = false;
/** @var int $threshold Threshold in seconds */
$threshold = Registry::get(\OxidEsales\Eshop\Core\ConfigFile::class)->getVar('offlineWarningInterval');
if (file_exists($this->offlineWarningTimestampFile)) {
$lastSentTimestamp = (int) file_get_contents($this->offlineWarningTimestampFile);
$lastSentBefore = time() - $lastSentTimestamp;
if ($lastSentBefore < $threshold) {
$wasSentWithinThreshold = true;
}
}
return $wasSentWithinThreshold;
} | [
"protected",
"function",
"messageWasSentWithinThreshold",
"(",
")",
"{",
"$",
"wasSentWithinThreshold",
"=",
"false",
";",
"/** @var int $threshold Threshold in seconds */",
"$",
"threshold",
"=",
"Registry",
"::",
"get",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
... | Return true, if a message was already sent within a given threshold.
This method forms part of the exception handling process. Any further exceptions must be caught.
@return bool | [
"Return",
"true",
"if",
"a",
"message",
"was",
"already",
"sent",
"within",
"a",
"given",
"threshold",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L869-L884 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl.sendOfflineWarning | protected function sendOfflineWarning(\OxidEsales\Eshop\Core\Exception\StandardException $exception)
{
$result = false;
/** @var $emailAddress Email address to sent the message to */
$emailAddress = Registry::get(\OxidEsales\Eshop\Core\ConfigFile::class)->getVar('sAdminEmail');
if ($emailAddress) {
/** As we are inside the exception handling process, any further exceptions must be caught */
$failedShop = isset($_REQUEST['shp']) ? addslashes($_REQUEST['shp']) : 'Base shop';
$date = date(DATE_RFC822); // RFC 822 (example: Mon, 15 Aug 05 15:52:01 +0000)
$script = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
$referrer = $_SERVER['HTTP_REFERER'];
//sending a message to admin
$emailSubject = 'Offline warning!';
$emailBody = "
Database connection error in OXID eShop:
Date: {$date}
Shop: {$failedShop}
mysql error: " . $exception->getMessage() . "
mysql error no: " . $exception->getCode() . "
Script: {$script}
Referrer: {$referrer}";
$mailer = new PHPMailer();
$mailer->isMail();
$mailer->setFrom($emailAddress);
$mailer->addAddress($emailAddress);
$mailer->Subject = $emailSubject;
$mailer->Body = $emailBody;
/** Set the priority of the message
* For most clients expecting the Priority header:
* 1 = High, 2 = Medium, 3 = Low
* */
$mailer->Priority = 1;
/** MS Outlook custom header */
$mailer->addCustomHeader("X-MSMail-Priority: Urgent");
/** Set the Importance header: */
$mailer->addCustomHeader("Importance: High");
$result = $mailer->send();
}
return $result;
} | php | protected function sendOfflineWarning(\OxidEsales\Eshop\Core\Exception\StandardException $exception)
{
$result = false;
/** @var $emailAddress Email address to sent the message to */
$emailAddress = Registry::get(\OxidEsales\Eshop\Core\ConfigFile::class)->getVar('sAdminEmail');
if ($emailAddress) {
/** As we are inside the exception handling process, any further exceptions must be caught */
$failedShop = isset($_REQUEST['shp']) ? addslashes($_REQUEST['shp']) : 'Base shop';
$date = date(DATE_RFC822); // RFC 822 (example: Mon, 15 Aug 05 15:52:01 +0000)
$script = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
$referrer = $_SERVER['HTTP_REFERER'];
//sending a message to admin
$emailSubject = 'Offline warning!';
$emailBody = "
Database connection error in OXID eShop:
Date: {$date}
Shop: {$failedShop}
mysql error: " . $exception->getMessage() . "
mysql error no: " . $exception->getCode() . "
Script: {$script}
Referrer: {$referrer}";
$mailer = new PHPMailer();
$mailer->isMail();
$mailer->setFrom($emailAddress);
$mailer->addAddress($emailAddress);
$mailer->Subject = $emailSubject;
$mailer->Body = $emailBody;
/** Set the priority of the message
* For most clients expecting the Priority header:
* 1 = High, 2 = Medium, 3 = Low
* */
$mailer->Priority = 1;
/** MS Outlook custom header */
$mailer->addCustomHeader("X-MSMail-Priority: Urgent");
/** Set the Importance header: */
$mailer->addCustomHeader("Importance: High");
$result = $mailer->send();
}
return $result;
} | [
"protected",
"function",
"sendOfflineWarning",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Exception",
"\\",
"StandardException",
"$",
"exception",
")",
"{",
"$",
"result",
"=",
"false",
";",
"/** @var $emailAddress Email address to sent the message to... | Send an offline warning to the shop owner.
Currently an email is sent to the email address configured as 'sAdminEmail' in the eShop config file.
This method forms part of the exception handling process. Any further exceptions must be caught.
@param StandardException $exception
@return bool Returns true, if the email was sent. | [
"Send",
"an",
"offline",
"warning",
"to",
"the",
"shop",
"owner",
".",
"Currently",
"an",
"email",
"is",
"sent",
"to",
"the",
"email",
"address",
"configured",
"as",
"sAdminEmail",
"in",
"the",
"eShop",
"config",
"file",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L896-L944 | train |
OXID-eSales/oxideshop_ce | source/Core/ShopControl.php | ShopControl.getControllerClass | protected function getControllerClass($controllerKey)
{
/** Remove try catch block after routing BC is removed */
try {
$controllerClass = $this->resolveControllerClass($controllerKey);
} catch (\OxidEsales\Eshop\Core\Exception\RoutingException $exception) {
$this->handleRoutingException($exception);
$controllerClass = $controllerKey;
}
return $controllerClass;
} | php | protected function getControllerClass($controllerKey)
{
/** Remove try catch block after routing BC is removed */
try {
$controllerClass = $this->resolveControllerClass($controllerKey);
} catch (\OxidEsales\Eshop\Core\Exception\RoutingException $exception) {
$this->handleRoutingException($exception);
$controllerClass = $controllerKey;
}
return $controllerClass;
} | [
"protected",
"function",
"getControllerClass",
"(",
"$",
"controllerKey",
")",
"{",
"/** Remove try catch block after routing BC is removed */",
"try",
"{",
"$",
"controllerClass",
"=",
"$",
"this",
"->",
"resolveControllerClass",
"(",
"$",
"controllerKey",
")",
";",
"}... | Get controller class from key.
Fallback is to use key as class if no match can be found.
@param string $controllerKey
@return string | [
"Get",
"controller",
"class",
"from",
"key",
".",
"Fallback",
"is",
"to",
"use",
"key",
"as",
"class",
"if",
"no",
"match",
"can",
"be",
"found",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ShopControl.php#L954-L965 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ShopLicense.php | ShopLicense._canUpdate | protected function _canUpdate()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$blIsMallAdmin = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('malladmin');
if (!$blIsMallAdmin) {
return false;
}
if ($myConfig->isDemoShop()) {
return false;
}
return true;
} | php | protected function _canUpdate()
{
$myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
$blIsMallAdmin = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('malladmin');
if (!$blIsMallAdmin) {
return false;
}
if ($myConfig->isDemoShop()) {
return false;
}
return true;
} | [
"protected",
"function",
"_canUpdate",
"(",
")",
"{",
"$",
"myConfig",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"blIsMallAdmin",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"... | Checks if the license key update is allowed.
@return bool | [
"Checks",
"if",
"the",
"license",
"key",
"update",
"is",
"allowed",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ShopLicense.php#L70-L84 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ShopLicense.php | ShopLicense._fetchCurVersionInfo | protected function _fetchCurVersionInfo($sUrl)
{
$aParams = ["myversion" => \OxidEsales\Eshop\Core\Registry::getConfig()->getVersion()];
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$iLang = $oLang->getTplLanguage();
$sLang = $oLang->getLanguageAbbr($iLang);
$oCurl = oxNew(\OxidEsales\Eshop\Core\Curl::class);
$oCurl->setMethod("POST");
$oCurl->setUrl($sUrl . "/" . $sLang);
$oCurl->setParameters($aParams);
$sOutput = $oCurl->execute();
$sOutput = strip_tags($sOutput, "<br>, <b>");
$aResult = explode("<br>", $sOutput);
if (strstr($aResult[5], "update")) {
$sUpdateLink = \OxidEsales\Eshop\Core\Registry::getLang()->translateString("VERSION_UPDATE_LINK");
$aResult[5] = "<a id='linkToUpdate' href='$sUpdateLink' target='_blank'>" . $aResult[5] . "</a>";
}
return implode("<br>", $aResult);
} | php | protected function _fetchCurVersionInfo($sUrl)
{
$aParams = ["myversion" => \OxidEsales\Eshop\Core\Registry::getConfig()->getVersion()];
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$iLang = $oLang->getTplLanguage();
$sLang = $oLang->getLanguageAbbr($iLang);
$oCurl = oxNew(\OxidEsales\Eshop\Core\Curl::class);
$oCurl->setMethod("POST");
$oCurl->setUrl($sUrl . "/" . $sLang);
$oCurl->setParameters($aParams);
$sOutput = $oCurl->execute();
$sOutput = strip_tags($sOutput, "<br>, <b>");
$aResult = explode("<br>", $sOutput);
if (strstr($aResult[5], "update")) {
$sUpdateLink = \OxidEsales\Eshop\Core\Registry::getLang()->translateString("VERSION_UPDATE_LINK");
$aResult[5] = "<a id='linkToUpdate' href='$sUpdateLink' target='_blank'>" . $aResult[5] . "</a>";
}
return implode("<br>", $aResult);
} | [
"protected",
"function",
"_fetchCurVersionInfo",
"(",
"$",
"sUrl",
")",
"{",
"$",
"aParams",
"=",
"[",
"\"myversion\"",
"=>",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getVersion",
"(",
")",
"]",... | Fetch current shop version information from url
@param string $sUrl current version info fetching url by edition
@return string | [
"Fetch",
"current",
"shop",
"version",
"information",
"from",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ShopLicense.php#L93-L114 | train |
OXID-eSales/oxideshop_ce | source/Core/ViewHelper/StyleRegistrator.php | StyleRegistrator.formLocalFileUrl | protected function formLocalFileUrl($file)
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$parts = explode('?', $file);
$url = $config->getResourceUrl($parts[0], $config->isAdmin());
$parameters = $parts[1];
if (empty($parameters)) {
$path = $config->getResourcePath($file, $config->isAdmin());
$parameters = filemtime($path);
}
if (empty($url) && $config->getConfigParam('iDebug') != 0) {
$error = "{oxstyle} resource not found: " . getStr()->htmlspecialchars($file);
trigger_error($error, E_USER_WARNING);
}
return $url ? "$url?$parameters" : '';
} | php | protected function formLocalFileUrl($file)
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$parts = explode('?', $file);
$url = $config->getResourceUrl($parts[0], $config->isAdmin());
$parameters = $parts[1];
if (empty($parameters)) {
$path = $config->getResourcePath($file, $config->isAdmin());
$parameters = filemtime($path);
}
if (empty($url) && $config->getConfigParam('iDebug') != 0) {
$error = "{oxstyle} resource not found: " . getStr()->htmlspecialchars($file);
trigger_error($error, E_USER_WARNING);
}
return $url ? "$url?$parameters" : '';
} | [
"protected",
"function",
"formLocalFileUrl",
"(",
"$",
"file",
")",
"{",
"$",
"config",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"parts",
"=",
"explode",
"(",
"'?'",
",",
"$",
"file"... | Separate query part, appends query part if needed, append file modification timestamp.
@param string $file
@return string | [
"Separate",
"query",
"part",
"appends",
"query",
"part",
"if",
"needed",
"append",
"file",
"modification",
"timestamp",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/ViewHelper/StyleRegistrator.php#L56-L73 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Locator.php | Locator.setLocatorData | public function setLocatorData($oCurrArticle, $oLocatorTarget)
{
$sLocfnc = "_set{$this->_sType}LocatorData";
$this->$sLocfnc($oLocatorTarget, $oCurrArticle);
// passing list type to view
$oLocatorTarget->setListType($this->_sType);
} | php | public function setLocatorData($oCurrArticle, $oLocatorTarget)
{
$sLocfnc = "_set{$this->_sType}LocatorData";
$this->$sLocfnc($oLocatorTarget, $oCurrArticle);
// passing list type to view
$oLocatorTarget->setListType($this->_sType);
} | [
"public",
"function",
"setLocatorData",
"(",
"$",
"oCurrArticle",
",",
"$",
"oLocatorTarget",
")",
"{",
"$",
"sLocfnc",
"=",
"\"_set{$this->_sType}LocatorData\"",
";",
"$",
"this",
"->",
"$",
"sLocfnc",
"(",
"$",
"oLocatorTarget",
",",
"$",
"oCurrArticle",
")",
... | Executes locator method according locator type
@param \OxidEsales\Eshop\Application\Model\Article $oCurrArticle current article
@param \OxidEsales\Eshop\Application\Controller\FrontendController $oLocatorTarget FrontendController object | [
"Executes",
"locator",
"method",
"according",
"locator",
"type"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Locator.php#L63-L70 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Locator.php | Locator._setListLocatorData | protected function _setListLocatorData($oLocatorTarget, $oCurrArticle)
{
// if no active category is loaded - lets check for category passed by post/get
if (($oCategory = $oLocatorTarget->getActiveCategory())) {
$sOrderBy = $oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent());
$oIdList = $this->_loadIdsInList($oCategory, $oCurrArticle, $sOrderBy);
//page number
$iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
// setting product position in list, amount of articles etc
$oCategory->iCntOfProd = $oIdList->count();
$oCategory->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive() && $iPage) {
/** @var \OxidEsales\Eshop\Application\Model\SeoEncoderCategory $oSeoEncoderCategory */
$oSeoEncoderCategory = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderCategory::class);
$oCategory->toListLink = $oSeoEncoderCategory->getCategoryPageUrl($oCategory, $iPage);
} else {
$oCategory->toListLink = $this->_makeLink($oCategory->getLink(), $this->_getPageNumber($iPage));
}
$oNextProduct = $this->_oNextProduct;
$oBackProduct = $this->_oBackProduct;
$oCategory->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), '') : null;
$oCategory->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), '') : null;
// active category
$oLocatorTarget->setActiveCategory($oCategory);
// category path
if (($oCatTree = $oLocatorTarget->getCategoryTree())) {
$oLocatorTarget->setCatTreePath($oCatTree->getPath());
}
}
} | php | protected function _setListLocatorData($oLocatorTarget, $oCurrArticle)
{
// if no active category is loaded - lets check for category passed by post/get
if (($oCategory = $oLocatorTarget->getActiveCategory())) {
$sOrderBy = $oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent());
$oIdList = $this->_loadIdsInList($oCategory, $oCurrArticle, $sOrderBy);
//page number
$iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
// setting product position in list, amount of articles etc
$oCategory->iCntOfProd = $oIdList->count();
$oCategory->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive() && $iPage) {
/** @var \OxidEsales\Eshop\Application\Model\SeoEncoderCategory $oSeoEncoderCategory */
$oSeoEncoderCategory = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderCategory::class);
$oCategory->toListLink = $oSeoEncoderCategory->getCategoryPageUrl($oCategory, $iPage);
} else {
$oCategory->toListLink = $this->_makeLink($oCategory->getLink(), $this->_getPageNumber($iPage));
}
$oNextProduct = $this->_oNextProduct;
$oBackProduct = $this->_oBackProduct;
$oCategory->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), '') : null;
$oCategory->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), '') : null;
// active category
$oLocatorTarget->setActiveCategory($oCategory);
// category path
if (($oCatTree = $oLocatorTarget->getCategoryTree())) {
$oLocatorTarget->setCatTreePath($oCatTree->getPath());
}
}
} | [
"protected",
"function",
"_setListLocatorData",
"(",
"$",
"oLocatorTarget",
",",
"$",
"oCurrArticle",
")",
"{",
"// if no active category is loaded - lets check for category passed by post/get",
"if",
"(",
"(",
"$",
"oCategory",
"=",
"$",
"oLocatorTarget",
"->",
"getActiveC... | Sets details locator data for articles that came from regular list.
@param \OxidEsales\Eshop\Application\Controller\FrontendController $oLocatorTarget view object
@param \OxidEsales\Eshop\Application\Model\Article $oCurrArticle current article | [
"Sets",
"details",
"locator",
"data",
"for",
"articles",
"that",
"came",
"from",
"regular",
"list",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Locator.php#L78-L113 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Locator.php | Locator._setVendorLocatorData | protected function _setVendorLocatorData($oLocatorTarget, $oCurrArticle)
{
if (($oVendor = $oLocatorTarget->getActVendor())) {
$sVendorId = $oVendor->getId();
$myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
$blSeo = $myUtils->seoIsActive();
// loading data for article navigation
$oIdList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
$oIdList->loadVendorIds($sVendorId);
//page number
$iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
$sAdd = null;
if (!$blSeo) {
$sAdd = 'listtype=vendor&cnid=v_' . $sVendorId;
}
// setting product position in list, amount of articles etc
$oVendor->iCntOfProd = $oIdList->count();
$oVendor->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
if ($blSeo && $iPage) {
$oVendor->toListLink = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderVendor::class)->getVendorPageUrl($oVendor, $iPage);
} else {
$oVendor->toListLink = $this->_makeLink($oVendor->getLink(), $this->_getPageNumber($iPage));
}
$oNextProduct = $this->_oNextProduct;
$oBackProduct = $this->_oBackProduct;
$oVendor->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), $sAdd) : null;
$oVendor->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), $sAdd) : null;
}
} | php | protected function _setVendorLocatorData($oLocatorTarget, $oCurrArticle)
{
if (($oVendor = $oLocatorTarget->getActVendor())) {
$sVendorId = $oVendor->getId();
$myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
$blSeo = $myUtils->seoIsActive();
// loading data for article navigation
$oIdList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
$oIdList->loadVendorIds($sVendorId);
//page number
$iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
$sAdd = null;
if (!$blSeo) {
$sAdd = 'listtype=vendor&cnid=v_' . $sVendorId;
}
// setting product position in list, amount of articles etc
$oVendor->iCntOfProd = $oIdList->count();
$oVendor->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
if ($blSeo && $iPage) {
$oVendor->toListLink = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderVendor::class)->getVendorPageUrl($oVendor, $iPage);
} else {
$oVendor->toListLink = $this->_makeLink($oVendor->getLink(), $this->_getPageNumber($iPage));
}
$oNextProduct = $this->_oNextProduct;
$oBackProduct = $this->_oBackProduct;
$oVendor->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), $sAdd) : null;
$oVendor->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), $sAdd) : null;
}
} | [
"protected",
"function",
"_setVendorLocatorData",
"(",
"$",
"oLocatorTarget",
",",
"$",
"oCurrArticle",
")",
"{",
"if",
"(",
"(",
"$",
"oVendor",
"=",
"$",
"oLocatorTarget",
"->",
"getActVendor",
"(",
")",
")",
")",
"{",
"$",
"sVendorId",
"=",
"$",
"oVendo... | Sets details locator data for articles that came from vendor list.
@param \OxidEsales\Eshop\Application\Controller\FrontendController $oLocatorTarget FrontendController object
@param \OxidEsales\Eshop\Application\Model\Article $oCurrArticle current article | [
"Sets",
"details",
"locator",
"data",
"for",
"articles",
"that",
"came",
"from",
"vendor",
"list",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Locator.php#L121-L157 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Locator.php | Locator._setManufacturerLocatorData | protected function _setManufacturerLocatorData($oLocatorTarget, $oCurrArticle)
{
if (($oManufacturer = $oLocatorTarget->getActManufacturer())) {
$sManufacturerId = $oManufacturer->getId();
$myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
$blSeo = $myUtils->seoIsActive();
// loading data for article navigation
$oIdList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
$oIdList->loadManufacturerIds($sManufacturerId);
//page number
$iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
$sAdd = null;
if (!$blSeo) {
$sAdd = 'listtype=manufacturer&mnid=' . $sManufacturerId;
}
// setting product position in list, amount of articles etc
$oManufacturer->iCntOfProd = $oIdList->count();
$oManufacturer->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
if ($blSeo && $iPage) {
/** @var \OxidEsales\Eshop\Application\Model\SeoEncoderManufacturer $oSeoEncoderManufacturer */
$oSeoEncoderManufacturer = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderManufacturer::class);
$oManufacturer->toListLink = $oSeoEncoderManufacturer->getManufacturerPageUrl($oManufacturer, $iPage);
} else {
$oManufacturer->toListLink = $this->_makeLink($oManufacturer->getLink(), $this->_getPageNumber($iPage));
}
$oNextProduct = $this->_oNextProduct;
$oBackProduct = $this->_oBackProduct;
$oManufacturer->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), $sAdd) : null;
$oManufacturer->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), $sAdd) : null;
// active Manufacturer
$oLocatorTarget->setActiveCategory($oManufacturer);
// Manufacturer path
if (($oManufacturerTree = $oLocatorTarget->getManufacturerTree())) {
$oLocatorTarget->setCatTreePath($oManufacturerTree->getPath());
}
}
} | php | protected function _setManufacturerLocatorData($oLocatorTarget, $oCurrArticle)
{
if (($oManufacturer = $oLocatorTarget->getActManufacturer())) {
$sManufacturerId = $oManufacturer->getId();
$myUtils = \OxidEsales\Eshop\Core\Registry::getUtils();
$blSeo = $myUtils->seoIsActive();
// loading data for article navigation
$oIdList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oIdList->setCustomSorting($oLocatorTarget->getSortingSql($oLocatorTarget->getSortIdent()));
$oIdList->loadManufacturerIds($sManufacturerId);
//page number
$iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
$sAdd = null;
if (!$blSeo) {
$sAdd = 'listtype=manufacturer&mnid=' . $sManufacturerId;
}
// setting product position in list, amount of articles etc
$oManufacturer->iCntOfProd = $oIdList->count();
$oManufacturer->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
if ($blSeo && $iPage) {
/** @var \OxidEsales\Eshop\Application\Model\SeoEncoderManufacturer $oSeoEncoderManufacturer */
$oSeoEncoderManufacturer = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderManufacturer::class);
$oManufacturer->toListLink = $oSeoEncoderManufacturer->getManufacturerPageUrl($oManufacturer, $iPage);
} else {
$oManufacturer->toListLink = $this->_makeLink($oManufacturer->getLink(), $this->_getPageNumber($iPage));
}
$oNextProduct = $this->_oNextProduct;
$oBackProduct = $this->_oBackProduct;
$oManufacturer->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), $sAdd) : null;
$oManufacturer->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), $sAdd) : null;
// active Manufacturer
$oLocatorTarget->setActiveCategory($oManufacturer);
// Manufacturer path
if (($oManufacturerTree = $oLocatorTarget->getManufacturerTree())) {
$oLocatorTarget->setCatTreePath($oManufacturerTree->getPath());
}
}
} | [
"protected",
"function",
"_setManufacturerLocatorData",
"(",
"$",
"oLocatorTarget",
",",
"$",
"oCurrArticle",
")",
"{",
"if",
"(",
"(",
"$",
"oManufacturer",
"=",
"$",
"oLocatorTarget",
"->",
"getActManufacturer",
"(",
")",
")",
")",
"{",
"$",
"sManufacturerId",... | Sets details locator data for articles that came from Manufacturer list.
@param \OxidEsales\Eshop\Application\Controller\FrontendController $oLocatorTarget FrontendController object
@param \OxidEsales\Eshop\Application\Model\Article $oCurrArticle current article | [
"Sets",
"details",
"locator",
"data",
"for",
"articles",
"that",
"came",
"from",
"Manufacturer",
"list",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Locator.php#L165-L211 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Locator.php | Locator._setRecommlistLocatorData | protected function _setRecommlistLocatorData($oLocatorTarget, $oCurrArticle)
{
if (($oRecommList = $oLocatorTarget->getActiveRecommList())) {
// loading data for article navigation
$oIdList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oIdList->loadRecommArticleIds($oRecommList->getId(), null);
//page number
$iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
$sSearchRecomm = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchrecomm', true);
if ($sSearchRecomm !== null) {
$sSearchFormRecomm = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchrecomm');
$sSearchLinkRecomm = rawurlencode($sSearchRecomm);
$sAddSearch = 'searchrecomm=' . $sSearchLinkRecomm;
}
// setting product position in list, amount of articles etc
$oRecommList->iCntOfProd = $oIdList->count();
$oRecommList->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
$blSeo = \OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive();
if ($blSeo && $iPage) {
/** @var \OxidEsales\Eshop\Application\Model\SeoEncoderRecomm $oSeoEncoderRecomm */
$oSeoEncoderRecomm = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderRecomm::class);
$oRecommList->toListLink = $oSeoEncoderRecomm->getRecommPageUrl($oRecommList, $iPage);
} else {
$oRecommList->toListLink = $this->_makeLink($oRecommList->getLink(), $this->_getPageNumber($iPage));
}
$oRecommList->toListLink = $this->_makeLink($oRecommList->toListLink, $sAddSearch);
$sAdd = '';
if (!$blSeo) {
$sAdd = 'recommid=' . $oRecommList->getId() . '&listtype=recommlist' . ($sAddSearch ? '&' : '');
}
$sAdd .= $sAddSearch;
$oNextProduct = $this->_oNextProduct;
$oBackProduct = $this->_oBackProduct;
$oRecommList->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), $sAdd) : null;
$oRecommList->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), $sAdd) : null;
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$sTitle = $oLang->translateString('RECOMMLIST');
if ($sSearchRecomm !== null) {
$sTitle .= " / " . $oLang->translateString('RECOMMLIST_SEARCH') . ' "' . $sSearchFormRecomm . '"';
}
$oLocatorTarget->setSearchTitle($sTitle);
$oLocatorTarget->setActiveCategory($oRecommList);
}
} | php | protected function _setRecommlistLocatorData($oLocatorTarget, $oCurrArticle)
{
if (($oRecommList = $oLocatorTarget->getActiveRecommList())) {
// loading data for article navigation
$oIdList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oIdList->loadRecommArticleIds($oRecommList->getId(), null);
//page number
$iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
$sSearchRecomm = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchrecomm', true);
if ($sSearchRecomm !== null) {
$sSearchFormRecomm = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('searchrecomm');
$sSearchLinkRecomm = rawurlencode($sSearchRecomm);
$sAddSearch = 'searchrecomm=' . $sSearchLinkRecomm;
}
// setting product position in list, amount of articles etc
$oRecommList->iCntOfProd = $oIdList->count();
$oRecommList->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
$blSeo = \OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive();
if ($blSeo && $iPage) {
/** @var \OxidEsales\Eshop\Application\Model\SeoEncoderRecomm $oSeoEncoderRecomm */
$oSeoEncoderRecomm = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\SeoEncoderRecomm::class);
$oRecommList->toListLink = $oSeoEncoderRecomm->getRecommPageUrl($oRecommList, $iPage);
} else {
$oRecommList->toListLink = $this->_makeLink($oRecommList->getLink(), $this->_getPageNumber($iPage));
}
$oRecommList->toListLink = $this->_makeLink($oRecommList->toListLink, $sAddSearch);
$sAdd = '';
if (!$blSeo) {
$sAdd = 'recommid=' . $oRecommList->getId() . '&listtype=recommlist' . ($sAddSearch ? '&' : '');
}
$sAdd .= $sAddSearch;
$oNextProduct = $this->_oNextProduct;
$oBackProduct = $this->_oBackProduct;
$oRecommList->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), $sAdd) : null;
$oRecommList->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), $sAdd) : null;
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$sTitle = $oLang->translateString('RECOMMLIST');
if ($sSearchRecomm !== null) {
$sTitle .= " / " . $oLang->translateString('RECOMMLIST_SEARCH') . ' "' . $sSearchFormRecomm . '"';
}
$oLocatorTarget->setSearchTitle($sTitle);
$oLocatorTarget->setActiveCategory($oRecommList);
}
} | [
"protected",
"function",
"_setRecommlistLocatorData",
"(",
"$",
"oLocatorTarget",
",",
"$",
"oCurrArticle",
")",
"{",
"if",
"(",
"(",
"$",
"oRecommList",
"=",
"$",
"oLocatorTarget",
"->",
"getActiveRecommList",
"(",
")",
")",
")",
"{",
"// loading data for article... | Sets details locator data for articles that came from recommlist.
Template variables:
<b>sSearchTitle</b>, <b>searchparamforhtml</b>
@param \OxidEsales\Eshop\Application\Controller\FrontendController $oLocatorTarget FrontendController object
@param \OxidEsales\Eshop\Application\Model\Article $oCurrArticle current article
@deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module. | [
"Sets",
"details",
"locator",
"data",
"for",
"articles",
"that",
"came",
"from",
"recommlist",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Locator.php#L288-L338 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Locator.php | Locator._loadIdsInList | protected function _loadIdsInList($oCategory, $oCurrArticle, $sOrderBy = null)
{
$oIdList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oIdList->setCustomSorting($sOrderBy);
// additionally check if this category is loaded and is price category ?
if ($oCategory->isPriceCategory()) {
$oIdList->loadPriceIds($oCategory->oxcategories__oxpricefrom->value, $oCategory->oxcategories__oxpriceto->value);
} else {
$sActCat = $oCategory->getId();
$oIdList->loadCategoryIDs($sActCat, \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('session_attrfilter'));
// if not found - reloading with empty filter
if (!isset($oIdList[$oCurrArticle->getId()])) {
$oIdList->loadCategoryIDs($sActCat, null);
}
}
return $oIdList;
} | php | protected function _loadIdsInList($oCategory, $oCurrArticle, $sOrderBy = null)
{
$oIdList = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);
$oIdList->setCustomSorting($sOrderBy);
// additionally check if this category is loaded and is price category ?
if ($oCategory->isPriceCategory()) {
$oIdList->loadPriceIds($oCategory->oxcategories__oxpricefrom->value, $oCategory->oxcategories__oxpriceto->value);
} else {
$sActCat = $oCategory->getId();
$oIdList->loadCategoryIDs($sActCat, \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('session_attrfilter'));
// if not found - reloading with empty filter
if (!isset($oIdList[$oCurrArticle->getId()])) {
$oIdList->loadCategoryIDs($sActCat, null);
}
}
return $oIdList;
} | [
"protected",
"function",
"_loadIdsInList",
"(",
"$",
"oCategory",
",",
"$",
"oCurrArticle",
",",
"$",
"sOrderBy",
"=",
"null",
")",
"{",
"$",
"oIdList",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Articl... | Setting product position in list, amount of articles etc
@param \OxidEsales\Eshop\Application\Model\Category $oCategory active category id
@param object $oCurrArticle current article
@param string $sOrderBy order by fields
@return object | [
"Setting",
"product",
"position",
"in",
"list",
"amount",
"of",
"articles",
"etc"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Locator.php#L349-L367 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Locator.php | Locator._makeLink | protected function _makeLink($sLink, $sParams)
{
if ($sParams) {
$sLink .= ((strpos($sLink, '?') !== false) ? '&' : '?') . $sParams;
}
return $sLink;
} | php | protected function _makeLink($sLink, $sParams)
{
if ($sParams) {
$sLink .= ((strpos($sLink, '?') !== false) ? '&' : '?') . $sParams;
}
return $sLink;
} | [
"protected",
"function",
"_makeLink",
"(",
"$",
"sLink",
",",
"$",
"sParams",
")",
"{",
"if",
"(",
"$",
"sParams",
")",
"{",
"$",
"sLink",
".=",
"(",
"(",
"strpos",
"(",
"$",
"sLink",
",",
"'?'",
")",
"!==",
"false",
")",
"?",
"'&'",
":",
"'?... | Appends urs with currently passed parameters
@param string $sLink url to add parameters
@param string $sParams parameters to add to url
@return string | [
"Appends",
"urs",
"with",
"currently",
"passed",
"parameters"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Locator.php#L377-L384 | train |
OXID-eSales/oxideshop_ce | source/Application/Component/Locator.php | Locator._findActPageNumber | protected function _findActPageNumber($iPageNr, $oIdList = null, $oArticle = null)
{
//page number
$iPageNr = (int) $iPageNr;
// maybe there is no page number passed, but we still can find the position in id's list
if (!$iPageNr && $oIdList && $oArticle) {
$iNrofCatArticles = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
$iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;
$sParentIdField = 'oxarticles__oxparentid';
$sArticleId = $oArticle->$sParentIdField->value ? $oArticle->$sParentIdField->value : $oArticle->getId();
$iPos = \OxidEsales\Eshop\Core\Registry::getUtils()->arrayStringSearch($sArticleId, $oIdList->arrayKeys());
$iPageNr = floor($iPos / $iNrofCatArticles);
}
return $iPageNr;
} | php | protected function _findActPageNumber($iPageNr, $oIdList = null, $oArticle = null)
{
//page number
$iPageNr = (int) $iPageNr;
// maybe there is no page number passed, but we still can find the position in id's list
if (!$iPageNr && $oIdList && $oArticle) {
$iNrofCatArticles = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
$iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;
$sParentIdField = 'oxarticles__oxparentid';
$sArticleId = $oArticle->$sParentIdField->value ? $oArticle->$sParentIdField->value : $oArticle->getId();
$iPos = \OxidEsales\Eshop\Core\Registry::getUtils()->arrayStringSearch($sArticleId, $oIdList->arrayKeys());
$iPageNr = floor($iPos / $iNrofCatArticles);
}
return $iPageNr;
} | [
"protected",
"function",
"_findActPageNumber",
"(",
"$",
"iPageNr",
",",
"$",
"oIdList",
"=",
"null",
",",
"$",
"oArticle",
"=",
"null",
")",
"{",
"//page number",
"$",
"iPageNr",
"=",
"(",
"int",
")",
"$",
"iPageNr",
";",
"// maybe there is no page number pas... | If page number is not passed trying to fetch it from list of ids. To search
for position in list, article ids list and current article id must be passed
@param int $iPageNr current page number (user defined or passed by request)
@param \OxidEsales\Eshop\Core\Model\ListModel $oIdList list of article ids (optional)
@param \OxidEsales\Eshop\Application\Model\Article $oArticle active article id (optional)
@return int | [
"If",
"page",
"number",
"is",
"not",
"passed",
"trying",
"to",
"fetch",
"it",
"from",
"list",
"of",
"ids",
".",
"To",
"search",
"for",
"position",
"in",
"list",
"article",
"ids",
"list",
"and",
"current",
"article",
"id",
"must",
"be",
"passed"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Component/Locator.php#L396-L412 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/ClearCookiesController.php | ClearCookiesController._removeCookies | protected function _removeCookies()
{
$oUtilsServer = \OxidEsales\Eshop\Core\Registry::getUtilsServer();
if (isset($_SERVER['HTTP_COOKIE'])) {
$aCookies = explode(';', $_SERVER['HTTP_COOKIE']);
foreach ($aCookies as $sCookie) {
$sRawCookie = explode('=', $sCookie);
$oUtilsServer->setOxCookie(trim($sRawCookie[0]), '', time() - 10000, '/');
}
}
$oUtilsServer->setOxCookie('language', '', time() - 10000, '/');
$oUtilsServer->setOxCookie('displayedCookiesNotification', '', time() - 10000, '/');
$this->dispatchEvent(new AllCookiesRemovedEvent());
} | php | protected function _removeCookies()
{
$oUtilsServer = \OxidEsales\Eshop\Core\Registry::getUtilsServer();
if (isset($_SERVER['HTTP_COOKIE'])) {
$aCookies = explode(';', $_SERVER['HTTP_COOKIE']);
foreach ($aCookies as $sCookie) {
$sRawCookie = explode('=', $sCookie);
$oUtilsServer->setOxCookie(trim($sRawCookie[0]), '', time() - 10000, '/');
}
}
$oUtilsServer->setOxCookie('language', '', time() - 10000, '/');
$oUtilsServer->setOxCookie('displayedCookiesNotification', '', time() - 10000, '/');
$this->dispatchEvent(new AllCookiesRemovedEvent());
} | [
"protected",
"function",
"_removeCookies",
"(",
")",
"{",
"$",
"oUtilsServer",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsServer",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'HTTP_COOKIE'",
"]"... | Clears all cookies | [
"Clears",
"all",
"cookies"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/ClearCookiesController.php#L42-L56 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/CategoryList.php | CategoryList.render | public function render()
{
parent::render();
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$iLang = $oLang->getTplLanguage();
// parent category tree
$oCatTree = oxNew(\OxidEsales\Eshop\Application\Model\CategoryList::class);
$oCatTree->loadList();
// add Root as fake category
// rebuild list as we need the root entry at the first position
$aNewList = [];
$oRoot = new stdClass();
$oRoot->oxcategories__oxid = new \OxidEsales\Eshop\Core\Field(null, \OxidEsales\Eshop\Core\Field::T_RAW);
$oRoot->oxcategories__oxtitle = new \OxidEsales\Eshop\Core\Field($oLang->translateString("viewAll", $iLang), \OxidEsales\Eshop\Core\Field::T_RAW);
$aNewList[] = $oRoot;
$oRoot = new stdClass();
$oRoot->oxcategories__oxid = new \OxidEsales\Eshop\Core\Field("oxrootid", \OxidEsales\Eshop\Core\Field::T_RAW);
$oRoot->oxcategories__oxtitle = new \OxidEsales\Eshop\Core\Field("-- " . $oLang->translateString("mainCategory", $iLang) . " --", \OxidEsales\Eshop\Core\Field::T_RAW);
$aNewList[] = $oRoot;
foreach ($oCatTree as $oCategory) {
$aNewList[] = $oCategory;
}
$oCatTree->assign($aNewList);
$aFilter = $this->getListFilter();
if (is_array($aFilter) && isset($aFilter["oxcategories"]["oxparentid"])) {
foreach ($oCatTree as $oCategory) {
if ($oCategory->oxcategories__oxid->value == $aFilter["oxcategories"]["oxparentid"]) {
$oCategory->selected = 1;
break;
}
}
}
$this->_aViewData["cattree"] = $oCatTree;
return "category_list.tpl";
} | php | public function render()
{
parent::render();
$oLang = \OxidEsales\Eshop\Core\Registry::getLang();
$iLang = $oLang->getTplLanguage();
// parent category tree
$oCatTree = oxNew(\OxidEsales\Eshop\Application\Model\CategoryList::class);
$oCatTree->loadList();
// add Root as fake category
// rebuild list as we need the root entry at the first position
$aNewList = [];
$oRoot = new stdClass();
$oRoot->oxcategories__oxid = new \OxidEsales\Eshop\Core\Field(null, \OxidEsales\Eshop\Core\Field::T_RAW);
$oRoot->oxcategories__oxtitle = new \OxidEsales\Eshop\Core\Field($oLang->translateString("viewAll", $iLang), \OxidEsales\Eshop\Core\Field::T_RAW);
$aNewList[] = $oRoot;
$oRoot = new stdClass();
$oRoot->oxcategories__oxid = new \OxidEsales\Eshop\Core\Field("oxrootid", \OxidEsales\Eshop\Core\Field::T_RAW);
$oRoot->oxcategories__oxtitle = new \OxidEsales\Eshop\Core\Field("-- " . $oLang->translateString("mainCategory", $iLang) . " --", \OxidEsales\Eshop\Core\Field::T_RAW);
$aNewList[] = $oRoot;
foreach ($oCatTree as $oCategory) {
$aNewList[] = $oCategory;
}
$oCatTree->assign($aNewList);
$aFilter = $this->getListFilter();
if (is_array($aFilter) && isset($aFilter["oxcategories"]["oxparentid"])) {
foreach ($oCatTree as $oCategory) {
if ($oCategory->oxcategories__oxid->value == $aFilter["oxcategories"]["oxparentid"]) {
$oCategory->selected = 1;
break;
}
}
}
$this->_aViewData["cattree"] = $oCatTree;
return "category_list.tpl";
} | [
"public",
"function",
"render",
"(",
")",
"{",
"parent",
"::",
"render",
"(",
")",
";",
"$",
"oLang",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getLang",
"(",
")",
";",
"$",
"iLang",
"=",
"$",
"oLang",
"->",
"ge... | Loads category tree, passes data to Smarty and returns name of
template file "category_list.tpl".
@return string | [
"Loads",
"category",
"tree",
"passes",
"data",
"to",
"Smarty",
"and",
"returns",
"name",
"of",
"template",
"file",
"category_list",
".",
"tpl",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/CategoryList.php#L61-L103 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Country.php | Country.isForeignCountry | public function isForeignCountry()
{
return !in_array($this->getId(), \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aHomeCountry'));
} | php | public function isForeignCountry()
{
return !in_array($this->getId(), \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aHomeCountry'));
} | [
"public",
"function",
"isForeignCountry",
"(",
")",
"{",
"return",
"!",
"in_array",
"(",
"$",
"this",
"->",
"getId",
"(",
")",
",",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(... | returns true if this country is a foreign country
@return bool | [
"returns",
"true",
"if",
"this",
"country",
"is",
"a",
"foreign",
"country"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Country.php#L45-L48 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Country.php | Country.getStates | public function getStates()
{
if (!is_null($this->_aStates)) {
return $this->_aStates;
}
$sCountryId = $this->getId();
$sViewName = getViewName("oxstates", $this->getLanguage());
$sQ = "select * from {$sViewName} where `oxcountryid` = '$sCountryId' order by `oxtitle` ";
$this->_aStates = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$this->_aStates->init("oxstate");
$this->_aStates->selectString($sQ);
return $this->_aStates;
} | php | public function getStates()
{
if (!is_null($this->_aStates)) {
return $this->_aStates;
}
$sCountryId = $this->getId();
$sViewName = getViewName("oxstates", $this->getLanguage());
$sQ = "select * from {$sViewName} where `oxcountryid` = '$sCountryId' order by `oxtitle` ";
$this->_aStates = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
$this->_aStates->init("oxstate");
$this->_aStates->selectString($sQ);
return $this->_aStates;
} | [
"public",
"function",
"getStates",
"(",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"_aStates",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_aStates",
";",
"}",
"$",
"sCountryId",
"=",
"$",
"this",
"->",
"getId",
"(",
")",
";",
... | Returns current state list
@return array | [
"Returns",
"current",
"state",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Country.php#L65-L79 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/Country.php | Country.getIdByCode | public function getIdByCode($sCode)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
return $oDb->getOne("select oxid from oxcountry where oxisoalpha2 = " . $oDb->quote($sCode));
} | php | public function getIdByCode($sCode)
{
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
return $oDb->getOne("select oxid from oxcountry where oxisoalpha2 = " . $oDb->quote($sCode));
} | [
"public",
"function",
"getIdByCode",
"(",
"$",
"sCode",
")",
"{",
"$",
"oDb",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DatabaseProvider",
"::",
"getDb",
"(",
")",
";",
"return",
"$",
"oDb",
"->",
"getOne",
"(",
"\"select oxid from oxcou... | Returns country id by code
@param string $sCode country code
@return string | [
"Returns",
"country",
"id",
"by",
"code"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/Country.php#L88-L93 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/DeliverySetGroupsAjax.php | DeliverySetGroupsAjax.addGroupToSet | public function addGroupToSet()
{
$aChosenCat = $this->_getActionIds('oxgroups.oxid');
$soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');
// adding
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
$sGroupTable = $this->_getViewName('oxgroups');
$aChosenCat = $this->_getAll($this->_addFilter("select $sGroupTable.oxid " . $this->_getQuery()));
}
if ($soxId && $soxId != "-1" && is_array($aChosenCat)) {
foreach ($aChosenCat as $sChosenCat) {
$oObject2Delivery = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
$oObject2Delivery->init('oxobject2delivery');
$oObject2Delivery->oxobject2delivery__oxdeliveryid = new \OxidEsales\Eshop\Core\Field($soxId);
$oObject2Delivery->oxobject2delivery__oxobjectid = new \OxidEsales\Eshop\Core\Field($sChosenCat);
$oObject2Delivery->oxobject2delivery__oxtype = new \OxidEsales\Eshop\Core\Field("oxdelsetg");
$oObject2Delivery->save();
}
}
} | php | public function addGroupToSet()
{
$aChosenCat = $this->_getActionIds('oxgroups.oxid');
$soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');
// adding
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
$sGroupTable = $this->_getViewName('oxgroups');
$aChosenCat = $this->_getAll($this->_addFilter("select $sGroupTable.oxid " . $this->_getQuery()));
}
if ($soxId && $soxId != "-1" && is_array($aChosenCat)) {
foreach ($aChosenCat as $sChosenCat) {
$oObject2Delivery = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
$oObject2Delivery->init('oxobject2delivery');
$oObject2Delivery->oxobject2delivery__oxdeliveryid = new \OxidEsales\Eshop\Core\Field($soxId);
$oObject2Delivery->oxobject2delivery__oxobjectid = new \OxidEsales\Eshop\Core\Field($sChosenCat);
$oObject2Delivery->oxobject2delivery__oxtype = new \OxidEsales\Eshop\Core\Field("oxdelsetg");
$oObject2Delivery->save();
}
}
} | [
"public",
"function",
"addGroupToSet",
"(",
")",
"{",
"$",
"aChosenCat",
"=",
"$",
"this",
"->",
"_getActionIds",
"(",
"'oxgroups.oxid'",
")",
";",
"$",
"soxId",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"("... | Adds user group to delivery sets config | [
"Adds",
"user",
"group",
"to",
"delivery",
"sets",
"config"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/DeliverySetGroupsAjax.php#L87-L107 | train |
OXID-eSales/oxideshop_ce | source/Internal/Application/ContainerFactory.php | ContainerFactory.initializeContainer | private function initializeContainer()
{
$cacheFilePath = $this::getCacheFilePath();
if (file_exists($cacheFilePath)) {
$this->loadContainerFromCache($cacheFilePath);
} else {
$this->getCompiledSymfonyContainer();
$this->saveContainerToCache($cacheFilePath);
}
} | php | private function initializeContainer()
{
$cacheFilePath = $this::getCacheFilePath();
if (file_exists($cacheFilePath)) {
$this->loadContainerFromCache($cacheFilePath);
} else {
$this->getCompiledSymfonyContainer();
$this->saveContainerToCache($cacheFilePath);
}
} | [
"private",
"function",
"initializeContainer",
"(",
")",
"{",
"$",
"cacheFilePath",
"=",
"$",
"this",
"::",
"getCacheFilePath",
"(",
")",
";",
"if",
"(",
"file_exists",
"(",
"$",
"cacheFilePath",
")",
")",
"{",
"$",
"this",
"->",
"loadContainerFromCache",
"("... | Loads container from cache if available, otherwise
create the container from scratch. | [
"Loads",
"container",
"from",
"cache",
"if",
"available",
"otherwise",
"create",
"the",
"container",
"from",
"scratch",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Application/ContainerFactory.php#L54-L64 | train |
OXID-eSales/oxideshop_ce | source/Internal/Application/ContainerFactory.php | ContainerFactory.getCompiledSymfonyContainer | private function getCompiledSymfonyContainer()
{
$containerBuilder = (new ContainerBuilderFactory())->create();
$this->symfonyContainer = $containerBuilder->getContainer();
$this->symfonyContainer->compile();
} | php | private function getCompiledSymfonyContainer()
{
$containerBuilder = (new ContainerBuilderFactory())->create();
$this->symfonyContainer = $containerBuilder->getContainer();
$this->symfonyContainer->compile();
} | [
"private",
"function",
"getCompiledSymfonyContainer",
"(",
")",
"{",
"$",
"containerBuilder",
"=",
"(",
"new",
"ContainerBuilderFactory",
"(",
")",
")",
"->",
"create",
"(",
")",
";",
"$",
"this",
"->",
"symfonyContainer",
"=",
"$",
"containerBuilder",
"->",
"... | Returns compiled Container | [
"Returns",
"compiled",
"Container"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Application/ContainerFactory.php#L78-L83 | train |
OXID-eSales/oxideshop_ce | source/Internal/Application/ContainerFactory.php | ContainerFactory.saveContainerToCache | private function saveContainerToCache($cachefile)
{
$dumper = new PhpDumper($this->symfonyContainer);
file_put_contents($cachefile, $dumper->dump());
} | php | private function saveContainerToCache($cachefile)
{
$dumper = new PhpDumper($this->symfonyContainer);
file_put_contents($cachefile, $dumper->dump());
} | [
"private",
"function",
"saveContainerToCache",
"(",
"$",
"cachefile",
")",
"{",
"$",
"dumper",
"=",
"new",
"PhpDumper",
"(",
"$",
"this",
"->",
"symfonyContainer",
")",
";",
"file_put_contents",
"(",
"$",
"cachefile",
",",
"$",
"dumper",
"->",
"dump",
"(",
... | Dumps the compiled container to the cachefile.
@param string $cachefile | [
"Dumps",
"the",
"compiled",
"container",
"to",
"the",
"cachefile",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Application/ContainerFactory.php#L90-L94 | train |
OXID-eSales/oxideshop_ce | source/Internal/Application/ContainerFactory.php | ContainerFactory.resetContainer | public static function resetContainer()
{
if (file_exists(self::getCacheFilePath())) {
unlink(self::getCacheFilePath());
}
self::$instance = null;
} | php | public static function resetContainer()
{
if (file_exists(self::getCacheFilePath())) {
unlink(self::getCacheFilePath());
}
self::$instance = null;
} | [
"public",
"static",
"function",
"resetContainer",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"self",
"::",
"getCacheFilePath",
"(",
")",
")",
")",
"{",
"unlink",
"(",
"self",
"::",
"getCacheFilePath",
"(",
")",
")",
";",
"}",
"self",
"::",
"$",
"ins... | Forces reload of the ContainerFactory on next request. | [
"Forces",
"reload",
"of",
"the",
"ContainerFactory",
"on",
"next",
"request",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Application/ContainerFactory.php#L121-L127 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/UserRemark.php | UserRemark.delete | public function delete()
{
$oRemark = oxNew(\OxidEsales\Eshop\Application\Model\Remark::class);
$oRemark->delete(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("rem_oxid"));
} | php | public function delete()
{
$oRemark = oxNew(\OxidEsales\Eshop\Application\Model\Remark::class);
$oRemark->delete(\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("rem_oxid"));
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"$",
"oRemark",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Application",
"\\",
"Model",
"\\",
"Remark",
"::",
"class",
")",
";",
"$",
"oRemark",
"->",
"delete",
"(",
"\\",
"OxidEsales",
"... | Deletes user actions history record. | [
"Deletes",
"user",
"actions",
"history",
"record",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/UserRemark.php#L88-L92 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineLicenseCheck.php | OnlineLicenseCheck.validateNewSerial | public function validateNewSerial($serial)
{
$serials = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam("aSerials");
$serials[] = ['attributes' => ['state' => 'new'], 'value' => $serial];
return $this->validate($serials);
} | php | public function validateNewSerial($serial)
{
$serials = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam("aSerials");
$serials[] = ['attributes' => ['state' => 'new'], 'value' => $serial];
return $this->validate($serials);
} | [
"public",
"function",
"validateNewSerial",
"(",
"$",
"serial",
")",
"{",
"$",
"serials",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
"->",
"getConfigParam",
"(",
"\"aSerials\"",
")",
";",
"$",
"seria... | The Online shop license check for the new serial is performed. Returns check result.
@param string $serial Serial to check.
@return bool | [
"The",
"Online",
"shop",
"license",
"check",
"for",
"the",
"new",
"serial",
"is",
"performed",
".",
"Returns",
"check",
"result",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineLicenseCheck.php#L167-L173 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineLicenseCheck.php | OnlineLicenseCheck.validate | public function validate($serials)
{
$serials = (array)$serials;
$this->setIsException(false);
$result = false;
try {
$request = $this->formRequest($serials);
$caller = $this->getCaller();
$response = $caller->doRequest($request);
$result = $this->validateResponse($response);
if ($result) {
$this->logSuccess();
}
} catch (\OxidEsales\Eshop\Core\Exception\StandardException $ex) {
$this->setErrorMessage($ex->getMessage());
$this->setIsException(true);
}
return $result;
} | php | public function validate($serials)
{
$serials = (array)$serials;
$this->setIsException(false);
$result = false;
try {
$request = $this->formRequest($serials);
$caller = $this->getCaller();
$response = $caller->doRequest($request);
$result = $this->validateResponse($response);
if ($result) {
$this->logSuccess();
}
} catch (\OxidEsales\Eshop\Core\Exception\StandardException $ex) {
$this->setErrorMessage($ex->getMessage());
$this->setIsException(true);
}
return $result;
} | [
"public",
"function",
"validate",
"(",
"$",
"serials",
")",
"{",
"$",
"serials",
"=",
"(",
"array",
")",
"$",
"serials",
";",
"$",
"this",
"->",
"setIsException",
"(",
"false",
")",
";",
"$",
"result",
"=",
"false",
";",
"try",
"{",
"$",
"request",
... | The Online shop license check is performed. Returns check result.
@param array $serials Serial keys to be checked.
@return bool | [
"The",
"Online",
"shop",
"license",
"check",
"is",
"performed",
".",
"Returns",
"check",
"result",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineLicenseCheck.php#L182-L205 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineLicenseCheck.php | OnlineLicenseCheck.validateResponse | protected function validateResponse($response)
{
if (isset($response->code) && isset($response->message)) {
if ($response->code == $this->validResponseCode &&
$response->message == $this->validResponseMessage
) {
// serial keys are valid
$valid = true;
} else {
// serial keys are not valid
$this->setErrorMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('OLC_ERROR_SERIAL_NOT_VALID'));
$valid = false;
}
} else {
// validation result is unknown
throw new \OxidEsales\Eshop\Core\Exception\StandardException('OLC_ERROR_RESPONSE_NOT_VALID');
}
return $valid;
} | php | protected function validateResponse($response)
{
if (isset($response->code) && isset($response->message)) {
if ($response->code == $this->validResponseCode &&
$response->message == $this->validResponseMessage
) {
// serial keys are valid
$valid = true;
} else {
// serial keys are not valid
$this->setErrorMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('OLC_ERROR_SERIAL_NOT_VALID'));
$valid = false;
}
} else {
// validation result is unknown
throw new \OxidEsales\Eshop\Core\Exception\StandardException('OLC_ERROR_RESPONSE_NOT_VALID');
}
return $valid;
} | [
"protected",
"function",
"validateResponse",
"(",
"$",
"response",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"response",
"->",
"code",
")",
"&&",
"isset",
"(",
"$",
"response",
"->",
"message",
")",
")",
"{",
"if",
"(",
"$",
"response",
"->",
"code",
"... | Performs a check of the response code and message.
@param \OxidEsales\Eshop\Core\OnlineLicenseCheckResponse $response
@throws \OxidEsales\Eshop\Core\Exception\StandardException
@return bool | [
"Performs",
"a",
"check",
"of",
"the",
"response",
"code",
"and",
"message",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineLicenseCheck.php#L236-L255 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineLicenseCheck.php | OnlineLicenseCheck.formRequest | protected function formRequest($serials)
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
/** @var \OxidEsales\Eshop\Core\OnlineLicenseCheckRequest $request */
$request = oxNew(\OxidEsales\Eshop\Core\OnlineLicenseCheckRequest::class);
$request->keys = ['key' => $serials];
$request->productSpecificInformation = new stdClass();
if (!is_null($this->getAppServerExporter())) {
$servers = $this->getAppServerExporter()->exportAppServerList();
$request->productSpecificInformation->servers = ['server' => $servers];
}
$counters = $this->formCounters();
if (!empty($counters)) {
$request->productSpecificInformation->counters = ['counter' => $counters];
}
return $request;
} | php | protected function formRequest($serials)
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
/** @var \OxidEsales\Eshop\Core\OnlineLicenseCheckRequest $request */
$request = oxNew(\OxidEsales\Eshop\Core\OnlineLicenseCheckRequest::class);
$request->keys = ['key' => $serials];
$request->productSpecificInformation = new stdClass();
if (!is_null($this->getAppServerExporter())) {
$servers = $this->getAppServerExporter()->exportAppServerList();
$request->productSpecificInformation->servers = ['server' => $servers];
}
$counters = $this->formCounters();
if (!empty($counters)) {
$request->productSpecificInformation->counters = ['counter' => $counters];
}
return $request;
} | [
"protected",
"function",
"formRequest",
"(",
"$",
"serials",
")",
"{",
"$",
"config",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"/** @var \\OxidEsales\\Eshop\\Core\\OnlineLicenseCheckRequest $request */",... | Builds request object with required parameters.
@param array $serials Array of serials to add to request.
@return \OxidEsales\Eshop\Core\OnlineLicenseCheckRequest | [
"Builds",
"request",
"object",
"with",
"required",
"parameters",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineLicenseCheck.php#L264-L286 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineLicenseCheck.php | OnlineLicenseCheck.formCounters | protected function formCounters()
{
$userCounter = $this->getUserCounter();
$counters = [];
if (!is_null($this->getUserCounter())) {
$counters[] = [
'name' => 'admin users',
'value' => $userCounter->getAdminCount(),
];
$counters[] = [
'name' => 'active admin users',
'value' => $userCounter->getActiveAdminCount(),
];
}
$counters[] = [
'name' => 'subShops',
'value' => \OxidEsales\Eshop\Core\Registry::getConfig()->getMandateCount(),
];
return $counters;
} | php | protected function formCounters()
{
$userCounter = $this->getUserCounter();
$counters = [];
if (!is_null($this->getUserCounter())) {
$counters[] = [
'name' => 'admin users',
'value' => $userCounter->getAdminCount(),
];
$counters[] = [
'name' => 'active admin users',
'value' => $userCounter->getActiveAdminCount(),
];
}
$counters[] = [
'name' => 'subShops',
'value' => \OxidEsales\Eshop\Core\Registry::getConfig()->getMandateCount(),
];
return $counters;
} | [
"protected",
"function",
"formCounters",
"(",
")",
"{",
"$",
"userCounter",
"=",
"$",
"this",
"->",
"getUserCounter",
"(",
")",
";",
"$",
"counters",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"getUserCounter",
"(",
")",
"... | Forms shop counters array for sending to OXID server.
@return array | [
"Forms",
"shop",
"counters",
"array",
"for",
"sending",
"to",
"OXID",
"server",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineLicenseCheck.php#L293-L316 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineLicenseCheck.php | OnlineLicenseCheck.logSuccess | protected function logSuccess()
{
$time = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$baseShop = \OxidEsales\Eshop\Core\Registry::getConfig()->getBaseShopId();
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar(
"str",
\OxidEsales\Eshop\Core\OnlineLicenseCheck::CONFIG_VAR_NAME,
$time,
$baseShop
);
} | php | protected function logSuccess()
{
$time = \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime();
$baseShop = \OxidEsales\Eshop\Core\Registry::getConfig()->getBaseShopId();
\OxidEsales\Eshop\Core\Registry::getConfig()->saveShopConfVar(
"str",
\OxidEsales\Eshop\Core\OnlineLicenseCheck::CONFIG_VAR_NAME,
$time,
$baseShop
);
} | [
"protected",
"function",
"logSuccess",
"(",
")",
"{",
"$",
"time",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getUtilsDate",
"(",
")",
"->",
"getTime",
"(",
")",
";",
"$",
"baseShop",
"=",
"\\",
"OxidEsales",
"\\",
"... | Registers the latest Successful Online License check. | [
"Registers",
"the",
"latest",
"Successful",
"Online",
"License",
"check",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineLicenseCheck.php#L321-L331 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/PriceAlarmMain.php | PriceAlarmMain.send | public function send()
{
$blError = true;
// error
if (($sOxid = $this->getEditObjectId())) {
$oPricealarm = oxNew(\OxidEsales\Eshop\Application\Model\PriceAlarm::class);
$oPricealarm->load($sOxid);
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
$sMailBody = isset($aParams['oxpricealarm__oxlongdesc']) ? stripslashes($aParams['oxpricealarm__oxlongdesc']) : '';
if ($sMailBody) {
$sMailBody = \OxidEsales\Eshop\Core\Registry::getUtilsView()->parseThroughSmarty($sMailBody, $oPricealarm->getId());
}
$sRecipient = $oPricealarm->oxpricealarm__oxemail->value;
$oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
$blSuccess = (int) $oEmail->sendPricealarmToCustomer($sRecipient, $oPricealarm, $sMailBody);
// setting result message
if ($blSuccess) {
$oPricealarm->oxpricealarm__oxsended->setValue(date("Y-m-d H:i:s"));
$oPricealarm->save();
$blError = false;
}
}
if (!$blError) {
$this->_aViewData["mail_succ"] = 1;
} else {
$this->_aViewData["mail_err"] = 1;
}
} | php | public function send()
{
$blError = true;
// error
if (($sOxid = $this->getEditObjectId())) {
$oPricealarm = oxNew(\OxidEsales\Eshop\Application\Model\PriceAlarm::class);
$oPricealarm->load($sOxid);
$aParams = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("editval");
$sMailBody = isset($aParams['oxpricealarm__oxlongdesc']) ? stripslashes($aParams['oxpricealarm__oxlongdesc']) : '';
if ($sMailBody) {
$sMailBody = \OxidEsales\Eshop\Core\Registry::getUtilsView()->parseThroughSmarty($sMailBody, $oPricealarm->getId());
}
$sRecipient = $oPricealarm->oxpricealarm__oxemail->value;
$oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);
$blSuccess = (int) $oEmail->sendPricealarmToCustomer($sRecipient, $oPricealarm, $sMailBody);
// setting result message
if ($blSuccess) {
$oPricealarm->oxpricealarm__oxsended->setValue(date("Y-m-d H:i:s"));
$oPricealarm->save();
$blError = false;
}
}
if (!$blError) {
$this->_aViewData["mail_succ"] = 1;
} else {
$this->_aViewData["mail_err"] = 1;
}
} | [
"public",
"function",
"send",
"(",
")",
"{",
"$",
"blError",
"=",
"true",
";",
"// error",
"if",
"(",
"(",
"$",
"sOxid",
"=",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
")",
")",
"{",
"$",
"oPricealarm",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
... | Sending email to selected customer | [
"Sending",
"email",
"to",
"selected",
"customer"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/PriceAlarmMain.php#L88-L121 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/PriceAlarmMain.php | PriceAlarmMain.getActivePriceAlarmsCount | protected function getActivePriceAlarmsCount()
{
// #1140 R - price must be checked from the object.
$query = "
SELECT oxarticles.oxid, oxpricealarm.oxprice
FROM oxpricealarm, oxarticles
WHERE oxarticles.oxid = oxpricealarm.oxartid AND oxpricealarm.oxsended = '000-00-00 00:00:00'";
$result = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->select($query);
$count = 0;
if ($result != false && $result->count() > 0) {
while (!$result->EOF) {
$article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$article->load($result->fields[0]);
if ($article->getPrice()->getBruttoPrice() <= $result->fields[1]) {
$count++;
}
$result->fetchRow();
}
}
return $count;
} | php | protected function getActivePriceAlarmsCount()
{
// #1140 R - price must be checked from the object.
$query = "
SELECT oxarticles.oxid, oxpricealarm.oxprice
FROM oxpricealarm, oxarticles
WHERE oxarticles.oxid = oxpricealarm.oxartid AND oxpricealarm.oxsended = '000-00-00 00:00:00'";
$result = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->select($query);
$count = 0;
if ($result != false && $result->count() > 0) {
while (!$result->EOF) {
$article = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
$article->load($result->fields[0]);
if ($article->getPrice()->getBruttoPrice() <= $result->fields[1]) {
$count++;
}
$result->fetchRow();
}
}
return $count;
} | [
"protected",
"function",
"getActivePriceAlarmsCount",
"(",
")",
"{",
"// #1140 R - price must be checked from the object.",
"$",
"query",
"=",
"\"\n SELECT oxarticles.oxid, oxpricealarm.oxprice\n FROM oxpricealarm, oxarticles\n WHERE oxarticles.oxid = oxpricealar... | Returns number of active price alarms.
@return int | [
"Returns",
"number",
"of",
"active",
"price",
"alarms",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/PriceAlarmMain.php#L128-L150 | train |
OXID-eSales/oxideshop_ce | source/Core/PasswordSaltGenerator.php | PasswordSaltGenerator.generate | public function generate()
{
if ($this->_getOpenSSLFunctionalityChecker()->isOpenSslRandomBytesGeneratorAvailable()) {
$sSalt = bin2hex(openssl_random_pseudo_bytes(16));
} else {
$sSalt = $this->_customSaltGenerator();
}
return $sSalt;
} | php | public function generate()
{
if ($this->_getOpenSSLFunctionalityChecker()->isOpenSslRandomBytesGeneratorAvailable()) {
$sSalt = bin2hex(openssl_random_pseudo_bytes(16));
} else {
$sSalt = $this->_customSaltGenerator();
}
return $sSalt;
} | [
"public",
"function",
"generate",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_getOpenSSLFunctionalityChecker",
"(",
")",
"->",
"isOpenSslRandomBytesGeneratorAvailable",
"(",
")",
")",
"{",
"$",
"sSalt",
"=",
"bin2hex",
"(",
"openssl_random_pseudo_bytes",
"(",
... | Generates salt. If openssl_random_pseudo_bytes function is not available,
than fallback to custom salt generator.
@return string | [
"Generates",
"salt",
".",
"If",
"openssl_random_pseudo_bytes",
"function",
"is",
"not",
"available",
"than",
"fallback",
"to",
"custom",
"salt",
"generator",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PasswordSaltGenerator.php#L37-L46 | train |
OXID-eSales/oxideshop_ce | source/Core/PasswordSaltGenerator.php | PasswordSaltGenerator._customSaltGenerator | protected function _customSaltGenerator()
{
$sHash = '';
$sSalt = '';
for ($i = 0; $i < 32; $i++) {
$sHash = hash('sha256', $sHash . mt_rand());
$iPosition = mt_rand(0, 62);
$sSalt .= $sHash[$iPosition];
}
return $sSalt;
} | php | protected function _customSaltGenerator()
{
$sHash = '';
$sSalt = '';
for ($i = 0; $i < 32; $i++) {
$sHash = hash('sha256', $sHash . mt_rand());
$iPosition = mt_rand(0, 62);
$sSalt .= $sHash[$iPosition];
}
return $sSalt;
} | [
"protected",
"function",
"_customSaltGenerator",
"(",
")",
"{",
"$",
"sHash",
"=",
"''",
";",
"$",
"sSalt",
"=",
"''",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"32",
";",
"$",
"i",
"++",
")",
"{",
"$",
"sHash",
"=",
"hash",
"(... | Generates custom salt.
@return string | [
"Generates",
"custom",
"salt",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/PasswordSaltGenerator.php#L63-L74 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/ActionList.php | ActionList.loadCurrent | public function loadCurrent()
{
$sViewName = $this->getBaseObject()->getViewName();
$sDate = date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime());
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = "select * from {$sViewName} where oxtype=2 and oxactive=1 and oxshopid='" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . "' and (oxactiveto > " . $oDb->quote($sDate) . " or oxactiveto=0) and oxactivefrom != 0 and oxactivefrom < " . $oDb->quote($sDate) . "
" . $this->_getUserGroupFilter() . "
order by oxactiveto, oxactivefrom";
$this->selectString($sQ);
} | php | public function loadCurrent()
{
$sViewName = $this->getBaseObject()->getViewName();
$sDate = date('Y-m-d H:i:s', \OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime());
$oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
$sQ = "select * from {$sViewName} where oxtype=2 and oxactive=1 and oxshopid='" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . "' and (oxactiveto > " . $oDb->quote($sDate) . " or oxactiveto=0) and oxactivefrom != 0 and oxactivefrom < " . $oDb->quote($sDate) . "
" . $this->_getUserGroupFilter() . "
order by oxactiveto, oxactivefrom";
$this->selectString($sQ);
} | [
"public",
"function",
"loadCurrent",
"(",
")",
"{",
"$",
"sViewName",
"=",
"$",
"this",
"->",
"getBaseObject",
"(",
")",
"->",
"getViewName",
"(",
")",
";",
"$",
"sDate",
"=",
"date",
"(",
"'Y-m-d H:i:s'",
",",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
... | Loads current promotions | [
"Loads",
"current",
"promotions"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/ActionList.php#L63-L72 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/ActionList.php | ActionList._getUserGroupFilter | protected function _getUserGroupFilter($oUser = null)
{
$oUser = ($oUser == null) ? $this->getUser() : $oUser;
$sTable = getViewName('oxactions');
$sGroupTable = getViewName('oxgroups');
$aIds = [];
// checking for current session user which gives additional restrictions for user itself, users group and country
if ($oUser && count($aGroupIds = $oUser->getUserGroups())) {
foreach ($aGroupIds as $oGroup) {
$aIds[] = $oGroup->getId();
}
}
$sGroupSql = count($aIds) ? "EXISTS(select oxobject2action.oxid from oxobject2action where oxobject2action.oxactionid=$sTable.OXID and oxobject2action.oxclass='oxgroups' and oxobject2action.OXOBJECTID in (" . implode(', ', \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aIds)) . ") )" : '0';
return " and (
select
if(EXISTS(select 1 from oxobject2action, $sGroupTable where $sGroupTable.oxid=oxobject2action.oxobjectid and oxobject2action.oxactionid=$sTable.OXID and oxobject2action.oxclass='oxgroups' LIMIT 1),
$sGroupSql,
1)
) ";
} | php | protected function _getUserGroupFilter($oUser = null)
{
$oUser = ($oUser == null) ? $this->getUser() : $oUser;
$sTable = getViewName('oxactions');
$sGroupTable = getViewName('oxgroups');
$aIds = [];
// checking for current session user which gives additional restrictions for user itself, users group and country
if ($oUser && count($aGroupIds = $oUser->getUserGroups())) {
foreach ($aGroupIds as $oGroup) {
$aIds[] = $oGroup->getId();
}
}
$sGroupSql = count($aIds) ? "EXISTS(select oxobject2action.oxid from oxobject2action where oxobject2action.oxactionid=$sTable.OXID and oxobject2action.oxclass='oxgroups' and oxobject2action.OXOBJECTID in (" . implode(', ', \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aIds)) . ") )" : '0';
return " and (
select
if(EXISTS(select 1 from oxobject2action, $sGroupTable where $sGroupTable.oxid=oxobject2action.oxobjectid and oxobject2action.oxactionid=$sTable.OXID and oxobject2action.oxclass='oxgroups' LIMIT 1),
$sGroupSql,
1)
) ";
} | [
"protected",
"function",
"_getUserGroupFilter",
"(",
"$",
"oUser",
"=",
"null",
")",
"{",
"$",
"oUser",
"=",
"(",
"$",
"oUser",
"==",
"null",
")",
"?",
"$",
"this",
"->",
"getUser",
"(",
")",
":",
"$",
"oUser",
";",
"$",
"sTable",
"=",
"getViewName",... | Returns part of user group filter query
@param \OxidEsales\Eshop\Application\Model\User $oUser user object
@return string | [
"Returns",
"part",
"of",
"user",
"group",
"filter",
"query"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/ActionList.php#L114-L135 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/ActionList.php | ActionList.fetchExistsActivePromotion | protected function fetchExistsActivePromotion()
{
$query = "select 1 from " . getViewName('oxactions') . " where oxtype=2 and oxactive=1 and oxshopid='" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . "' limit 1";
return \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($query);
} | php | protected function fetchExistsActivePromotion()
{
$query = "select 1 from " . getViewName('oxactions') . " where oxtype=2 and oxactive=1 and oxshopid='" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . "' limit 1";
return \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getOne($query);
} | [
"protected",
"function",
"fetchExistsActivePromotion",
"(",
")",
"{",
"$",
"query",
"=",
"\"select 1 from \"",
".",
"getViewName",
"(",
"'oxactions'",
")",
".",
"\" where oxtype=2 and oxactive=1 and oxshopid='\"",
".",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
... | Fetch the information, if there is an active promotion.
@return string One, if there is an active promotion. | [
"Fetch",
"the",
"information",
"if",
"there",
"is",
"an",
"active",
"promotion",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/ActionList.php#L153-L158 | train |
OXID-eSales/oxideshop_ce | source/Application/Model/ActionList.php | ActionList.loadBanners | public function loadBanners()
{
$oBaseObject = $this->getBaseObject();
$oViewName = $oBaseObject->getViewName();
$sQ = "select * from {$oViewName} where oxtype=3 and " . $oBaseObject->getSqlActiveSnippet()
. " and oxshopid='" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . "' " . $this->_getUserGroupFilter()
. " order by oxsort";
$this->selectString($sQ);
} | php | public function loadBanners()
{
$oBaseObject = $this->getBaseObject();
$oViewName = $oBaseObject->getViewName();
$sQ = "select * from {$oViewName} where oxtype=3 and " . $oBaseObject->getSqlActiveSnippet()
. " and oxshopid='" . \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId() . "' " . $this->_getUserGroupFilter()
. " order by oxsort";
$this->selectString($sQ);
} | [
"public",
"function",
"loadBanners",
"(",
")",
"{",
"$",
"oBaseObject",
"=",
"$",
"this",
"->",
"getBaseObject",
"(",
")",
";",
"$",
"oViewName",
"=",
"$",
"oBaseObject",
"->",
"getViewName",
"(",
")",
";",
"$",
"sQ",
"=",
"\"select * from {$oViewName} where... | load active shop banner list | [
"load",
"active",
"shop",
"banner",
"list"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Model/ActionList.php#L163-L171 | train |
OXID-eSales/oxideshop_ce | source/Core/Dao/ApplicationServerDao.php | ApplicationServerDao.findAll | public function findAll()
{
$appServerList = [];
/** @var \OxidEsales\Eshop\Core\Database\Adapter\ResultSetInterface $resultList */
$resultList = $this->selectAllData();
if ($resultList != false && $resultList->count() > 0) {
$result = $resultList->getFields();
$serverId = $this->getServerIdFromConfig($result['oxvarname']);
$information = $this->getValueFromConfig($result['oxvarvalue']);
$appServerList[$serverId] = $this->createServer($information);
while ($result = $resultList->fetchRow()) {
$serverId = $this->getServerIdFromConfig($result['oxvarname']);
$information = $this->getValueFromConfig($result['oxvarvalue']);
$appServerList[$serverId] = $this->createServer($information);
}
}
return $appServerList;
} | php | public function findAll()
{
$appServerList = [];
/** @var \OxidEsales\Eshop\Core\Database\Adapter\ResultSetInterface $resultList */
$resultList = $this->selectAllData();
if ($resultList != false && $resultList->count() > 0) {
$result = $resultList->getFields();
$serverId = $this->getServerIdFromConfig($result['oxvarname']);
$information = $this->getValueFromConfig($result['oxvarvalue']);
$appServerList[$serverId] = $this->createServer($information);
while ($result = $resultList->fetchRow()) {
$serverId = $this->getServerIdFromConfig($result['oxvarname']);
$information = $this->getValueFromConfig($result['oxvarvalue']);
$appServerList[$serverId] = $this->createServer($information);
}
}
return $appServerList;
} | [
"public",
"function",
"findAll",
"(",
")",
"{",
"$",
"appServerList",
"=",
"[",
"]",
";",
"/** @var \\OxidEsales\\Eshop\\Core\\Database\\Adapter\\ResultSetInterface $resultList */",
"$",
"resultList",
"=",
"$",
"this",
"->",
"selectAllData",
"(",
")",
";",
"if",
"(",
... | Finds all application servers.
@return array | [
"Finds",
"all",
"application",
"servers",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Dao/ApplicationServerDao.php#L54-L72 | train |
OXID-eSales/oxideshop_ce | source/Core/Dao/ApplicationServerDao.php | ApplicationServerDao.delete | public function delete($id)
{
unset($this->appServer[$id]);
$query = "DELETE FROM oxconfig WHERE oxvarname = ? and oxshopid = ?";
$parameter = [
self::CONFIG_NAME_FOR_SERVER_INFO.$id,
$this->config->getBaseShopId()
];
$this->database->execute($query, $parameter);
} | php | public function delete($id)
{
unset($this->appServer[$id]);
$query = "DELETE FROM oxconfig WHERE oxvarname = ? and oxshopid = ?";
$parameter = [
self::CONFIG_NAME_FOR_SERVER_INFO.$id,
$this->config->getBaseShopId()
];
$this->database->execute($query, $parameter);
} | [
"public",
"function",
"delete",
"(",
"$",
"id",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"appServer",
"[",
"$",
"id",
"]",
")",
";",
"$",
"query",
"=",
"\"DELETE FROM oxconfig WHERE oxvarname = ? and oxshopid = ?\"",
";",
"$",
"parameter",
"=",
"[",
"self"... | Deletes the entity with the given id.
@param string $id An id of the entity to delete. | [
"Deletes",
"the",
"entity",
"with",
"the",
"given",
"id",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Dao/ApplicationServerDao.php#L80-L92 | train |
OXID-eSales/oxideshop_ce | source/Core/Dao/ApplicationServerDao.php | ApplicationServerDao.findAppServer | public function findAppServer($id)
{
if (!isset($this->appServer[$id])) {
$serverData = $this->selectDataById($id);
if ($serverData != false) {
$appServerProperties = (array)unserialize($serverData);
} else {
return null;
}
$this->appServer[$id] = $this->createServer($appServerProperties);
}
return $this->appServer[$id];
} | php | public function findAppServer($id)
{
if (!isset($this->appServer[$id])) {
$serverData = $this->selectDataById($id);
if ($serverData != false) {
$appServerProperties = (array)unserialize($serverData);
} else {
return null;
}
$this->appServer[$id] = $this->createServer($appServerProperties);
}
return $this->appServer[$id];
} | [
"public",
"function",
"findAppServer",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"appServer",
"[",
"$",
"id",
"]",
")",
")",
"{",
"$",
"serverData",
"=",
"$",
"this",
"->",
"selectDataById",
"(",
"$",
"id",
")",
"... | Finds an application server by given id, null if none is found.
@param string $id An id of the entity to find.
@return \OxidEsales\Eshop\Core\DataObject\ApplicationServer|null | [
"Finds",
"an",
"application",
"server",
"by",
"given",
"id",
"null",
"if",
"none",
"is",
"found",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Dao/ApplicationServerDao.php#L101-L115 | train |
OXID-eSales/oxideshop_ce | source/Core/Dao/ApplicationServerDao.php | ApplicationServerDao.save | public function save($appServer)
{
$id = $appServer->getId();
if ($this->findAppServer($id)) {
$this->update($appServer);
unset($this->appServer[$id]);
} else {
$this->insert($appServer);
}
} | php | public function save($appServer)
{
$id = $appServer->getId();
if ($this->findAppServer($id)) {
$this->update($appServer);
unset($this->appServer[$id]);
} else {
$this->insert($appServer);
}
} | [
"public",
"function",
"save",
"(",
"$",
"appServer",
")",
"{",
"$",
"id",
"=",
"$",
"appServer",
"->",
"getId",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"findAppServer",
"(",
"$",
"id",
")",
")",
"{",
"$",
"this",
"->",
"update",
"(",
"$",
... | Updates or insert the given entity.
@param \OxidEsales\Eshop\Core\DataObject\ApplicationServer $appServer | [
"Updates",
"or",
"insert",
"the",
"given",
"entity",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Dao/ApplicationServerDao.php#L122-L131 | train |
OXID-eSales/oxideshop_ce | source/Core/Dao/ApplicationServerDao.php | ApplicationServerDao.update | protected function update($appServer)
{
$query = "UPDATE oxconfig SET oxvarvalue=ENCODE( ?, ?) WHERE oxvarname = ? and oxshopid = ?";
$parameter = [
$this->convertAppServerToConfigOption($appServer),
$this->config->getConfigParam('sConfigKey'),
self::CONFIG_NAME_FOR_SERVER_INFO.$appServer->getId(),
$this->config->getBaseShopId()
];
$this->database->execute($query, $parameter);
} | php | protected function update($appServer)
{
$query = "UPDATE oxconfig SET oxvarvalue=ENCODE( ?, ?) WHERE oxvarname = ? and oxshopid = ?";
$parameter = [
$this->convertAppServerToConfigOption($appServer),
$this->config->getConfigParam('sConfigKey'),
self::CONFIG_NAME_FOR_SERVER_INFO.$appServer->getId(),
$this->config->getBaseShopId()
];
$this->database->execute($query, $parameter);
} | [
"protected",
"function",
"update",
"(",
"$",
"appServer",
")",
"{",
"$",
"query",
"=",
"\"UPDATE oxconfig SET oxvarvalue=ENCODE( ?, ?) WHERE oxvarname = ? and oxshopid = ?\"",
";",
"$",
"parameter",
"=",
"[",
"$",
"this",
"->",
"convertAppServerToConfigOption",
"(",
"$",
... | Updates the given entity.
@param \OxidEsales\Eshop\Core\DataObject\ApplicationServer $appServer | [
"Updates",
"the",
"given",
"entity",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Dao/ApplicationServerDao.php#L162-L174 | train |
OXID-eSales/oxideshop_ce | source/Core/Dao/ApplicationServerDao.php | ApplicationServerDao.insert | protected function insert($appServer)
{
$query = "insert into oxconfig (oxid, oxshopid, oxmodule, oxvarname, oxvartype, oxvarvalue)
values(?, ?, '', ?, ?, ENCODE( ?, ?) )";
$parameter = [
\OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID(),
$this->config->getBaseShopId(),
self::CONFIG_NAME_FOR_SERVER_INFO.$appServer->getId(),
'arr',
$this->convertAppServerToConfigOption($appServer),
$this->config->getConfigParam('sConfigKey')
];
$this->database->execute($query, $parameter);
} | php | protected function insert($appServer)
{
$query = "insert into oxconfig (oxid, oxshopid, oxmodule, oxvarname, oxvartype, oxvarvalue)
values(?, ?, '', ?, ?, ENCODE( ?, ?) )";
$parameter = [
\OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID(),
$this->config->getBaseShopId(),
self::CONFIG_NAME_FOR_SERVER_INFO.$appServer->getId(),
'arr',
$this->convertAppServerToConfigOption($appServer),
$this->config->getConfigParam('sConfigKey')
];
$this->database->execute($query, $parameter);
} | [
"protected",
"function",
"insert",
"(",
"$",
"appServer",
")",
"{",
"$",
"query",
"=",
"\"insert into oxconfig (oxid, oxshopid, oxmodule, oxvarname, oxvartype, oxvarvalue)\n values(?, ?, '', ?, ?, ENCODE( ?, ?) )\"",
";",
"$",
"parameter",
"=",
"[",
"\\",
"OxidEsale... | Insert new application server entity.
@param \OxidEsales\Eshop\Core\DataObject\ApplicationServer $appServer | [
"Insert",
"new",
"application",
"server",
"entity",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Dao/ApplicationServerDao.php#L181-L196 | train |
OXID-eSales/oxideshop_ce | source/Core/Dao/ApplicationServerDao.php | ApplicationServerDao.getServerIdFromConfig | private function getServerIdFromConfig($varName)
{
$constNameLength = strlen(self::CONFIG_NAME_FOR_SERVER_INFO);
$id = substr($varName, $constNameLength);
return $id;
} | php | private function getServerIdFromConfig($varName)
{
$constNameLength = strlen(self::CONFIG_NAME_FOR_SERVER_INFO);
$id = substr($varName, $constNameLength);
return $id;
} | [
"private",
"function",
"getServerIdFromConfig",
"(",
"$",
"varName",
")",
"{",
"$",
"constNameLength",
"=",
"strlen",
"(",
"self",
"::",
"CONFIG_NAME_FOR_SERVER_INFO",
")",
";",
"$",
"id",
"=",
"substr",
"(",
"$",
"varName",
",",
"$",
"constNameLength",
")",
... | Parses config option name to get the server id.
@param string $varName The name of the config option.
@return string The id of server. | [
"Parses",
"config",
"option",
"name",
"to",
"get",
"the",
"server",
"id",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Dao/ApplicationServerDao.php#L245-L250 | train |
OXID-eSales/oxideshop_ce | source/Core/Dao/ApplicationServerDao.php | ApplicationServerDao.createServer | protected function createServer($data)
{
/** @var \OxidEsales\Eshop\Core\DataObject\ApplicationServer $appServer */
$appServer = oxNew(\OxidEsales\Eshop\Core\DataObject\ApplicationServer::class);
$appServer->setId($this->getServerParameter($data, 'id'));
$appServer->setTimestamp($this->getServerParameter($data, 'timestamp'));
$appServer->setIp($this->getServerParameter($data, 'ip'));
$appServer->setLastFrontendUsage($this->getServerParameter($data, 'lastFrontendUsage'));
$appServer->setLastAdminUsage($this->getServerParameter($data, 'lastAdminUsage'));
return $appServer;
} | php | protected function createServer($data)
{
/** @var \OxidEsales\Eshop\Core\DataObject\ApplicationServer $appServer */
$appServer = oxNew(\OxidEsales\Eshop\Core\DataObject\ApplicationServer::class);
$appServer->setId($this->getServerParameter($data, 'id'));
$appServer->setTimestamp($this->getServerParameter($data, 'timestamp'));
$appServer->setIp($this->getServerParameter($data, 'ip'));
$appServer->setLastFrontendUsage($this->getServerParameter($data, 'lastFrontendUsage'));
$appServer->setLastAdminUsage($this->getServerParameter($data, 'lastAdminUsage'));
return $appServer;
} | [
"protected",
"function",
"createServer",
"(",
"$",
"data",
")",
"{",
"/** @var \\OxidEsales\\Eshop\\Core\\DataObject\\ApplicationServer $appServer */",
"$",
"appServer",
"=",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"DataObject",
"\\",
"Appli... | Creates ApplicationServer from given server id and data.
@param array $data The array of server data.
@return \OxidEsales\Eshop\Core\DataObject\ApplicationServer | [
"Creates",
"ApplicationServer",
"from",
"given",
"server",
"id",
"and",
"data",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Dao/ApplicationServerDao.php#L271-L283 | train |
OXID-eSales/oxideshop_ce | source/Core/Dao/ApplicationServerDao.php | ApplicationServerDao.convertAppServerToConfigOption | private function convertAppServerToConfigOption($appServer)
{
$serverData = [
'id' => $appServer->getId(),
'timestamp' => $appServer->getTimestamp(),
'ip' => $appServer->getIp(),
'lastFrontendUsage' => $appServer->getLastFrontendUsage(),
'lastAdminUsage' => $appServer->getLastAdminUsage()
];
return serialize($serverData);
} | php | private function convertAppServerToConfigOption($appServer)
{
$serverData = [
'id' => $appServer->getId(),
'timestamp' => $appServer->getTimestamp(),
'ip' => $appServer->getIp(),
'lastFrontendUsage' => $appServer->getLastFrontendUsage(),
'lastAdminUsage' => $appServer->getLastAdminUsage()
];
return serialize($serverData);
} | [
"private",
"function",
"convertAppServerToConfigOption",
"(",
"$",
"appServer",
")",
"{",
"$",
"serverData",
"=",
"[",
"'id'",
"=>",
"$",
"appServer",
"->",
"getId",
"(",
")",
",",
"'timestamp'",
"=>",
"$",
"appServer",
"->",
"getTimestamp",
"(",
")",
",",
... | Convert ApplicationServer object into simple array for saving into database oxconfig table.
@param \OxidEsales\Eshop\Core\DataObject\ApplicationServer $appServer An application server object.
@return array | [
"Convert",
"ApplicationServer",
"object",
"into",
"simple",
"array",
"for",
"saving",
"into",
"database",
"oxconfig",
"table",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Dao/ApplicationServerDao.php#L305-L316 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleTemplateBlockPathFormatter.php | ModuleTemplateBlockPathFormatter.getPath | public function getPath()
{
if (is_null($this->moduleId) || is_null($this->fileName)) {
throw oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class);
}
$fileName = $this->fileName;
// for < 4.6 modules, since 4.7/5.0 insert in oxtplblocks the full file name and path
if (basename($fileName) === $fileName) {
// for 4.5 modules, since 4.6 insert in oxtplblocks the full file name
if (substr($fileName, -4) !== '.tpl') {
$fileName = $fileName . ".tpl";
}
$fileName = "out/blocks/$fileName";
}
$moduleList = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
$activeModuleInfo = $moduleList->getActiveModuleInfo();
if (!array_key_exists($this->moduleId, $activeModuleInfo)) {
throw oxNew('oxException', 'Module: ' . $this->moduleId . ' is not active.');
}
$modulePath = $activeModuleInfo[$this->moduleId];
$fileSystem = oxNew(FileSystem::class);
return $fileSystem->combinePaths($this->modulesPath, $modulePath, $fileName);
} | php | public function getPath()
{
if (is_null($this->moduleId) || is_null($this->fileName)) {
throw oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class);
}
$fileName = $this->fileName;
// for < 4.6 modules, since 4.7/5.0 insert in oxtplblocks the full file name and path
if (basename($fileName) === $fileName) {
// for 4.5 modules, since 4.6 insert in oxtplblocks the full file name
if (substr($fileName, -4) !== '.tpl') {
$fileName = $fileName . ".tpl";
}
$fileName = "out/blocks/$fileName";
}
$moduleList = oxNew(\OxidEsales\Eshop\Core\Module\ModuleList::class);
$activeModuleInfo = $moduleList->getActiveModuleInfo();
if (!array_key_exists($this->moduleId, $activeModuleInfo)) {
throw oxNew('oxException', 'Module: ' . $this->moduleId . ' is not active.');
}
$modulePath = $activeModuleInfo[$this->moduleId];
$fileSystem = oxNew(FileSystem::class);
return $fileSystem->combinePaths($this->modulesPath, $modulePath, $fileName);
} | [
"public",
"function",
"getPath",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"moduleId",
")",
"||",
"is_null",
"(",
"$",
"this",
"->",
"fileName",
")",
")",
"{",
"throw",
"oxNew",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",... | Return full path to module file which defines content to place in Shop block.
@throws \oxException
@return string | [
"Return",
"full",
"path",
"to",
"module",
"file",
"which",
"defines",
"content",
"to",
"place",
"in",
"Shop",
"block",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleTemplateBlockPathFormatter.php#L67-L97 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleExtensionsCleaner.php | ModuleExtensionsCleaner.getModuleExtensionsGarbage | protected function getModuleExtensionsGarbage($moduleMetaDataExtensions, $moduleInstalledExtensions)
{
$garbage = $moduleInstalledExtensions;
foreach ($garbage as $installedClassName => $installedClassPaths) {
if (isset($moduleMetaDataExtensions[$installedClassName])) {
// In case more than one extension is specified per module.
$metaDataExtensionPaths = $moduleMetaDataExtensions[$installedClassName];
if (!is_array($metaDataExtensionPaths)) {
$metaDataExtensionPaths = [$metaDataExtensionPaths];
}
foreach ($installedClassPaths as $index => $installedClassPath) {
if (in_array($installedClassPath, $metaDataExtensionPaths)) {
unset($garbage[$installedClassName][$index]);
}
}
if (count($garbage[$installedClassName]) == 0) {
unset($garbage[$installedClassName]);
}
}
}
return $garbage;
} | php | protected function getModuleExtensionsGarbage($moduleMetaDataExtensions, $moduleInstalledExtensions)
{
$garbage = $moduleInstalledExtensions;
foreach ($garbage as $installedClassName => $installedClassPaths) {
if (isset($moduleMetaDataExtensions[$installedClassName])) {
// In case more than one extension is specified per module.
$metaDataExtensionPaths = $moduleMetaDataExtensions[$installedClassName];
if (!is_array($metaDataExtensionPaths)) {
$metaDataExtensionPaths = [$metaDataExtensionPaths];
}
foreach ($installedClassPaths as $index => $installedClassPath) {
if (in_array($installedClassPath, $metaDataExtensionPaths)) {
unset($garbage[$installedClassName][$index]);
}
}
if (count($garbage[$installedClassName]) == 0) {
unset($garbage[$installedClassName]);
}
}
}
return $garbage;
} | [
"protected",
"function",
"getModuleExtensionsGarbage",
"(",
"$",
"moduleMetaDataExtensions",
",",
"$",
"moduleInstalledExtensions",
")",
"{",
"$",
"garbage",
"=",
"$",
"moduleInstalledExtensions",
";",
"foreach",
"(",
"$",
"garbage",
"as",
"$",
"installedClassName",
"... | Returns extension which is no longer in metadata - garbage
@param array $moduleMetaDataExtensions extensions defined in metadata.
@param array $moduleInstalledExtensions extensions which are installed
@return array | [
"Returns",
"extension",
"which",
"is",
"no",
"longer",
"in",
"metadata",
"-",
"garbage"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleExtensionsCleaner.php#L86-L111 | train |
OXID-eSales/oxideshop_ce | source/Core/Module/ModuleExtensionsCleaner.php | ModuleExtensionsCleaner.removeGarbage | protected function removeGarbage($installedExtensions, $garbage)
{
foreach ($garbage as $className => $classPaths) {
foreach ($classPaths as $sClassPath) {
if (isset($installedExtensions[$className])) {
unset($installedExtensions[$className][array_search($sClassPath, $installedExtensions[$className])]);
if (count($installedExtensions[$className]) == 0) {
unset($installedExtensions[$className]);
}
}
}
}
return $installedExtensions;
} | php | protected function removeGarbage($installedExtensions, $garbage)
{
foreach ($garbage as $className => $classPaths) {
foreach ($classPaths as $sClassPath) {
if (isset($installedExtensions[$className])) {
unset($installedExtensions[$className][array_search($sClassPath, $installedExtensions[$className])]);
if (count($installedExtensions[$className]) == 0) {
unset($installedExtensions[$className]);
}
}
}
}
return $installedExtensions;
} | [
"protected",
"function",
"removeGarbage",
"(",
"$",
"installedExtensions",
",",
"$",
"garbage",
")",
"{",
"foreach",
"(",
"$",
"garbage",
"as",
"$",
"className",
"=>",
"$",
"classPaths",
")",
"{",
"foreach",
"(",
"$",
"classPaths",
"as",
"$",
"sClassPath",
... | Removes garbage - not exiting module extensions, returns clean array of installed extensions
@param array $installedExtensions all installed extensions ( from all modules )
@param array $garbage extension which are not used and should be removed
@return array | [
"Removes",
"garbage",
"-",
"not",
"exiting",
"module",
"extensions",
"returns",
"clean",
"array",
"of",
"installed",
"extensions"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Module/ModuleExtensionsCleaner.php#L121-L135 | train |
OXID-eSales/oxideshop_ce | source/Core/Autoload/BackwardsCompatibilityAutoload.php | BackwardsCompatibilityAutoload.autoload | public static function autoload($class)
{
/**
* Classes from unified namespace canot be loaded by this auto loader.
* Do not try to load them in order to avoid strange errors in edge cases.
*/
if (false !== strpos($class, 'OxidEsales\Eshop\\')) {
return false;
}
$unifiedNamespaceClassName = static::getUnifiedNamespaceClassForBcAlias($class);
if (!empty($unifiedNamespaceClassName)) {
static::forceBackwardsCompatiblityClassLoading($unifiedNamespaceClassName);
}
} | php | public static function autoload($class)
{
/**
* Classes from unified namespace canot be loaded by this auto loader.
* Do not try to load them in order to avoid strange errors in edge cases.
*/
if (false !== strpos($class, 'OxidEsales\Eshop\\')) {
return false;
}
$unifiedNamespaceClassName = static::getUnifiedNamespaceClassForBcAlias($class);
if (!empty($unifiedNamespaceClassName)) {
static::forceBackwardsCompatiblityClassLoading($unifiedNamespaceClassName);
}
} | [
"public",
"static",
"function",
"autoload",
"(",
"$",
"class",
")",
"{",
"/**\n * Classes from unified namespace canot be loaded by this auto loader.\n * Do not try to load them in order to avoid strange errors in edge cases.\n */",
"if",
"(",
"false",
"!==",
"str... | Autoload method.
@param string $class Name of the class to be loaded
@return bool | [
"Autoload",
"method",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Autoload/BackwardsCompatibilityAutoload.php#L25-L39 | train |
OXID-eSales/oxideshop_ce | source/Core/Autoload/BackwardsCompatibilityAutoload.php | BackwardsCompatibilityAutoload.getUnifiedNamespaceClassForBcAlias | private static function getUnifiedNamespaceClassForBcAlias($bcAlias)
{
$classMap = static::getBackwardsCompatibilityClassMap();
$bcAlias = strtolower($bcAlias);
$result = isset($classMap[$bcAlias]) ? $classMap[$bcAlias] : "";
return $result;
} | php | private static function getUnifiedNamespaceClassForBcAlias($bcAlias)
{
$classMap = static::getBackwardsCompatibilityClassMap();
$bcAlias = strtolower($bcAlias);
$result = isset($classMap[$bcAlias]) ? $classMap[$bcAlias] : "";
return $result;
} | [
"private",
"static",
"function",
"getUnifiedNamespaceClassForBcAlias",
"(",
"$",
"bcAlias",
")",
"{",
"$",
"classMap",
"=",
"static",
"::",
"getBackwardsCompatibilityClassMap",
"(",
")",
";",
"$",
"bcAlias",
"=",
"strtolower",
"(",
"$",
"bcAlias",
")",
";",
"$",... | Return the name of a Unified Namespace class for a given backwards compatible class
@param string $bcAlias Name of the backwards compatible class like oxArticle
@return string Name of the unified namespace class like OxidEsales\Eshop\Application\Model\Article | [
"Return",
"the",
"name",
"of",
"a",
"Unified",
"Namespace",
"class",
"for",
"a",
"given",
"backwards",
"compatible",
"class"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Autoload/BackwardsCompatibilityAutoload.php#L48-L55 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineCaller.php | OnlineCaller.call | public function call(\OxidEsales\Eshop\Core\OnlineRequest $oRequest)
{
$sOutputXml = null;
$iFailedCallsCount = \OxidEsales\Eshop\Core\Registry::getConfig()->getSystemConfigParameter('iFailedOnlineCallsCount');
try {
$sXml = $this->_formXMLRequest($oRequest);
$sOutputXml = $this->_executeCurlCall($this->_getServiceUrl(), $sXml);
$statusCode = $this->_getCurl()->getStatusCode();
if ($statusCode != 200) {
/** @var \OxidEsales\Eshop\Core\Exception\StandardException $oException */
$oException = new StandardException('cUrl call to ' . $this->_getCurl()->getUrl() . ' failed with HTTP status '. $statusCode);
throw $oException;
}
$this->_resetFailedCallsCount($iFailedCallsCount);
} catch (Exception $oEx) {
if ($iFailedCallsCount > self::ALLOWED_HTTP_FAILED_CALLS_COUNT) {
\OxidEsales\Eshop\Core\Registry::getLogger()->error($oEx->getMessage(), [$oEx]);
$sXml = $this->_formEmail($oRequest);
$this->_sendEmail($sXml);
$this->_resetFailedCallsCount($iFailedCallsCount);
} else {
$this->_increaseFailedCallsCount($iFailedCallsCount);
}
}
return $sOutputXml;
} | php | public function call(\OxidEsales\Eshop\Core\OnlineRequest $oRequest)
{
$sOutputXml = null;
$iFailedCallsCount = \OxidEsales\Eshop\Core\Registry::getConfig()->getSystemConfigParameter('iFailedOnlineCallsCount');
try {
$sXml = $this->_formXMLRequest($oRequest);
$sOutputXml = $this->_executeCurlCall($this->_getServiceUrl(), $sXml);
$statusCode = $this->_getCurl()->getStatusCode();
if ($statusCode != 200) {
/** @var \OxidEsales\Eshop\Core\Exception\StandardException $oException */
$oException = new StandardException('cUrl call to ' . $this->_getCurl()->getUrl() . ' failed with HTTP status '. $statusCode);
throw $oException;
}
$this->_resetFailedCallsCount($iFailedCallsCount);
} catch (Exception $oEx) {
if ($iFailedCallsCount > self::ALLOWED_HTTP_FAILED_CALLS_COUNT) {
\OxidEsales\Eshop\Core\Registry::getLogger()->error($oEx->getMessage(), [$oEx]);
$sXml = $this->_formEmail($oRequest);
$this->_sendEmail($sXml);
$this->_resetFailedCallsCount($iFailedCallsCount);
} else {
$this->_increaseFailedCallsCount($iFailedCallsCount);
}
}
return $sOutputXml;
} | [
"public",
"function",
"call",
"(",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"OnlineRequest",
"$",
"oRequest",
")",
"{",
"$",
"sOutputXml",
"=",
"null",
";",
"$",
"iFailedCallsCount",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",... | Makes curl call with given parameters to given url.
@param \OxidEsales\Eshop\Core\OnlineRequest $oRequest Information set in Request object will be sent to OXID servers.
@return null|string In XML format. | [
"Makes",
"curl",
"call",
"with",
"given",
"parameters",
"to",
"given",
"url",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineCaller.php#L80-L107 | train |
OXID-eSales/oxideshop_ce | source/Core/OnlineCaller.php | OnlineCaller._executeCurlCall | private function _executeCurlCall($sUrl, $sXml)
{
$oCurl = $this->_getCurl();
$oCurl->setMethod('POST');
$oCurl->setUrl($sUrl);
$oCurl->setParameters(['xmlRequest' => $sXml]);
$oCurl->setOption(
\OxidEsales\Eshop\Core\Curl::EXECUTION_TIMEOUT_OPTION,
static::CURL_EXECUTION_TIMEOUT
);
return $oCurl->execute();
} | php | private function _executeCurlCall($sUrl, $sXml)
{
$oCurl = $this->_getCurl();
$oCurl->setMethod('POST');
$oCurl->setUrl($sUrl);
$oCurl->setParameters(['xmlRequest' => $sXml]);
$oCurl->setOption(
\OxidEsales\Eshop\Core\Curl::EXECUTION_TIMEOUT_OPTION,
static::CURL_EXECUTION_TIMEOUT
);
return $oCurl->execute();
} | [
"private",
"function",
"_executeCurlCall",
"(",
"$",
"sUrl",
",",
"$",
"sXml",
")",
"{",
"$",
"oCurl",
"=",
"$",
"this",
"->",
"_getCurl",
"(",
")",
";",
"$",
"oCurl",
"->",
"setMethod",
"(",
"'POST'",
")",
";",
"$",
"oCurl",
"->",
"setUrl",
"(",
"... | Executes CURL call with given parameters.
@param string $sUrl Server address to call to.
@param string $sXml Data to send. Currently OXID servers only accept XML formatted data.
@return string | [
"Executes",
"CURL",
"call",
"with",
"given",
"parameters",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/OnlineCaller.php#L171-L183 | train |
OXID-eSales/oxideshop_ce | source/Internal/Application/ContainerBuilder.php | ContainerBuilder.loadProjectServices | private function loadProjectServices(SymfonyContainerBuilder $symfonyContainer)
{
try {
$this->cleanupProjectYaml();
$loader = new YamlFileLoader($symfonyContainer, new FileLocator());
$loader->load($this->context->getGeneratedProjectFilePath());
} catch (FileLocatorFileNotFoundException $exception) {
// In case project file not found, do nothing.
}
} | php | private function loadProjectServices(SymfonyContainerBuilder $symfonyContainer)
{
try {
$this->cleanupProjectYaml();
$loader = new YamlFileLoader($symfonyContainer, new FileLocator());
$loader->load($this->context->getGeneratedProjectFilePath());
} catch (FileLocatorFileNotFoundException $exception) {
// In case project file not found, do nothing.
}
} | [
"private",
"function",
"loadProjectServices",
"(",
"SymfonyContainerBuilder",
"$",
"symfonyContainer",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"cleanupProjectYaml",
"(",
")",
";",
"$",
"loader",
"=",
"new",
"YamlFileLoader",
"(",
"$",
"symfonyContainer",
",",
"... | Loads a 'project.yaml' file if it can be found in the shop directory.
@param SymfonyContainerBuilder $symfonyContainer | [
"Loads",
"a",
"project",
".",
"yaml",
"file",
"if",
"it",
"can",
"be",
"found",
"in",
"the",
"shop",
"directory",
"."
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Application/ContainerBuilder.php#L79-L88 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ObjectSeo.php | ObjectSeo.getEntryMetaData | public function getEntryMetaData($sMetaType)
{
return $this->_getEncoder()->getMetaData($this->getEditObjectId(), $sMetaType, \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(), $this->getEditLang());
} | php | public function getEntryMetaData($sMetaType)
{
return $this->_getEncoder()->getMetaData($this->getEditObjectId(), $sMetaType, \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId(), $this->getEditLang());
} | [
"public",
"function",
"getEntryMetaData",
"(",
"$",
"sMetaType",
")",
"{",
"return",
"$",
"this",
"->",
"_getEncoder",
"(",
")",
"->",
"getMetaData",
"(",
"$",
"this",
"->",
"getEditObjectId",
"(",
")",
",",
"$",
"sMetaType",
",",
"\\",
"OxidEsales",
"\\",... | Returns object seo data
@param string $sMetaType meta data type (oxkeywords/oxdescription)
@return string | [
"Returns",
"object",
"seo",
"data"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ObjectSeo.php#L132-L135 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ObjectSeo.php | ObjectSeo._getStdUrl | protected function _getStdUrl($sOxid)
{
if ($sType = $this->_getType()) {
$oObject = oxNew($sType);
if ($oObject->load($sOxid)) {
return $oObject->getBaseStdLink($this->getEditLang(), true, false);
}
}
} | php | protected function _getStdUrl($sOxid)
{
if ($sType = $this->_getType()) {
$oObject = oxNew($sType);
if ($oObject->load($sOxid)) {
return $oObject->getBaseStdLink($this->getEditLang(), true, false);
}
}
} | [
"protected",
"function",
"_getStdUrl",
"(",
"$",
"sOxid",
")",
"{",
"if",
"(",
"$",
"sType",
"=",
"$",
"this",
"->",
"_getType",
"(",
")",
")",
"{",
"$",
"oObject",
"=",
"oxNew",
"(",
"$",
"sType",
")",
";",
"if",
"(",
"$",
"oObject",
"->",
"load... | Returns objects std url
@param string $sOxid object id
@return string | [
"Returns",
"objects",
"std",
"url"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ObjectSeo.php#L169-L177 | train |
OXID-eSales/oxideshop_ce | source/Core/Exception/ExceptionToDisplay.php | ExceptionToDisplay.getOxMessage | public function getOxMessage()
{
if ($this->_blDebug) {
return $this;
} else {
$sString = \OxidEsales\Eshop\Core\Registry::getLang()->translateString($this->_sMessage);
if (!empty($this->_aMessageArgs)) {
$sString = vsprintf($sString, $this->_aMessageArgs);
}
return $sString;
}
} | php | public function getOxMessage()
{
if ($this->_blDebug) {
return $this;
} else {
$sString = \OxidEsales\Eshop\Core\Registry::getLang()->translateString($this->_sMessage);
if (!empty($this->_aMessageArgs)) {
$sString = vsprintf($sString, $this->_aMessageArgs);
}
return $sString;
}
} | [
"public",
"function",
"getOxMessage",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_blDebug",
")",
"{",
"return",
"$",
"this",
";",
"}",
"else",
"{",
"$",
"sString",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getL... | Returns translated exception message
@return string | [
"Returns",
"translated",
"exception",
"message"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Core/Exception/ExceptionToDisplay.php#L167-L180 | train |
OXID-eSales/oxideshop_ce | source/Internal/Application/DataObject/DIConfigWrapper.php | DIConfigWrapper.removeEmptySections | private function removeEmptySections()
{
$sections = [$this::IMPORTS_SECTION, $this::SERVICE_SECTION];
foreach ($sections as $section) {
if (array_key_exists($section, $this->configArray) &&
(!$this->configArray[$section] || !count($this->configArray[$section]))) {
unset($this->configArray[$section]);
}
}
} | php | private function removeEmptySections()
{
$sections = [$this::IMPORTS_SECTION, $this::SERVICE_SECTION];
foreach ($sections as $section) {
if (array_key_exists($section, $this->configArray) &&
(!$this->configArray[$section] || !count($this->configArray[$section]))) {
unset($this->configArray[$section]);
}
}
} | [
"private",
"function",
"removeEmptySections",
"(",
")",
"{",
"$",
"sections",
"=",
"[",
"$",
"this",
"::",
"IMPORTS_SECTION",
",",
"$",
"this",
"::",
"SERVICE_SECTION",
"]",
";",
"foreach",
"(",
"$",
"sections",
"as",
"$",
"section",
")",
"{",
"if",
"(",... | Removes section entries when they are empty | [
"Removes",
"section",
"entries",
"when",
"they",
"are",
"empty"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Internal/Application/DataObject/DIConfigWrapper.php#L230-L239 | train |
OXID-eSales/oxideshop_ce | source/Application/Controller/Admin/ManufacturerMainAjax.php | ManufacturerMainAjax.removeManufacturer | public function removeManufacturer()
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$articleIds = $this->_getActionIds('oxarticles.oxid');
$manufacturerId = $config->getRequestParameter('oxid');
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("all")) {
$articleViewTable = $this->_getViewName('oxarticles');
$articleIds = $this->_getAll($this->_addFilter("select $articleViewTable.oxid " . $this->_getQuery()));
}
if (is_array($articleIds) && !empty($articleIds)) {
$query = $this->formManufacturerRemovalQuery($articleIds);
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->execute($query);
$this->resetCounter("manufacturerArticle", $manufacturerId);
}
} | php | public function removeManufacturer()
{
$config = \OxidEsales\Eshop\Core\Registry::getConfig();
$articleIds = $this->_getActionIds('oxarticles.oxid');
$manufacturerId = $config->getRequestParameter('oxid');
if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("all")) {
$articleViewTable = $this->_getViewName('oxarticles');
$articleIds = $this->_getAll($this->_addFilter("select $articleViewTable.oxid " . $this->_getQuery()));
}
if (is_array($articleIds) && !empty($articleIds)) {
$query = $this->formManufacturerRemovalQuery($articleIds);
\OxidEsales\Eshop\Core\DatabaseProvider::getDb()->execute($query);
$this->resetCounter("manufacturerArticle", $manufacturerId);
}
} | [
"public",
"function",
"removeManufacturer",
"(",
")",
"{",
"$",
"config",
"=",
"\\",
"OxidEsales",
"\\",
"Eshop",
"\\",
"Core",
"\\",
"Registry",
"::",
"getConfig",
"(",
")",
";",
"$",
"articleIds",
"=",
"$",
"this",
"->",
"_getActionIds",
"(",
"'oxarticle... | Removes article from Manufacturer config | [
"Removes",
"article",
"from",
"Manufacturer",
"config"
] | acd72f4a7c5c7340d70b191e081e4a24b74887cc | https://github.com/OXID-eSales/oxideshop_ce/blob/acd72f4a7c5c7340d70b191e081e4a24b74887cc/source/Application/Controller/Admin/ManufacturerMainAjax.php#L108-L125 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.