2017 © Pedro Peláez
 

library packagist-crawler

build mirror of packagist.org

image

hirak/packagist-crawler

build mirror of packagist.org

  • Wednesday, July 20, 2016
  • by hirak
  • Repository
  • 3 Watchers
  • 30 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

packagist-crawler

packagist.orgをクロールして、全てのpackage.jsonをダウンロードします。 ダウンロードし終わったあとでstaticなweb serverで配信すれば、packagist.orgのミラーを作ることができます。, (*1)

Requirement

  • PHP > 5.3
  • ext-curl
  • ext-hash
  • ext-json
  • ext-zlib
  • ext-PDO
  • ext-pdo_sqlite

Install

$ git clone https://github.com/hirak/packagist-crawler
$ cd packagist-crawler
$ composer install

Download!

$ php parallel.php

(...few minutes...)

$ ls cache/
p/
packages.json

Configuration

  • config.default.php
  • config.php

このどちらかのファイルがあると、挙動を変えることができます。 修正したいときはconfig.default.phpをconfig.phpにコピーして、 config.phpの方をカスタマイズしてください。, (*2)

<?php
return (object)array(
    'cachedir' => __DIR__ . '/cache/',
    //'cachedir' => '/usr/share/nginx/html/',
    //'cachedir' => '/usr/local/apache2/htdocs/',
    'packagistUrl' => 'https://packagist.org',
    'maxConnections' => 4,
    'lockfile' => __DIR__ . '/cache/.lock',
    'expiredDb' => __DIR__ . '/cache/.expired.db
);

cachedir

ダウンロードしたpackages.jsonを格納するディレクトリです。, (*3)

packagistUrl

ダウンロード元のpackagist.orgのURLです。 デフォルトではオリジンからダウンロードしますが、 既に存在する他のミラーサイトを指定することができます。, (*4)

maxConnections

並列ダウンロードの並列数です。 増やした方が速くダウンロードできますが、 オリジンに負荷をかけるので適当なところにしてください。, (*5)

expiredDb

ファイル更新によって古くなったjsonが記録されています。, (*6)

License

著作権は放棄するものとします。 利用に際して制限はありませんし、作者への連絡や著作権表示なども必要ありません。 スニペット的にコードをコピーして使っても問題ありません。, (*7)

ライセンスの原文, (*8)

CC0-1.0 (No Rights Reserved) - https://creativecommons.org/publicdomain/zero/1.0/ - http://sciencecommons.jp/cc0/about (Japanese), (*9)

The Versions

20/07 2016

dev-master

9999999-dev

build mirror of packagist.org

  Sources   Download

CC0-1.0

The Requires

 

by Hiraku NAKANO

01/01 2015

0.0.1

0.0.1.0

build mirror of packagist.org

  Sources   Download

CC0-1.0

The Requires

 

by Hiraku NAKANO