PHP Classes

File: engine/modules/core/doctor/doctor.hook.inc

Recommend this page to a friend!
  Classes of Aldo Tripiciano   Quanta CMS   engine/modules/core/doctor/doctor.hook.inc   Download  
File: engine/modules/core/doctor/doctor.hook.inc
Role: Example script
Content type: text/plain
Description: Example script
Class: Quanta CMS
Manage content that works without a database
Author: By
Last change:
Date: 5 years ago
Size: 1,471 bytes
 

Contents

Class file image Download
<?php
/**
 * Implements hook_doctor_setup().
 *
 * Setup a Quanta site.
 *
 * @param Environment $env
 * The Environment.
 * @param array $vars
 * An array of variables.
 */
function doctor_doctor_pre_setup($env, $vars) {
 
/** @var Doctor $doctor */
 
$doctor = $vars['doctor'];
 
$doctor->op('Starting Quanta installation. Good luck!');

 
// Check that all system paths do exist.
 
$doctor->checkCurrentUnixUser();

 
// Check that all system paths do exist.
 
$doctor->checkWebServerModules();

 
// Check that all system paths do exist.
 
$doctor->checkWebServerUser();

 
$doctor->ok('Current user: ' . $doctor->unix_user);
 
$doctor->ok('Web Server user: ' . $doctor->web_server_user);

 
$user_is_correct = $doctor->ask('Are those users correct? (y/n)');
  if (
$user_is_correct == 'n') {
   
$doctor->stop('Aborting.');
  }

 
// Check that all system paths do exist.
 
$doctor->checkSystemPaths();

 
// Clear all cache (for existing applications).
 
$doctor->cure('clear_cache');

 
$doctor->ok();

 
// TODO: move in modules - out of doctor.
 
$doctor->cure('check');

 
$doctor->checkWebServerVsUnixUser();
}

/**
 * Implements hook_doctor_setup().
 *
 * Setup a Quanta site.
 *
 * @param Environment $env
 * The Environment.
 * @param array $vars
 * An array of variables.
 */
function doctor_doctor($env, $vars) {
 
/** @var Doctor $doctor */
 
$doctor = $vars['doctor'];
 
// TODO: move in modules - out of doctor.
 
$doctor->checkBrokenLinks();
}