public function Test_copy_directories() { $original_path = 'ak_test_folder'; $copy_path = $original_path . '_copy'; $this->assertTrue(AkFileSystem::copy($original_path, $copy_path)); $file_name = $copy_path . '/new_folder/test_file.txt'; $content = "\rThis is the content of the test file"; $this->assertTrue(AkFileSystem::file_get_contents($file_name) === $content); }
public function __construct() { parent::__construct(); $this->fixtures_base = AkConfig::getDir('fixtures') . DS . 'Image_TestCase'; if (!($this->offline_mode = !@file_get_contents('http://www.akelos.org/testing_resources/images/watermark.png'))) { $this->image_path = $this->fixtures_base . DS . 'akelos_framework_logo.png'; $this->photo_path = $this->fixtures_base . DS . 'cristobal.jpg'; $this->watermark = $this->fixtures_base . DS . 'watermark.png'; AkFileSystem::copy(AkConfig::getDir('fixtures') . '/old_logo.png', $this->image_path, array('base_path' => AK_FRAMEWORK_DIR)); $cristobal = @Ak::url_get_contents('http://www.akelos.org/testing_resources/images/cristobal.jpg', array('cache' => 100000)); if (!empty($cristobal)) { AkFileSystem::file_put_contents($this->photo_path, $cristobal, array('base_path' => AK_FRAMEWORK_DIR)); } $watermark = @Ak::url_get_contents('http://www.akelos.org/testing_resources/images/watermark.png', array('cache' => 100000)); if (!empty($watermark)) { AkFileSystem::file_put_contents($this->watermark, $watermark, array('base_path' => AK_FRAMEWORK_DIR)); } $this->_run_extra_tests = file_exists($this->photo_path); } }
protected function _removeOldVersionsFileAndUseMigrationsTable($options) { $oldfile = $this->_versionPath($options); $version = AkFileSystem::file_get_contents($oldfile); AkFileSystem::copy($oldfile, $oldfile . '.backup'); AkFileSystem::file_delete($oldfile); $this->log('message', 'got old version from file:' . $oldfile . '=' . $version . ' moved to backup-file:' . $oldfile . '.backup'); $this->setInstalledVersion($version, $options); $this->AkelosMigration->create(array('name' => $this->getInstallerName(), 'version' => $version)); }
/** * @deprecated * @uses AkFileSystem::copy */ static function copy($origin, $target, $options = array()) { Ak::deprecateMethod(__METHOD__, 'AkFileSystem::copy()'); return AkFileSystem::copy($origin, $target, $options); }