处理编译时间记录标签

@param string $content
原模板内容
@return void
9076
protected function processBuildTime(string &$content): void
    {
        $pattern = $this->getTagPattern('build_time');
        $content = preg_replace_callback($pattern, function ($match) {
            return '<?php /*模板编译于' . date('Y-m-d H:i:s') . '*/ ?>';
        }, $content);
    }
1109804
protected function parseContent($content) {
        if(is_bool($content)) {
            $this->addLanguage($this->language, $content);
            return;
        }
        if (!$content) {
            return;
        }
        if (is_string($content)) {
            $this->addLanguage($this->language, $content);
            return;
        }
        foreach($content as $key => $data) {
            if (!empty($data[0]['sys']['linkType'])) {
                foreach($data as $link) {
                    $this->addLink($link['id'], $link['linkType'], $key);
                }
            } else {
                if (is_numeric($key)) {
                    $this->addLanguage($this->language, [$data]);
                } else {
                    $this->addLanguage($key, $data);
                }
            }
        }
    }
252612
public function setContent($content)
    {
        if (empty($content) || !is_string($content)) {
            throw new BuildException('Content must be a non-empty string');
        }

        $this->_content = $content;
    }
86567
public function set(string $hash, string $content): void
    {
        $this->saveContent($hash, $content);
    }
449441
public function setContent($content)
    {
        if (! $content) {
            return $this;
        }
        if (! is_array($content)) {
            $content = array( $content );
        }
        $this->clearContent();
        foreach ($content as $child) {
            $this->addChild($child);
        }

        return $this;
    }
1312841
public function setContent($content): void
    {
        try {
            $this->content = value($content);
        } catch (\Exception $e) {
            $this->content = $e->getMessage();
        }
    }
42727
public function setContent($content)
    {
        $this->content = null;
        if ($content === null) {
            return;
        }

        if (TypeHandling::isSimpleType(gettype($content)) && !is_array($content)) {
            $this->content = (string)$content;
        }

        if (is_resource($content)) {
            $this->content = $content;
        }

        return $this;
    }
992808
public function setContent( $content = NULL )
	{
		if( is_object( $content ) ){
			if( !method_exists( $content, '__toString' ) ){											//  content is not a renderable object
				$message	= 'Object of class "'.get_class( $content ).'" cannot be rendered';		//  prepare message about not renderable object
				throw new InvalidArgumentException( $message ); 									//  break with error message
			}
			$content	= (string) $content;														//  render object to string
		}
		$this->content	= $content;
	}
119212
public static function append($section, $content)
	{
		if (isset(static::$sections[$section]))
		{
			static::$sections[$section] .= $content;
		}
		else
		{
			static::$sections[$section] = $content;
		}
	}
49710
public function parse($content) {
        $this->_content = $content;

        $this->_parseExtends();

        if ($this->_parent != null) {
            $this->_parseExtendsMain();
        }

        $this->_parseDebugStart();
        $this->_parseExtend();
        $this->_parseInclude();
        $this->_parsePath();
        $this->_parseGravatar();
        $this->_parseAsset();
        $this->_parseUrl();
        $this->_parsePhp();
        $this->_parseLang();
        $this->_parseForeach();
        $this->_parseFor();
        $this->_parseVar();
        $this->_parseVarFunc();
        $this->_parseCondition();
        $this->_parseFunction();
        $this->_parseException();
        $this->_parseBlock();
        $this->_parseTemplate();
        $this->_parseCall();
        $this->_parseMinify();
        $this->_parseDebugEnd();

        return $this->_content;
    }
1129213
private function write( string$content )
	{
		$this->raw.= $content;

		fwrite( $this->handle, $content );
	}
1266651
protected function prepareTpl(&$content)
    {
        $this->modx->loadClass('modParser', '', false, true);
        $parser = new Parser($this->modx);
        $this->modx->toPlaceholders($this->profile);
        $this->modx->toPlaceholders($this->request->args());
        $parser->processElementTags('', $content);
    }
1014295
public function setCache($content)
    {
        if (!empty($content) && $content->getXml()!==null) {
            return (!empty($content)) ?
                file_put_contents($this->getCacheKey(), $content->getXml()->asXML()) : false;
        }
        return false;
    }
1086930
public function indexContent(Content $content)
    {
        $document = $this->mapper->mapContent($content);

        $this->gateway->index($document);
    }
1017343
private function prepareContent($content)
    {
        $this->content = $content;

        if (!($this->content instanceof StreamInterface)) {
            $this->content = Stream::factory($this->content);
        } elseif ($this->content instanceof MultipartBody) {
            if (!$this->hasHeader('Content-Disposition')) {
                $disposition = 'form-data; name="' . $this->name .'"';
                $this->headers['Content-Disposition'] = $disposition;
            }

            if (!$this->hasHeader('Content-Type')) {
                $this->headers['Content-Type'] = sprintf(
                    "multipart/form-data; boundary=%s",
                    $this->content->getBoundary()
                );
            }
        }
    }
986936
public function flush($content = null)
    {
        if (function_exists('apache_setenv')) {
            apache_setenv('no-gzip', '1');
        }

        /**
         * Disable zlib to compress output
         * @link http://www.php.net/manual/en/zlib.configuration.php
         */
        if (!headers_sent() && extension_loaded('zlib')) {
            ini_set('zlib.output_compression', '0');
        }

        /**
         * Turn implicit flush on
         * @link http://www.php.net/manual/en/function.ob-implicit-flush.php
         */
        ob_implicit_flush();

        $this->send($content);

        /**
         * Send blank characters for output_buffering
         * @link http://www.php.net/manual/en/outcontrol.configuration.php
         */
        if ($length = ini_get('output_buffering')) {
            echo str_pad('', $length);
        }

        while (ob_get_level()) {
            ob_end_flush();
        }

        return $this;
    }
890019
private function execute($content)
	{
		$ch = curl_init();

		curl_setopt($ch, CURLOPT_URL, $this->url);
		curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Token '.$this->token, 'Content-Type: application/json', 'Accept: application/json']);
		curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode((object) $content));

		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

		$result = curl_exec($ch);

		if(!$result)
			return curl_error( $ch );

		return $result;

	}