本文整理匯總了PHP中Http::get_to_file方法的典型用法代碼示例。如果您正苦於以下問題:PHP Http::get_to_file方法的具體用法?PHP Http::get_to_file怎麽用?PHP Http::get_to_file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Http
的用法示例。
在下文中一共展示了Http::get_to_file方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetToFile
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();
}
示例2: download_from_repository
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);
}