Toggle navigation

Penggunaan Repository Packagist

Version 1.0.0

Jika kamu adalah pengguna framework pemograman php seperti laravel dan lainnya, tentu kamu akan familiar dengan istilah composer. Packagist  sendiri adalah sebuah repositori standar yang didalamnya terdapat paket Рpaket yang di butuhkan composer. Dengan packagist kamu dapat menemukan dan membuat paket composer. Telkom University saat ini memiliki mirror packagist yang dapat di akses pada URL https://packagist.telkomuniversity.ac.id.

 

 

Penggunaan packagist yang berada di Telkom University cukup mudah, yaitu dengan cara konfigurasi composer untuk di arahkan ke Telkom University.

Konfigurasi Global

Jalankan baris perintah di bawah ini untuk mengkonfigurasi packagist menjadi lokal Telkom University.

composer config -g repos.packagist composer https://packagist.telkomuniversity.ac.id

Setelah melakukan perintah diatas, jika kamu membuka file compresor.json yang berada pada direktory ~/.config/composer/ maka hasilnya akan seperti di bawah ini :

{
    "require": {},
    "repositories": {
        "packagist": {
            "type": "composer",
            "url": "https://packagist.telkomunivesity.ac.id"
        }
    }
}

Konfigurasi per project

Jika kamu tidak ingin mengatur mirror packagist secara global tapi hanya pada suatu project, maka kamu perlu masuk kedalam direktori project yang terdapat file composer.json. Kemudian jalankan perintah di bawah ini

composer config repos.packagist composer https://packagist.telkomuniversity.ac.id

Perbedaannya adalah pada -g. jika hanya ingin per project maka -g di hapuskan. Cek file composer.json akan berubah seperti konfigurasi global.

Jika packagist telah di atur menjadi lokal Telkom University, kamu dapat ujicoba dengan cara menginstall sebuah library. contohnya seperti script di bawah ini :

composer global require "laravel/installer=~1.1" -vvv

Ujicoba disini adalah menginstall library laravel dengan mirror packagist Telkom University. Bila dilihat pada log dibahwah ini downloading mengarah pada packagist.telkomuniversity.ac.id.

Changed current directory to /home/hanang/.config/composer
Reading ./composer.json
Loading config file /home/hanang/.config/composer/config.json
Loading config file /home/hanang/.config/composer/auth.json
Loading config file ./composer.json
Loading config file /home/hanang/.config/composer/auth.json
Reading /home/hanang/.config/composer/auth.json
Checked CA file /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem: valid
Executing command (/home/hanang/.config/composer): git branch --no-color --no-abbrev -v
Executing command (/home/hanang/.config/composer): git describe --exact-match --tags
Executing command (/home/hanang/.config/composer): git log --pretty="%H" -n1 HEAD
Executing command (/home/hanang/.config/composer): hg branch
Executing command (/home/hanang/.config/composer): fossil branch list
Executing command (/home/hanang/.config/composer): fossil tag list
Executing command (/home/hanang/.config/composer): svn info --xml
Reading /home/hanang/.config/composer/vendor/composer/installed.json
Running 1.9.1 (2019-11-01 17:20:17) with PHP 7.3.13 on Linux / 3.10.0-1062.4.3.el7.x86_64
Downloading https://packagist.telkomuniversity.ac.id/packages.json
Writing /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/packages.json into cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2013.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2014.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2015.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2016.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2017.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2018.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2019.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2019-04.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2019-07.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2019-10.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2020-01.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-archived.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-latest.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-laravel$installer.json from cache
./composer.json has been updated
Reading ./composer.json
Loading config file /home/hanang/.config/composer/config.json
Loading config file /home/hanang/.config/composer/auth.json
Loading config file ./composer.json
Loading config file /home/hanang/.config/composer/auth.json
Reading /home/hanang/.config/composer/auth.json
Executing command (/home/hanang/.config/composer): git branch --no-color --no-abbrev -v
Executing command (/home/hanang/.config/composer): git describe --exact-match --tags
Executing command (/home/hanang/.config/composer): git log --pretty="%H" -n1 HEAD
Executing command (/home/hanang/.config/composer): hg branch
Executing command (/home/hanang/.config/composer): fossil branch list
Executing command (/home/hanang/.config/composer): fossil tag list
Executing command (/home/hanang/.config/composer): svn info --xml
Reading /home/hanang/.config/composer/vendor/composer/installed.json
Reading ./composer.lock
Loading composer repositories with package information
Downloading https://packagist.telkomuniversity.ac.id/packages.json
Writing /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2013.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2014.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2015.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2016.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2017.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2018.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2019.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2019-04.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2019-07.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2019-10.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-2020-01.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-archived.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/p-provider-latest.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-doctrine$instantiator.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-guzzlehttp$promises.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-guzzlehttp$psr7.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-guzzlehttp$guzzle.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-psr$http-message.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-ralouphie$getallheaders.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-symfony$console.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-symfony$filesystem.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-symfony$process.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-laravel$installer.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-guzzlehttp$streams.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-guzzlehttp$ringphp.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-react$promise.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-symfony$polyfill-mbstring.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-symfony$debug.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-symfony$contracts.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-symfony$polyfill-php73.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-symfony$service-contracts.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-symfony$polyfill-ctype.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-psr$log.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-psr$cache.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-psr$container.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-myclabs$deep-copy.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phar-io$version.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phar-io$manifest.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phpdocumentor$reflection-common.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phpdocumentor$type-resolver.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-webmozart$assert.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phpdocumentor$reflection-docblock.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$comparator.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$recursion-context.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phpspec$prophecy.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-dflydev$markdown.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$diff.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$exporter.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phpunit$php-file-iterator.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phpunit$php-text-template.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phpunit$php-token-stream.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$code-unit-reverse-lookup.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$environment.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$version.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-theseer$tokenizer.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phpunit$php-code-coverage.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phpunit$php-timer.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$global-state.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$object-enumerator.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$resource-operations.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$type.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-phpunit$phpunit.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-sebastian$object-reflector.json from cache
Reading /home/hanang/.cache/composer/repo/https---packagist.telkomuniversity.ac.id/provider-illuminate$support.json from cache
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.087 seconds
Analyzed 8252 packages to resolve dependencies
Analyzed 225026 rules to resolve dependencies
Nothing to install or update
Reading /home/hanang/.config/composer/vendor/composer/installed.json
Generating autoload files
[hanang@proline ~]$

 

Untuk menonakifkan mirror kamu cukup menjalankan perintah di bawah ini pada terminal konsol:

composer config -g --unset repos.packagist