PHPackages                             premekkoch/github-service - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. premekkoch/github-service

ActiveLibrary

premekkoch/github-service
=========================

Nette Framework service to get file last modification date from GitHub

0.2.0(6y ago)047MITPHPPHP &gt;=7.1

Since Mar 5Pushed 6y ago1 watchersCompare

[ Source](https://github.com/premekkoch/github-service)[ Packagist](https://packagist.org/packages/premekkoch/github-service)[ RSS](/packages/premekkoch-github-service/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (10)Used By (0)

PremekKoch\\github-service
==========================

[](#premekkochgithub-service)

Use this service, if you want to find the last modification date of your repository file on github. Service uses a cache for performace reasons.

Instalation
-----------

[](#instalation)

```
composer require premekkoch/github-service

```

Configuration
-------------

[](#configuration)

### 1. Add section "Github" to `parameters` section in `config.neon`:

[](#1-add-section-github-to-parameters-section-in-configneon)

```
  parameters:
    GitHub:
      user: GITHUB_USER
      repo: REPOSITORY_NAME
      subdir: REPOSITORY_SUBDIRECTORY
      client_id: CLIENT_ID
      client_secret: CLIENT_SECRET

```

*Item `subdir` can be empty - use it, if you're working only with one of repo directory only.*

### 2. Register a service in `config.neon`:

[](#2-register-a-service-in-configneon)

```
services:
	  githubService: PremekKoch\GitHub\GitHubService(%GitHub.user%, %GitHub.repo%, %GitHub.subdir%, %GitHub.client_id%, %GitHub.client_secret%)

```

How to use
----------

[](#how-to-use)

### 1. Simple use:

[](#1-simple-use)

Inject an service into presenter

```
  /** @var PremekKoch\GitHub\GitHubService @inject */
  public $githubService;

```

and then call service method

```
	:
  $file = 'test.md';
  $this->githubService->getFileLastCommit($file, TRUE);
	:

```

By setting second parameter "useCache" you can decide, if you want to get cashed or "live" data. If this parameter is set to FALSE, GitHub API is called and cache is refreshed automaticaly for this file.

### 2. Cache refresh:

[](#2-cache-refresh)

Simply call

```
	$this->githubService->refreshGithubCache();

```

to refresh cache for all files. Or you can do something like this for refresh `.md` files cache only:

```
  $tree = $this->gitHubService->getFilesTree();
  foreach ($tree as $file) {
    if (strpos($file->path, '.md')) {
      $this->gitHubService->getFileLastCommit($file->path, FALSE);
  }

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~183 days

Recently: every ~355 days

Total

9

Last Release

2251d ago

PHP version history (2 changes)0.0.1PHP &gt;=5.4

0.2.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/0124c7578878cd1f7e1987a73f731277f113af61a4f623d8a8266a2e40f87684?d=identicon)[premekkoch](/maintainers/premekkoch)

---

Top Contributors

[![premekkoch](https://avatars.githubusercontent.com/u/895425?v=4)](https://github.com/premekkoch "premekkoch (12 commits)")

### Embed Badge

![Health badge](/badges/premekkoch-github-service/health.svg)

```
[![Health](https://phpackages.com/badges/premekkoch-github-service/health.svg)](https://phpackages.com/packages/premekkoch-github-service)
```

###  Alternatives

[nette/nette

👪 Nette Framework - innovative framework for fast and easy development of secured web applications in PHP (metapackage)

1.6k2.8M333](/packages/nette-nette)[nette/code-checker

✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.

881.7M6](/packages/nette-code-checker)[nette/web-project

Nette: Standard Web Project

10991.8k](/packages/nette-web-project)[kdyby/autowired

Syntax sugar for working with services in Nette Framework

30885.7k9](/packages/kdyby-autowired)[contributte/forms-bootstrap

Nette extension for Bootstrap forms

211.1M4](/packages/contributte-forms-bootstrap)[tomaj/nette-api

Nette api

36261.8k4](/packages/tomaj-nette-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
