-
Notifications
You must be signed in to change notification settings - Fork 23
/
autogit.php
executable file
·37 lines (31 loc) · 1020 Bytes
/
autogit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* Kirby Auto Git Plugin
*
* @version 0.6.1
* @author Pedro Borges <[email protected]>
* @copyright Pedro Borges <[email protected]>
* @link https://github.com/pedroborges/kirby-autogit
* @license MIT
*/
if (c::get('autogit', true)) {
// Load Auto Git class and dependencies
require_once(__DIR__.DS.'vendor'.DS.'autoload.php');
require_once(__DIR__.DS.'lib'.DS.'autogit.php');
// Helper function that returns an Autogit\Autogit instance
function autogit() {
return Autogit\Autogit::instance();
}
// Load routes
require_once(__DIR__.DS.'lib'.DS.'routes.php');
// Only load hooks, routes and widgets when
// the content directory is a Git repo
if (function_exists('panel')) {
// Load hooks
require_once(__DIR__.DS.'lib'.DS.'hooks.php');
// Load widgets
if (c::get('autogit.widget', true)) {
kirby()->set('widget', 'autogit', __DIR__.DS.'widgets'.DS.'autogit');
}
}
}