Exemple #1
0
 public function test_should_get_the_right_temp_dir()
 {
     $tmp_dir = Ak::get_tmp_dir_name();
     $tmp_file = $tmp_dir . DS . 'ak_test_' . __CLASS__;
     $tmp_file2 = $tmp_dir . DS . 'ak_test_dir' . DS . 'level_one' . DS . 'file.txt';
     $this->assertTrue(is_dir($tmp_dir), 'Could not find temporary directory at: ' . $tmp_dir);
     $this->assertTrue(touch($tmp_dir . DS . 'ak_test_' . __CLASS__), 'Can\'t touch files on the temporary directory ' . $tmp_dir);
     $this->assertTrue(AkFileSystem::file_put_contents($tmp_file, 'abc'), 'Can\'t write on the temporary file ' . $tmp_file);
     $this->assertTrue(AkFileSystem::file_get_contents($tmp_file) == 'abc', 'Can\'t write on the temporary file ' . $tmp_file);
     $this->assertTrue(AkFileSystem::file_put_contents($tmp_file2, 'abce'), 'Can\'t write on the temporary file ' . $tmp_file2);
     $this->assertTrue(AkFileSystem::file_get_contents($tmp_file2) == 'abce', 'Can\'t write on the temporary file ' . $tmp_file2);
     $this->assertEqual($tmp_dir, AK_TMP_DIR);
 }
Exemple #2
0
/**
 * @deprecated
 */
function ak_get_tmp_dir_name()
{
    Ak::deprecateWarning('ak_get_tmp_dir_name is deprecated. Please use Ak::get_tmp_dir_name()');
    return Ak::get_tmp_dir_name();
}
Exemple #3
0
defined('AK_PUBLIC_DIR') || define('AK_PUBLIC_DIR', AK_BASE_DIR . DS . 'public');
defined('AK_TEST_DIR') || define('AK_TEST_DIR', AK_BASE_DIR . DS . 'test');
defined('AK_SCRIPT_DIR') || define('AK_SCRIPT_DIR', AK_BASE_DIR . DS . 'script');
defined('AK_APP_VENDOR_DIR') || define('AK_APP_VENDOR_DIR', AK_BASE_DIR . DS . 'vendor');
defined('AK_APP_LIB_DIR') || define('AK_APP_LIB_DIR', AK_BASE_DIR . DS . 'lib');
defined('AK_TASKS_DIR') || define('AK_TASKS_DIR', AK_APP_LIB_DIR . DS . 'tasks');
defined('AK_APIS_DIR') || define('AK_APIS_DIR', AK_APP_DIR . DS . 'apis');
defined('AK_MODELS_DIR') || define('AK_MODELS_DIR', AK_APP_DIR . DS . 'models');
defined('AK_CONTROLLERS_DIR') || define('AK_CONTROLLERS_DIR', AK_APP_DIR . DS . 'controllers');
defined('AK_VIEWS_DIR') || define('AK_VIEWS_DIR', AK_APP_DIR . DS . 'views');
defined('AK_HELPERS_DIR') || define('AK_HELPERS_DIR', AK_APP_DIR . DS . 'helpers');
defined('AK_APP_PLUGINS_DIR') || define('AK_APP_PLUGINS_DIR', AK_APP_VENDOR_DIR . DS . 'plugins');
defined('AK_APP_INSTALLERS_DIR') || define('AK_APP_INSTALLERS_DIR', AK_APP_DIR . DS . 'installers');
defined('AK_PLUGINS_DIR') || define('AK_PLUGINS_DIR', AK_APP_VENDOR_DIR . DS . 'plugins');
defined('AK_PLUGINS') || define('AK_PLUGINS', 'auto');
defined('AK_TMP_DIR') || define('AK_TMP_DIR', Ak::get_tmp_dir_name());
defined('AK_COMPILED_VIEWS_DIR') || define('AK_COMPILED_VIEWS_DIR', AK_TMP_DIR . DS . 'views');
defined('AK_CACHE_DIR') || define('AK_CACHE_DIR', AK_TMP_DIR . DS . 'cache');
defined('AK_DEFAULT_LAYOUT') || define('AK_DEFAULT_LAYOUT', 'application');
defined('AK_CONTRIB_DIR') || define('AK_CONTRIB_DIR', AK_AKELOS_UTILS_DIR . DS . 'contrib');
defined('AK_LIB_DIR') || define('AK_LIB_DIR', AK_FRAMEWORK_DIR);
defined('AK_VENDOR_DIR') || define('AK_VENDOR_DIR', AK_CONTRIB_DIR);
defined('AK_DOCS_DIR') || define('AK_DOCS_DIR', AK_BASE_DIR . DS . 'docs');
defined('AK_CONFIG_INCLUDED') || define('AK_CONFIG_INCLUDED', true);
defined('AK_FW') || define('AK_FW', true);
if (AK_ENVIRONMENT != 'setup') {
    defined('AK_UPLOAD_FILES_USING_FTP') || define('AK_UPLOAD_FILES_USING_FTP', !empty($ftp_settings));
    defined('AK_READ_FILES_USING_FTP') || define('AK_READ_FILES_USING_FTP', false);
    defined('AK_DELETE_FILES_USING_FTP') || define('AK_DELETE_FILES_USING_FTP', !empty($ftp_settings));
    defined('AK_FTP_AUTO_DISCONNECT') || define('AK_FTP_AUTO_DISCONNECT', !empty($ftp_settings));
    if (!empty($ftp_settings)) {