Permalink
Browse files

Fixed some syntax errors

  • Loading branch information...
1 parent 3f491a6 commit 2965c492a5a7f25f7b5fe10985ffcd3f5679f3cd @xanmanning xanmanning committed Jun 22, 2010
Showing with 33 additions and 23 deletions.
  1. +10 −10 commit.php
  2. +3 −2 config.php
  3. +3 −3 filestuff.php
  4. +4 −4 git.php
  5. +4 −4 html_helpers.php
  6. +9 −0 index.php
View
@@ -217,22 +217,22 @@ function save_bundle() {
$fname = "";
do {
$fname = create_random_message(9);
- } while (is_file("{$dname}{$fname}"));
- $fullpath = "{$dname}{$fname}";
+ } while (is_file($dname . $fname));
+ $fullpath = $dname . $fname;
if (false == move_uploaded_file($_FILES['bundle_file']['tmp_name'], $fullpath)) {
return false;
}
chmod($fullpath, 0666);
- $file = fopen("{$fullpath}.txt", "w");
+ $file = fopen($fullpath . ".txt", "w");
fwrite($file, $_POST['commiter_name'], 40);
fclose($file);
- chmod("{$fullpath}.txt", 0666);
+ chmod($fullpath . ".txt", 0666);
// send e-mail message about the commitment
- $message = "{$_POST['commiter_name']}\n {$fullpath}\n";
- $headers = "From: {$CONFIG['email_address']}\r\n" .
- "Reply-To: {$CONFIG['email_address']}\r\n" .
+ $message = $_POST['commiter_name'] . "\n " . $fullpath . "\n";
+ $headers = "From: " . $CONFIG['email_address'] . "\r\n" .
+ "Reply-To: " . $CONFIG['email_address'] . "\r\n" .
'X-Mailer: PHP/' . phpversion();
- $ok = mail($CONFIG['email_address'], "Bundle sent to {$repo}", $message, $headers);
+ $ok = mail($CONFIG['email_address'], "Bundle sent to " . $repo, $message, $headers);
if (!$ok) {
echo "Error sending email message\n";
}
@@ -242,11 +242,11 @@ function save_bundle() {
// check if a tag is in repository
function check_tag_in_repo($the_tag) {
global $CONFIG['repo_directory'];
- $repo=$_GET['p'];
+ $repo = $_GET['p'];
$out = array();
$nr=0;
do {
- $cmd="GIT_DIR=".escapeshellarg($CONFIG['repo_directory'].$repo)." git rev-list --all --full-history --topo-order ";
+ $cmd="GIT_DIR=" . escapeshellarg($CONFIG['repo_directory'] . $repo) . " git rev-list --all --full-history --topo-order ";
$cmd .= "--max-count=1000 --skip=" .escapeshellarg($nr) ." ";
$cmd .= "--pretty=format:\"";
$cmd .= "parents %P%n";
View
@@ -44,8 +44,9 @@
$CONFIG['email_address'] = "mail@example.com";
$CONFIG['repo_title'] = "My public repository";
-/* The directory where repo directories reside */
+/* The directory where repo directories reside (Trailing slash) */
$CONFIG['repo_directory'] = "/var/user/";
+ $CONFIG['repo_directory'] = "/home/xan/git/";
/* The suffix, that can be used for complementing the repo directory,
* useful when you are using nonbare repositories, then:
@@ -68,7 +69,7 @@
/* if git is not installed into standard path, we need to set the path */
$mypath = getenv("PATH");
- $addpath = "/usr/bin/git";
+ $addpath = "/usr/local/git/bin";
if (isset($mypath)) {
$mypath .= ":" . $addpath;
} else {
View
@@ -28,15 +28,15 @@
function create_directory($fullpath) {
if(($fullpath[0] != '/') && ($fullpath[1] == 0)) {
- echo "Wrong path name $fullpath\n";
+ echo "Wrong path name " . $fullpath . "\n";
die();
}
if( ! is_dir($fullpath) ){
if( ! mkdir($fullpath) ){
- echo "Error by making directory $fullpath\n";
+ echo "Error by making directory " . $fullpath . "\n";
die();
}
- chmod( $fullpath, 0777 );
+ chmod($fullpath, 0777 );
return true;
}
return false;
View
@@ -336,14 +336,14 @@ function html_tree($proj, $tree) {
$plain = html_ahref(array('p' => $proj, 'dl' => "plain", 'h' => $obj['hash'], 'n' => $obj['file'])) . "plain</a>";
$dlfile = " | " . html_ahref(array('p' => $proj, 'dl' => "dlfile", 'h' => $obj['hash'], 'n' => $obj['file'])) . "file</a>";
$objlink = html_ahref(array('p' => $proj, 'a' => "jump_to_tag", 'b' => $obj['hash'], 'n' => $obj['file']), "blob") . $obj['file'] . "</a>\n";
- $ext=@$extEnscript[strrchr($obj['file'],".")];
+ $ext = @$extEnscript[strrchr($obj['file'], ".")];
if ($ext == "") {
$icon = "<img src=\"" . sanitized_url() . "dl=icon_plain\" style=\"border-width: 0px;\"/>";
} else {
$icon = "<img src=\"" . sanitized_url() . "dl=icon_color\" style=\"border-width: 0px;\"/>";
}
}
- echo "<tr><td>" . $perm . "</td><td>" . $icon . "</td></td><td>" . $objlink . "</td><td>" . $plain$dlfile . "</td></tr>\n";
+ echo "<tr><td>" . $perm . "</td><td>" . $icon . "</td></td><td>" . $objlink . "</td><td>" . $plain . $dlfile . "</td></tr>\n";
}
echo "</table>\n";
echo "</div>\n";
@@ -429,7 +429,7 @@ function html_shortlog($proj, $lines) {
$tree = html_ahref(array('p' => $_GET['p'], 'a' => "jump_to_tag", 'tag' => $cid, 'tr' => $tid, 't' => $tid, 'pg' => "")) . "tree</a>";
}
echo "<tr><td>{$date}</td>";
- echo "<td>" . html_ahref(array('p' => $_GET['p'], 'a' => "jump_to_tag", 'tag' => $cid)) . s"<img src=\"" . $CONFIG['repo_http_relpath'] . $CONFIG['cache_name'] . $proj . "/graph-" . $cid . ".png\" /></a></td>";
+ echo "<td>" . html_ahref(array('p' => $_GET['p'], 'a' => "jump_to_tag", 'tag' => $cid)) . "<img src=\"" . $CONFIG['repo_http_relpath'] . $CONFIG['cache_name'] . $proj . "/graph-" . $cid . ".png\" /></a></td>";
echo "<td>{$auth}</td><td>";
if (in_array($cid,$branches)) {
foreach($branches as $symbolic => $hashic) {
@@ -596,7 +596,7 @@ function get_file_owner($repopath) {
function get_last($repopath) {
global $CONFIG;
$out = array();
- $cmd = "GIT_DIR=" . escapeshellarg($repopath . $CONFIG['repo_suffix'])) . " git rev-list --header --max-count=1 HEAD 2>&1 | grep -a committer | cut -d' ' -f5-6";
+ $cmd = "GIT_DIR=" . escapeshellarg($repopath . $CONFIG['repo_suffix']) . " git rev-list --header --max-count=1 HEAD 2>&1 | grep -a committer | cut -d' ' -f5-6";
$date = exec($cmd, &$out);
return date($CONFIG['git_date_format'], (int)$date);
}
View
@@ -82,7 +82,7 @@ function html_ref($arguments, $prefix) {
}
function html_header() {
- global $CONFIG['repo_title'];
+ global $CONFIG;
global $git_embed;
if (!$git_embed) {
@@ -124,7 +124,7 @@ function html_breadcrumbs() {
}
function html_pages() {
- global $CONFIG['git_bundle_active'];
+ global $CONFIG;
if(isset($_GET['p'])) {
html_spacer();
$now = floor(time()/15/60); // one hour
@@ -139,7 +139,7 @@ function html_pages() {
function html_footer() {
global $git_embed;
- global $CONFIG['git_logo'];
+ global $CONFIG;
echo "<div class=\"gitfooter\">\n";
@@ -194,7 +194,7 @@ function html_title($text = "&nbsp;") {
}
function html_style() {
- global $CONFIG['git_css'];
+ global $CONFIG;
if (file_exists("style.css")) {
echo "<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />\n";
View
@@ -0,0 +1,9 @@
+<?php
+
+error_reporting(-1);
+
+$cat = "syntax error";
+
+echo "pants to you" $cat;
+
+?>

0 comments on commit 2965c49

Please sign in to comment.