PHP 클래스 gb, gitblog

These values can be overridden in gb-config.php (or somewhere else for that matter).
파일 보기 프로젝트 열기: rsms/gitblog 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_authenticators
$authorized # Admin authentication
$categories_prefix URL prefix for categories
$comments_cache_fnext
$content_cache_fnext
$data_store_class # data -- arbitrary key-value storage
$data_stores
$deferred # defer -- Delayed execution
$deferred_time_limit
$dir Absolute path to the gitblog directory
$errors Themes should take care of this and display these error messages where appropriate.
$events # Events
$feed_prefix URL prefix for the feed
$filters # Filters
$index_cache_fnext
$index_prefix URL to gitblog index _relative_ to gb::$site_url
$is_404
$is_categories
$is_feed
$is_internal_call True if some part of gitblog (inside the gitblog directory) is the initial invoker
$is_page
$is_post
$is_posts
$is_preview This is automatically set to true by the request handler (end of this file) when all of the following are true: - gb::$preview_query_key is set in the query string (i.e. "?preview") - Client is authorized (gb::$authorized is non-false)
$is_search
$is_tags
$log_cb
$log_filter Disable logging by setting this to -1. See the "Logging" section in gitblog.php for more information.
$log_open # Logging
$object_indices # reading object indices
$pages_prefix URL prefix for pages
$pathspec_query_key When this query string key is set and gb::$is_preview is true, the object specified by pathspec is loaded. This overrides parsing the URI and is needed in cases where there are multiple posts with the same name but with different file extensions (content types).
$plugins_loaded # Plugins
$posts_cn_pattern The granularity of this date is the "bottleneck", or "limiter", for $posts_prefix. If you specify "%Y", $posts_prefix can define patterns with granularity ranging from year to second. But if you set this parameter to "%Y/%m/%d-" the minimum granularity of $posts_prefix goes up to day, which means that this: $posts_prefix = '%Y/%m/' will not work, as day is missing. However this: $posts_prefix = '%y-%m-%e/' and $posts_prefix = '%y/%m/%e/%H/%M/' works fine, as they both have a granularity of one day or more. It's recommended not to alter this value. The only viable case where altering this is if you are posting many many posts every day, thus adding day ($posts_cn_pattern = '%Y/%m/%d-') would give a slight file system performance improvement on most file systems.
$posts_fuzzy_lookup Enables fuzzy URI matching of posts
$posts_pagesize Number of posts per page.
$posts_prefix Need to specify at least year and month. Day, time and so on is optional. Changing this parameter does not affect the cache.
$preview_query_key When this query string key is set and the client is authorized, the same effect as setting $version_query_key to "work" is achieved.
$rebuilders # GitBlog
$request_query 'PATH_INFO' or any other string which will then be matched in $_GET[string]
$secret Shared secret
$settings A JSONDict
$site_description Site description
$site_dir Absolute path to the site root
$site_path Absolute URL path (i.e. starts with a slash) to the site root
$site_state Contains the site.json structure or null if not loaded
$site_title Site title
$site_url Absolute URL to the site root, not including gb::$index_prefix
$tags_prefix URL prefix for tags
$theme_dir Absolute path to current theme. Available when running a theme.
$theme_url Absolute URL to current theme. Available when running a theme.
$title # The following are used at runtime.
$version # Constants
$version_query_key When this query string key is set and the client is authorized, the specified version of a viewed post is displayed rather than the live version.

보호된 프로퍼티들

프로퍼티 타입 설명
$current_url # Info about the Request

공개 메소드들

메소드 설명
add_filter ( $tag, $func, $priority = 100 ) Add a filter
authenticate ( $force = true, $context = 'gb-admin' )
authenticator ( $context = 'gb-admin' )
categories ( $indexname = 'category-to-objs' )
data ( $name, $default = null )
deauthorize ( $redirect = true, $context = 'gb-admin' )
defer ( $callable ) Schedule $callable for delayed execution.
event ( ) Dispatch an event, optionally with arguments.
filter ( $tag, $value ) Apply filters for $tag on $value
glob ( $pattern, $skip = '/\/$/' ) Glob with PCRE skip filter which defaults to skipping directories.
index ( $name, $fallback = null )
index_cachename ( $name )
index_path ( $name )
init ( $add_sample_content = true, $shared = 'true', $theme = 'default', $mkdirmode = 509 )
load_plugins ( $context )
load_site_state ( ) Load the site state
log ( ) Send a message to syslog.
observe ( $event, $callable ) Register $callable for receiving $event s
openlog ( $ident = null, $options = LOG_PID, $facility = LOG_USER )
pathToTheme ( $file = '' )
plugin_check_enabled ( $context, $name )
referrer_url ( $fallback_on_http_referer = false )
run_deferred ( )
shell ( $cmd, $input = null, $cwd = null, $env = null ) Execute a command inside a shell
stop_observing ( $callable, $event = null ) Unregister $callable from receiving $event s
tags ( $indexname = 'tags-by-popularity' )
url ( )
urlToCategories ( $categories )
urlToCategory ( $category )
urlToTag ( $tag )
urlToTags ( $tags )
url_to ( $part = null, $htmlsafe = true )
verify ( )
verify_config ( )
verify_integrity ( ) Verify integrity of the site, automatically taking any actions to restore it if broken.
version_format ( $v )
version_parse ( $s )
vlog ( $priority, $vargs, $btoffset = 1, $prefix = null )

메소드 상세

add_filter() 정적인 공개 메소드

Lower number for $priority means earlier execution of $func. If $func returns boolean FALSE the filter chain is broken, not applying any more filter after the one returning FALSE. Returning anything else have no effect.
static public add_filter ( $tag, $func, $priority = 100 )

authenticate() 정적인 공개 메소드

static public authenticate ( $force = true, $context = 'gb-admin' )

authenticator() 정적인 공개 메소드

static public authenticator ( $context = 'gb-admin' )

categories() 정적인 공개 메소드

static public categories ( $indexname = 'category-to-objs' )

data() 정적인 공개 메소드

static public data ( $name, $default = null )

deauthorize() 정적인 공개 메소드

static public deauthorize ( $redirect = true, $context = 'gb-admin' )

defer() 정적인 공개 메소드

$callable will be executed after the response has been sent to the client. This is useful for expensive operations which do not need to send anything to the client. At the first call to defer, deferring will be "activated". This means that output buffering is enabled, keepalive disabled and user-abort is ignored. You can check to see if deferring is enabled by doing a truth check on gb::$deferred. The event "did-activate-deferring" is also posted. Use deferring wth caution. A good example of when delayed execution is a good idea, is how the email-notification plugin defers the mail action (this is actually part of GBMail but this plugin makes good use of it). Events: - "did-activate-deferring" Posted when defer is activated.
static public defer ( $callable )

event() 정적인 공개 메소드

Dispatch an event, optionally with arguments.
static public event ( )

filter() 정적인 공개 메소드

Apply filters for $tag on $value
static public filter ( $tag, $value )

glob() 정적인 공개 메소드

Glob with PCRE skip filter which defaults to skipping directories.
static public glob ( $pattern, $skip = '/\/$/' )

index() 정적인 공개 메소드

static public index ( $name, $fallback = null )

index_cachename() 정적인 공개 메소드

static public index_cachename ( $name )

index_path() 정적인 공개 메소드

static public index_path ( $name )

init() 정적인 공개 메소드

static public init ( $add_sample_content = true, $shared = 'true', $theme = 'default', $mkdirmode = 509 )

load_plugins() 정적인 공개 메소드

static public load_plugins ( $context )

load_site_state() 정적인 공개 메소드

Load the site state
static public load_site_state ( )

log() 정적인 공개 메소드

INT CONSTANT DESCRIPTION ---- ----------- ---------------------------------- 0 LOG_EMERG system is unusable 1 LOG_ALERT action must be taken immediately 2 LOG_CRIT critical conditions 3 LOG_ERR error conditions 4 LOG_WARNING warning conditions 5 LOG_NOTICE normal, but significant, condition 6 LOG_INFO informational message 7 LOG_DEBUG debug-level message
static public log ( )

observe() 정적인 공개 메소드

Register $callable for receiving $event s
static public observe ( $event, $callable )

openlog() 정적인 공개 메소드

static public openlog ( $ident = null, $options = LOG_PID, $facility = LOG_USER )

pathToTheme() 정적인 공개 메소드

static public pathToTheme ( $file = '' )

plugin_check_enabled() 정적인 공개 메소드

static public plugin_check_enabled ( $context, $name )

referrer_url() 정적인 공개 메소드

static public referrer_url ( $fallback_on_http_referer = false )

run_deferred() 정적인 공개 메소드

static public run_deferred ( )

shell() 정적인 공개 메소드

Execute a command inside a shell
static public shell ( $cmd, $input = null, $cwd = null, $env = null )

stop_observing() 정적인 공개 메소드

Unregister $callable from receiving $event s
static public stop_observing ( $callable, $event = null )

tags() 정적인 공개 메소드

static public tags ( $indexname = 'tags-by-popularity' )

url() 정적인 공개 메소드

static public url ( )

urlToCategories() 정적인 공개 메소드

static public urlToCategories ( $categories )

urlToCategory() 정적인 공개 메소드

static public urlToCategory ( $category )

urlToTag() 정적인 공개 메소드

static public urlToTag ( $tag )

urlToTags() 정적인 공개 메소드

static public urlToTags ( $tags )

url_to() 정적인 공개 메소드

static public url_to ( $part = null, $htmlsafe = true )

verify() 정적인 공개 메소드

static public verify ( )

verify_config() 정적인 공개 메소드

static public verify_config ( )

verify_integrity() 정적인 공개 메소드

Return values: 0 Nothing done (everything is probably OK). -1 Error (the error has been logged through trigger_error). 1 gitblog cache was updated. 2 gitdir is missing and need to be created (git init). 3 upgrade performed
static public verify_integrity ( )

version_format() 정적인 공개 메소드

static public version_format ( $v )

version_parse() 정적인 공개 메소드

static public version_parse ( $s )

vlog() 정적인 공개 메소드

static public vlog ( $priority, $vargs, $btoffset = 1, $prefix = null )

프로퍼티 상세

$_authenticators 공개적으로 정적으로 프로퍼티

public static $_authenticators

$authorized 공개적으로 정적으로 프로퍼티

# Admin authentication
public static $authorized

$categories_prefix 공개적으로 정적으로 프로퍼티

URL prefix for categories
public static $categories_prefix

$comments_cache_fnext 공개적으로 정적으로 프로퍼티

public static $comments_cache_fnext

$content_cache_fnext 공개적으로 정적으로 프로퍼티

public static $content_cache_fnext

$current_url 보호되어 있는 정적으로 프로퍼티

# Info about the Request
protected static $current_url

$data_store_class 공개적으로 정적으로 프로퍼티

# data -- arbitrary key-value storage
public static $data_store_class

$data_stores 공개적으로 정적으로 프로퍼티

public static $data_stores

$deferred 공개적으로 정적으로 프로퍼티

# defer -- Delayed execution
public static $deferred

$deferred_time_limit 공개적으로 정적으로 프로퍼티

public static $deferred_time_limit

$dir 공개적으로 정적으로 프로퍼티

Absolute path to the gitblog directory
public static $dir

$errors 공개적으로 정적으로 프로퍼티

Themes should take care of this and display these error messages where appropriate.
public static $errors

$events 공개적으로 정적으로 프로퍼티

# Events
public static $events

$feed_prefix 공개적으로 정적으로 프로퍼티

URL prefix for the feed
public static $feed_prefix

$filters 공개적으로 정적으로 프로퍼티

# Filters
public static $filters

$index_cache_fnext 공개적으로 정적으로 프로퍼티

public static $index_cache_fnext

$index_prefix 공개적으로 정적으로 프로퍼티

URL to gitblog index _relative_ to gb::$site_url
public static $index_prefix

$is_404 공개적으로 정적으로 프로퍼티

public static $is_404

$is_categories 공개적으로 정적으로 프로퍼티

public static $is_categories

$is_feed 공개적으로 정적으로 프로퍼티

public static $is_feed

$is_internal_call 공개적으로 정적으로 프로퍼티

True if some part of gitblog (inside the gitblog directory) is the initial invoker
public static $is_internal_call

$is_page 공개적으로 정적으로 프로퍼티

public static $is_page

$is_post 공개적으로 정적으로 프로퍼티

public static $is_post

$is_posts 공개적으로 정적으로 프로퍼티

public static $is_posts

$is_preview 공개적으로 정적으로 프로퍼티

This is automatically set to true by the request handler (end of this file) when all of the following are true: - gb::$preview_query_key is set in the query string (i.e. "?preview") - Client is authorized (gb::$authorized is non-false)
public static $is_preview

$is_tags 공개적으로 정적으로 프로퍼티

public static $is_tags

$log_cb 공개적으로 정적으로 프로퍼티

public static $log_cb

$log_filter 공개적으로 정적으로 프로퍼티

Disable logging by setting this to -1. See the "Logging" section in gitblog.php for more information.
public static $log_filter

$log_open 공개적으로 정적으로 프로퍼티

# Logging
public static $log_open

$object_indices 공개적으로 정적으로 프로퍼티

# reading object indices
public static $object_indices

$pages_prefix 공개적으로 정적으로 프로퍼티

URL prefix for pages
public static $pages_prefix

$pathspec_query_key 공개적으로 정적으로 프로퍼티

When this query string key is set and gb::$is_preview is true, the object specified by pathspec is loaded. This overrides parsing the URI and is needed in cases where there are multiple posts with the same name but with different file extensions (content types).
public static $pathspec_query_key

$plugins_loaded 공개적으로 정적으로 프로퍼티

# Plugins
public static $plugins_loaded

$posts_cn_pattern 공개적으로 정적으로 프로퍼티

The granularity of this date is the "bottleneck", or "limiter", for $posts_prefix. If you specify "%Y", $posts_prefix can define patterns with granularity ranging from year to second. But if you set this parameter to "%Y/%m/%d-" the minimum granularity of $posts_prefix goes up to day, which means that this: $posts_prefix = '%Y/%m/' will not work, as day is missing. However this: $posts_prefix = '%y-%m-%e/' and $posts_prefix = '%y/%m/%e/%H/%M/' works fine, as they both have a granularity of one day or more. It's recommended not to alter this value. The only viable case where altering this is if you are posting many many posts every day, thus adding day ($posts_cn_pattern = '%Y/%m/%d-') would give a slight file system performance improvement on most file systems.
public static $posts_cn_pattern

$posts_fuzzy_lookup 공개적으로 정적으로 프로퍼티

Enables fuzzy URI matching of posts
public static $posts_fuzzy_lookup

$posts_pagesize 공개적으로 정적으로 프로퍼티

Number of posts per page.
public static $posts_pagesize

$posts_prefix 공개적으로 정적으로 프로퍼티

Need to specify at least year and month. Day, time and so on is optional. Changing this parameter does not affect the cache.
public static $posts_prefix

$preview_query_key 공개적으로 정적으로 프로퍼티

When this query string key is set and the client is authorized, the same effect as setting $version_query_key to "work" is achieved.
public static $preview_query_key

$rebuilders 공개적으로 정적으로 프로퍼티

# GitBlog
public static $rebuilders

$request_query 공개적으로 정적으로 프로퍼티

'PATH_INFO' or any other string which will then be matched in $_GET[string]
public static $request_query

$secret 공개적으로 정적으로 프로퍼티

Shared secret
public static $secret

$settings 공개적으로 정적으로 프로퍼티

A JSONDict
public static $settings

$site_description 공개적으로 정적으로 프로퍼티

Site description
public static $site_description

$site_dir 공개적으로 정적으로 프로퍼티

Absolute path to the site root
public static $site_dir

$site_path 공개적으로 정적으로 프로퍼티

Absolute URL path (i.e. starts with a slash) to the site root
public static $site_path

$site_state 공개적으로 정적으로 프로퍼티

Contains the site.json structure or null if not loaded
public static $site_state

$site_title 공개적으로 정적으로 프로퍼티

Site title
public static $site_title

$site_url 공개적으로 정적으로 프로퍼티

Absolute URL to the site root, not including gb::$index_prefix
public static $site_url

$tags_prefix 공개적으로 정적으로 프로퍼티

URL prefix for tags
public static $tags_prefix

$theme_dir 공개적으로 정적으로 프로퍼티

Absolute path to current theme. Available when running a theme.
public static $theme_dir

$theme_url 공개적으로 정적으로 프로퍼티

Absolute URL to current theme. Available when running a theme.
public static $theme_url

$title 공개적으로 정적으로 프로퍼티

# The following are used at runtime.
public static $title

$version 공개적으로 정적으로 프로퍼티

# Constants
public static $version

$version_query_key 공개적으로 정적으로 프로퍼티

When this query string key is set and the client is authorized, the specified version of a viewed post is displayed rather than the live version.
public static $version_query_key