我们的 philosopherbios.profile 脚本的开头如下:
<?php // $Id$ require_once('profiles/default/default.profile'); /** * Provide an installer for our specific set of * modules, content types, and so on. * @file */ /** * Provide details about this profile. */ function philosopherbios_profile_details() { return array( 'name' => 'Philosopher Bios Profile', 'description' => 'Use this profile to install the ' .'modules and theme for Philosopher Bios.', ); }
有一点非常显眼,文件的开头用了一条 require_once 语句。严格地说,这不是必要的。不过,我们可以使用默认大纲中的一两个函数完成 Drupal 基本安装的一部分。如果我们不这样做,就不得不复制那个文件中的几段,每当 Drupal 推出一个新的发行版时,就去同步代码。
这个文件中的第一个函数是 philosopherbios_profile_details()。这个函数的目的是提供一些信息,帮助用户判断是否采用这个大纲。当安装开始时,就会要求用户选择大纲:

图 9-3
philosopherbios_profile_details() 函数返回的数组的作用是在这个列表中显示我们的大纲。name 称为大纲的标题,description 用于提供帮助文本。
这个函数的作用仅止于此。
评论
发表新评论