惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LangChain Blog
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
Y
Y Combinator Blog
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
Application and Cybersecurity Blog
Application and Cybersecurity Blog
NISL@THU
NISL@THU
aimingoo的专栏
aimingoo的专栏
T
Tor Project blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Cisco Talos Blog
Cisco Talos Blog
A
Arctic Wolf
T
Troy Hunt's Blog
U
Unit 42
Forbes - Security
Forbes - Security
J
Java Code Geeks
P
Privacy International News Feed
W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
S
Schneier on Security
H
Heimdal Security Blog
量子位
Martin Fowler
Martin Fowler
G
Google Developers Blog
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
Docker
罗磊的独立博客
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
Simon Willison's Weblog
Simon Willison's Weblog
N
News and Events Feed by Topic
D
DataBreaches.Net
V2EX - 技术
V2EX - 技术
AWS News Blog
AWS News Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Attack and Defense Labs
Attack and Defense Labs
S
SegmentFault 最新的问题
MongoDB | Blog
MongoDB | Blog
S
Secure Thoughts
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - 雨中流泪

Rails 命令大全 ObjectHTML Framework 0.0.9.1 for PHP 发布.欢迎试用 在学习中沉沦... 在Dom4j中使用xpath - 雨中流泪 - 博客园 Spring.Net + NHibernate 入门例子 - 雨中流泪 使用Spring 2.5 和 Hibernate 3.2 开发MVC Web程序(基于annotation特性) PHP函数收藏---不断更新中! - 雨中流泪 - 博客园 程序员的编辑器--EmEditor 自己写的一个JS组件,JCombo 0.9 - 雨中流泪 - 博客园 Enterprise Library 3.1的研究之路---Data Access Application Block(1) 发个"违法"的东西.VisualAssist X 1559破解版 自己写的Log日志记录类,支持文件和数据库,自动建立Log表格 (三)AJAXPro之旅---原理的探究 - 雨中流泪 - 博客园 (二)AJAXPro之旅---构造实际的AJAX应用. (一)AJAXPro之旅---神奇的小魔盒 Windows Live Writer 我的AJAX类的使用(一个简单的异步组件) Grove,.Net下最方便的O/R Map库 ASP.Net分页组件1.0开发下载了...
轻量的PHP开发框架--- litePhp
雨中流泪 · 2008-03-19 · via 博客园 - 雨中流泪

轻量的PHP开发框架--- litePhp

这个框架是我利用业余时间写的.轻量高效.模板,缓存等都有(模板是拿DZ的),他没有采用类和对象的复杂模式.采用函数作为主要的实现方式.

下面我们来看看这个模板的快速之路,下面是他的目录结构:


index.php是主入口文件
LitePHP目录是其核心目录.Module是程序的模块目录,Resource是模板所在地.
现在我们看看index.php的代码:

<?php
    
require('LitePHP/Lite.php');
    
define('APP_ROOT', dirname(__FILE__));
    runMVC();
    
echo '<br />program is run: '. (runTimers() * 1000. ' ms.';
?>

然后我们写模块代码:

<?php
    
function actionIndex(){
        
echo _L('aaa');//该模块的语言资源
        loadHelper('LiteDB');
        dump(query(
'select * from ice_sort'));
        
$title = '标题';
        
$body = '文本的内容';
        
include(parse_template('index'));
        logmessage(
'记录日志');
    }
    
    
function actionQQ() {
        
echo(_L('E_NOT_FILE'));//默认语言文件中的资源
    }
?>

然后我们写他的配置文件config.php

<? if(!defined('IN_LITE')) exit('Access Denied'); ?>
<?php

    
return array(
        
'actionprefix' => 'action',
        
'datasourse' => array(
            
'host' => '127.0.0.1',
            
'database' => 'icemvc',
            
'username' => 'root',
            
'password' => 'kelezyb',
            
'prefix' => 'ice',
        )
,
        
'language' => 'cn',
        
'view' => array(
            
'tplpath' => 'Resource/templates',
            
'tplcpath' => 'Resource/templates_c',
            
'isCache' => true,
            
'cacheTimer' => 360,
        )
,
        
'log' => array(
            
'logpath' => '_log',
            
'logmaxsize' => 4096,
        )
,
    );
?>

我们看看他的模块语言资源(group.i18n.php)

<?php
    
return array(
        
'aaa' => '阿斯顿嘎达公告速递公司的 啊速递公司大概阿斯顿个阿斯嘎斯大概啊三个啊三个',
    );
?>

然后打开浏览器,我们输入网址:http://127.1:8080/index.php?mod=group

再输入:http://127.1:8080/index.php?mod=group&act=QQ
其实访问的相当于group.php的actionQQ函数.

/Files/eicesoft/htdocs.zip