git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dennis Stosberg <dennis@stosberg.net>
To: Martin Langhoff <martin.langhoff@gmail.com>
Cc: Jakub Narebski <jnareb@gmail.com>, git@vger.kernel.org
Subject: [PATCH 1/3] gitweb: Declare global variables with "our"
Date: Wed, 21 Jun 2006 15:07:08 +0200	[thread overview]
Message-ID: <20060621130708.Gcbc6e5c@leonov.stosberg.net> (raw)
In-Reply-To: <20060621130535.G2b34d382@leonov.stosberg.net>

Variables declared with "my" in the file scope cannot be accessed from
subroutines with mod_perl.
---
 gitweb/gitweb.cgi |   55 ++++++++++++++++++++++++++---------------------------
 1 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index ef7fcbd..8f19fdb 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -16,21 +16,21 @@ use Encode;
 use Fcntl ':mode';
 binmode STDOUT, ':utf8';
 
-my $cgi = new CGI;
-my $version = "267";
-my $my_url = $cgi->url();
-my $my_uri = $cgi->url(-absolute => 1);
-my $rss_link = "";
+our $cgi = new CGI;
+our $version = "267";
+our $my_url = $cgi->url();
+our $my_uri = $cgi->url(-absolute => 1);
+our $rss_link = "";
 
 # location of the git-core binaries
-my $gitbin = "/usr/bin";
+our $gitbin = "/usr/bin";
 
 # absolute fs-path which will be prepended to the project path
-#my $projectroot = "/pub/scm";
-my $projectroot = "/home/kay/public_html/pub/scm";
+#our $projectroot = "/pub/scm";
+our $projectroot = "/home/kay/public_html/pub/scm";
 
 # version of the git-core binaries
-my $git_version = qx($gitbin/git --version);
+our $git_version = qx($gitbin/git --version);
 if ($git_version =~ m/git version (.*)$/) {
 	$git_version = $1;
 } else {
@@ -38,32 +38,31 @@ if ($git_version =~ m/git version (.*)$/
 }
 
 # location for temporary files needed for diffs
-my $git_temp = "/tmp/gitweb";
+our $git_temp = "/tmp/gitweb";
 
 # target of the home link on top of all pages
-my $home_link = $my_uri;
+our $home_link = $my_uri;
 
 # html text to include at home page
-my $home_text = "indextext.html";
+our $home_text = "indextext.html";
 
 # URI of default stylesheet
-my $stylesheet = "gitweb.css";
+our $stylesheet = "gitweb.css";
 
 # source of projects list
-#my $projects_list = $projectroot;
-my $projects_list = "index/index.aux";
+#our $projects_list = $projectroot;
+our $projects_list = "index/index.aux";
 
 # default blob_plain mimetype and default charset for text/plain blob
-my $default_blob_plain_mimetype = 'text/plain';
-my $default_text_plain_charset  = undef;
+our $default_blob_plain_mimetype = 'text/plain';
+our $default_text_plain_charset  = undef;
 
 # file to use for guessing MIME types before trying /etc/mime.types
 # (relative to the current git repository)
-my $mimetypes_file = undef;
-
+our $mimetypes_file = undef;
 
 # input validation and dispatch
-my $action = $cgi->param('a');
+our $action = $cgi->param('a');
 if (defined $action) {
 	if ($action =~ m/[^0-9a-zA-Z\.\-_]/) {
 		undef $action;
@@ -78,7 +77,7 @@ if (defined $action) {
 	}
 }
 
-my $order = $cgi->param('o');
+our $order = $cgi->param('o');
 if (defined $order) {
 	if ($order =~ m/[^0-9a-zA-Z_]/) {
 		undef $order;
@@ -86,7 +85,7 @@ if (defined $order) {
 	}
 }
 
-my $project = $cgi->param('p');
+our $project = $cgi->param('p');
 if (defined $project) {
 	$project = validate_input($project);
 	if (!defined($project)) {
@@ -108,7 +107,7 @@ if (defined $project) {
 	exit;
 }
 
-my $file_name = $cgi->param('f');
+our $file_name = $cgi->param('f');
 if (defined $file_name) {
 	$file_name = validate_input($file_name);
 	if (!defined($file_name)) {
@@ -116,7 +115,7 @@ if (defined $file_name) {
 	}
 }
 
-my $hash = $cgi->param('h');
+our $hash = $cgi->param('h');
 if (defined $hash) {
 	$hash = validate_input($hash);
 	if (!defined($hash)) {
@@ -124,7 +123,7 @@ if (defined $hash) {
 	}
 }
 
-my $hash_parent = $cgi->param('hp');
+our $hash_parent = $cgi->param('hp');
 if (defined $hash_parent) {
 	$hash_parent = validate_input($hash_parent);
 	if (!defined($hash_parent)) {
@@ -132,7 +131,7 @@ if (defined $hash_parent) {
 	}
 }
 
-my $hash_base = $cgi->param('hb');
+our $hash_base = $cgi->param('hb');
 if (defined $hash_base) {
 	$hash_base = validate_input($hash_base);
 	if (!defined($hash_base)) {
@@ -140,7 +139,7 @@ if (defined $hash_base) {
 	}
 }
 
-my $page = $cgi->param('pg');
+our $page = $cgi->param('pg');
 if (defined $page) {
 	if ($page =~ m/[^0-9]$/) {
 		undef $page;
@@ -148,7 +147,7 @@ if (defined $page) {
 	}
 }
 
-my $searchtext = $cgi->param('s');
+our $searchtext = $cgi->param('s');
 if (defined $searchtext) {
 	if ($searchtext =~ m/[^a-zA-Z0-9_\.\/\-\+\:\@ ]/) {
 		undef $searchtext;
-- 
1.4.0

  reply	other threads:[~2006-06-21 13:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-20 16:51 [RFC] gitweb wishlist and TODO list Jakub Narebski
2006-06-20 17:33 ` Carl Worth
2006-06-20 17:46   ` Jakub Narebski
2006-06-20 17:55     ` Petr Baudis
2006-06-20 18:34       ` Jakub Narebski
2006-06-20 18:40         ` Petr Baudis
2006-06-21 14:52       ` Jakub Narebski
2006-06-20 19:33 ` Martin Langhoff
2006-06-20 19:56   ` Jakub Narebski
2006-06-20 21:17     ` Martin Langhoff
2006-07-01 10:35       ` Paul Mackerras
2006-06-21 13:05   ` Dennis Stosberg
2006-06-21 13:07     ` Dennis Stosberg [this message]
2006-06-21 13:08     ` [PATCH 2/3] Add a parameter to specify the repository path Dennis Stosberg
2006-06-21 13:09     ` [PATCH 3/3] gitweb: Use --git-dir parameter instead of setting $ENV{'GIT_DIR'} Dennis Stosberg
2006-06-21 13:33       ` Timo Hirvonen
2006-06-21 13:42         ` Jakub Narebski
2006-06-21 13:30     ` [RFC] gitweb wishlist and TODO list Jakub Narebski
2006-06-22 10:00       ` Dennis Stosberg
2006-06-22 14:47         ` Ryan Anderson
2006-06-21 16:45     ` Ryan Anderson
2006-06-21 17:36       ` Jakub Narebski
2006-06-20 19:46 ` Junio C Hamano
2006-06-20 20:10 ` Petr Baudis
2006-06-20 20:59   ` Jakub Narebski
2006-06-20 21:25 ` Petr Baudis
2006-06-20 21:53 ` Thomas Glanzmann
2006-06-21  8:56   ` Josef Weidendorfer
2006-06-21  9:15     ` Jakub Narebski
2006-06-21  9:57       ` Josef Weidendorfer
2006-06-21 13:53         ` Jakub Narebski
     [not found]           ` <200606211802.41071.Josef.Weidendorfer@gmx.de>
2006-06-21 16:38             ` Jakub Narebski
2006-06-21 20:35               ` Josef Weidendorfer
2006-06-22  9:01 ` Jakub Narebski
2006-06-22  9:14   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060621130708.Gcbc6e5c@leonov.stosberg.net \
    --to=dennis@stosberg.net \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=martin.langhoff@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).