mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
use realpath for files
This commit is contained in:
@@ -153,11 +153,11 @@ class Debug extends CI_Controller
|
||||
public function selfupdate() {
|
||||
if (file_exists('.git')) {
|
||||
try {
|
||||
$st=exec('touch ./.maintenance');
|
||||
$st=exec('touch '.realpath(APPPATH.'../').'/.maintenance');
|
||||
$st=exec('git stash push --include-untracked');
|
||||
$st=exec('git pull --rebase');
|
||||
$st=exec('git pull');
|
||||
$st=exec('git stash pop');
|
||||
$st=exec('rm ./.maintenance');
|
||||
$st=exec('rm '.realpath(APPPATH.'../').'/.maintenance');
|
||||
} catch (\Throwable $th) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (file_exists('.git')) { ?>
|
||||
<?php if (file_exists(realpath(APPPATH.'../').'/.git')) { ?>
|
||||
<?php
|
||||
//Below is a failsafe where git commands fail
|
||||
try {
|
||||
@@ -217,7 +217,7 @@
|
||||
$commitDate = trim(exec('git log --pretty="%ci" -n1 HEAD'));
|
||||
$line = trim(exec('git log -n 1 --pretty=%D HEAD'));
|
||||
$pieces = explode(', ', $line);
|
||||
$lastFetch = trim(exec('stat -c %Y .git/FETCH_HEAD'));
|
||||
$lastFetch = trim(exec('stat -c %Y '.realpath(APPPATH.'../').'/.git/FETCH_HEAD'));
|
||||
//Below is a failsafe for systems without the stat command
|
||||
try {
|
||||
$dt = new DateTime("@$lastFetch");
|
||||
|
||||
Reference in New Issue
Block a user