PHPCMS V9产品介绍
PHPCMS V9(简称V9)采用PHP5+MYSQL做为技术基础进行开发。V9采用OOP(面向对象)方式进行基础运行框架搭建。模块化开发方式做为功能开发形式。框架易于功能扩展,代码维护,优秀的二次开发能力,可满足所有网站的应用需求。
5年开发经验的优秀团队,在掌握了丰富的WEB开发经验和CMS产品开发经验的同时,勇于创新追求完美的设计理念,为全球多达10万网站提供助力,并被更多的政府机构、教育机构、事业单位、商业企业、个人站长所认可。
V9在保留2008版的特点的同时,对新版本作出重大的创新,以期待全新的PHPCMS系统服务更多的用户。
-----------------------------------①---------------------------------
-----------------------------------②---------------------------------
-----------------------------------③---------------------------------
根目录
| – api 结构文件目录
| – caches 缓存文件目录
| – configs 系统配置文件目录
| – caches_* 系统缓存目录
| – phpcms phpcms框架主目录
| – languages 框架语言包目录
| – libs 框架主类库、主函数库目录
| – model 框架数据库模型目录
| – modules 框架模块目录
| – templates 框架系统模板目录
| – phpsso_server phpsso主目录
| – statics 系统附件包
| – css 系统css包
| – images 系统图片包
| – js 系统js包
| – index.php 程序主入口
-----------------------------------④---------------------------------
<?php
define("PHPCMS_PATH',dirname(__FILE__).DIRECTORY_SEPARATOR);
include PHPCMS_PATH.'/phpcms/base.php';
pc_base::creat_app();
?>
-----------------------------------⑤---------------------------------
<?php
define("IN_PHPCMS', true);
define('PC_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
if(!defined('PHPCMS_PATH')) define('PHPCMS_PATH',
PC_PATH.'..'.DIRECTORY_SEPARATOR);
define('CACHE_PATH', PHPCMS_PATH.'caches'.DIRECTORY_SEPARATOR);
…
?>
-----------------------------------⑥---------------------------------
-----------------------------------⑦---------------------------------
-----------------------------------⑦---------------------------------
-----------------------------------⑧---------------------------------
-----------------------------------⑨---------------------------------
<?php
function new_addslashes($string){
if(!is_array($string)) return addslashes($string);
foreach($string as $key => $val) $string[$key] = new_addslashes($val);
return $string;
}
... … ... …
?>
-----------------------------------⑩---------------------------------
-----------------------------------十一---------------------------------
-----------------------------------十二---------------------------------
-----------------------------------十三---------------------------------
-----------------------------------十四---------------------------------
-----------------------------------十五---------------------------------
-----------------------------------十六---------------------------------
-----------------------------------十七---------------------------------
入口文件
pc_base::load_sys_func("global');
pc_base::load_sys_func('extention');
pc_base::auto_load_func();
pc_base::load_config('system','web_path')
pc_base:: load_sys_class($classname, $path = '', $initialize = 1)
pc_base:: load_app_class($classname, $m = '', $initialize = 1)
-----------------------------------十八---------------------------------
-----------------------------------十九---------------------------------
-----------------------------------二十---------------------------------
<?php
defined("IN_PHPCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);
class test_model extends model {
public function __construct() {
$this->db_config = pc_base::load_config('database');
$this->db_setting = ‘default';
$this->table_name = 'test';
parent::__construct();
}
}
?>
-----------------------------------二十一-------------------------------
-----------------------------------二十二-------------------------------
-----------------------------------二十三-------------------------------
<?php
defined("IN_PHPCMS') or exit('No permission resources');
class mytest
{
public function init() {
echo 'this is a init';
}
public function mylist() {
echo 'this is mylist<br>hello world';
}
}
?>
-----------------------------------二十四-------------------------------
create TABLE v9_test(
id int auto_increment primary key,
title char(20)
);
insert into v9_test values(null,"this is a test');
insert into v9_test values(null,'hello world')
-----------------------------------二十五-------------------------------
<?php
defined("IN_PHPCMS') or exit('No permission resources.');
pc_base::load_sys_class('model', '', 0);
class test_model extends model {
public function __construct() {
$this->db_config = pc_base::load_config('database');
$this->db_setting = 'default';
$this->table_name = 'test';
parent::__construct();
}
}
?>
-----------------------------------二十六-------------------------------
<?php
defined("IN_PHPCMS') or exit('No permission resources');
class mytest {
public function __construct() {
$this->db=pc_base::load_model('test_model','',1);
}
public function init() {
$arr=$this->db->select();
//var_dump($arr);
include template('test','mytest',‘default');
}
}
?>
-----------------------------------二十七-------------------------------
-----------------------------------二十八-------------------------------
1.调用数据库模型
$this->db = pc_base::load_model("test_model');
其中$this->db中所支持的方法请参照phpcms/libs/classes/model.class.php中方法
2.加载系统类 $http = pc_base::load_sys_class('http'); //实例化http类 pc_base::load_sys_class('format', '', 0);
//调用form类,不进行实例化操作3.加载系统函
3.加载系统函数库 pc_base::load_sys_func('mail');
调用mail函数包
4. 加载模块类 $test = pc_base::load_sys_class(‘classname‘,’test’);
//实例化test模块下 classname类
5.加载模块函数库 pc_base::load_sys_func(‘global‘,’test’);
调用test模块的global函数包
-----------------------------------二十九-------------------------------
6.加载前台模板
include template("test', 'mytest', 'default');
7.加载后台模板 include $this->admin_tpl('mytest_admin_list');
8.权限控制 后台控制控制器需要加载admin模块下的admin类,并继承该类
<?php
defined('IN_PHPCMS') or exit('No permission resources.');
pc_base::load_app_class('admin','admin',0);
class mytest_admin extends admin {
//这个控制器需要登录后台才可以访问
}
?>
--------------------------------------------------------------------------------------------------邓总随笔