<?php

/**
 * Vvveb
 *
 * Copyright (C) 2020  Ziadin Givan
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */

define('HOST','www');
define('FTP_PATH','www');
define('IS_MOBILE',false);
define('IS_STAGING',false);
define('VIEW_TEMPLATE_ENGINE','psttt');

// Define configuration
define('SQL_CHECK', true);

//define('ID_HOST', $_SERVER['HASH']);
define('ID_HOST', $_SERVER['HTTP_HOST']);

//Service
define('SERVICE_CACHE_FLAG_REGENERATE', -2); //wait for cache generation

if (! defined('SERVICE_CACHE_FLAG_LOCK')) {
	define('SERVICE_CACHE_FLAG_LOCK', -1);
} //lock set

//time
define('SERVICE_CACHE_EXPIRE_DELAY', 5); //real expiration time +5 seconds
define('SERVICE_CACHE_WAIT', 3); //wait for cache generation
define('SERVICE_CACHE_MAX_WAIT_RETRY', 3); //wait for cache generation
define('SERVICE_CACHE_LOCK_EXPIRE', 20); //lock can not be set more than SERVICE_CACHE_LOCK_EXPIRE seconds
define('COMPONENT_CACHE_EXPIRE', 20);

define('CACHE_DRIVER', 'memcache');
define('CACHE_MEMCACHE_SERVERS', [
	['localhost', 11211, 33],
	//array('mem2.domain.com', 11211, 67)
]);

$config = [
	'host'                 => 'www',
	'ftp_path'             => 'www',
	'is_mobile'            => false,
	'is_staging'           => false,
	'view_template_engine' => 'psttt',

	// define configuration
	'db_engine' => 'mysqli',
	'db_host'   => '127.0.0.1',
	'db_user'   => 'root',
	'db_pass'   => 'dan1ela',
	'db_name'   => 'vvveb',
	'sql_check' => true,

	//'id_host' =>  $_server['hash'],
	'id_host' => 0,

	//service
	'service_cache_flag_regenerate' => -2, //wait for cache generation
	'service_cache_flag_lock'       => -1, //lock set

	//time
	'service_cache_expire_delay'   => 5, //real expiration time +5 seconds
	'service_cache_wait'           => 3, //wait for cache generation
	'service_cache_max_wait_retry' => 3, //wait for cache generation
	'service_cache_lock_expire'    => 20, //lock can not be set more than service_cache_lock_expire seconds
	'component_cache_expire'       => 20,
];
