Skip to content
Snippets Groups Projects
  • Sebastien ANDRE's avatar
    start modif php83 · b259a564
    Sebastien ANDRE authored
     * remove deprecated utf8_encode and decode
     * remove strftime
     * phpunit 9.6
     * rename PHPunit class with namespace
     * migrate phpunit xml files to 9.6
     * remove return in teardown
     * phpunit constraint change
     * remove call strftime
     * use phpunit for assert
     * remove early desc in run phpunit
     * fix error with xdebug
     * Fix View parameter
     * disabled multimedia and webkiosk tests
     * in volatile dont use adpater sql
     * try to fix kidilangues
     * fix SoapClient error
     * disable disk test
     * remove zend_adapter in bokeh tests
     * remove upgrade_db.sh in git run
     * change gitlab-ci with new image boogie
     * Always pull dev images for alpine-8.3
     * php 83: fix iconv error
    b259a564
bootstrap_db.php 3.40 KiB
<?php
/**
 * Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
 *
 * BOKEH 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.
 *
 * There are special exceptions to the terms and conditions of the AGPL as it
 * is applied to this software (see README file).
 *
 * BOKEH 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 BOKEH; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 */

chdir(realpath(__DIR__) . '/../');

error_reporting(E_ALL);
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
ini_set('memory_limit', '3072M');
date_default_timezone_set('Europe/Paris');

set_include_path(getcwd() . '/library'
                 . PATH_SEPARATOR . getcwd() . '/library/digital_resources'
                 . PATH_SEPARATOR . getcwd() . '/library/templates'
                 . PATH_SEPARATOR . getcwd() . '/library/Class'
                 . PATH_SEPARATOR . getcwd() . '/library/ZendAfi'
                 . PATH_SEPARATOR . getcwd() . '/library/storm/src'
                 . PATH_SEPARATOR . getcwd() . '/library/storm/tests'
                 . PATH_SEPARATOR . getcwd() . '/library/storm/zf/library'
                 . PATH_SEPARATOR . getcwd() . '/application/modules'
                 . PATH_SEPARATOR . getcwd() . '/tests'
                 . PATH_SEPARATOR . getcwd()
                 . PATH_SEPARATOR . get_include_path());

//echo 'PATHS = ' . get_include_path() . "\n";
// Includes de base
include_once 'local.php';
include_once 'fonctions/fonctions.php';
require_once 'Zend/Loader.php';
require_once 'library/startup.php';

$path = __DIR__;
$parts = explode(DIRECTORY_SEPARATOR, $path);
$parts = array_reverse($parts);

defineConstant('BASE_URL', '/' . $parts[1]);
defineConstant('URL_IMG', BASE_URL . '/public/opac/skins/original/images/');
defineConstant('URL_SHARED_IMG', BASE_URL . '/public/opac/images/');

$_SERVER['SERVER_NAME'] = 'localhost';
$_SERVER['SERVER_PORT'] = '80';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['HTTP_HOST'] = 'localhost';

setupOpac();

Class_ICal_Autoloader::getInstance()->ensureAutoload();

(new Storm_Cache)->getCache()->setOption('caching', true);

$db_cache = Zend_Cache::factory('Core',
                                'File',
                                ['lifetime' => 300 ,
                                 'automatic_serialization' => true],
                                ['cache_dir' => PATH_TEMP]);

Zend_Db_Table_Abstract::setDefaultMetadataCache($db_cache);

Storm_Cache::setSeed('local');

$cfg = new Zend_Config(Zend_Registry::get('cfg')->toArray(), true);
$cfg->amber = new Zend_Config(['deploy' => false]);

Zend_Registry::set('cfg', $cfg);
$translate = Zend_Registry::get('translate');
$translate->addTranslation(LANG_DIR . 'ro.mo', 'ro');
$translate->addTranslation(LANG_DIR . 'en.mo', 'en');
$translate->addTranslation(LANG_DIR . 'es.mo', 'es');
$translate->addTranslation(LANG_DIR . 'fr.mo', 'fr');
$translate->setLocale('fr');

register_shutdown_function(fn() => TestSpeedTrap::printSpeedTrappedTests());