Installation

The Packagist project is developed based on Symfony.

Prerequisites

  • PHP Web runtime environment
  • Symfony CLI
  • MySQL database
  • Redis
  • Git

Installation

git clone [email protected]:composer/packagist.git

Create Database

Create a database named packagist.

Install Dependencies

composer install

Modify Configuration File

Edit the app/config/parameters.yml file in the project directory and modify it according to your actual environment.

# This file is auto-generated during the composer install
parameters:
  database_driver: pdo_mysql
  database_host: 127.0.0.1
  database_name: packagist
  database_user: root
  database_password: Password
  database_name_test: packagist_test
  mailer_transport: null
  mailer_host: localhost
  mailer_user: null
  mailer_password: null
  mailer_from_email: [email protected]
  mailer_from_name: 'Admin Team'
  mailer_encryption: tls
  mailer_auth_mode: login
  redis_dsn: 'redis://localhost/1'
  redis_dsn_test: 'redis://127.0.0.1/14'
  redis_session_dsn: 'redis://localhost/2'
  locale: en
  google_analytics:
    ga_key: null
  github.client_id: CHANGE_ME_IN_PROD
  github.client_secret: CHANGE_ME_IN_PROD
  github.webhook_secret: CHANGE_ME_IN_PROD
  validation_cache_backend: null
  doctrine_cache_backend: array
  secret: CHANGE_ME_IN_PROD
  remember_me.secret: CHANGE_ME_IN_PROD
  force_ssl: false
  trusted_hosts: null
  algolia.app_id: CHANGE_ME
  algolia.admin_key: CHANGE_ME
  algolia.search_key: CHANGE_ME
  algolia.index_name: packagist

Create Database Tables

app/console doctrine:schema:create

Add Scheduled Task

Add the following command to CRON Job. This command is used to update package information.

app/console packagist:run-workers

Run the Service

symfony serve

I hope this is helpful, Happy hacking…