Ejemplo n.º 1
0
 function testGetToFile()
 {
     $target_file = new File("/" . FRAMEWORK_CORE_PATH . "tests/utils/http_test/output/result.txt");
     $this->assertFalse($target_file->exists(), "Il file da scaricare esiste gia'!!");
     $url = "http://" . Host::current() . "/framework/core/tests/utils/http_test/input/hello.php";
     Http::get_to_file($url, $target_file);
     $this->assertTrue($target_file->exists(), "Il file da scaricare non e' stato creato!!");
     $this->assertEqual("Hello!", $target_file->getContent(), "Il contenuto salvato non corrisponde!!");
     $target_file->delete();
 }
Ejemplo n.º 2
0
 static function download_from_repository($key, $module_name)
 {
     $target_file = new File(ModuleArchiver::MODULES_ARCHIVE_DIR . $key);
     Http::get_to_file(Config::instance()->MODULE_REPOSITORY_DOWNLOAD_URL . "?key=" . $key . "&module_name=" . $module_name, $target_file);
 }