Exemplo n.º 1
0
* define and initialize default values for form variables
*/
$db_server = '';
$db_user = '';
$db_pass = '';
$db_name = '';
$tables_prefix = 'mo_';
$installation_complete_url = '';
$status_message = '';
/**
* Get the plugins to install from the current directory.
* The current directory is the directory housing the installer directory
*/
$unified_installer_dir = dirname(__FILE__);
$plugins_dir = str_replace('\\', '/', dirname($unified_installer_dir));
$directories = DirectoryInspector::get_directory_contents($plugins_dir, 'DIRECTORIES_ONLY', false);
$eligible_plugins = array();
//every plugin in the directory
$plugins_to_install = array();
//plugins selected by the user to install, this is passed in a session variable to finalize.php
foreach ($directories as $directory) {
    $config_filename = $directory . '-app-config.php';
    if ($directory != 'unified-installer' && !file_exists($plugins_dir . '/' . $directory . '/' . $config_filename)) {
        $eligible_plugins[] = $directory;
    }
}
/**
* declare and set variables needed by installer-form.php
*/
$user_manager_directory_exists = $session_manager_directory_exists = false;
$available_plugins_str = "<div><label>Choose Apps to Install</label><br/>" . "\r\n";
 private static function _cropImg($arr)
 {
     include_once self::_get_app_directory() . '/lib/wideimage/WideImage.php';
     $height = $arr['height'];
     $width = $arr['width'];
     $x = $arr['x'];
     $y = $arr['y'];
     $final_filename = $arr['final_file_destination'] . '/' . $arr['final_file_name'];
     $temp_filename = $arr['temp_file_destination'] . '/' . $arr['temp_file_name'];
     if (isset($arr['thumb']) && $arr['thumb'] === true) {
         WideImage::load($temp_filename)->crop($x, $y, $width, $height)->saveToFile($final_filename);
         if (file_exists($arr['original_image_save_directory'] . '/' . $arr['final_file_name']) && !$arr['save_original_image']) {
             unlink($arr['original_image_save_directory'] . '/' . $arr['final_file_name']);
         }
     } else {
         WideImage::load($temp_filename)->resize($width, $height, $fit = 'inside', $scale = 'any')->saveToFile($final_filename);
     }
     return DirectoryInspector::get_resource_url($final_filename, self::_get_app_url());
 }