导航

上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 61 下一页

2013年10月7日

摘要: Drupal整个启动过程共分为8个阶段:DRUPAL_BOOTSTRAP_CONFIGURATION:initialize configuration DRUPAL_BOOTSTRAP_PAGE_CACHE:try to serve a cached page DRUPAL_BOOTSTRAP_DATABASE:initialize database layer DRUPAL_BOOTSTRAP_VARIABLES:initialize the variable system DRUPAL_BOOTSTRAP_SESSION:initialize session han... 阅读全文

posted @ 2013-10-07 16:51 eastson 阅读(567) 评论(0) 推荐(0) 编辑

摘要: Drupal的后台数据库中有很多以cache开头的表,这些都是Drupal的缓存数据表。Drupal的缓存机制使用了接口方式,所有的缓存对象都必须实现DrupalCacheInterface接口:interface DrupalCacheInterface { function get($cid); function getMultiple(&$cids); function set($cid, $data, $expire = CACHE_PERMANENT); function clear($cid = NULL, $wildcard = FALSE); function isE. 阅读全文

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

摘要: Drupal的系统变量都保存在数据库variable表中:然后,开发人员可以通过下面的API函数操作这些系统变量:function variable_get($name, $default = NULL) { global $conf; return isset($conf[$name]) ? $conf[$name] : $default;}function variable_set($name, $value) { global $conf; db_merge('variable')->key(array('name' => $name))-&g 阅读全文

posted @ 2013-10-07 15:47 eastson 阅读(302) 评论(0) 推荐(0) 编辑

2013年10月5日

摘要: My solution to getting Clean URL working with my multisite setup drupal 4.7I added Alias to my httpd.conf apache file: # Alias for all php drupal sites Alias /abc /var/www/html/drupal Alias /def /var/www/html/drupal Alias /xyz /var/www/html/drupalMy setup has 4 sites /drupal, /abc, /def,... 阅读全文

posted @ 2013-10-05 16:47 eastson 阅读(283) 评论(0) 推荐(0) 编辑

摘要: Drupal的注册表是指registry和registry_file两个数据表。前一个表保存所有可用的类和接口以及它们所对应的文件,后一个表保存每个文件的hash码。1. 将所有需要更新的文件都汇总的$files数组:// 需要更新的文件有两部分:一是系统includes目录下所有的.inc文件,二是模块描述文件中通过files属性声明的文件。$files = array();$modules = db_query("SELECT * FROM {system} WHERE type = 'module'")->fetchAll();foreach ( 阅读全文

posted @ 2013-10-05 10:57 eastson 阅读(348) 评论(0) 推荐(0) 编辑

摘要: Drupal通过spl_autoload_register()注册类加载器实现自动加载:function _drupal_bootstrap_database() { // ... .... spl_autoload_register('drupal_autoload_class'); spl_autoload_register('drupal_autoload_interface');}再来看看类加载器是如何实现的?function drupal_autoload_interface($interface) { return _registry_check_c 阅读全文

posted @ 2013-10-05 10:26 eastson 阅读(487) 评论(0) 推荐(0) 编辑

2013年10月4日

摘要: 1. 下载:http://simpletest.org/。2.下载后,只要测试文件中包含如下两个文件,就可以用了 : 3. 比如测试一个界面:get('http://www.example.com/contact.php'); $this->assertResponse(200); } } ?> 还可以测试表单的提交动作:function testIsProperFormSubmissionSuccessful() { $this->get('http://www.example.com/contact.php'); $this->ass 阅读全文

posted @ 2013-10-04 16:44 eastson 阅读(390) 评论(0) 推荐(0) 编辑

摘要: Drupal的配置文件搜索是通过bootstrap.inc的conf_path()函数实现的:function conf_path($require_settings = TRUE, $reset = FALSE) { $conf = &drupal_static(__FUNCTION__, ''); if ($conf && !$reset) { return $conf; } $confdir = 'sites'; $sites = array(); if (file_exists(DRUPAL_ROOT . '/' 阅读全文

posted @ 2013-10-04 15:16 eastson 阅读(927) 评论(0) 推荐(0) 编辑

摘要: 在一台PC机上安装m0n0wall,相信大家都有经验。一般采用两种方法:1、在一台Windows XP或Windows 2000的PC上,下载physdiskwrite软件和m0n0wall映像文件(img文件),将一块硬盘(由于m0n0wall很小,因此很小容量的硬盘即可,1GB、2.1GB等均可;那种很老的210MB硬盘,只有是好的就能用)接入这台PC;如果用CF卡作为存储介质,可以使用读卡器或CF卡转IDE接口卡,将CF卡接入这台PC。在命令提示符窗口运行命令:physdiskwrite [-u] 这里-u对于physdiskwrite 0.5.1版来说,大于2GB的硬盘,需要添加这个参 阅读全文

posted @ 2013-10-04 11:55 eastson 阅读(1453) 评论(0) 推荐(0) 编辑

2013年9月26日

摘要: Drupal使用称之为“placeholder”的方式处理SQL查询参数: 'page',));// CORRECT:$result = db_query("SELECT nid, title FROM {node} WHERE type = :type", array( ':type' => 'page',));?>数组参数主要是应用于IN查询的环境: array(13, 42, 144));// Will get turned into this prepared statement equivalent au 阅读全文

posted @ 2013-09-26 16:28 eastson 阅读(251) 评论(0) 推荐(0) 编辑

上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 61 下一页