public function index() { $this->base_dir = AK_BASE_DIR; $this->akelos_dir = AK_FRAMEWORK_DIR; $this->tasks_dir = AK_TASKS_DIR; $this->has_configuration = file_exists(AkConfig::getDir('config') . DS . 'config.php'); $this->has_routes = file_exists(AkConfig::getDir('config') . DS . 'routes.php'); $this->has_database = file_exists(AkConfig::getDir('config') . DS . 'database.yml'); $this->using_root_path = $this->Request->getPath() == '/'; $this->new_install = !$this->has_configuration || !$this->has_routes || $this->using_root_path; $this->environment = AK_ENVIRONMENT; $this->memcached_on = AkMemcache::isServerUp(); $this->constants = AkDebug::get_constants(); $this->langs = Ak::langs(); $this->database_settings = Ak::getSettings('database', false); $this->server_user = trim(AK_WIN ? `ECHO %USERNAME%` : `whoami`); $this->local_ips = AkConfig::getOption('local_ips', array('localhost', '127.0.0.1', '::1')); $paths = array(AK_APP_DIR . DS . 'locales'); $this->invalid_permissions = array(); foreach ($paths as $path) { if (is_dir($path) && !@file_put_contents($path . DS . '__test_file')) { $this->invalid_permissions[] = $path; } else { @unlink($path . DS . '__test_file'); } } }
public function test_all_caches() { $cacheHandlers = array('cache_lite' => 1, 'akadodbcache' => 2); $memcacheEnabled = AkConfig::getOption('memcached_enabled', AkMemcache::isServerUp()); if ($memcacheEnabled) { $cacheHandlers['akmemcache'] = 3; } $unitTests = array('_test_cache_with_string_key', '_test_cache_with_string_key_cached'); if ($this->controller->_CacheHandler instanceof AkCacheHandler) { foreach ($cacheHandlers as $class => $type) { $this->controller->_CacheHandler->setCacheStore($type); $this->_test_init(); foreach ($unitTests as $test) { $this->{$test}($class); } } } else { $this->fail('CacheHandler is not initialized. Please enable the caching system for the unit-test'); } }
static function getTestTitle($options) { AkConfig::setOption('testing_url', AK_TESTING_URL); AkConfig::setOption('memcached_enabled', AkMemcache::isServerUp()); AkUnitTestSuite::checkIfTestingWebserverIsAccesible($options); $dabase_settings = AK_DATABASE_SETTINGS_NAMESPACE == 'database' ? Ak::getSetting('database', 'type') : AK_DATABASE_SETTINGS_NAMESPACE; return "PHP " . phpversion() . ", Environment: " . AK_ENVIRONMENT . ", Database: " . $dabase_settings . (AkConfig::getOption('memcached_enabled', false) ? ', Memcached: enabled' : '') . (AkConfig::getOption('webserver_enabled', false) ? ', Testing URL: ' . AkConfig::getOption('testing_url') : ', Testing URL: DISABLED!!!') . "\n" . "Error reporting set to: " . AkConfig::getErrorReportingLevelDescription() . "\n" . trim($options['description']) . ''; }
public function __construct() { parent::__construct(); $this->memcached_enabled = AkConfig::getOption('memcached_enabled', AkMemcache::isServerUp()); }
<?php if (!defined('AK_BASE_DIR') && !defined('AK_FRAMEWORK_DIR')) { define('AK_FRAMEWORK_DIR', realpath(dirname(__FILE__) . '/../../')); if (is_dir(AK_FRAMEWORK_DIR . DIRECTORY_SEPARATOR . 'app_layout')) { define('AK_BASE_DIR', AK_FRAMEWORK_DIR . DIRECTORY_SEPARATOR . 'app_layout'); } } require_once dirname(__FILE__) . '/../shared/config/config.php'; AkConfig::setOption('testing_url', 'http://akelos.tests/akelos'); AkConfig::setOption('action_controller.session', array("key" => "_myapp_session", "secret" => "c1ef4792-42c5-b484-819e-16750c71cddb")); AkUnitTestSuite::checkIfTestingWebserverIsAccesible(array('base_path' => dirname(__FILE__))); AkConfig::setOption('memcached_enabled', AkMemcache::isServerUp()); if (AK_WEB_REQUEST && !(AK_REMOTE_IP == '127.0.0.1' || AK_REMOTE_IP == '::1')) { die('Web tests can only be called from localhost(127.0.0.1), you can change this beahviour in ' . __FILE__); }