PHP Script For Updating Drupal Core
Updating Drupal core can be a difficult process because Drupal still doesn't support core update in online way. We must download the core first, extract it, then upload it to our server manually. This process can take more time because of so many manual operations. In order to solve that problem, I try to create a PHP script to make the update process easier. We just need to open a URL with some query string and then the script will download the requested Drupal core to our server. What we need to do next is run the update.php.
How To Use
This script is very easy to use. We assume that the newest Drupal core version is 7.23, so we just need to open the following URL with our web browser.
http://<website>/update_drupal.php?afn=drupal-7.23
After that, the Drupal core will be updated and we just need to run update.php
To enhance the security, you can protect the page from anonymous user by forcing user to login before running drupal_update.php.
This script can be downloaded from the attachment section.
UPDATE
It seems the Drupal download URL is using HTTPS now. So this script needs little update. Find the following line:
<?php
...
$drupal_url = 'http://ftp.drupal.org/files/projects';
...
?>
Then replace it with:
<?php
...
$drupal_url = 'https://ftp.drupal.org/files/projects';
...
?>
Attachment | Size |
---|---|
![]() | 1.09 KB |