Class Pinoco
Pinoco web site environment It makes existing static web site dynamic transparently.
Install PHPTAL. Make your application directory anywhere.
Put .htaccess in your site root.
RewriteEngine On RewriteCond %{REQUEST_FILENAME} \.(html|php)$ [OR] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !_gateway\.php$ RewriteRule ^(.*)$ _gateway.php/$1 [L,QSA] #...or RewriteRule ^(.*)$ _gateway.php?PATH_INFO=$1 [L,QSA]
Put _gateway.php in your site root.
require_once 'Pinoco.php'; Pinoco::create("*** your_app_dir ***", array( // 'use_mod_rewrite' => true, // true or false default true // 'use_path_info' => true, // true or false default true // 'custom_path_info' => false, // false(auto) or string default false // 'directory_index' => "index.html index.php", // string like DirectoryIndex directive default "index.html index.php" ))->run();
Pinoco::create guesses HTTP request to create Pinoco instance. If this method can't work file in your environment, you can create Pinoco environment manually via "new" operator using your own parameters.
- Pinoco_Vars implements IteratorAggregate, ArrayAccess, Countable, Pinoco_ArrayConvertible
- Pinoco_DynamicVars
- Pinoco
Copyright: Copyright 2010-2012, Hisateru Tanaka <tanakahisateru@gmail.com>
License: License (http://www.opensource.org/licenses/mit-license.php)
Author: Hisateru Tanaka <tanakahisateru@gmail.com>
Located at Pinoco.php
public static
|
|
public
|
#
__construct( string $baseuri, string $dispatcher, string $path, string $basedir, string $sysdir, boolean $testing = false )
Pinoco constructor. |
public
|
|
public
|
|
public static
|
|
public static
|
|
public static
|
|
public static
|
|
public static
|
|
public
string
|
|
public
string
|
|
public
string
|
|
public
boolean
|
|
public
|
|
public
|
|
public
string
|
|
public
string
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
|
public
string
|
|
public
|
#
get_renderers( )
Page renderers repository. A renderer object is registered to file extension as dictionary key. |
public
|
|
public
callable
|
|
public
callable
|
|
public
|
|
public
|
|
public
|
#
set_directory_index( string $files )
Default files (separated by white space) for directory access. |
public
|
|
public
|
|
public static
|
|
public static
|
|
public static
|
|
public static
|
|
public static
|
|
public static
|
|
public
|
|
public
|
#
abortIfNotModified( integer $timestamp = null, string $etag = null, integer $lifetime = 86400 )
Conditional flow control. Send cache hints and also might send "304 Not Modified" status if the content has not been changed from previously sent (detected by incoming request header). |
public
|
#
serveStatic( string $filename, integer $lifetime = 86400, string $mime_type = null )
Serves static file or send 304 no-modified response automatically. This method terminates hook script flow. |
public
|
|
public static
string
|
|
public
string
|
|
public
boolean
|
|
public
boolean
|
|
public
boolean
|
|
public
string
|
|
public
|
|
public static
string
|
|
public static
|
|
public static
|
|
public static
|
|
public
|
|
public
mixed
|
|
public
|string
|
|
public static
|
get(),
getIterator(),
has(),
keys(),
set()
|
__call(),
__get(),
__isset(),
__set(),
__unset(),
count(),
fromArray(),
import(),
markAsDirty(),
offsetExists(),
offsetGet(),
offsetSet(),
offsetUnset(),
registerAsDynamic(),
registerAsLazy(),
registerAsMethod(),
remove(),
rget(),
setDefault(),
setLoose(),
toArray(),
toArrayRecurse(),
values(),
wrap()
|
string |
VERSION
|
"0.8.0" |
public
|
$incdir |
#
Include pathes |
public
string
|
$directory_index |
#
Space separated directory index files(like Apache) |
public
string
|
$page |
#
Template file to be rendered |
public
callable
|
$url_modifier |
#
URL modification callback |
public
callable
|
$page_modifier |
#
Template page base path modification callback |
public read-only
string
|
$baseuri |
#
Base URI |
public read-only
string
|
$basedir |
#
Base directory |
public read-only
string
|
$sysdir |
#
Application directory |
public read-only
boolean
|
$testing |
#
Test mode flag |
public read-only
|
$request |
#
Request related global variables wrapper |
public read-only
string
|
$path |
#
Path under base URI |
public read-only
string
|
$script |
#
Current hook script |
public read-only
|
$activity |
#
Activity history of hook scripts |
public read-only
|
$sent_headers |
#
Sent headers via Pinoco |
public read-only
string
|
$subpath |
#
Sub-path under current hook script |
public read-only
|
$pathargs |
#
Path elements matches _default[.*] hooks |
public read-only
|
$renderers |
#
File extension to rendering module mappings |
public read-only
|
$autolocal |
#
Auto extracted variables into local scope |