Full Code of easysoft/zentaophp for AI

master f1ce398f0a11 cached
234 files
1.4 MB
388.1k tokens
1487 symbols
1 requests
Download .txt
Showing preview only (1,588K chars total). Download the full file or copy to clipboard to get everything.
Repository: easysoft/zentaophp
Branch: master
Commit: f1ce398f0a11
Files: 234
Total size: 1.4 MB

Directory structure:
gitextract_zm9qj3qj/

├── .gitignore
├── .htaccess
├── Makefile
├── VERSION
├── config/
│   ├── config.php
│   ├── filter.php
│   └── my.example.php
├── db/
│   └── blog.sql
├── framework/
│   ├── base/
│   │   ├── control.class.php
│   │   ├── helper.class.php
│   │   ├── model.class.php
│   │   └── router.class.php
│   ├── control.class.php
│   ├── helper.class.php
│   ├── model.class.php
│   ├── router.class.php
│   └── tests/
│       └── helper/
│           ├── .case001.expect
│           ├── .case002.expect
│           ├── .case003.expect
│           ├── .case004.expect
│           ├── case001.php
│           ├── case002.php
│           ├── case003.php
│           ├── case004.php
│           ├── import1.php
│           └── import2.php
├── index.php
├── js/
│   └── my.js
├── lib/
│   ├── base/
│   │   ├── dao/
│   │   │   └── dao.class.php
│   │   ├── filter/
│   │   │   └── filter.class.php
│   │   ├── front/
│   │   │   └── front.class.php
│   │   └── pager/
│   │       └── pager.class.php
│   ├── dao/
│   │   └── dao.class.php
│   ├── filter/
│   │   └── filter.class.php
│   ├── front/
│   │   └── front.class.php
│   ├── mobile/
│   │   └── mobile.class.php
│   ├── pager/
│   │   └── pager.class.php
│   └── purifier/
│       ├── purifier.class.php
│       └── standalone/
│           └── HTMLPurifier/
│               ├── ConfigSchema/
│               │   ├── Builder/
│               │   │   ├── ConfigSchema.php
│               │   │   └── Xml.php
│               │   ├── Exception.php
│               │   ├── Interchange/
│               │   │   ├── Directive.php
│               │   │   └── Id.php
│               │   ├── Interchange.php
│               │   ├── InterchangeBuilder.php
│               │   ├── Validator.php
│               │   ├── ValidatorAtom.php
│               │   ├── schema/
│               │   │   ├── Attr.AllowedClasses.txt
│               │   │   ├── Attr.AllowedFrameTargets.txt
│               │   │   ├── Attr.AllowedRel.txt
│               │   │   ├── Attr.AllowedRev.txt
│               │   │   ├── Attr.ClassUseCDATA.txt
│               │   │   ├── Attr.DefaultImageAlt.txt
│               │   │   ├── Attr.DefaultInvalidImage.txt
│               │   │   ├── Attr.DefaultInvalidImageAlt.txt
│               │   │   ├── Attr.DefaultTextDir.txt
│               │   │   ├── Attr.EnableID.txt
│               │   │   ├── Attr.ForbiddenClasses.txt
│               │   │   ├── Attr.IDBlacklist.txt
│               │   │   ├── Attr.IDBlacklistRegexp.txt
│               │   │   ├── Attr.IDPrefix.txt
│               │   │   ├── Attr.IDPrefixLocal.txt
│               │   │   ├── AutoFormat.AutoParagraph.txt
│               │   │   ├── AutoFormat.Custom.txt
│               │   │   ├── AutoFormat.DisplayLinkURI.txt
│               │   │   ├── AutoFormat.Linkify.txt
│               │   │   ├── AutoFormat.PurifierLinkify.DocURL.txt
│               │   │   ├── AutoFormat.PurifierLinkify.txt
│               │   │   ├── AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt
│               │   │   ├── AutoFormat.RemoveEmpty.RemoveNbsp.txt
│               │   │   ├── AutoFormat.RemoveEmpty.txt
│               │   │   ├── AutoFormat.RemoveSpansWithoutAttributes.txt
│               │   │   ├── CSS.AllowImportant.txt
│               │   │   ├── CSS.AllowTricky.txt
│               │   │   ├── CSS.AllowedFonts.txt
│               │   │   ├── CSS.AllowedProperties.txt
│               │   │   ├── CSS.DefinitionRev.txt
│               │   │   ├── CSS.ForbiddenProperties.txt
│               │   │   ├── CSS.MaxImgLength.txt
│               │   │   ├── CSS.Proprietary.txt
│               │   │   ├── CSS.Trusted.txt
│               │   │   ├── Cache.DefinitionImpl.txt
│               │   │   ├── Cache.SerializerPath.txt
│               │   │   ├── Cache.SerializerPermissions.txt
│               │   │   ├── Core.AggressivelyFixLt.txt
│               │   │   ├── Core.AllowHostnameUnderscore.txt
│               │   │   ├── Core.CollectErrors.txt
│               │   │   ├── Core.ColorKeywords.txt
│               │   │   ├── Core.ConvertDocumentToFragment.txt
│               │   │   ├── Core.DirectLexLineNumberSyncInterval.txt
│               │   │   ├── Core.DisableExcludes.txt
│               │   │   ├── Core.EnableIDNA.txt
│               │   │   ├── Core.Encoding.txt
│               │   │   ├── Core.EscapeInvalidChildren.txt
│               │   │   ├── Core.EscapeInvalidTags.txt
│               │   │   ├── Core.EscapeNonASCIICharacters.txt
│               │   │   ├── Core.HiddenElements.txt
│               │   │   ├── Core.Language.txt
│               │   │   ├── Core.LexerImpl.txt
│               │   │   ├── Core.MaintainLineNumbers.txt
│               │   │   ├── Core.NormalizeNewlines.txt
│               │   │   ├── Core.RemoveInvalidImg.txt
│               │   │   ├── Core.RemoveProcessingInstructions.txt
│               │   │   ├── Core.RemoveScriptContents.txt
│               │   │   ├── Filter.Custom.txt
│               │   │   ├── Filter.ExtractStyleBlocks.Escaping.txt
│               │   │   ├── Filter.ExtractStyleBlocks.Scope.txt
│               │   │   ├── Filter.ExtractStyleBlocks.TidyImpl.txt
│               │   │   ├── Filter.ExtractStyleBlocks.txt
│               │   │   ├── Filter.YouTube.txt
│               │   │   ├── HTML.Allowed.txt
│               │   │   ├── HTML.AllowedAttributes.txt
│               │   │   ├── HTML.AllowedComments.txt
│               │   │   ├── HTML.AllowedCommentsRegexp.txt
│               │   │   ├── HTML.AllowedElements.txt
│               │   │   ├── HTML.AllowedModules.txt
│               │   │   ├── HTML.Attr.Name.UseCDATA.txt
│               │   │   ├── HTML.BlockWrapper.txt
│               │   │   ├── HTML.CoreModules.txt
│               │   │   ├── HTML.CustomDoctype.txt
│               │   │   ├── HTML.DefinitionID.txt
│               │   │   ├── HTML.DefinitionRev.txt
│               │   │   ├── HTML.Doctype.txt
│               │   │   ├── HTML.FlashAllowFullScreen.txt
│               │   │   ├── HTML.ForbiddenAttributes.txt
│               │   │   ├── HTML.ForbiddenElements.txt
│               │   │   ├── HTML.MaxImgLength.txt
│               │   │   ├── HTML.Nofollow.txt
│               │   │   ├── HTML.Parent.txt
│               │   │   ├── HTML.Proprietary.txt
│               │   │   ├── HTML.SafeEmbed.txt
│               │   │   ├── HTML.SafeIframe.txt
│               │   │   ├── HTML.SafeObject.txt
│               │   │   ├── HTML.SafeScripting.txt
│               │   │   ├── HTML.Strict.txt
│               │   │   ├── HTML.TargetBlank.txt
│               │   │   ├── HTML.TidyAdd.txt
│               │   │   ├── HTML.TidyLevel.txt
│               │   │   ├── HTML.TidyRemove.txt
│               │   │   ├── HTML.Trusted.txt
│               │   │   ├── HTML.XHTML.txt
│               │   │   ├── Output.CommentScriptContents.txt
│               │   │   ├── Output.FixInnerHTML.txt
│               │   │   ├── Output.FlashCompat.txt
│               │   │   ├── Output.Newline.txt
│               │   │   ├── Output.SortAttr.txt
│               │   │   ├── Output.TidyFormat.txt
│               │   │   ├── Test.ForceNoIconv.txt
│               │   │   ├── URI.AllowedSchemes.txt
│               │   │   ├── URI.Base.txt
│               │   │   ├── URI.DefaultScheme.txt
│               │   │   ├── URI.DefinitionID.txt
│               │   │   ├── URI.DefinitionRev.txt
│               │   │   ├── URI.Disable.txt
│               │   │   ├── URI.DisableExternal.txt
│               │   │   ├── URI.DisableExternalResources.txt
│               │   │   ├── URI.DisableResources.txt
│               │   │   ├── URI.Host.txt
│               │   │   ├── URI.HostBlacklist.txt
│               │   │   ├── URI.MakeAbsolute.txt
│               │   │   ├── URI.Munge.txt
│               │   │   ├── URI.MungeResources.txt
│               │   │   ├── URI.MungeSecretKey.txt
│               │   │   ├── URI.OverrideAllowedSchemes.txt
│               │   │   ├── URI.SafeIframeRegexp.txt
│               │   │   └── info.ini
│               │   └── schema.ser
│               ├── EntityLookup/
│               │   └── entities.ser
│               ├── Filter/
│               │   ├── ExtractStyleBlocks.php
│               │   └── YouTube.php
│               ├── Language/
│               │   ├── classes/
│               │   │   └── en-x-test.php
│               │   └── messages/
│               │       ├── en-x-test.php
│               │       ├── en-x-testmini.php
│               │       └── en.php
│               ├── Lexer/
│               │   └── PH5P.php
│               ├── Printer/
│               │   ├── CSSDefinition.php
│               │   ├── ConfigForm.css
│               │   ├── ConfigForm.js
│               │   ├── ConfigForm.php
│               │   └── HTMLDefinition.php
│               └── Printer.php
├── module/
│   ├── blog/
│   │   ├── control.php
│   │   ├── css/
│   │   │   └── common.css
│   │   ├── lang/
│   │   │   ├── en.php
│   │   │   └── zh-cn.php
│   │   ├── model.php
│   │   └── view/
│   │       ├── create.html.php
│   │       ├── edit.html.php
│   │       ├── index.html.php
│   │       └── view.html.php
│   ├── common/
│   │   ├── lang/
│   │   │   ├── en.php
│   │   │   └── zh-cn.php
│   │   ├── model.php
│   │   └── view/
│   │       ├── footer.html.php
│   │       ├── header.html.php
│   │       └── nav.html.php
│   ├── file/
│   │   ├── config.php
│   │   ├── control.php
│   │   ├── lang/
│   │   │   ├── en.php
│   │   │   ├── zh-cn.php
│   │   │   └── zh-tw.php
│   │   └── model.php
│   └── index/
│       ├── control.php
│       ├── css/
│       │   └── index.css
│       ├── js/
│       │   └── index.js
│       ├── lang/
│       │   ├── en.php
│       │   └── zh-cn.php
│       └── view/
│           └── index.html.php
├── theme/
│   └── my.css
└── tools/
    ├── build/
    │   ├── debian/
    │   │   ├── README.Debian
    │   │   ├── changelog
    │   │   ├── compat
    │   │   ├── control
    │   │   ├── copyright
    │   │   ├── dirs
    │   │   ├── docs
    │   │   ├── files
    │   │   ├── postinst.ex
    │   │   ├── postrm.ex
    │   │   ├── preinst.ex
    │   │   ├── prerm.ex
    │   │   ├── rules
    │   │   └── watch.ex
    │   └── pear/
    │       └── package.xml
    ├── chanzhi/
    │   ├── control.class.php
    │   ├── helper.class.php
    │   ├── myrouter.class.php
    │   └── process.php
    ├── ranzhi/
    │   ├── helper.class.php
    │   ├── myrouter.class.php
    │   └── process.php
    └── zentao/
        ├── front.class.php
        ├── myrouter.class.php
        └── process.php

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
config/my.php
www/data/
release/*
tmp/extensions/*
tmp/log/*
tmp/model/*
tmp/cache/*
tmp/extension/*
.gitkeep


================================================
FILE: .htaccess
================================================
# Add support for PATH_INFO method.
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-d 
  RewriteCond %{REQUEST_FILENAME} !-f 
  RewriteRule (.*)$ index.php/$1 [L]
</IfModule>

# Set expires for static files.
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/gif A2592000
  ExpiresByType image/jpeg A2592000
  ExpiresByType image/png A2592000
  ExpiresByType image/x-icon A2592000
  ExpiresByType application/javascript A2592000
  ExpiresByType application/x-shockwave-flash A2592000
  ExpiresByType text/css A604800
</IfModule>

# Deflate static files.
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript
</IfModule>

# Turn off FileEtag.
FileEtag none


================================================
FILE: Makefile
================================================
VERSION=$(shell head -n 1 VERSION)

all: zip

clean:
	rm -fr *-stamp
	rm -fr debian/zentaophp
	rm -fr zentaoPHP-*.tgz
	rm -fr package.xml
	rm -fr ztphp*
	rm -fr *.zip
	rm -fr zentaophp
	rm -fr ztphpapi
pear:
	cp app/cli/ztphp.sh ./ztphp
	cp app/cli/ztphp.bat ./ztphp.bat
	cp package/pear/package.xml .
	pear package

pear-install:
	sudo pear uninstall zentaophp
	sudo pear install zentaoPHP*.tgz

deb:
	dpkg-buildpackage -rfakeroot

zip:
	mkdir zentaophp
	cp -fr {config,db,favicon.ico,framework,index.php,js,lib,module,theme,.htaccess} zentaophp
	rm -fr zentaophp/config/my.php
	rm -fr zentaophp/framework/tests
	rm -fr zentaophp/config/sites/*
	rm -fr zentaophp/config/domain.php
	mkdir zentaophp/tmp/log -p
	chmod 777 -R zentaophp/tmp/log
	find zentaophp -name .git |xargs rm -fr
	zip -r -9 zentaoPHP.$(VERSION).zip zentaophp
	rm -fr zentaophp
ztphpdoc:
	phpdoc -d framework,lib -t ztphpapi -o HTML:frames:phphtmllib -ti "zentaophp framework help" -s on -pp on -i *test*
	phpdoc -d framework,lib -t ztphpapi.chm -o chm:default:default -ti "zentaophp framework help" -s on -pp on -i *test*


================================================
FILE: VERSION
================================================
3.0


================================================
FILE: config/config.php
================================================
<?php
/**
 * ZenTaoPHP的config文件。如果更改配置,不要直接修改该文件,复制到my.php修改相应的值。
 * The config file of zentaophp.  Don't modify this file directly, copy the item to my.php and change it.
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */

/* 保证在命令行环境也能运行。Make sure to run in ztcli env. */
if(!class_exists('config')){class config{}}
if(!function_exists('getWebRoot')){function getWebRoot(){}}

/* 基本设置。Basic settings. */
$config->version    = '3.1';                // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. 
$config->charset    = 'UTF-8';              // ZenTaoPHP的编码。 The encoding of ZenTaoPHP.                 
$config->cookieLife = time() + 2592000;     // Cookie的生存时间。The cookie life time.                      
$config->timezone   = 'Asia/Shanghai';      // 时区设置。        The time zone setting, for more see http://www.php.net/manual/en/timezones.php.
$config->webRoot    = '';                   // URL根目录。       The root path of the url.

/* 框架路由相关设置。Routing settings. */
$config->requestType = 'PATH_INFO';         // 请求类型:PATH_INFO|PATHINFO2|GET。    The request type: PATH_INFO|PATH_INFO2|GET.
$config->requestFix  = '-';                 // PATH_INFO和PATH_INFO2模式的分隔符。    The divider in the url when PATH_INFO|PATH_INFO2.              
$config->moduleVar   = 'm';                 // 请求类型为GET:模块变量名。            requestType=GET: the module var name.               
$config->methodVar   = 'f';                 // 请求类型为GET:模块变量名。            requestType=GET: the method var name.               
$config->viewVar     = 't';                 // 请求类型为GET:视图变量名。            requestType=GET: the view var name.                 
$config->sessionVar  = 'sid';               // 请求类型为GET:session变量名。         requestType=GET: the session var name.              
$config->views       = ',html,json,mhtml,'; // 支持的视图类型。                       Supported view formats. 

/* 支持的主题和语言。Supported thems and languages. */
$config->themes['default'] = 'default'; 
$config->langs['zh-cn']    = '简体';
$config->langs['zh-tw']    = '繁体';
$config->langs['en']       = 'English';

/* 设备类型视图文件前缀。The prefix for view file for different device. */ 
$config->devicePrefix['mhtml'] = 'm.';

/* 默认值设置。Default settings. */
$config->default = new stdclass();
$config->default->view   = 'html';        //默认视图。 Default view.
$config->default->lang   = 'en';          //默认语言。 Default language.
$config->default->theme  = 'default';     //默认主题。 Default theme.
$config->default->module = 'index';       //默认模块。 Default module.
$config->default->method = 'index';       //默认方法。 Default method.

/* 数据库设置。Database settings. */
$config->db = new stdclass();
$config->slaveDB = new stdclass();
$config->db->persistant      = false;     // 是否为持续连接。       Pconnect or not.
$config->db->driver          = 'mysql';   // 目前只支持MySQL数据库。Must be MySQL. Don't support other database server yet.
$config->db->encoding        = 'UTF8';    // 数据库编码。           Encoding of database.
$config->db->strictMode      = false;     // 关闭MySQL的严格模式。  Turn off the strict mode of MySQL.
$config->db->prefix          = '';        // 数据库表名前缀。       The prefix of the table name.
$config->slaveDB->persistant = false;
$config->slaveDB->driver     = 'mysql';
$config->slaveDB->encoding   = 'UTF8';
$config->slaveDB->strictMode = false;

/* 可用域名后缀列表。Domain postfix lists. */
$config->domainPostfix  = "|com|com.cn|com.hk|com.tw|com.vc|edu.cn|es|";
$config->domainPostfix .= "|eu|fm|gov.cn|gs|hk|im|in|info|jp|kr|la|me|";
$config->domainPostfix .= "|mobi|my|name|net|net.cn|org|org.cn|pk|pro|";
$config->domainPostfix .= "|sg|so|tel|tk|to|travel|tv|tw|uk|us|ws|";
$config->domainPostfix .= "|ac.cn|bj.cn|sh.cn|tj.cn|cq.cn|he.cn|sn.cn|";
$config->domainPostfix .= "|sx.cn|nm.cn|ln.cn|jl.cn|hl.cn|js.cn|zj.cn|";
$config->domainPostfix .= "|ah.cn|fj.cn|jx.cn|sd.cn|ha.cn|hb.cn|hn.cn|";
$config->domainPostfix .= "|gd.cn|gx.cn|hi.cn|sc.cn|gz.cn|yn.cn|gs.cn|pub|pw|";
$config->domainPostfix .= "|qh.cn|nx.cn|xj.cn|tw.cn|hk.cn|mo.cn|xz.cn|xyz|wang|";
$config->domainPostfix .= "|ae|asia|biz|cc|cd|cm|cn|co|co.jp|co.kr|co.uk|";
$config->domainPostfix .= "|top|ren|club|space|tm|website|cool|company|city|email|";
$config->domainPostfix .= "|market|software|ninja|bike|today|life|co.il|io|";
$config->domainPostfix .= "|mn|ph|ps|tl|uz|vn|co.nz|cz|gg|gl|gr|je|md|me.uk|org.uk|pl|si|sx|vg|ag|";
$config->domainPostfix .= "|bz|cl|ec|gd|gy|ht|lc|ms|mx|pe|tc|vc|ac|bi|mg|mu|sc|as|com.sb|cx|ki|nf|sh|";
$config->domainPostfix .= "|rocks|social|co.com|bio|reviews|link|sexy|us.com|consulting|moda|desi|";
$config->domainPostfix .= "|menu|info|events|webcam|dating|vacations|flights|cruises|global|ca|guru|";
$config->domainPostfix .= "|futbol|rentals|dance|lawyer|attorney|democrat|republican|actor|condos|immobilien|";
$config->domainPostfix .= "|villas|foundation|expert|works|tools|watch|zone|bargains|agency|best|solar|";
$config->domainPostfix .= "|farm|pics|photo|marketing|holiday|gift|buzz|guitars|trade|construction|"; 
$config->domainPostfix .= "|international|house|coffee|florist|rich|ceo|camp|education|repair|win|site|";

/* 系统框架配置。Framework settings. */
$config->framework = new stdclass();
$config->framework->autoConnectDB  = true;  // 是否自动连接数据库。              Whether auto connect database or not.
$config->framework->multiLanguage  = false; // 是否启用多语言功能。              Whether enable multi lanuage or not.
$config->framework->multiTheme     = false; // 是否启用多风格功能。              Whether enable multi theme or not.
$config->framework->multiSite      = false; // 是否启用多站点模式。              Whether enable multi site mode or not.
$config->framework->extensionLevel = 0;     // 0=>无扩展,1=>公共扩展,2=>站点扩展 0=>no extension, 1=> common extension, 2=> every site has it's extension.
$config->framework->jsWithPrefix   = true;  // js::set()输出的时候是否增加前缀。 When us js::set(), add prefix or not.
$config->framework->filterBadKeys  = true;  // 是否过滤不合要求的键值。          Whether filter bad keys or not.
$config->framework->filterTrojan   = true;  // 是否过滤木马攻击代码。            Whether strip trojan code or not.
$config->framework->filterXSS      = true;  // 是否过滤XSS攻击代码。             Whether strip xss code or not.
$config->framework->filterParam    = 2;     // 1=>默认过滤,2=>开启过滤参数功能。0=>default filter 2=>Whether strip param.
$config->framework->purifier       = true;  // 是否对数据做purifier处理。        Whether purifier data or not.
$config->framework->logDays        = 14;    // 日志文件保存的天数。              The days to save log files.

$config->framework->detectDevice['zh-cn'] = false; // 在zh-cn语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
$config->framework->detectDevice['zh-tw'] = false; // 在zh-tw语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
$config->framework->detectDevice['en']    = false; // 在en语言情况下,是否启用设备检测功能。    Whether enable device detect or not.

/* 文件上传设置。 Upload settings. */
$config->file = new stdclass();    
$config->file->dangers = 'php,php3,php4,phtml,php5,jsp,py,rb,asp,aspx,ashx,asa,cer,cdx,aspl,shtm,shtml,html,htm';
$config->file->allowed = 'txt,doc,docx,dot,wps,wri,pdf,ppt,xls,xlsx,ett,xlt,xlsm,csv,jpg,jpeg,png,psd,gif,ico,bmp,swf,avi,rmvb,rm,mp3,mp4,3gp,flv,mov,movie,rar,zip,bz,bz2,tar,gz';

/* 配置参数过滤。Filter param settings. */
$filterConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'filter.php';
if(file_exists($filterConfig)) include $filterConfig;

/* 引用自定义的配置。 Include the custom config file. */
$myConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'my.php';
if(file_exists($myConfig)) include $myConfig;


================================================
FILE: config/filter.php
================================================
<?php
$filter = new stdclass();
$filter->rules = new stdclass();
$filter->rules->md5        = '/^[a-z0-9]{32}$/';
$filter->rules->base64     = '/^[a-zA-Z0-9\+\/\=]+$/';
$filter->rules->checked    = '/^[0-9,]+$/';
$filter->rules->idList     = '/^[0-9\|]+$/';
$filter->rules->lang       = '/^[a-zA-Z_\-]+$/';
$filter->rules->any        = '/./';
$filter->rules->number     = '/^[0-9]+$/';
$filter->rules->orderBy    = '/^\w+_(desc|asc)$/i';
$filter->rules->word       = '/^\w+$/';
$filter->rules->paramName  = '/^[a-zA-Z0-9_\.]+$/';
$filter->rules->paramValue = '/^[a-zA-Z0-9=_\-]+$/';

$filter->default = new stdclass(); 
$filter->default->moduleName = 'code';
$filter->default->methodName = 'code';
$filter->default->paramName  = 'reg::paramName';
$filter->default->paramValue = 'reg::paramValue';

$filter->default->get['onlybody'] = 'equal::yes';
$filter->default->get['HTTP_X_REQUESTED_WITH'] = 'equal::XMLHttpRequest';


================================================
FILE: config/my.example.php
================================================
<?php
$config->installed    = true;  
$config->debug        = true;  
$config->requestType  = 'GET';
$config->requestFix   = '-';
$config->webRoot      = '/'; 

$config->db->host     = 'localhost';
$config->db->port     = '3306';
$config->db->name     = 'demo'; 
$config->db->user     = 'root'; 
$config->db->password = '';

/* 如果需要配置主从数据库,取消注释即可。To use master and slave database feature, uncomment this. */

//$config->slaveDB->host     = 'localhost';
//$config->slaveDB->port     = '3306';
//$config->slaveDB->name     = 'demo';
//$config->slaveDB->user     = 'root';
//$config->slaveDB->password = '';

/* 框架功能开关参数。Use these params to enable or disable some features of framework. */
$config->framework->autoConnectDB = true;  // 是否自动连接数据库。              Whether auto connect database or not.
$config->framework->multiLanguage = true;  // 是否启用多语言功能。              Whether enable multi lanuage or not.
$config->framework->multiTheme    = false; // 是否启用多风格功能。              Whether enable multi theme or not.
$config->framework->detectDevice  = false; // 是否启用设备检测功能。            Whether enable device detect or not.
$config->framework->multiSite     = false; // 是否启用多站点模式。              Whether enable multi site mode or not.
$config->framework->extensionLevel= 0;     // 0=>无扩展,1=>公共扩展,2=>站点扩展 0=>no extension, 1=> common extension, 2=> every site has it's extension.
$config->framework->jsWithPrefix  = true;  // js::set()输出的时候是否增加前缀。 When us js::set(), add prefix or not.
$config->framework->filterBadKeys = true;  // 是否过滤不合要求的键值。          Whether filter bad keys or not.
$config->framework->filterTrojan  = true;  // 是否过滤木马攻击代码。            Whether strip trojan code or not.
$config->framework->filterXSS     = true;  // 是否过滤XSS攻击代码。             Whether strip xss code or not.
$config->framework->purifier      = true;  // 是否对数据做purifier处理。        Whether purifier data or not.
$config->framework->logDays       = 14;    // 日志文件保存的天数。              The days to save log files.


================================================
FILE: db/blog.sql
================================================
CREATE TABLE IF NOT EXISTS `blog` (
  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `title` char(120) NOT NULL,
  `content` text NOT NULL,
  `date` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;


================================================
FILE: framework/base/control.class.php
================================================
<?php /**
 * ZenTaoPHP的baseControl类。
 * The baseControl class file of ZenTaoPHP framework.
 *
 * @package framework
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 *
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
class baseControl
{
    /**
     * 全局对象 $app。
     * The global $app object.
     * 
     * @var object
     * @access public
     */
    public $app;

    /**
     * 应用名称 $appName
     * The global $appName.
     * 
     * @var string
     * @access public
     */
    public $appName;

    /**
     * 全局对象 $config。
     * The global $config object.
     * 
     * @var object
     * @access public
     */
    public $config;

    /**
     * 全局对象 $lang。
     * The global $lang object.
     * 
     * @var object
     * @access public
     */
    public $lang;

    /**
     * 全局对象 $dbh,数据库连接句柄。
     * The global $dbh object, the database connection handler.
     * 
     * @var object
     * @access public
     */
    public $dbh;

    /**
     * $dao对象,实现sql的拼装和执行。
     * The $dao object, used to join sql and excute sql.
     * 
     * @var object
     * @access public
     */
    public $dao;

    /**
     * $post对象,用户可以通过$this->post->key来引用$_POST变量。
     * The $post object, useer can access a post var by $this->post->key.
     * 
     * @var object
     * @access public
     */
    public $post;

    /**
     * $get对象,用户可以通过$this->get->key来引用$_GET变量。
     * The $get object, useer can access a get var by $this->get->key.
     * 
     * @var object
     * @access public
     */
    public $get;

    /**
     * $session对象,用户可以通过$this->session->key来引用$_SESSION变量。
     * The $session object, useer can access a session var by $this->session->key.
     * 
     * @var object
     * @access public
     */
    public $session;

    /**
     * $server对象,用户可以通过$this->server->key来引用$_SERVER变量。
     * The $server object, useer can access a server var by $this->server->key.
     * 
     * @var object
     * @access public
     */
    public $server;

    /**
     * $cookie对象,用户可以通过$this->cookie->key来引用$_COOKIE变量。
     * The $cookie object, useer can access a cookie var by $this->cookie->key.
     * 
     * @var object
     * @access public
     */
    public $cookie;

    /**
     * 当前模块的名称。
     * The name of current module.
     * 
     * @var string
     * @access public
     */
    public $moduleName;

    /**
     * $view用于存放从control传到view视图的数据。
     * The vars assigned to the view page.
     * 
     * @var object
     * @access public
     */
    public $view; 

    /**
     * 视图的类型,比如html, json。
     * The type of the view, such html, json.
     * 
     * @var string
     * @access public
     */
    public $viewType;

    /**
     * 输出到浏览器的内容。
     * The content to display.
     * 
     * @var string
     * @access public
     */
    public $output;

    /**
     * 客户端设备。
     * The client device.
     * 
     * @var string   
     * @access public
     */
    public $clientDevice;

    /**
     * 不同设备下视图文件的前缀。
     * The prefix of view file for mobile or PC. 
     * 
     * @var string   
     * @access public
     */
    public $devicePrefix;

    /**
     * 构造方法。 
     * 
     * 1. 将全局变量设为baseControl类的成员变量,方便baseControl的派生类调用; 
     * 2. 设置当前模块,读取该模块的model类;
     * 3. 初始化$view视图类。
     *
     * The construct function.
     *
     * 1. global the global vars, refer them by the class member such as $this->app.
     * 2. set the pathes of current module, and load it's model class.
     * 3. auto assign the $lang and $config to the view.
     * 
     * @param  string $moduleName 
     * @param  string $methodName 
     * @param  string $appName 
     * @access public
     * @return void
     */
    public function __construct($moduleName = '', $methodName = '', $appName = '')
    {
        /*
         * 将全局变量设为baseControl类的成员变量,方便baseControl的派生类调用。
         * Global the globals, and refer them as a class member.
         */
        global $app, $config, $lang, $dbh, $common;
        $this->app      = $app;
        $this->config   = $config;
        $this->lang     = $lang;
        $this->dbh      = $dbh;
        $this->viewType = $this->app->getViewType();
        $this->appName  = $appName ? $appName : $this->app->getAppName();

        /**
         * 设置当前模块,读取该模块的model类。
         * Load the model file auto.
         */
        $this->setModuleName($moduleName);
        $this->setMethodName($methodName);
        $this->loadModel($this->moduleName, $appName);

        /**
         * 如果客户端是手机的话,视图文件增加m.前缀。
         * If the clent is mobile, add m. as prefix for view file.
         */
        $this->setClientDevice();
        $this->setDevicePrefix();

        /**
         * 初始化$view视图类。
         * Init the view vars.
         */
        $this->view = new stdclass();
        $this->view->app     = $app;
        $this->view->lang    = $lang;
        $this->view->config  = $config;
        $this->view->common  = $common;
        $this->view->title   = '';

        /**
         * 设置超级变量,从$app引用过来。
         * Set super vars.
         */
        $this->setSuperVars();
    }

    //-------------------- Model相关方法(Model related methods) --------------------//

    /* 
     * 设置模块名。 
     * Set the module name. 
     * 
     * @param   string  $moduleName  模块名,如果为空,则从$app中获取. The module name, if empty, get it from $app.
     * @access  public
     * @return  void
     */
    public function setModuleName($moduleName = '')
    {
        $this->moduleName = $moduleName ? strtolower($moduleName) : $this->app->getModuleName();
    }

    /**
     * 设置方法名。
     * Set the method name.
     * 
     * @param   string  $methodName   方法名,如果为空,则从$app中获取。The method name, if empty, get it from $app.   
     * @access  public
     * @return  void
     */
    public function setMethodName($methodName = '')
    {
        $this->methodName = $methodName ? strtolower($methodName) : $this->app->getMethodName();
    }

    /**
     * 加载指定模块的model文件。
     * Load the model file of one module.
     * 
     * @param   string  $moduleName 模块名,如果为空,使用当前模块。The module name, if empty, use current module's name.
     * @param   string  $appName    The app name, if empty, use current app's name.
     * @access  public
     * @return  object|bool 如果没有model文件,返回false,否则返回model对象。If no model file, return false, else return the model object.
     */
    public function loadModel($moduleName = '', $appName = '')
    {
        if(empty($moduleName)) $moduleName = $this->moduleName;
        if(empty($appName))    $appName    = $this->appName;

        global $loadedModels;
        if(isset($loadedModels[$appName][$moduleName]))
        {
            $this->$moduleName = $loadedModels[$appName][$moduleName];
            $this->dao = $this->$moduleName->dao;
            return $this->$moduleName;
        }

        $modelFile = $this->app->setModelFile($moduleName, $appName);

        /**
         * 如果没有model文件,尝试加载config配置信息。
         * If no model file, try load config. 
         */
        if(!helper::import($modelFile)) 
        {
            $this->app->loadModuleConfig($moduleName, $appName);
            $this->app->loadLang($moduleName, $appName);
            $this->dao = new dao();
            return false;
        }

        /** 
         * 如果没有扩展文件,model类名是$moduleName + 'model',如果有扩展,还需要增加ext前缀。
         * If no extension file, model class name is $moduleName + 'model', else with 'ext' as the prefix.
         */
        $modelClass = class_exists('ext' . $appName . $moduleName. 'model') ? 'ext' . $appName . $moduleName . 'model' : $appName . $moduleName . 'model';
        if(!class_exists($modelClass))
        {
            $modelClass = class_exists('ext' . $moduleName. 'model') ? 'ext' . $moduleName . 'model' : $moduleName . 'model';
            if(!class_exists($modelClass)) $this->app->triggerError(" The model $modelClass not found", __FILE__, __LINE__, $exit = true);
        }

        /** 
         * 初始化model对象,在control对象中可以通过$this->$moduleName来引用。同时将dao对象赋为control对象的成员变量,方便引用。
         * Init the model object thus you can try $this->$moduleName to access it. Also assign the $dao object as a member of control object.
         */
        $loadedModels[$appName][$moduleName] = new $modelClass($appName);
        $this->$moduleName = $loadedModels[$appName][$moduleName];
        $this->dao = $this->$moduleName->dao;
        return $this->$moduleName;
    }

    /**
     * 设置超级全局变量,方便直接引用。
     * Set the super vars.
     * 
     * @access public
     * @return void
     */
    public function setSuperVars()
    {
        $this->post    = $this->app->post;
        $this->get     = $this->app->get;
        $this->server  = $this->app->server;
        $this->session = $this->app->session;
        $this->cookie  = $this->app->cookie;
    }

    /**
     * 设置客户端的设备类型。
     * Set client device.
     * 
     * @access public
     * @return void
     */
    public function setClientDevice()
    {
        $this->clientDevice = $this->app->clientDevice;
    }

    /**
     * 如果客户端是手机的话,视图文件增加m.前缀。
     * If the clent is mobile, add m. as prefix for view file.
     *
     * @access public
     * @return void
     */
    public function setDevicePrefix()
    {
        $this->devicePrefix = zget($this->config->devicePrefix, $this->viewType, '');
    }

    //-------------------- 视图相关方法(View related methods) --------------------//

    /**
     * 设置视图文件:主视图文件,扩展视图文件, 站点扩展视图文件,以及钩子脚本。
     * Set view files: the main file, extension view file, site extension view file and hook files.
     * 
     * @param  string   $moduleName    module name
     * @param  string   $methodName    method name
     * @access public
     * @return string  the view file
     */
    public function setViewFile($moduleName, $methodName)
    {
        $moduleName = strtolower(trim($moduleName));
        $methodName = strtolower(trim($methodName));

        $modulePath  = $this->app->getModulePath($this->appName, $moduleName);
        $viewExtPath = $this->app->getModuleExtPath($this->appName, $moduleName, 'view');

        $viewType     = $this->viewType == 'mhtml' ? 'html' : $this->viewType;
        $mainViewFile = $modulePath . 'view' . DS . $this->devicePrefix . $methodName . '.' . $viewType . '.php';
        $viewFile     = $mainViewFile;

        if(!empty($viewExtPath))
        {
            $commonExtViewFile = $viewExtPath['common'] . $this->devicePrefix . $methodName . ".{$viewType}.php";
            $siteExtViewFile   = empty($viewExtPath['site']) ? '' : $viewExtPath['site'] . $this->devicePrefix . $methodName . ".{$viewType}.php";

            $viewFile = file_exists($commonExtViewFile) ? $commonExtViewFile : $mainViewFile;
            $viewFile = (!empty($siteExtViewFile) and file_exists($siteExtViewFile)) ? $siteExtViewFile : $viewFile;
            if(!is_file($viewFile)) $this->app->triggerError("the view file $viewFile not found", __FILE__, __LINE__, $exit = true);

            $commonExtHookFiles = glob($viewExtPath['common'] . $this->devicePrefix . $methodName . ".*.{$viewType}.hook.php");
            $siteExtHookFiles   = empty($viewExtPath['site']) ? '' : glob($viewExtPath['site'] . $this->devicePrefix . $methodName . ".*.{$viewType}.hook.php");
            $extHookFiles       = array_merge((array) $commonExtHookFiles, (array) $siteExtHookFiles);
        }

        if(!empty($extHookFiles)) return array('viewFile' => $viewFile, 'hookFiles' => $extHookFiles);
        return $viewFile;
    }

    /**
     * 获取某一个视图文件的扩展。
     * Get the extension file of an view.
     * 
     * @param  string $viewFile 
     * @access public
     * @return string|bool  If extension view file exists, return the path. Else return fasle.
     */
    public function getExtViewFile($viewFile)
    {
        /**
         * 首先找sitecode下的扩展文件,如果没有,再找ext下的扩展文件。 
         * Find extViewFile in ext/_$siteCode/view first, then try ext/view/.
         */
        if($this->app->siteCode)
        {
            $extPath     = dirname(dirname(realpath($viewFile))) . "/ext/_{$this->app->siteCode}/view";
            $extViewFile = $extPath . basename($viewFile);

            if(file_exists($extViewFile))
            {
                helper::cd($extPath);
                return $extViewFile;
            }
        }

        $extPath = dirname(dirname(realpath($viewFile))) . '/ext/view/';
        $extViewFile = $extPath . basename($viewFile);
        if(file_exists($extViewFile))
        {
            helper::cd($extPath);
            return $extViewFile;
        }
        return false;
    }

    /**
     * 获取适用于当前方法的css:该模块公用的css + 当前方法的css + 扩展的css。
     * Get css codes applied to current method: module common css + method css + extension css.
     * 
     * @param  string    $moduleName 
     * @param  string    $methodName 
     * @access public
     * @return string
     */
    public function getCSS($moduleName, $methodName)
    {
        $moduleName   = strtolower(trim($moduleName));
        $methodName   = strtolower(trim($methodName));

        $modulePath   = $this->app->getModulePath($this->appName, $moduleName);
        $cssExtPath   = $this->app->getModuleExtPath($this->appName, $moduleName, 'css') ;

        $css = '';
        $mainCssFile   = $modulePath . 'css' . DS . $this->devicePrefix . 'common.css';
        $methodCssFile = $modulePath . 'css' . DS . $this->devicePrefix . $methodName . '.css';
        if(file_exists($mainCssFile)) $css .= file_get_contents($mainCssFile);
        if(is_file($methodCssFile))   $css .= file_get_contents($methodCssFile);

        if(!empty($cssExtPath))
        {
            $cssMethodExt = $cssExtPath['common'] . $methodName . DS;
            $cssCommonExt = $cssExtPath['common'] . 'common' . DS;

            $cssExtFiles = glob($cssCommonExt . $this->devicePrefix . '*.css');
            if(!empty($cssExtFiles) and is_array($cssExtFiles)) foreach($cssExtFiles as $cssFile) $css .= file_get_contents($cssFile);

            $cssExtFiles = glob($cssMethodExt . $this->devicePrefix . '*.css');
            if(!empty($cssExtFiles) and is_array($cssExtFiles)) foreach($cssExtFiles as $cssFile) $css .= file_get_contents($cssFile);

            if(!empty($cssExtPath['site']))
            {
                $cssMethodExt = $cssExtPath['site'] . $methodName . DS;
                $cssCommonExt = $cssExtPath['site'] . 'common' . DS;
                $cssExtFiles = glob($cssCommonExt . $this->devicePrefix . '*.css');
                if(!empty($cssExtFiles) and is_array($cssExtFiles)) foreach($cssExtFiles as $cssFile) $css .= file_get_contents($cssFile);

                $cssExtFiles = glob($cssMethodExt . $this->devicePrefix . '*.css');
                if(!empty($cssExtFiles) and is_array($cssExtFiles)) foreach($cssExtFiles as $cssFile) $css .= file_get_contents($cssFile);
            }
        }

        return $css;
    }

    /**
     * 获取适用于当前方法的js:该模块公用的js + 当前方法的js + 扩展的js。
     * Get js codes applied to current method: module common js + method js + extension js.
     * 
     * @param  string    $moduleName 
     * @param  string    $methodName 
     * @access public
     * @return string
     */
    public function getJS($moduleName, $methodName)
    {
        $moduleName  = strtolower(trim($moduleName));
        $methodName  = strtolower(trim($methodName));

        $modulePath  = $this->app->getModulePath($this->appName, $moduleName);
        $jsExtPath   = $this->app->getModuleExtPath($this->appName, $moduleName, 'js');

        $js = '';
        $mainJsFile   = $modulePath . 'js' . DS . $this->devicePrefix . 'common.js';
        $methodJsFile = $modulePath . 'js' . DS . $this->devicePrefix . $methodName . '.js';
        if(file_exists($mainJsFile))   $js .= file_get_contents($mainJsFile);
        if(is_file($methodJsFile))     $js .= file_get_contents($methodJsFile);

        if(!empty($jsExtPath))
        {
            $jsMethodExt = $jsExtPath['common'] . $methodName . DS;
            $jsCommonExt = $jsExtPath['common'] . 'common' . DS;

            $jsExtFiles = glob($jsCommonExt . $this->devicePrefix . '*.js');
            if(!empty($jsExtFiles) and is_array($jsExtFiles)) foreach($jsExtFiles as $jsFile) $js .= file_get_contents($jsFile);

            $jsExtFiles = glob($jsMethodExt . $this->devicePrefix . '*.js');
            if(!empty($jsExtFiles) and is_array($jsExtFiles)) foreach($jsExtFiles as $jsFile) $js .= file_get_contents($jsFile);

            if(!empty($jsExtPath['site']))
            {
                $jsMethodExt = $jsExtPath['site'] . $methodName . DS;
                $jsCommonExt = $jsExtPath['site'] . 'common' . DS;

                $jsExtFiles = glob($jsCommonExt . $this->devicePrefix . '*.js');
                if(!empty($jsExtFiles) and is_array($jsExtFiles)) foreach($jsExtFiles as $jsFile) $js .= file_get_contents($jsFile);

                $jsExtFiles = glob($jsMethodExt . $this->devicePrefix . '*.js');
                if(!empty($jsExtFiles) and is_array($jsExtFiles)) foreach($jsExtFiles as $jsFile) $js .= file_get_contents($jsFile);
            }
        }
        
        return $js;
    }

    /**
     * 向$view传递一个变量。
     * Assign one var to the view vars.
     * 
     * @param   string  $name       the name.
     * @param   mixed   $value      the value.
     * @access  public
     * @return  void
     */
    public function assign($name, $value)
    {
        $this->view->$name = $value;
    }

    /**
     * 清空$output。
     * Clear the output.
     *
     * @access public
     * @return void
     */
    public function clear()
    {
        $this->output = '';
    }

    /**
     * 渲染视图文件。
     * Parse view file. 
     *
     * @param  string $moduleName    module name, if empty, use current module.
     * @param  string $methodName    method name, if empty, use current method.
     * @access public
     * @return string the parsed result.
     */
    public function parse($moduleName = '', $methodName = '')
    {
        if(empty($moduleName)) $moduleName = $this->moduleName;
        if(empty($methodName)) $methodName = $this->methodName;

        if($this->viewType == 'json') $this->parseJSON($moduleName, $methodName);
        if($this->viewType != 'json') $this->parseDefault($moduleName, $methodName);

        return $this->output;
    }

    /**
     * 渲染json格式。
     * Parse json format.
     *
     * @param string $moduleName    module name
     * @param string $methodName    method name
     * @access public
     * @return void
     */
    public function parseJSON($moduleName, $methodName)
    {
        unset($this->view->app);
        unset($this->view->config);
        unset($this->view->lang);
        unset($this->view->header);
        unset($this->view->position);
        unset($this->view->moduleTree);
        unset($this->view->common);
        unset($this->view->pager->app);
        unset($this->view->pager->lang);

        $output['status'] = is_object($this->view) ? 'success' : 'fail';
        $output['data']   = json_encode($this->view);
        $output['md5']    = md5(json_encode($this->view));

        $this->output = json_encode($output);
    }

    /**
     * 默认渲染方法,适用于viewType = html的时候。
     * Default parse method when viewType != json, like html.
     *
     * @param string $moduleName    module name
     * @param string $methodName    method name
     * @access public
     * @return void
     */
    public function parseDefault($moduleName, $methodName)
    {
        /**
         * 设置视图文件。(PHP7有一个bug,不能直接$viewFile = $this->setViewFile())。
         * Set viewFile. (Can't assign $viewFile = $this->setViewFile() directly because one php7's bug.)
         */
        $results  = $this->setViewFile($moduleName, $methodName);
        $viewFile = $results;
        if(is_array($results)) extract($results);

        /**
         * 获得当前页面的CSS和JS。
         * Get css and js codes for current method. 
         */
        $css = $this->getCSS($moduleName, $methodName);
        $js  = $this->getJS($moduleName, $methodName);
        if($css) $this->view->pageCSS = $css;
        if($js)  $this->view->pageJS  = $js;

        /**
         * 切换到视图文件所在的目录,以保证视图文件里面的include语句能够正常运行。
         * Change the dir to the view file to keep the relative pathes work. 
         */
        $currentPWD = getcwd();
        chdir(dirname($viewFile));

        /**
         * 使用extract安定ob方法渲染$viewFile里面的代码。
         * Use extract and ob functions to eval the codes in $viewFile.
         */
        extract((array)$this->view);
        ob_start();
        include $viewFile;
        if(isset($hookFiles)) foreach($hookFiles as $hookFile) if(file_exists($hookFile)) include $hookFile;
        $this->output .= ob_get_contents();
        ob_end_clean();

        /**
         * 渲染完毕后,再切换回之前的路径。
         * At the end, chang the dir to the previous. 
         */
        chdir($currentPWD);
    }

    /**
     * 获取一个方法的输出内容,这样我们可以在一个方法里获取其他模块方法的内容。
     * 如果模块名为空,则调用该模块、该方法;如果设置了模块名,调用指定模块指定方法。
     *
     * Get the output of one module's one method as a string, thus in one module's method, can fetch other module's content.
     * If the module name is empty, then use the current module and method. If set, use the user defined module and method.
     *
     * @param   string  $moduleName    module name.
     * @param   string  $methodName    method name.
     * @param   array   $params        params.
     * @access  public
     * @return  string  the parsed html.
     */
    public function fetch($moduleName = '', $methodName = '', $params = array(), $appName = '')
    {
        /**
         * 如果模块名为空,则调用该模块、该方法。
         * If the module name is empty, then use the current module and method.
         */
        if($moduleName == '') $moduleName = $this->moduleName;
        if($methodName == '') $methodName = $this->methodName;
        if($appName == '')    $appName    = $this->appName;
        if($moduleName == $this->moduleName and $methodName == $this->methodName) 
        {
            $this->parse($moduleName, $methodName);
            return $this->output;
        }

        $currentModuleName = $this->moduleName;
        $currentMethodName = $this->methodName;
        $currentAppName    = $this->appName;
        $currentParams     = $this->app->getParams();

        /**
         * 设置调用指定模块的指定方法。
         * chang the dir to the previous.
         */
        $this->app->setModuleName($moduleName);
        $this->app->setMethodName($methodName);

        if(!is_array($params)) parse_str($params, $params);
        $this->app->params = $params;

        $currentPWD = getcwd();

        /**
         * 设置引用的文件和路径。
         * Set the pathes and files to included.
         */
        $modulePath        = $this->app->getModulePath($appName, $moduleName);
        $moduleControlFile = $modulePath . 'control.php';
        $actionExtPath     = $this->app->getModuleExtPath($appName, $moduleName, 'control');
        $file2Included     = $moduleControlFile;

        if(!empty($actionExtPath))
        {
            /**
             * 设置公共扩展。
             * set common extension.
             */
            $commonActionExtFile = $actionExtPath['common'] . strtolower($methodName) . '.php';
            $file2Included       = file_exists($commonActionExtFile) ? $commonActionExtFile : $moduleControlFile;

            if(!empty($actionExtPath['site']))
            {
                /**
                 * 设置站点扩展。
                 * every site has it's extension.
                 */
                $siteActionExtFile = $actionExtPath['site'] . strtolower($methodName) . '.php';
                $file2Included     = file_exists($siteActionExtFile) ? $siteActionExtFile : $file2Included;
            }
        }

        /**
         * 加载控制器文件。
         * Load the control file. 
         */
        if(!is_file($file2Included)) $this->app->triggerError("The control file $file2Included not found", __FILE__, __LINE__, $exit = true);
        chdir(dirname($file2Included));
        if($moduleName != $this->moduleName) helper::import($file2Included);

        /**
         * 设置调用的类名。
         * Set the name of the class to be called. 
         */
        $className = class_exists("my$moduleName") ? "my$moduleName" : $moduleName;
        if(!class_exists($className)) $this->app->triggerError(" The class $className not found", __FILE__, __LINE__, $exit = true);

        /**
         * 解析参数,创建模块control对象。
         * Parse the params, create the $module control object. 
         */
        $module = new $className($moduleName, $methodName, $appName);

        /**
         * 调用对应方法,使用ob方法获取输出内容。
         * Call the method and use ob function to get the output. 
         */
        ob_start();
        call_user_func_array(array($module, $methodName), $params);
        $output = ob_get_contents();
        ob_end_clean();
        
        unset($module);

        /**
         * 切换回之前的模块和方法。
         * Chang the module、method to the previous.
         */
        $this->app->setModuleName($currentModuleName);
        $this->app->setMethodName($currentMethodName);
        $this->app->params = $currentParams;

        chdir($currentPWD);

        /**
         * 返回内容。
         * Return the content. 
         */
        return $output;
    }

    /**
     * 向浏览器输出内容。
     * Print the content of the view. 
     *
     * @param   string  $moduleName    module name
     * @param   string  $methodName    method name
     * @access  public
     * @return  void
     */
    public function display($moduleName = '', $methodName = '')
    {
        if(empty($this->output)) $this->parse($moduleName, $methodName);
        echo $this->output;
    }

    /** 
     * 直接输出data数据,通常用于ajax请求中。
     * Send data directly, for ajax requests.
     *
     * @param  misc   $data 
     * @param  string $type 
     * @access public
     * @return void
     */
    public function send($data, $type = 'json')
    {
        if($type != 'json') die();

        $data = (array) $data;
        if(helper::isAjaxRequest() or $this->viewType == 'json') print(json_encode($data)) and die(helper::removeUTF8Bom(ob_get_clean()));

        /**
         * 响应非ajax的请求。
         * Response request not ajax. 
         */
        if(isset($data['result']) and $data['result'] == 'success')
        {
            if(!empty($data['message'])) echo js::alert($data['message']);
            $locate = isset($data['locate']) ? $data['locate'] : (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '');
            if(!empty($locate)) die(js::locate($locate));
            die(isset($data['message']) ? $data['message'] : 'success');
        }

        if(isset($data['result']) and $data['result'] == 'fail')
        {
            if(!empty($data['message']))
            {
                $message = json_decode(json_encode((array)$data['message']));
                foreach((array)$message as $item => $errors) $message->$item = implode(',', $errors);
                echo js::alert(strip_tags(implode(" ", (array) $message)));
                die(js::locate('back'));
            }
            die('fail');
        }
    }

    /**
     * 创建一个模块方法的链接。
     * Create a link to one method of one module.
     *
     * @param   string         $moduleName    module name
     * @param   string         $methodName    method name
     * @param   string|array   $vars          the params passed, can be array(key=>value) or key1=value1&key2=value2
     * @param   string         $viewType      the view type
     * @access  public
     * @return  string the link string.
     */
    public function createLink($moduleName, $methodName = 'index', $vars = array(), $viewType = '', $onlybody = false)
    {
        if(empty($moduleName)) $moduleName = $this->moduleName;
        return helper::createLink($moduleName, $methodName, $vars, $viewType, $onlybody);
    }

    /**
     * 创建当前模块的一个方法链接。
     * Create a link to the inner method of current module.
     * 
     * @param   string         $methodName    method name
     * @param   string|array   $vars          the params passed, can be array(key=>value) or key1=value1&key2=value2
     * @param   string         $viewType      the view type
     * @access  public
     * @return  string  the link string.
     */
    public function inlink($methodName = 'index', $vars = array(), $viewType = '', $onlybody = false)
    {
        return helper::createLink($this->moduleName, $methodName, $vars, $viewType, $onlybody);
    }

    /**
     * 重定向到另一个页面。
     * Location to another page.
     * 
     * @param   string   $url   the target url.
     * @access  public
     * @return  void
     */
    public function locate($url)
    {
        header("location: $url");
        exit;
    }
}


================================================
FILE: framework/base/helper.class.php
================================================
<?php
/**
 * ZenTaoPHP的baseHelper类。
 * The baseHelper class file of ZenTaoPHP framework.
 *
 * @package framework
 *
 * The author disclaims copyright to this source code. In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
class baseHelper
{
    /**
     * 设置一个对象的成员变量。
     * Set the member's value of one object.
     * <code>
     * <?php
     * $lang->db->user = 'wwccss';
     * helper::setMember('lang', 'db.user', 'chunsheng.wang');
     * ?>
     * </code>
     * @param string    $objName    the var name of the object.
     * @param string    $key        the key of the member, can be parent.child.
     * @param mixed     $value      the value to be set.
     * @static
     * @access public
     * @return bool
     */
    static public function setMember($objName, $key, $value)
    {
        global $$objName;
        if(!is_object($$objName) or empty($key)) return false;
        $key   = str_replace('.', '->', $key);
        $value = serialize($value);
        $code  = ("\$${objName}->{$key}=unserialize(<<<EOT\n$value\nEOT\n);");
        eval($code);
        return true;
    }

    /**
     * 生成一个模块方法的链接。control类的createLink实际上调用的是这个方法。
     * Create a link to a module's method, mapped in control class to call conveniently.
     *
     * <code>
     * <?php
     * helper::createLink('hello', 'index', 'var1=value1&var2=value2');
     * helper::createLink('hello', 'index', array('var1' => 'value1', 'var2' => 'value2');
     * ?>
     * </code>
     * @param string       $moduleName     module name, can pass appName like app.module.
     * @param string       $methodName     method name
     * @param string|array $vars           the params passed to the method, can be array('key' => 'value') or key1=value1&key2=value2) or key1=value1&key2=value2
     * @param string       $viewType       the view type
     * @param bool         $onlyBody       pass onlyBody=yes to the link thus the app can control the header and footer hide or show..
     * @static
     * @access public
     * @return string the link string.
     */
    static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = '', $onlyBody = false)
    {
        /* 设置$appName和$moduleName。Set appName and moduleName. */
        global $app, $config;
        if(strpos($moduleName, '.') !== false) 
        {
            list($appName, $moduleName) = explode('.', $moduleName);
        }
        else
        {
            $appName = $app->getAppName();
        }
        if(!empty($appName)) $appName .= '/';

        /* 处理$viewType和$vars。Set $viewType and $vars. */
        if(empty($viewType)) $viewType = $app->getViewType();
        if(!is_array($vars)) parse_str($vars, $vars);

        /* 生成url链接的开始部分。Set the begin parts of the link. */
        if($config->requestType == 'PATH_INFO')  $link = $config->webRoot . $appName;
        if($config->requestType != 'PATH_INFO')  $link = $config->webRoot . $appName . basename($_SERVER['SCRIPT_NAME']);
        if($config->requestType == 'PATH_INFO2') $link .= '/';

        /**
         * #1: RequestType为GET。When the requestType is GET. 
         * Input: moduleName=article&methodName=index&var1=value1. Output: ?m=article&f=index&var1=value1.
         *
         */
        if($config->requestType == 'GET')
        {
            $link .= "?{$config->moduleVar}=$moduleName&{$config->methodVar}=$methodName";
            if($viewType != 'html') $link .= "&{$config->viewVar}=" . $viewType;
            foreach($vars as $key => $value) $link .= "&$key=$value";
            return self::processOnlyBodyParam($link, $onlyBody);
        }

        /**
         * #2: 方法名不是默认值或者是默认值,但有传参。MethodName equals the default method or vars not empty. 
         * Input: moduleName=article&methodName=view. Output: article-view.html
         * Input: moduleName=article&methodName=view. Output: article-index-abc.html
         *
         */
        if($methodName != $config->default->method or !empty($vars))
        {
            $link .= "$moduleName{$config->requestFix}$methodName";
            foreach($vars as $value) $link .= "{$config->requestFix}$value";
            $link .= '.' . $viewType;

            return self::processOnlyBodyParam($link, $onlyBody);
        }

        /**
         * #3: 方法名为默认值且没有传参且模块名为默认值。MethodName is the default and moduleName is default and vars empty. 
         * Input: moduleName=index&methodName=index. Output: index.html
         *
         */
        if($moduleName == $config->default->module)
        {
            $link .= $config->default->method . '.' . $viewType; 
            return self::processOnlyBodyParam($link, $onlyBody);
        }

        /**
         * #4: 方法名为默认值且没有传参且模块名不为默认值,viewType和app指定的相等。MethodName is default but moduleName not and viewType equal app's viewType.. 
         * Input: moduleName=article&methodName=index&viewType=html. Output: /article/
         *
         */
        if($viewType == $app->getViewType())
        {
            $link .= $moduleName . '/';
            return self::processOnlyBodyParam($link, $onlyBody);
        }

        /**
         * #5: 方法名为默认值且没有传参且模块名不为默认值,viewType有另外指定。MethodName is default but moduleName not and viewType no equls app's viewType. 
         * Input: moduleName=article&methodName=index&viewType=json. Output: /article.json
         *
         */
        $link .= $moduleName . '.' . $viewType;
        return self::processOnlyBodyParam($link, $onlyBody);
    }

    /**
     * 处理onlyBody 参数。
     * Process the onlyBody param in url.
     *
     * 如果传参的时候设定了$onlyBody为真,或者当前页面请求中包含了onlybody=yes,在生成链接的时候继续追加。
     * If $onlyBody set to true or onlybody=yes in the url, append onlyBody param to the link.
     * 
     * @param  string  $link 
     * @param  bool    $onlyBody 
     * @static
     * @access public
     * @return string
     */
    public static function processOnlyBodyParam($link, $onlyBody = false)
    {
        global $config;
        if(!$onlyBody and !self::inOnlyBodyMode()) return $link;
        $onlybodyString = $config->requestType != 'GET' ? "?onlybody=yes" : "&onlybody=yes";
        return $link . $onlybodyString;
    }

    /**
     * 检查是否是onlybody模式。
     * Check in only body mode or not.
     * 
     * @access public
     * @return void
     */
    public static function inOnlyBodyMode()
    {
        return (isset($_GET['onlybody']) and $_GET['onlybody'] == 'yes');
    }

    /**
     * 使用helper::import()来引入文件,不要直接使用include或者require. 
     * Using helper::import() to import a file, instead of include or require.
     *
     * @param string    $file   the file to be imported.
     * @static
     * @access public
     * @return bool
     */
    static public function import($file)
    {
        $file = realpath($file);
        if(!is_file($file)) return false;

        static $includedFiles = array();
        if(!isset($includedFiles[$file]))
        {
            include $file;
            $includedFiles[$file] = true;
            return true;
        }

        return true;
    }

    /**
     * 将数组或者列表转化成 IN( 'a', 'b') 的形式。
     * Convert a list to  IN('a', 'b') string.
     * 
     * @param   string|array $idList   列表,可以是数组或者用逗号隔开的列表。The id lists, can be a array or a string joined with comma.
     * @static
     * @access  public
     * @return  string  the string like IN('a', 'b').
     */
    static public function dbIN($idList)
    {
        if(is_array($idList)) 
        {
            if(!function_exists('get_magic_quotes_gpc') or !get_magic_quotes_gpc())
            {
                foreach ($idList as $key=>$value)  $idList[$key] = addslashes($value); 
            }
            return "IN ('" . join("','", $idList) . "')";
        }

        if(!function_exists('get_magic_quotes_gpc') or !get_magic_quotes_gpc()) $idList = addslashes($idList);
        return "IN ('" . str_replace(',', "','", str_replace(' ', '', $idList)) . "')";
    }

    /**
     * 安全的Base64编码,框架对'/'字符比较敏感,转换为'.'。
     * Create safe base64 encoded string for the framework.
     * 
     * @param   string  $string   the string to encode.
     * @static
     * @access  public
     * @return  string  encoded string.
     */
    static public function safe64Encode($string)
    {
        return strtr(base64_encode($string), '/', '.');
    }

    /**
     * 解码base64,先将之前的'.' 转换回'/'
     * Decode the string encoded by safe64Encode.
     * 
     * @param   string  $string   the string to decode
     * @static
     * @access  public
     * @return  string  decoded string.
     */
    static public function safe64Decode($string)
    {
        return base64_decode(strtr($string, '.', '/'));
    }

    /**
     * JSON编码,自动处理转义的问题。
     * JSON encode, process the slashes.
     * 
     * @param   mixed  $data   the object to encode
     * @static
     * @access  public
     * @return  string  decoded string.
     */
    static public function jsonEncode($data)
    {
        return (function_exists('get_magic_quotes_gpc') and get_magic_quotes_gpc()) ? addslashes(json_encode($data)) : json_encode($data);
    }

    /**
     * 判断是否是utf8编码
     * Judge a string is utf-8 or not.
     * 
     * @author hmdker@gmail.com
     * @param  string    $string 
     * @see    http://php.net/manual/en/function.mb-detect-encoding.php
     * @static
     * @access public
     * @return bool
     */
    static public function isUTF8($string)
    {
        $c    = 0; 
        $b    = 0;
        $bits = 0;
        $len  = strlen($string);
        for($i=0; $i<$len; $i++)
        {
            $c = ord($string[$i]);
            if($c > 128)
            {
                if(($c >= 254)) return false;
                elseif($c >= 252) $bits=6;
                elseif($c >= 248) $bits=5;
                elseif($c >= 240) $bits=4;
                elseif($c >= 224) $bits=3;
                elseif($c >= 192) $bits=2;
                else return false;
                if(($i+$bits) > $len) return false;
                while($bits > 1)
                {
                    $i++;
                    $b=ord($string[$i]);
                    if($b < 128 || $b > 191) return false;
                    $bits--;
                }
            }
        }
        return true;
    }

    /**
     * 去掉UTF-8 Bom头。
     * Remove UTF-8 Bom.
     * 
     * @param  string    $string
     * @access public
     * @return string
     */
    public static function removeUTF8Bom($string)
    {
        if(substr($string, 0, 3) == pack('CCC', 239, 187, 191)) return substr($string, 3);
        return $string;
    }

    /**
     * 增强substr方法:支持多字节语言,比如中文。
     * Enhanced substr version: support multibyte languages like Chinese.
     *
     * @param string    $string
     * @param int       $length 
     * @param string    $append 
     * @return string 
     */
    public static function substr($string, $length, $append = '')
    {
        $rawString = $string;

        if(function_exists('mb_substr')) $string = mb_substr($string, 0, $length, 'utf-8');

        preg_match_all("/./su", $string, $data);
        $string = join("", array_slice($data[0],  0, $length));

        return ($string != $rawString) ? $string . $append : $string;
    }

    /**
     * Get browser name and version.
     * 
     * @access public
     * @return array
     */
    public static function getBrowser()
    {
        $browser = array('name'=>'unknown', 'version'=>'unknown');

        if(empty($_SERVER['HTTP_USER_AGENT'])) return $browser;

        $agent = $_SERVER["HTTP_USER_AGENT"];

        /* Chrome should checked before safari.*/
        if(strpos($agent, 'Firefox') !== false) $browser['name'] = "firefox";
        if(strpos($agent, 'Opera') !== false)   $browser['name'] = 'opera';
        if(strpos($agent, 'Safari') !== false)  $browser['name'] = 'safari';
        if(strpos($agent, 'Chrome') !== false)  $browser['name'] = "chrome";

        /* Check the name of browser */
        if(strpos($agent, 'MSIE') !== false || strpos($agent, 'rv:11.0')) $browser['name'] = 'ie';
        if(strpos($agent, 'Edge') !== false) $browser['name'] = 'edge';

        /* Check the version of browser */
        if(preg_match('/MSIE\s(\d+)\..*/i', $agent, $regs))       $browser['version'] = $regs[1];
        if(preg_match('/FireFox\/(\d+)\..*/i', $agent, $regs))    $browser['version'] = $regs[1];
        if(preg_match('/Opera[\s|\/](\d+)\..*/i', $agent, $regs)) $browser['version'] = $regs[1];
        if(preg_match('/Chrome\/(\d+)\..*/i', $agent, $regs))     $browser['version'] = $regs[1];

        if((strpos($agent, 'Chrome') == false) && preg_match('/Safari\/(\d+)\..*$/i', $agent, $regs)) $browser['version'] = $regs[1];
        if(preg_match('/rv:(\d+)\..*/i', $agent, $regs)) $browser['version'] = $regs[1];
        if(preg_match('/Edge\/(\d+)\..*/i', $agent, $regs)) $browser['version'] = $regs[1];

        return $browser;
    }

    /**
     * Get client os from agent info. 
     * 
     * @static
     * @access public
     * @return string
     */
    public static function getOS()
    {
        if(empty($_SERVER['HTTP_USER_AGENT'])) return 'unknow';

        $osList = array();
        $osList['/windows nt 10/i']      = 'Windows 10';
        $osList['/windows nt 6.3/i']     = 'Windows 8.1';
        $osList['/windows nt 6.2/i']     = 'Windows 8';
        $osList['/windows nt 6.1/i']     = 'Windows 7';
        $osList['/windows nt 6.0/i']     = 'Windows Vista';
        $osList['/windows nt 5.2/i']     = 'Windows Server 2003/XP x64';
        $osList['/windows nt 5.1/i']     = 'Windows XP';
        $osList['/windows xp/i']         = 'Windows XP';
        $osList['/windows nt 5.0/i']     = 'Windows 2000';
        $osList['/windows me/i']         = 'Windows ME';
        $osList['/win98/i']              = 'Windows 98';
        $osList['/win95/i']              = 'Windows 95';
        $osList['/win16/i']              = 'Windows 3.11';
        $osList['/macintosh|mac os x/i'] = 'Mac OS X';
        $osList['/mac_powerpc/i']        = 'Mac OS 9';
        $osList['/linux/i']              = 'Linux';
        $osList['/ubuntu/i']             = 'Ubuntu';
        $osList['/iphone/i']             = 'iPhone';
        $osList['/ipod/i']               = 'iPod';
        $osList['/ipad/i']               = 'iPad';
        $osList['/android/i']            = 'Android';
        $osList['/blackberry/i']         = 'BlackBerry';
        $osList['/webos/i']              = 'Mobile';

        foreach ($osList as $regex => $value)
        { 
            if(preg_match($regex, $_SERVER['HTTP_USER_AGENT'])) return $value; 
        }   

        return 'unknown';
    }
    
    /**
     *  计算两个日期相差的天数,取整。
     *  Compute the diff days of two date.
     * 
     * @param   string $date1   the first date.
     * @param   string $date2   the sencond date.
     * @access  public
     * @return  int  the diff of the two days.
     */
    static public function diffDate($date1, $date2)
    {
        return round((strtotime($date1) - strtotime($date2)) / 86400, 0);
    }

    /**
     *  获取当前时间,使用common语言文件定义的DT_DATETIME1常量。
     *  Get now time use the DT_DATETIME1 constant defined in the lang file.
     * 
     * @access  public
     * @return  datetime  now
     */
    static public function now()
    {
        return date(DT_DATETIME1);
    }

    /**
     *  获取当前日期,使用common语言文件定义的DT_DATE1常量。
     *  Get today according to the  DT_DATE1 constant defined in the lang file.
     *
     * @access  public
     * @return  date  today
     */
    static public function today()
    {
        return date(DT_DATE1);
    }

    /**
     *  获取当前日期,使用common语言文件定义的DT_TIME1常量。
     *  Get now time use the DT_TIME1 constant defined in the lang file.
     * 
     * @access  public
     * @return  date  today
     */
    static public function time()
    {
        return date(DT_TIME1);
    }

    /**
     *  判断日期是不是零。
     *  Judge a date is zero or not.
     * 
     * @access  public
     * @return  bool
     */
    static public function isZeroDate($date)
    {
        return substr($date, 0, 4) == '0000';
    }

    /**
     *  列出目录中符合该正则表达式的文件。
     *  Get files match the pattern under a directory.
     * 
     * @access  public
     * @return  array   the files match the pattern
     */
    static public function ls($dir, $pattern = '')
    {
        if(empty($dir)) return array();

        $files = array();
        $dir   = realpath($dir);
        if(is_dir($dir)) $files = glob($dir . DIRECTORY_SEPARATOR . '*' . $pattern);
        return empty($files) ? array() : $files;
    }

    /**
     * 切换目录。第一次调用的时候记录当前的路径,再次调用的时候切换回之前的路径。
     * Change directory: first call, save the $cwd, secend call, change to $cwd.
     * 
     * @param  string $path 
     * @static
     * @access public
     * @return void
     */
    static function cd($path = '')
    {
        static $cwd = '';
        if($path) $cwd = getcwd();
        !empty($path) ? chdir($path) : chdir($cwd);
    }

    /**
     * 通过域名获取站点代号。
     * Get siteCode for a domain.
     *
     * www.xirang.com => xirang
     * xirang.com     => xirang
     * xirang.com.cn  => xirang
     * xirang.cn      => xirang
     * xirang         => xirang
     *
     * @param  string $domain
     * @return string $siteCode
     **/ 
    public static function parseSiteCode($domain)
    {
        global $config;

        /* 去除域名中的端口部分。Remove the port part of the domain. */
        if(strpos($domain, ':') !== false) $domain = substr($domain, 0, strpos($domain, ':'));
        $domain = strtolower($domain);

        /* $config里面有定义或者是localhost,直接返回。 Return directly if defined in $config or is localhost. */
        if(isset($config->siteCodeList[$domain])) return $config->siteCodeList[$domain];
        if($domain == 'localhost') return $domain;

        /* 将域名中的-改为_。Replace '-' with '_' in the domain. */
        $domain = str_replace('-', '_', $domain);
        $items  = explode('.', $domain);

        /* 类似a.com的形式。 Domain like a.com. */
        $postfix = str_replace($items[0] . '.', '', $domain);
        if(isset($config->domainPostfix) and strpos($config->domainPostfix, "|$postfix|") !== false) return $items[0];

        /* 类似www.a.com的形式。 Domain like www.a.com. */
        $postfix = str_replace($items[0] . '.' . $items[1] . '.', '', $domain);
        if(isset($config->domainPostfix) and strpos($config->domainPostfix, "|$postfix|") !== false) return $items[1];

        /* 类似xxx.sub.a.com的形式。 Domain like xxx.sub.a.com. */
        $postfix = str_replace($items[0] . '.' . $items[1] . '.' . $items[2] . '.', '', $domain);
        if(isset($config->domainPostfix) and strpos($config->domainPostfix, "|$postfix|") !== false) return $items[0];

        return '';
    }

    /**
     * 检查是否是AJAX请求。
     * Check is ajax request.
     * 
     * @static
     * @access public
     * @return bool
     */
    public static function isAjaxRequest()
    {
        if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') return true;
        if(isset($_GET['HTTP_X_REQUESTED_WITH'])    && $_GET['HTTP_X_REQUESTED_WITH']    == 'XMLHttpRequest') return true;
        return false;
    }

    /**
     * 301跳转。
     * Header 301 Moved Permanently.
     * 
     * @param  string    $locate 
     * @access public
     * @return void
     */
    public static function header301($locate)
    {
        header('HTTP/1.1 301 Moved Permanently');
        die(header('Location:' . $locate));
    }

    /** 
     * 获取远程IP。
     * Get remote ip. 
     * 
     * @access public
     * @return string
     */
    public static function getRemoteIp()
    {
        $ip = '';
        if(!empty($_SERVER["REMOTE_ADDR"]))          $ip = $_SERVER["REMOTE_ADDR"];
        if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
        if(!empty($_SERVER['HTTP_CLIENT_IP']))       $ip = $_SERVER['HTTP_CLIENT_IP'];

        return $ip;
    }
}

//------------------------------- 常用函数。Some tool functions.-------------------------------//

/**
 *  helper::createLink()的别名,方便创建本模块方法的链接。
 *  The short alias of helper::createLink() method to create link to control method of current module.
 *
 * @param  string        $methodName  the method name
 * @param  string|array  $vars        the params passed to the method, can be array('key' => 'value') or key1=value1&key2=value2)
 * @param  string        $viewType    
 * @return string the link string.
 */
function inLink($methodName = 'index', $vars = '', $viewType = '')
{
    global $app;
    return helper::createLink($app->getModuleName(), $methodName, $vars, $viewType);
}

/**
 *  通过一个静态游标,可以遍历数组。
 *  Static cycle a array.
 *
 * @param array  $items     the array to be cycled.
 * @return mixed
 */
function cycle($items)
{
    static $i = 0;
    if(!is_array($items)) $items = explode(',', $items);
    if(!isset($items[$i])) $i = 0;
    return $items[$i++];
}

/**
 * 获取当前时间的Unix时间戳,精确到微妙。
 * Get current microtime.
 * 
 * @access public
 * @return float current time.
 */
function getTime()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}

/**
 * 打印变量的信息
 * dump a var.
 * 
 * @param mixed $var 
 * @access public
 * @return void
 */
function a($var)
{
    echo "<xmp class='a-left'>";
    print_r($var);
    echo "</xmp>";
}

/**
 * 判断是否内外IP。
 * Judge the server ip is local or not.
 *
 * @access public
 * @return void
 */
function isLocalIP()
{
    global $config;
    if(isset($config->islocalIP)) return $config->isLocalIP;
    $serverIP = $_SERVER['SERVER_ADDR'];
    if($serverIP == '127.0.0.1') return true;
    if(strpos($serverIP, '10.70') !== false) return false;
    return !filter_var($serverIP, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE);
}

/**
 * 获取webRoot。
 * Get web root. 
 * 
 * @access public
 * @return string 
 */
function getWebRoot($full = false)
{
    $path = $_SERVER['SCRIPT_NAME'];

    if(PHP_SAPI == 'cli')
    {
        if(isset($_SERVER['argv'][1]))
        {
            $url  = parse_url($_SERVER['argv'][1]);
            $path = empty($url['path']) ? '/' : rtrim($url['path'], '/');
        }
        $path = empty($path) ? '/' : preg_replace('/\/www$/', '/www/', $path);
    }
    
    if($full)
    {
        $http = (isset($_SERVER['HTTPS']) and strtolower($_SERVER['HTTPS']) != 'off') ? 'https://' : 'http://';
        return $http . $_SERVER['HTTP_HOST'] . substr($path, 0, (strrpos($path, '/') + 1));
    }

    $path = substr($path, 0, (strrpos($path, '/') + 1));
    $path = str_replace('\\', '/', $path);
    return $path;
}

/**
 * 当数组/对象变量$var存在$key项时,返回存在的对应值或设定值,否则返回$key或不存在的设定值。
 * When the $var has the $key, return it, esle result one default value.
 * 
 * @param  array|object    $var 
 * @param  string|int      $key 
 * @param  mixed           $valueWhenNone     value when the key not exits.
 * @param  mixed           $valueWhenExists   value when the key exits.
 * @access public
 * @return string
 */
function zget($var, $key, $valueWhenNone = false, $valueWhenExists = false)
{
    if(!is_array($var) and !is_object($var)) return false;

    $type = is_array($var) ? 'array' : 'object';
    $checkExists = $type == 'array' ? isset($var[$key]) : isset($var->$key);

    if($checkExists)
    {
        if($valueWhenExists !== false) return $valueWhenExists;
        return $type == 'array' ? $var[$key] : $var->$key;
    }

    if($valueWhenNone !== false) return $valueWhenNone;
    return $key;
}


================================================
FILE: framework/base/model.class.php
================================================
<?php
/**
 * ZenTaoPHP的baseModel类。
 * The baseModel class file of ZenTaoPHP framework.
 *
 * @package framework
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
class baseModel
{
    /**
     * 全局对象$app。
     * The global $app object.
     * 
     * @var object
     * @access public
     */
    public $app;

    /**
     * 应用名称$appName。
     * The global appName.
     * 
     * @var string
     * @access public
     */
    public $appName;

    /**
     * 全局对象$config。
     * The global $config object.
     * 
     * @var object
     * @access public
     */
    public $config;

    /**
     * 全局对象$lang。
     * The global $lang object.
     * 
     * @var object
     * @access public
     */
    public $lang;

    /**
     * 全局对象$dbh,数据库连接句柄。
     * The global $dbh object, the database connection handler.
     * 
     * @var object
     * @access public
     */
    public $dbh;

    /**
     * $dao对象,用于访问或者更新数据库。
     * The $dao object, used to access or update database.
     * 
     * @var object
     * @access public
     */
    public $dao;

    /**
     * $post对象,用于访问$_POST变量。
     * The $post object, used to access the $_POST var.
     * 
     * @var object
     * @access public
     */
    public $post;

    /**
     * $get对象,用于访问$_GET变量。
     * The $get object, used to access the $_GET var.
     * 
     * @var object
     * @access public
     */
    public $get;

    /**
     * $session对象,用于访问$_SESSION变量。
     * The $session object, used to access the $_SESSION var.
     * 
     * @var object
     * @access public
     */
    public $session;

    /**
     * $server对象,用于访问$_SERVER变量。
     * The $server object, used to access the $_SERVER var.
     * 
     * @var object
     * @access public
     */
    public $server;

    /**
     * $cookie对象,用于访问$_COOKIE变量。
     * The $cookie object, used to access the $_COOKIE var.
     * 
     * @var object
     * @access public
     */
    public $cookie;

    /**
     * $global对象,用于访问$_GLOBAL变量。
     * The $global object, used to access the $_GLOBAL var.
     * 
     * @var object
     * @access public
     */
    public $global;

    /**
     * 构造方法。
     * 1. 将全局变量设为model类的成员变量,方便model的派生类调用;
     * 2. 设置$config, $lang, $dbh, $dao。
     * 
     * The construct function.
     * 1. global the global vars, refer them by the class member such as $this->app.
     * 2. set the pathes, config, lang of current module
     *
     * @param  string $appName 
     * @access public
     * @return void
     */
    public function __construct($appName = '')
    {
        global $app, $config, $lang, $dbh;
        $this->app     = $app;
        $this->config  = $config;
        $this->lang    = $lang;
        $this->dbh     = $dbh;
        $this->appName = empty($appName) ? $this->app->getAppName() : $appName;

        $moduleName = $this->getModuleName();
        if($this->config->framework->multiLanguage) $this->app->loadLang($moduleName, $this->appName);
        if($moduleName != 'common') $this->app->loadModuleConfig($moduleName, $this->appName);

        $this->loadDAO();
        $this->setSuperVars();
    }

    /**
     * 获取该model的模块名,而不是用户请求的模块名。
     *
     * 这个方法通过去掉该model类名的'ext'和'model'字符串,来获取当前模块名。
     * 不要使用$app->getModuleName(),因为其返回的是用户请求的模块名。
     * 另一个model可以通过loadModel()加载进来,与请求的模块名不一致。
     * 
     * Get the module name of this model. Not the module user visiting.
     *
     * This method replace the 'ext' and 'model' string from the model class name, thus get the module name.
     * Not using $app->getModuleName() because it return the module user is visiting. But one module can be
     * loaded by loadModel() so we must get the module name of this model.
     *
     * @access public
     * @return string the module name.
     */
    public function getModuleName()
    {
        $parentClass = get_parent_class($this);
        $selfClass   = get_class($this);
        $className   = $parentClass == 'model' ? $selfClass : $parentClass;
        if($className == 'extensionModel') return 'extension';
        return strtolower(str_ireplace(array('ext', 'Model'), '', $className));
    }

    /**
     * 设置全局超级变量。
     * Set the super vars.
     * 
     * @access public
     * @return void
     */
    public function setSuperVars()
    {
        $this->post    = $this->app->post;
        $this->get     = $this->app->get;
        $this->server  = $this->app->server;
        $this->cookie  = $this->app->cookie;
        $this->session = $this->app->session;
    }

    /**
     * 加载一个模块的model。加载完成后,使用$this->$moduleName来访问这个model对象。
     * 比如:loadModel('user')引入user模块的model实例对象,可以通过$this->user来访问它。
     *
     * Load the model of one module. After loaded, can use $this->$moduleName to visit the model object.
     * 
     * @param   string  $moduleName
     * @access  public
     * @return  object|bool  the model object or false if model file not exists.
     */
    public function loadModel($moduleName, $appName = '')
    {
        if(empty($moduleName)) return false;
        if(empty($appName)) $appName = $this->appName;

        global $loadedModels;
        if(isset($loadedModels[$appName][$moduleName]))
        {
            $this->$moduleName = $loadedModels[$appName][$moduleName];
            return $this->$moduleName;
        }

        $modelFile = $this->app->setModelFile($moduleName, $appName);

        if(!helper::import($modelFile)) return false;
        $modelClass = class_exists('ext' . $appName . $moduleName. 'model') ? 'ext' . $appName . $moduleName . 'model' : $appName . $moduleName . 'model';
        if(!class_exists($modelClass))
        {
            $modelClass = class_exists('ext' . $moduleName. 'model') ? 'ext' . $moduleName . 'model' : $moduleName . 'model';
            if(!class_exists($modelClass)) $this->app->triggerError(" The model $modelClass not found", __FILE__, __LINE__, $exit = true);
        }

        $loadedModels[$appName][$moduleName] = new $modelClass($appName);
        $this->$moduleName = $loadedModels[$appName][$moduleName];
        return $this->$moduleName;
    }

    /**
     * 加载model的class扩展,主要是为了开发加密代码使用。
     * 可以将主要的逻辑存放到$moduleName/ext/model/class/$extensionName.class.php中。
     * 然后在ext/model/$extension.php的扩展里面使用$this->loadExtension()来调用相应的方法。
     * ext/model/class/*.class.php代码可以加密。而ext/model/*.php可以不用加密。
     * 因为框架对model的扩展是采取合并文件的方式,ext/model/*.php文件不能加密。
     *
     * Load extension class of a model thus user can encrypt the code.
     * You can put the main extension logic codes in $moduleName/ext/model/class/$extensionName.class.php.
     * And call them by the ext/model/$extension.php like this: $this->loadExtension('myextension')->method().
     * You can encrypt the code in ext/model/class/*.class.php.
     * Because the framework will merge the extension files in ext/model/*.php to the module/model.php.
     * 
     * @param  string $extensionName 
     * @param  string $moduleName 
     * @access public
     * @return void
     */
    public function loadExtension($extensionName, $moduleName = '')
    {
        if(empty($extensionName)) return false;

        /* 设置扩展的名字和相应的文件。Set extenson name and extension file. */
        $extensionName = strtolower($extensionName);
        $moduleName    = $moduleName ? $moduleName : $this->getModuleName();
        $moduleExtPath = $this->app->getModuleExtPath($this->appName, $moduleName, 'model');
        if(!empty($moduleExtPath['site'])) $extensionFile = $moduleExtPath['site'] . 'class/' . $extensionName . '.class.php';
        if(!isset($extensionFile) or !file_exists($extensionFile)) $extensionFile = $moduleExtPath['common'] . 'class/' . $extensionName . '.class.php';

        /* 载入父类。Try to import parent model file auto and then import the extension file. */
        if(!class_exists($moduleName . 'Model')) helper::import($this->app->getModulePath($this->appName, $moduleName) . 'model.php');
        if(!helper::import($extensionFile)) return false;

        /* 设置扩展类的名字。Set the extension class name. */
        $extensionClass = $extensionName . ucfirst($moduleName);
        if(!class_exists($extensionClass)) return false;

        /* 实例化扩展类。Create an instance of the extension class and return it. */
        $extensionObject = new $extensionClass;
        $extensionClass  = str_replace('Model', '', $extensionClass);
        $this->$extensionClass = $extensionObject;
        return $extensionObject;
    }

    /**
     * 加载DAO。
     * Load DAO.
     * 
     * @access public
     * @return void
     */
    public function loadDAO()
    {
        $this->dao = $this->app->loadClass('dao');
    }

    /**
     * 删除记录。
     * Delete one record.
     * 
     * @param  string    $table  the table name
     * @param  string    $id     the id value of the record to be deleted
     * @access public
     * @return void
     */
    public function delete($table, $id = 0)
    {
        $this->dao->delete()->from($table)->where('id')->eq($id)->exec();
    }
}


================================================
FILE: framework/base/router.class.php
================================================
<?php
/**
 * 此文件包括ZenTaoPHP框架的三个类:baseRouter, config, lang。
 * The router, config and lang class file of ZenTaoPHP framework.
 *
 * @package framework
 *
 * The author disclaims copyright to this source code. In place of 
 * a legal notice, here is a blessing:
 *
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
class baseRouter
{
    /**
     * ZenTaoPHP的基础目录,一般是程序的根目录。
     * The base path of the ZenTaoPHP framework.
     *
     * @var string
     * @access public
     */
    public $basePath;

    /**
     * 框架的根目录。
     * The root directory of the framwork($this->basePath/framework)
     * 
     * @var string
     * @access public
     */
    public $frameRoot;

    /**
     * 类库的根目录。{$this->basePath/lib}
     * The root directory of the library($this->basePath/lib).
     * 
     * @var string
     * @access public
     */
    public $coreLibRoot;

    /**
     * 应用名称
     * The appName.
     * 
     * @var string
     * @access public
     */
    public $appName = '';

    /**
     * 应用程序的根目录。
     * The root directory of the app.
     * 
     * @var string
     * @access public
     */
    public $appRoot;

    /**
     * 临时文件的根目录。
     * The root directory of temp.
     * 
     * @var string
     * @access public
     */
    public $tmpRoot;

    /**
     * 缓存的根目录。
     * The root directory of cache.
     * 
     * @var string
     * @access public
     */
    public $cacheRoot;

    /**
     * WWW目录。
     * The root directory of www.
     * 
     * @var string
     * @access public
     */
    public $wwwRoot;

    /**
     * 附件存放目录。
     * The root directory of data.
     * 
     * @var string
     * @access public
     */
    public $dataRoot;

    /**
     * 日志文件的根目录。
     * The root directory of log.
     * 
     * @var string
     * @access public
     */
    public $logRoot;

    /**
     * 配置文件的根目录。
     * The root directory of config.
     * 
     * @var string
     * @access public
     */
    public $configRoot;

    /**
     * 模块的根目录。
     * The root directory of module.
     * 
     * @var string
     * @access public
     */
    public $moduleRoot;

    /**
     * 主题的根目录。
     * The root directory of theme.
     * 
     * @var string
     * @access public
     */
    public $themeRoot;

    /**
     * 用户使用的语言。
     * The lang of the client user.
     * 
     * @var string
     * @access public
     */
    public $clientLang;

    /**
     * 用户使用的主题。
     * The theme of the client user.
     * 
     * @var string
     * @access public
     */
    public $clientTheme;

    /**
     * 客户端设备类型。
     * The device type of client.
     * 
     * @var string   
     * @access public
     */
    public $clientDevice;

    /**
     * 当前模块的control对象。
     * The control object of current module.
     * 
     * @var object
     * @access public
     */
    public $control;

    /**
     * 模块名。
     * The module name
     * 
     * @var string
     * @access public
     */
    public $moduleName;

    /**
     * 当前访问模块的control文件。
     * The control file of the module current visiting.
     * 
     * @var string
     * @access public
     */
    public $controlFile;

    /**
     * 当前访问的方法名。
     * The name of the method current visiting.
     * 
     * @var string
     * @access public
     */
    public $methodName;

    /**
     * 当前方法的扩展文件。
     * The action extension file of current method.
     * 
     * @var string
     * @access public
     */
    public $extActionFile;

    /**
     * 访问的URI。
     * The URI.
     * 
     * @var string
     * @access public
     */
    public $URI;

    /**
     * url地址传递的参数。
     * The params passed in through url.
     * 
     * @var array
     * @access public
     */
    public $params;

    /**
     * 视图类型。
     * The view type.
     * 
     * @var string
     * @access public
     */
    public $viewType;

    /**
     * 全局$config对象。
     * The global $config object.
     * 
     * @var object
     * @access public
     */
    public $config;

    /**
     * 全局$lang对象。
     * The global $lang object.
     * 
     * @var object
     * @access public
     */
    public $lang;

    /**
     * 全局$dbh对象,数据库连接句柄。
     * The global $dbh object, the database connection handler.
     * 
     * @var object
     * @access public
     */
    public $dbh;

    /**
     * 从数据库的句柄。
     * The slave database handler.
     * 
     * @var object
     * @access public
     */
    public $slaveDBH;

    /**
     * $post对象,用于访问$_POST变量。
     * The $post object, used to access the $_POST var.
     * 
     * @var object
     * @access public
     */
    public $post;

    /**
     * $get对象,用于访问$_GET变量。
     * The $get object, used to access the $_GET var.
     * 
     * @var object
     * @access public
     */
    public $get;

    /**
     * $session对象,用于访问$_SESSION变量。
     * The $session object, used to access the $_SESSION var.
     * 
     * @var object
     * @access public
     */
    public $session;

    /**
     * $server对象,用于访问$_SERVER变量。
     * The $server object, used to access the $_SERVER var.
     * 
     * @var object
     * @access public
     */
    public $server;

    /**
     * $cookie对象,用于访问$_COOKIE变量。
     * The $cookie object, used to access the $_COOKIE var.
     * 
     * @var object
     * @access public
     */
    public $cookie;

    /**
     * 网站代号。
     * The code of current site.
     * 
     * @var string
     * @access public
     */
    public $siteCode;

    /**
     * 构造方法, 设置路径,类,超级变量等。注意:
     * 1.应该使用createApp()方法实例化router类;
     * 2.如果$appRoot为空,框架会根据$appName计算应用路径。
     *
     * The construct function.
     * Prepare all the paths, classes, super objects and so on.
     * Notice: 
     * 1. You should use the createApp() method to get an instance of the router.
     * 2. If the $appRoot is empty, the framework will compute the appRoot according the $appName
     *
     * @param string $appName   the name of the app 
     * @param string $appRoot   the root path of the app
     * @access public
     * @return void
     */
    public function __construct($appName = 'demo', $appRoot = '')
    {
        $this->setPathFix();
        $this->setBasePath();
        $this->setFrameRoot();
        $this->setCoreLibRoot();
        $this->setAppRoot($appName, $appRoot);
        $this->setTmpRoot();
        $this->setCacheRoot();
        $this->setLogRoot();
        $this->setConfigRoot();
        $this->setModuleRoot();
        $this->setWwwRoot();
        $this->setThemeRoot();
        $this->setDataRoot();
        $this->loadMainConfig();

        $this->loadClass('front',  $static = true);
        $this->loadClass('filter', $static = true);
        $this->loadClass('dao',    $static = true);
        $this->loadClass('mobile', $static = true);

        $this->setSuperVars();
        $this->setDebug();
        $this->setErrorHandler();
        $this->setTimezone();
        $this->startSession();

        if($this->config->framework->multiSite)     $this->setSiteCode() && $this->loadExtraConfig();
        if($this->config->framework->autoConnectDB) $this->connectDB();
        if($this->config->framework->multiLanguage) $this->setClientLang();

        $needDetectDevice   = zget($this->config->framework->detectDevice, $this->clientLang, false);
        $this->clientDevice = $needDetectDevice ? $this->setClientDevice() : 'desktop';

        if($this->config->framework->multiLanguage) $this->loadLang('common');
        if($this->config->framework->multiTheme)    $this->setClientTheme();
    }

    /**
     * 创建一个应用。
     * Create an application.
     * 
     * @param string $appName   应用名称。  The name of the app.
     * @param string $appRoot   应用根路径。The root path of the app.
     * @param string $className 应用类名,如果对router类做了扩展,需要指定类名。When extends router class, you should pass in the child router class name.
     * @static
     * @access public
     * @return object   the app object
     */
    public static function createApp($appName = 'demo', $appRoot = '', $className = '')
    {
        if(empty($className)) $className = __CLASS__;
        return new $className($appName, $appRoot);
    }

    //-------------------- 路径相关方法(Path related methods)--------------------//

    /**
     * 设置应用名称。
     * Set app name.
     * 
     * @param  string    $appName 
     * @access public
     * @return void
     */
    public function setAppName($appName)
    {
        $this->appName = $appName;
    }

    /**
     * 设置目录分隔符。
     * Set the path directory separator.
     * 
     * @access public
     * @return void
     */
    public function setPathFix()
    {
        define('DS', DIRECTORY_SEPARATOR);
    }

    /**
     * 设置基础目录。
     * Set the base path.
     *
     * @access public
     * @return void
     */
    public function setBasePath()
    {
        $this->basePath = realpath(dirname(dirname(dirname(__FILE__)))) . DS;
    }

    /**
     * 设置框架根目录。
     * Set the frame root.
     * 
     * @access public
     * @return void
     */
    public function setFrameRoot()
    {
        $this->frameRoot = $this->basePath . 'framework' . DS;
    }

    /**
     * 设置类库的根目录。
     * Set the app lib root.
     * 
     * @access public
     * @return void
     */
    public function setCoreLibRoot()
    {
        $this->coreLibRoot = $this->basePath . 'lib' . DS;
    }

    /**
     * 设置应用的根目录。
     * Set the app root.
     *
     * @param string $appName 
     * @param string $appRoot 
     * @access public
     * @return void
     */
    public function setAppRoot($appName = 'demo', $appRoot = '')
    {
        if(empty($appRoot))  $this->appRoot = $this->basePath . 'app' . DS . $appName . DS;
        if(!empty($appRoot)) $this->appRoot = realpath($appRoot) . DS;
        if(!is_dir($this->appRoot)) $this->triggerError("The app you call not found in {$this->appRoot}", __FILE__, __LINE__, $exit = true);
    }

    /**
     * 设置临时文件的根目录。
     * Set the tmp root.
     * 
     * @access public
     * @return void
     */
    public function setTmpRoot()
    {
        $this->tmpRoot = $this->basePath . 'tmp' . DS;
    }

    /**
     * 设置缓存的根目录。
     * Set the cache root.
     * 
     * @access public
     * @return void
     */
    public function setCacheRoot()
    {
        $this->cacheRoot = $this->tmpRoot . 'cache' . DS;
    }

    /**
     * 设置log的根目录。
     * Set the log root.
     * 
     * @access public
     * @return void
     */
    public function setLogRoot()
    {
        $this->logRoot = $this->tmpRoot . 'log' . DS;
    }

    /**
     * 设置config配置文件的根目录。
     * Set the config root.
     * 
     * @access public
     * @return void
     */
    public function setConfigRoot()
    {
        $this->configRoot = $this->basePath . 'config' . DS;
    }

    /**
     * 设置模块的根目录。
     * Set the module root.
     * 
     * @access public
     * @return void
     */
    public function setModuleRoot()
    {
        $this->moduleRoot = $this->basePath . 'module' . DS;
    }

    /**
     * 设置www的根目录。
     * Set the www root.
     * 
     * @access public
     * @return void
     */
    public function setWwwRoot()
    {
        $this->wwwRoot = rtrim(dirname($_SERVER['SCRIPT_FILENAME']), DS) . DS;
    }

    /**
     * 设置主题根目录。
     * Set the theme root.
     * 
     * @access public
     * @return void
     */
    public function setThemeRoot()
    {
        $this->themeRoot = $this->wwwRoot . 'theme' . DS;
    }

   /**
     * 设置data根目录。
     * Set the data root.
     * 
     * @access public
     * @return void
     */
    public function setDataRoot()
    {
        $this->dataRoot = $this->wwwRoot . 'data' . DS;
    }

    /**
     * 设置超级变量。
     * Set the super vars.
     * 
     * @access public
     * @return void
     */
    public function setSuperVars()
    {
        $this->post    = new super('post');
        $this->get     = new super('get');
        $this->server  = new super('server');
        $this->cookie  = new super('cookie');
        $this->session = new super('session');

        unset($GLOBALS);
        unset($_REQUEST);

        $_FILES  = validater::filterFiles();
        $_POST   = validater::filterSuper($_POST);
        $_GET    = validater::filterSuper($_GET);
        $_COOKIE = validater::filterSuper($_COOKIE);
    }

    /**
     * 设置Debug模式。
     * set Debug. 
     * 
     * @access public
     * @return void
     */
    public function setDebug()
    {
        if(!empty($this->config->debug)) error_reporting(E_ALL & ~ E_STRICT);
    }

    /**
     * 设置错误处理句柄。
     * Set the error handler.
     * 
     * @access public
     * @return void
     */
    public function setErrorHandler()
    {
        set_error_handler(array($this, 'saveError'));
        register_shutdown_function(array($this, 'shutdown'));
    }

    /**
     * 获取应用名称
     * Get app name 
     * 
     * @access public
     * @return string
     */
    public function getAppName()
    {
        return $this->appName;
    }

    /**
     * 获取$basePath,即基础路径。
     * Get the $basePath var.
     * 
     * @access public
     * @return string
     */
    public function getBasePath()
    {
        return $this->basePath;
    }

    /**
     * 获取$frameRoot,即框架根目录。
     * Get the $frameRoot var.
     * 
     * @access public
     * @return string
     */
    public function getFrameRoot()
    {
        return $this->frameRoot;
    }

    /**
     * 获取$appRoot变量,即应用的根目录。
     * Get the $appRoot var.
     * 
     * @access public
     * @return string
     */
    public function getAppRoot()
    {
        return $this->appRoot;
    }

    /**
     * 获取$wwwRoot变量。
     * Get the $wwwRoot var
     * 
     * @access public
     * @return string
     */
    public function getWwwRoot()
    {
        return $this->wwwRoot;
    }

    /**
     * 获取$coreLibRoot变量,即应用类库的根目录。
     * Get the $coreLibRoot var.
     * 
     * @access public
     * @return string
     */
    public function getCoreLibRoot()
    {
        return $this->coreLibRoot;
    }

    /**
     * 获取$tmpRoot变量,即临时文件的根目录。
     * Get the $tmpRoot var.
     * 
     * @access public
     * @return string
     */
    public function getTmpRoot()
    {
        return $this->tmpRoot;
    } 

    /**
     * 获取$cacheRoot变量,即缓存文件的根目录。
     * Get the $cacheRoot var.
     * 
     * @access public
     * @return string
     */
    public function getCacheRoot()
    {
        return $this->cacheRoot;
    } 

    /**
     * 获取$logRoot变量,即日志文件的根目录。
     * Get the $logRoot var.
     * 
     * @access public
     * @return string
     */
    public function getLogRoot()
    {
        return $this->logRoot;
    } 

    /**
     * 获取$configRoot变量,即配置文件的根目录。
     * Get the $configRoot var.
     * 
     * @access public
     * @return string
     */
    public function getConfigRoot()
    {
        return $this->configRoot;
    }

    /**
     * 获取$moduleRoot变量,即应用模块的根目录。
     * Get the $moduleRoot var.
     * 
     * @param  string $appName 
     * @access public
     * @return string
     */
    public function getModuleRoot($appName = '')
    {
        if($appName == '') return $this->moduleRoot;
        return dirname($this->moduleRoot) . DS . $appName . DS;
    }

    /**
     * 获取$webRoot,即应用的路径。
     * Get the $webRoot var.
     * 
     * @access public
     * @return string
     */
    public function getWebRoot()
    {
        return $this->config->webRoot;
    }

    /**
     * 获取$themeRoot变量,即主题的根目录。
     * Get the $themeRoot var.
     * 
     * @access public
     * @return string
     */
    public function getThemeRoot()
    {
        return $this->themeRoot;
    }

    /**
     * 获取$dataRoot目录
     * Get the $dataRoot var
     * 
     * @access public
     * @return string
     */
    public function getDataRoot()
    {
        return $this->dataRoot;
    }

   //------ 客户端环境有关的函数(Client environment related functions) ------//
    
    /**
     * 根据配置设置当前时区。
     * Set the time zone according to the config.
     * 
     * @access public
     * @return void
     */
    public function setTimezone()
    {
        if(isset($this->config->timezone)) date_default_timezone_set($this->config->timezone);
    }

    /**
     * 开启 session
     * Start the session.
     *
     * @access public
     * @return void
     */
    public function startSession()
    {
        if(!defined('SESSION_STARTED'))
        {
            $sessionName = $this->config->sessionVar;
            session_name($sessionName);
            if(isset($_GET[$this->config->sessionVar])) session_id($_GET[$this->config->sessionVar]);
            session_start();
            define('SESSION_STARTED', true);
        }
    }

    /**
     * 根据用户浏览器的语言设置和服务器配置,选择显示的语言。
     * 优先级:$lang参数 > session > cookie > 浏览器 > 配置文件。
     *
     * Set the language.
     * Using the order of method $lang param, session, cookie, browser and the default lang.
     *
     * @param   string $lang  zh-cn|zh-tw|zh-hk|en
     * @access  public
     * @return  void
     */
    public function setClientLang($lang = '')
    {
        if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) $this->clientLang = $this->parseHttpAcceptLang();
        if(isset($_COOKIE['lang']))                 $this->clientLang = $_COOKIE['lang'];
        if(isset($_SESSION['lang']))                $this->clientLang = $_SESSION['lang'];
        if(!empty($lang))                           $this->clientLang = $lang;
     
        if(!empty($this->clientLang))
        {
            $this->clientLang = strtolower($this->clientLang);
            if(!isset($this->config->langs[$this->clientLang])) $this->clientLang = $this->config->default->lang;
        }    
        else
        {
            $this->clientLang = $this->config->default->lang;
        }

        setcookie('lang', $this->clientLang, $this->config->cookieLife, $this->config->webRoot);
        if(!isset($_COOKIE['lang'])) $_COOKIE['lang'] = $this->clientLang;

        return true;
    }

    /**
     * 从HTTP_ACCEPT_LANGUAGE中提出去支持的语言。
     * Parse the lang str from HTTP_ACCEPT_LANGUAGE header.
     * 
     * @access public
     * @return string
     */
    public function parseHttpAcceptLang()
    {
        if(empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) return '';

        $raw  = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
        $pos  = strpos($raw, ',');
        $lang = $pos === false ? $raw : substr($raw, 0, $pos);

        /* Fix clientLang for ie >= 10. https://www.drupal.org/node/365615. */
        if(stripos($lang, 'hans')) $lang = 'zh-cn';
        if(stripos($lang, 'hant')) $lang = 'zh-tw';
        return $lang;
    }

    /**
     * 设置客户端使用的主题,判断逻辑与客户端的语言相同。
     * 主题的css和图片文件应该存放在www/theme/$themeName路径。
     *
     * Set the theme the client user using. The logic is same as the clientLang.
     * The css and images files of an theme should saved at www/theme/$themeName
     *
     * @param   string $theme   
     * @access  public
     * @return  void
     */
    public function setClientTheme($theme = '')
    {
        if(isset($this->config->client->theme)) $this->clientTheme = $this->config->client->theme;
        if(isset($_COOKIE['theme']))            $this->clientTheme = $_COOKIE['theme'];
        if(!empty($theme))                      $this->clientTheme = $theme;

        if(!empty($this->clientTheme))
        {
            $this->clientTheme = strtolower($this->clientTheme);
            if(!isset($this->lang->themes[$this->clientTheme])) $this->clientTheme = $this->config->default->theme;
        }    
        else
        {
            $this->clientTheme = $this->config->default->theme;
        }

        setcookie('theme', $this->clientTheme, $this->config->cookieLife, $this->config->webRoot);
        if(!isset($_COOKIE['theme'])) $_COOKIE['theme'] = $this->clientTheme;

        return true;
    }

   /**
     * 设置客户端的设备类型。
     * Set client device.
     * 
     * @access public
     * @return void
     */
    public function setClientDevice()
    {
        $this->clientDevice = 'desktop';

        if($this->cookie->device == 'mobile')  $this->clientDevice = 'mobile';
        if($this->cookie->device == 'desktop') $this->clientDevice = 'desktop';

        if(strpos('mobile,desktop', $this->cookie->device) === false) 
        {
            $mobile = new mobile();
            $this->clientDevice = ($mobile->isMobile() and !$mobile->isTablet()) ? 'mobile' : 'desktop';
        }

        setcookie('device', $this->clientDevice, $this->config->cookieLife, $this->config->webRoot);
        if(!isset($_COOKIE['device'])) $_COOKIE['device'] = $this->clientDevice;

        return $this->clientDevice;
    }

    /**
     * 设置站点代号,可以针对不同的站点来加载不同的扩展。
     * Set the code of current site, thus can load diffrent extension of diffrent site.
     * 
     * @access public
     * @return void
     */
    public function setSiteCode()
    {
        return $this->siteCode = helper::parseSiteCode($this->server->http_host);
    }

    /**
     * 获取$clientLang变量,即客户端的语言。
     * Get the $clientLang var.
     * 
     * @access public
     * @return string
     */
    public function getClientLang()
    {
        return $this->clientLang;
    }

    /**
     * 获取$clientTheme变量。
     * Get the $clientTheme var. 
     *
     * @access public
     * @return string
     */
    public function getClientTheme()
    {
        return $this->config->webRoot . 'theme/' . $this->clientTheme . '/';
    }

    /**
     * 获得客户端的终端设备。
     * Get the client device.
     * 
     * @access public
     * @return void
     */
    public function getClientDevice()
    {
        return $this->clientDevice;
    }

    //-------------------- 请求相关的方法(Request related methods) --------------------//

    /**
     * 解析本次请求的入口方法,根据请求的类型(PATH_INFO GET),调用相应的方法。
     * The entrance of parseing request. According to the requestType, call related methods.
     * 
     * @access public
     * @return void
     */
    public function parseRequest()
    {
        if($this->config->requestType == 'PATH_INFO' or $this->config->requestType == 'PATH_INFO2')
        {
            $this->parsePathInfo();
            $this->setRouteByPathInfo();
        }
        elseif($this->config->requestType == 'GET')
        {
            $this->parseGET();
            $this->setRouteByGET();
        }
        else
        {
            $this->triggerError("The request type {$this->config->requestType} not supported", __FILE__, __LINE__, $exit = true);
        }
    }

    /**
     * PATH_INFO方式解析,获取$URI和$viewType。
     * Parse PATH_INFO, get the $URI and $viewType.
     * 
     * @access public
     * @return void
     */
    public function parsePathInfo()
    {
        $pathInfo = $this->getPathInfo();
        if(!empty($pathInfo))
        {
            $dotPos = strrpos($pathInfo, '.');
            if($dotPos)
            {
                $this->URI      = substr($pathInfo, 0, $dotPos);
                $this->viewType = substr($pathInfo, $dotPos + 1);
                if(strpos($this->config->views, ',' . $this->viewType . ',') === false)
                {
                    $this->viewType = $this->config->default->view;
                }
            }
            else
            {
                $this->URI      = $pathInfo;
                $this->viewType = $this->config->default->view;
            }
        }
        else
        {
            $this->viewType = $this->config->default->view;
        }
    }

    /**
     * 从$_SERVER或者$_ENV全局变量根据pathinfo变量名获取$PATH_INFO值。
     * PATH_INFO的变量名几乎都是'PATH_INFO',但也有可能是ORIG_PATH_INFO。
     * 
     * Get $PATH_INFO from $_SERVER or $_ENV by the pathinfo var name.
     * Mostly, the var name of PATH_INFO is PATH_INFO, but may be ORIG_PATH_INFO.
     *
     * @access  public
     * @return  string the PATH_INFO
     */
    public function getPathInfo()
    {
        if(isset($_SERVER['PATH_INFO']))
        {
            $value = $_SERVER['PATH_INFO'];
        }
        elseif(isset($_SERVER['ORIG_PATH_INFO']))
        {
            $value = $_SERVER['ORIG_PATH_INFO'];
        }
        elseif(isset($this->URI))
        {
            $value = $this->URI;
            $subpath = str_replace($_SERVER['DOCUMENT_ROOT'], '', dirname($_SERVER['SCRIPT_FILENAME']));
            if($subpath != '/') $subpath = '/' . $subpath;
            if($subpath != '' and $subpath != '/' and strpos($value, $subpath) === 0) $value = substr($value, strlen($subpath));
        }
        else
        {
            $value = @getenv('PATH_INFO');
            if(empty($value)) $value = @getenv('ORIG_PATH_INFO');
        }

        if(strpos($value, $_SERVER['SCRIPT_NAME']) !== false) $value = str_replace($_SERVER['SCRIPT_NAME'], '', $value);
        if(strpos($value, '?') === false) return trim($value, '/');

        $value    = parse_url($value);
        $pathInfo = trim(zget($value, 'path', ''), '/');
        if(trim($pathInfo, '/') == trim($this->config->webRoot, '/')) $pathInfo = '';

        return $pathInfo;
    }

    /**
     * GET请求方式解析,获取$URI和$viewType。
     * Parse GET, get $URI and $viewType.
     *
     * @access public
     * @return void
     */
    public function parseGET()
    {
        if(isset($_GET[$this->config->viewVar]))
        {
            $this->viewType = $_GET[$this->config->viewVar]; 
            if(strpos($this->config->views, ',' . $this->viewType . ',') === false) $this->viewType = $this->config->default->view;
        }
        else
        {
            $this->viewType = $this->config->default->view;
        }
        $this->URI = $_SERVER['REQUEST_URI'];
    }

    /**
     * 获取$URL。
     * Get the $URL.
     * 
     * @param  bool $full  true, the URI contains the webRoot, else only hte URI.
     * @access public
     * @return string
     */
    public function getURI($full = false)
    {
        if($full and $this->config->requestType == 'PATH_INFO')
        {
            if($this->URI) return $this->config->webRoot . $this->URI . '.' . $this->viewType;
            return $this->config->webRoot;
        }
        return $this->URI;
    }

    /**
     * 获取$vewType变量。
     * Get the $viewType var.
     * 
     * @access public
     * @return string
     */
    public function getViewType()
    {
        return $this->viewType;
    }

    //-------------------- 模块及扩展设置(Module and extension) --------------------//

    /**
     * 加载common模块。
     *  
     *  common模块比较特别,它会执行几乎每次请求都需要执行的操作,例如:
     *  打开session,检查权限等等。
     *  加载完$lang, $config, $dbh后,需要在入口文件(www/index.php)中手动调用该方法。
     *
     * Load the common module
     *
     *  The common module is a special module, which can be used to do some common things. For examle:
     *  start session, check priviledge and so on.
     *  This method should called manually in the router file(www/index.php) after the $lang, $config, $dbh loaded.
     *
     * @access public
     * @return object|bool  the common model object or false if not exits.
     */
    public function loadCommon()
    {
        $this->setModuleName('common');
        $commonModelFile = $this->setModelFile('common');
        if(!file_exists($commonModelFile)) return false;

        helper::import($commonModelFile);

        if($this->config->framework->extensionLevel == 0 and class_exists('commonModel'))    return new commonModel();
        if($this->config->framework->extensionLevel > 0  and class_exists('extCommonModel')) return new extCommonModel();

        if(class_exists('commonModel')) return new commonModel();
        return false;
    }

    /**
     * 设置要被调用的模块名。
     * Set the name of the module to be called.
     * 
     * @param   string $moduleName  the module name
     * @access  public
     * @return  void
     */
    public function setModuleName($moduleName = '')
    {
        if($this->checkModuleName($moduleName)) $this->moduleName = strtolower($moduleName);
    }

    /**
     * 设置要被调用的控制器文件。
     * Set the control file of the module to be called.
     * 
     * @param   bool    $exitIfNone     没有找到该控制器文件的情况:如果该参数为true,则终止程序;如果为false,则打印错误日志
     *                                  If control file not foundde, how to do. True, die the whole app. false, log error.
     * @access  public
     * @return  bool
     */
    public function setControlFile($exitIfNone = true)
    {
        $this->controlFile = $this->moduleRoot . $this->moduleName . DS . 'control.php';
        if(file_exists($this->controlFile)) return true;
        $this->triggerError("the control file $this->controlFile not found.", __FILE__, __LINE__, $exitIfNone);
    }

    /**
     * 设置要被调用的方法名。
     * Set the name of the method calling.
     * 
     * @param string $methodName 
     * @access public
     * @return void
     */
    public function setMethodName($methodName = '')
    {
        if($this->checkMethodName($methodName)) $this->methodName = strtolower($methodName);
    }

    /**
     * 获取一个模块的路径。
     * Get the path of one module.
     * 
     * @param  string $appName    the app name
     * @param  string $moduleName    the module name
     * @access public
     * @return string the module path
     */
    public function getModulePath($appName = '', $moduleName = '')
    {
        if($moduleName == '') $moduleName = $this->moduleName;

        if($this->checkModuleName($moduleName))
        {
            $modulePath = $this->getModuleRoot($appName) . strtolower($moduleName) . DS;
            return $modulePath;
        }
    }

    /**
     * 获取一个模块的扩展路径。 Get extension path of one module.
     * 
     * If the extensionLevel == 0, return empty array.
     * If the extensionLevel == 1, return the common extension directory.
     * If the extensionLevel == 2, return the common and site extension directories.
     *
     * @param   string $appName        the app name
     * @param   string $moduleName     the module name
     * @param   string $ext            the extension type, can be control|model|view|lang|config
     * @access  public
     * @return  string the extension path.
     */
    public function getModuleExtPath($appName, $moduleName, $ext)
    {
        /* 检查失败或者extensionLevel为0,直接返回空。If check failed or extensionLevel == 0, return empty array. */
        if(!$this->checkModuleName($moduleName) or $this->config->framework->extensionLevel == 0) return array();

        /* When extensionLevel == 1. */
        $modulePath = $this->getModulePath($appName, $moduleName);
        $paths = array();
        $paths['common'] = $modulePath . 'ext' . DS . $ext . DS;
        if($this->config->framework->extensionLevel == 1) return $paths;

        /* When extensionLevel == 2. */
        $paths['site'] = empty($this->siteCode) ? '' : $modulePath . 'ext' . DS . '_' . $this->siteCode . DS . $ext . DS;
        return $paths;
    }

    /**
     * 检查模块中某一个变量必须为英文字母和数字组合。Check module a variable must be ascii.
     * 
     * @param  string    $var 
     * @access public
     * @return bool
     */
    public function checkModuleName($var)
    {
        global $filter;
        $rule = $filter->default->moduleName;
        if(validater::checkByRule($var, $rule)) return true;
        $this->triggerError("'$var' illegal. ", __FILE__, __LINE__, $exit = true);
    }

    /**
     * 检查方法中某一个变量必须为英文字母和数字组合。Check method a variable must be ascii.
     * 
     * @param  string    $var 
     * @access public
     * @return bool
     */
    public function checkMethodName($var)
    {
        global $filter;
        $rule = $filter->default->methodName;
        if($this->config->framework->filterParam == 2 and isset($filter->{$this->moduleName}->methodName)) $rule = $filter->{$this->moduleName}->methodName;

        if(validater::checkByRule($var, $rule)) return true;
        $this->triggerError("'$var' illegal. ", __FILE__, __LINE__, $exit = true);
    }

    /**
     * 设置Action的扩展文件。 Set the action extension file.
     * 
     * @access  public
     * @return  bool
     */
    public function setActionExtFile()
    {
        $moduleExtPaths = $this->getModuleExtPath('', $this->moduleName, 'control');
        
        /* 如果扩展目录为空,不包含任何扩展文件。If there's no ext pathes return false.*/
        if(empty($moduleExtPaths)) return false;

        /* 如果extensionLevel == 2,且扩展文件存在,返回该站点扩展文件。If extensionLevel == 2 and site extensionFile exists, return it. */
        if($this->config->framework->extensionLevel == 2 and !empty( $moduleExtPaths['site']))
        {
            $this->extActionFile = $moduleExtPaths['site'] . $this->methodName . '.php';
            if(file_exists($this->extActionFile)) return true;
        }

        /* 然后再尝试寻找公共扩展文件。Then try to find the common extension file. */
        $this->extActionFile = $moduleExtPaths['common'] . $this->methodName . '.php';
        return file_exists($this->extActionFile);
    }

    /**
     * 设置一个模块的model文件,如果存在model扩展,一起合并。
     * Set the model file of one module. If there's an extension file, merge it with the main model file.
     * 
     * @param   string $moduleName the module name
     * @param   string $appName the app name
     * @static
     * @access  public
     * @return  string the model file
     */
    public function setModelFile($moduleName, $appName = '')
    {
        if($appName == '') $appName = $this->getAppName();

        /* 设置主model文件。 Set the main model file. */
        $mainModelFile = $this->getModulePath($appName, $moduleName) . 'model.php';
        if($this->config->framework->extensionLevel == 0) return $mainModelFile;

        /* 计算扩展的文件和hook文件。Compute the extension files and hook files. */
        $hookFiles     = array();
        $extFiles      = array();
        $siteExtended  = false; 

        $modelExtPaths = $this->getModuleExtPath($appName, $moduleName, 'model');
        foreach($modelExtPaths as $extType => $modelExtPath)
        {
            if(empty($modelExtPath)) continue;

            $tmpHookFiles = helper::ls($modelExtPath . 'hook/', '.php');
            $tmpExtFiles  = helper::ls($modelExtPath, '.php');
            $hookFiles    = array_merge($hookFiles, $tmpHookFiles);
            $extFiles     = array_merge($extFiles,  $tmpExtFiles);

            if($extType == 'site' and (!empty($tmpHookFiles) or !empty($tmpExtFiles))) $siteExtended = true;
        }

        /* 如果没有扩展文件,返回主文件。 If no extension or hook files, return the main file directly. */
        if(empty($extFiles) and empty($hookFiles)) return $mainModelFile;

        /* 计算合并之后的modelFile路径。Compute the merged model file path. */
        $extModelPrefix  = ($siteExtended and !empty($this->siteCode)) ? $this->siteCode{0} . DS . $this->siteCode : '';
        $mergedModelDir  = $this->getTmpRoot() . 'model' . DS . ($extModelPrefix ? $extModelPrefix . DS : '');
        $mergedModelFile = $mergedModelDir . $moduleName . '.php';
        if(!is_dir($mergedModelDir)) mkdir($mergedModelDir, 0755, true);

        /* 判断生成的缓存文件是否需要更新。 Judge whether the merged model file needed update or not. */
        if(!$this->needModelFileUpdate($mergedModelFile, $extFiles, $hookFiles, $modelExtPaths, $mainModelFile)) return $mergedModelFile;

        /* 合并扩展和hook文件。Merge the extension and hook files. */
        $modelLines = $this->mergeModelExtFiles($moduleName, $mainModelFile, $extFiles, $mergedModelDir);
        $this->mergeModelHookFiles($moduleName, $mainModelFile, $modelLines, $hookFiles, $mergedModelDir, $mergedModelFile);

        return $mergedModelFile;
    }

    /**
     * 检查合并之后的model文件是否需要更新。Check whether the merged model file need update or not.
     * 
     * @param  string    $mainModelFile 
     * @param  string    $mergedModelFile 
     * @param  string    $modelExtPaths 
     * @param  array     $extFiles 
     * @param  array     $hookFiles 
     * @access public
     * @return bool
     */
    public function needModelFileUpdate($mergedModelFile, $extFiles, $hookFiles, $modelExtPaths, $mainModelFile)
    {
        $lastTime = file_exists($mergedModelFile) ? filemtime($mergedModelFile) : 0;

        foreach($extFiles  as $extFile)  if(filemtime($extFile)  > $lastTime) return true;
        foreach($hookFiles as $hookFile) if(filemtime($hookFile) > $lastTime) return true;

        $modelExtPath  = $modelExtPaths['common']; 
        $modelHookPath = $modelExtPaths['common'] . 'hook/';
        if(is_dir($modelExtPath ) and filemtime($modelExtPath)  > $lastTime) return true;
        if(is_dir($modelHookPath) and filemtime($modelHookPath) > $lastTime) return true;

        if(!empty($modelExtPaths['site']))
        {
            $modelExtPath  = $modelExtPaths['site']; 
            $modelHookPath = $modelExtPaths['site'] . 'hook/';
            if(is_dir($modelExtPath ) and filemtime($modelExtPath)  > $lastTime) return true;
            if(is_dir($modelHookPath) and filemtime($modelHookPath) > $lastTime) return true;
        }

        if(filemtime($mainModelFile) > $lastTime) return true;

        return false;
    }

    /**
     * 将model的扩展文件合并在一起。Merge model ext files.
     * 
     * @param  string    $moduleName 
     * @param  string    $mainModelFile 
     * @param  array     $extFiles 
     * @param  string    $mergedModelDir 
     * @access public
     * @return void
     */
    public function mergeModelExtFiles($moduleName, $mainModelFile, $extFiles, $mergedModelDir)
    {
        /* 设置类名。Set the class names. */
        $modelClass    = "{$moduleName}Model";
        $tmpModelClass = "tmpExt$modelClass";

        /* 开始拼装代码。Prepare the codes. */
        $modelLines  = "<?php\n";
        $modelLines .= "global \$app;\n";
        $modelLines .= "helper::cd(\$app->getBasePath());\n";
        $modelLines .= "helper::import('" . str_replace($this->getBasePath(), '', $mainModelFile) . "');\n";
        $modelLines .= "helper::cd();\n";
        $modelLines .= "class $tmpModelClass extends $modelClass \n{\n";

        /* 将扩展文件的代码合并到代码中。Cycle all the extension files and merge them into model lines. */
        foreach($extFiles as $extFile) $modelLines .= self::removePHPTAG($extFile);

        /* 做个标记,方便后面替换代码使用。Make a mark for replacing codes. */
        $replaceMark = '//**//';
        $modelLines .= "\n$replaceMark\n}";

        /* 生成一个临时的model扩展文件,并加载,用于后续的hook文件加载使用。Create a tmp merged model file and import it for merge hook codes using. */
        $tmpModelFile = $mergedModelDir . "tmp$moduleName.php";
        if(@file_put_contents($tmpModelFile, $modelLines)) 
        {
            if(!class_exists($tmpModelClass)) include $tmpModelFile;
            return $modelLines;
        }
            
        $this->triggerError("ERROR: $tmpModelFile not writable.", __FILE__, __LINE__, true);
    }

    /**
     * 合并model的hook脚本。Merge hook files for a model.
     * 
     * @access public
     * @return void
     */
    public function mergeModelHookFiles($moduleName, $mainModelFile, $modelLines, $hookFiles, $mergedModelDir, $mergedModelFile)
    {
        /* 定义相关变量。Init vars. */
        $modelClass    = $moduleName . 'Model';
        $extModelClass = 'ext' . $modelClass;
        $tmpModelClass = 'tmpExt' . $modelClass;
        $tmpModelFile  = $mergedModelDir . "tmp$moduleName.php";
        $replaceMark   = '//**//';

        /* 读取hook文件。Get hook codes need to merge. */
        $hookCodes = array();
        foreach($hookFiles as $hookFile)
        {
            /* 通过文件名获得其对应的方法名。Get methods according it's filename. */
            $fileName = baseName($hookFile);
            list($method) = explode('.', $fileName);
            $hookCodes[$method][] = self::removePHPTAG($hookFile);
        }

        /* 合并Hook文件。Cycle the hook methods and merge hook codes. */
        $hookedMethods    = array_keys($hookCodes);
        $mainModelCodes   = file($mainModelFile);
        $mergedModelCodes = file($tmpModelFile);
        foreach($hookedMethods as $method)
        {
            /* 通过反射获得hook脚本对应的方法所在的文件和起止行数。Reflection the hooked method to get it's defined position. */
            if(!method_exists($tmpModelClass, $method)) continue;
            $methodRelfection = new reflectionMethod($tmpModelClass, $method);
            $definedFile = $methodRelfection->getFileName();
            $startLine   = $methodRelfection->getStartLine();
            $endLine     = $methodRelfection->getEndLine();

            /* 将Hook脚本和老的代码合并在一起,并替换原来的定义。Merge hook codes with old codes and replace back. */
            $oldCodes  = $definedFile == $tmpModelFile ? $mergedModelCodes : $mainModelCodes;
            $oldCodes  = join("", array_slice($oldCodes, $startLine - 1, $endLine - $startLine + 1));
            $openBrace = strpos($oldCodes, '{');
            $newCodes  = substr($oldCodes, 0, $openBrace + 1) . "\n" . join("\n", $hookCodes[$method]) . substr($oldCodes, $openBrace + 1);

            if($definedFile == $tmpModelFile) $modelLines = str_replace($oldCodes, $newCodes, $modelLines);
            if($definedFile != $tmpModelFile) $modelLines = str_replace($replaceMark, $newCodes . "\n$replaceMark", $modelLines);
        }
        
        /* 保存最终的Model文件。Save the last merged model file. */
        $modelLines = str_replace($tmpModelClass, $extModelClass, $modelLines);
        file_put_contents($mergedModelFile, $modelLines);
        unlink($tmpModelFile);
    }

    /**
     * Remove tags of PHP 
     * 
     * @param  string    $fileName 
     * @static
     * @access public
     * @return string
     */
    static public function removePHPTAG($fileName)
    {
        $code = trim(file_get_contents($fileName));
        if(strpos($code, '<?php') === 0)     $code = ltrim($code, '<?php');
        if(strrpos($code, '?>')   !== false) $code = rtrim($code, '?>');
        return trim($code);
    }

    //-------------------- 路由相关方法(Routing related methods) --------------------//
   
    /**
     * 设置路由(PATH_INFO 方式):
     * 1.设置模块名;
     * 2.设置方法名;
     * 3.设置控制器文件。
     *
     * Set the route according to PATH_INFO.
     * 1. set the module name.
     * 2. set the method name.
     * 3. set the control file.
     *
     * @access public
     * @return void
     */
    public function setRouteByPathInfo()
    {
        if(!empty($this->URI))
        {
            /*
             * 根据$requestFix分割符,分割网址。
             * There's the request seperator, split the URI by it.
             **/
            if(strpos($this->URI, $this->config->requestFix) !== false)
            {
                $items = explode($this->config->requestFix, $this->URI);
                $this->setModuleName($items[0]);
                $this->setMethodName($items[1]);
            }    
            /*
             * 如果网址中没有分隔符,使用默认的方法。
             * No reqeust seperator, use the default method name.
             **/
            else
            {
                $this->setModuleName($this->URI);
                $this->setMethodName($this->config->default->method);
            }
        }
        else
        {    
            $this->setModuleName($this->config->default->module);   // 使用默认模块 use the default module.
            $this->setMethodName($this->config->default->method);   // 使用默认方法 use the default method.
        }
        $this->setControlFile();
    }

    /**
     * 设置路由(GET 方式):
     * 1.设置模块名;
     * 2.设置方法名;
     * 3.设置控制器文件。
     *
     * Set the route according to GET.
     * 1. set the module name.
     * 2. set the method name.
     * 3. set the control file.
     *
     * @access public
     * @return void
     */
    public function setRouteByGET()
    {
        $moduleName = isset($_GET[$this->config->moduleVar]) ? strtolower($_GET[$this->config->moduleVar]) : $this->config->default->module;
        $methodName = isset($_GET[$this->config->methodVar]) ? strtolower($_GET[$this->config->methodVar]) : $this->config->default->method;
        $this->setModuleName($moduleName);
        $this->setControlFile();
        $this->setMethodName($methodName);
    }

    /**
     * 加载一个模块:
     * 1. 引入控制器文件或扩展的方法文件;
     * 2. 创建control对象;
     * 3. 解析url,得到请求的参数;
     * 4. 使用call_user_function_array调用相应的方法。
     *
     * Load a module.
     * 1. include the control file or the extension action file.
     * 2. create the control object.
     * 3. set the params passed in through url.
     * 4. call the method by call_user_function_array
     * 
     * @access public
     * @return bool|object  if the module object of die.
     */
    public function loadModule()
    {
        $appName    = $this->appName;
        $moduleName = $this->moduleName;
        $methodName = $this->methodName;

        /* 
         * 引入该模块的control文件。
         * Include the control file of the module.
         **/
        $file2Included = $this->setActionExtFile() ? $this->extActionFile : $this->controlFile;
        chdir(dirname($file2Included));
        include $file2Included;

        /*
         * 设置control的类名。
         * Set the class name of the control.
         **/
        $className = class_exists("my$moduleName") ? "my$moduleName" : $moduleName;
        if(!class_exists($className)) $this->triggerError("the control $className not found", __FILE__, __LINE__, $exit = true);

        /*
         * 创建control类的实例。
         * Create a instance of the control.
         **/
        $module = new $className();
        if(!method_exists($module, $methodName)) $this->triggerError("the module $moduleName has no $methodName method", __FILE__, __LINE__, $exit = true);
        $this->control = $module;

        /* include default value for module*/
        $defaultValueFiles = glob($this->getTmpRoot() . "defaultvalue/*.php");
        if($defaultValueFiles) foreach($defaultValueFiles as $file) include $file;

        /* 
         * 使用反射机制获取函数参数的默认值。
         * Get the default settings of the method to be called using the reflecting. 
         *
         * */
        $defaultParams = array();
        $methodReflect = new reflectionMethod($className, $methodName);
        foreach($methodReflect->getParameters() as $param)
        {
            $name = $param->getName();

            $default = '_NOT_SET';
            if(isset($paramDefaultValue[$appName][$className][$methodName][$name]))
            {
                $default = $paramDefaultValue[$appName][$className][$methodName][$name];
            }
            elseif(isset($paramDefaultValue[$className][$methodName][$name]))
            {
                $default = $paramDefaultValue[$className][$methodName][$name];
            }
            elseif($param->isDefaultValueAvailable())
            {
                $default = $param->getDefaultValue();
            }

            $defaultParams[$name] = $default;
        }

        /** 
         * 根据PATH_INFO或者GET方式设置请求的参数。
         * Set params according PATH_INFO or GET.
         */
        if($this->config->requestType != 'GET')
        {
            $this->setParamsByPathInfo($defaultParams);
        }
        else
        {
            $this->setParamsByGET($defaultParams);
        }

        if($this->config->framework->filterParam == 2)
        {
            $_GET     = validater::filterParam($_GET, 'get');
            $_COOKIE  = validater::filterParam($_COOKIE, 'cookie');
        }

        /* 调用该方法   Call the method. */
        call_user_func_array(array($module, $methodName), $this->params);
        return $module;
    }

    /**
     * 设置请求的参数(PATH_INFO 方式)。
     * Set the params by PATH_INFO.
     * 
     * @param   array  $defaultParams the default settings of the params.
     * @param   string $type
     * @access  public
     * @return  void
     */
    public function setParamsByPathInfo($defaultParams = array(), $type = '')
    {
        $params = array();
        if($type != 'fetch')
        {
            /* 分割URI。 Spit the URI. */
            $items     = explode($this->config->requestFix, $this->URI);
            $itemCount = count($items);

            /** 
             * 前两项为模块名和方法名,参数从下标2开始。
             * The first two item is moduleName and methodName. So the params should begin at 2.
             **/
            for($i = 2; $i < $itemCount; $i ++)
            {
                $key = key($defaultParams);     // Get key from the $defaultParams.
                if(empty($key)) continue;

                $params[$key] = $items[$i];
                next($defaultParams);
            }
        }

        $this->params = $this->mergeParams($defaultParams, $params);
    }

    /**
     * 设置请求的参数(GET 方式)。
     * Set the params by GET.
     * 
     * @param   array  $defaultParams the default settings of the params.
     * @param   string $type
     * @access  public
     * @return  void
     */
    public function setParamsByGET($defaultParams, $type = '')
    {
        $params = array();
        if($type != 'fetch')
        {
            /* Unset moduleVar, methodVar, viewVar and session 变量, 剩下的作为参数。 */
            /* Unset the moduleVar, methodVar, viewVar and session var, all the left are the params. */
            unset($_GET[$this->config->moduleVar]);
            unset($_GET[$this->config->methodVar]);
            unset($_GET[$this->config->viewVar]);
            unset($_GET[$this->config->sessionVar]);
            $params = $_GET;
        }

        $this->params = $this->mergeParams($defaultParams, $params);
    }

    /**
     * 合并请求的参数和默认参数,这样就可以省略已经有默认值的参数了。
     * Merge the params passed in and the default params. Thus the params which have default values needn't pass value, just like a function.
     *
     * @param   array $defaultParams     the default params defined by the method.
     * @param   array $passedParams      the params passed in through url.
     * @access  public
     * @return  array the merged params.
     */
    public function mergeParams($defaultParams, $passedParams)
    {
        global $filter;

        /* Remove these two params. */
        unset($passedParams['onlybody']);
        unset($passedParams['HTTP_X_REQUESTED_WITH']);

        /* Check params from URL. */
        $nameRule = isset($filter->{$this->moduleName}->{$this->methodName}->paramName)  ? $filter->{$this->moduleName}->{$this->methodName}->paramName  : $filter->default->paramName;
        foreach($passedParams as $param => $value)
        {
            if(!validater::checkByRule($param, $nameRule)) die('Bad Request!');
            $valueRule = $filter->default->paramValue;
            if(isset($filter->{$this->moduleName}->{$this->methodName}->paramValue[$param]))
            {
                $valueRule = $filter->{$this->moduleName}->{$this->methodName}->paramValue[$param];
            }

            if($value and !validater::checkByRule($value, $valueRule)) die('Bad Request!');
        }

        $passedParams = array_values($passedParams);
        $i = 0;
        foreach($defaultParams as $key => $defaultValue)
        {
            if(isset($passedParams[$i]))
            {
                $defaultParams[$key] = strip_tags($passedParams[$i]);
            }
            else
            {
                if($defaultValue === '_NOT_SET') $this->triggerError("The param '$key' should pass value. ", __FILE__, __LINE__, $exit = true);
            }
            $i ++;
        }

        return $defaultParams;
    }

    /**
     * 获取$moduleName变量。
     * Get the $moduleName var.
     * 
     * @access public
     * @return string
     */
    public function getModuleName()
    {
        return $this->moduleName;
    }

    /**
     * 获取$controlFile变量。
     * Get the $controlFile var.
     * 
     * @access public
     * @return string
     */
    public function getControlFile()
    {
        return $this->controlFile;
    }

    /**
     * 获取$methodName变量。
     * Get the $methodName var.
     * 
     * @access public
     * @return string
     */
    public function getMethodName()
    {
        return $this->methodName;
    }

    /**
     * 获取$param变量。
     * Get the $param var.
     * 
     * @access public
     * @return string
     */
    public function getParams()
    {
        return $this->params;
    }

    //-------------------- 常用的工具方法(Tool methods) ------------------//

    /**
     * 从类库中加载一个类文件。
     *
     * Load a class file.
     *
     * @param   string $className  the class name
     * @param   bool   $static     statis class or not
     * @access  public
     * @return  object|bool the instance of the class or just true.
     */
    public function loadClass($className, $static = false)
    {
        $className = strtolower($className);

        /* 搜索$coreLibRoot(Search in $coreLibRoot) */
        $classFile = $this->coreLibRoot . $className;
        if(is_dir($classFile)) $classFile .= DS . $className;
        $classFile .= '.class.php';
        if(!helper::import($classFile)) $this->triggerError("class file $classFile not found", __FILE__, __LINE__, $exit = true);

        /* 如果是静态调用,则返回(If staitc, return) */
        if($static) return true;

        /* 实例化该类(Instance it) */
        global $$className;
        if(!class_exists($className)) $this->triggerError("the class $className not found in $classFile", __FILE__, __LINE__, $exit = true);
        if(!is_object($$className)) $$className = new $className();
        return $$className;
    }

    /**
     * 加载整个应用公共的配置文件。
     * Load the common config files for the app.
     * 
     * @access public
     * @return void
     */
    public function loadMainConfig()
    {
        /* 初始化$config对象。Init the $config object. */
        global $config, $filter;
        if(!is_object($config)) $config = new config();
        $this->config = $config;

        /* 加载主配置文件。 Load the main config file. */
        $mainConfigFile = $this->configRoot . 'config.php';
        if(!file_exists($mainConfigFile)) $this->triggerError("The main config file $mainConfigFile not found", __FILE__, __LINE__, $exit = true);
        include $mainConfigFile;
    }

    /**
     * 当multiSite功能打开的时候,加载额外的配置文件。
     * When multiSite feature enabled, load extra config file.
     * 
     * @access public
     * @return void
     */
    public function loadExtraConfig()
    {
        global $config;
        $multiConfigFile = $this->configRoot . 'multi.php';
        if(file_exists($multiConfigFile)) include $multiConfigFile;

        $siteConfigFile = $this->configRoot . "sites/{$this->siteCode}.php";
        if(file_exists($siteConfigFile))  include $siteConfigFile;
    }

    /**
     * 加载模块的config文件,返回全局$config对象。
     * 如果该模块是common,加载$configRoot的配置文件,其他模块则加载其模块的配置文件。
     *
     * Load config and return it as the global config object.
     * If the module is common, search in $configRoot, else in $modulePath.
     *
     * @param   string $moduleName     module name
     * @param   string $appName        app name
     * @param   bool   $exitIfNone     exit or not
     * @access  public
     * @return  object|bool the config object or false.
     */
    public function loadModuleConfig($moduleName, $appName = '')
    {
        global $config;

        if($config and (!isset($config->$moduleName) or !is_object($config->$moduleName))) $config->$moduleName = new stdclass();

        /* 初始化数组。Init the variables. */
        $extConfigFiles       = array();
        $commonExtConfigFiles = array();
        $siteExtConfigFiles   = array();

        /* 先获得模块的主配置文件。Get the main config file for current module first. */
        $mainConfigFile = $this->getModulePath($appName, $moduleName) . 'config.php';

        /* 查找扩展配置文件。Get extension config files. */
        if($config->framework->extensionLevel > 0) $extConfigPath = $this->getModuleExtPath($appName, $moduleName, 'config');
        if($config->framework->extensionLevel >= 1 and !empty($extConfigPath['common'])) $commonExtConfigFiles = helper::ls($extConfigPath['common'], '.php');
        if($config->framework->extensionLevel == 2 and !empty($extConfigPath['site']))   $siteExtConfigFiles   = helper::ls($extConfigPath['site'], '.php');
        $extConfigFiles = array_merge($commonExtConfigFiles, $siteExtConfigFiles);

        /* 将主配置文件和扩展配置文件合并在一起。Put the main config file and extension config files together. */
        $configFiles = array_merge(array($mainConfigFile), $extConfigFiles);

        /* 加载每一个配置文件。Load every config file. */
        static $loadedConfigs = array();
        foreach($configFiles as $configFile)
        {
            if(in_array($configFile, $loadedConfigs)) continue;
            if(file_exists($configFile)) include $configFile;
            $loadedConfigs[] = $configFile;
        }

        /* 加载数据库中与本模块相关的配置项。Merge from the db configs. */
        if($moduleName != 'common')
        {
            if(isset($config->system->$moduleName))   $this->mergeConfig($config->system->$moduleName, $moduleName);
            if(isset($config->personal->$moduleName)) $this->mergeConfig($config->personal->$moduleName, $moduleName);
        }
    }

    /**
     * Merge db config.
     * 
     * @param  array  $dbConfig 
     * @param  string $moduleName 
     * @access public
     * @return void
     */
    public  function mergeConfig($dbConfig, $moduleName = 'common')
    {
        global $config;

        /* 如果没有设置本模块配置,则首先进行初始化。Init the $config->$moduleName if not set.*/
        if($moduleName != 'common' and !isset($config->$moduleName)) $config->$moduleName = new stdclass();

        $config2Merge = $config;
        if($moduleName != 'common') $config2Merge = $config->$moduleName;

        foreach($dbConfig as $item)
        {
            if($item->section)
            {
                if(!isset($config2Merge->{$item->section})) $config2Merge->{$item->section} = new stdclass();
                if(is_object($config2Merge->{$item->section}))
                {
                    $config2Merge->{$item->section}->{$item->key} = $item->value;
                }
            }
            else
            {
                $config2Merge->{$item->key} = $item->value;
            }
        }
    }

    /**
     * 向客户端输出配置参数,客户端可以根据这些参数实现和调整请求的逻辑。
     * Export the config params to the client, thus the client can adjust it's logic according the config.
     * 
     * @access public
     * @return void
     */
    public function exportConfig()
    {
        $view = new stdclass();
        $view->version     = $this->config->version;
        $view->requestType = $this->config->requestType;
        $view->requestFix  = $this->config->requestFix;
        $view->moduleVar   = $this->config->moduleVar;
        $view->methodVar   = $this->config->methodVar;
        $view->viewVar     = $this->config->viewVar;
        $view->sessionVar  = $this->config->sessionVar;

        $this->session->set('random', mt_rand(0, 10000));
        $view->sessionName = session_name();
        $view->sessionID   = session_id();
        $view->random      = $this->session->random;
        $view->expiredTime = ini_get('session.gc_maxlifetime');
        $view->serverTime  = time();

        echo json_encode($view);
    }

    /**
     * 加载语言文件,返回全局$lang对象。
     * Load lang and return it as the global lang object.
     * 
     * @param   string $moduleName     the module name
     * @param   string $appName     the app name
     * @access  public
     * @return  bool|object the lang object or false.
     */
    public function loadLang($moduleName, $appName = '')
    {
        /* 初始化变量。Init vars. */
        $modulePath      = $this->getModulePath($appName, $moduleName);
        $extLangFiles    = array();
        $langFilesToLoad = array();

        /* 判断主语言文件是否存在。Whether the main lang file exists or not. */
        $mainLangFile = $modulePath . 'lang' . DS . $this->clientLang . '.php';
        if(file_exists($mainLangFile)) $langFilesToLoad[] = $mainLangFile;

        /* 获取扩展语言文件。If extensionLevel > 0, get extension lang files. */
        if($this->config->framework->extensionLevel > 0)
        {
            $commonExtLangFiles = array();
            $siteExtLangFiles   = array();

            $extLangPath = $this->getModuleExtPath($appName, $moduleName, 'lang');
            if($this->config->framework->extensionLevel >= 1 and !empty($extLangPath['common'])) $commonExtLangFiles = helper::ls($extLangPath['common'] . $this->clientLang, '.php');
            if($this->config->framework->extensionLevel == 2 and !empty($extLangPath['site']))   $siteExtLangFiles   = helper::ls($extLangPath['site'] . $this->clientLang, '.php');
            $extLangFiles  = array_merge($commonExtLangFiles, $siteExtLangFiles);
        }

        /* 计算最终要加载的语言文件。 Get the lang files to be loaded. */
        $langFilesToLoad = array_merge($langFilesToLoad, $extLangFiles);
        if(empty($langFilesToLoad)) return false;

        /* 加载语言文件。Load lang files. */
        global $lang;
        if(!is_object($lang)) $lang = new language();
        if(!isset($lang->$moduleName)) $lang->$moduleName = new stdclass();

        static $loadedLangs = array();
        foreach($langFilesToLoad as $langFile)
        {
            if(in_array($langFile, $loadedLangs)) continue;
            include $langFile;
            $loadedLangs[] = $langFile;
        }

        $this->lang = $lang;
        return $lang;
    }

    /**
     * 连接数据库。
     * Connect to database.
     * 
     * @access public
     * @return void
     */
    public function connectDB()
    {
        global $config, $dbh, $slaveDBH;
        if(!isset($config->installed) or !$config->installed) return;

        if(isset($config->db->host))      $this->dbh      = $dbh      = $this->connectByPDO($config->db);
        if(isset($config->slaveDB->host)) $this->slaveDBH = $slaveDBH = $this->connectByPDO($config->slaveDB);
    }

    /**
     * 使用PDO连接数据库。
     * Connect database by PDO.
     * 
     * @param  object    $params    the database params.
     * @access public
     * @return object|bool
     */
    public function connectByPDO($params)
    {
        if(!isset($params->driver)) self::triggerError('no pdo driver defined, it should be mysql or sqlite', __FILE__, __LINE__, $exit = true);
        if(!isset($params->user)) return false;
        if($params->driver == 'mysql')
        {
            $dsn = "mysql:host={$params->host}; port={$params->port}; dbname={$params->name}";
        }    
        try 
        {
            $dbh = new PDO($dsn, $params->user, $params->password, array(PDO::ATTR_PERSISTENT => $params->persistant));
            $dbh->exec("SET NAMES {$params->encoding}");

            /*
             * 如果系统是Linux,开启仿真预处理和缓冲查询。
             * If run on linux, set emulatePrepare and bufferQuery to true.
             **/
            if(!isset($params->emulatePrepare) and PHP_OS == 'Linux') $params->emulatePrepare = true;
            if(!isset($params->bufferQuery) and PHP_OS == 'Linux')    $params->bufferQuery = true;

            $dbh->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
            $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            if(isset($params->strictMode) and $params->strictMode == false) $dbh->exec("SET @@sql_mode= ''");
            if(isset($params->emulatePrepare)) $dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, $params->emulatePrepare);
            if(isset($params->bufferQuery))    $dbh->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, $params->bufferQuery);

            return $dbh;
        }
        catch (PDOException $exception)
        {
            self::triggerError($exception->getMessage(), __FILE__, __LINE__, $exit = true);
        }
    }

    //-------------------- 错误处理方法(Error methods) ------------------//

    /**
     * 程序停止时执行的函数。
     * The shutdown handler.
     * 
     * @access public
     * @return void
     */
    public function shutdown()
    {
        /* 如果debug模式开启,保存sql语句(If debug on, save sql queries) */
        if(!empty($this->config->debug)) $this->saveSQL();

        /* 
         * 发现错误,保存到日志中。
         * If any error occers, save it.
         * */
        if(!function_exists('error_get_last')) return;
        $error = error_get_last();
        if($error) $this->saveError($error['type'], $error['message'], $error['file'], $error['line']);
    }

    /**
     * 触发一个错误。
     * Trigger an error.
     * 
     * @param string    $message    错误信息      error message
     * @param string    $file       所在文件      the file error occers
     * @param int       $line       错误行        the line error occers
     * @param bool      $exit       是否停止程序  exit the program or not
     * @access public
     * @return void
     */
    public function triggerError($message, $file, $line, $exit = false)
    {
        /* 设置错误信息(Set the error info) */
        $message = htmlspecialchars($message);
        $log     = "ERROR: $message in $file on line $line";
        if(isset($_SERVER['SCRIPT_URI'])) $log .= ", request: $_SERVER[SCRIPT_URI]";; 
        $trace = debug_backtrace();
        extract($trace[0]);
        extract($trace[1]);
        $log .= ", last called by $file on line $line through function $function.\n";

        /* 触发错误(Trigger the error) */
        trigger_error($log, $exit ? E_USER_ERROR : E_USER_WARNING);
    }

    /**
     * 保存错误信息。
     * Save error info.
     * 
     * @param  int    $level 
     * @param  string $message 
     * @param  string $file 
     * @param  int    $line 
     * @access public
     * @return void
     */
    public function saveError($level, $message, $file, $line)
    {
        if(empty($this->config->debug))  return true;
        if(!is_dir($this->logRoot))      return true;
        if(!is_writable($this->logRoot)) return true;

        /*
         * 删除设定时间之前的日志。
         * Delete the log before the set time.
         **/
        if(mt_rand(0, 10) == 1)
        {
            $logDays = isset($this->config->framework->logDays) ? $this->config->framework->logDays : 14;
            $dayTime = time() - $logDays * 24 * 3600;
            foreach(glob($this->getLogRoot() . '*') as $logFile)
            {
                if(filemtime($logFile) <= $dayTime) unlink($logFile);
            }
        }

        /* 
         * 忽略该错误:Redefining already defined constructor。
         * Skip the error: Redefining already defined constructor.
         **/
        if(strpos($message, 'Redefining') !== false) return true;

        /* 
         * 设置错误信息。
         * Set the error info.
         **/
        $errorLog  = "\n" . date('H:i:s') . " $message in <strong>$file</strong> on line <strong>$line</strong> ";
        $errorLog .= "when visiting <strong>" . htmlspecialchars($this->getURI()) . "</strong>\n";

        /* 
         * 为了安全起见,对公网环境隐藏脚本路径。
         * If the ip is pulic, hidden the full path of scripts.
         */
        if(!defined('IN_SHELL') and !($this->server->remote_addr == '127.0.0.1' or filter_var($this->server->remote_addr, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE) === false))
        {
            $errorLog  = str_replace($this->getBasePath(), '', $errorLog);
        }

        /* 保存到日志文件(Save to log file) */
        $errorFile = $this->logRoot . 'php.' . date('Ymd') . '.log.php';
        if(!is_file($errorFile)) file_put_contents($errorFile, "<?php\n die();\n?>\n");

        $fh = fopen($errorFile, 'a');
        if($fh) fwrite($fh, strip_tags($errorLog)) and fclose($fh);

        /* 
         * 如果debug > 1,显示warning, notice级别的错误。
         * If the debug > 1, show warning, notice error.
         **/
        if($level == E_NOTICE or $level == E_WARNING or $level == E_STRICT or $level == 8192) // 8192: E_DEPRECATED
        {
            if(!empty($this->config->debug) and $this->config->debug > 1)
            {
                $cmd  = "vim +$line $file";
                $size = strlen($cmd);
                echo "<pre class='alert alert-danger'>$message: ";
                echo "<input type='text' value='$cmd' size='$size' style='border:none; background:none;' onclick='this.select();' /></pre>";
            }
        }

        /* 
         * 如果是严重错误,停止程序。
         * If error level is serious, die.
         * */
        if($level == E_ERROR or $level == E_PARSE or $level == E_CORE_ERROR or $level == E_COMPILE_ERROR or $level == E_USER_ERROR)
        {
            if(empty($this->config->debug)) die();
            if(PHP_SAPI == 'cli') die($errorLog);

            $htmlError  = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /></head>";
            $htmlError .= "<body>" . nl2br($errorLog) . "</body></html>";
            die($htmlError);
        }
    }

    /**
     * 保存sql语句。
     * Save the sql.
     * 
     * @access public
     * @return void
     */
    public function saveSQL()
    {
        if(!$this->config->debug) return true;
        if(!class_exists('dao')) return;

        $sqlLog = $this->getLogRoot() . 'sql.' . date('Ymd') . '.log.php';
        if(!is_file($sqlLog)) file_put_contents($sqlLog, "<?php\n die();\n?>\n");

        $fh = @fopen($sqlLog, 'a');
        if(!$fh) return false;
        fwrite($fh, date('Ymd H:i:s') . ": " . $this->getURI() . "\n");
        foreach(dao::$querys as $query) fwrite($fh, "  $query\n");
        fwrite($fh, "\n");
        fclose($fh);
    }
}

/**
 * config类。
 * The config class.
 * 
 * @package framework
 */
class config
{ 
    /**
     * 设置成员变量,成员可以是'db.user'类似的格式。
     * Set the value of a member. the member can be the format like db.user.
     * 
     * <code>
     * <?php
     * $config->set('db.user', 'wwccss'); 
     * ?>
     * </code>
     * @param   string  $key    the key of the member
     * @param   mixed   $value  the value
     * @access  public
     * @return  void
     */
    public function set($key, $value)
    {
        helper::setMember('config', $key, $value);
    }
}

/**
 * lang类。
 * The lang class.
 * 
 * @package framework
 */
class language 
{
    /**
     * 设置成员变量,成员可以是'db.user'类似的格式。
     * Set the value of a member. the member can be the foramt like db.user.
     * 
     * <code>
     * <?php
     * $lang->set('version', '1.0); 
     * ?>
     * </code>
     * @param   string  $key    成员的键名,可以是father.child的形式。
     *                          the key of the member, can be father.child 
     * @param   mixed   $value  the value
     * @access  public
     * @return  void
     */
    public function set($key, $value)
    {
        helper::setMember('lang', $key, $value);
    }

    /**
     * 显示一个成员的值。
     * Show a member. 
     * 
     * @param   object $obj    the object
     * @param   string $key    the key
     * @access  public
     * @return  void
     */
    public function show($obj, $key)
    {
        $obj = (array)$obj;
        echo isset($obj[$key]) ? $obj[$key] : '';
    }
}

/**
 * 超级对象类,转化超级全局变量。
 * The super object class.
 * 
 * @package framework
 */
class super
{
    /**
     * 构造函数,设置超级变量名。
     * Construct, set the var scope.
     * 
     * @param   string $scope  the scope, can be server, post, get, cookie, session, global
     * @access  public
     * @return  void
     */
    public function __construct($scope)
    {
        $this->scope = $scope;
    }

    /**
     * 设置超级变量的成员值。
     * Set one member value. 
     * 
     * @param   string    the key
     * @param   mixed $value  the value
     * @access  public
     * @return  void
     */
    public function set($key, $value)
    {
        if($this->scope == 'post')
        {
            $_POST[$key] = $value;
        }
        elseif($this->scope == 'get')
        {
            $_GET[$key] = $value;
        }
        elseif($this->scope == 'server')
        {
            $_SERVER[$key] = $value;
        }
        elseif($this->scope == 'cookie')
        {
            $_COOKIE[$key] = $value;
        }
        elseif($this->scope == 'session')
        {
            $_SESSION[$key] = $value;
        }
        elseif($this->scope == 'env')
        {
            $_ENV[$key] = $value;
        }
        elseif($this->scope == 'global')
        {
            $GLOBALS[$key] = $value;
        }
    }

    /**
     * 超级变量的魔术方法,比如用$post->key访问$_POST['key']。
     * The magic get method.
     * 
     * @param  string $key    the key
     * @access public
     * @return mixed|bool     return the value of the key or false.
     */
    public function __get($key)
    {
        if($this->scope == 'post')
        {
            if(isset($_POST[$key])) return $_POST[$key];
            return false;
        }
        elseif($this->scope == 'get')
        {
            if(isset($_GET[$key])) return $_GET[$key];
            return false;
        }
        elseif($this->scope == 'server')
        {
            if($key == 'ajax') return isset($_SERVER['HTTP_X_REQUESTED_WITH']) ? true : false;
            if(isset($_SERVER[$key])) return $_SERVER[$key];
            $key = strtoupper($key);
            if(isset($_SERVER[$key])) return $_SERVER[$key];
            return false;
        }
        elseif($this->scope == 'cookie')
        {
            if(isset($_COOKIE[$key])) return $_COOKIE[$key];
            return false;
        }
        elseif($this->scope == 'session')
        {
            if(isset($_SESSION[$key])) return $_SESSION[$key];
            return false;
        }
        elseif($this->scope == 'env')
        {
            if(isset($_ENV[$key])) return $_ENV[$key];
            return false;
        }
        elseif($this->scope == 'global')
        {
            if(isset($GLOBALS[$key])) return $GLOBALS[$key];
            return false;
        }
        else
        {
            return false;
        }
    }

    /**
     * 打印变量的详细结构。
     * Print the structure.
     * 
     * @access public
     * @return void
     */
    public function a()
    {
        if($this->scope == 'post')    a($_POST);
        if($this->scope == 'get')     a($_GET);
        if($this->scope == 'server')  a($_SERVER);
        if($this->scope == 'cookie')  a($_COOKIE);
        if($this->scope == 'session') a($_SESSION);
        if($this->scope == 'env')     a($_ENV);
        if($this->scope == 'global')  a($GLOBALS);
    }
}


================================================
FILE: framework/control.class.php
================================================
<?php
/**
 * Control类从baseControl类继承而来,每个模块的control对象从control类集成。
 * 您可以对baseControl类进行扩展,扩展的逻辑可以定义在这个文件中。
 *
 * This control class extends from the baseControl class and extened by every module's control. 
 * You can extend the baseControl class by change this file.
 *
 * @package framework
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 *
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
include FRAME_ROOT . '/base/control.class.php';
class control extends baseControl
{
}


================================================
FILE: framework/helper.class.php
================================================
<?php
/**
 * Helper类从baseHelper类继承而来,您可以在这个文件中对其进行扩展。
 * This helper class extends from the baseHelper class, and you can
 * extend it by change this helper.class.php file.
 *
 * @package framework
 *
 * The author disclaims copyright to this source code. In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
include FRAME_ROOT . '/base/helper.class.php';
class helper extends baseHelper
{
}


================================================
FILE: framework/model.class.php
================================================
<?php
/**
 * model类从baseModel类继承而来,每个模块的model对象从model类集成。
 * 您可以对baseModel类进行扩展,扩展的逻辑可以定义在这个文件中。
 *
 * This model class extends from the baseModel class and extened by every module's model. 
 * You can extend the baseModel class by change this file.
 *
 * @package framework
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
include FRAME_ROOT . '/base/model.class.php';
class model extends baseModel
{
}


================================================
FILE: framework/router.class.php
================================================
<?php
/**
 * router类从baseRouter类集成而来,您可以通过修改这个文件实现对baseRouter类的扩展。
 * The router class extend from baseRouter class, you can extend baseRouter class by change this file.
 *
 * @package framework
 *
 * The author disclaims copyright to this source code. In place of 
 * a legal notice, here is a blessing:
 *
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
define('FRAME_ROOT', dirname(__FILE__));
include FRAME_ROOT . '/base/router.class.php';
class router extends baseRouter
{
}


================================================
FILE: framework/tests/helper/.case001.expect
================================================
stdClass Object
(
    [a1] => 1
    [a2] => 2
    [a3] => stdClass Object
        (
            [b1] => 3
            [b2] => 4
        )

    [a4] => stdClass Object
        (
            [b3] => stdClass Object
                (
                    [c1] => 5
                )

        )

    [a5] => 6
    [a6] => stdClass Object
        (
            [b4] => 7
        )

    [a7] => stdClass Object
        (
            [b5] => stdClass Object
                (
                    [c2] => 8
                )

        )

)
3
10


================================================
FILE: framework/tests/helper/.case002.expect
================================================
chunsheng
wang'chun"sheng
Array
(
    [0] => a
    [1] => b
    [2] => c
)
stdClass Object
(
)
localhost
chunsheng'.wang
Array
(
    [0] => 1
    [1] => 2
    [2] => 3
)


================================================
FILE: framework/tests/helper/.case003.expect
================================================
/index/index.html
/user/login.html
/user/view/k1/v1/k2/v2.html
/user/view/k1/v1/k2/v2.html

/index/index.html
/user/login.html
/user/view/v1/v2.html
/user/view/v1/v2.html

/index-index.html
/user-login.html
/user-view-v1-v2.html
/user-view-v1-v2.html

/?m=index&f=index&t=html
/?m=user&f=login&t=html
/?m=user&f=view&t=html&k1=v1&k2=v2
/?m=user&f=view&t=html&k1=v1&k2=v2


================================================
FILE: framework/tests/helper/.case004.expect
================================================
case004.php
helper.class.php
import1.php

case004.php
helper.class.php
import1.php

case004.php
helper.class.php
import1.php
import2.php

bool(false)


================================================
FILE: framework/tests/helper/case001.php
================================================
#!/usr/bin/env php
<?php
/**
 * 测试array2Object方法。
 *
 * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)
 * @author      chunsheng.wang <chunsheng@cnezsoft.com>
 * @package     Testing
 * @version     $Id$
 * @link        http://www.zentao.net
 * @license     http://opensource.org/licenses/lgpl-3.0.html LGPL
 */
include '../../helper.class.php';
$array['a1'] = '1';
$array['a2'] = '2';
$array['a3']['b1'] = '3';
$array['a3']['b2'] = '4';
$array['a4']['b3']['c1'] = '5';
$array['a5'] = '6';
$array['a6']['b4'] = '7';
$array['a7']['b5']['c2'] = '8';

$config = new stdClass();
eval (helper::array2object($array, 'config'));
print_r($config);
echo $config->a3->b1;
echo "\n";
helper::setMember('config', 'a3.b1', 10);
echo $config->a3->b1;
echo "\n";
?>


================================================
FILE: framework/tests/helper/case002.php
================================================
#!/usr/bin/env php
<?php
/**
 * 测试setMember方法。
 *
 * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)
 * @author      chunsheng.wang <chunsheng@cnezsoft.com>
 * @package     Testing
 * @version     $Id$
 * @link        http://www.zentao.net
 * @license     http://opensource.org/licenses/lgpl-3.0.html LGPL
 */
include '../../helper.class.php';
$config = new stdClass();

/* 测试一维属性的修改。*/
$config->user = 'wwccss';
helper::setMember('config', 'user', 'chunsheng');
echo $config->user . "\n";

/* 赋值的变量含有单双引号。*/
$config->name = 'wwccss';
helper::setMember('config', 'name', "wang'chun\"sheng");
echo $config->name . "\n";

/* 赋值的变量为一个数组。*/
$config->users = array(1,2,3);
helper::setMember('config', 'users', array('a', 'b', 'c'));
print_r($config->users);

/* 赋值的变量为一个对象。*/
$config->obj = array(1,2,3);
helper::setMember('config', 'obj', new stdClass());
print_r($config->obj);

/* 测试二维属性的修改。*/
$config->db->host = 'localhost';
$config->db->user = 'wwccss';
$config->db->param = array();
helper::setMember('config', 'db.host', "localhost");
helper::setMember('config', 'db.user', "chunsheng'.wang");
helper::setMember('config', 'db.param', array('1', '2', '3'));
echo $config->db->host . "\n";
echo $config->db->user . "\n";
print_r($config->db->param);
?>


================================================
FILE: framework/tests/helper/case003.php
================================================
#!/usr/bin/env php
<?php
/**
 * 测试createLink方法
 *
 * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)
 * @author      chunsheng.wang <chunsheng@cnezsoft.com>
 * @package     Testing
 * @version     $Id$
 * @link        http://www.zentao.net
 * @license     http://opensource.org/licenses/lgpl-3.0.html LGPL
 */
include '../../helper.class.php';

/* 实例化app的mock对象。*/
$app = new mockapp();
$app->setViewType('html');

/* 设置cfg配置,并将其转换为$config对象。*/
$cfg['webRoot'] = '/';
$cfg['requestType'] = 'PATH_INFO';
$cfg['requestFix'] = '/';
$cfg['pathType']   = 'full';
$cfg['moduleVar']  = 'm';
$cfg['methodVar']  = 'f';
$cfg['viewVar']    = 't';
eval(helper::array2Object($cfg, 'config'));

/* PATH_INFO + FULL*/
$vars = array('k1' => 'v1', 'k2' => 'v2');
echo helper::createLink('index') . "\n";               // 只有模块名。
echo helper::createLink('user', 'login') . "\n";       // 增加方法名。
echo helper::createLink('user', 'view', $vars) . "\n"; // 增加参数。
$vars = 'k1=v1&k2=v2';
echo helper::createLink('user', 'view', $vars) . "\n\n"; // 参数改成str形式。

/* PATH_INFO + CLEAN */
$config->pathType = 'clean';
$vars = array('k1' => 'v1', 'k2' => 'v2');
echo helper::createLink('index') . "\n";               // 只有模块名。
echo helper::createLink('user', 'login') . "\n";       // 增加方法名。
echo helper::createLink('user', 'view', $vars) . "\n"; // 增加参数。
$vars = 'k1=v1&k2=v2';
echo helper::createLink('user', 'view', $vars) . "\n\n"; // 参数改成str形式。

/* PATH_INFO + CLEAN + REQUESTFIX */
$config->requestFix = '-';
$vars = array('k1' => 'v1', 'k2' => 'v2');
echo helper::createLink('index') . "\n";               // 只有模块名。
echo helper::createLink('user', 'login') . "\n";       // 增加方法名。
echo helper::createLink('user', 'view', $vars) . "\n"; // 增加参数。
$vars = 'k1=v1&k2=v2';
echo helper::createLink('user', 'view', $vars) . "\n\n"; // 参数改成str形式。

/* GET + CLEAN */
$config->requestType = 'GET';
$vars = array('k1' => 'v1', 'k2' => 'v2');
echo helper::createLink('index') . "\n";               // 只有模块名。
echo helper::createLink('user', 'login') . "\n";       // 增加方法名。
echo helper::createLink('user', 'view', $vars) . "\n"; // 增加参数。
$vars = 'k1=v1&k2=v2';
echo helper::createLink('user', 'view', $vars) . "\n"; // 参数改成str形式。

/**
 * app的mock对象。
 * 
 * @package Testing
 */
class mockapp
{
    private $viewType;
    public function setViewType($viewType)
    {
        $this->viewType = $viewType;
    }
    public function getViewType()
    {
        return $this->viewType;
    }
}
?>


================================================
FILE: framework/tests/helper/case004.php
================================================
#!/usr/bin/env php
<?php
/**
 * 测试import方法
 *
 * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)
 * @author      chunsheng.wang <chunsheng@cnezsoft.com>
 * @package     Testing
 * @version     $Id$
 * @link        http://www.zentao.net
 * @license     http://opensource.org/licenses/lgpl-3.0.html LGPL
 */
include '../../helper.class.php';

/* 首次包含。*/
helper::import('import1.php');
printIncluded();

/* 重复包含。*/
helper::import('import1.php');
printIncluded();

/* 包含第二个文件。*/
helper::import('import2.php');
printIncluded();

/* 包含不存在的文件。*/
var_dump(helper::import('noexits.php'));

/**
 * 只打印包含文件的文件名。
 * 
 * @access public
 * @return void
 */
function printIncluded()
{
    $files = get_included_files();
    foreach($files as $file)
    {
        echo basename($file) . "\n";
    }
    echo "\n";
}
?>


================================================
FILE: framework/tests/helper/import1.php
================================================
<?php
/**
 * import方法的辅助测试文件。
 *
 * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)
 * @author      chunsheng.wang <chunsheng@cnezsoft.com>
 * @package     Testing
 * @version     $Id$
 * @link        http://www.zentao.net
 * @license     http://opensource.org/licenses/lgpl-3.0.html LGPL
 */

class myclass1{};
?>


================================================
FILE: framework/tests/helper/import2.php
================================================
<?php
/**
 * import方法的辅助测试文件。
 *
 * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)
 * @author      chunsheng.wang <chunsheng@cnezsoft.com>
 * @package     Testing
 * @version     $Id$
 * @link        http://www.zentao.net
 * @license     http://opensource.org/licenses/lgpl-3.0.html LGPL
 */
class myclass2{};
?>


================================================
FILE: index.php
================================================
<?php
/**
 * 整个应用的入口文件。
 * The router file of zentaophp.
 *
 * All request should be routed by this router.
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
/* 先关闭所有的错误输出。Turn off error reporting first. */
error_reporting(0);

/* 使用ob捕获所有的输出。Use ob to get output. */
ob_start();

/* 加载框架核心文件。Load the framework. */
include './framework/router.class.php';
include './framework/control.class.php';
include './framework/model.class.php';
include './framework/helper.class.php';

/* 响应请求。Response the request. */
$app    = router::createApp('demo', dirname(__FILE__), 'router');     // 实例化router。  Instance the router class.
$common = $app->loadCommon();                                         // 加载common模块。Load the common module.
$app->parseRequest();                                                 // 解析请求。      Parse the request.
$app->loadModule();                                                   // 加载模块。      Load module.
echo helper::removeUTF8Bom(ob_get_clean());                           // 输出内容。      Print the output.


================================================
FILE: js/my.js
================================================
/**
 * The js file of ZenTaoPHP.
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */

/**
 * Create link. 
 * 
 * @param  string $moduleName 
 * @param  string $methodName 
 * @param  string $vars 
 * @param  string $viewType 
 * @access public
 * @return string
 */
function createLink(moduleName, methodName, vars, viewType)
{
    if(!viewType) viewType = config.defaultView;
    if(vars)
    {
        vars = vars.split('&');
        for(i = 0; i < vars.length; i ++) vars[i] = vars[i].split('=');
    }
    if(config.requestType != 'GET')
    {
        if(config.requestType == 'PATH_INFO') link = config.webRoot + moduleName + config.requestFix + methodName;
        if(config.requestType == 'PATH_INFO2') link = config.webRoot + 'index.php/'  + moduleName + config.requestFix + methodName;
        if(vars)
        {
            for(i = 0; i < vars.length; i ++) link += config.requestFix + vars[i][1];
        }
        link += '.' + viewType;
    }
    else
    {
        link = config.router + '?' + config.moduleVar + '=' + moduleName + '&' + config.methodVar + '=' + methodName + '&' + config.viewVar + '=' + viewType;
        if(vars) for(i = 0; i < vars.length; i ++) link += '&' + vars[i][0] + '=' + vars[i][1];
    }
    return link;
}

/**
 * Switch language.
 * 
 * @param  object $switcher 
 * @access public
 * @return void
 */
function switchLang(switcher)
{
    $.cookie('lang', $(switcher).data('lang'));
    location.href = location.href;
}


================================================
FILE: lib/base/dao/dao.class.php
================================================
<?php
/**
 * ZenTaoPHP的dao和sql类。
 * The dao and sql class file of ZenTaoPHP framework.
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */

/**
 * DAO类。
 * DAO, data access object.
 * 
 * @package framework
 */
class baseDAO
{
    /* Use these strange strings to avoid conflicting with these keywords in the sql body. */
    const WHERE   = 'wHeRe';
    const GROUPBY = 'gRoUp bY';
    const HAVING  = 'hAvInG';
    const ORDERBY = 'oRdEr bY';
    const LIMIT   = 'lImiT';

    /**
     * 全局对象$app
     * The global app object.
     * 
     * @var object
     * @access public
     */
    public $app;

    /**
     * 全局对象$config
     * The global config object.
     * 
     * @var object
     * @access public
     */
    public $config;

    /**
     * 全局对象$lang
     * The global lang object.
     * 
     * @var object
     * @access public
     */
    public $lang;

    /**
     * 全局对象$dbh
     * The global dbh(database handler) object.
     * 
     * @var object
     * @access public
     */
    public $dbh;

    /**
     * 全局对象$slaveDBH。
     * The global slaveDBH(database handler) object.
     * 
     * @var object
     * @access public
     */
    public $slaveDBH;

    /**
     * sql对象,用于生成sql语句。
     * The sql object, used to create the query sql.
     * 
     * @var object
     * @access public
     */
    public $sqlobj;

    /**
     * 正在使用的表。
     * The table of current query.
     * 
     * @var string
     * @access public
     */
    public $table;

    /**
     * $this->table的别名。
     * The alias of $this->table.
     * 
     * @var string
     * @access public
     */
    public $alias;

    /**
     * 查询的字段。
     * The fields will be returned.
     * 
     * @var string
     * @access public
     */
    public $fields;

    /**
     * 查询模式,raw模式用于正常的select update等sql拼接操作,magic模式用于findByXXX等魔术方法。
     * The query mode, raw or magic.
     * 
     * This var is used to diff dao::from() with sql::from().
     *
     * @var string
     * @access public
     */
    public $mode;

    /**
     * 执行方式:insert, select, update, delete, replace。
     * The query method: insert, select, update, delete, replace.
     *
     * @var string
     * @access public
     */
    public $method;

    /**
     * 是否自动增加lang条件。
     * If auto add lang statement.
     *
     * @var bool
     * @access public
     */
    public $autoLang;

    /**
     * 需要修复表的错误代码
     * The sql code of need repair table.
     * 
     * @var string
     * @access public
     */
    public $repairCode = '|1034|1035|1194|1195|1459|';

    /**
     * 执行的请求,所有的查询都保存在该数组。
     * The queries executed. Every query will be saved in this array.
     * 
     * @var array
     * @access public
     */
    static public $querys = array();

    /**
     * 存放错误的数组。
     * The errors.
     * 
     * @var array
     * @access public
     */
    static public $errors = array();

    /**
     * 缓存。
     * The cache.
     * 
     * @var array
     * @access public
     */
    static public $cache = array();

    /**
     * 构造方法。
     * The construct method.
     *
     * @access public
     * @return void
     */
    public function __construct()
    {
        global $app, $config, $lang, $dbh, $slaveDBH;
        $this->app      = $app;
        $this->config   = $config;
        $this->lang     = $lang;
        $this->dbh      = $dbh;
        $this->slaveDBH = $slaveDBH ? $slaveDBH : false;

        $this->reset();
    }

    /**
     * 设置$table属性。
     * Set the $table property.
     * 
     * @param  string $table 
     * @access public
     * @return void
     */
    public function setTable($table)
    {
        $this->table = $table;
    }

    /**
     * 设置$alias属性。
     * Set the $alias property.
     * 
     * @param  string $alias 
     * @access public
     * @return void
     */
    public function setAlias($alias)
    {
        $this->alias = $alias;
    }

    /**
     * 设置$fields属性。
     * Set the $fields property.
     * 
     * @param  string $fields 
     * @access public
     * @return void
     */
    public function setFields($fields)
    {
        $this->fields = $fields;
    }

    /**
     * 设置autoLang项。
     * Set autoLang item.
     * 
     * @param  bool    $autoLang 
     * @access public
     * @return void
     */
    public function setAutoLang($autoLang)
    {
        $this->autoLang = $autoLang;
        return $this;
    }

    /**
     * 重置属性。
     * Reset the vars.
     * 
     * @access public
     * @return void
     */
    public function reset()
    {
        $this->setFields('');
        $this->setTable('');
        $this->setAlias('');
        $this->setMode('');
        $this->setMethod('');
        $this->setAutoLang(isset($this->config->framework->autoLang) and $this->config->framework->autoLang);
    }

    //-----根据请求的方式,调用sql类相应的方法(Call according method of sql class by query method. -----//

    /**
     * 设置请求模式。像findByxxx之类的方法,使用的是magic模式;其他方法使用的是raw模式。
     * Set the query mode. If the method if like findByxxx, the mode is magic. Else, the mode is raw.
     * 
     * @param  string $mode     magic|raw
     * @access public
     * @return void
     */
    public function setMode($mode = '')
    {
        $this->mode = $mode;
    }

    /**
     * 设置请求方法:select|update|insert|delete|replace 。
     * Set the query method: select|update|insert|delete|replace 
     * 
     * @param  string $method 
     * @access public
     * @return void
     */
    public function setMethod($method = '')
    {
        $this->method = $method;
    }

    /**
     * 开始事务。
     * Begin Transaction 
     * 
     * @access public
     * @return void
     */
    public function begin()
    {
        $this->dbh->beginTransaction();
    }

    /**
     * 事务回滚。
     * Roll back  
     * 
     * @access public
     * @return void
     */
    public function rollBack()
    {
        $this->dbh->rollBack();
    }

    /**
     * 提交事务。
     * Commits a transaction.
     * 
     * @access public
     * @return void
     */
    public function commit()
    {
        $this->dbh->commit();
    }

    /**
     * select方法,调用sql::select()。
     * The select method, call sql::select().
     * 
     * @param  string $fields 
     * @access public
     * @return object the dao object self.
     */
    public function select($fields = '*')
    {
        $this->setMode('raw');
        $this->setMethod('select');
        $this->sqlobj = sql::select($fields);
        return $this;
    }

    /**
     * 获取查询记录条数。
     * The count method, call sql::select() and from().
     * use as $this->dao->select()->from(TABLE_BUG)->where()->count();
     *
     * @param  string $distinctField 
     * @access public
     * @return void
     */
    public function count($distinctField = '')
    {
        /* 获得SELECT,FROM的位置,使用count(*)替换其字段。 */
        /* Get the SELECT, FROM position, thus get the fields, replace it by count(*). */
        $sql        = $this->get();
        $selectPOS  = strpos($sql, 'SELECT') + strlen('SELECT');
        $fromPOS    = strpos($sql, 'FROM');
        $fields     = substr($sql, $selectPOS, $fromPOS - $selectPOS );
        $countField = $distinctField ? 'distinct ' . $distinctField : '*';
        $sql        = str_replace($fields, " COUNT($countField) AS recTotal ", substr($sql, 0, $fromPOS)) . substr($sql, $fromPOS);

        /*
         * 去掉SQL语句中order和limit之后的部分。
         * Remove the part after order and limit.
         **/
        $subLength = strlen($sql);
        $orderPOS  = strripos($sql, 'order by');
        $limitPOS  = strripos($sql, 'limit');
        if($limitPOS) $subLength = $limitPOS;
        if($orderPOS) $subLength = $orderPOS;
        $sql = substr($sql, 0, $subLength);
        self::$querys[] = $sql;

        /* 
         * 获取记录数。
         * Get the records count.
         **/
        try
        {
            $row = $this->dbh->query($sql)->fetch(PDO::FETCH_OBJ);
        }
        catch (PDOException $e) 
        {
            $this->sqlError($e);
        }

        return is_object($row) ? $row->recTotal : 0;
    }

    /**
     * update方法,调用sql::update()。
     * The update method, call sql::update().
     * 
     * @param  string $table 
     * @access public
     * @return object the dao object self.
     */
    public function update($table)
    {
        $this->setMode('raw');
        $this->setMethod('update');
        $this->sqlobj = sql::update($table);
        $this->setTable($table);
        return $this;
    }

    /**
     * delete方法,调用sql::delete()。
     * The delete method, call sql::delete().
     * 
     * @access public
     * @return object the dao object self.
     */
    public function delete()
    {
        $this->setMode('raw');
        $this->setMethod('delete');
        $this->sqlobj = sql::delete();
        return $this;
    }

    /**
     * insert方法,调用sql::insert()。
     * The insert method, call sql::insert().
     * 
     * @param  string $table 
     * @access public
     * @return object the dao object self.
     */
    public function insert($table)
    {
        $this->setMode('raw');
        $this->setMethod('insert');
        $this->sqlobj = sql::insert($table);
        $this->setTable($table);
        return $this;
    }

    /**
     * replace方法,调用sql::replace()。
     * The replace method, call sql::replace().
     * 
     * @param  string $table 
     * @access public
     * @return object the dao object self.
     */
    public function replace($table)
    {
        $this->setMode('raw');
        $this->setMethod('replace');
        $this->sqlobj = sql::replace($table);
        $this->setTable($table);
        return $this;
    }

    /**
     * 设置要操作的表。
     * Set the from table.
     * 
     * @param  string $table 
     * @access public
     * @return object the dao object self.
     */
    public function from($table) 
    {
        $this->setTable($table);
        if($this->mode == 'raw') $this->sqlobj->from($table);
        return $this;
    }

    /**
     * 设置字段。
     * Set the fields.
     * 
     * @param  string $fields 
     * @access public
     * @return object the dao object self.
     */
    public function fields($fields)
    {
        $this->setFields($fields);
        return $this;
    }

    /**
     * 表别名,相当于sql里的AS。(as是php的关键词,使用alias代替)
     * Alias a table, equal the AS keyword. (Don't use AS, because it's a php keyword.)
     * 
     * @param  string $alias 
     * @access public
     * @return object the dao object self.
     */
    public function alias($alias)
    {
        if(empty($this->alias)) $this->setAlias($alias);
        $this->sqlobj->alias($alias);
        return $this;
    }

    /**
     * 设置需要更新或插入的数据。
     * Set the data to update or insert.
     * 
     * @param  object $data  the data object or array
     * @access public
     * @return object the dao object self.
     */
    public function data($data, $skipFields = '')
    {
        if(!is_object($data)) $data = (object)$data;
        if($this->autoLang and !isset($data->lang)) 
        {
            $data->lang = $this->app->getClientLang();
            if(isset($this->app->config->cn2tw) and $this->app->config->cn2tw and $data->lang == 'zh-tw') $data->lang = 'zh-cn';
            if(defined('RUN_MODE') and RUN_MODE == 'front' and !empty($this->app->config->cn2tw)) $data->lang = str_replace('zh-tw', 'zh-cn', $data->lang);
        }

        $this->sqlobj->data($data, $skipFields);
        return $this;
    }

    //-------------------- sql相关的方法(The sql related method) --------------------//

    /**
     * 获取sql字符串。
     * Get the sql string.
     * 
     * @access public
     * @return string the sql string after process.
     */
    public function get()
    {
        return $this->processKeywords($this->processSQL());
    }

    /**
     * 打印sql字符串。
     * Print the sql string.
     * 
     * @access public
     * @return void
     */
    public function printSQL()
    {
        echo $this->processSQL();
    }

    /**
     * 查看SQL索引。
     * Explain sql. 
     * 
     * @param  string $sql 
     * @access public
     * @return void
     */
    public function explain($sql = '')
    {
        $sql    = empty($sql) ? $this->processSQL() : $sql;
        $result = $this->dbh->query('explain ' . $sql)->fetch();
        a($result);
    }

    /**
     * 处理sql语句,替换表和字段。
     * Process the sql, replace the table, fields.
     * 
     * @access public
     * @return string the sql string after process.
     */
    public function processSQL()
    {
        $sql = $this->sqlobj->get();

        /** 
         * 如果是magic模式,处理表和字段。
         * If the mode is magic, process the $fields and $table.
         **/
        if($this->mode == 'magic')
        {
            if($this->fields == '') $this->fields = '*';
            if($this->table == '')  $this->app->triggerError('Must set the table name', __FILE__, __LINE__, $exit = true);
            $sql = sprintf($this->sqlobj->get(), $this->fields, $this->table);
        }

        /* If the method if select, update or delete, set the lang condition. */
        if($this->autoLang and $this->table != '' and $this->method != 'insert' and $this->method != 'replace')
        {
            $lang = $this->app->getClientLang();

            /* Get the position to insert lang = ?. */
            $wherePOS  = strrpos($sql, DAO::WHERE);             // The position of WHERE keyword.
            $groupPOS  = strrpos($sql, DAO::GROUPBY);           // The position of GROUP BY keyword.
            $havingPOS = strrpos($sql, DAO::HAVING);            // The position of HAVING keyword.
            $orderPOS  = strrpos($sql, DAO::ORDERBY);           // The position of ORDERBY keyword.
            $limitPOS  = strrpos($sql, DAO::LIMIT);             // The position of LIMIT keyword.
            $splitPOS  = $orderPOS ? $orderPOS : $limitPOS;     // If $orderPOS, use it instead of $limitPOS.
            $splitPOS  = $havingPOS? $havingPOS: $splitPOS;     // If $havingPOS, use it instead of $orderPOS.
            $splitPOS  = $groupPOS ? $groupPOS : $splitPOS;     // If $groupPOS, use it instead of $havingPOS.

            /* Set the conditon to be appened. */
            $tableName = !empty($this->alias) ? $this->alias : $this->table;

            if(!empty($this->app->config->cn2tw)) $lang = str_replace('zh-tw', 'zh-cn', $lang);

            $langCondition = " $tableName.lang in('{$lang}', 'all') ";

            /* If $spliPOS > 0, split the sql at $splitPOS. */
            if($splitPOS)
            {
                $firstPart = substr($sql, 0, $splitPOS);
                $lastPart  = substr($sql, $splitPOS);
                if($wherePOS)
                {
                    $sql = $firstPart . " AND $langCondition " . $lastPart;
                }
                else
                {
                    $sql = $firstPart . " WHERE $langCondition " . $lastPart;
                }
            }
            else
            {
                $sql .= $wherePOS ? " AND $langCondition" : " WHERE $langCondition";
            }
        }

        self::$querys[] = $this->processKeywords($sql);
        return $sql;
    }

    /**
     * 替换sql常量关键字。
     * Process the sql keywords, replace the constants to normal.
     * 
     * @param  string $sql 
     * @access public
     * @return string the sql string.
     */
    public function processKeywords($sql)
    {
        return str_replace(array(DAO::WHERE, DAO::GROUPBY, DAO::HAVING, DAO::ORDERBY, DAO::LIMIT), array('WHERE', 'GROUP BY', 'HAVING', 'ORDER BY', 'LIMIT'), $sql);
    }

    //-------------------- 查询相关方法(Query related methods) --------------------//

    /**
     * 设置$dbh,数据库连接句柄。
     * Set the dbh. 
     * 
     * You can use like this: $this->dao->dbh($dbh), thus you can handle two database.
     *
     * @param  object $dbh 
     * @access public
     * @return object the dao object self.
     */
    public function dbh($dbh)
    {
        $this->dbh = $dbh;
        return $this;
    }

    /**
     * 执行SQL语句,返回PDOStatement结果集。
     * Query the sql, return the statement object.
     * 
     * @access public
     * @return object   the PDOStatement object.
     */
    public function query($sql = '')
    {
        /* 如果有错误,返回一个空的PDOStatement对象,确保后续方法能够执行。*/
        /* If any error, return an empty statement object to make sure the remain method to execute. */
        if(!empty(dao::$errors)) return new PDOStatement();   

        if($sql)
        {
            $sql       = trim($sql);
            $sqlMethod = strtolower(substr($sql, 0, strpos($sql, ' ')));
            $this->setMethod($sqlMethod);
            $this->sqlobj = new sql();
            $this->sqlobj->sql = $sql;
        }
        else
        {
            $sql = $this->processSQL();
        }

        try
        {
            $method = $this->method;
            $this->reset();

            if($this->slaveDBH and $method == 'select')
            {
                return $this->slaveDBH->query($sql);
            }
            else
            {
                return $this->dbh->query($sql);
            }
        }
        catch (PDOException $e) 
        {
            $this->sqlError($e);
        }
    }

    /**
     * 将记录进行分页,自动设置limit语句。
     * Page the records, set the limit part auto.
     * 
     * @param  object $pager 
     * @access public
     * @return object the dao object self.
     */
    public function page($pager, $distinctField = '')
    {
        if(!is_object($pager)) return $this;

        /*
         * 如果$pager的总记录为0,需要计算总结果数。
         * If the record total is 0, compute it. 
         **/
        if($pager->recTotal == 0)
        {
            $recTotal = $this->count($distinctField);
            $pager->setRecTotal($recTotal);
            $pager->setPageTotal();
        }
        $this->sqlobj->limit($pager->limit());
        return $this;
    }

    /**
     * 执行SQL。query()会返回stmt对象,该方法只返回更改或删除的记录数。
     * Execute the sql. It's different with query(), which return the stmt object. But this not.
     * 
     * @param  string $sql 
     * @access public
     * @return int the modified or deleted records. 更改或删除的记录数。
     */
    public function exec($sql = '')
    {
        if(!empty(dao::$errors)) return new PDOStatement();   // If any error, return an empty statement object to make sure the remain method to execute.

        if($sql)
        {
            $this->sqlobj = new sql();
            $this->sqlobj->sql = $sql;
        }
        else
        {
            $sql = $this->processSQL();
        }

        try
        {
            if($this->table) unset(dao::$cache[$this->table]);
            $this->reset();
            return $this->dbh->exec($sql);
        }
        catch (PDOException $e) 
        {
            $this->sqlError($e);
        }
    }

    //-------------------- Fetch相关方法(Fetch related methods) -------------------//

    /**
     * 获取一个记录。
     * Fetch one record.
     * 
     * @param  string $field        如果已经设置获取的字段,则只返回这个字段的值,否则返回这个记录。
     *                              if the field is set, only return the value of this field, else return this record
     * @access public
     * @return object|mixed
     */
    public function fetch($field = '')
    {
        $sql   = $this->processSQL();
        $table = $this->table;
        $key   = 'fetch-' . md5($sql);
        if(isset(dao::$cache[$table][$key]))
        {
            if(empty($field)) return $this->getRow(dao::$cache[$table][$key]);

            $result = dao::$cache[$table][$key];
            return $result ? $result->$field : '';
        }

        if(empty($field))
        {
            $data = $this->query()->fetch();
            dao::$cache[$table][$key] = $data;
            return $this->getRow($data);
        }

        $this->setFields($field);
        $result = $this->query()->fetch(PDO::FETCH_OBJ);
        dao::$cache[$table][$key] = $result;
        return $result ? $result->$field : '';
    }

    /**
     * 获取所有记录。
     * Fetch all records.
     * 
     * @param  string $keyField     返回以该字段做键的记录
     *                              the key field, thus the return records is keyed by this field
     * @access public
     * @return array the records
     */
    public function fetchAll($keyField = '')
    {
        $sql   = $this->processSQL();
        $table = $this->table;
        $key   = 'fetchAll-' . md5($sql . $keyField);
        if(isset(dao::$cache[$table][$key]))
        {
            $rows   = dao::$cache[$table][$key];
            $result = array();
            foreach($rows as $i => $row) $result[$i] = $this->getRow($row);
            return $result;
        }

        $stmt = $this->query();
        dao::$cache[$table][$key] = array();
        if(empty($keyField))
        {
            $rows   = $stmt->fetchAll();
            $result = array();
            dao::$cache[$table][$key] = $rows;
            foreach($rows as $i => $row) $result[$i] = $this->getRow($row);
            return $result;
        }

        $rows = array();
        while($row = $stmt->fetch())
        {
            dao::$cache[$table][$key][$row->$keyField] = $row;
            $rows[$row->$keyField] = $this->getRow($row);
        }

        return $rows;
    }

    /**
     * 获取所有记录并将按照字段分组。
     * Fetch all records and group them by one field.
     * 
     * @param  string $groupField  分组的字段   the field to group by        
     * @param  string $keyField    键字段       the field of key             
     * @access public
     * @return array the records.
     */
    public function fetchGroup($groupField, $keyField = '')
    {
        $sql   = $this->processSQL();
        $table = $this->table;
        $key   = 'fetchGroup-' . md5($sql . $groupField . $keyField);
        if(isset(dao::$cache[$table][$key]))
        {
            $result    = array();
            $groupRows = dao::$cache[$table][$key];
            foreach($groupRows as $groupField => $rows)
            {
                foreach($rows as $keyField => $row) $result[$groupField][$keyField] = $this->getRow($row);
            }
            return $result;
        }

        $stmt = $this->query();
        $rows = array();
        while($row = $stmt->fetch())
        {
            empty($keyField) ?  $rows[$row->$groupField][] = $row : $rows[$row->$groupField][$row->$keyField] = $this->getRow($row);
        }
        dao::$cache[$table][$key] = $rows;
        return $rows;
    }

    /**
     * 获取的记录是以关联数组的形式
     * Fetch array like key=>value.
     *
     * 如果没有设置参数,用首末两键作为参数。
     * If the keyFiled and valueField not set, use the first and last in the record.
     * 
     * @param  string $keyField 
     * @param  string $valueField 
     * @access public
     * @return array
     */
    public function fetchPairs($keyField = '', $valueField = '')
    {
        $keyField   = trim($keyField, '`');
        $valueField = trim($valueField, '`');

        $sql   = $this->processSQL();
        $table = $this->table;
        $key   = 'fetchPairs-' . md5($sql . $keyField . $valueField);
        if(isset(dao::$cache[$table][$key])) return dao::$cache[$table][$key];

        $pairs = array();
        $ready = false;
        $stmt  = $this->query();
        while($row = $stmt->fetch(PDO::FETCH_ASSOC))
        {
            if(!$ready)
            {
                if(empty($keyField)) $keyField = key($row);
                if(empty($valueField)) 
                {
                    end($row);
                    $valueField = key($row);
                }
                $ready = true;
            }

            $pairs[$row[$keyField]] = $row[$valueField];
        }

        dao::$cache[$table][$key] = $pairs;
        return $pairs;
    }

    /**
     * 返回最后插入的ID。
     * Return the last insert ID.
     * 
     * @access public
     * @return int
     */
    public function lastInsertID()
    {
        return $this->dbh->lastInsertID();
    }

    /**
     * 重新生成数据。
     * Get row by data. 
     * 
     * @param  array/object    $data 
     * @access public
     * @return array/object
     */
    public function getRow($data)
    {
        if(!is_object($data)) return $data;
        return json_decode(json_encode($data));
    }

    //-------------------- 魔术方法(Magic methods) --------------------//

    /**
     * 解析dao的方法名,处理魔术方法。
     * Use it to do some convenient queries.
     * 
     * @param  string $funcName  the function name to be called
     * @param  array  $funcArgs  the params
     * @access public
     * @return object the dao object self.
     */
    public function __call($funcName, $funcArgs)
    {
        $funcName = strtolower($funcName);

        /* 
         * 如果是findByxxx,转换为where条件语句。
         * findByxxx, xxx as will be in the where.
         **/
        if(strpos($funcName, 'findby') !== false)
        {
            $this->setMode('magic');
            $this->setFields('');
            $field = str_replace('findby', '', $funcName);
            if(count($funcArgs) == 1)
            {
                $operator = '=';
                $value    = $funcArgs[0];
            }
            else
            {
                $operator = $funcArgs[0];
                $value    = $funcArgs[1];
            }
            $this->sqlobj = sql::select('%s')->from('%s')->where($field, $operator, $value);
            return $this;
        }
        /* 
         * 获取指定个数的记录:fetch10 获取10条记录。
         * Fetch10. 
         **/
        elseif(strpos($funcName, 'fetch') !== false)
        {
            $max  = str_replace('fetch', '', $funcName);
            $stmt = $this->query();

            $rows = array();
            $key  = isset($funcArgs[0]) ? $funcArgs[0] : '';
            $i    = 0;
            while($row = $stmt->fetch())
            {
                $key ? $rows[$row->$key] = $row : $rows[] = $row;
                $i ++;
                if($i == $max) break;
            }
            return $rows;
        }
        /* 
         * 其他的方法,转到sqlobj对象执行。
         * Others, call the method in sql class.
         **/
        else
        {
            /* 
             * 使用$arg0, $arg1... 生成调用的参数。
             * Create the max counts of sql class methods, and then create $arg0, $arg1...
             **/
            for($i = 0; $i < SQL::MAX_ARGS; $i ++)
            {
                ${"arg$i"} = isset($funcArgs[$i]) ? $funcArgs[$i] : null;
            }
            $this->sqlobj->$funcName($arg0, $arg1, $arg2);
            return $this;
        }
    }

    //-------------------- 条件检查( Data Checking)--------------------//

    /**
     * 检查字段是否满足条件。
     * Check a filed is satisfied with the check rule.
     * 
     * @param  string $fieldName    the field to check
     * @param  string $funcName     the check rule
     * @param  string $condition     the condition
     * @access public
     * @return object the dao object self.
     */
    public function check($fieldName, $funcName, $condition = '')
    {
        /* 
         * 如果没数据中没有该字段,直接返回。
         * If no this field in the data, return.
         **/
        if(!isset($this->sqlobj->data->$fieldName)) return $this;

        /* 设置字段值。 */
        /* Set the field label and value. */
        global $lang, $config, $app;
        if(isset($config->db->prefix))
        {
            $table = strtolower(str_replace(array($config->db->prefix, '`'), '', $this->table));
        }
        elseif(strpos($this->table, '_') !== false)
        {
            $table = strtolower(substr($this->table, strpos($this->table, '_') + 1));
            $table = str_replace('`', '', $table);
        }
        else
        {
            $table = strtolower($this->table);
        }
        $fieldLabel = isset($lang->$table->$fieldName) ? $lang->$table->$fieldName : $fieldName;
        $value = isset($this->sqlobj->data->$fieldName) ? $this->sqlobj->data->$fieldName : null;

        /* 
         * 检查唯一性。
         * Check unique.
         **/
        if($funcName == 'unique')
        {
            $args = func_get_args();
            $sql  = "SELECT COUNT(*) AS count FROM $this->table WHERE `$fieldName` = " . $this->sqlobj->quote($value); 
            if($condition) $sql .= ' AND ' . $condition;
            try
            {
                $row = $this->dbh->query($sql)->fetch();
                if($row->count != 0) $this->logError($funcName, $fieldName, $fieldLabel, array($value));
            }
            catch (PDOException $e) 
            {
                $this->sqlError($e);
            }
        }
        else
        {
            /* 
             * 创建参数。
             * Create the params.
             **/
            $funcArgs = func_get_args();
            unset($funcArgs[0]);
            unset($funcArgs[1]);

            for($i = 0; $i < VALIDATER::MAX_ARGS; $i ++)
            {
                ${"arg$i"} = isset($funcArgs[$i + 2]) ? $funcArgs[$i + 2] : null;
            }
            $checkFunc = 'check' . $funcName;
            if(validater::$checkFunc($value, $arg0, $arg1, $arg2) === false)
            {
                $this->logError($funcName, $fieldName, $fieldLabel, $funcArgs);
            }
        }

        return $this;
    }

    /**
     * 检查一个字段是否满足条件。
     * Check a field, if satisfied with the condition.
     * 
     * @param  string $condition 
     * @param  string $fieldName 
     * @param  string $funcName 
     * @access public
     * @return object the dao object self.
     */
    public function checkIF($condition, $fieldName, $funcName)
    {
        if(!$condition) return $this;
        $funcArgs = func_get_args();
        for($i = 0; $i < VALIDATER::MAX_ARGS; $i ++)
        {
            ${"arg$i"} = isset($funcArgs[$i + 3]) ? $funcArgs[$i + 3] : null;
        }
        $this->check($fieldName, $funcName, $arg0, $arg1, $arg2);
        return $this;
    }

    /**
     * 批量检查字段。
     * Batch check some fileds.
     * 
     * @param  string $fields       the fields to check, join with ,
     * @param  string $funcName 
     * @access public
     * @return object the dao object self.
     */
    public function batchCheck($fields, $funcName)
    {
        $fields = explode(',', str_replace(' ', '', $fields));
        $funcArgs = func_get_args();
        for($i = 0; $i < VALIDATER::MAX_ARGS; $i ++)
        {
            ${"arg$i"} = isset($funcArgs[$i + 2]) ? $funcArgs[$i + 2] : null;
        }
        foreach($fields as $fieldName) $this->check($fieldName, $funcName, $arg0, $arg1, $arg2);
        return $this;
    }

    /**
     * 批量检查字段是否满足条件。
     * Batch check fields on the condition is true.
     * 
     * @param  string $condition 
     * @param  string $fields 
     * @param  string $funcName 
     * @access public
     * @return object the dao object self.
     */
    public function batchCheckIF($condition, $fields, $funcName)
    {
        if(!$condition) return $this;
        $fields = explode(',', str_replace(' ', '', $fields));
        $funcArgs = func_get_args();
        for($i = 0; $i < VALIDATER::MAX_ARGS; $i ++)
        {
            ${"arg$i"} = isset($funcArgs[$i + 3]) ? $funcArgs[$i + 3] : null;
        }
        foreach($fields as $fieldName) $this->check($fieldName, $funcName, $arg0, $arg1, $arg2);
        return $this;
    }

    /**
     * 根据数据库结构检查字段。
     * Check the fields according the the database schema.
     * 
     * @param  string $skipFields   fields to skip checking
     * @access public
     * @return object the dao object self.
     */
    public function autoCheck($skipFields = '')
    {
        $fields     = $this->getFieldsType();
        $skipFields = ",$skipFields,";

        foreach($fields as $fieldName => $validater)
        {
            if(strpos($skipFields, $fieldName) !== false) continue; // skip it.
            if(!isset($this->sqlobj->data->$fieldName)) continue;
            if($validater['rule'] == 'skip') continue;
            $options = array();
            if(isset($validater['options'])) $options = array_values($validater['options']);
            for($i = 0; $i < VALIDATER::MAX_ARGS; $i ++)
            {
                ${"arg$i"} = isset($options[$i]) ? $options[$i] : null;
            }
            $this->check($fieldName, $validater['rule'], $arg0, $arg1, $arg2);
        }
        return $this;
    }

    /**
     * 记录错误到日志。
     * Log the error.
     * 
     * module/common/lang中定义了错误提示信息。
     * For the error notice, see module/common/lang.
     *
     * @param  string $checkType    the check rule
     * @param  string $fieldName    the field name
     * @param  string $fieldLabel   the field label
     * @param  array  $funcArgs     the args
     * @access public
     * @return void
     */
    public function logError($checkType, $fieldName, $fieldLabel, $funcArgs = array())
    {
        global $lang;
        $error    = $lang->error->$checkType;
        $replaces = array_merge(array($fieldLabel), $funcArgs);     // the replace values.

        /*
         * 如果$error错误信息是一个字符串,进行替换。
         * Just a string, cycle the $replaces.
         **/
        if(!is_array($error))
        {
            foreach($replaces as $replace)
            {
                $pos = strpos($error, '%s');
                if($pos === false) break;
                $error = substr($error, 0, $pos) . $replace . substr($error, $pos + 2);
            }
        }
        /*
         * 如果error错误信息是一个数组,选择一个%s满足替换个数的进行替换。
         * If the error define is an array, select the one which %s counts match the $replaces.
         **/
        else
        {
            /*
             * 去掉空值项。
             * Remove the empty items.
             **/
            foreach($replaces as $key => $value) if(is_null($value)) unset($replaces[$key]);
            $replacesCount = count($replaces);
            foreach($error as $errorString)
            {
                if(substr_count($errorString, '%s') == $replacesCount)
                {
                    $error = vsprintf($errorString, $replaces);
                }
            }
        }
        dao::$errors[$fieldName][] = $error;
    }

    /**
     * 判断是否有错误。
     * Judge any error or not.
     * 
     * @access public
     * @return bool
     */
    public static function isError()
    {
        return !empty(dao::$errors);
    }

    /**
     * 获取错误。
     * Get the errors.
     * 
     * @access public
     * @return array
     */
    public static function getError($join = false)
    {
        $errors = dao::$errors;
        dao::$errors = array();     // 清除dao的错误信息(Must clear errors)

        if(!$join) return $errors;

        if(is_array($errors))
        {
            $message = '';
            foreach($errors as $item)
            {
                is_array($item) ? $message .= join('\n', $item) . '\n' : $message .= $item . '\n';
            }
            return $message;
        }
    }

    /**
     * 获取表的字段类型。
     * Get the defination of fields of the table.
     * 
     * @access public
     * @return array
     */
    public function getFieldsType()
    {
        try
        {
            $this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
            $sql = "DESC $this->table";
       
Download .txt
gitextract_zm9qj3qj/

├── .gitignore
├── .htaccess
├── Makefile
├── VERSION
├── config/
│   ├── config.php
│   ├── filter.php
│   └── my.example.php
├── db/
│   └── blog.sql
├── framework/
│   ├── base/
│   │   ├── control.class.php
│   │   ├── helper.class.php
│   │   ├── model.class.php
│   │   └── router.class.php
│   ├── control.class.php
│   ├── helper.class.php
│   ├── model.class.php
│   ├── router.class.php
│   └── tests/
│       └── helper/
│           ├── .case001.expect
│           ├── .case002.expect
│           ├── .case003.expect
│           ├── .case004.expect
│           ├── case001.php
│           ├── case002.php
│           ├── case003.php
│           ├── case004.php
│           ├── import1.php
│           └── import2.php
├── index.php
├── js/
│   └── my.js
├── lib/
│   ├── base/
│   │   ├── dao/
│   │   │   └── dao.class.php
│   │   ├── filter/
│   │   │   └── filter.class.php
│   │   ├── front/
│   │   │   └── front.class.php
│   │   └── pager/
│   │       └── pager.class.php
│   ├── dao/
│   │   └── dao.class.php
│   ├── filter/
│   │   └── filter.class.php
│   ├── front/
│   │   └── front.class.php
│   ├── mobile/
│   │   └── mobile.class.php
│   ├── pager/
│   │   └── pager.class.php
│   └── purifier/
│       ├── purifier.class.php
│       └── standalone/
│           └── HTMLPurifier/
│               ├── ConfigSchema/
│               │   ├── Builder/
│               │   │   ├── ConfigSchema.php
│               │   │   └── Xml.php
│               │   ├── Exception.php
│               │   ├── Interchange/
│               │   │   ├── Directive.php
│               │   │   └── Id.php
│               │   ├── Interchange.php
│               │   ├── InterchangeBuilder.php
│               │   ├── Validator.php
│               │   ├── ValidatorAtom.php
│               │   ├── schema/
│               │   │   ├── Attr.AllowedClasses.txt
│               │   │   ├── Attr.AllowedFrameTargets.txt
│               │   │   ├── Attr.AllowedRel.txt
│               │   │   ├── Attr.AllowedRev.txt
│               │   │   ├── Attr.ClassUseCDATA.txt
│               │   │   ├── Attr.DefaultImageAlt.txt
│               │   │   ├── Attr.DefaultInvalidImage.txt
│               │   │   ├── Attr.DefaultInvalidImageAlt.txt
│               │   │   ├── Attr.DefaultTextDir.txt
│               │   │   ├── Attr.EnableID.txt
│               │   │   ├── Attr.ForbiddenClasses.txt
│               │   │   ├── Attr.IDBlacklist.txt
│               │   │   ├── Attr.IDBlacklistRegexp.txt
│               │   │   ├── Attr.IDPrefix.txt
│               │   │   ├── Attr.IDPrefixLocal.txt
│               │   │   ├── AutoFormat.AutoParagraph.txt
│               │   │   ├── AutoFormat.Custom.txt
│               │   │   ├── AutoFormat.DisplayLinkURI.txt
│               │   │   ├── AutoFormat.Linkify.txt
│               │   │   ├── AutoFormat.PurifierLinkify.DocURL.txt
│               │   │   ├── AutoFormat.PurifierLinkify.txt
│               │   │   ├── AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt
│               │   │   ├── AutoFormat.RemoveEmpty.RemoveNbsp.txt
│               │   │   ├── AutoFormat.RemoveEmpty.txt
│               │   │   ├── AutoFormat.RemoveSpansWithoutAttributes.txt
│               │   │   ├── CSS.AllowImportant.txt
│               │   │   ├── CSS.AllowTricky.txt
│               │   │   ├── CSS.AllowedFonts.txt
│               │   │   ├── CSS.AllowedProperties.txt
│               │   │   ├── CSS.DefinitionRev.txt
│               │   │   ├── CSS.ForbiddenProperties.txt
│               │   │   ├── CSS.MaxImgLength.txt
│               │   │   ├── CSS.Proprietary.txt
│               │   │   ├── CSS.Trusted.txt
│               │   │   ├── Cache.DefinitionImpl.txt
│               │   │   ├── Cache.SerializerPath.txt
│               │   │   ├── Cache.SerializerPermissions.txt
│               │   │   ├── Core.AggressivelyFixLt.txt
│               │   │   ├── Core.AllowHostnameUnderscore.txt
│               │   │   ├── Core.CollectErrors.txt
│               │   │   ├── Core.ColorKeywords.txt
│               │   │   ├── Core.ConvertDocumentToFragment.txt
│               │   │   ├── Core.DirectLexLineNumberSyncInterval.txt
│               │   │   ├── Core.DisableExcludes.txt
│               │   │   ├── Core.EnableIDNA.txt
│               │   │   ├── Core.Encoding.txt
│               │   │   ├── Core.EscapeInvalidChildren.txt
│               │   │   ├── Core.EscapeInvalidTags.txt
│               │   │   ├── Core.EscapeNonASCIICharacters.txt
│               │   │   ├── Core.HiddenElements.txt
│               │   │   ├── Core.Language.txt
│               │   │   ├── Core.LexerImpl.txt
│               │   │   ├── Core.MaintainLineNumbers.txt
│               │   │   ├── Core.NormalizeNewlines.txt
│               │   │   ├── Core.RemoveInvalidImg.txt
│               │   │   ├── Core.RemoveProcessingInstructions.txt
│               │   │   ├── Core.RemoveScriptContents.txt
│               │   │   ├── Filter.Custom.txt
│               │   │   ├── Filter.ExtractStyleBlocks.Escaping.txt
│               │   │   ├── Filter.ExtractStyleBlocks.Scope.txt
│               │   │   ├── Filter.ExtractStyleBlocks.TidyImpl.txt
│               │   │   ├── Filter.ExtractStyleBlocks.txt
│               │   │   ├── Filter.YouTube.txt
│               │   │   ├── HTML.Allowed.txt
│               │   │   ├── HTML.AllowedAttributes.txt
│               │   │   ├── HTML.AllowedComments.txt
│               │   │   ├── HTML.AllowedCommentsRegexp.txt
│               │   │   ├── HTML.AllowedElements.txt
│               │   │   ├── HTML.AllowedModules.txt
│               │   │   ├── HTML.Attr.Name.UseCDATA.txt
│               │   │   ├── HTML.BlockWrapper.txt
│               │   │   ├── HTML.CoreModules.txt
│               │   │   ├── HTML.CustomDoctype.txt
│               │   │   ├── HTML.DefinitionID.txt
│               │   │   ├── HTML.DefinitionRev.txt
│               │   │   ├── HTML.Doctype.txt
│               │   │   ├── HTML.FlashAllowFullScreen.txt
│               │   │   ├── HTML.ForbiddenAttributes.txt
│               │   │   ├── HTML.ForbiddenElements.txt
│               │   │   ├── HTML.MaxImgLength.txt
│               │   │   ├── HTML.Nofollow.txt
│               │   │   ├── HTML.Parent.txt
│               │   │   ├── HTML.Proprietary.txt
│               │   │   ├── HTML.SafeEmbed.txt
│               │   │   ├── HTML.SafeIframe.txt
│               │   │   ├── HTML.SafeObject.txt
│               │   │   ├── HTML.SafeScripting.txt
│               │   │   ├── HTML.Strict.txt
│               │   │   ├── HTML.TargetBlank.txt
│               │   │   ├── HTML.TidyAdd.txt
│               │   │   ├── HTML.TidyLevel.txt
│               │   │   ├── HTML.TidyRemove.txt
│               │   │   ├── HTML.Trusted.txt
│               │   │   ├── HTML.XHTML.txt
│               │   │   ├── Output.CommentScriptContents.txt
│               │   │   ├── Output.FixInnerHTML.txt
│               │   │   ├── Output.FlashCompat.txt
│               │   │   ├── Output.Newline.txt
│               │   │   ├── Output.SortAttr.txt
│               │   │   ├── Output.TidyFormat.txt
│               │   │   ├── Test.ForceNoIconv.txt
│               │   │   ├── URI.AllowedSchemes.txt
│               │   │   ├── URI.Base.txt
│               │   │   ├── URI.DefaultScheme.txt
│               │   │   ├── URI.DefinitionID.txt
│               │   │   ├── URI.DefinitionRev.txt
│               │   │   ├── URI.Disable.txt
│               │   │   ├── URI.DisableExternal.txt
│               │   │   ├── URI.DisableExternalResources.txt
│               │   │   ├── URI.DisableResources.txt
│               │   │   ├── URI.Host.txt
│               │   │   ├── URI.HostBlacklist.txt
│               │   │   ├── URI.MakeAbsolute.txt
│               │   │   ├── URI.Munge.txt
│               │   │   ├── URI.MungeResources.txt
│               │   │   ├── URI.MungeSecretKey.txt
│               │   │   ├── URI.OverrideAllowedSchemes.txt
│               │   │   ├── URI.SafeIframeRegexp.txt
│               │   │   └── info.ini
│               │   └── schema.ser
│               ├── EntityLookup/
│               │   └── entities.ser
│               ├── Filter/
│               │   ├── ExtractStyleBlocks.php
│               │   └── YouTube.php
│               ├── Language/
│               │   ├── classes/
│               │   │   └── en-x-test.php
│               │   └── messages/
│               │       ├── en-x-test.php
│               │       ├── en-x-testmini.php
│               │       └── en.php
│               ├── Lexer/
│               │   └── PH5P.php
│               ├── Printer/
│               │   ├── CSSDefinition.php
│               │   ├── ConfigForm.css
│               │   ├── ConfigForm.js
│               │   ├── ConfigForm.php
│               │   └── HTMLDefinition.php
│               └── Printer.php
├── module/
│   ├── blog/
│   │   ├── control.php
│   │   ├── css/
│   │   │   └── common.css
│   │   ├── lang/
│   │   │   ├── en.php
│   │   │   └── zh-cn.php
│   │   ├── model.php
│   │   └── view/
│   │       ├── create.html.php
│   │       ├── edit.html.php
│   │       ├── index.html.php
│   │       └── view.html.php
│   ├── common/
│   │   ├── lang/
│   │   │   ├── en.php
│   │   │   └── zh-cn.php
│   │   ├── model.php
│   │   └── view/
│   │       ├── footer.html.php
│   │       ├── header.html.php
│   │       └── nav.html.php
│   ├── file/
│   │   ├── config.php
│   │   ├── control.php
│   │   ├── lang/
│   │   │   ├── en.php
│   │   │   ├── zh-cn.php
│   │   │   └── zh-tw.php
│   │   └── model.php
│   └── index/
│       ├── control.php
│       ├── css/
│       │   └── index.css
│       ├── js/
│       │   └── index.js
│       ├── lang/
│       │   ├── en.php
│       │   └── zh-cn.php
│       └── view/
│           └── index.html.php
├── theme/
│   └── my.css
└── tools/
    ├── build/
    │   ├── debian/
    │   │   ├── README.Debian
    │   │   ├── changelog
    │   │   ├── compat
    │   │   ├── control
    │   │   ├── copyright
    │   │   ├── dirs
    │   │   ├── docs
    │   │   ├── files
    │   │   ├── postinst.ex
    │   │   ├── postrm.ex
    │   │   ├── preinst.ex
    │   │   ├── prerm.ex
    │   │   ├── rules
    │   │   └── watch.ex
    │   └── pear/
    │       └── package.xml
    ├── chanzhi/
    │   ├── control.class.php
    │   ├── helper.class.php
    │   ├── myrouter.class.php
    │   └── process.php
    ├── ranzhi/
    │   ├── helper.class.php
    │   ├── myrouter.class.php
    │   └── process.php
    └── zentao/
        ├── front.class.php
        ├── myrouter.class.php
        └── process.php
Download .txt
SYMBOL INDEX (1487 symbols across 52 files)

FILE: config/config.php
  class config (line 15) | class config{}
  function getWebRoot (line 16) | function getWebRoot(){}

FILE: db/blog.sql
  type `blog` (line 1) | CREATE TABLE IF NOT EXISTS `blog` (

FILE: framework/base/control.class.php
  class baseControl (line 14) | class baseControl
    method __construct (line 188) | public function __construct($moduleName = '', $methodName = '', $appNa...
    method setModuleName (line 245) | public function setModuleName($moduleName = '')
    method setMethodName (line 258) | public function setMethodName($methodName = '')
    method loadModel (line 272) | public function loadModel($moduleName = '', $appName = '')
    method setSuperVars (line 327) | public function setSuperVars()
    method setClientDevice (line 343) | public function setClientDevice()
    method setDevicePrefix (line 355) | public function setDevicePrefix()
    method setViewFile (line 371) | public function setViewFile($moduleName, $methodName)
    method getExtViewFile (line 409) | public function getExtViewFile($viewFile)
    method getCSS (line 446) | public function getCSS($moduleName, $methodName)
    method getJS (line 495) | public function getJS($moduleName, $methodName)
    method assign (line 545) | public function assign($name, $value)
    method clear (line 557) | public function clear()
    method parse (line 571) | public function parse($moduleName = '', $methodName = '')
    method parseJSON (line 591) | public function parseJSON($moduleName, $methodName)
    method parseDefault (line 619) | public function parseDefault($moduleName, $methodName)
    method fetch (line 676) | public function fetch($moduleName = '', $methodName = '', $params = ar...
    method display (line 795) | public function display($moduleName = '', $methodName = '')
    method send (line 810) | public function send($data, $type = 'json')
    method createLink (line 853) | public function createLink($moduleName, $methodName = 'index', $vars =...
    method inlink (line 869) | public function inlink($methodName = 'index', $vars = array(), $viewTy...
    method locate (line 882) | public function locate($url)

FILE: framework/base/helper.class.php
  class baseHelper (line 15) | class baseHelper
    method setMember (line 33) | static public function setMember($objName, $key, $value)
    method createLink (line 63) | static public function createLink($moduleName, $methodName = 'index', ...
    method processOnlyBodyParam (line 158) | public static function processOnlyBodyParam($link, $onlyBody = false)
    method inOnlyBodyMode (line 173) | public static function inOnlyBodyMode()
    method import (line 187) | static public function import($file)
    method dbIN (line 212) | static public function dbIN($idList)
    method safe64Encode (line 236) | static public function safe64Encode($string)
    method safe64Decode (line 250) | static public function safe64Decode($string)
    method jsonEncode (line 264) | static public function jsonEncode($data)
    method isUTF8 (line 280) | static public function isUTF8($string)
    method removeUTF8Bom (line 319) | public static function removeUTF8Bom($string)
    method substr (line 334) | public static function substr($string, $length, $append = '')
    method getBrowser (line 352) | public static function getBrowser()
    method getOS (line 390) | public static function getOS()
    method diffDate (line 436) | static public function diffDate($date1, $date2)
    method now (line 448) | static public function now()
    method today (line 460) | static public function today()
    method time (line 472) | static public function time()
    method isZeroDate (line 484) | static public function isZeroDate($date)
    method ls (line 496) | static public function ls($dir, $pattern = '')
    method cd (line 515) | static function cd($path = '')
    method parseSiteCode (line 535) | public static function parseSiteCode($domain)
    method isAjaxRequest (line 574) | public static function isAjaxRequest()
    method header301 (line 589) | public static function header301($locate)
    method getRemoteIp (line 602) | public static function getRemoteIp()
  function inLink (line 624) | function inLink($methodName = 'index', $vars = '', $viewType = '')
  function cycle (line 637) | function cycle($items)
  function getTime (line 652) | function getTime()
  function a (line 666) | function a($var)
  function isLocalIP (line 680) | function isLocalIP()
  function getWebRoot (line 697) | function getWebRoot($full = false)
  function zget (line 733) | function zget($var, $key, $valueWhenNone = false, $valueWhenExists = false)

FILE: framework/base/model.class.php
  class baseModel (line 15) | class baseModel
    method __construct (line 138) | public function __construct($appName = '')
    method getModuleName (line 171) | public function getModuleName()
    method setSuperVars (line 187) | public function setSuperVars()
    method loadModel (line 206) | public function loadModel($moduleName, $appName = '')
    method loadExtension (line 251) | public function loadExtension($extensionName, $moduleName = '')
    method loadDAO (line 284) | public function loadDAO()
    method delete (line 298) | public function delete($table, $id = 0)

FILE: framework/base/router.class.php
  class baseRouter (line 15) | class baseRouter
    method __construct (line 339) | public function __construct($appName = 'demo', $appRoot = '')
    method createApp (line 389) | public static function createApp($appName = 'demo', $appRoot = '', $cl...
    method setAppName (line 405) | public function setAppName($appName)
    method setPathFix (line 417) | public function setPathFix()
    method setBasePath (line 429) | public function setBasePath()
    method setFrameRoot (line 441) | public function setFrameRoot()
    method setCoreLibRoot (line 453) | public function setCoreLibRoot()
    method setAppRoot (line 467) | public function setAppRoot($appName = 'demo', $appRoot = '')
    method setTmpRoot (line 481) | public function setTmpRoot()
    method setCacheRoot (line 493) | public function setCacheRoot()
    method setLogRoot (line 505) | public function setLogRoot()
    method setConfigRoot (line 517) | public function setConfigRoot()
    method setModuleRoot (line 529) | public function setModuleRoot()
    method setWwwRoot (line 541) | public function setWwwRoot()
    method setThemeRoot (line 553) | public function setThemeRoot()
    method setDataRoot (line 565) | public function setDataRoot()
    method setSuperVars (line 577) | public function setSuperVars()
    method setDebug (line 601) | public function setDebug()
    method setErrorHandler (line 613) | public function setErrorHandler()
    method getAppName (line 626) | public function getAppName()
    method getBasePath (line 638) | public function getBasePath()
    method getFrameRoot (line 650) | public function getFrameRoot()
    method getAppRoot (line 662) | public function getAppRoot()
    method getWwwRoot (line 674) | public function getWwwRoot()
    method getCoreLibRoot (line 686) | public function getCoreLibRoot()
    method getTmpRoot (line 698) | public function getTmpRoot()
    method getCacheRoot (line 710) | public function getCacheRoot()
    method getLogRoot (line 722) | public function getLogRoot()
    method getConfigRoot (line 734) | public function getConfigRoot()
    method getModuleRoot (line 747) | public function getModuleRoot($appName = '')
    method getWebRoot (line 760) | public function getWebRoot()
    method getThemeRoot (line 772) | public function getThemeRoot()
    method getDataRoot (line 784) | public function getDataRoot()
    method setTimezone (line 798) | public function setTimezone()
    method startSession (line 810) | public function startSession()
    method setClientLang (line 833) | public function setClientLang($lang = '')
    method parseHttpAcceptLang (line 863) | public function parseHttpAcceptLang()
    method setClientTheme (line 888) | public function setClientTheme($theme = '')
    method setClientDevice (line 917) | public function setClientDevice()
    method setSiteCode (line 943) | public function setSiteCode()
    method getClientLang (line 955) | public function getClientLang()
    method getClientTheme (line 967) | public function getClientTheme()
    method getClientDevice (line 979) | public function getClientDevice()
    method parseRequest (line 993) | public function parseRequest()
    method parsePathInfo (line 1018) | public function parsePathInfo()
    method getPathInfo (line 1055) | public function getPathInfo()
    method parseGET (line 1095) | public function parseGET()
    method getURI (line 1117) | public function getURI($full = false)
    method getViewType (line 1134) | public function getViewType()
    method loadCommon (line 1157) | public function loadCommon()
    method setModuleName (line 1180) | public function setModuleName($moduleName = '')
    method setControlFile (line 1194) | public function setControlFile($exitIfNone = true)
    method setMethodName (line 1209) | public function setMethodName($methodName = '')
    method getModulePath (line 1223) | public function getModulePath($appName = '', $moduleName = '')
    method getModuleExtPath (line 1247) | public function getModuleExtPath($appName, $moduleName, $ext)
    method checkModuleName (line 1270) | public function checkModuleName($var)
    method checkMethodName (line 1285) | public function checkMethodName($var)
    method setActionExtFile (line 1301) | public function setActionExtFile()
    method setModelFile (line 1330) | public function setModelFile($moduleName, $appName = '')
    method needModelFileUpdate (line 1386) | public function needModelFileUpdate($mergedModelFile, $extFiles, $hook...
    method mergeModelExtFiles (line 1421) | public function mergeModelExtFiles($moduleName, $mainModelFile, $extFi...
    method mergeModelHookFiles (line 1459) | public function mergeModelHookFiles($moduleName, $mainModelFile, $mode...
    method removePHPTAG (line 1515) | static public function removePHPTAG($fileName)
    method setRouteByPathInfo (line 1539) | public function setRouteByPathInfo()
    method setRouteByGET (line 1585) | public function setRouteByGET()
    method loadModule (line 1610) | public function loadModule()
    method setParamsByPathInfo (line 1704) | public function setParamsByPathInfo($defaultParams = array(), $type = '')
    method setParamsByGET (line 1739) | public function setParamsByGET($defaultParams, $type = '')
    method mergeParams (line 1765) | public function mergeParams($defaultParams, $passedParams)
    method getModuleName (line 1812) | public function getModuleName()
    method getControlFile (line 1824) | public function getControlFile()
    method getMethodName (line 1836) | public function getMethodName()
    method getParams (line 1848) | public function getParams()
    method loadClass (line 1865) | public function loadClass($className, $static = false)
    method loadMainConfig (line 1892) | public function loadMainConfig()
    method loadExtraConfig (line 1912) | public function loadExtraConfig()
    method loadModuleConfig (line 1935) | public function loadModuleConfig($moduleName, $appName = '')
    method mergeConfig (line 1983) | public  function mergeConfig($dbConfig, $moduleName = 'common')
    method exportConfig (line 2017) | public function exportConfig()
    method loadLang (line 2047) | public function loadLang($moduleName, $appName = '')
    method connectDB (line 2098) | public function connectDB()
    method connectByPDO (line 2115) | public function connectByPDO($params)
    method shutdown (line 2158) | public function shutdown()
    method triggerError (line 2183) | public function triggerError($message, $file, $line, $exit = false)
    method saveError (line 2209) | public function saveError($level, $message, $file, $line)
    method saveSQL (line 2295) | public function saveSQL()
  class config (line 2318) | class config
    method set (line 2334) | public function set($key, $value)
  class language (line 2346) | class language
    method set (line 2363) | public function set($key, $value)
    method show (line 2377) | public function show($obj, $key)
  class super (line 2390) | class super
    method __construct (line 2400) | public function __construct($scope)
    method set (line 2414) | public function set($key, $value)
    method __get (line 2454) | public function __get($key)
    method a (line 2507) | public function a()

FILE: framework/control.class.php
  class control (line 19) | class control extends baseControl

FILE: framework/helper.class.php
  class helper (line 17) | class helper extends baseHelper

FILE: framework/model.class.php
  class model (line 19) | class model extends baseModel

FILE: framework/router.class.php
  class router (line 17) | class router extends baseRouter

FILE: framework/tests/helper/case003.php
  class mockapp (line 69) | class mockapp
    method setViewType (line 72) | public function setViewType($viewType)
    method getViewType (line 76) | public function getViewType()

FILE: framework/tests/helper/case004.php
  function printIncluded (line 36) | function printIncluded()

FILE: framework/tests/helper/import1.php
  class myclass1 (line 13) | class myclass1{}

FILE: framework/tests/helper/import2.php
  class myclass2 (line 12) | class myclass2{}

FILE: js/my.js
  function createLink (line 22) | function createLink(moduleName, methodName, vars, viewType)
  function switchLang (line 55) | function switchLang(switcher)

FILE: lib/base/dao/dao.class.php
  class baseDAO (line 20) | class baseDAO
    method __construct (line 182) | public function __construct()
    method setTable (line 202) | public function setTable($table)
    method setAlias (line 215) | public function setAlias($alias)
    method setFields (line 228) | public function setFields($fields)
    method setAutoLang (line 241) | public function setAutoLang($autoLang)
    method reset (line 254) | public function reset()
    method setMode (line 274) | public function setMode($mode = '')
    method setMethod (line 287) | public function setMethod($method = '')
    method begin (line 299) | public function begin()
    method rollBack (line 311) | public function rollBack()
    method commit (line 323) | public function commit()
    method select (line 336) | public function select($fields = '*')
    method count (line 353) | public function count($distinctField = '')
    method update (line 400) | public function update($table)
    method delete (line 416) | public function delete()
    method insert (line 432) | public function insert($table)
    method replace (line 449) | public function replace($table)
    method from (line 466) | public function from($table)
    method fields (line 481) | public function fields($fields)
    method alias (line 495) | public function alias($alias)
    method data (line 510) | public function data($data, $skipFields = '')
    method get (line 533) | public function get()
    method printSQL (line 545) | public function printSQL()
    method explain (line 558) | public function explain($sql = '')
    method processSQL (line 572) | public function processSQL()
    method processKeywords (line 641) | public function processKeywords($sql)
    method dbh (line 658) | public function dbh($dbh)
    method query (line 671) | public function query($sql = '')
    method page (line 718) | public function page($pager, $distinctField = '')
    method exec (line 744) | public function exec($sql = '')
    method fetch (line 781) | public function fetch($field = '')
    method fetchAll (line 816) | public function fetchAll($keyField = '')
    method fetchGroup (line 859) | public function fetchGroup($groupField, $keyField = '')
    method fetchPairs (line 897) | public function fetchPairs($keyField = '', $valueField = '')
    method lastInsertID (line 937) | public function lastInsertID()
    method getRow (line 950) | public function getRow($data)
    method __call (line 967) | public function __call($funcName, $funcArgs)
    method check (line 1044) | public function check($fieldName, $funcName, $condition = '')
    method checkIF (line 1124) | public function checkIF($condition, $fieldName, $funcName)
    method batchCheck (line 1145) | public function batchCheck($fields, $funcName)
    method batchCheckIF (line 1167) | public function batchCheckIF($condition, $fields, $funcName)
    method autoCheck (line 1188) | public function autoCheck($skipFields = '')
    method logError (line 1223) | public function logError($checkType, $fieldName, $fieldLabel, $funcArg...
    method isError (line 1272) | public static function isError()
    method getError (line 1284) | public static function getError($join = false)
    method getFieldsType (line 1309) | public function getFieldsType()
    method sqlError (line 1375) | public function sqlError($exception)
  class baseSQL (line 1398) | class baseSQL
    method __construct (line 1487) | public function __construct($table = '')
    method factory (line 1502) | public static function factory($table = '')
    method select (line 1515) | public static function select($field = '*')
    method update (line 1530) | public static function update($table)
    method insert (line 1545) | public static function insert($table)
    method replace (line 1560) | public static function replace($table)
    method delete (line 1574) | public static function delete()
    method data (line 1590) | public function data($data, $skipFields = '')
    method markLeft (line 1619) | public function markLeft($count = 1)
    method markRight (line 1635) | public function markRight($count = 1)
    method set (line 1651) | public function set($set)
    method from (line 1673) | public function from($table)
    method alias (line 1687) | public function alias($alias)
    method leftJoin (line 1701) | public function leftJoin($table)
    method on (line 1715) | public function on($condition)
    method beginIF (line 1729) | public function beginIF($condition)
    method fi (line 1743) | public function fi()
    method where (line 1760) | public function where($arg1, $arg2 = null, $arg3 = null)
    method andWhere (line 1786) | public function andWhere($condition, $addMark = false)
    method orWhere (line 1802) | public function orWhere($condition)
    method eq (line 1817) | public function eq($value)
    method ne (line 1832) | public function ne($value)
    method gt (line 1847) | public function gt($value)
    method ge (line 1862) | public function ge($value)
    method lt (line 1877) | public function lt($value)
    method le (line 1892) | public function le($value)
    method between (line 1908) | public function between($min, $max)
    method in (line 1925) | public function in($ids)
    method notin (line 1940) | public function notin($ids)
    method like (line 1955) | public function like($string)
    method notLike (line 1970) | public function notLike($string)
    method orderBy (line 1985) | public function orderBy($order)
    method limit (line 2036) | public function limit($limit)
    method groupBy (line 2056) | public function groupBy($groupBy)
    method having (line 2071) | public function having($having)
    method get (line 2085) | public function get()
    method quote (line 2098) | public function quote($value)

FILE: lib/base/filter/filter.class.php
  class baseValidater (line 20) | class baseValidater
    method checkBool (line 37) | public static function checkBool($var)
    method checkInt (line 51) | public static function checkInt($var)
    method checkNotInt (line 87) | public static function checkNotInt($var)
    method checkFloat (line 102) | public static function checkFloat($var, $decimal = '.')
    method checkEmail (line 116) | public static function checkEmail($var)
    method checkPhone (line 130) | public static function checkPhone($var)
    method checkTel (line 144) | public static function checkTel($var)
    method checkMobile (line 158) | public static function checkMobile($var)
    method checkURL (line 175) | public static function checkURL($var)
    method checkDomain (line 191) | public static function checkDomain($var)
    method checkIP (line 206) | public static function checkIP($var, $range = 'all')
    method checkIdcard (line 224) | public static function checkIdcard($idcard)
    method checkDate (line 263) | public static function checkDate($date)
    method checkREG (line 281) | public static function checkREG($var, $reg)
    method checkLength (line 297) | public static function checkLength($var, $max, $min = 0)
    method checkNotEmpty (line 312) | public static function checkNotEmpty($var)
    method checkEmpty (line 326) | public static function checkEmpty($var)
    method checkAccount (line 340) | public static function checkAccount($var)
    method checkCode (line 356) | public static function checkCode($var)
    method checkCaptcha (line 370) | public static function checkCaptcha($var)
    method checkEqual (line 386) | public static function checkEqual($var, $value)
    method checkNotEqual (line 401) | public static function checkNotEqual($var, $value)
    method checkGT (line 416) | public static function checkGT($var, $value)
    method checkLT (line 431) | public static function checkLT($var, $value)
    method checkGE (line 446) | public static function checkGE($var, $value)
    method checkLE (line 461) | public static function checkLE($var, $value)
    method checkIn (line 476) | public static function checkIn($var, $value)
    method checkFileName (line 491) | public static function checkFileName($var)
    method checkSensitive (line 506) | public static function checkSensitive($vars, $dicts)
    method filterFiles (line 527) | public static function filterFiles()
    method filterSuper (line 568) | public static function filterSuper($super)
    method filterBadKeys (line 603) | public static function filterBadKeys($var)
    method filterTrojan (line 619) | public static function filterTrojan($var)
    method filterXSS (line 641) | public static function filterXSS($var)
    method filterParam (line 669) | public static function filterParam($var, $type)
    method checkByRule (line 714) | public static function checkByRule($var, $rule)
    method parseRuleString (line 749) | public static function parseRuleString($rule)
    method call (line 770) | public static function call($var, $func)
  class baseFixer (line 782) | class baseFixer
    method __construct (line 810) | public function __construct($scope)
    method input (line 849) | public static function input($scope)
    method cleanEmail (line 862) | public function cleanEmail($fieldName)
    method encodeURL (line 877) | public function encodeURL($fieldName)
    method cleanURL (line 896) | public function cleanURL($fieldName)
    method cleanFloat (line 911) | public function cleanFloat($fieldName)
    method cleanINT (line 926) | public function cleanINT($fieldName = '')
    method specialChars (line 941) | public function specialChars($fieldName)
    method specialArray (line 958) | public function specialArray($data)
    method stripTags (line 976) | public function stripTags($fieldName, $allowedTags = '')
    method skipSpecial (line 1028) | public function skipSpecial($fieldName)
    method quote (line 1043) | public function quote($fieldName)
    method setDefault (line 1059) | public function setDefault($fields, $value)
    method setIF (line 1076) | public function setIF($condition, $fieldName, $value)
    method setForce (line 1091) | public function setForce($fieldName, $value)
    method remove (line 1105) | public function remove($fieldName)
    method removeIF (line 1121) | public function removeIF($condition, $fields)
    method add (line 1137) | public function add($fieldName, $value)
    method addIF (line 1153) | public function addIF($condition, $fieldName, $value)
    method join (line 1168) | public function join($fieldName, $value)
    method callFunc (line 1184) | public function callFunc($fieldName, $func)
    method get (line 1199) | public function get($fields = '')
    method processFields (line 1225) | public function processFields($fields)

FILE: lib/base/front/front.class.php
  class baseHTML (line 20) | class baseHTML
    method title (line 31) | public static function title($title)
    method meta (line 46) | public static function meta($name, $value)
    method favicon (line 61) | public static function favicon($url)
    method icon (line 76) | public static function icon($name, $class = '')
    method rss (line 92) | public static function rss($url, $title = '')
    method a (line 109) | static public function a($href = '', $title = '', $misc = '', $newline...
    method mailto (line 129) | static public function mailto($mail = '', $title = '')
    method select (line 156) | static public function select($name = '', $options = array(), $selecte...
    method selectGroup (line 196) | static public function selectGroup($name = '', $groups = array(), $sel...
    method radio (line 236) | static public function radio($name = '', $options = array(), $checked ...
    method checkbox (line 271) | static public function checkbox($name, $options, $checked = "", $attri...
    method input (line 308) | static public function input($name, $value = "", $attrib = "")
    method hidden (line 327) | static public function hidden($name, $value = "", $attrib = "")
    method password (line 343) | static public function password($name, $value = "", $attrib = "")
    method textarea (line 359) | static public function textarea($name, $value = "", $attrib = "")
    method file (line 374) | static public function file($name, $attrib = "")
    method date (line 391) | static public function date($name, $value = "", $options = '', $attrib...
    method dateTime (line 411) | static public function dateTime($name, $value = "", $options = '', $at...
    method image (line 429) | static public function image($image, $attrib = '')
    method submitButton (line 445) | public static function submitButton($label = '', $class = 'btn btn-pri...
    method resetButton (line 465) | public static function resetButton($label = '', $class = '')
    method backButton (line 485) | public static function backButton($label = '', $misc = '', $class = '')
    method commonButton (line 510) | public static function commonButton($label = '', $class = 'btn btn-def...
    method linkButton (line 529) | public static function linkButton($label = '', $link = '', $class='btn...
    method closeButton (line 547) | public static function closeButton()
    method selectAll (line 564) | static public function selectAll($scope = "", $type = "button", $check...
    method selectReverse (line 629) | static public function selectReverse($scope = "")
    method selectButton (line 669) | static public function selectButton($scope = "", $asGroup = true, $app...
    method printStars (line 707) | public static function printStars($stars)
  class baseJS (line 735) | class baseJS
    method import (line 747) | public static function import($url, $ieParam = '')
    method start (line 768) | static public function start($full = true)
    method end (line 783) | static public function end($newline = true)
    method alert (line 799) | static public function alert($message = '', $full = true)
    method close (line 812) | static public function close()
    method error (line 827) | static public function error($message, $full = true)
    method resetForm (line 852) | static public function resetForm()
    method confirm (line 870) | static public function confirm($message = '', $okURL = '', $cancleURL ...
    method locate (line 918) | static public function locate($url, $target = "self")
    method closeWindow (line 947) | static public function closeWindow()
    method refresh (line 963) | static public function refresh($url, $target = "self", $time = 3000)
    method reload (line 980) | static public function reload($window = 'self')
    method closeColorbox (line 998) | static public function closeColorbox($window = 'self')
    method closeModal (line 1014) | static public function closeModal($window = 'self', $location = 'this'...
    method exportConfigVars (line 1031) | static public function exportConfigVars()
    method execute (line 1087) | static public function execute($code)
    method set (line 1105) | static public function set($key, $value)
  class baseCSS (line 1158) | class baseCSS
    method import (line 1168) | public static function import($url, $attrib = '')
    method internal (line 1184) | public static function internal($css)

FILE: lib/base/pager/pager.class.php
  class basePager (line 19) | class basePager
    method __construct (line 127) | public function __construct($recTotal = 0, $recPerPage = 20, $pageID = 1)
    method init (line 150) | public static function init($recTotal = 0, $recPerPage = 20, $pageID = 1)
    method setRecTotal (line 163) | public function setRecTotal($recTotal = 0)
    method setRecPerPage (line 176) | public function setRecPerPage($recPerPage)
    method setPageTotal (line 192) | public function setPageTotal()
    method setPageID (line 205) | public function setPageID($pageID)
    method setApp (line 224) | public function setApp()
    method setLang (line 237) | public function setLang()
    method setModuleName (line 250) | public function setModuleName()
    method setMethodName (line 262) | public function setMethodName()
    method setParams (line 274) | public function setParams()
    method limit (line 302) | public function limit()
    method show (line 318) | public function show($align = 'right', $type = 'full')
    method getJustify (line 337) | public function getJustify()
    method get (line 369) | public function get($align = 'right', $type = 'full')
    method createDigest (line 418) | public function createDigest()
    method createFirstPage (line 430) | public function createFirstPage()
    method createPrePage (line 445) | public function createPrePage($type = 'full')
    method createNextPage (line 469) | public function createNextPage($type = 'full')
    method createLastPage (line 492) | public function createLastPage()
    method createRecPerPageJS (line 506) | public function createRecPerPageJS()
    method createRecPerPageList (line 562) | public function createRecPerPageList()
    method createGoTo (line 586) | public function createGoTo()
    method createLink (line 603) | public function createLink($title)

FILE: lib/dao/dao.class.php
  class dao (line 21) | class dao extends baseDAO
  class sql (line 31) | class sql extends baseSQL

FILE: lib/filter/filter.class.php
  class validater (line 21) | class validater extends baseValidater
  class fixer (line 31) | class fixer extends baseFixer

FILE: lib/front/front.class.php
  class html (line 21) | class html extends baseHTML
  class js (line 31) | class js extends baseJS
  class css (line 41) | class css extends baseCSS

FILE: lib/mobile/mobile.class.php
  class mobile (line 28) | class mobile
    method __construct (line 653) | public function __construct(
    method getScriptVersion (line 669) | public static function getScriptVersion()
    method setHttpHeaders (line 680) | public function setHttpHeaders($httpHeaders = null)
    method getHttpHeaders (line 707) | public function getHttpHeaders()
    method getHttpHeader (line 722) | public function getHttpHeader($header)
    method getMobileHeaders (line 743) | public function getMobileHeaders()
    method getUaHttpHeaders (line 754) | public function getUaHttpHeaders()
    method setCfHeaders (line 768) | public function setCfHeaders($cfHeaders = null) {
    method getCfHeaders (line 795) | public function getCfHeaders()
    method setUserAgent (line 807) | public function setUserAgent($userAgent = null)
    method getUserAgent (line 838) | public function getUserAgent()
    method setDetectionType (line 852) | public function setDetectionType($type = null)
    method getMatchingRegex (line 865) | public function getMatchingRegex()
    method getMatchesArray (line 870) | public function getMatchesArray()
    method getPhoneDevices (line 880) | public static function getPhoneDevices()
    method getTabletDevices (line 890) | public static function getTabletDevices()
    method getUserAgents (line 900) | public static function getUserAgents()
    method getBrowsers (line 910) | public static function getBrowsers()
    method getUtilities (line 920) | public static function getUtilities()
    method getMobileDetectionRules (line 932) | public static function getMobileDetectionRules()
    method getMobileDetectionRulesExtended (line 959) | public function getMobileDetectionRulesExtended()
    method getRules (line 984) | public function getRules()
    method getOperatingSystems (line 998) | public static function getOperatingSystems()
    method checkHttpHeadersForMobile (line 1010) | public function checkHttpHeadersForMobile()
    method __call (line 1042) | public function __call($name, $arguments)
    method matchDetectionRulesAgainstUA (line 1062) | protected function matchDetectionRulesAgainstUA($userAgent = null)
    method matchUAAgainstKey (line 1087) | protected function matchUAAgainstKey($key)
    method isMobile (line 1115) | public function isMobile($userAgent = null, $httpHeaders = null)
    method isTablet (line 1152) | public function isTablet($userAgent = null, $httpHeaders = null)
    method is (line 1183) | public function is($key, $userAgent = null, $httpHeaders = null)
    method match (line 1214) | public function match($regex, $userAgent = null)
    method getProperties (line 1231) | public static function getProperties()
    method prepareVersionNo (line 1245) | public function prepareVersionNo($ver)
    method version (line 1270) | public function version($propertyName, $type = self::VERSION_TYPE_STRING)
    method mobileGrade (line 1315) | public function mobileGrade()

FILE: lib/pager/pager.class.php
  class pager (line 21) | class pager extends basePager

FILE: lib/purifier/purifier.class.php
  class HTMLPurifier (line 74) | class HTMLPurifier
    method __construct (line 134) | public function __construct($config = null)
    method addFilter (line 145) | public function addFilter($filter)
    method purify (line 166) | public function purify($html, $config = null)
    method purifyArray (line 260) | public function purifyArray($array_of_html, $config = null)
    method instance (line 281) | public static function instance($prototype = null)
    method getInstance (line 306) | public static function getInstance($prototype = null)
  class HTMLPurifier_Arborize (line 323) | class HTMLPurifier_Arborize
    method arborize (line 325) | public static function arborize($tokens, $config, $context) {
    method flatten (line 352) | public static function flatten($node, $config, $context) {
  class HTMLPurifier_AttrCollections (line 392) | class HTMLPurifier_AttrCollections
    method __construct (line 408) | public function __construct($attr_types, $modules)
    method performInclusions (line 443) | public function performInclusions(&$attr)
    method expandIdentifiers (line 480) | public function expandIdentifiers(&$attr, $attr_types)
  class HTMLPurifier_AttrDef (line 542) | abstract class HTMLPurifier_AttrDef
    method validate (line 566) | abstract public function validate($string, $config, $context);
    method parseCDATA (line 589) | public function parseCDATA($string)
    method make (line 601) | public function make($string)
    method mungeRgb (line 616) | protected function mungeRgb($string)
    method expandCSSEscape (line 625) | protected function expandCSSEscape($string)
  class HTMLPurifier_AttrTransform (line 685) | abstract class HTMLPurifier_AttrTransform
    method transform (line 697) | abstract public function transform($attr, $config, $context);
    method prependCSS (line 705) | public function prependCSS(&$attr, $css)
    method confiscateAttr (line 717) | public function confiscateAttr(&$attr, $key)
  class HTMLPurifier_AttrTypes (line 735) | class HTMLPurifier_AttrTypes
    method __construct (line 747) | public function __construct()
    method makeEnum (line 788) | private static function makeEnum($in)
    method get (line 798) | public function get($type)
    method set (line 819) | public function set($type, $impl)
  class HTMLPurifier_AttrValidator (line 834) | class HTMLPurifier_AttrValidator
    method validateToken (line 844) | public function validateToken($token, $config, $context)
  class HTMLPurifier_Bootstrap (line 1036) | class HTMLPurifier_Bootstrap
    method autoload (line 1044) | public static function autoload($class)
    method getPath (line 1064) | public static function getPath($class)
    method registerAutoload (line 1085) | public static function registerAutoload()
  class HTMLPurifier_Definition (line 1138) | abstract class HTMLPurifier_Definition
    method doSetup (line 1170) | abstract protected function doSetup($config);
    method setup (line 1176) | public function setup($config)
  class HTMLPurifier_CSSDefinition (line 1194) | class HTMLPurifier_CSSDefinition extends HTMLPurifier_Definition
    method doSetup (line 1209) | protected function doSetup($config)
    method doSetupProprietary (line 1530) | protected function doSetupProprietary($config)
    method doSetupTricky (line 1566) | protected function doSetupTricky($config)
    method doSetupTrusted (line 1599) | protected function doSetupTrusted($config)
    method setupConfigStuff (line 1629) | protected function setupConfigStuff($config)
  class HTMLPurifier_ChildDef (line 1668) | abstract class HTMLPurifier_ChildDef
    method getAllowedElements (line 1698) | public function getAllowedElements($config)
    method validateChildren (line 1711) | abstract public function validateChildren($children, $config, $context);
  class HTMLPurifier_Config (line 1732) | class HTMLPurifier_Config
    method __construct (line 1821) | public function __construct($definition, $parent = null)
    method create (line 1838) | public static function create($config, $schema = null)
    method inherit (line 1860) | public static function inherit(HTMLPurifier_Config $config)
    method createDefault (line 1869) | public static function createDefault()
    method get (line 1884) | public function get($key, $a = null)
    method getBatch (line 1935) | public function getBatch($namespace)
    method getBatchSerial (line 1962) | public function getBatchSerial($namespace)
    method getSerial (line 1978) | public function getSerial()
    method getAll (line 1991) | public function getAll()
    method set (line 2011) | public function set($key, $value, $a = null)
    method _listify (line 2105) | private function _listify($lookup)
    method getHTMLDefinition (line 2128) | public function getHTMLDefinition($raw = false, $optimized = false)
    method getCSSDefinition (line 2147) | public function getCSSDefinition($raw = false, $optimized = false)
    method getURIDefinition (line 2166) | public function getURIDefinition($raw = false, $optimized = false)
    method getDefinition (line 2188) | public function getDefinition($type, $raw = false, $optimized = false)
    method initDefinition (line 2341) | private function initDefinition($type)
    method maybeGetRawDefinition (line 2359) | public function maybeGetRawDefinition($name)
    method maybeGetRawHTMLDefinition (line 2364) | public function maybeGetRawHTMLDefinition()
    method maybeGetRawCSSDefinition (line 2369) | public function maybeGetRawCSSDefinition()
    method maybeGetRawURIDefinition (line 2374) | public function maybeGetRawURIDefinition()
    method loadArray (line 2385) | public function loadArray($config_array)
    method getAllowedDirectivesForForm (line 2414) | public static function getAllowedDirectivesForForm($allowed, $schema =...
    method loadArrayFromForm (line 2474) | public static function loadArrayFromForm($array, $index = false, $allo...
    method mergeArrayFromForm (line 2489) | public function mergeArrayFromForm($array, $index = false, $allowed = ...
    method prepareArrayFromForm (line 2507) | public static function prepareArrayFromForm($array, $index = false, $a...
    method loadIni (line 2537) | public function loadIni($filename)
    method isFinalized (line 2553) | public function isFinalized($error = false)
    method autoFinalize (line 2565) | public function autoFinalize()
    method finalize (line 2577) | public function finalize()
    method triggerError (line 2590) | protected function triggerError($msg, $no)
    method serialize (line 2616) | public function serialize()
  class HTMLPurifier_ConfigSchema (line 2633) | class HTMLPurifier_ConfigSchema
    method __construct (line 2687) | public function __construct()
    method makeFromSerial (line 2696) | public static function makeFromSerial()
    method instance (line 2712) | public static function instance($prototype = null)
    method add (line 2733) | public function add($key, $default, $type, $allow_null)
    method addValueAliases (line 2753) | public function addValueAliases($key, $aliases)
    method addAllowedValues (line 2770) | public function addAllowedValues($key, $allowed)
    method addAlias (line 2780) | public function addAlias($key, $new_key)
    method postProcess (line 2791) | public function postProcess()
  class HTMLPurifier_ContentSets (line 2810) | class HTMLPurifier_ContentSets
    method __construct (line 2842) | public function __construct($modules)
    method generateChildDef (line 2887) | public function generateChildDef(&$def, $module)
    method generateChildDefCallback (line 2906) | public function generateChildDefCallback($matches)
    method getChildDef (line 2920) | public function getChildDef($def, $module)
    method convertToLookup (line 2963) | protected function convertToLookup($string)
  class HTMLPurifier_Context (line 2985) | class HTMLPurifier_Context
    method register (line 2999) | public function register($name, &$ref)
    method get (line 3017) | public function &get($name, $ignore_error = false)
    method destroy (line 3036) | public function destroy($name)
    method exists (line 3053) | public function exists($name)
    method loadArray (line 3062) | public function loadArray($context_array)
  class HTMLPurifier_DefinitionCache (line 3082) | abstract class HTMLPurifier_DefinitionCache
    method __construct (line 3093) | public function __construct($type)
    method generateKey (line 3103) | public function generateKey($config)
    method isOld (line 3117) | public function isOld($key, $config)
    method checkDefType (line 3142) | public function checkDefType($def)
    method add (line 3156) | abstract public function add($def, $config);
    method set (line 3163) | abstract public function set($def, $config);
    method replace (line 3170) | abstract public function replace($def, $config);
    method get (line 3176) | abstract public function get($config);
    method remove (line 3182) | abstract public function remove($config);
    method flush (line 3188) | abstract public function flush($config);
    method cleanup (line 3197) | abstract public function cleanup($config);
  class HTMLPurifier_DefinitionCacheFactory (line 3207) | class HTMLPurifier_DefinitionCacheFactory
    method setup (line 3227) | public function setup()
    method instance (line 3237) | public static function instance($prototype = null)
    method register (line 3254) | public function register($short, $long)
    method create (line 3265) | public function create($type, $config)
    method addDecorator (line 3297) | public function addDecorator($decorator)
  class HTMLPurifier_Doctype (line 3317) | class HTMLPurifier_Doctype
    method __construct (line 3362) | public function __construct(
  class HTMLPurifier_DoctypeRegistry (line 3385) | class HTMLPurifier_DoctypeRegistry
    method register (line 3413) | public function register(
    method get (line 3465) | public function get($doctype)
    method make (line 3488) | public function make($config)
    method getDoctypeFromConfig (line 3498) | public function getDoctypeFromConfig($config)
  class HTMLPurifier_ElementDef (line 3536) | class HTMLPurifier_ElementDef
    method create (line 3663) | public static function create($content_model, $content_model_type, $attr)
    method mergeIn (line 3678) | public function mergeIn($def)
    method _mergeAssocArray (line 3727) | private function _mergeAssocArray(&$a1, $a2)
  class HTMLPurifier_Encoder (line 3749) | class HTMLPurifier_Encoder
    method __construct (line 3755) | private function __construct()
    method muteErrorHandler (line 3763) | public static function muteErrorHandler()
    method unsafeIconv (line 3774) | public static function unsafeIconv($in, $out, $text)
    method iconv (line 3790) | public static function iconv($in, $out, $text, $max_chunk_size = 8000)
    method cleanUTF8 (line 3869) | public static function cleanUTF8($str, $force_php = false)
    method unichr (line 4051) | public static function unichr($code)
    method iconvAvailable (line 4098) | public static function iconvAvailable()
    method convertToUTF8 (line 4114) | public static function convertToUTF8($str, $config, $context)
    method convertFromUTF8 (line 4162) | public static function convertFromUTF8($str, $config, $context)
    method convertToASCIIDumbLossless (line 4216) | public static function convertToASCIIDumbLossless($str)
    method testIconvTruncateBug (line 4273) | public static function testIconvTruncateBug()
    method testEncodingSupportsASCII (line 4307) | public static function testEncodingSupportsASCII($encoding, $bypass = ...
  class HTMLPurifier_EntityLookup (line 4360) | class HTMLPurifier_EntityLookup
    method setup (line 4375) | public function setup($file = false)
    method instance (line 4388) | public static function instance($prototype = false)
  class HTMLPurifier_EntityParser (line 4413) | class HTMLPurifier_EntityParser
    method substituteNonSpecialEntities (line 4463) | public function substituteNonSpecialEntities($string)
    method nonSpecialEntityCallback (line 4482) | protected function nonSpecialEntityCallback($matches)
    method substituteSpecialEntities (line 4519) | public function substituteSpecialEntities($string)
    method specialEntityCallback (line 4538) | protected function specialEntityCallback($matches)
  class HTMLPurifier_ErrorCollector (line 4564) | class HTMLPurifier_ErrorCollector
    method __construct (line 4614) | public function __construct($context)
    method send (line 4627) | public function send($severity, $msg)
    method getRaw (line 4720) | public function getRaw()
    method getHTMLFormatted (line 4731) | public function getHTMLFormatted($config, $errors = null)
    method _renderStruct (line 4763) | private function _renderStruct(&$ret, $struct, $line = null, $col = null)
  class HTMLPurifier_ErrorStruct (line 4811) | class HTMLPurifier_ErrorStruct
    method getChild (line 4857) | public function getChild($type, $id)
    method addError (line 4870) | public function addError($severity, $message)
  class HTMLPurifier_Exception (line 4884) | class HTMLPurifier_Exception extends Exception
  class HTMLPurifier_Filter (line 4912) | class HTMLPurifier_Filter
    method preFilter (line 4928) | public function preFilter($html, $config, $context)
    method postFilter (line 4940) | public function postFilter($html, $config, $context)
  class HTMLPurifier_Generator (line 4957) | class HTMLPurifier_Generator
    method __construct (line 5014) | public function __construct($config, $context)
    method generateFromTokens (line 5030) | public function generateFromTokens($tokens)
    method generateFromToken (line 5086) | public function generateFromToken($token)
    method generateScriptFromToken (line 5140) | public function generateScriptFromToken($token)
    method generateAttributes (line 5158) | public function generateAttributes($assoc_array_of_attributes, $elemen...
    method escape (line 5222) | public function escape($string, $quote = null)
  class HTMLPurifier_HTMLDefinition (line 5260) | class HTMLPurifier_HTMLDefinition extends HTMLPurifier_Definition
    method addAttribute (line 5347) | public function addAttribute($element_name, $attr_name, $def)
    method addElement (line 5363) | public function addElement($element_name, $type, $contents, $attr_coll...
    method addBlankElement (line 5380) | public function addBlankElement($element_name)
    method getAnonymousModule (line 5393) | public function getAnonymousModule()
    method __construct (line 5419) | public function __construct()
    method doSetup (line 5427) | protected function doSetup($config)
    method processModules (line 5444) | protected function processModules($config)
    method setupConfigStuff (line 5495) | protected function setupConfigStuff($config)
    method parseTinyMCEAllowedList (line 5692) | public function parseTinyMCEAllowedList($list)
  class HTMLPurifier_HTMLModule (line 5746) | class HTMLPurifier_HTMLModule
    method getChildDef (line 5851) | public function getChildDef($def)
    method addElement (line 5872) | public function addElement($element, $type, $contents, $attr_includes ...
    method addBlankElement (line 5902) | public function addBlankElement($element)
    method addElementToContentSet (line 5920) | public function addElementToContentSet($element, $type)
    method parseContents (line 5940) | public function parseContents($contents)
    method mergeInAttrIncludes (line 5966) | public function mergeInAttrIncludes(&$attr, $attr_includes)
    method makeLookup (line 5986) | public function makeLookup($list)
    method setup (line 6007) | public function setup($config)
  class HTMLPurifier_HTMLModuleManager (line 6016) | class HTMLPurifier_HTMLModuleManager
    method __construct (line 6087) | public function __construct()
    method registerModule (line 6183) | public function registerModule($module, $overload = false)
    method addModule (line 6222) | public function addModule($module)
    method addPrefix (line 6235) | public function addPrefix($prefix)
    method setup (line 6245) | public function setup($config)
    method processModule (line 6343) | public function processModule($module)
    method getElements (line 6355) | public function getElements()
    method getElement (line 6392) | public function getElement($name, $trusted = null)
  class HTMLPurifier_IDAccumulator (line 6482) | class HTMLPurifier_IDAccumulator
    method build (line 6497) | public static function build($config, $context)
    method add (line 6509) | public function add($id)
    method load (line 6522) | public function load($array_of_ids)
  class HTMLPurifier_Injector (line 6547) | abstract class HTMLPurifier_Injector
    method rewindOffset (line 6603) | public function rewindOffset($offset)
    method getRewindOffset (line 6612) | public function getRewindOffset()
    method prepare (line 6628) | public function prepare($config, $context)
    method checkNeeded (line 6651) | public function checkNeeded($config)
    method allowsElement (line 6678) | public function allowsElement($name)
    method forward (line 6711) | protected function forward(&$i, &$current)
    method forwardUntilEndToken (line 6735) | protected function forwardUntilEndToken(&$i, &$current, &$nesting)
    method backward (line 6765) | protected function backward(&$i, &$current)
    method handleText (line 6782) | public function handleText(&$token)
    method handleElement (line 6789) | public function handleElement(&$token)
    method handleEnd (line 6796) | public function handleEnd(&$token)
    method notifyEnd (line 6807) | public function notifyEnd($token)
  class HTMLPurifier_Language (line 6820) | class HTMLPurifier_Language
    method __construct (line 6876) | public function __construct($config, $context)
    method load (line 6886) | public function load()
    method getMessage (line 6904) | public function getMessage($key)
    method getErrorName (line 6920) | public function getErrorName($int)
    method listify (line 6936) | public function listify($array)
    method formatMessage (line 6961) | public function formatMessage($key, $args = array())
  class HTMLPurifier_LanguageFactory (line 7028) | class HTMLPurifier_LanguageFactory
    method instance (line 7077) | public static function instance($prototype = null)
    method setup (line 7093) | public function setup()
    method create (line 7106) | public function create($config, $context, $code = false)
    method getFallbackFor (line 7154) | public function getFallbackFor($code)
    method loadLanguage (line 7164) | public function loadLanguage($code)
  class HTMLPurifier_Length (line 7235) | class HTMLPurifier_Length
    method __construct (line 7269) | public function __construct($n = '0', $u = false)
    method make (line 7280) | public static function make($s)
    method validate (line 7298) | protected function validate()
    method toString (line 7327) | public function toString()
    method getN (line 7339) | public function getN()
    method getUnit (line 7348) | public function getUnit()
    method isValid (line 7357) | public function isValid()
    method compareTo (line 7372) | public function compareTo($l)
  class HTMLPurifier_Lexer (line 7431) | class HTMLPurifier_Lexer
    method create (line 7458) | public static function create($config)
    method __construct (line 7541) | public function __construct()
    method parseData (line 7575) | public function parseData($string)
    method tokenizeHTML (line 7612) | public function tokenizeHTML($string, $config, $context)
    method escapeCDATA (line 7622) | protected static function escapeCDATA($string)
    method escapeCommentedCDATA (line 7636) | protected static function escapeCommentedCDATA($string)
    method removeIEConditional (line 7650) | protected static function removeIEConditional($string)
    method CDATACallback (line 7668) | protected static function CDATACallback($matches)
    method normalize (line 7683) | public function normalize($html, $config, $context)
    method extractBody (line 7734) | public function extractBody($html)
  class HTMLPurifier_Node (line 7758) | abstract class HTMLPurifier_Node
    method toTokenPair (line 7793) | abstract public function toTokenPair();
  class HTMLPurifier_PercentEncoder (line 7808) | class HTMLPurifier_PercentEncoder
    method __construct (line 7821) | public function __construct($preserve = false)
    method encode (line 7856) | public function encode($string)
    method normalize (line 7877) | public function normalize($string)
  class HTMLPurifier_PropertyList (line 7915) | class HTMLPurifier_PropertyList
    method __construct (line 7938) | public function __construct($parent = null)
    method get (line 7948) | public function get($name)
    method set (line 7965) | public function set($name, $value)
    method has (line 7975) | public function has($name)
    method reset (line 7985) | public function reset($name = null)
    method squash (line 8000) | public function squash($force = false)
    method getParent (line 8016) | public function getParent()
    method setParent (line 8025) | public function setParent($plist)
  class HTMLPurifier_PropertyListIterator (line 8038) | class HTMLPurifier_PropertyListIterator extends FilterIterator
    method __construct (line 8054) | public function __construct(Iterator $iterator, $filter = null)
    method accept (line 8064) | public function accept()
  class HTMLPurifier_Queue (line 8095) | class HTMLPurifier_Queue {
    method __construct (line 8099) | public function __construct($input = array()) {
    method shift (line 8107) | public function shift() {
    method push (line 8121) | public function push($x) {
    method isEmpty (line 8128) | public function isEmpty() {
  class HTMLPurifier_Strategy (line 8144) | abstract class HTMLPurifier_Strategy
    method execute (line 8155) | abstract public function execute($tokens, $config, $context);
  class HTMLPurifier_StringHash (line 8170) | class HTMLPurifier_StringHash extends ArrayObject
    method offsetGet (line 8182) | public function offsetGet($index)
    method getAccessed (line 8192) | public function getAccessed()
    method resetAccessed (line 8200) | public function resetAccessed()
  class HTMLPurifier_StringHashParser (line 8235) | class HTMLPurifier_StringHashParser
    method parseFile (line 8248) | public function parseFile($file)
    method parseMultiFile (line 8267) | public function parseMultiFile($file)
    method parseHandle (line 8293) | protected function parseHandle($fh)
  class HTMLPurifier_TagTransform (line 8350) | abstract class HTMLPurifier_TagTransform
    method transform (line 8365) | abstract public function transform($tag, $config, $context);
    method prependCSS (line 8374) | protected function prependCSS(&$attr, $css)
  class HTMLPurifier_Token (line 8388) | abstract class HTMLPurifier_Token
    method __get (line 8430) | public function __get($n)
    method position (line 8456) | public function position($l = null, $c = null)
    method rawPosition (line 8467) | public function rawPosition($l, $c)
    method toNode (line 8479) | abstract public function toNode();
  class HTMLPurifier_TokenFactory (line 8497) | class HTMLPurifier_TokenFactory
    method __construct (line 8529) | public function __construct()
    method createStart (line 8544) | public function createStart($name, $attr = array())
    method createEnd (line 8556) | public function createEnd($name)
    method createEmpty (line 8569) | public function createEmpty($name, $attr = array())
    method createText (line 8581) | public function createText($data)
    method createComment (line 8593) | public function createComment($data)
  class HTMLPurifier_URI (line 8613) | class HTMLPurifier_URI
    method __construct (line 8660) | public function __construct($scheme, $userinfo, $host, $port, $path, $...
    method getSchemeObj (line 8677) | public function getSchemeObj($config, $context)
    method validate (line 8708) | public function validate($config, $context)
    method toString (line 8819) | public function toString()
    method isLocal (line 8873) | public function isLocal($config, $context)
    method isBenign (line 8895) | public function isBenign($config, $context)
  class HTMLPurifier_URIDefinition (line 8920) | class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition
    method __construct (line 8943) | public function __construct()
    method registerFilter (line 8954) | public function registerFilter($filter)
    method addFilter (line 8959) | public function addFilter($filter, $config)
    method doSetup (line 8970) | protected function doSetup($config)
    method setupFilters (line 8976) | protected function setupFilters($config)
    method setupMemberVariables (line 8991) | protected function setupMemberVariables($config)
    method getDefaultScheme (line 9004) | public function getDefaultScheme($config, $context)
    method filter (line 9009) | public function filter(&$uri, $config, $context)
    method postFilter (line 9018) | public function postFilter(&$uri, $config, $context)
  class HTMLPurifier_URIFilter (line 9058) | abstract class HTMLPurifier_URIFilter
    method prepare (line 9087) | public function prepare($config)
    method filter (line 9101) | abstract public function filter(&$uri, $config, $context);
  class HTMLPurifier_URIParser (line 9112) | class HTMLPurifier_URIParser
    method __construct (line 9120) | public function __construct()
    method parse (line 9131) | public function parse($uri)
  class HTMLPurifier_URIScheme (line 9183) | abstract class HTMLPurifier_URIScheme
    method doValidate (line 9230) | abstract public function doValidate(&$uri, $config, $context);
    method validate (line 9240) | public function validate(&$uri, $config, $context)
  class HTMLPurifier_URISchemeRegistry (line 9286) | class HTMLPurifier_URISchemeRegistry
    method instance (line 9297) | public static function instance($prototype = null)
    method getScheme (line 9321) | public function getScheme($scheme, $config, $context)
    method register (line 9355) | public function register($scheme, $scheme_obj)
  class HTMLPurifier_UnitConverter (line 9369) | class HTMLPurifier_UnitConverter
    method __construct (line 9418) | public function __construct($output_precision = 4, $internal_precision...
    method convert (line 9444) | public function convert($length, $to_unit)
    method getSigFigs (line 9554) | public function getSigFigs($n)
    method add (line 9576) | private function add($s1, $s2, $scale)
    method mul (line 9592) | private function mul($s1, $s2, $scale)
    method div (line 9608) | private function div($s1, $s2, $scale)
    method round (line 9624) | private function round($n, $sigfigs)
    method scale (line 9651) | private function scale($r, $scale)
  class HTMLPurifier_VarParser (line 9677) | class HTMLPurifier_VarParser
    method parse (line 9731) | final public function parse($var, $type, $allow_null = false)
    method parseImplementation (line 9808) | protected function parseImplementation($var, $type, $allow_null)
    method error (line 9817) | protected function error($msg)
    method errorInconsistent (line 9831) | protected function errorInconsistent($class, $type)
    method errorGeneric (line 9844) | protected function errorGeneric($var, $type)
    method getTypeName (line 9854) | public static function getTypeName($type)
  class HTMLPurifier_VarParserException (line 9875) | class HTMLPurifier_VarParserException extends HTMLPurifier_Exception
  class HTMLPurifier_Zipper (line 9902) | class HTMLPurifier_Zipper
    method __construct (line 9906) | public function __construct($front, $back) {
    method fromArray (line 9917) | static public function fromArray($array) {
    method toArray (line 9928) | public function toArray($t = NULL) {
    method next (line 9942) | public function next($t) {
    method advance (line 9953) | public function advance($t, $n) {
    method prev (line 9965) | public function prev($t) {
    method delete (line 9975) | public function delete() {
    method done (line 9983) | public function done() {
    method insertBefore (line 9991) | public function insertBefore($t) {
    method insertAfter (line 9999) | public function insertAfter($t) {
    method splice (line 10023) | public function splice($t, $delete, $replacement) {
  class HTMLPurifier_AttrDef_CSS (line 10053) | class HTMLPurifier_AttrDef_CSS extends HTMLPurifier_AttrDef
    method validate (line 10062) | public function validate($css, $config, $context)
  class HTMLPurifier_AttrDef_Clone (line 10153) | class HTMLPurifier_AttrDef_Clone extends HTMLPurifier_AttrDef
    method __construct (line 10164) | public function __construct($clone)
    method validate (line 10175) | public function validate($v, $config, $context)
    method make (line 10184) | public function make($string)
  class HTMLPurifier_AttrDef_Enum (line 10201) | class HTMLPurifier_AttrDef_Enum extends HTMLPurifier_AttrDef
    method __construct (line 10221) | public function __construct($valid_values = array(), $case_sensitive =...
    method validate (line 10233) | public function validate($string, $config, $context)
    method make (line 10251) | public function make($string)
  class HTMLPurifier_AttrDef_Integer (line 10275) | class HTMLPurifier_AttrDef_Integer extends HTMLPurifier_AttrDef
    method __construct (line 10301) | public function __construct($negative = true, $zero = true, $positive ...
    method validate (line 10314) | public function validate($integer, $config, $context)
  class HTMLPurifier_AttrDef_Lang (line 10364) | class HTMLPurifier_AttrDef_Lang extends HTMLPurifier_AttrDef
    method validate (line 10373) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_Switch (line 10450) | class HTMLPurifier_AttrDef_Switch
    method __construct (line 10473) | public function __construct($tag, $with_tag, $without_tag)
    method validate (line 10486) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_Text (line 10504) | class HTMLPurifier_AttrDef_Text extends HTMLPurifier_AttrDef
    method validate (line 10513) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_URI (line 10527) | class HTMLPurifier_AttrDef_URI extends HTMLPurifier_AttrDef
    method __construct (line 10543) | public function __construct($embeds_resource = false)
    method make (line 10553) | public function make($string)
    method validate (line 10565) | public function validate($uri, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Number (line 10638) | class HTMLPurifier_AttrDef_CSS_Number extends HTMLPurifier_AttrDef
    method __construct (line 10650) | public function __construct($non_negative = false)
    method validate (line 10663) | public function validate($number, $config, $context)
  class HTMLPurifier_AttrDef_CSS_AlphaValue (line 10720) | class HTMLPurifier_AttrDef_CSS_AlphaValue extends HTMLPurifier_AttrDef_C...
    method __construct (line 10723) | public function __construct()
    method validate (line 10734) | public function validate($number, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Background (line 10759) | class HTMLPurifier_AttrDef_CSS_Background extends HTMLPurifier_AttrDef
    method __construct (line 10772) | public function __construct($config)
    method validate (line 10788) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_BackgroundPosition (line 10908) | class HTMLPurifier_AttrDef_CSS_BackgroundPosition extends HTMLPurifier_A...
    method __construct (line 10921) | public function __construct()
    method validate (line 10933) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Border (line 11028) | class HTMLPurifier_AttrDef_CSS_Border extends HTMLPurifier_AttrDef
    method __construct (line 11040) | public function __construct($config)
    method validate (line 11054) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Color (line 11085) | class HTMLPurifier_AttrDef_CSS_Color extends HTMLPurifier_AttrDef
    method validate (line 11094) | public function validate($color, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Composite (line 11197) | class HTMLPurifier_AttrDef_CSS_Composite extends HTMLPurifier_AttrDef
    method __construct (line 11210) | public function __construct($defs)
    method validate (line 11221) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_DenyElementDecorator (line 11240) | class HTMLPurifier_AttrDef_CSS_DenyElementDecorator extends HTMLPurifier...
    method __construct (line 11255) | public function __construct($def, $element)
    method validate (line 11268) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Filter (line 11287) | class HTMLPurifier_AttrDef_CSS_Filter extends HTMLPurifier_AttrDef
    method __construct (line 11294) | public function __construct()
    method validate (line 11305) | public function validate($value, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Font (line 11363) | class HTMLPurifier_AttrDef_CSS_Font extends HTMLPurifier_AttrDef
    method __construct (line 11379) | public function __construct($config)
    method validate (line 11396) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_FontFamily (line 11540) | class HTMLPurifier_AttrDef_CSS_FontFamily extends HTMLPurifier_AttrDef
    method __construct (line 11545) | public function __construct()
    method validate (line 11589) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Ident (line 11760) | class HTMLPurifier_AttrDef_CSS_Ident extends HTMLPurifier_AttrDef
    method validate (line 11769) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_ImportantDecorator (line 11793) | class HTMLPurifier_AttrDef_CSS_ImportantDecorator extends HTMLPurifier_A...
    method __construct (line 11808) | public function __construct($def, $allow = false)
    method validate (line 11821) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Length (line 11850) | class HTMLPurifier_AttrDef_CSS_Length extends HTMLPurifier_AttrDef
    method __construct (line 11867) | public function __construct($min = null, $max = null)
    method validate (line 11879) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_ListStyle (line 11929) | class HTMLPurifier_AttrDef_CSS_ListStyle extends HTMLPurifier_AttrDef
    method __construct (line 11942) | public function __construct($config)
    method validate (line 11956) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Multiple (line 12049) | class HTMLPurifier_AttrDef_CSS_Multiple extends HTMLPurifier_AttrDef
    method __construct (line 12068) | public function __construct($single, $max = 4)
    method validate (line 12080) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_Percentage (line 12113) | class HTMLPurifier_AttrDef_CSS_Percentage extends HTMLPurifier_AttrDef
    method __construct (line 12125) | public function __construct($non_negative = false)
    method validate (line 12136) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_TextDecoration (line 12170) | class HTMLPurifier_AttrDef_CSS_TextDecoration extends HTMLPurifier_AttrDef
    method validate (line 12179) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_CSS_URI (line 12221) | class HTMLPurifier_AttrDef_CSS_URI extends HTMLPurifier_AttrDef_URI
    method __construct (line 12224) | public function __construct()
    method validate (line 12235) | public function validate($uri_string, $config, $context)
  class HTMLPurifier_AttrDef_HTML_Bool (line 12290) | class HTMLPurifier_AttrDef_HTML_Bool extends HTMLPurifier_AttrDef
    method __construct (line 12306) | public function __construct($name = false)
    method validate (line 12317) | public function validate($string, $config, $context)
    method make (line 12329) | public function make($string)
  class HTMLPurifier_AttrDef_HTML_Nmtokens (line 12342) | class HTMLPurifier_AttrDef_HTML_Nmtokens extends HTMLPurifier_AttrDef
    method validate (line 12351) | public function validate($string, $config, $context)
    method split (line 12375) | protected function split($string, $config, $context)
    method filter (line 12400) | protected function filter($tokens, $config, $context)
  class HTMLPurifier_AttrDef_HTML_Class (line 12413) | class HTMLPurifier_AttrDef_HTML_Class extends HTMLPurifier_AttrDef_HTML_...
    method split (line 12421) | protected function split($string, $config, $context)
    method filter (line 12438) | protected function filter($tokens, $config, $context)
  class HTMLPurifier_AttrDef_HTML_Color (line 12462) | class HTMLPurifier_AttrDef_HTML_Color extends HTMLPurifier_AttrDef
    method validate (line 12471) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_HTML_FrameTarget (line 12514) | class HTMLPurifier_AttrDef_HTML_FrameTarget extends HTMLPurifier_AttrDef...
    method __construct (line 12527) | public function __construct()
    method validate (line 12537) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_HTML_ID (line 12559) | class HTMLPurifier_AttrDef_HTML_ID extends HTMLPurifier_AttrDef
    method __construct (line 12575) | public function __construct($selector = false)
    method validate (line 12586) | public function validate($id, $config, $context)
  class HTMLPurifier_AttrDef_HTML_Pixels (line 12659) | class HTMLPurifier_AttrDef_HTML_Pixels extends HTMLPurifier_AttrDef
    method __construct (line 12670) | public function __construct($max = null)
    method validate (line 12681) | public function validate($string, $config, $context)
    method make (line 12717) | public function make($string)
  class HTMLPurifier_AttrDef_HTML_Length (line 12740) | class HTMLPurifier_AttrDef_HTML_Length extends HTMLPurifier_AttrDef_HTML...
    method validate (line 12749) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_HTML_LinkTypes (line 12796) | class HTMLPurifier_AttrDef_HTML_LinkTypes extends HTMLPurifier_AttrDef
    method __construct (line 12808) | public function __construct($name)
    method validate (line 12831) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_HTML_MultiLength (line 12869) | class HTMLPurifier_AttrDef_HTML_MultiLength extends HTMLPurifier_AttrDef...
    method validate (line 12878) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_URI_Email (line 12924) | abstract class HTMLPurifier_AttrDef_URI_Email extends HTMLPurifier_AttrDef
    method unpack (line 12932) | public function unpack($string)
  class HTMLPurifier_AttrDef_URI_Host (line 12948) | class HTMLPurifier_AttrDef_URI_Host extends HTMLPurifier_AttrDef
    method __construct (line 12963) | public function __construct()
    method validate (line 12975) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrDef_URI_IPv4 (line 13078) | class HTMLPurifier_AttrDef_URI_IPv4 extends HTMLPurifier_AttrDef
    method validate (line 13093) | public function validate($aIP, $config, $context)
    method _loadRegex (line 13109) | protected function _loadRegex()
  class HTMLPurifier_AttrDef_URI_IPv6 (line 13126) | class HTMLPurifier_AttrDef_URI_IPv6 extends HTMLPurifier_AttrDef_URI_IPv4
    method validate (line 13135) | public function validate($aIP, $config, $context)
  class HTMLPurifier_AttrDef_URI_Email_SimpleCheck (line 13214) | class HTMLPurifier_AttrDef_URI_Email_SimpleCheck extends HTMLPurifier_At...
    method validate (line 13223) | public function validate($string, $config, $context)
  class HTMLPurifier_AttrTransform_Background (line 13243) | class HTMLPurifier_AttrTransform_Background extends HTMLPurifier_AttrTra...
    method transform (line 13251) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_BdoDir (line 13274) | class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform
    method transform (line 13283) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_BgColor (line 13300) | class HTMLPurifier_AttrTransform_BgColor extends HTMLPurifier_AttrTransform
    method transform (line 13308) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_BoolToCSS (line 13329) | class HTMLPurifier_AttrTransform_BoolToCSS extends HTMLPurifier_AttrTran...
    method __construct (line 13347) | public function __construct($attr, $css)
    method transform (line 13359) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_Border (line 13377) | class HTMLPurifier_AttrTransform_Border extends HTMLPurifier_AttrTransform
    method transform (line 13385) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_EnumToCSS (line 13405) | class HTMLPurifier_AttrTransform_EnumToCSS extends HTMLPurifier_AttrTran...
    method __construct (line 13432) | public function __construct($attr, $enum_to_css, $case_sensitive = false)
    method transform (line 13445) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_ImgRequired (line 13478) | class HTMLPurifier_AttrTransform_ImgRequired extends HTMLPurifier_AttrTr...
    method transform (line 13487) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_ImgSpace (line 13522) | class HTMLPurifier_AttrTransform_ImgSpace extends HTMLPurifier_AttrTrans...
    method __construct (line 13540) | public function __construct($attr)
    method transform (line 13554) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_Input (line 13585) | class HTMLPurifier_AttrTransform_Input extends HTMLPurifier_AttrTransform
    method __construct (line 13592) | public function __construct()
    method transform (line 13603) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_Lang (line 13643) | class HTMLPurifier_AttrTransform_Lang extends HTMLPurifier_AttrTransform
    method transform (line 13652) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_Length (line 13673) | class HTMLPurifier_AttrTransform_Length extends HTMLPurifier_AttrTransform
    method __construct (line 13686) | public function __construct($name, $css_name = null)
    method transform (line 13698) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_Name (line 13719) | class HTMLPurifier_AttrTransform_Name extends HTMLPurifier_AttrTransform
    method transform (line 13728) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_NameSync (line 13755) | class HTMLPurifier_AttrTransform_NameSync extends HTMLPurifier_AttrTrans...
    method __construct (line 13758) | public function __construct()
    method transform (line 13769) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_Nofollow (line 13798) | class HTMLPurifier_AttrTransform_Nofollow extends HTMLPurifier_AttrTrans...
    method __construct (line 13805) | public function __construct()
    method transform (line 13816) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_SafeEmbed (line 13845) | class HTMLPurifier_AttrTransform_SafeEmbed extends HTMLPurifier_AttrTran...
    method transform (line 13858) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_SafeObject (line 13874) | class HTMLPurifier_AttrTransform_SafeObject extends HTMLPurifier_AttrTra...
    method transform (line 13887) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_SafeParam (line 13912) | class HTMLPurifier_AttrTransform_SafeParam extends HTMLPurifier_AttrTran...
    method __construct (line 13924) | public function __construct()
    method transform (line 13936) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_ScriptRequired (line 13983) | class HTMLPurifier_AttrTransform_ScriptRequired extends HTMLPurifier_Att...
    method transform (line 13991) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_TargetBlank (line 14011) | class HTMLPurifier_AttrTransform_TargetBlank extends HTMLPurifier_AttrTr...
    method __construct (line 14018) | public function __construct()
    method transform (line 14029) | public function transform($attr, $config, $context)
  class HTMLPurifier_AttrTransform_Textarea (line 14053) | class HTMLPurifier_AttrTransform_Textarea extends HTMLPurifier_AttrTrans...
    method transform (line 14061) | public function transform($attr, $config, $context)
  class HTMLPurifier_ChildDef_Chameleon (line 14087) | class HTMLPurifier_ChildDef_Chameleon extends HTMLPurifier_ChildDef
    method __construct (line 14111) | public function __construct($inline, $block)
    method validateChildren (line 14124) | public function validateChildren($children, $config, $context)
  class HTMLPurifier_ChildDef_Custom (line 14152) | class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef
    method __construct (line 14179) | public function __construct($dtd_regex)
    method _compileRegex (line 14188) | protected function _compileRegex()
    method validateChildren (line 14224) | public function validateChildren($children, $config, $context)
  class HTMLPurifier_ChildDef_Empty (line 14256) | class HTMLPurifier_ChildDef_Empty extends HTMLPurifier_ChildDef
    method __construct (line 14268) | public function __construct()
    method validateChildren (line 14278) | public function validateChildren($children, $config, $context)
  class HTMLPurifier_ChildDef_List (line 14297) | class HTMLPurifier_ChildDef_List extends HTMLPurifier_ChildDef
    method validateChildren (line 14316) | public function validateChildren($children, $config, $context)
  class HTMLPurifier_ChildDef_Required (line 14378) | class HTMLPurifier_ChildDef_Required extends HTMLPurifier_ChildDef
    method __construct (line 14395) | public function __construct($elements)
    method validateChildren (line 14430) | public function validateChildren($children, $config, $context)
  class HTMLPurifier_ChildDef_Optional (line 14501) | class HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required
    method validateChildren (line 14519) | public function validateChildren($children, $config, $context)
  class HTMLPurifier_ChildDef_StrictBlockquote (line 14543) | class HTMLPurifier_ChildDef_StrictBlockquote extends HTMLPurifier_ChildD...
    method getAllowedElements (line 14576) | public function getAllowedElements($config)
    method validateChildren (line 14588) | public function validateChildren($children, $config, $context)
    method init (line 14634) | private function init($config)
  class HTMLPurifier_ChildDef_Table (line 14680) | class HTMLPurifier_ChildDef_Table extends HTMLPurifier_ChildDef
    method __construct (line 14705) | public function __construct()
    method validateChildren (line 14715) | public function validateChildren($children, $config, $context)
  class HTMLPurifier_DefinitionCache_Decorator (line 14876) | class HTMLPurifier_DefinitionCache_Decorator extends HTMLPurifier_Defini...
    method __construct (line 14891) | public function __construct()
    method decorate (line 14900) | public function decorate(&$cache)
    method copy (line 14913) | public function copy()
    method add (line 14923) | public function add($def, $config)
    method set (line 14933) | public function set($def, $config)
    method replace (line 14943) | public function replace($def, $config)
    method get (line 14952) | public function get($config)
    method remove (line 14961) | public function remove($config)
    method flush (line 14970) | public function flush($config)
    method cleanup (line 14979) | public function cleanup($config)
  class HTMLPurifier_DefinitionCache_Null (line 14992) | class HTMLPurifier_DefinitionCache_Null extends HTMLPurifier_DefinitionC...
    method add (line 15000) | public function add($def, $config)
    method set (line 15010) | public function set($def, $config)
    method replace (line 15020) | public function replace($def, $config)
    method remove (line 15029) | public function remove($config)
    method get (line 15038) | public function get($config)
    method flush (line 15047) | public function flush($config)
    method cleanup (line 15056) | public function cleanup($config)
  class HTMLPurifier_DefinitionCache_Serializer (line 15066) | class HTMLPurifier_DefinitionCache_Serializer extends HTMLPurifier_Defin...
    method add (line 15074) | public function add($def, $config)
    method set (line 15094) | public function set($def, $config)
    method replace (line 15111) | public function replace($def, $config)
    method get (line 15130) | public function get($config)
    method remove (line 15143) | public function remove($config)
    method flush (line 15156) | public function flush($config)
    method cleanup (line 15178) | public function cleanup($config)
    method generateFilePath (line 15206) | public function generateFilePath($config)
    method generateDirectoryPath (line 15219) | public function generateDirectoryPath($config)
    method generateBaseDirectoryPath (line 15232) | public function generateBaseDirectoryPath($config)
    method _write (line 15246) | private function _write($file, $data, $config)
    method _prepareDir (line 15266) | private function _prepareDir($config)
    method _testPermissions (line 15301) | private function _testPermissions($dir, $chmod)
  class HTMLPurifier_DefinitionCache_Decorator_Cleanup (line 15356) | class HTMLPurifier_DefinitionCache_Decorator_Cleanup extends HTMLPurifie...
    method copy (line 15366) | public function copy()
    method add (line 15376) | public function add($def, $config)
    method set (line 15390) | public function set($def, $config)
    method replace (line 15404) | public function replace($def, $config)
    method get (line 15417) | public function get($config)
  class HTMLPurifier_DefinitionCache_Decorator_Memory (line 15436) | class HTMLPurifier_DefinitionCache_Decorator_Memory extends HTMLPurifier...
    method copy (line 15451) | public function copy()
    method add (line 15461) | public function add($def, $config)
    method set (line 15475) | public function set($def, $config)
    method replace (line 15489) | public function replace($def, $config)
    method get (line 15502) | public function get($config)
  class HTMLPurifier_HTMLModule_Bdo (line 15521) | class HTMLPurifier_HTMLModule_Bdo extends HTMLPurifier_HTMLModule
    method setup (line 15539) | public function setup($config)
  class HTMLPurifier_HTMLModule_CommonAttributes (line 15562) | class HTMLPurifier_HTMLModule_CommonAttributes extends HTMLPurifier_HTML...
  class HTMLPurifier_HTMLModule_Edit (line 15598) | class HTMLPurifier_HTMLModule_Edit extends HTMLPurifier_HTMLModule
    method setup (line 15609) | public function setup($config)
    method getChildDef (line 15636) | public function getChildDef($def)
  class HTMLPurifier_HTMLModule_Forms (line 15653) | class HTMLPurifier_HTMLModule_Forms extends HTMLPurifier_HTMLModule
    method setup (line 15676) | public function setup($config)
  class HTMLPurifier_HTMLModule_Hypertext (line 15844) | class HTMLPurifier_HTMLModule_Hypertext extends HTMLPurifier_HTMLModule
    method setup (line 15855) | public function setup($config)
  class HTMLPurifier_HTMLModule_Iframe (line 15889) | class HTMLPurifier_HTMLModule_Iframe extends HTMLPurifier_HTMLModule
    method setup (line 15905) | public function setup($config)
  class HTMLPurifier_HTMLModule_Image (line 15939) | class HTMLPurifier_HTMLModule_Image extends HTMLPurifier_HTMLModule
    method setup (line 15950) | public function setup($config)
  class HTMLPurifier_HTMLModule_Legacy (line 16000) | class HTMLPurifier_HTMLModule_Legacy extends HTMLPurifier_HTMLModule
    method setup (line 16010) | public function setup($config)
  class HTMLPurifier_HTMLModule_List (line 16174) | class HTMLPurifier_HTMLModule_List extends HTMLPurifier_HTMLModule
    method setup (line 16198) | public function setup($config)
  class HTMLPurifier_HTMLModule_Name (line 16223) | class HTMLPurifier_HTMLModule_Name extends HTMLPurifier_HTMLModule
    method setup (line 16233) | public function setup($config)
  class HTMLPurifier_HTMLModule_Nofollow (line 16254) | class HTMLPurifier_HTMLModule_Nofollow extends HTMLPurifier_HTMLModule
    method setup (line 16265) | public function setup($config)
  class HTMLPurifier_HTMLModule_NonXMLCommonAttributes (line 16276) | class HTMLPurifier_HTMLModule_NonXMLCommonAttributes extends HTMLPurifie...
  class HTMLPurifier_HTMLModule_Object (line 16302) | class HTMLPurifier_HTMLModule_Object extends HTMLPurifier_HTMLModule
    method setup (line 16317) | public function setup($config)
  class HTMLPurifier_HTMLModule_Presentation (line 16370) | class HTMLPurifier_HTMLModule_Presentation extends HTMLPurifier_HTMLModule
    method setup (line 16381) | public function setup($config)
  class HTMLPurifier_HTMLModule_Proprietary (line 16407) | class HTMLPurifier_HTMLModule_Proprietary extends HTMLPurifier_HTMLModule
    method setup (line 16417) | public function setup($config)
  class HTMLPurifier_HTMLModule_Ruby (line 16448) | class HTMLPurifier_HTMLModule_Ruby extends HTMLPurifier_HTMLModule
    method setup (line 16459) | public function setup($config)
  class HTMLPurifier_HTMLModule_SafeEmbed (line 16484) | class HTMLPurifier_HTMLModule_SafeEmbed extends HTMLPurifier_HTMLModule
    method setup (line 16494) | public function setup($config)
  class HTMLPurifier_HTMLModule_SafeObject (line 16528) | class HTMLPurifier_HTMLModule_SafeObject extends HTMLPurifier_HTMLModule
    method setup (line 16538) | public function setup($config)
  class HTMLPurifier_HTMLModule_SafeScripting (line 16589) | class HTMLPurifier_HTMLModule_SafeScripting extends HTMLPurifier_HTMLModule
    method setup (line 16599) | public function setup($config)
  class HTMLPurifier_HTMLModule_Scripting (line 16639) | class HTMLPurifier_HTMLModule_Scripting extends HTMLPurifier_HTMLModule
    method setup (line 16664) | public function setup($config)
  class HTMLPurifier_HTMLModule_StyleAttribute (line 16704) | class HTMLPurifier_HTMLModule_StyleAttribute extends HTMLPurifier_HTMLMo...
    method setup (line 16724) | public function setup($config)
  class HTMLPurifier_HTMLModule_Tables (line 16737) | class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule
    method setup (line 16747) | public function setup($config)
  class HTMLPurifier_HTMLModule_Target (line 16813) | class HTMLPurifier_HTMLModule_Target extends HTMLPurifier_HTMLModule
    method setup (line 16823) | public function setup($config)
  class HTMLPurifier_HTMLModule_TargetBlank (line 16843) | class HTMLPurifier_HTMLModule_TargetBlank extends HTMLPurifier_HTMLModule
    method setup (line 16853) | public function setup($config)
  class HTMLPurifier_HTMLModule_Text (line 16876) | class HTMLPurifier_HTMLModule_Text extends HTMLPurifier_HTMLModule
    method setup (line 16893) | public function setup($config)
  class HTMLPurifier_HTMLModule_Tidy (line 16957) | class HTMLPurifier_HTMLModule_Tidy extends HTMLPurifier_HTMLModule
    method setup (line 16992) | public function setup($config)
    method getFixesForLevel (line 17024) | public function getFixesForLevel($level)
    method makeFixesForLevel (line 17058) | public function makeFixesForLevel($fixes)
    method populate (line 17078) | public function populate($fixes)
    method getFixType (line 17131) | public function getFixType($name)
    method makeFixes (line 17174) | public function makeFixes()
  class HTMLPurifier_HTMLModule_XMLCommonAttributes (line 17183) | class HTMLPurifier_HTMLModule_XMLCommonAttributes extends HTMLPurifier_H...
  class HTMLPurifier_HTMLModule_Tidy_Name (line 17207) | class HTMLPurifier_HTMLModule_Tidy_Name extends HTMLPurifier_HTMLModule_...
    method makeFixes (line 17222) | public function makeFixes()
  class HTMLPurifier_HTMLModule_Tidy_Proprietary (line 17238) | class HTMLPurifier_HTMLModule_Tidy_Proprietary extends HTMLPurifier_HTML...
    method makeFixes (line 17254) | public function makeFixes()
  class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 (line 17273) | class HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 extends HTMLPurifier_HT...
    method makeFixes (line 17279) | public function makeFixes()
  class HTMLPurifier_HTMLModule_Tidy_Strict (line 17453) | class HTMLPurifier_HTMLModule_Tidy_Strict extends HTMLPurifier_HTMLModul...
    method makeFixes (line 17468) | public function makeFixes()
    method getChildDef (line 17484) | public function getChildDef($def)
  class HTMLPurifier_HTMLModule_Tidy_Transitional (line 17497) | class HTMLPurifier_HTMLModule_Tidy_Transitional extends HTMLPurifier_HTM...
  class HTMLPurifier_HTMLModule_Tidy_XHTML (line 17514) | class HTMLPurifier_HTMLModule_Tidy_XHTML extends HTMLPurifier_HTMLModule...
    method makeFixes (line 17529) | public function makeFixes()
  class HTMLPurifier_Injector_AutoParagraph (line 17547) | class HTMLPurifier_Injector_AutoParagraph extends HTMLPurifier_Injector
    method _pStart (line 17562) | private function _pStart()
    method handleText (line 17572) | public function handleText(&$token)
    method handleElement (line 17650) | public function handleElement(&$token)
    method _splitText (line 17750) | private function _splitText($data, &$result)
    method _isInline (line 17836) | private function _isInline($token)
    method _pLookAhead (line 17846) | private function _pLookAhead()
    method _checkNeedsP (line 17871) | private function _checkNeedsP($current)
  class HTMLPurifier_Injector_DisplayLinkURI (line 17901) | class HTMLPurifier_Injector_DisplayLinkURI extends HTMLPurifier_Injector
    method handleElement (line 17916) | public function handleElement(&$token)
    method handleEnd (line 17923) | public function handleEnd(&$token)
  class HTMLPurifier_Injector_Linkify (line 17942) | class HTMLPurifier_Injector_Linkify extends HTMLPurifier_Injector
    method handleText (line 17957) | public function handleText(&$token)
  class HTMLPurifier_Injector_PurifierLinkify (line 18003) | class HTMLPurifier_Injector_PurifierLinkify extends HTMLPurifier_Injector
    method prepare (line 18025) | public function prepare($config, $context)
    method handleText (line 18034) | public function handleText(&$token)
  class HTMLPurifier_Injector_RemoveEmpty (line 18071) | class HTMLPurifier_Injector_RemoveEmpty extends HTMLPurifier_Injector
    method prepare (line 18109) | public function prepare($config, $context)
    method handleElement (line 18122) | public function handleElement(&$token)
  class HTMLPurifier_Injector_RemoveSpansWithoutAttributes (line 18176) | class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends HTMLPur...
    method prepare (line 18204) | public function prepare($config, $context)
    method handleElement (line 18215) | public function handleElement(&$token)
    method handleEnd (line 18246) | public function handleEnd(&$token)
  class HTMLPurifier_Injector_SafeObject (line 18262) | class HTMLPurifier_Injector_SafeObject extends HTMLPurifier_Injector
    method prepare (line 18309) | public function prepare($config, $context)
    method handleElement (line 18317) | public function handleElement(&$token)
    method handleEnd (line 18364) | public function handleEnd(&$token)
  class HTMLPurifier_Lexer_DOMLex (line 18404) | class HTMLPurifier_Lexer_DOMLex extends HTMLPurifier_Lexer
    method __construct (line 18412) | public function __construct()
    method tokenizeHTML (line 18425) | public function tokenizeHTML($html, $config, $context)
    method tokenizeDOM (line 18469) | protected function tokenizeDOM($node, &$tokens)
    method createStartNode (line 18508) | protected function createStartNode($node, &$tokens, $collect)
    method createEndNode (line 18568) | protected function createEndNode($node, &$tokens)
    method transformAttrToAssoc (line 18580) | protected function transformAttrToAssoc($node_map)
    method muteErrorHandler (line 18600) | public function muteErrorHandler($errno, $errstr)
    method callbackUndoCommentSubst (line 18610) | public function callbackUndoCommentSubst($matches)
    method callbackArmorCommentEntities (line 18621) | public function callbackArmorCommentEntities($matches)
    method wrapHTML (line 18633) | protected function wrapHTML($html, $config, $context)
  class HTMLPurifier_Lexer_DirectLex (line 18671) | class HTMLPurifier_Lexer_DirectLex extends HTMLPurifier_Lexer
    method scriptCallback (line 18689) | protected function scriptCallback($matches)
    method tokenizeHTML (line 18700) | public function tokenizeHTML($html, $config, $context)
    method substrCount (line 19012) | protected function substrCount($haystack, $needle, $offset, $length)
    method parseAttributeString (line 19034) | public function parseAttributeString($string, $config, $context)
  class HTMLPurifier_Node_Comment (line 19204) | class HTMLPurifier_Node_Comment extends HTMLPurifier_Node
    method __construct (line 19224) | public function __construct($data, $line = null, $col = null)
    method toTokenPair (line 19231) | public function toTokenPair() {
  class HTMLPurifier_Node_Element (line 19241) | class HTMLPurifier_Node_Element extends HTMLPurifier_Node
    method __construct (line 19274) | public function __construct($name, $attr = array(), $line = null, $col...
    method toTokenPair (line 19282) | public function toTokenPair() {
  class HTMLPurifier_Node_Text (line 19307) | class HTMLPurifier_Node_Text extends HTMLPurifier_Node
    method __construct (line 19336) | public function __construct($data, $is_whitespace, $line = null, $col ...
    method toTokenPair (line 19344) | public function toTokenPair() {
  class HTMLPurifier_Strategy_Composite (line 19356) | abstract class HTMLPurifier_Strategy_Composite extends HTMLPurifier_Stra...
    method execute (line 19371) | public function execute($tokens, $config, $context)
  class HTMLPurifier_Strategy_Core (line 19387) | class HTMLPurifier_Strategy_Core extends HTMLPurifier_Strategy_Composite
    method __construct (line 19389) | public function __construct()
  class HTMLPurifier_Strategy_FixNesting (line 19431) | class HTMLPurifier_Strategy_FixNesting extends HTMLPurifier_Strategy
    method execute (line 19440) | public function execute($tokens, $config, $context)
  class HTMLPurifier_Strategy_MakeWellFormed (line 19595) | class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy
    method execute (line 19647) | public function execute($tokens, $config, $context)
    method processToken (line 20116) | protected function processToken($token, $injector = -1)
    method insertBefore (line 20162) | private function insertBefore($token)
    method remove (line 20175) | private function remove()
  class HTMLPurifier_Strategy_RemoveForeignElements (line 20193) | class HTMLPurifier_Strategy_RemoveForeignElements extends HTMLPurifier_S...
    method execute (line 20202) | public function execute($tokens, $config, $context)
  class HTMLPurifier_Strategy_ValidateAttributes (line 20397) | class HTMLPurifier_Strategy_ValidateAttributes extends HTMLPurifier_Stra...
    method execute (line 20406) | public function execute($tokens, $config, $context)
  class HTMLPurifier_TagTransform_Font (line 20454) | class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform
    method transform (line 20487) | public function transform($tag, $config, $context)
  class HTMLPurifier_TagTransform_Simple (line 20559) | class HTMLPurifier_TagTransform_Simple extends HTMLPurifier_TagTransform
    method __construct (line 20570) | public function __construct($transform_to, $style = null)
    method transform (line 20582) | public function transform($tag, $config, $context)
  class HTMLPurifier_Token_Comment (line 20602) | class HTMLPurifier_Token_Comment extends HTMLPurifier_Token
    method __construct (line 20622) | public function __construct($data, $line = null, $col = null)
    method toNode (line 20629) | public function toNode() {
  class HTMLPurifier_Token_Tag (line 20641) | abstract class HTMLPurifier_Token_Tag extends HTMLPurifier_Token
    method __construct (line 20677) | public function __construct($name, $attr = array(), $line = null, $col...
    method toNode (line 20698) | public function toNode() {
  class HTMLPurifier_Token_Empty (line 20710) | class HTMLPurifier_Token_Empty extends HTMLPurifier_Token_Tag
    method toNode (line 20712) | public function toNode() {
  class HTMLPurifier_Token_End (line 20730) | class HTMLPurifier_Token_End extends HTMLPurifier_Token_Tag
    method toNode (line 20739) | public function toNode() {
  class HTMLPurifier_Token_Start (line 20751) | class HTMLPurifier_Token_Start extends HTMLPurifier_Token_Tag
  class HTMLPurifier_Token_Text (line 20768) | class HTMLPurifier_Token_Text extends HTMLPurifier_Token
    method __construct (line 20796) | public function __construct($data, $line = null, $col = null)
    method toNode (line 20804) | public function toNode() {
  class HTMLPurifier_URIFilter_DisableExternal (line 20813) | class HTMLPurifier_URIFilter_DisableExternal extends HTMLPurifier_URIFilter
    method prepare (line 20829) | public function prepare($config)
    method filter (line 20843) | public function filter(&$uri, $config, $context)
  class HTMLPurifier_URIFilter_DisableExternalResources (line 20868) | class HTMLPurifier_URIFilter_DisableExternalResources extends HTMLPurifi...
    method filter (line 20881) | public function filter(&$uri, $config, $context)
  class HTMLPurifier_URIFilter_DisableResources (line 20894) | class HTMLPurifier_URIFilter_DisableResources extends HTMLPurifier_URIFi...
    method filter (line 20907) | public function filter(&$uri, $config, $context)
  class HTMLPurifier_URIFilter_HostBlacklist (line 20921) | class HTMLPurifier_URIFilter_HostBlacklist extends HTMLPurifier_URIFilter
    method prepare (line 20937) | public function prepare($config)
    method filter (line 20949) | public function filter(&$uri, $config, $context)
  class HTMLPurifier_URIFilter_MakeAbsolute (line 20966) | class HTMLPurifier_URIFilter_MakeAbsolute extends HTMLPurifier_URIFilter
    method prepare (line 20987) | public function prepare($config)
    method filter (line 21013) | public function filter(&$uri, $config, $context)
    method _collapseStack (line 21078) | private function _collapseStack($stack)
  class HTMLPurifier_URIFilter_Munge (line 21123) | class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter
    method prepare (line 21164) | public function prepare($config)
    method filter (line 21182) | public function filter(&$uri, $config, $context)
    method makeReplace (line 21218) | protected function makeReplace($uri, $config, $context)
  class HTMLPurifier_URIFilter_SafeIframe (line 21245) | class HTMLPurifier_URIFilter_SafeIframe extends HTMLPurifier_URIFilter
    method prepare (line 21269) | public function prepare($config)
    method filter (line 21281) | public function filter(&$uri, $config, $context)
  class HTMLPurifier_URIScheme_data (line 21311) | class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme
    method doValidate (line 21341) | public function doValidate(&$uri, $config, $context)
    method muteErrorHandler (line 21429) | public function muteErrorHandler($errno, $errstr)
  class HTMLPurifier_URIScheme_file (line 21439) | class HTMLPurifier_URIScheme_file extends HTMLPurifier_URIScheme
    method doValidate (line 21464) | public function doValidate(&$uri, $config, $context)
  class HTMLPurifier_URIScheme_ftp (line 21484) | class HTMLPurifier_URIScheme_ftp extends HTMLPurifier_URIScheme
    method doValidate (line 21507) | public function doValidate(&$uri, $config, $context)
  class HTMLPurifier_URIScheme_http (line 21543) | class HTMLPurifier_URIScheme_http extends HTMLPurifier_URIScheme
    method doValidate (line 21566) | public function doValidate(&$uri, $config, $context)
  class HTMLPurifier_URIScheme_https (line 21580) | class HTMLPurifier_URIScheme_https extends HTMLPurifier_URIScheme_http
  class HTMLPurifier_URIScheme_mailto (line 21605) | class HTMLPurifier_URIScheme_mailto extends HTMLPurifier_URIScheme
    method doValidate (line 21623) | public function doValidate(&$uri, $config, $context)
  class HTMLPurifier_URIScheme_news (line 21640) | class HTMLPurifier_URIScheme_news extends HTMLPurifier_URIScheme
    method doValidate (line 21658) | public function doValidate(&$uri, $config, $context)
  class HTMLPurifier_URIScheme_nntp (line 21676) | class HTMLPurifier_URIScheme_nntp extends HTMLPurifier_URIScheme
    method doValidate (line 21694) | public function doValidate(&$uri, $config, $context)
  class HTMLPurifier_VarParser_Flexible (line 21711) | class HTMLPurifier_VarParser_Flexible extends HTMLPurifier_VarParser
    method parseImplementation (line 21720) | protected function parseImplementation($var, $type, $allow_null)
  class HTMLPurifier_VarParser_Native (line 21842) | class HTMLPurifier_VarParser_Native extends HTMLPurifier_VarParser
    method parseImplementation (line 21851) | protected function parseImplementation($var, $type, $allow_null)
    method evalExpression (line 21861) | protected function evalExpression($expr)

FILE: lib/purifier/standalone/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php
  class HTMLPurifier_ConfigSchema_Builder_ConfigSchema (line 7) | class HTMLPurifier_ConfigSchema_Builder_ConfigSchema
    method build (line 14) | public function build($interchange)

FILE: lib/purifier/standalone/HTMLPurifier/ConfigSchema/Builder/Xml.php
  class HTMLPurifier_ConfigSchema_Builder_Xml (line 7) | class HTMLPurifier_ConfigSchema_Builder_Xml extends XMLWriter
    method writeHTMLDiv (line 23) | protected function writeHTMLDiv($html)
    method export (line 39) | protected function export($var)
    method build (line 50) | public function build($interchange)
    method buildDirective (line 75) | public function buildDirective($directive)

FILE: lib/purifier/standalone/HTMLPurifier/ConfigSchema/Exception.php
  class HTMLPurifier_ConfigSchema_Exception (line 6) | class HTMLPurifier_ConfigSchema_Exception extends HTMLPurifier_Exception

FILE: lib/purifier/standalone/HTMLPurifier/ConfigSchema/Interchange.php
  class HTMLPurifier_ConfigSchema_Interchange (line 8) | class HTMLPurifier_ConfigSchema_Interchange
    method addDirective (line 28) | public function addDirective($directive)
    method validate (line 40) | public function validate()

FILE: lib/purifier/standalone/HTMLPurifier/ConfigSchema/Interchange/Directive.php
  class HTMLPurifier_ConfigSchema_Interchange_Directive (line 6) | class HTMLPurifier_ConfigSchema_Interchange_Directive

FILE: lib/purifier/standalone/HTMLPurifier/ConfigSchema/Interchange/Id.php
  class HTMLPurifier_ConfigSchema_Interchange_Id (line 6) | class HTMLPurifier_ConfigSchema_Interchange_Id
    method __construct (line 17) | public function __construct($key)
    method toString (line 27) | public function toString()
    method getRootNamespace (line 35) | public function getRootNamespace()
    method getDirective (line 43) | public function getDirective()
    method make (line 52) | public static function make($id)

FILE: lib/purifier/standalone/HTMLPurifier/ConfigSchema/InterchangeBuilder.php
  class HTMLPurifier_ConfigSchema_InterchangeBuilder (line 3) | class HTMLPurifier_ConfigSchema_InterchangeBuilder
    method __construct (line 15) | public function __construct($varParser = null)
    method buildFromDirectory (line 24) | public static function buildFromDirectory($dir = null)
    method buildDir (line 36) | public function buildDir($interchange, $dir = null)
    method buildFile (line 67) | public function buildFile($interchange, $file)
    method build (line 82) | public function build($interchange, $hash)
    method buildDirective (line 107) | public function buildDirective($interchange, $hash)
    method evalArray (line 180) | protected function evalArray($contents)
    method lookup (line 190) | protected function lookup($array)
    method id (line 205) | protected function id($id)
    method _findUnused (line 215) | protected function _findUnused($hash)

FILE: lib/purifier/standalone/HTMLPurifier/ConfigSchema/Validator.php
  class HTMLPurifier_ConfigSchema_Validator (line 11) | class HTMLPurifier_ConfigSchema_Validator
    method __construct (line 36) | public function __construct()
    method validate (line 46) | public function validate($interchange)
    method validateId (line 66) | public function validateId($id)
    method validateDirective (line 86) | public function validateDirective($d)
    method validateDirectiveAllowed (line 129) | public function validateDirectiveAllowed($d)
    method validateDirectiveValueAliases (line 154) | public function validateDirectiveValueAliases($d)
    method validateDirectiveAliases (line 190) | public function validateDirectiveAliases($d)
    method with (line 219) | protected function with($obj, $member)
    method error (line 228) | protected function error($target, $msg)
    method getFormattedContext (line 242) | protected function getFormattedContext()

FILE: lib/purifier/standalone/HTMLPurifier/ConfigSchema/ValidatorAtom.php
  class HTMLPurifier_ConfigSchema_ValidatorAtom (line 9) | class HTMLPurifier_ConfigSchema_ValidatorAtom
    method __construct (line 31) | public function __construct($context, $obj, $member)
    method assertIsString (line 42) | public function assertIsString()
    method assertIsBool (line 53) | public function assertIsBool()
    method assertIsArray (line 64) | public function assertIsArray()
    method assertNotNull (line 75) | public function assertNotNull()
    method assertAlnum (line 86) | public function assertAlnum()
    method assertNotEmpty (line 98) | public function assertNotEmpty()
    method assertIsLookup (line 109) | public function assertIsLookup()
    method error (line 124) | protected function error($msg)

FILE: lib/purifier/standalone/HTMLPurifier/Filter/ExtractStyleBlocks.php
  function htmlpurifier_filter_extractstyleblocks_muteerrorhandler (line 7) | function htmlpurifier_filter_extractstyleblocks_muteerrorhandler()
  class HTMLPurifier_Filter_ExtractStyleBlocks (line 25) | class HTMLPurifier_Filter_ExtractStyleBlocks extends HTMLPurifier_Filter
    method __construct (line 57) | public function __construct()
    method styleCallback (line 79) | protected function styleCallback($matches)
    method preFilter (line 92) | public function preFilter($html, $config, $context)
    method cleanCSS (line 119) | public function cleanCSS($css, $config, $context)

FILE: lib/purifier/standalone/HTMLPurifier/Filter/YouTube.php
  class HTMLPurifier_Filter_YouTube (line 7) | class HTMLPurifier_Filter_YouTube extends HTMLPurifier_Filter
    method preFilter (line 21) | public function preFilter($html, $config, $context)
    method postFilter (line 41) | public function postFilter($html, $config, $context)
    method armorUrl (line 51) | protected function armorUrl($url)
    method postFilterCallback (line 60) | protected function postFilterCallback($matches)

FILE: lib/purifier/standalone/HTMLPurifier/Language/classes/en-x-test.php
  class HTMLPurifier_Language_en_x_test (line 5) | class HTMLPurifier_Language_en_x_test extends HTMLPurifier_Language

FILE: lib/purifier/standalone/HTMLPurifier/Lexer/PH5P.php
  class HTMLPurifier_Lexer_PH5P (line 13) | class HTMLPurifier_Lexer_PH5P extends HTMLPurifier_Lexer_DOMLex
    method tokenizeHTML (line 21) | public function tokenizeHTML($html, $config, $context)
  class HTML5 (line 71) | class HTML5
    method __construct (line 462) | public function __construct($data)
    method save (line 477) | public function save()
    method char (line 482) | private function char()
    method character (line 489) | private function character($s, $l = 0)
    method characters (line 500) | private function characters($char_class, $start)
    method dataState (line 505) | private function dataState()
    method entityDataState (line 617) | private function entityDataState()
    method tagOpenState (line 636) | private function tagOpenState()
    method closeTagOpenState (line 728) | private function closeTagOpenState()
    method tagNameState (line 809) | private function tagNameState()
    method beforeAttributeNameState (line 854) | private function beforeAttributeNameState()
    method attributeNameState (line 904) | private function attributeNameState()
    method afterAttributeNameState (line 956) | private function afterAttributeNameState()
    method beforeAttributeValueState (line 1011) | private function beforeAttributeValueState()
    method attributeValueDoubleQuotedState (line 1060) | private function attributeValueDoubleQuotedState()
    method attributeValueSingleQuotedState (line 1096) | private function attributeValueSingleQuotedState()
    method attributeValueUnquotedState (line 1132) | private function attributeValueUnquotedState()
    method entityInAttributeValueState (line 1169) | private function entityInAttributeValueState()
    method bogusCommentState (line 1185) | private function bogusCommentState()
    method markupDeclarationOpenState (line 1214) | private function markupDeclarationOpenState()
    method commentState (line 1243) | private function commentState()
    method commentDashState (line 1270) | private function commentDashState()
    method commentEndState (line 1298) | private function commentEndState()
    method doctypeState (line 1322) | private function doctypeState()
    method beforeDoctypeNameState (line 1337) | private function beforeDoctypeNameState()
    method doctypeNameState (line 1389) | private function doctypeNameState()
    method afterDoctypeNameState (line 1419) | private function afterDoctypeNameState()
    method bogusDoctypeState (line 1443) | private function bogusDoctypeState()
    method entity (line 1463) | private function entity()
    method emitToken (line 1554) | private function emitToken($token)
    method EOF (line 1566) | private function EOF()
  class HTML5TreeConstructer (line 1577) | class HTML5TreeConstructer
    method __construct (line 1700) | public function __construct()
    method emitToken (line 1713) | public function emitToken($token)
    method initPhase (line 1731) | private function initPhase($token)
    method rootElementPhase (line 1786) | private function rootElementPhase($token)
    method mainPhase (line 1836) | private function mainPhase($token)
    method beforeHead (line 1917) | private function beforeHead($token)
    method inHead (line 1978) | private function inHead($token)
    method afterHead (line 2113) | private function afterHead($token)
    method inBody (line 2176) | private function inBody($token)
    method inTable (line 3316) | private function inTable($token)
    method inCaption (line 3528) | private function inCaption($token)
    method inColumnGroup (line 3623) | private function inColumnGroup($token)
    method inTableBody (line 3685) | private function inTableBody($token)
    method inRow (line 3784) | private function inRow($token)
    method inCell (line 3882) | private function inCell($token)
    method inSelect (line 4021) | private function inSelect($token)
    method afterBody (line 4202) | private function afterBody($token)
    method inFrameset (line 4243) | private function inFrameset($token)
    method afterFrameset (line 4312) | private function afterFrameset($token)
    method trailingEndPhase (line 4351) | private function trailingEndPhase($token)
    method insertElement (line 4394) | private function insertElement($token, $append = true, $check = false)
    method insertText (line 4423) | private function insertText($data)
    method insertComment (line 4429) | private function insertComment($data)
    method appendToRealParent (line 4435) | private function appendToRealParent($node)
    method elementInScope (line 4466) | private function elementInScope($el, $table = false)
    method reconstructActiveFormattingElements (line 4526) | private function reconstructActiveFormattingElements()
    method clearTheActiveFormattingElementsUpToTheLastMarker (line 4598) | private function clearTheActiveFormattingElementsUpToTheLastMarker()
    method generateImpliedEndTags (line 4620) | private function generateImpliedEndTags($exclude = array())
    method getElementCategory (line 4635) | private function getElementCategory($node)
    method clearStackToTableContext (line 4649) | private function clearStackToTableContext($elements)
    method resetInsertionMode (line 4667) | private function resetInsertionMode()
    method closeCell (line 4766) | private function closeCell()
    method save (line 4784) | public function save()

FILE: lib/purifier/standalone/HTMLPurifier/Printer.php
  class HTMLPurifier_Printer (line 6) | class HTMLPurifier_Printer
    method __construct (line 24) | public function __construct()
    method prepareGenerator (line 32) | public function prepareGenerator($config)
    method start (line 51) | protected function start($tag, $attr = array())
    method end (line 63) | protected function end($tag)
    method element (line 78) | protected function element($tag, $contents, $attr = array(), $escape =...
    method elementEmpty (line 90) | protected function elementEmpty($tag, $attr = array())
    method text (line 101) | protected function text($text)
    method row (line 114) | protected function row($name, $value)
    method escape (line 131) | protected function escape($string)
    method listify (line 144) | protected function listify($array, $polite = false)
    method getClass (line 170) | protected function getClass($obj, $sec_prefix = '')

FILE: lib/purifier/standalone/HTMLPurifier/Printer/CSSDefinition.php
  class HTMLPurifier_Printer_CSSDefinition (line 3) | class HTMLPurifier_Printer_CSSDefinition extends HTMLPurifier_Printer
    method render (line 14) | public function render($config)

FILE: lib/purifier/standalone/HTMLPurifier/Printer/ConfigForm.js
  function toggleWriteability (line 1) | function toggleWriteability(id_of_patient, checked) {

FILE: lib/purifier/standalone/HTMLPurifier/Printer/ConfigForm.php
  class HTMLPurifier_Printer_ConfigForm (line 6) | class HTMLPurifier_Printer_ConfigForm extends HTMLPurifier_Printer
    method __construct (line 40) | public function __construct(
    method setTextareaDimensions (line 59) | public function setTextareaDimensions($cols = null, $rows = null)
    method getCSS (line 72) | public static function getCSS()
    method getJavaScript (line 80) | public static function getJavaScript()
    method render (line 93) | public function render($config, $allowed = true, $render_controls = true)
    method renderNamespace (line 144) | protected function renderNamespace($ns, $directives)
  class HTMLPurifier_Printer_ConfigForm_NullDecorator (line 210) | class HTMLPurifier_Printer_ConfigForm_NullDecorator extends HTMLPurifier...
    method __construct (line 221) | public function __construct($obj)
    method render (line 235) | public function render($ns, $directive, $value, $name, $config)
  class HTMLPurifier_Printer_ConfigForm_default (line 278) | class HTMLPurifier_Printer_ConfigForm_default extends HTMLPurifier_Printer
    method render (line 298) | public function render($ns, $directive, $value, $name, $config)
  class HTMLPurifier_Printer_ConfigForm_bool (line 381) | class HTMLPurifier_Printer_ConfigForm_bool extends HTMLPurifier_Printer
    method render (line 391) | public function render($ns, $directive, $value, $name, $config)

FILE: lib/purifier/standalone/HTMLPurifier/Printer/HTMLDefinition.php
  class HTMLPurifier_Printer_HTMLDefinition (line 3) | class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
    method render (line 15) | public function render($config)
    method renderDoctype (line 38) | protected function renderDoctype()
    method renderEnvironment (line 57) | protected function renderEnvironment()
    method renderContentSets (line 103) | protected function renderContentSets()
    method renderInfo (line 122) | protected function renderInfo()
    method renderChildren (line 184) | protected function renderChildren($def)
    method listifyTagLookup (line 261) | protected function listifyTagLookup($array)
    method listifyObjectList (line 280) | protected function listifyObjectList($array)
    method listifyAttr (line 295) | protected function listifyAttr($array)
    method heavyHeader (line 314) | protected function heavyHeader($text, $num = 1)

FILE: module/blog/control.php
  class blog (line 12) | class blog extends control
    method __construct (line 20) | public function __construct()
    method index (line 32) | public function index($recTotal = 0, $recPerPage = 20, $pageID = 0)
    method create (line 49) | public function create()
    method edit (line 69) | public function edit($id)
    method view (line 91) | public function view($id)
    method delete (line 105) | public function delete($id)

FILE: module/blog/model.php
  class blogModel (line 14) | class blogModel extends model
    method getList (line 22) | public function getList($pager = null)
    method getById (line 34) | public function getById($id)
    method create (line 45) | public function create()
    method update (line 59) | public function update($articleID)
    method delete (line 73) | public function delete($id, $table = null)

FILE: module/common/model.php
  class commonModel (line 12) | class commonModel extends model
    method __construct (line 20) | public function __construct()
    method startSession (line 37) | public function startSession()
    method sendHeader (line 50) | public function sendHeader()
    method printRunInfo (line 63) | public function printRunInfo($startTime)

FILE: module/file/control.php
  class file (line 12) | class file extends control
    method ajaxUpload (line 20) | public function ajaxUpload($uid = '')
    method ajaxPasteImage (line 56) | public function ajaxPasteImage($uid = '')
    method read (line 71) | public function read($fileID)

FILE: module/file/model.php
  class fileModel (line 14) | class fileModel extends model
    method __construct (line 26) | public function __construct()
    method getById (line 41) | public function getById($fileID)
    method saveUpload (line 62) | public function saveUpload($objectType = '', $objectID = '', $extra = ...
    method getCount (line 93) | public function getCount()
    method getUpload (line 106) | public function getUpload($htmlTagName = 'files', $labelsName = 'labels')
    method getExtension (line 159) | public function getExtension($filename)
    method getSaveName (line 174) | public function getSaveName($pathName)
    method getRealPathName (line 187) | public function getRealPathName($pathName)
    method setPathName (line 203) | public function setPathName($fileID, $extension)
    method setSavePath (line 216) | public function setSavePath()
    method setWebPath (line 233) | public function setWebPath()
    method setImgSize (line 246) | public function setImgSize($content, $maxSize = 0)
    method pasteImage (line 273) | public function pasteImage($data, $uid = '')
    method compressImage (line 313) | public function compressImage($file)
    method imagecreatefrombmp (line 350) | public function imagecreatefrombmp($filename) {
    method dwordize (line 392) | private function dwordize($str)
    method checkSavePath (line 406) | public function checkSavePath()
    method updateObjectID (line 420) | public function updateObjectID($uid, $objectID, $objectType)
    method processImgURL (line 445) | public function processImgURL($data, $editorList, $uid = '')
    method replaceImgURL (line 471) | public function replaceImgURL($data, $fields)

FILE: module/index/control.php
  class index (line 12) | class index extends control
    method __construct (line 20) | public function __construct()
    method index (line 31) | public function index()

FILE: tools/chanzhi/myrouter.class.php
  class myrouter (line 3) | class myrouter extends router
    method __construct (line 5) | public function __construct($appName = 'demo', $appRoot = '')
    method sendHeader (line 15) | public function sendHeader()
    method setTplRoot (line 23) | public function setTplRoot()
    method getTplRoot (line 27) | public function getTplRoot()
    method setClientLang (line 31) | public function setClientLang($lang = '')
    method fixLangConfig (line 111) | public function fixLangConfig()
    method fixRequestURI (line 117) | public function fixRequestURI()
    method parseRequest (line 130) | public function parseRequest()
    method setControlFile (line 159) | public function setControlFile($exitIfNone = true)
    method getModulePath (line 179) | public function getModulePath($appName = '', $moduleName = '')
    method setRouteByGET (line 185) | public function setRouteByGET()
    method loadModule (line 201) | public function loadModule()
    method setParamsByPathInfo (line 206) | public function setParamsByPathInfo($defaultParams = array())
    method loadLang (line 222) | public function loadLang($moduleName, $appName = '')
    method headError (line 267) | public function headError()
    method getPathInfo (line 274) | public function getPathInfo()

FILE: tools/ranzhi/myrouter.class.php
  class myrouter (line 3) | class myrouter extends router
    method __construct (line 7) | public function __construct($appName = '', $appRoot = '')
    method setModuleRoot (line 18) | public function setModuleRoot()
    method setStaticRoot (line 23) | public function setStaticRoot()
    method setWwwRoot (line 28) | public function setWwwRoot()
    method setDataRoot (line 33) | public function setDataRoot()
    method setThemeRoot (line 38) | public function setThemeRoot()
    method getAppName (line 43) | public function getAppName()
    method getStaticRoot (line 48) | public function getStaticRoot()
    method getURI (line 53) | public function getURI($full = false)
    method loadCommon (line 63) | public function loadCommon()
    method setControlFile (line 84) | public function setControlFile($exitIfNone = true)
    method getModulePath (line 95) | public function getModulePath($appName = '', $moduleName = '')
    method getModuleExtPath (line 102) | public function getModuleExtPath($appName, $moduleName, $ext)
    method setActionExtFile (line 113) | public function setActionExtFile()
    method loadLang (line 126) | public function loadLang($moduleName, $appName = '')

FILE: tools/zentao/myrouter.class.php
  class myrouter (line 3) | class myrouter extends router
    method loadCommon (line 5) | public function loadCommon()
    method loadLang (line 31) | public function loadLang($moduleName, $appName = '')
Condensed preview — 234 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,618K chars).
[
  {
    "path": ".gitignore",
    "chars": 110,
    "preview": "config/my.php\nwww/data/\nrelease/*\ntmp/extensions/*\ntmp/log/*\ntmp/model/*\ntmp/cache/*\ntmp/extension/*\n.gitkeep\n"
  },
  {
    "path": ".htaccess",
    "chars": 748,
    "preview": "# Add support for PATH_INFO method.\n<IfModule mod_rewrite.c>\n  RewriteEngine On\n  RewriteCond %{REQUEST_FILENAME} !-d \n "
  },
  {
    "path": "Makefile",
    "chars": 1092,
    "preview": "VERSION=$(shell head -n 1 VERSION)\n\nall: zip\n\nclean:\n\trm -fr *-stamp\n\trm -fr debian/zentaophp\n\trm -fr zentaoPHP-*.tgz\n\tr"
  },
  {
    "path": "VERSION",
    "chars": 4,
    "preview": "3.0\n"
  },
  {
    "path": "config/config.php",
    "chars": 7677,
    "preview": "<?php\n/**\n * ZenTaoPHP的config文件。如果更改配置,不要直接修改该文件,复制到my.php修改相应的值。\n * The config file of zentaophp.  Don't modify this fi"
  },
  {
    "path": "config/filter.php",
    "chars": 922,
    "preview": "<?php\n$filter = new stdclass();\n$filter->rules = new stdclass();\n$filter->rules->md5        = '/^[a-z0-9]{32}$/';\n$filte"
  },
  {
    "path": "config/my.example.php",
    "chars": 1975,
    "preview": "<?php\n$config->installed    = true;  \n$config->debug        = true;  \n$config->requestType  = 'GET';\n$config->requestFix"
  },
  {
    "path": "db/blog.sql",
    "chars": 235,
    "preview": "CREATE TABLE IF NOT EXISTS `blog` (\n  `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,\n  `title` char(120) NOT NULL,\n"
  },
  {
    "path": "framework/base/control.class.php",
    "chars": 28886,
    "preview": "<?php /**\n * ZenTaoPHP的baseControl类。\n * The baseControl class file of ZenTaoPHP framework.\n *\n * @package framework\n *\n "
  },
  {
    "path": "framework/base/helper.class.php",
    "chars": 23603,
    "preview": "<?php\n/**\n * ZenTaoPHP的baseHelper类。\n * The baseHelper class file of ZenTaoPHP framework.\n *\n * @package framework\n *\n * "
  },
  {
    "path": "framework/base/model.class.php",
    "chars": 9185,
    "preview": "<?php\n/**\n * ZenTaoPHP的baseModel类。\n * The baseModel class file of ZenTaoPHP framework.\n *\n * @package framework\n *\n * Th"
  },
  {
    "path": "framework/base/router.class.php",
    "chars": 73791,
    "preview": "<?php\n/**\n * 此文件包括ZenTaoPHP框架的三个类:baseRouter, config, lang。\n * The router, config and lang class file of ZenTaoPHP frame"
  },
  {
    "path": "framework/control.class.php",
    "chars": 651,
    "preview": "<?php\n/**\n * Control类从baseControl类继承而来,每个模块的control对象从control类集成。\n * 您可以对baseControl类进行扩展,扩展的逻辑可以定义在这个文件中。\n *\n * This co"
  },
  {
    "path": "framework/helper.class.php",
    "chars": 553,
    "preview": "<?php\n/**\n * Helper类从baseHelper类继承而来,您可以在这个文件中对其进行扩展。\n * This helper class extends from the baseHelper class, and you ca"
  },
  {
    "path": "framework/model.class.php",
    "chars": 628,
    "preview": "<?php\n/**\n * model类从baseModel类继承而来,每个模块的model对象从model类集成。\n * 您可以对baseModel类进行扩展,扩展的逻辑可以定义在这个文件中。\n *\n * This model class "
  },
  {
    "path": "framework/router.class.php",
    "chars": 591,
    "preview": "<?php\n/**\n * router类从baseRouter类集成而来,您可以通过修改这个文件实现对baseRouter类的扩展。\n * The router class extend from baseRouter class, you"
  },
  {
    "path": "framework/tests/helper/.case001.expect",
    "chars": 535,
    "preview": "stdClass Object\n(\n    [a1] => 1\n    [a2] => 2\n    [a3] => stdClass Object\n        (\n            [b1] => 3\n            [b"
  },
  {
    "path": "framework/tests/helper/.case002.expect",
    "chars": 170,
    "preview": "chunsheng\nwang'chun\"sheng\nArray\n(\n    [0] => a\n    [1] => b\n    [2] => c\n)\nstdClass Object\n(\n)\nlocalhost\nchunsheng'.wang"
  },
  {
    "path": "framework/tests/helper/.case003.expect",
    "chars": 371,
    "preview": "/index/index.html\n/user/login.html\n/user/view/k1/v1/k2/v2.html\n/user/view/k1/v1/k2/v2.html\n\n/index/index.html\n/user/logi"
  },
  {
    "path": "framework/tests/helper/.case004.expect",
    "chars": 150,
    "preview": "case004.php\nhelper.class.php\nimport1.php\n\ncase004.php\nhelper.class.php\nimport1.php\n\ncase004.php\nhelper.class.php\nimport1"
  },
  {
    "path": "framework/tests/helper/case001.php",
    "chars": 770,
    "preview": "#!/usr/bin/env php\n<?php\n/**\n * 测试array2Object方法。\n *\n * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com"
  },
  {
    "path": "framework/tests/helper/case002.php",
    "chars": 1272,
    "preview": "#!/usr/bin/env php\n<?php\n/**\n * 测试setMember方法。\n *\n * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)\n "
  },
  {
    "path": "framework/tests/helper/case003.php",
    "chars": 2473,
    "preview": "#!/usr/bin/env php\n<?php\n/**\n * 测试createLink方法\n *\n * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)\n "
  },
  {
    "path": "framework/tests/helper/case004.php",
    "chars": 821,
    "preview": "#!/usr/bin/env php\n<?php\n/**\n * 测试import方法\n *\n * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)\n * @a"
  },
  {
    "path": "framework/tests/helper/import1.php",
    "chars": 333,
    "preview": "<?php\n/**\n * import方法的辅助测试文件。\n *\n * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)\n * @author      ch"
  },
  {
    "path": "framework/tests/helper/import2.php",
    "chars": 332,
    "preview": "<?php\n/**\n * import方法的辅助测试文件。\n *\n * @copyright   Copyright 2009-2010 青岛易软天创网络科技有限公司(www.cnezsoft.com)\n * @author      ch"
  },
  {
    "path": "index.php",
    "chars": 1255,
    "preview": "<?php\n/**\n * 整个应用的入口文件。\n * The router file of zentaophp.\n *\n * All request should be routed by this router.\n *\n * The au"
  },
  {
    "path": "js/my.js",
    "chars": 1685,
    "preview": "/**\n * The js file of ZenTaoPHP.\n *\n * The author disclaims copyright to this source code.  In place of\n * a legal notic"
  },
  {
    "path": "lib/base/dao/dao.class.php",
    "chars": 54913,
    "preview": "<?php\n/**\n * ZenTaoPHP的dao和sql类。\n * The dao and sql class file of ZenTaoPHP framework.\n *\n * The author disclaims copyri"
  },
  {
    "path": "lib/base/filter/filter.class.php",
    "chars": 32273,
    "preview": "<?php\n/**\n * ZenTaoPHP的验证和过滤类。\n * The validater and fixer class file of ZenTaoPHP framework.\n *\n * The author disclaims "
  },
  {
    "path": "lib/base/front/front.class.php",
    "chars": 34939,
    "preview": "<?php\n/**\n * ZenTaoPHP的前端类。\n * The front class file of ZenTaoPHP framework.\n *\n * The author disclaims copyright to this"
  },
  {
    "path": "lib/base/pager/pager.class.php",
    "chars": 15890,
    "preview": "<?php\n/**\n * ZenTaoPHP的分页类。\n * The pager class file of ZenTaoPHP framework.\n *\n * The author disclaims copyright to this"
  },
  {
    "path": "lib/dao/dao.class.php",
    "chars": 626,
    "preview": "<?php\n/**\n * ZenTaoPHP的dao和sql类。\n * The dao and sql class file of ZenTaoPHP framework.\n *\n * The author disclaims copyri"
  },
  {
    "path": "lib/filter/filter.class.php",
    "chars": 715,
    "preview": "<?php\n/**\n * ZenTaoPHP的验证和过滤类。\n * The validater and fixer class file of ZenTaoPHP framework.\n *\n * The author disclaims "
  },
  {
    "path": "lib/front/front.class.php",
    "chars": 713,
    "preview": "<?php\n/**\n * ZenTaoPHP的前端类。\n * The front class file of ZenTaoPHP framework.\n *\n * The author disclaims copyright to this"
  },
  {
    "path": "lib/mobile/mobile.class.php",
    "chars": 79279,
    "preview": "<?php\n/**\n * Mobile Detect Library\n * =====================\n *\n * Motto: \"Every business should have a mobile detection "
  },
  {
    "path": "lib/pager/pager.class.php",
    "chars": 521,
    "preview": "<?php\n/**\n * ZenTaoPHP的分页类。\n * The pager class file of ZenTaoPHP framework.\n *\n * The author disclaims copyright to this"
  },
  {
    "path": "lib/purifier/purifier.class.php",
    "chars": 677404,
    "preview": "<?php\n\n/**\n * @file\n * This file was auto-generated by generate-includes.php and includes all of\n * the core files requi"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php",
    "chars": 1325,
    "preview": "<?php\r\n\r\n/**\r\n * Converts HTMLPurifier_ConfigSchema_Interchange to our runtime\r\n * representation used to perform checks"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/Builder/Xml.php",
    "chars": 4516,
    "preview": "<?php\r\n\r\n/**\r\n * Converts HTMLPurifier_ConfigSchema_Interchange to an XML format,\r\n * which can be further processed to "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/Exception.php",
    "chars": 173,
    "preview": "<?php\r\n\r\n/**\r\n * Exceptions related to configuration schema\r\n */\r\nclass HTMLPurifier_ConfigSchema_Exception extends HTML"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/Interchange/Directive.php",
    "chars": 2058,
    "preview": "<?php\r\n\r\n/**\r\n * Interchange component class describing configuration directives.\r\n */\r\nclass HTMLPurifier_ConfigSchema_"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/Interchange/Id.php",
    "chars": 1131,
    "preview": "<?php\r\n\r\n/**\r\n * Represents a directive ID in the interchange format.\r\n */\r\nclass HTMLPurifier_ConfigSchema_Interchange_"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/Interchange.php",
    "chars": 1329,
    "preview": "<?php\r\n\r\n/**\r\n * Generic schema interchange format that can be converted to a runtime\r\n * representation (HTMLPurifier_C"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/InterchangeBuilder.php",
    "chars": 7341,
    "preview": "<?php\r\n\r\nclass HTMLPurifier_ConfigSchema_InterchangeBuilder\r\n{\r\n\r\n    /**\r\n     * Used for processing DEFAULT, nothing e"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/Validator.php",
    "chars": 8615,
    "preview": "<?php\r\n\r\n/**\r\n * Performs validations on HTMLPurifier_ConfigSchema_Interchange\r\n *\r\n * @note If you see '// handled by I"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/ValidatorAtom.php",
    "chars": 2982,
    "preview": "<?php\r\n\r\n/**\r\n * Fluent interface for validating the contents of member variables.\r\n * This should be immutable. See HTM"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt",
    "chars": 230,
    "preview": "Attr.AllowedClasses\r\nTYPE: lookup/null\r\nVERSION: 4.0.0\r\nDEFAULT: null\r\n--DESCRIPTION--\r\nList of allowed class values in "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt",
    "chars": 590,
    "preview": "Attr.AllowedFrameTargets\r\nTYPE: lookup\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\nLookup table of all allowed link frame target"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt",
    "chars": 297,
    "preview": "Attr.AllowedRel\r\nTYPE: lookup\r\nVERSION: 1.6.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\nList of allowed forward document relat"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt",
    "chars": 264,
    "preview": "Attr.AllowedRev\r\nTYPE: lookup\r\nVERSION: 1.6.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\nList of allowed reverse document relat"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt",
    "chars": 945,
    "preview": "Attr.ClassUseCDATA\r\nTYPE: bool/null\r\nDEFAULT: null\r\nVERSION: 4.0.0\r\n--DESCRIPTION--\r\nIf null, class will auto-detect the"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt",
    "chars": 490,
    "preview": "Attr.DefaultImageAlt\r\nTYPE: string/null\r\nDEFAULT: null\r\nVERSION: 3.2.0\r\n--DESCRIPTION--\r\nThis is the content of the alt "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt",
    "chars": 329,
    "preview": "Attr.DefaultInvalidImage\r\nTYPE: string\r\nDEFAULT: ''\r\n--DESCRIPTION--\r\nThis is the default image an img tag will be point"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt",
    "chars": 309,
    "preview": "Attr.DefaultInvalidImageAlt\r\nTYPE: string\r\nDEFAULT: 'Invalid image'\r\n--DESCRIPTION--\r\nThis is the content of the alt tag"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt",
    "chars": 304,
    "preview": "Attr.DefaultTextDir\r\nTYPE: string\r\nDEFAULT: 'ltr'\r\n--DESCRIPTION--\r\nDefines the default text direction (ltr or rtl) of t"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt",
    "chars": 661,
    "preview": "Attr.EnableID\r\nTYPE: bool\r\nDEFAULT: false\r\nVERSION: 1.2.0\r\n--DESCRIPTION--\r\nAllows the ID attribute in HTML.  This is di"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt",
    "chars": 270,
    "preview": "Attr.ForbiddenClasses\r\nTYPE: lookup\r\nVERSION: 4.0.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\nList of forbidden class values i"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt",
    "chars": 128,
    "preview": "Attr.IDBlacklist\r\nTYPE: list\r\nDEFAULT: array()\r\nDESCRIPTION: Array of IDs not allowed in the document.\r\n--# vim: et sw=4"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt",
    "chars": 326,
    "preview": "Attr.IDBlacklistRegexp\r\nTYPE: string/null\r\nVERSION: 1.6.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\nPCRE regular expression to be"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt",
    "chars": 487,
    "preview": "Attr.IDPrefix\r\nTYPE: string\r\nVERSION: 1.2.0\r\nDEFAULT: ''\r\n--DESCRIPTION--\r\nString to prefix to IDs.  If you have no idea"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt",
    "chars": 674,
    "preview": "Attr.IDPrefixLocal\r\nTYPE: string\r\nVERSION: 1.2.0\r\nDEFAULT: ''\r\n--DESCRIPTION--\r\nTemporary prefix for IDs used in conjunc"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt",
    "chars": 1169,
    "preview": "AutoFormat.AutoParagraph\r\nTYPE: bool\r\nVERSION: 2.0.1\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n\r\n<p>\r\n  This directive turns on "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt",
    "chars": 313,
    "preview": "AutoFormat.Custom\r\nTYPE: list\r\nVERSION: 2.0.1\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\n\r\n<p>\r\n  This directive can be used to"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt",
    "chars": 328,
    "preview": "AutoFormat.DisplayLinkURI\r\nTYPE: bool\r\nVERSION: 3.2.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n  This directive turns on t"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt",
    "chars": 279,
    "preview": "AutoFormat.Linkify\r\nTYPE: bool\r\nVERSION: 2.0.1\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n\r\n<p>\r\n  This directive turns on linkif"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt",
    "chars": 338,
    "preview": "AutoFormat.PurifierLinkify.DocURL\r\nTYPE: string\r\nVERSION: 2.0.1\r\nDEFAULT: '#%s'\r\nALIASES: AutoFormatParam.PurifierLinkif"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt",
    "chars": 320,
    "preview": "AutoFormat.PurifierLinkify\r\nTYPE: bool\r\nVERSION: 2.0.1\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n\r\n<p>\r\n  Internal auto-formatte"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt",
    "chars": 375,
    "preview": "AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions\r\nTYPE: lookup\r\nVERSION: 4.0.0\r\nDEFAULT: array('td' => true, 'th' => true)\r\n"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt",
    "chars": 464,
    "preview": "AutoFormat.RemoveEmpty.RemoveNbsp\r\nTYPE: bool\r\nVERSION: 4.0.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n  When enabled, HTM"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt",
    "chars": 1820,
    "preview": "AutoFormat.RemoveEmpty\r\nTYPE: bool\r\nVERSION: 3.2.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n  When enabled, HTML Purifier "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt",
    "chars": 306,
    "preview": "AutoFormat.RemoveSpansWithoutAttributes\r\nTYPE: bool\r\nVERSION: 4.0.1\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n  This direct"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt",
    "chars": 244,
    "preview": "CSS.AllowImportant\r\nTYPE: bool\r\nDEFAULT: false\r\nVERSION: 3.1.0\r\n--DESCRIPTION--\r\nThis parameter determines whether or no"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt",
    "chars": 472,
    "preview": "CSS.AllowTricky\r\nTYPE: bool\r\nDEFAULT: false\r\nVERSION: 3.1.0\r\n--DESCRIPTION--\r\nThis parameter determines whether or not t"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt",
    "chars": 363,
    "preview": "CSS.AllowedFonts\r\nTYPE: lookup/null\r\nVERSION: 4.3.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n<p>\r\n    Allows you to manually spe"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt",
    "chars": 626,
    "preview": "CSS.AllowedProperties\r\nTYPE: lookup/null\r\nVERSION: 3.1.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    If HTML Purifier's "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt",
    "chars": 207,
    "preview": "CSS.DefinitionRev\r\nTYPE: int\r\nVERSION: 2.0.0\r\nDEFAULT: 1\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Revision identifier for your custo"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt",
    "chars": 476,
    "preview": "CSS.ForbiddenProperties\r\nTYPE: lookup\r\nVERSION: 4.2.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\n<p>\r\n    This is the logical i"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt",
    "chars": 639,
    "preview": "CSS.MaxImgLength\r\nTYPE: string/null\r\nDEFAULT: '1200px'\r\nVERSION: 3.1.1\r\n--DESCRIPTION--\r\n<p>\r\n This parameter sets the m"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt",
    "chars": 174,
    "preview": "CSS.Proprietary\r\nTYPE: bool\r\nVERSION: 3.0.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Whether or not to allow safe, p"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt",
    "chars": 260,
    "preview": "CSS.Trusted\r\nTYPE: bool\r\nVERSION: 4.2.1\r\nDEFAULT: false\r\n--DESCRIPTION--\r\nIndicates whether or not the user's CSS input "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt",
    "chars": 388,
    "preview": "Cache.DefinitionImpl\r\nTYPE: string/null\r\nVERSION: 2.0.0\r\nDEFAULT: 'Serializer'\r\n--DESCRIPTION--\r\n\r\nThis directive define"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt",
    "chars": 343,
    "preview": "Cache.SerializerPath\r\nTYPE: string/null\r\nVERSION: 2.0.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Absolute path with n"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt",
    "chars": 265,
    "preview": "Cache.SerializerPermissions\r\nTYPE: int\r\nVERSION: 4.3.0\r\nDEFAULT: 0755\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Directory permissions"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt",
    "chars": 680,
    "preview": "Core.AggressivelyFixLt\r\nTYPE: bool\r\nVERSION: 2.1.0\r\nDEFAULT: true\r\n--DESCRIPTION--\r\n<p>\r\n    This directive enables aggr"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt",
    "chars": 591,
    "preview": "Core.AllowHostnameUnderscore\r\nTYPE: bool\r\nVERSION: 4.6.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n    By RFC 1123, undersc"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt",
    "chars": 445,
    "preview": "Core.CollectErrors\r\nTYPE: bool\r\nVERSION: 2.0.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n\r\nWhether or not to collect errors foun"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt",
    "chars": 729,
    "preview": "Core.ColorKeywords\r\nTYPE: hash\r\nVERSION: 2.0.0\r\n--DEFAULT--\r\narray (\r\n  'maroon' => '#800000',\r\n  'red' => '#FF0000',\r\n "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt",
    "chars": 447,
    "preview": "Core.ConvertDocumentToFragment\r\nTYPE: bool\r\nDEFAULT: true\r\n--DESCRIPTION--\r\n\r\nThis parameter determines whether or not t"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt",
    "chars": 649,
    "preview": "Core.DirectLexLineNumberSyncInterval\r\nTYPE: int\r\nVERSION: 2.0.0\r\nDEFAULT: 0\r\n--DESCRIPTION--\r\n\r\n<p>\r\n  Specifies the num"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt",
    "chars": 472,
    "preview": "Core.DisableExcludes\r\nTYPE: bool\r\nDEFAULT: false\r\nVERSION: 4.5.0\r\n--DESCRIPTION--\r\n<p>\r\n  This directive disables SGML-s"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt",
    "chars": 312,
    "preview": "Core.EnableIDNA\r\nTYPE: bool\r\nDEFAULT: false\r\nVERSION: 4.4.0\r\n--DESCRIPTION--\r\nAllows international domain names in URLs."
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt",
    "chars": 782,
    "preview": "Core.Encoding\r\nTYPE: istring\r\nDEFAULT: 'utf-8'\r\n--DESCRIPTION--\r\nIf for some reason you are unable to convert all webpag"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt",
    "chars": 515,
    "preview": "Core.EscapeInvalidChildren\r\nTYPE: bool\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p><strong>Warning:</strong> this configuration"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt",
    "chars": 209,
    "preview": "Core.EscapeInvalidTags\r\nTYPE: bool\r\nDEFAULT: false\r\n--DESCRIPTION--\r\nWhen true, invalid tags will be written back to the"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt",
    "chars": 580,
    "preview": "Core.EscapeNonASCIICharacters\r\nTYPE: bool\r\nVERSION: 1.4.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\nThis directive overcomes a d"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt",
    "chars": 594,
    "preview": "Core.HiddenElements\r\nTYPE: lookup\r\n--DEFAULT--\r\narray (\r\n  'script' => true,\r\n  'style' => true,\r\n)\r\n--DESCRIPTION--\r\n\r\n"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.Language.txt",
    "chars": 302,
    "preview": "Core.Language\r\nTYPE: string\r\nVERSION: 2.0.0\r\nDEFAULT: 'en'\r\n--DESCRIPTION--\r\n\r\nISO 639 language code for localizable thi"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt",
    "chars": 1078,
    "preview": "Core.LexerImpl\r\nTYPE: mixed/null\r\nVERSION: 2.0.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n  This parameter determines wha"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt",
    "chars": 572,
    "preview": "Core.MaintainLineNumbers\r\nTYPE: bool/null\r\nVERSION: 2.0.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n  If true, HTML Purifi"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt",
    "chars": 290,
    "preview": "Core.NormalizeNewlines\r\nTYPE: bool\r\nVERSION: 4.2.0\r\nDEFAULT: true\r\n--DESCRIPTION--\r\n<p>\r\n    Whether or not to normalize"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt",
    "chars": 346,
    "preview": "Core.RemoveInvalidImg\r\nTYPE: bool\r\nDEFAULT: true\r\nVERSION: 1.3.0\r\n--DESCRIPTION--\r\n\r\n<p>\r\n  This directive enables pre-e"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt",
    "chars": 409,
    "preview": "Core.RemoveProcessingInstructions\r\nTYPE: bool\r\nVERSION: 4.2.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\nInstead of escaping proc"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt",
    "chars": 292,
    "preview": "Core.RemoveScriptContents\r\nTYPE: bool/null\r\nDEFAULT: NULL\r\nVERSION: 2.0.0\r\nDEPRECATED-VERSION: 2.1.0\r\nDEPRECATED-USE: Co"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt",
    "chars": 318,
    "preview": "Filter.Custom\r\nTYPE: list\r\nVERSION: 3.1.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\n<p>\r\n  This directive can be used to add c"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt",
    "chars": 499,
    "preview": "Filter.ExtractStyleBlocks.Escaping\r\nTYPE: bool\r\nVERSION: 3.0.0\r\nDEFAULT: true\r\nALIASES: Filter.ExtractStyleBlocksEscapin"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt",
    "chars": 1229,
    "preview": "Filter.ExtractStyleBlocks.Scope\r\nTYPE: string/null\r\nVERSION: 3.0.0\r\nDEFAULT: NULL\r\nALIASES: Filter.ExtractStyleBlocksSco"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt",
    "chars": 592,
    "preview": "Filter.ExtractStyleBlocks.TidyImpl\r\nTYPE: mixed/null\r\nVERSION: 3.1.0\r\nDEFAULT: NULL\r\nALIASES: FilterParam.ExtractStyleBl"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt",
    "chars": 2832,
    "preview": "Filter.ExtractStyleBlocks\r\nTYPE: bool\r\nVERSION: 3.1.0\r\nDEFAULT: false\r\nEXTERNAL: CSSTidy\r\n--DESCRIPTION--\r\n<p>\r\n  This d"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt",
    "chars": 511,
    "preview": "Filter.YouTube\r\nTYPE: bool\r\nVERSION: 3.1.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n  <strong>Warning:</strong> Deprecated"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt",
    "chars": 1021,
    "preview": "HTML.Allowed\r\nTYPE: itext/null\r\nVERSION: 2.0.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    This is a preferred convenien"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt",
    "chars": 626,
    "preview": "HTML.AllowedAttributes\r\nTYPE: lookup/null\r\nVERSION: 1.3.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    If HTML Purifier's"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt",
    "chars": 377,
    "preview": "HTML.AllowedComments\r\nTYPE: lookup\r\nVERSION: 4.4.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\nA whitelist which indicates what "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt",
    "chars": 726,
    "preview": "HTML.AllowedCommentsRegexp\r\nTYPE: string/null\r\nVERSION: 4.4.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\nA regexp, which if it mat"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt",
    "chars": 905,
    "preview": "HTML.AllowedElements\r\nTYPE: lookup/null\r\nVERSION: 1.3.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n<p>\r\n    If HTML Purifier's tag"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt",
    "chars": 746,
    "preview": "HTML.AllowedModules\r\nTYPE: lookup/null\r\nVERSION: 2.0.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    A doctype comes with "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt",
    "chars": 482,
    "preview": "HTML.Attr.Name.UseCDATA\r\nTYPE: bool\r\nDEFAULT: false\r\nVERSION: 4.0.0\r\n--DESCRIPTION--\r\nThe W3C specification DTD defines "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt",
    "chars": 589,
    "preview": "HTML.BlockWrapper\r\nTYPE: string\r\nVERSION: 1.3.0\r\nDEFAULT: 'p'\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    String name of element to wra"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt",
    "chars": 645,
    "preview": "HTML.CoreModules\r\nTYPE: lookup\r\nVERSION: 2.0.0\r\n--DEFAULT--\r\narray (\r\n  'Structure' => true,\r\n  'Text' => true,\r\n  'Hype"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt",
    "chars": 242,
    "preview": "HTML.CustomDoctype\r\nTYPE: string/null\r\nVERSION: 2.0.1\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\nA custom doctype for power-user"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt",
    "chars": 1243,
    "preview": "HTML.DefinitionID\r\nTYPE: string/null\r\nDEFAULT: NULL\r\nVERSION: 2.0.0\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Unique identifier for a"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt",
    "chars": 549,
    "preview": "HTML.DefinitionRev\r\nTYPE: int\r\nVERSION: 2.0.0\r\nDEFAULT: 1\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Revision identifier for your cust"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt",
    "chars": 484,
    "preview": "HTML.Doctype\r\nTYPE: string/null\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\nDoctype to use during filtering. Technically speaking t"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt",
    "chars": 298,
    "preview": "HTML.FlashAllowFullScreen\r\nTYPE: bool\r\nVERSION: 4.2.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n    Whether or not to permi"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt",
    "chars": 873,
    "preview": "HTML.ForbiddenAttributes\r\nTYPE: lookup\r\nVERSION: 3.1.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\n<p>\r\n    While this directive"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt",
    "chars": 774,
    "preview": "HTML.ForbiddenElements\r\nTYPE: lookup\r\nVERSION: 3.1.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\n<p>\r\n    This was, perhaps, the"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt",
    "chars": 504,
    "preview": "HTML.MaxImgLength\r\nTYPE: int/null\r\nDEFAULT: 1200\r\nVERSION: 3.1.1\r\n--DESCRIPTION--\r\n<p>\r\n This directive controls the max"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt",
    "chars": 170,
    "preview": "HTML.Nofollow\r\nTYPE: bool\r\nVERSION: 4.3.0\r\nDEFAULT: FALSE\r\n--DESCRIPTION--\r\nIf enabled, nofollow rel attributes are adde"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt",
    "chars": 326,
    "preview": "HTML.Parent\r\nTYPE: string\r\nVERSION: 1.3.0\r\nDEFAULT: 'div'\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    String name of element that HTML "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt",
    "chars": 346,
    "preview": "HTML.Proprietary\r\nTYPE: bool\r\nVERSION: 3.1.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n    Whether or not to allow propriet"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt",
    "chars": 496,
    "preview": "HTML.SafeEmbed\r\nTYPE: bool\r\nVERSION: 3.1.1\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n    Whether or not to permit embed tag"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt",
    "chars": 411,
    "preview": "HTML.SafeIframe\r\nTYPE: bool\r\nVERSION: 4.4.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n    Whether or not to permit iframe t"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt",
    "chars": 454,
    "preview": "HTML.SafeObject\r\nTYPE: bool\r\nVERSION: 3.1.1\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n    Whether or not to permit object t"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt",
    "chars": 283,
    "preview": "HTML.SafeScripting\r\nTYPE: lookup\r\nVERSION: 4.5.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\n<p>\r\n    Whether or not to permit s"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt",
    "chars": 230,
    "preview": "HTML.Strict\r\nTYPE: bool\r\nVERSION: 1.3.0\r\nDEFAULT: false\r\nDEPRECATED-VERSION: 1.7.0\r\nDEPRECATED-USE: HTML.Doctype\r\n--DESC"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt",
    "chars": 261,
    "preview": "HTML.TargetBlank\r\nTYPE: bool\r\nVERSION: 4.4.0\r\nDEFAULT: FALSE\r\n--DESCRIPTION--\r\nIf enabled, <code>target=blank</code> att"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt",
    "chars": 171,
    "preview": "HTML.TidyAdd\r\nTYPE: lookup\r\nVERSION: 2.0.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\n\r\nFixes to add to the default set of Tidy"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt",
    "chars": 644,
    "preview": "HTML.TidyLevel\r\nTYPE: string\r\nVERSION: 2.0.0\r\nDEFAULT: 'medium'\r\n--DESCRIPTION--\r\n\r\n<p>General level of cleanliness the "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt",
    "chars": 179,
    "preview": "HTML.TidyRemove\r\nTYPE: lookup\r\nVERSION: 2.0.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\n\r\nFixes to remove from the default set"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt",
    "chars": 275,
    "preview": "HTML.Trusted\r\nTYPE: bool\r\nVERSION: 2.0.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\nIndicates whether or not the user input is tr"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt",
    "chars": 246,
    "preview": "HTML.XHTML\r\nTYPE: bool\r\nDEFAULT: true\r\nVERSION: 1.1.0\r\nDEPRECATED-VERSION: 1.7.0\r\nDEPRECATED-USE: HTML.Doctype\r\n--DESCRI"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt",
    "chars": 285,
    "preview": "Output.CommentScriptContents\r\nTYPE: bool\r\nVERSION: 2.0.0\r\nDEFAULT: true\r\n--DESCRIPTION--\r\nDetermines whether or not HTML"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt",
    "chars": 558,
    "preview": "Output.FixInnerHTML\r\nTYPE: bool\r\nVERSION: 4.3.0\r\nDEFAULT: true\r\n--DESCRIPTION--\r\n<p>\r\n  If true, HTML Purifier will prot"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt",
    "chars": 280,
    "preview": "Output.FlashCompat\r\nTYPE: bool\r\nVERSION: 4.1.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n  If true, HTML Purifier will gene"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt",
    "chars": 371,
    "preview": "Output.Newline\r\nTYPE: string/null\r\nVERSION: 2.0.1\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Newline string to format f"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt",
    "chars": 523,
    "preview": "Output.SortAttr\r\nTYPE: bool\r\nVERSION: 3.2.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n  If true, HTML Purifier will sort at"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt",
    "chars": 852,
    "preview": "Output.TidyFormat\r\nTYPE: bool\r\nVERSION: 1.1.1\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n    Determines whether or not to ru"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt",
    "chars": 204,
    "preview": "Test.ForceNoIconv\r\nTYPE: bool\r\nDEFAULT: false\r\n--DESCRIPTION--\r\nWhen set to true, HTMLPurifier_Encoder will act as if ic"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt",
    "chars": 485,
    "preview": "URI.AllowedSchemes\r\nTYPE: lookup\r\n--DEFAULT--\r\narray (\r\n  'http' => true,\r\n  'https' => true,\r\n  'mailto' => true,\r\n  'f"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.Base.txt",
    "chars": 671,
    "preview": "URI.Base\r\nTYPE: string/null\r\nVERSION: 2.1.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    The base URI is the URI of the d"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt",
    "chars": 255,
    "preview": "URI.DefaultScheme\r\nTYPE: string\r\nDEFAULT: 'http'\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Defines through what scheme the output wil"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt",
    "chars": 253,
    "preview": "URI.DefinitionID\r\nTYPE: string/null\r\nVERSION: 2.1.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Unique identifier for a "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt",
    "chars": 207,
    "preview": "URI.DefinitionRev\r\nTYPE: int\r\nVERSION: 2.1.0\r\nDEFAULT: 1\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Revision identifier for your custo"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt",
    "chars": 286,
    "preview": "URI.Disable\r\nTYPE: bool\r\nVERSION: 1.3.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Disables all URIs in all forms. Not"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt",
    "chars": 454,
    "preview": "URI.DisableExternal\r\nTYPE: bool\r\nVERSION: 1.2.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\nDisables links to external websites.  "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt",
    "chars": 562,
    "preview": "URI.DisableExternalResources\r\nTYPE: bool\r\nVERSION: 1.3.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\nDisables the embedding of ext"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt",
    "chars": 442,
    "preview": "URI.DisableResources\r\nTYPE: bool\r\nVERSION: 4.2.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n    Disables embedding resources"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.Host.txt",
    "chars": 837,
    "preview": "URI.Host\r\nTYPE: string/null\r\nVERSION: 1.2.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Defines the domain name of the s"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt",
    "chars": 319,
    "preview": "URI.HostBlacklist\r\nTYPE: list\r\nVERSION: 1.3.0\r\nDEFAULT: array()\r\n--DESCRIPTION--\r\nList of strings that are forbidden in "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt",
    "chars": 403,
    "preview": "URI.MakeAbsolute\r\nTYPE: bool\r\nVERSION: 2.1.0\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Converts all URIs into absolut"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt",
    "chars": 2842,
    "preview": "URI.Munge\r\nTYPE: string/null\r\nVERSION: 1.3.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n\r\n<p>\r\n    Munges all browsable (usually h"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt",
    "chars": 628,
    "preview": "URI.MungeResources\r\nTYPE: bool\r\nVERSION: 3.1.1\r\nDEFAULT: false\r\n--DESCRIPTION--\r\n<p>\r\n    If true, any URI munging direc"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt",
    "chars": 1008,
    "preview": "URI.MungeSecretKey\r\nTYPE: string/null\r\nVERSION: 3.1.1\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n<p>\r\n    This directive enables s"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt",
    "chars": 335,
    "preview": "URI.OverrideAllowedSchemes\r\nTYPE: bool\r\nDEFAULT: true\r\n--DESCRIPTION--\r\nIf this is set to true (which it is by default),"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt",
    "chars": 919,
    "preview": "URI.SafeIframeRegexp\r\nTYPE: string/null\r\nVERSION: 4.4.0\r\nDEFAULT: NULL\r\n--DESCRIPTION--\r\n<p>\r\n    A PCRE regular express"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/ConfigSchema/schema/info.ini",
    "chars": 48,
    "preview": "name = \"HTML Purifier\"\r\n\r\n; vim: et sw=4 sts=4\r\n"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/EntityLookup/entities.ser",
    "chars": 4971,
    "preview": "a:253:{s:4:\"fnof\";s:2:\"ƒ\";s:5:\"Alpha\";s:2:\"Α\";s:4:\"Beta\";s:2:\"Β\";s:5:\"Gamma\";s:2:\"Γ\";s:5:\"Delta\";s:2:\"Δ\";s:7:\"Epsilon\";s"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Filter/ExtractStyleBlocks.php",
    "chars": 13781,
    "preview": "<?php\r\n\r\n// why is this a top level function? Because PHP 5.2.0 doesn't seem to\r\n// understand how to interpret this fil"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Filter/YouTube.php",
    "chars": 2638,
    "preview": "<?php\r\n/**\r\n * change log.\r\n * Fix for chanzhi. 20150713 chujilu@cnezsoft.com\r\n *\r\n */\r\nclass HTMLPurifier_Filter_YouTub"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Language/classes/en-x-test.php",
    "chars": 146,
    "preview": "<?php\r\n\r\n// private class for unit testing\r\n\r\nclass HTMLPurifier_Language_en_x_test extends HTMLPurifier_Language\r\n{\r\n}\r"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Language/messages/en-x-test.php",
    "chars": 182,
    "preview": "<?php\r\n\r\n// private language message file for unit testing purposes\r\n\r\n$fallback = 'en';\r\n\r\n$messages = array(\r\n    'HTM"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Language/messages/en-x-testmini.php",
    "chars": 241,
    "preview": "<?php\r\n\r\n// private language message file for unit testing purposes\r\n// this language file has no class associated with "
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Language/messages/en.php",
    "chars": 4103,
    "preview": "<?php\r\n\r\n$fallback = false;\r\n\r\n$messages = array(\r\n\r\n    'HTMLPurifier' => 'HTML Purifier',\r\n// for unit testing purpose"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Lexer/PH5P.php",
    "chars": 187395,
    "preview": "<?php\r\n\r\n/**\r\n * Experimental HTML5-based parser using Jeroen van der Meer's PH5P library.\r\n * Occupies space in the HTM"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Printer/CSSDefinition.php",
    "chars": 1238,
    "preview": "<?php\r\n\r\nclass HTMLPurifier_Printer_CSSDefinition extends HTMLPurifier_Printer\r\n{\r\n    /**\r\n     * @type HTMLPurifier_CS"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Printer/ConfigForm.css",
    "chars": 311,
    "preview": "\r\n.hp-config {}\r\n\r\n.hp-config tbody th {text-align:right; padding-right:0.5em;}\r\n.hp-config thead, .hp-config .namespace"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Printer/ConfigForm.js",
    "chars": 147,
    "preview": "function toggleWriteability(id_of_patient, checked) {\r\n    document.getElementById(id_of_patient).disabled = checked;\r\n}"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Printer/ConfigForm.php",
    "chars": 15105,
    "preview": "<?php\r\n\r\n/**\r\n * @todo Rewrite to use Interchange objects\r\n */\r\nclass HTMLPurifier_Printer_ConfigForm extends HTMLPurifi"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Printer/HTMLDefinition.php",
    "chars": 10815,
    "preview": "<?php\r\n\r\nclass HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer\r\n{\r\n\r\n    /**\r\n     * @type HTMLPurifier"
  },
  {
    "path": "lib/purifier/standalone/HTMLPurifier/Printer.php",
    "chars": 6115,
    "preview": "<?php\r\n\r\n// OUT OF DATE, NEEDS UPDATING!\r\n// USE XMLWRITER!\r\n\r\nclass HTMLPurifier_Printer\r\n{\r\n\r\n    /**\r\n     * For HTML"
  },
  {
    "path": "module/blog/control.php",
    "chars": 2613,
    "preview": "<?php\r\n/**\r\n * The control file of blog module of ZenTaoPHP.\r\n *\r\n * The author disclaims copyright to this source code."
  },
  {
    "path": "module/blog/css/common.css",
    "chars": 140,
    "preview": ".container > .panel {margin:0 -10px;}\n.table-form th{vertical-align:middle; text-align:right;}\n.table-form td, .table-fo"
  },
  {
    "path": "module/blog/lang/en.php",
    "chars": 697,
    "preview": "<?php\r\n/**\r\n * The blog module english file of ZenTaoPHP.\r\n *\r\n * The author disclaims copyright to this source code.  I"
  },
  {
    "path": "module/blog/lang/zh-cn.php",
    "chars": 682,
    "preview": "<?php\r\n/**\r\n * The blog module simplified chinese file of ZenTaoPHP.\r\n *\r\n * The author disclaims copyright to this sour"
  },
  {
    "path": "module/blog/model.php",
    "chars": 1964,
    "preview": "<?php\r\n/**\r\n * The model file of blog module of ZenTaoPHP.\r\n *\r\n * The author disclaims copyright to this source code.  "
  },
  {
    "path": "module/blog/view/create.html.php",
    "chars": 1207,
    "preview": "<?php\r\n/**\r\n * The html template file of add method of blog module of ZenTaoPHP.\r\n *\r\n * The author disclaims copyright "
  },
  {
    "path": "module/blog/view/edit.html.php",
    "chars": 1224,
    "preview": "<?php\r\n/**\r\n * The html template file of edit method of blog module of ZenTaoPHP.\r\n *\r\n * The author disclaims copyright"
  },
  {
    "path": "module/blog/view/index.html.php",
    "chars": 1985,
    "preview": "<?php\r\n/**\r\n * The html template file of index method of blog module of ZenTaoPHP.\r\n *\r\n * The author disclaims copyrigh"
  },
  {
    "path": "module/blog/view/view.html.php",
    "chars": 764,
    "preview": "<?php\r\n/**\r\n * The html template file of view method of blog module of ZenTaoPHP.\r\n *\r\n * The author disclaims copyright"
  },
  {
    "path": "module/common/lang/en.php",
    "chars": 2533,
    "preview": "<?php\r\n/**\r\n * The common english language file of ZenTaoPHP.\r\n *\r\n * The author disclaims copyright to this source code"
  },
  {
    "path": "module/common/lang/zh-cn.php",
    "chars": 2271,
    "preview": "<?php\r\n/**\r\n * The common simplified chinese file of zentaoPHP.\r\n *\r\n * The author disclaims copyright to this source co"
  },
  {
    "path": "module/common/model.php",
    "chars": 1748,
    "preview": "<?php\n/**\n * The model file of common module of ZenTaoPHP.\n *\n * The author disclaims copyright to this source code.  In"
  },
  {
    "path": "module/common/view/footer.html.php",
    "chars": 139,
    "preview": "<?php if(isset($pageJS)) js::execute($pageJS);?>\n<?php if($this->server->HTTP_X_PJAX == false):?>\n  </div>\n</body>\n</htm"
  },
  {
    "path": "module/common/view/header.html.php",
    "chars": 789,
    "preview": "<?php\n$webRoot = $this->app->getWebRoot();\n$jsRoot  = $webRoot . 'js/';\n?>\n<!DOCTYPE html>\n<html lang='en'>\n<head>\n <?ph"
  },
  {
    "path": "module/common/view/nav.html.php",
    "chars": 1407,
    "preview": "<div id='header' class='bg-primary with-shadow'>\n<div class='container navbar navbar-default' role=\"navigation\">\n  <div "
  },
  {
    "path": "module/file/config.php",
    "chars": 429,
    "preview": "<?php\n$config->file->mimes['xml']     = 'text/xml';\n$config->file->mimes['html']    = 'text/html';\n$config->file->mimes["
  },
  {
    "path": "module/file/control.php",
    "chars": 2833,
    "preview": "<?php\n/**\n * The control file of file module of ZenTaoPMS.\n *\n * @copyright   Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao"
  },
  {
    "path": "module/file/lang/en.php",
    "chars": 2601,
    "preview": "<?php\n/**\n * The file module English file of ZenTaoPMS.\n *\n * @copyright   Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Na"
  },
  {
    "path": "module/file/lang/zh-cn.php",
    "chars": 1956,
    "preview": "<?php\n/**\n * The file module zh-cn file of ZenTaoPMS.\n *\n * @copyright   Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Natu"
  },
  {
    "path": "module/file/lang/zh-tw.php",
    "chars": 1956,
    "preview": "<?php\n/**\n * The file module zh-tw file of ZenTaoPMS.\n *\n * @copyright   Copyright 2009-2015 青島易軟天創網絡科技有限公司(QingDao Natu"
  }
]

// ... and 34 more files (download for full content)

About this extraction

This page contains the full source code of the easysoft/zentaophp GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 234 files (1.4 MB), approximately 388.1k tokens, and a symbol index with 1487 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!