PHP code example of bychekru / git-ranker

1. Go to this page and download the library: Download bychekru/git-ranker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bychekru / git-ranker example snippets



:init([
    'app_dir' => __DIR__, // local app dir
    'repo_local_path' => __DIR__, // local repository path
    'repo_remote_path' => 'BychekRU/git_ranker', // username/repository
    'repo_branch' => 'main', // repo branch
    'git_path' => 'C:\Program Files\Git\bin', // path to local Git Bash instanse
    'mode' => 'remote', // local or remote
    'commits_per_page' => 15, // commits on page
    'process_rebased_count' => 100, // check integrity of last 100 commits
    'error_handler' => function($error){ // function will called when error will occur
        var_dump($error);
        exit();
    },
    'github' => [
        'username' => 'login', // github username
        'token' => 'ghp_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', // github token
        // if you use GitHub class for authentification, you can state
        'app_id' => '', // github app id
        'app_secret' => '', // github app secret
    ],
]);