Пример #1
0
    {
        global $config;
        if (ini_get('register_globals')) {
            throw new HaploPhpConfigException('Please disable register_globals in your php.ini file.');
        }
        if (get_magic_quotes_gpc()) {
            throw new HaploPhpConfigException('Please disable magic_quotes_gpc in your php.ini file.');
        }
        if (!is_dir($config->get_key('paths', 'actions'))) {
            throw new HaploDirNotFoundException('Actions directory (' . $config->get_key('paths', 'actions') . ') not found.');
        }
        if (!is_dir($config->get_key('paths', 'templates'))) {
            throw new HaploDirNotFoundException('Templates directory (' . $config->get_key('paths', 'templates') . ') not found.');
        }
        if (!is_dir($config->get_key('paths', 'postFilters'))) {
            throw new HaploDirnotFoundException('Template post filters directory (' . $config->get_key('paths', 'postFilters') . ') not found.');
        }
        if (!is_dir($config->get_key('paths', 'translations'))) {
            throw new HaploDirNotFoundException('Translations directory (' . $config->get_key('paths', 'translations') . ') not found.');
        }
        if (!is_dir($config->get_key('paths', 'cache'))) {
            throw new HaploDirNotFoundException('Cache directory (' . $config->get_key('paths', 'cache') . ') not found');
        }
        if (!is_writable($config->get_key('paths', 'cache'))) {
            throw new HaploDirNotWritableException('Cache directory (' . $config->get_key('paths', 'cache') . ') is not writeable.');
        }
    }
}
// check that the framework is set up correctly
HaploSetup::validate();
Пример #2
0
<?php

namespace HaploMvc;

require APP_BASE . '/HaploMvc/Exception/HaploExceptions.php';
// this can be disabled after successful setup
HaploSetup::validate(APP_BASE);