简体   繁体   English

以编程方式创建整个Drupal网站

[英]Programmatically create a whole Drupal site

I am going to start a new project and I would like to avoid the tedious tasks necessary to recreate and populate a site with all the custom content, modules and functionality. 我将开始一个新项目,我想避免用所有自定义内容,模块和功能来重新创建和填充网站所必需的繁琐任务。

My idea is to create PHP scripts (similar to the installation scripts in the profile folder) to populate users, content, menus, views, etc. In this way you can execute the scripts and rebuild the whole site from scratch. 我的想法是创建PHP脚本(类似于profile文件文件夹中的安装脚本)来填充用户,内容,菜单,视图等。通过这种方式,您可以执行脚本并从头开始重建整个站点。

Do you know any tool/documentation to do this? 您知道执行此操作的任何工具/文档吗?

You should have a look at drush make , which is part of the very helpful drush command line shell & scripting interface for Drupal. 您应该看一下drush make ,它是Drupal非常有用的drush命令行shell和脚本界面的一部分。

You can generate a starting makefile from an existing Drupal installation using: 您可以使用以下方法从现有的Drupal安装中生成一个启动文件:

 drush make-generate /path/to/make-file.make

.. and then tweak the configuration as needed, including custom file/module downloads. ..,然后根据需要调整配置,包括自定义文件/模块下载。

Well, you can always build new profile that will help you build new web-sites. 好吧,您始终可以建立新的配置文件,以帮助您建立新的网站。 Please look at How to Write a Drupal 7 Installation Profile . 请查看如何编写Drupal 7安装配置文件 Its simular like building new module (documented). 它类似于构建新模块(已记录)。

For our needs in the company, we've build 2 type of profile installation but sometimes it was more worth to copy existing site and install it on new domain. 为了满足公司的需求,我们构建了两种类型的概要文件安装,但是有时更值得复制现有站点并将其安装在新域上。 But I assume that our needs are different then yours. 但我认为我们的需求与您的需求不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM