PHP 클래스 PicoDeprecated

This plugin exists for backward compatibility and is disabled by default. It gets automatically enabled when a plugin which doesn't implement {@link PicoPluginInterface} is loaded. This plugin triggers deprecated events and automatically enables {@link PicoParsePagesContent} and {@link PicoExcerpt}. These plugins heavily impact Pico's performance! You can disable this plugin by calling {@link PicoDeprecated::setEnabled()}. The following deprecated events are triggered by this plugin: | Event | ... triggers the deprecated event | | ------------------- | --------------------------------------------------------- | | onPluginsLoaded | plugins_loaded() | | onConfigLoaded | config_loaded($config) | | onRequestUrl | request_url($url) | | onContentLoading | before_load_content($file) | | onContentLoaded | after_load_content($file, $rawContent) | | on404ContentLoading | before_404_load_content($file) | | on404ContentLoaded | after_404_load_content($file, $rawContent) | | onMetaHeaders | before_read_file_meta($headers) | | onMetaParsed | file_meta($meta) | | onContentParsing | before_parse_content($rawContent) | | onContentParsed | after_parse_content($content) | | onContentParsed | content_parsed($content) | | onSinglePageLoaded | get_page_data($pages, $meta) | | onPagesLoaded | get_pages($pages, $currentPage, $previousPage, $nextPage) | | onTwigRegistration | before_twig_register() | | onPageRendering | before_render($twigVariables, $twig, $templateName) | | onPageRendered | after_render($output) | Since Pico 1.0 the config is stored in {@path "config/config.php"}. This plugin tries to read {@path "config.php"} in Pico's root dir and overwrites all settings previously specified in {@path "config/config.php"}.
저자: Daniel Rudolf
상속: extends AbstractPicoPlugin
파일 보기 프로젝트 열기: gilbitron/pico

보호된 프로퍼티들

프로퍼티 타입 설명
$enabled This plugin is disabled by default
$requestFile string | null The requested file

공개 메소드들

메소드 설명
on404ContentLoaded ( &$rawContent ) Triggers the deprecated event after_404_load_content($file, $rawContent)
on404ContentLoading ( &$file ) Triggers the deprecated before_404_load_content($file)
onConfigLoaded ( array &$config ) : void Triggers the deprecated event config_loaded($config)
onContentLoaded ( &$rawContent ) Triggers the deprecated event after_load_content($file, $rawContent)
onContentLoading ( &$file ) Triggers the deprecated before_load_content($file)
onContentParsed ( &$content ) Triggers the deprecated events after_parse_content($content) and content_parsed($content)
onContentParsing ( &$rawContent ) Triggers the deprecated event before_parse_content($rawContent)
onMetaHeaders ( array &$headers ) Triggers the deprecated event before_read_file_meta($headers)
onMetaParsed ( array &$meta ) Triggers the deprecated event file_meta($meta)
onPageRendered ( &$output ) Triggers the deprecated event after_render($output)
onPageRendering ( Twig_Environment &$twig, array &$twigVariables, &$templateName ) Triggers the deprecated event before_render($twigVariables, $twig, $templateName)
onPagesLoaded ( array &$pages, array &$currentPage = null, array &$previousPage = null, array &$nextPage = null ) Triggers the deprecated event get_pages($pages, $currentPage, $previousPage, $nextPage)
onPluginsLoaded ( array &$plugins ) Enables this plugin on demand and triggers the deprecated event plugins_loaded()
onRequestFile ( &$file ) Sets PicoDeprecated::$requestFile to trigger the deprecated events after_load_content() and after_404_load_content()
onRequestUrl ( &$url ) Triggers the deprecated event request_url($url)
onSinglePageLoaded ( array &$pageData ) Triggers the deprecated event get_page_data($pages, $meta)
onTwigRegistration ( ) Triggers the deprecated event before_twig_register()

보호된 메소드들

메소드 설명
defineConstants ( ) : void Defines deprecated constants
enablePlugins ( ) : void Enables the plugins PicoParsePagesContent and PicoExcerpt
loadRootDirConfig ( array &$realConfig ) : void Read config.php in Pico's root dir
triggerEvent ( string $eventName, array $params = [] ) : void Triggers a deprecated event on all plugins

메소드 상세

defineConstants() 보호된 메소드

ROOT_DIR, LIB_DIR, PLUGINS_DIR, THEMES_DIR and CONTENT_EXT are deprecated since v1.0, CONTENT_DIR existed just in v0.9, CONFIG_DIR just for a short time between v0.9 and v1.0 and CACHE_DIR was dropped with v1.0 without a replacement.
또한 보기: PicoDeprecated::onConfigLoaded()
protected defineConstants ( ) : void
리턴 void

enablePlugins() 보호된 메소드

Enables the plugins PicoParsePagesContent and PicoExcerpt
또한 보기: PicoParsePagesContent
또한 보기: PicoExcerpt
protected enablePlugins ( ) : void
리턴 void

loadRootDirConfig() 보호된 메소드

Read config.php in Pico's root dir
또한 보기: PicoDeprecated::onConfigLoaded()
또한 보기: Pico::loadConfig()
protected loadRootDirConfig ( array &$realConfig ) : void
$realConfig array
리턴 void

on404ContentLoaded() 공개 메소드

Triggers the deprecated event after_404_load_content($file, $rawContent)
또한 보기: DummyPlugin::on404ContentLoaded()
public on404ContentLoaded ( &$rawContent )

on404ContentLoading() 공개 메소드

Triggers the deprecated before_404_load_content($file)
또한 보기: DummyPlugin::on404ContentLoading()
public on404ContentLoading ( &$file )

onConfigLoaded() 공개 메소드

This method also defines deprecated constants, reads the config.php in Pico's root dir, enables the plugins {@link PicoParsePagesContent} and {@link PicoExcerpt} and makes $config globally accessible (the latter was removed with Pico 0.9 and was added again as deprecated feature with Pico 1.0)
또한 보기: PicoDeprecated::defineConstants()
또한 보기: PicoDeprecated::loadRootDirConfig()
또한 보기: PicoDeprecated::enablePlugins()
또한 보기: DummyPlugin::onConfigLoaded()
public onConfigLoaded ( array &$config ) : void
$config array
리턴 void

onContentLoaded() 공개 메소드

Triggers the deprecated event after_load_content($file, $rawContent)
또한 보기: DummyPlugin::onContentLoaded()
public onContentLoaded ( &$rawContent )

onContentLoading() 공개 메소드

Triggers the deprecated before_load_content($file)
또한 보기: DummyPlugin::onContentLoading()
public onContentLoading ( &$file )

onContentParsed() 공개 메소드

Triggers the deprecated events after_parse_content($content) and content_parsed($content)
또한 보기: DummyPlugin::onContentParsed()
public onContentParsed ( &$content )

onContentParsing() 공개 메소드

Triggers the deprecated event before_parse_content($rawContent)
또한 보기: DummyPlugin::onContentParsing()
public onContentParsing ( &$rawContent )

onMetaHeaders() 공개 메소드

Triggers the deprecated event before_read_file_meta($headers)
또한 보기: DummyPlugin::onMetaHeaders()
public onMetaHeaders ( array &$headers )
$headers array

onMetaParsed() 공개 메소드

Triggers the deprecated event file_meta($meta)
또한 보기: DummyPlugin::onMetaParsed()
public onMetaParsed ( array &$meta )
$meta array

onPageRendered() 공개 메소드

Triggers the deprecated event after_render($output)
또한 보기: DummyPlugin::onPageRendered()
public onPageRendered ( &$output )

onPageRendering() 공개 메소드

Please note that the before_render() event gets $templateName passed without its file extension. The file extension is later added again.
또한 보기: DummyPlugin::onPageRendering()
public onPageRendering ( Twig_Environment &$twig, array &$twigVariables, &$templateName )
$twig Twig_Environment
$twigVariables array

onPagesLoaded() 공개 메소드

Please note that the get_pages() event gets $pages passed without a array index. The index is rebuild later using either the id array key or is derived from the url array key. Duplicates are prevented by adding ~dup when necessary.
또한 보기: DummyPlugin::onPagesLoaded()
public onPagesLoaded ( array &$pages, array &$currentPage = null, array &$previousPage = null, array &$nextPage = null )
$pages array
$currentPage array
$previousPage array
$nextPage array

onPluginsLoaded() 공개 메소드

Enables this plugin on demand and triggers the deprecated event plugins_loaded()
또한 보기: DummyPlugin::onPluginsLoaded()
public onPluginsLoaded ( array &$plugins )
$plugins array

onRequestFile() 공개 메소드

Sets PicoDeprecated::$requestFile to trigger the deprecated events after_load_content() and after_404_load_content()
또한 보기: PicoDeprecated::onContentLoaded()
또한 보기: PicoDeprecated::on404ContentLoaded()
또한 보기: DummyPlugin::onRequestFile()
public onRequestFile ( &$file )

onRequestUrl() 공개 메소드

Triggers the deprecated event request_url($url)
또한 보기: DummyPlugin::onRequestUrl()
public onRequestUrl ( &$url )

onSinglePageLoaded() 공개 메소드

Triggers the deprecated event get_page_data($pages, $meta)
또한 보기: DummyPlugin::onSinglePageLoaded()
public onSinglePageLoaded ( array &$pageData )
$pageData array

onTwigRegistration() 공개 메소드

Triggers the deprecated event before_twig_register()
또한 보기: DummyPlugin::onTwigRegistration()
public onTwigRegistration ( )

triggerEvent() 보호된 메소드

Deprecated events are also triggered on plugins which implement {@link PicoPluginInterface}. Please note that the methods are called directly and not through {@link PicoPluginInterface::handleEvent()}.
protected triggerEvent ( string $eventName, array $params = [] ) : void
$eventName string event to trigger
$params array parameters to pass
리턴 void

프로퍼티 상세

$enabled 보호되어 있는 프로퍼티

This plugin is disabled by default
또한 보기: AbstractPicoPlugin::$enabled
protected $enabled

$requestFile 보호되어 있는 프로퍼티

The requested file
또한 보기: PicoDeprecated::getRequestFile()
protected string|null $requestFile
리턴 string | null