Update CMS

Module "Update CMS" required for the installation. It belongs to the CMS "Service" and is part DIAFAN.CMS core. It has only the administrative part.

For correct operation of the module must be PHP-extension ZipArchive.


The module allows you to receive updates for your DIAFAN.CMS from our server.

When you first install DIAFAN.CMS created so-called "point of no return", which contains a backup of all the files installed "from the box". Subsequently, when receiving the update, DIAFAN.CMS cusps creates and maintains a separate updated versions of the files.

DIAFAN.CMS updates are checked only at your request! It should go to the module "Update CMS" and click "Check for updates". If your version of DIAFAN.CMS there are changes, you will see a list of updates available for download, and a list will be button "Download".

Check updates

After clicking on it will be progressively downloaded updates. If you interrupt the download to complete, the next time you check the list of updates will be adjusted. Continue interrupted downloads can be the same way – by using the "Download" button below the list. The update can participate DIAFAN.CMS all files, including templates, styles and image files. When this skip any of the packets is not possible, the system automatically checks the integrity of each update.

Each downloading updates cusps are created automatically. After downloading the update, you must click the "Apply" button (it appears on the screen after the last downloaded updates). Applied will be updating all the current point of return to the last update performed.

Check updates

As updating work?

  1. Generate theme. What does it mean? All received the updated files from our server are compared with the current file of the entire system at the current point of return. If DIAFAN.CMS finds that some current system files are not suitable for the preparation of an update, they will be moved to the folder custom in the current theme. If the current theme is not present, it will be created a new one.

  2. Files that you receive from the service will be recorded on the spot displaced files. On the site it will not be displayed because of the current theme files have a higher priority.

  3. If the update provided by the change of the database structure, it will be produced.

What if the update functionality is not satisfied?

You can return all back in one click. To do this, just go to the module "Update CMS" and click "Apply" in front of any previous point return. Revert to saved state also applies to a database. If any manipulation, after the application of cusps database structure were produced with it will return to its previous state.

Restoring using the cusps is subject only to the database structure, not the contents! For a full backup, you need to do is first exported, then the database import.

Is it possible to remove the point of return?

Yes, you can. When you delete return to its point of files attached to the next point. Moreover, to remove the excess return point is recommended because it will accelerate the generation of themes. And also, it is not recommended to get involved too frequent creation cusps. After all, the system inspects all the previous point, and the fewer, the faster generation.

The current point can not be removed, as well as the return point of download, but not yet applied the update.

How to view the details of the return points?

Each point can reveal the return by clicking on its name. After that it will be shown a complete list of files that are included in the point of no return. Also, it displays a list of files that differ from the current version of the site.

Updates are only available for sites with activated licenses DIAFAN.CMS.


Подключаемая часть – файл modules/update/update.inc.php. В нем описан класс Update_inc. В модуле к объекту класса можно обратиться через переменную $this->diafan->_update. Экземпляр класса создается при первом вызове переменной.


var folders = array('adm', 'css', 'img', 'themes', 'modules', 'includes', 'plugins', 'js') – папки и файлы, индексируеме для точек возврата.

var exclude = array('adm/htmleditor', 'includes/custom.php') – папки и файлы, не индексируемые для точек возврата.


void first_return () – Добавляет первую точку возврата.


// when installing DIAFAN.CMS

array get_files (integer $id) – Получает обновленные файлы точки с содержимым.

  • integer $id: идентификатор точки


// receives files from point of return ID=3
$rows = $this->diafan->_update->get_files(3);
/* output:
    [modules/news/news.model.php] => <?php
        class News_model extends Model
    [modules/news/news.php] => <?php
        class News extends Controller
) */

array get_all_files (integer $id) – Получает все файлы DIAFAN.CMS в точке с содержимым.

  • integer $id: идентификатор точки


// DIAFAN.CMS gets all the files relevant to the point of return of ID=3
$rows = $this->diafan->_update->get_all_files(3);
// displays the files in the format as function get_files()


  1. modules/update/admin/js/update.admin.count.js – Количество доступных обновлений, JS-сценарий;

  2. modules/update/admin/js/update.admin.js – Обновление, JS-сценарий;

  3. modules/update/admin/update.admin.php – Точки возврата;

  4. modules/update/admin/update.admin.action.php – Точки возврата;

  5. modules/update/admin/update.admin.count.php – Количество доступных обновлений для меню административной панели;

  6. modules/update/update.inc.php – Подключение модуля;

  7. modules/update/update.install.php – Module installation.