当前位置: 首页>>代码示例>>PHP>>正文


PHP CharsetConverter::initCharset方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Charset\CharsetConverter::initCharset方法的典型用法代码示例。如果您正苦于以下问题:PHP CharsetConverter::initCharset方法的具体用法?PHP CharsetConverter::initCharset怎么用?PHP CharsetConverter::initCharset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Charset\CharsetConverter的用法示例。


在下文中一共展示了CharsetConverter::initCharset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ordermoveSendMail

    /**
     * This method converts an sends mails.
     *
     * @param array $mailconf Mail configuration
     * @param array $orderdata Order data
     * @param string $template Template
     *
     * @return bool of \TYPO3\CMS\Core\Mail\MailMessage
     */
    protected function ordermoveSendMail(array $mailconf, array &$orderdata, &$template)
    {
        // First line is subject
        $parts = explode(chr(10), $mailconf['plain']['content'], 2);
        // add mail subject
        $mailconf['alternateSubject'] = trim($parts[0]);
        // replace plaintext content
        $mailconf['plain']['content'] = trim($parts[1]);
        /**
         * Convert Text to charset
         */
        $this->csConvObj->initCharset('utf-8');
        $this->csConvObj->initCharset('8bit');
        $mailconf['plain']['content'] = $this->csConvObj->conv($mailconf['plain']['content'], 'utf-8', 'utf-8');
        $mailconf['alternateSubject'] = $this->csConvObj->conv($mailconf['alternateSubject'], 'utf-8', 'utf-8');
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/Classes/Hook/class.tx_commerce_ordermailhooks.php']['ordermoveSendMail'])) {
            GeneralUtility::deprecationLog('
				hook
				$GLOBALS[\'TYPO3_CONF_VARS\'][\'EXTCONF\'][\'commerce/Classes/Hook/class.tx_commerce_ordermailhooks.php\'][\'ordermoveSendMail\']
				is deprecated since commerce 1.0.0, it will be removed in commerce 1.4.0, please use instead
				$GLOBALS[\'TYPO3_CONF_VARS\'][\'EXTCONF\'][\'commerce/Classes/Hook/OrdermailHooks.php\'][\'ordermoveSendMail\']
			');
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/Classes/Hook/class.tx_commerce_ordermailhooks.php']['ordermoveSendMail'] as $classRef) {
                $hookObj = GeneralUtility::getUserObj($classRef);
                if (method_exists($hookObj, 'postOrdermoveSendMail')) {
                    $hookObj->postOrdermoveSendMail($mailconf, $orderdata, $template);
                }
            }
        }
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/Classes/Hook/OrdermailHooks.php']['ordermoveSendMail'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/Classes/Hook/OrdermailHooks.php']['ordermoveSendMail'] as $classRef) {
                $hookObj = GeneralUtility::getUserObj($classRef);
                if (method_exists($hookObj, 'postOrdermoveSendMail')) {
                    $hookObj->postOrdermoveSendMail($mailconf, $orderdata, $template);
                }
            }
        }
        return Tx_Commerce_Utility_GeneralUtility::sendMail($mailconf);
    }
开发者ID:AndreasA,项目名称:commerce,代码行数:48,代码来源:OrdermailHooks.php

示例2: ordermoveSendMail

 /**
  * This method converts an sends mails.
  *
  * @param array $mailconf Mail configuration
  * @param array $orderdata Order data
  * @param string $template Template
  *
  * @return bool of \TYPO3\CMS\Core\Mail\MailMessage
  */
 protected function ordermoveSendMail(array $mailconf, array &$orderdata, &$template)
 {
     // First line is subject
     $parts = explode(chr(10), $mailconf['plain']['content'], 2);
     // add mail subject
     $mailconf['alternateSubject'] = trim($parts[0]);
     // replace plaintext content
     $mailconf['plain']['content'] = trim($parts[1]);
     /*
      * Convert Text to charset
      */
     $this->csConvObj->initCharset('utf-8');
     $this->csConvObj->initCharset('8bit');
     $mailconf['plain']['content'] = $this->csConvObj->conv($mailconf['plain']['content'], 'utf-8', 'utf-8');
     $mailconf['alternateSubject'] = $this->csConvObj->conv($mailconf['alternateSubject'], 'utf-8', 'utf-8');
     $hooks = \CommerceTeam\Commerce\Factory\HookFactory::getHooks('Hook/OrdermailHooks', 'ordermoveSendMail');
     foreach ($hooks as $hook) {
         if (method_exists($hook, 'postOrdermoveSendMail')) {
             $hook->postOrdermoveSendMail($mailconf, $orderdata, $template);
         }
     }
     return \CommerceTeam\Commerce\Utility\GeneralUtility::sendMail($mailconf);
 }
开发者ID:BenjaminBeck,项目名称:commerce,代码行数:32,代码来源:OrdermailHooks.php


注:本文中的TYPO3\CMS\Core\Charset\CharsetConverter::initCharset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。