写入错误信息

@param  string $name
@param  array  $parameters
@param  string $message
432984
protected function addError(string $name, array $parameters, string $message = '')
    {
        if (array_key_exists('message', $parameters) &&
            Assert::stringNotEmpty($parameters['message'])
        ) {
            $message = trim($parameters['message']);
        }

        $this->validator->addError(sprintf($message, $name));
    }
2541
public function addParameter($name, $parameter)
  {
    if ($this->isLocked()) {
      return $this->getObj()->addParameter($name, $parameter)->setLocked();
    } else {
      return parent::addParameter($name, $parameter);
    }
  }
1116390
public function trans($message, array $parameters = array())
    {
        return $this->translation->trans($message, $parameters, $this->domain, $this->locale);
    }
1241095
public function optfail($name, $message = '', $url = '')
    {
        echo rcube::Q($name) . ':&nbsp; <span class="na">NOT OK</span>';
        $this->_showhint($message, $url);
    }
164390
public function log(string $name, string $message, array $data = []): void
    {
        $filename = $this->dir . '/' . $name . '-' . date('Y-m-d') . '.log';
        try {
            $microtime = microtime(true);
            $microtimeParts = explode('.', $microtime);
            $logData = date('H:i:s', $microtime) . ':' . (isset($microtimeParts[1]) ? $microtimeParts[1] : '0') . "\n" . trim($message) . (empty($data) ? '' : "\n" . trim(print_r($data, true))) . "\n\n";
            $fileHandler = fopen($filename, 'ab');
            fwrite($fileHandler, $logData);
            fclose($fileHandler);
        } catch (\Exception $e) {
            throw new \Exception('Cannot write log file (' . $filename . ')');
        }
    }
391368
public function time(string $name, string $message = null): TimerContract
    {
        $id = isset($this->timers[$name]) ? \uniqid($name) : $name;

        $this->timers[$id] = $this->createTimer($name, \microtime(true), $message);

        return $this->timers[$id];
    }
735907
public static void log(Logger logger,
                           Level level,
                           String message,
                           Object[] parameters) {
        if (logger.isLoggable(level)) {
            String msg = localize(logger, message);
            try {
                msg = MessageFormat.format(msg, parameters);
            } catch (IllegalArgumentException ex) {
                //ignore, log as is
            }
            doLog(logger, level, msg, null);
        }
    }
1115587
public function notifyError($name, $message, callable $callback = null)
    {
        $this->bugsnag->notifyError($name, $message, $callback);
    }
315944
public function check($name, $parameters)
    {
        $parameters = func_get_args();

        // Remove $name
        array_shift($parameters);

        return call_user_func_array($this->conditions[$name], $parameters);
    }
738044
public static function info($name = '', $message = '', $data = array(), $other = array())
    {
        return self::write($name, 'INFO', $message, $data, $other);
    }
353186
public function renderContent($name, $parameters = [])
    {
        /**
         * @event cms.page.beforeRenderContent
         * Provides an oportunity to manipulate the name of the content file being rendered before it renders
         *
         * Example usage:
         *
         *     Event::listen('cms.page.beforeRenderContent', function ((\Cms\Classes\Controller) $controller, (string) $contentName) {
         *         return "path/to/overriding/location/" . $contentName;
         *     });
         *
         * Or
         *
         *     $CmsController->bindEvent('page.beforeRenderContent', function ((string) $contentName) {
         *         return "path/to/overriding/location/" . $contentName;
         *     });
         *
         */
        if ($event = $this->fireSystemEvent('cms.page.beforeRenderContent', [$name])) {
            $content = $event;
        }
        /*
         * Load content from theme
         */
        elseif (($content = Content::loadCached($this->theme, $name)) === null) {
            throw new CmsException(Lang::get('cms::lang.content.not_found_name', ['name'=>$name]));
        }

        $fileContent = $content->parsedMarkup;

        /*
         * Inject global view variables
         */
        $globalVars = ViewHelper::getGlobalVars();
        if (!empty($globalVars)) {
            $parameters = (array) $parameters + $globalVars;
        }

        /*
         * Parse basic template variables
         */
        if (!empty($parameters)) {
            $fileContent = TextParser::parse($fileContent, $parameters);
        }

        /**
         * @event cms.page.renderContent
         * Provides an oportunity to manipulate the output of a content file after being rendered
         *
         * Example usage:
         *
         *     Event::listen('cms.page.renderContent', function ((\Cms\Classes\Controller) $controller, (string) $contentName, (string) &$fileContent) {
         *         return "Overriding content";
         *     });
         *
         * Or
         *
         *     $CmsController->bindEvent('page.renderContent', function ((string) $contentName, (string) &$fileContent) {
         *         return "Overriding content";
         *     });
         *
         */
        if ($event = $this->fireSystemEvent('cms.page.renderContent', [$name, &$fileContent])) {
            return $event;
        }

        return $fileContent;
    }
1064029
function decodeCommand( $name, $parameters )
    {
        $names = $this->ruleNames();
        $rules = array();
        switch ( $name )
        {
            // Special code handlers
            case 'url_cleanup_iri':
            case 'url_cleanup':
            case 'url_cleanup_compat':
            case 'identifier_cleanup':
            {
            } break;

            case 'normalize':
            case 'search_normalize':
            case 'decompose':
            case 'diacritical':
            case 'lowercase':
            case 'uppercase':
            case 'search_cleanup':
            {
                if ( count( $parameters ) == 0 )
                {
                    // Include all normalize rules
                    foreach ( $names as $rule )
                    {
                        if ( preg_match( '#_'. $name . '$#', $rule ) )
                            $rules[] = $rule;
                    }
                }
                else
                {
                    foreach ( $parameters as $parameter )
                    {
                        $rule = $parameter . '_' . $name;
                        if ( in_array( $rule, $names ) )
                            $rules[] = $rule;
                    }
                }
            } break;

            case 'transform':
            case 'transliterate':
            {
                $dividers = array( 'transform' => '_to_',
                                   'transliterate' => '_transliterate_' );
                $divider = $dividers[$name];
                if ( count( $parameters ) == 0 )
                {
                    // Include all transformation rules
                    foreach ( $names as $rule )
                    {
                        if ( preg_match( '#^[a-zA-Z][a-zA-Z0-9-]+'. $divider . '[a-zA-Z][a-zA-Z0-9-]+$#', $rule ) )
                            $rules[] = $rule;
                    }
                }
                else if ( count( $parameters ) == 2 )
                {
                    $rule = $parameters[0] . $divider . $parameters[1];
                    if ( in_array( $rule, $names ) )
                        $rules[] = $rule;
                }
            } break;

            default:
            {
                $ini = eZINI::instance( 'transform.ini' );
                $commands = $ini->variable( 'Extensions', 'Commands' );
                if ( isset( $commands[$name] ) )
                {
                    break;
                }
                eZDebug::writeError( "Unknown command '$name'", __METHOD__ );
            } break;
        }
        return $rules;
    }
339059
public function create(string $name, $startPoint = null, $message = null)
    {
        $this->clearAll();
        $this->addCommandName(self::TAG_COMMAND);
        if (null !== $message) {
            $this->addCommandArgument('-m');
            $this->addCommandArgument($message);
        }
        if (null !== $startPoint) {
            $this->addCommandArgument($name);
            $this->addCommandSubject($startPoint);
        } else {
            $this->addCommandSubject($name);
        }

        return $this->getCommand();
    }
590008
protected function setParam($name, $value) {
        $params = $this->getParams();
        $params->$name = $value;
        $this->setParams($params);
    }
94378
protected function formatExceptionParams($message, $parameters)
    {
        if (trim($message) === '' || $parameters === null) {
            return $message;
        }

        if (is_array($parameters) === false) {
            $parameters = [$parameters];
        }

        return @vsprintf($message, $parameters);
    }
1021219
protected function api($name, $data = '', $method = 'POST', $param = ''){
        $params = array('access_token' => $this->accessToken);

        if(!empty($param) && is_array($param)){
            $params = array_merge($params, $param);
        }

        $url  = "{$this->apiURL}/{$name}";
        if(!empty($data)){
            //保护中文，微信api不支持中文转义的json结构
            array_walk_recursive($data, function(&$value){
                $value = urlencode($value);
            });
            $data = urldecode(json_encode($data));
        }

        $data = self::http($url, $params, $data, $method);

        return json_decode($data, true);
    }
1020851
public function bind($name,$params) 
    {

        $this->instances[$name] = $params;
        $this->bind[$name] = true;

    }