Subversion Repositories php_utils

Rev

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

Rev 21 Rev 22
Line 1... Line 1...
1
<?php
1
<?php
2
 
2
 
3
/*
3
/*
4
 * PHP git functions
4
 * PHP git functions
5
 * Copyright 2021 Daniel Marschall, ViaThinkSoft
5
 * Copyright 2021 Daniel Marschall, ViaThinkSoft
6
 * Revision 2021-12-13
6
 * Revision 2021-12-29
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 67... Line 67...
67
                $ary = explode(chr(0), $uncompressed);
67
                $ary = explode(chr(0), $uncompressed);
68
                $uncompressed = array_pop($ary);
68
                $uncompressed = array_pop($ary);
69
 
69
 
70
                return $uncompressed;
70
                return $uncompressed;
71
        } else {
71
        } else {
72
                $pack_files = glob($objects_dir.'/pack/pack-*.pack');
72
                $pack_files = @glob($objects_dir.'/pack/pack-*.pack');
73
                $last_exception = 'No pack files found';
73
                $last_exception = 'No pack files found';
74
                foreach ($pack_files as $basename) {
74
                if ($pack_files) foreach ($pack_files as $basename) {
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
                                return git_read_object($commit_object,
77
                                return git_read_object($commit_object,
78
                                        $objects_dir.'/pack/'.$basename.'.idx',
78
                                        $objects_dir.'/pack/'.$basename.'.idx',
79
                                        $objects_dir.'/pack/'.$basename.'.pack',
79
                                        $objects_dir.'/pack/'.$basename.'.pack',