modules/system/system.api.php, 1518行
安装当前的数据库架构版本,以及任何其他安装任务.
The hook will be called the first time a module is installed, and the module's schema version will be set to the module's greatest numbered update hook. Because of this, anytime a hook_update_N() is added to the module, this function needs to be updated to reflect the current version of the database schema.
See the Schema API documentation at http://drupal.org/node/146843 for details on hook_schema, where a database tables are defined.
Note that since this function is called from a full bootstrap, all functions (including those in modules enabled by the current page request) are available when this hook is called. Use cases could be displaying a user message, or calling a module function necessary for initial setup, etc.
Please be sure that anything added or modified in this function that can be removed during uninstall should be removed with hook_uninstall().
<?php function hook_install() { drupal_install_schema('upload'); } ?>
1 周 6 天之前
3 周 4 天之前
3 周 4 天之前
3 周 4 天之前
5 周 3 天之前
5 周 3 天之前
7 周 3 天之前
7 周 3 天之前
7 周 3 天之前
7 周 4 天之前