/** * Executes the configured tasks. * * @return boolean True if success * @throws Exception If an error occurs */ public function execute() { $conf = Base::parseTS($this->{$this->fieldTSconfig}); if (!isset($conf['client']['html']['catalog']['detail']['url']['config'])) { $conf['client']['html']['catalog']['detail']['url']['config'] = array('plugin' => 'catalog-detail', 'extension' => 'aimeos', 'absoluteUri' => 1); } if ($this->{$this->fieldSenderFrom} != '') { $conf['client']['html']['email']['from-name'] = $this->{$this->fieldSenderFrom}; } if ($this->{$this->fieldSenderEmail} != '') { $conf['client']['html']['email']['from-email'] = $this->{$this->fieldSenderEmail}; } if ($this->{$this->fieldReplyEmail} != '') { $conf['client']['html']['email']['reply-email'] = $this->{$this->fieldReplyEmail}; } if ($this->{$this->fieldPageDetail} != '') { $conf['client']['html']['catalog']['detail']['url']['target'] = $this->{$this->fieldPageDetail}; } if ($this->{$this->fieldContentBaseurl} != '') { $conf['client']['html']['common']['content']['baseurl'] = $this->{$this->fieldContentBaseurl}; } if ($this->{$this->fieldTemplateBaseurl} != '') { $themeDir = $this->{$this->fieldTemplateBaseurl}; if ($themeDir != '' && $themeDir[0] !== '/') { realpath(PATH_site . $themeDir); } $conf['client']['html']['common']['template']['baseurl'] = $this->{$this->fieldTemplateBaseurl}; } Scheduler\Base::initFrontend($this->{$this->fieldPageDetail}); Scheduler\Base::execute($conf, (array) $this->{$this->fieldController}, $this->{$this->fieldSite}); return true; }
/** * Creates a new configuration object. * * @return MW_Config_Interface Configuration object */ protected function getConfig() { $settings = (array) $this->settings; if (isset($this->settings['typo3']['tsconfig'])) { $tsconfig = Base::parseTS($this->settings['typo3']['tsconfig']); $settings = \TYPO3\CMS\Extbase\Utility\ArrayUtility::arrayMergeRecursiveOverrule($settings, $tsconfig); } return Base::getConfig($settings); }
/** * Executes the configured tasks. * * @return boolean True if success, false if not * @throws Exception If an error occurs */ public function execute() { $sitecodes = (array) $this->{$this->fieldSite}; $controllers = (array) $this->{$this->fieldController}; $tsconfig = $this->{$this->fieldTSconfig}; $conf = Base::parseTS($tsconfig); Scheduler\Base::execute($conf, $controllers, $sitecodes); return true; }
/** * Executes the Aimeos e-mail jobs * * The Aimeos shop system needs some maintenance tasks that must be * regularly executed. Each of these maintenance tasks must be executed for * all shop instances if you have more than one site in your installation. * * @param string $jobs List of job names separated by a space character like "customer/email/watch order/email/payment" * @param string $sites List of sites separated by a space character the jobs should be executed for, e.g. "default unittest" * @param string $tsconfig TypoScript string for individual configuration * @param string $senderFrom Name of the sender in the e-mail * @param string $senderEmail Sender e-mail address * @param string $replyEmail E-Mail address customers can reply to * @param string $detailPid Page ID of the catalog detail page for generating product URLs * @param string $baseUrl URL of the Aimeos uploads directory, e.g. https://yourdomain.tld/uploads/tx_aimeos * @param string $themeDir Absolute path or relative path from to TYPO3 root to the CSS files of the theme directory * @return boolean True on succes */ public function emailCommand($jobs = 'customer/email/watch order/email/delivery order/email/payment', $sites = 'default', $tsconfig = '', $senderFrom = 'Aimeos shop', $senderEmail = '', $replyEmail = '', $detailPid = '', $baseUrl = '', $themeDir = 'typo3conf/ext/aimeos/Resources/Public/Themes/elegance') { Scheduler\Base::initFrontend($detailPid); if ($themeDir != '' && $themeDir[0] !== '/') { $themeDir = realpath(PATH_site . $themeDir); } $conf = Base::parseTS($tsconfig); if (!isset($conf['client']['html']['catalog']['detail']['url']['config'])) { $conf['client']['html']['catalog']['detail']['url']['config'] = array('plugin' => 'catalog-detail', 'extension' => 'aimeos', 'absoluteUri' => 1); } $conf['client']['html']['email']['from-name'] = $senderFrom; $conf['client']['html']['email']['from-email'] = $senderEmail; $conf['client']['html']['email']['reply-email'] = $replyEmail; $conf['client']['html']['common']['content']['baseurl'] = $baseUrl; $conf['client']['html']['common']['template']['baseurl'] = $themeDir; $conf['client']['html']['catalog']['detail']['url']['target'] = $detailPid; Scheduler\Base::execute($conf, explode(' ', $jobs), $sites); return true; }
/** * Creates a new configuration object. * * @param array $paths Paths to the configuration directories * @param array $local Multi-dimensional associative list with local configuration * @return \Aimeos\MW\Config\Iface Configuration object */ public static function get(array $paths, array $local = array()) { if (self::$config === null) { // Using extension config directories if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['confDirs'])) { ksort($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['confDirs']); foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['aimeos']['confDirs'] as $dir) { if (($absPath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName($dir)) !== '') { $paths[] = $absPath; } } } $conf = new \Aimeos\MW\Config\PHPArray(array(), $paths); if (function_exists('apc_store') === true && (bool) \Aimeos\Aimeos\Base::getExtConfig('useAPC', false) === true) { $conf = new \Aimeos\MW\Config\Decorator\APC($conf, \Aimeos\Aimeos\Base::getExtConfig('apcPrefix', 't3:')); } self::$config = $conf; } if (isset($local['typo3']['tsconfig'])) { $tsconfig = \Aimeos\Aimeos\Base::parseTS($local['typo3']['tsconfig']); $local = \TYPO3\CMS\Extbase\Utility\ArrayUtility::arrayMergeRecursiveOverrule($local, $tsconfig); } return new \Aimeos\MW\Config\Decorator\Memory(self::$config, $local); }
/** * Fields validation. * This method checks if page id given in the 'Hide content' specific task is int+ * If the task class is not relevant, the method is expected to return true * * @param array $submittedData Reference to the array containing the data submitted by the user * @param tx_scheduler_Module $parentObject Reference to the calling object (Scheduler's BE module) * @return boolean True if validation was ok (or selected class is not relevant), false otherwise */ protected function validateFields(array &$submittedData, $parentObject) { if (count((array) $submittedData[$this->fieldController]) < 1) { throw new \Exception($GLOBALS['LANG']->sL('LLL:EXT:aimeos/Resources/Private/Language/Scheduler.xml:default.error.controller.missing')); } if (count((array) $submittedData[$this->fieldSite]) < 1) { throw new \Exception($GLOBALS['LANG']->sL('LLL:EXT:aimeos/Resources/Private/Language/Scheduler.xml:default.error.sitecode.missing')); } Base::parseTS($submittedData[$this->fieldTSconfig]); $context = Scheduler\Base::getContext(); $siteItems = Scheduler\Base::getSiteItems($context, $submittedData[$this->fieldSite]); if (count($siteItems) !== count($submittedData[$this->fieldSite])) { throw new \Exception($GLOBALS['LANG']->sL('LLL:EXT:aimeos/Resources/Private/Language/Scheduler.xml:default.error.sitecode')); } $aimeos = Base::getAimeos(); $cntlPaths = $aimeos->getCustomPaths('controller/jobs'); foreach ((array) $submittedData[$this->fieldController] as $name) { \Controller_Jobs_Factory::createController($context, $aimeos, $name); } return true; }