Subversion Repositories php_utils

Rev

Rev 80 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 80 Rev 81
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
3
/*
3
/*
4
 * PHP git functions
4
 * PHP git functions
5
 * Copyright 2021 - 2023 Daniel Marschall, ViaThinkSoft
5
 * Copyright 2021 - 2023 Daniel Marschall, ViaThinkSoft
6
 * Revision 2023-04-09
6
 * Revision 2023-04-10
7
 *
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this file except in compliance with the License.
9
 * you may not use this file except in compliance with the License.
10
 * You may obtain a copy of the License at
10
 * You may obtain a copy of the License at
11
 *
11
 *
Line 75... Line 75...
75
                        $basename = substr(basename($basename),0,strlen(basename($basename))-5);
75
                        $basename = substr(basename($basename),0,strlen(basename($basename))-5);
76
                        try {
76
                        try {
77
                                if (class_exists('ViaThinkSoft\Glip\Git')) {
77
                                if (class_exists('ViaThinkSoft\Glip\Git')) {
78
                                        // https://github.com/danielmarschall/glip
78
                                        // https://github.com/danielmarschall/glip
79
                                        // composer require danielmarschall/glip
79
                                        // composer require danielmarschall/glip
80
                                        $git = new Git($git_dir);
80
                                        $git = new ViaThinkSoft\Glip\Git($git_dir);
81
                                        $obj = $git->getObject(hex2bin($commit_object));
81
                                        $obj = $git->getObject(hex2bin($commit_object));
82
                                        return $obj->detail;
82
                                        return $obj->detail;
83
                                } else {
83
                                } else {
84
                                        // Own implementation (cannot read delta objects yet)
84
                                        // Own implementation (cannot read delta objects yet)
85
                                        return git_read_object($commit_object,
85
                                        return git_read_object($commit_object,