少し検索した後、私はそれをダウンロードする方法を見つけました。コードは次のとおりです。
<?php
$new_file = file_get_contents('http://wordpress.org/latest.zip') or exit('unable to open from wordpress');
$current = fopen('latest.zip','c') or exit("Unable to open file!");
fclose($current);
chmod('latest.zip',0777);
file_put_contents('latest.zip',$new_file);
echo 'Done';
?>
このスクリプトは、最初にwordpress.org
から「latest.zip」を
開き、次にホストで「latest.zip」という名前のファイルを開きます。そしてそれを閉じます。chmodファイルに書き込むためにを設定する必要があります。
最後に、ダウンロードしたファイルの内容を「latest.zip」にホストに配置します。
重要:この「script.php」をアップロードするフォルダーには、「latest.zip」ファイルを作成するための書き込みアクセス権が必要です。