extendedGitGraph ================ Displays a Commit Table for every of your github-years. This is practically a copy of githubs Commit-Graph functionality. But with the extra feature of showing commits older than a year, from private repositories abd from other git remotes. *See it live in action [here](https://www.mikescher.com/about)* ### How to use: Create a new ExtendedGitGraph object The constructor parameters are: * the path to the cache file * The output mode - STDOUT: Log to `print` and logfile - SESSION: Log session-variable and logfile (used for ajax calls) - LOGFILE: Only log to logfile * The logfile path. The 4 latest logs are kept and the placeholder {num} is used for different filenames ~~~php include 'src/ExtendedGitGraph.php'; $v = new ExtendedGitGraph(__DIR__ . '/egh_cache.bin', ExtendedGitGraph::OUT_STDOUT, __DIR__ . '/../temp/egh_log{num}.log'); ~~~ Next you need to add sources for us to search, currently supported are: * Github User accounts * Github Repositories * Gitea User accounts *(WIP)* * Gitea Repositories *(WIP)* ~~~php $v->addRemote('github-user', null, 'Mikescher', 'Mikescher'); $v->addRemote('github-user', null, 'Mikescher', 'Blackforestbytes'); $v->addRemote('github-repository', null, 'Mikescher', 'Anastron/ColorRunner'); $v->addRemote('gitea-user', null, 'Mikescher', 'Mikescher'); $v->addRemote('gitea-repository', null, 'Mikescher', 'Benzin/MVU_API'); ~~~ If you use github you need to specify an API token to get more than 60 API calls: (get one from [Github -> Settings -> Developer Settings -> Personal access tokens](https://github.com/settings/tokens)) ~~~php $v->ConnectionGithub->setAPIToken('1234567890ABCDEF'); ~~~ If you use gitea you need to specify the server url ~~~php $v->ConnectionGitea->setURL('https://my-git-server.tld'); ~~~ Now we generate the graphs, first call `init()` ~~~php $v->init(); ~~~ Then either query the data from our specified sources with `updateFromRemotes()` or load teh values from the last query from our specified cache file with `updateFromCache()` ~~~php $v->updateFromRemotes(); //$v->updateFromCache(); ~~~ Next call `generate()` to create HTML and get the snippets by calling `get()`. ~~~php $v->setColorScheme('blue'); $v->generate(); foreach ($v->get() as $year => $html) { file_put_contents(__DIR__ . '/../output/out_'.$year.'.html', $html); } ~~~ You can set the used color scheme with `setColorScheme`, supported are: - custom - standard - modern - gray - red - blue - purple - orange - halloween ![](https://raw.githubusercontent.com/Mikescher/extendedGitGraph/master/README-DATA/preview_orange.png) ![](https://raw.githubusercontent.com/Mikescher/extendedGitGraph/master/README-DATA/preview_purple.png) ![](https://raw.githubusercontent.com/Mikescher/extendedGitGraph/master/README-DATA/preview_green.png) ![](https://raw.githubusercontent.com/Mikescher/extendedGitGraph/master/README-DATA/preview_red.png) ### Reload with Ajax: The reloading can take a **long** time if you have a lot of commits and repositories. Because of that you can also refresh via Ajax: - Call the file `ajax/ajaxReload.php?scheme=x` to start the reloading - Call the file `ajax/ajaxStatus.php` to get the current status (for displaying purposes) - Call the file `ajax/ajaxRedraw.php?scheme=x` to only redraw from cache > **Attention:** > You need to create a file `ajaxSecret.php` that returns an ExtendedGitGraph object with your settings (remotes, repositories, tokens, etc). > Don't forget to set output mode to `ExtendedGitGraph::OUT_SESSION` Below a crappy example implementation with jQuerys Ajax calls: ~~~html