Esempio n. 1
0
 /**
  * Checks that an e-mail address is valid or empty.
  *
  * @param string $fieldName
  *        TS setup field name to mention in the warning, must not be empty
  * @param bool $canUseFlexforms
  *        whether the value can also be set via flexforms (this will be
  *        mentioned in the error message)
  * @param string $sheet
  *        flexforms sheet pointer, eg. "sDEF", will be ignored if
  *        $canUseFlexforms is set to FALSE
  * @param bool $unused unused
  * @param string $explanation
  *        a sentence explaining what that configuration value is needed for,
  *        must not be empty
  *
  * @return void
  */
 public function checkIsValidEmailOrEmpty($fieldName, $canUseFlexforms, $sheet, $unused, $explanation)
 {
     $value = $this->objectToCheck->getConfValueString($fieldName, $sheet);
     if ($value === '') {
         return;
     }
     if (!t3lib_div::validEmail($value)) {
         $message = 'The e-mail address in <strong>' . $this->getTSSetupPath() . $fieldName . '</strong> is set to <strong>' . $value . '</strong> ' . 'which is not valid. E-mails might not be received as long as ' . 'this address is invalid.<br />';
         $this->setErrorMessageAndRequestCorrection($fieldName, $canUseFlexforms, $message . $explanation);
     }
 }
Esempio n. 2
0
 /**
  * Cleans up oelib after running a test.
  *
  * @return void
  */
 public function cleanUp()
 {
     Tx_Oelib_ConfigurationProxy::purgeInstances();
     Tx_Oelib_BackEndLoginManager::purgeInstance();
     Tx_Oelib_ConfigurationRegistry::purgeInstance();
     Tx_Oelib_FrontEndLoginManager::purgeInstance();
     tx_oelib_Geocoding_Google::purgeInstance();
     tx_oelib_headerProxyFactory::purgeInstance();
     Tx_Oelib_MapperRegistry::purgeInstance();
     Tx_Oelib_PageFinder::purgeInstance();
     Tx_Oelib_Session::purgeInstances();
     Tx_Oelib_TemplateHelper::purgeCachedConfigurations();
     Tx_Oelib_TranslatorRegistry::purgeInstance();
     /** @var Tx_Oelib_MailerFactory $mailerFactory */
     $mailerFactory = t3lib_div::makeInstance('Tx_Oelib_MailerFactory');
     $mailerFactory->cleanUp();
 }
Esempio n. 3
0
 /**
  * Frees as much memory that has been used by this object as possible.
  */
 public function __destruct()
 {
     unset($this->configuration);
     parent::__destruct();
 }
Esempio n. 4
0
 /**
  * Purges all cached configuration values.
  *
  * This function is intended to be used for testing purposes only.
  *
  * @return void
  */
 public static function purgeCachedConfigurations()
 {
     self::$cachedConfigurations = array();
 }
Esempio n. 5
0
 /**
  * @test
  */
 public function purgeCachedConfigurationsDropsCachedConfiguration()
 {
     $this->testingFramework->discardFakeFrontEnd();
     Tx_Oelib_TemplateHelper::setCachedConfigurationValue('foo', 'bar');
     Tx_Oelib_TemplateHelper::purgeCachedConfigurations();
     $subject = new Tx_Oelib_TemplateHelper();
     $subject->init();
     self::assertSame('', $subject->getConfValueString('foo'));
 }
Esempio n. 6
0
 /**
  * Ensures that $this->cObj points to a valid content object.
  *
  * If this object alread has a valid cObj, this function does nothing.
  *
  * If there is a front end and this object does not have a cObj yet, the
  * cObj from the front end is used.
  *
  * If this object has no cObj and there is no front end, this function will
  * do nothing.
  *
  * @return void
  */
 public function ensureContentObject()
 {
     parent::ensureContentObject();
 }