【问题标题】:PHP Warning: Missing argument 1 for sfOutputEscaperGetterDecorator::get(), called inPHP 警告:sfOutputEscaperGetterDecorator::get() 缺少参数 1,调用
【发布时间】:2017-02-22 15:05:24
【问题描述】:

我正在为我的一个警告寻找解决方案。

系统信息:

  • 操作系统:FreeBSD
  • 引擎:nginx+php-fpm
  • CMS:Symfony 1.4

问题是,当我尝试在后端 Symfony Home 上列出数据时,我收到以下错误,并且无法显示数据,而是显示原始数据(将 exp. 链接到用户帐户),但并非所有内容都无法显示。

[error] 7716#100111: *1288 FastCGI sent in stderr: "PHP message: PHP Warning: Missing argument 1 for sfOutputEscaperGetterDecorator::get(), 在 /data/bin/cache/backend/prod/modules/ 中调用autoSfGuardUser/templates/_list_td_tabular.php 在第 2 行,并在第 45 行的 /data/bin/lib/symfony/escaper/sfOutputEscaperGetterDecorator.class.php 中定义 PHP 消息:PHP 警告:array_key_exists():第一个参数应该是 /data/bin/lib/symfony/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php 第 1357 行中的字符串或整数

文件:/data/bin/lib/symfony/escaper/sfOutputEscaperGetterDecorator.class.php

    <?php

    /*
     * This file is part of the symfony package.
     * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
     *
     * For the full copyright and license information, please view the LICENSE
     * file that was distributed with this source code.
     */

    /**
     * Abstract output escaping decorator class for "getter" objects.
     *
     * @see        sfOutputEscaper
     * @package    symfony
     * @subpackage view
     * @author     Mike Squire <mike@somosis.co.uk>
     * @version    SVN: $Id: sfOutputEscaperGetterDecorator.class.php 9047 2008-05-19 08:43:05Z FabianLange $
     */
    abstract class sfOutputEscaperGetterDecorator extends sfOutputEscaper
    {
      /**
       * Returns the raw, unescaped value associated with the key supplied.
       *
       * The key might be an index into an array or a value to be passed to the
       * decorated object's get() method.
       *
       * @param  string $key  The key to retrieve
       *
       * @return mixed The value
       */
      public abstract function getRaw($key);

      /**
       * Returns the escaped value associated with the key supplied.
       *
       * Typically (using this implementation) the raw value is obtained using the
       * {@link getRaw()} method, escaped and the result returned.
       *
       * @param  string $key             The key to retrieve
       * @param  string $escapingMethod  The escaping method (a PHP function) to use
       *
       * @return mixed The escaped value
       */
      public function get($key, $escapingMethod = null)
      {
        if (!$escapingMethod)
        {
          $escapingMethod = $this->escapingMethod;
        }

        return sfOutputEscaper::escape($escapingMethod, $this->getRaw($key));
      }
    }

【问题讨论】:

    标签: php symfony-1.4


    【解决方案1】:

    我找到了问题和解决方案。 问题出在 preg_replace 上,我已经按照这里的描述进行了更改 Symfony 1.4 deprecated function in php

    但是在清理 symfony 缓存之前它不会工作。 我已删除文件夹缓存 (/data/bin/cache) 中的所有(文件夹和文件)。

    附:链接http://blog.jakoubek.cz/symfony-1-4-deprecated-e-modifier 也很有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-05
      • 1970-01-01
      • 2014-12-14
      • 2018-03-14
      • 2020-05-16
      • 2012-03-04
      相关资源
      最近更新 更多