导航

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 61 下一页

2013年10月21日

摘要: Drupal在本阶段为用户设置缓存头信息。Drupal不为验证用户缓存页面,每次请求时都是从新读取的。function _drupal_bootstrap_page_header() { bootstrap_invoke_all('boot'); // 调用boot钩子, 只是启动模块 if (!drupal_is_cli()) { ob_start(); drupal_page_header(); }}function drupal_page_header() { $headers_sent = &drupal_static(__FUNCTION__, FALSE); 阅读全文

posted @ 2013-10-21 11:51 eastson 阅读(324) 评论(0) 推荐(0) 编辑

2013年10月19日

摘要: 原文地址:http://www.cnblogs.com/acpp/archive/2011/06/10/2077592.htmlsession.save_handler=files1.session_start()是session机制的开始,它有一定概率开启垃圾回收,因为session是存放在文件中的,PHP自身的垃圾回收是无效的,SESSION的回收是要删文件的,这个概率是根据php.ini的配置决定的,但是有的系统是 session.gc_probability=0,这也就是说概率是0,而是通过cron脚本来实现垃圾回收。session.gc_probability = 1session. 阅读全文

posted @ 2013-10-19 10:49 eastson 阅读(275) 评论(0) 推荐(0) 编辑

2013年10月17日

摘要: Drupal的很多功能都是可以定制的。以导航菜单为例,blog模块需要在菜单上添加一些功能,comment模块需要在菜单上添加一些功能,我们开发的自定义模块也需要在菜单上添加一些功能。Drupal开发者为了达到这样的扩展目的,设计了钩子系统,导航菜单就是其中一个名为menu的钩子。有了钩子系统,开发人员就可以在blog模块定义一个钩子函数从而实现menu钩子。Drupal要求钩子函数的命名必须要求以模块名开始,以钩子名为后缀。function block_menu() { $items['admin/structure/block/manage/%/%'] = array( & 阅读全文

posted @ 2013-10-17 17:21 eastson 阅读(386) 评论(0) 推荐(0) 编辑

摘要: Drupal的系统变量是指保存在后台数据库variable表中的一些参数设置,透过variable_get()和variable_set()存取:先看一看_drupal_bootstrap_variables()的代码:function _drupal_bootstrap_variables() { global $conf; // Initialize the lock system. require_once DRUPAL_ROOT . '/' . variable_get('lock_inc', 'includes/lock.inc'); 阅读全文

posted @ 2013-10-17 10:34 eastson 阅读(405) 评论(0) 推荐(0) 编辑

摘要: 什么是模块载入?首先说载入,这里的载入是指require_once。模块载入就是指require_once模块目录中的某个PHP文件。每个Drupal模块都应该有自己的主文件。模块主文件以模块名开始,以.module为后缀。例如blog模块,其主文件就是blog.module。drupal_load()函数用来完成载入模块主文件:function drupal_load($type, $name) { static $files = array(); if (isset($files[$type][$name])) { return TRUE; } $filename = dru... 阅读全文

posted @ 2013-10-17 10:10 eastson 阅读(512) 评论(0) 推荐(0) 编辑

2013年10月16日

摘要: system_list()函数的目的是根据传入的资源类型,返回一个数组列表:function system_list($type) { ... ... }参数$type支持下面三种类型:bootstrap:返回启动模块列表module_enabled :返回模块列表theme:返回主题列表三种类型里面bootstrap处理方式有点不同,module_enabled和theme是相同的。先看看bootstrap是如此处理的。这里的bootstrap指的是系统表system里面标识为bootstrap的模块,是系统的启动模块,在Drupal启动过程中需要先被载入。首先检查是否有缓存:if ($ca 阅读全文

posted @ 2013-10-16 14:52 eastson 阅读(417) 评论(0) 推荐(0) 编辑

摘要: Drupal中,主题是可以继承的,或者说是扩展。例如,要创建一个新的名为custom的主题,该主题与名为default的主题只有某些细小的差别。这个时候,不需要复制一份default到custom,可以在custom声明该主题继承自default就可以了。主题的继承关系在info文件中说明。首先,default主题的info文件不需要修改:name = Default Themecustom主题的info文件需要特别地声明base theme属性:name = Custom Themebase theme = defaultDrupal内部是如何解析这种继承关系的呢?解析的过程发生在syste 阅读全文

posted @ 2013-10-16 14:39 eastson 阅读(299) 评论(0) 推荐(0) 编辑

2013年10月14日

摘要: Drupal能够识别哪些资源类型?profile,不知道怎么翻译,应该是指安装类型,固定地存放于profiles目录下。module,模块,可以存在于多个目录下:modules、profiles/{profile}/modules、sites/all/modules、sites/{$site}/modules。theme,主题,可以存在于多个目录下:themes、profiles/{profile}/themes、sites/all/themes、sites/{$site}/themes。theme_engine,主题引擎,可以存在于多个目录下:themes/engines、profiles/ 阅读全文

posted @ 2013-10-14 17:10 eastson 阅读(374) 评论(0) 推荐(0) 编辑

2013年10月11日

摘要: Drupal在数据库启动阶段仅仅是简单地包含了database.inc文件,然后再注册类加载器:function _drupal_bootstrap_database() { // Initialize the database system. Note that the connection // won't be initialized until it is actually requested. require_once DRUPAL_ROOT . '/includes/database/database.inc'; // Register autoload f 阅读全文

posted @ 2013-10-11 16:02 eastson 阅读(245) 评论(0) 推荐(0) 编辑

2013年10月10日

摘要: Drupal有时会显示白屏,或者500内部错误,这多半是由于PHP脚本什么地方有问题造成的。这个时候,可以先看看php.log里面有没有提示:[10-Oct-2013 15:55:26 Asia/Shanghai] PHP Fatal error: Call to undefined function xxxxxx() in C:\Program Files\Zend\Apache2\htdocs\drupal\index.php on line 24也可以将display_errors选项开启,使php将所有的信息都显示出来:error_reporting(E_ALL);ini_set(&# 阅读全文

posted @ 2013-10-10 16:03 eastson 阅读(437) 评论(0) 推荐(0) 编辑

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 61 下一页