コード例 #1
0
ファイル: ConfigCheck.php プロジェクト: Konafets/oelib
 /**
  * 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);
     }
 }
コード例 #2
0
ファイル: TemplateHelperTest.php プロジェクト: Konafets/oelib
 /**
  * @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'));
 }