Using spip_loader

« Spip_loader » is a script that allows to install or to update your SPIP site automatically without uploading all the files by ftp.

Current version of spip_loader : 4.2.0

Use spip_loader to install SPIP automatically

  1. Download the script https://www.spip.net/spip-dev/INSTA...
  2. Set this file via ftp in the directory where you want to install SPIP (generally at the root of your server).
  3. Call the script from your navigator http://www.monsite.tld/spip_loader.php
  4. The script checks if your hosting has the necessary requirements then indicates the SPIP version you are going to install or update.
  5. Launch the automatic installation.

Leave the script online
Once SPIP installed, you can safely leave the script spip_loader.php (from version 2.1) on the server. Only the authorised and authenticated administrators will be able to proceed. The benefit is to be able, in case of alert, to update SPIP very easily.
Detailed explanations
From version 3.0.2 onwards, spip_loader detects its new versions and offers to update itself without the need for an FTP transfer.

  • a drop-down list allows to choose the version to be installed
  • if no SPIP is installed :
    • the drop-down list selects the latest stable version
  • if a SPIP is already installed :
    • the drop-down list is positioned by default on the latest version of the same branch as the site (if it is still referenced).
    • files that are obsolete after the update (i.e. that have been removed between the current site version and the installed version) are stored in a directory fichiers_obsoletes_{date} where date is replaced by the current date and time. This is done only on the directories: ecrire, prive, squelettes-dist and plugins-dist (and the old directory extensions).
    • corollary to the previous point, if plugins had been added to the plugins-dist/ directory (therefore not belonging to the zip provided by SPIP), they will also be moved to this directory of obsolete files, unless they contain a .spip_loader_keep file.
  • It is possible to use a configuration file to manage the defines and keep them from one update to another with spip_loader_config.php

It is also possible to force a certain zip with the constant _CHEMIN_FICHIER_ZIP. Example:

  1. define('_CHEMIN_FICHIER_ZIP', 'spip/stable/spip-3.2.zip');

Use spip_loader to proceed to an update

To update SPIP, proceed the same way:

  1. Access the SPIP private area
  2. Put the script to your server (if not already done)
  3. Call the script from your browser http://www.monsite.tld/spip_loader.php
  4. Choose the version you want to install
  5. Launch the automatic installation process

Before calling the script you should be identified as a webmaster.

Customize the authors authorized to perform an update

By default, only the author n°1 can perform this update.
If you want to add other authors, edit the script spip_loader.php at line:

  1. define('_SPIP_LOADER_UPDATE_AUTEURS', '1');

For example, to authorize authors 5, 6 and 8 to use the spip_loader, we will write the line this way:

  1. define('_SPIP_LOADER_UPDATE_AUTEURS', '5:6:8');

Since version 3.0.2 you can define these parameters in a file that will be included automatically spip_loader_config.php, so your settings are preserved when spip_loader is updated.

What to do in case of failure?

spip_loader can fail to upload files. Generally it is caused by permissions issues on the server. In this case you will have to install SPIP:

  • either by transferring manually the files via FTP
  • or by using git (for advanced users)

Author jack Published : Updated : 07/10/20

Translations : English, français, Nederlands, українська