Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merge apache2-rename-unstable to trunk

git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@159508 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 964dc7936059d024e12ca59c9a68df57980eca36 1 parent 548cb9d
Geoffrey Young authored
Showing with 2,155 additions and 2,344 deletions.
  1. +20 −0 Changes
  2. +47 −66 Makefile.PL
  3. +2 −2 ModPerl-Registry/Makefile.PL
  4. +1 −1  ModPerl-Registry/README
  5. +44 −44 ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  6. +7 −7 ModPerl-Registry/lib/ModPerl/RegistryLoader.pm
  7. +2 −2 ModPerl-Registry/t/TEST.PL
  8. +5 −5 ModPerl-Registry/t/cgi-bin/304.pl
  9. +6 −6 ModPerl-Registry/t/cgi-bin/ithreads_io_n_tie.pl
  10. +4 −4 ModPerl-Registry/t/cgi-bin/redirect-cookie.pl
  11. +1 −1  ModPerl-Registry/t/cgi-bin/redirect.pl
  12. +2 −2 ModPerl-Registry/t/cgi-bin/runtime_error_n_status_change.pl
  13. +1 −1  ModPerl-Registry/t/cgi-bin/special_blocks.pl
  14. +2 −2 ModPerl-Registry/t/cgi-bin/status_change.pl
  15. +1 −1  ModPerl-Registry/t/cgi.t
  16. +2 −6 ModPerl-Registry/t/conf/extra.conf.in
  17. +6 −6 ModPerl-Registry/t/conf/modperl_extra_startup.pl
  18. +1 −1  bin/mp2bug
  19. +0 −18 bin/mp2doc
  20. +3 −3 build/source_scan.pl
  21. +32 −89 lib/{Apache → Apache2}/Build.pm
  22. +13 −13 lib/{Apache → Apache2}/ParseSource.pm
  23. +14 −14 lib/{Apache → Apache2}/PerlSections.pm
  24. +3 −3 lib/{Apache → Apache2}/PerlSections/Dump.pm
  25. +19 −19 lib/{Apache → Apache2}/Reload.pm
  26. +13 −13 lib/{Apache → Apache2}/Resource.pm
  27. +19 −19 lib/{Apache → Apache2}/SizeLimit.pm
  28. +7 −7 lib/{Apache → Apache2}/SourceTables.pm
  29. +68 −86 lib/{Apache → Apache2}/Status.pm
  30. +1 −1  lib/{Apache → Apache2}/XSLoader.pm
  31. +125 −123 lib/{Apache → Apache2}/compat.pm
  32. +10 −10 lib/{Apache → Apache2}/porting.pm
  33. +7 −39 lib/ModPerl/BuildMM.pm
  34. +3 −4 lib/ModPerl/BuildOptions.pm
  35. +9 −9 lib/ModPerl/Code.pm
  36. +4 −4 lib/ModPerl/Config.pm
  37. +1 −1  lib/ModPerl/FunctionMap.pm
  38. +3 −57 lib/ModPerl/MM.pm
  39. +6 −6 lib/ModPerl/MapUtil.pm
  40. +2 −2 lib/ModPerl/ParseSource.pm
  41. +1 −1  lib/ModPerl/TestReport.pm
  42. +3 −3 lib/ModPerl/TestRun.pm
  43. +8 −8 lib/ModPerl/TypeMap.pm
  44. +27 −27 lib/ModPerl/WrapXS.pm
  45. +5 −2 lib/{mod_perl.pm → mod_perl2.pm}
  46. +3 −3 src/modules/perl/mod_perl.c
  47. +6 −6 src/modules/perl/modperl_callback.c
  48. +1 −1  src/modules/perl/modperl_callback.h
  49. +5 −5 src/modules/perl/modperl_cmd.c
  50. +4 −4 src/modules/perl/modperl_const.c
  51. +10 −10 src/modules/perl/modperl_filter.c
  52. +10 −10 src/modules/perl/modperl_io.c
  53. +10 −10 src/modules/perl/modperl_io_apache.c
  54. +5 −5 src/modules/perl/modperl_module.c
  55. +5 −5 src/modules/perl/modperl_util.c
  56. +0 −81 t/apache/constants.t
  57. +2 −2 t/{apache → apache2}/add_config.t
  58. +1 −1  t/{apache → apache2}/cgihandler.t
  59. +79 −0 t/apache2/constants.t
  60. +1 −1  t/{apache → apache2}/content_length_header.t
  61. +1 −1  t/{apache → apache2}/discard_rbody.t
  62. +1 −1  t/{apache → apache2}/post.t
  63. +1 −1  t/{apache → apache2}/read.t
  64. +1 −1  t/{apache → apache2}/read2.t
  65. +1 −1  t/{apache → apache2}/scanhdrs.t
  66. +1 −1  t/{apache → apache2}/scanhdrs2.t
  67. +1 −1  t/{apache → apache2}/send_cgi_header.t
  68. +2 −2 t/api/custom_response.t
  69. +1 −1  t/api/status.t
  70. +2 −2 t/apr-ext/perlio.t
  71. +2 −2 t/apr-ext/uuid.t
  72. +0 −1  t/apr/constants.t
  73. +2 −2 t/compat/request_body.t
  74. +2 −2 t/conf/extra.conf.in
  75. +6 −6 t/conf/extra.last.conf.in
  76. +16 −18 t/conf/modperl_extra.pl
  77. +31 −31 t/conf/post_config_startup.pl
  78. +1 −1  t/directive/perl.t
  79. +10 −10 t/filter/TestFilter/both_str_con_add.pm
  80. +11 −11 t/filter/TestFilter/both_str_native_remove.pm
  81. +10 −10 t/filter/TestFilter/both_str_req_add.pm
  82. +8 −8 t/filter/TestFilter/both_str_req_mix.pm
  83. +8 −8 t/filter/TestFilter/both_str_req_proxy.pm
  84. +3 −3 t/filter/TestFilter/in_autoload.pm
  85. +7 −7 t/filter/TestFilter/in_bbs_body.pm
  86. +7 −7 t/filter/TestFilter/in_bbs_consume.pm
  87. +13 −13 t/filter/TestFilter/in_bbs_inject_header.pm
  88. +6 −6 t/filter/TestFilter/in_bbs_msg.pm
  89. +7 −7 t/filter/TestFilter/in_bbs_underrun.pm
  90. +6 −6 t/filter/TestFilter/in_error.pm
  91. +9 −9 t/filter/TestFilter/in_init_basic.pm
  92. +7 −7 t/filter/TestFilter/in_str_bin_data.pm
  93. +8 −8 t/filter/TestFilter/in_str_consume.pm
  94. +7 −7 t/filter/TestFilter/in_str_declined.pm
  95. +7 −7 t/filter/TestFilter/in_str_lc.pm
  96. +8 −8 t/filter/TestFilter/in_str_msg.pm
  97. +7 −7 t/filter/TestFilter/in_str_sandwich.pm
  98. +5 −5 t/filter/TestFilter/out_bbs_basic.pm
  99. +6 −6 t/filter/TestFilter/out_bbs_ctx.pm
  100. +7 −7 t/filter/TestFilter/out_bbs_filebucket.pm
  101. +8 −8 t/filter/TestFilter/out_init_basic.pm
  102. +14 −14 t/filter/TestFilter/out_str_api.pm
  103. +6 −6 t/filter/TestFilter/out_str_ctx.pm
  104. +8 −8 t/filter/TestFilter/out_str_declined.pm
  105. +6 −6 t/filter/TestFilter/out_str_eval.pm
  106. +3 −3 t/filter/TestFilter/out_str_lc.pm
  107. +7 −7 t/filter/TestFilter/out_str_remove.pm
  108. +8 −8 t/filter/TestFilter/out_str_req_eos.pm
  109. +5 −5 t/filter/TestFilter/out_str_req_mix.pm
  110. +7 −7 t/filter/TestFilter/out_str_reverse.pm
  111. +7 −7 t/filter/TestFilter/out_str_subreq_default.pm
  112. +8 −8 t/filter/TestFilter/out_str_subreq_modperl.pm
  113. +1 −1  t/filter/both_str_req_mix.t
  114. +1 −0  t/filter/out_str_req_mix.t
  115. +7 −7 t/hooks/TestHooks/access.pm
  116. +6 −6 t/hooks/TestHooks/authen_basic.pm
  117. +5 −5 t/hooks/TestHooks/authen_digest.pm
  118. +8 −8 t/hooks/TestHooks/authz.pm
  119. +7 −7 t/hooks/TestHooks/cleanup.pm
  120. +6 −6 t/hooks/TestHooks/cleanup2.pm
  121. +4 −4 t/hooks/TestHooks/fixup.pm
  122. +4 −4 t/hooks/TestHooks/headerparser.pm
  123. +19 −19 t/hooks/TestHooks/hookrun.pm
  124. +6 −6 t/hooks/TestHooks/init.pm
  125. +5 −5 t/hooks/TestHooks/inlined_handlers.pm
  126. +7 −7 t/hooks/TestHooks/push_handlers.pm
  127. +6 −6 t/hooks/TestHooks/push_handlers_blessed.pm
  128. +6 −6 t/hooks/TestHooks/push_handlers_same_phase.pm
  129. +5 −5 t/hooks/TestHooks/set_handlers.pm
  130. +9 −9 t/hooks/TestHooks/stacked_handlers.pm
  131. +12 −12 t/hooks/TestHooks/stacked_handlers2.pm
  132. +8 −8 t/hooks/TestHooks/startup.pm
  133. +5 −5 t/hooks/TestHooks/trans.pm
  134. +1 −2  t/hooks/trans.t
  135. +1 −1  t/htdocs/includes-registry/cgipm.pl
  136. +1 −1  t/htdocs/includes/clear.shtml
  137. BIN  t/htdocs/perlio/MoonRise.jpeg
  138. +4 −6 t/htdocs/vhost/post_config.pl
  139. +4 −5 t/htdocs/vhost/startup.pl
  140. +3 −3 t/lib/TestCommon/FilterDebug.pm
  141. +5 −5 t/lib/TestCommon/Handlers.pm
  142. +3 −3 t/lib/TestCommon/Utils.pm
  143. +21 −22 t/modperl/status.t
  144. +4 −4 t/modules/apache_resource.t
  145. +2 −2 t/modules/apache_status.t
  146. +3 −3 t/modules/cgi.t
  147. +3 −3 t/modules/cgi2.t
  148. +1 −1  t/modules/cgipost.t
  149. +1 −1  t/modules/cgipost2.t
  150. +3 −3 t/modules/cgiupload.t
  151. +3 −3 t/modules/cgiupload2.t
  152. +2 −1  t/modules/include.t
  153. +4 −4 t/modules/reload.t
  154. +5 −5 t/preconnection/TestPreConnection/note.pm
  155. +4 −4 t/protocol/TestProtocol/echo_bbs.pm
  156. +4 −4 t/protocol/TestProtocol/echo_bbs2.pm
  157. +4 −4 t/protocol/TestProtocol/echo_block.pm
  158. +6 −6 t/protocol/TestProtocol/echo_filter.pm
  159. +3 −3 t/protocol/TestProtocol/echo_nonblock.pm
  160. +4 −4 t/protocol/TestProtocol/echo_timeout.pm
  161. +4 −4 t/protocol/TestProtocol/eliza.pm
  162. +16 −16 t/protocol/TestProtocol/pseudo_http.pm
  163. +7 −7 t/response/TestAPI/access.pm
  164. +14 −14 t/response/TestAPI/access2.pm
  165. +27 −27 t/response/TestAPI/aplog.pm
  166. +8 −8 t/response/TestAPI/command.pm
  167. +7 −7 t/response/TestAPI/conn_rec.pm
  168. +9 −9 t/response/TestAPI/conn_util.pm
  169. +5 −5 t/response/TestAPI/content_encoding.pm
  170. +4 −4 t/response/TestAPI/custom_response.pm
  171. +4 −4 t/response/TestAPI/err_headers_out.pm
  172. +7 −7 t/response/TestAPI/in_out_filters.pm
  173. +6 −6 t/response/TestAPI/internal_redirect.pm
  174. +5 −5 t/response/TestAPI/internal_redirect_handler.pm
  175. +8 −8 t/response/TestAPI/lookup_misc.pm
  176. +8 −8 t/response/TestAPI/lookup_uri.pm
  177. +7 −7 t/response/TestAPI/lookup_uri2.pm
  178. +29 −29 t/response/TestAPI/module.pm
  179. +6 −6 t/response/TestAPI/process.pm
  180. +39 −39 t/response/TestAPI/query.pm
  181. +25 −25 t/response/TestAPI/request_rec.pm
  182. +5 −5 t/response/TestAPI/request_subclass.pm
  183. +9 −9 t/response/TestAPI/request_util.pm
  184. +5 −5 t/response/TestAPI/response.pm
  185. +6 −6 t/response/TestAPI/rflush.pm
  186. +4 −4 t/response/TestAPI/sendfile.pm
  187. +11 −11 t/response/TestAPI/server_const.pm
  188. +5 −5 t/response/TestAPI/server_rec.pm
  189. +27 −27 t/response/TestAPI/server_util.pm
  190. +5 −5 t/response/TestAPI/show.pm
  191. +3 −3 t/response/TestAPI/slurp_filename.pm
  192. +4 −4 t/response/TestAPI/status.pm
  193. +8 −8 t/response/TestAPI/sub_request.pm
  194. +7 −7 t/response/TestAPI/uri.pm
  195. +2 −2 t/response/TestAPR/base64.pm
  196. +3 −3 t/response/TestAPR/brigade.pm
  197. +4 −4 t/response/TestAPR/bucket.pm
  198. +2 −2 t/response/TestAPR/date.pm
  199. +4 −4 t/response/TestAPR/finfo.pm
  200. +3 −3 t/response/TestAPR/flatten.pm
  201. +4 −4 t/response/TestAPR/ipsubnet.pm
  202. +4 −4 t/response/TestAPR/os.pm
  203. +8 −8 t/response/TestAPR/perlio.pm
  204. +3 −3 t/response/TestAPR/pool.pm
  205. +4 −4 t/response/TestAPR/pool_lifetime.pm
  206. +4 −4 t/response/TestAPR/sockaddr.pm
  207. +4 −4 t/response/TestAPR/socket.pm
  208. +2 −2 t/response/TestAPR/string.pm
  209. +2 −2 t/response/TestAPR/table.pm
  210. +2 −2 t/response/TestAPR/threadmutex.pm
  211. +2 −2 t/response/TestAPR/uri.pm
  212. +2 −2 t/response/TestAPR/util.pm
  213. +2 −2 t/response/TestAPR/uuid.pm
  214. +6 −6 t/response/{TestApache → TestApache2}/cgihandler.pm
  215. +6 −6 t/response/{TestApache → TestApache2}/conftree.pm
  216. +6 −6 t/response/{TestApache → TestApache2}/content_length_header.pm
  217. +9 −9 t/response/{TestApache → TestApache2}/discard_rbody.pm
  218. +5 −5 t/response/{TestApache → TestApache2}/post.pm
  219. +5 −5 t/response/{TestApache → TestApache2}/read.pm
  220. +6 −6 t/response/{TestApache → TestApache2}/read2.pm
  221. +4 −4 t/response/{TestApache → TestApache2}/scanhdrs.pm
  222. +3 −3 t/response/{TestApache → TestApache2}/scanhdrs2.pm
  223. +4 −4 t/response/{TestApache → TestApache2}/send_cgi_header.pm
  224. +12 −12 t/response/{TestApache → TestApache2}/subprocess.pm
  225. +23 −23 t/response/{TestApache → TestApache2}/util.pm
  226. +5 −5 t/response/{TestApache → TestApache2}/write.pm
  227. +7 −8 t/response/TestCompat/apache.pm
  228. +4 −4 t/response/TestCompat/apache_file.pm
  229. +7 −7 t/response/TestCompat/apache_module.pm
  230. +1 −1  t/response/TestCompat/apache_table.pm
  231. +5 −5 t/response/TestCompat/apache_uri.pm
  232. +8 −8 t/response/TestCompat/apache_util.pm
  233. +3 −3 t/response/TestCompat/conn_authen.pm
  234. +5 −5 t/response/TestCompat/conn_rec.pm
  235. +6 −6 t/response/TestCompat/request.pm
  236. +1 −1  t/response/TestCompat/request_body.pm
  237. +6 −6 t/response/TestCompat/send_fd.pm
  238. +20 −20 t/response/TestDirective/cmdparms.pm
  239. +3 −3 t/response/TestDirective/env.pm
  240. +5 −5 t/response/TestDirective/perldo.pm
  241. +9 −9 t/response/TestDirective/perlloadmodule.pm
  242. +8 −8 t/response/TestDirective/perlloadmodule2.pm
  243. +16 −16 t/response/TestDirective/perlloadmodule3.pm
  244. +14 −14 t/response/TestDirective/perlloadmodule4.pm
  245. +14 −14 t/response/TestDirective/perlloadmodule5.pm
  246. +14 −14 t/response/TestDirective/perlloadmodule6.pm
  247. +4 −4 t/response/TestDirective/perlmodule.pm
  248. +4 −5 t/response/TestDirective/perlrequire.pm
  249. +2 −2 t/response/TestDirective/pod.pm
  250. +4 −4 t/response/TestDirective/setupenv.pm
  251. +5 −5 t/response/TestError/api.pm
  252. +5 −5 t/response/TestError/runtime.pm
  253. +4 −4 t/response/TestError/syntax.pm
  254. +5 −5 t/response/TestModperl/cookie.pm
  255. +5 −5 t/response/TestModperl/cookie2.pm
  256. +4 −4 t/response/TestModperl/current_callback.pm
  257. +9 −9 t/response/TestModperl/dir_config.pm
  258. +2 −2 t/response/TestModperl/endav.pm
  259. +3 −3 t/response/TestModperl/env.pm
  260. +2 −2 t/response/TestModperl/exit.pm
  261. +3 −3 t/response/TestModperl/getc.pm
  262. +5 −5 t/response/TestModperl/io_nested_with_closed_stds.pm
  263. +8 −8 t/response/TestModperl/io_with_closed_stds.pm
  264. +5 −5 t/response/TestModperl/merge.pm
  265. +2 −2 t/response/TestModperl/method.pm
  266. +1 −1  t/response/TestModperl/methodname.pm
  267. +1 −1  t/response/TestModperl/methodobj.pm
  268. +2 −2 t/response/TestModperl/perl.pm
  269. +6 −6 t/response/TestModperl/perl_options.pm
  270. +3 −3 t/response/TestModperl/pnotes.pm
  271. +4 −4 t/response/TestModperl/post_utf8.pm
  272. +4 −4 t/response/TestModperl/print.pm
  273. +5 −5 t/response/TestModperl/print_utf8.pm
  274. +4 −4 t/response/TestModperl/print_utf8_2.pm
  275. +5 −5 t/response/TestModperl/printf.pm
  276. +4 −4 t/response/TestModperl/readline.pm
  277. +6 −6 t/response/TestModperl/request_rec_perlio_api.pm
  278. +5 −5 t/response/TestModperl/request_rec_tie_api.pm
  279. +3 −3 t/response/TestModperl/sameinterp.pm
  280. +3 −3 t/response/TestModperl/setauth.pm
  281. +9 −9 t/response/TestModperl/setupenv.pm
  282. +10 −10 t/response/TestModperl/setupenv2.pm
  283. +3 −3 t/response/TestModperl/status.pm
  284. +3 −3 t/response/TestModperl/subenv.pm
  285. +9 −9 t/response/TestModperl/taint.pm
  286. +2 −2 t/response/TestModperl/util.pm
  287. +3 −3 t/response/TestModules/cgi.pm
  288. +3 −3 t/response/TestModules/cgi2.pm
  289. +3 −3 t/response/TestModules/cgipost.pm
  290. +3 −3 t/response/TestModules/cgipost2.pm
  291. +3 −3 t/response/TestModules/cgiupload.pm
  292. +3 −3 t/response/TestModules/cgiupload2.pm
  293. +2 −2 t/response/TestModules/include_subreq.pm
  294. +8 −8 t/response/TestModules/proxy.pm
  295. +8 −8 t/response/TestModules/reload.pm
  296. +4 −4 t/response/TestPerl/api.pm
  297. +5 −5 t/response/TestPerl/hash_attack.pm
  298. +2 −3 t/response/TestPerl/ithreads.pm
  299. +6 −6 t/response/TestPerl/signals.pm
  300. +10 −10 t/response/TestUser/rewrite.pm
Sorry, we could not display the entire diff because too many files (383) changed.
View
20 Changes
@@ -12,6 +12,26 @@ Also refer to the Apache::Test changes log file, at Apache-Test/Changes
=item 1.999_22-dev
+ ******************** IMPORTANT ********************
+ this version of mod_perl is completely incompatible
+ with prior versions of mod_perl, both 1.XX and
+ 1.99_XX. Please read the below changes carefully.
+ ***************************************************
+
+s/Apache::/Apache2::/g and s/mod_perl/mod_perl2/g in all module
+APIs [joes].
+
+remove MP_INST_APACHE2 installation option and Apache2.pm - all
+mod_perl related files will now be installed so they are visible
+via standard @INC. also, refuse to install over mod_perl 2 versions
+less than 1.999_22. [Geoffrey Young]
+
+add $ENV{MOD_PERL_API_VERSION} as something that clearly distinguishes
+which mod_perl version is being used at request time. [Geoffrey Young]
+
+remove CGI.pm and Apache::Request dependencies from Apache2::Status
+since they weren't used at all [Geoffrey Young]
+
Fixes for Apache::Reload's touchfile feature (return Apache::OK
instead of 1) [Chris Warren <chwarren@cisco.com>]
View
113 Makefile.PL
@@ -9,16 +9,17 @@ $ENV{MOD_PERL_2_BUILD} = 1;
use constant MIN_HTTPD_VERSION_DYNAMIC => '2.0.47';
use constant MIN_HTTPD_VERSION_STATIC => '2.0.51';
-my($old_modperl_version, $old_modperl_pm);
+my($old_modperl_version, $old_modperl_pm, $apache2_pm);
BEGIN {
eval {
+ require Apache2;
+ $apache2_pm = 1;
require mod_perl;
- if ($mod_perl::VERSION < 1.99) {
+ if ($mod_perl::VERSION < 1.999_22) {
$old_modperl_version = $mod_perl::VERSION;
+ $old_modperl_pm = delete $INC{'mod_perl.pm'};
}
- $old_modperl_pm = delete $INC{'mod_perl.pm'};
- %mod_perl:: = ();
};
}
@@ -32,7 +33,7 @@ use File::Copy 'cp';
use File::Basename 'basename';
use File::Find ();
-use Apache::Build ();
+use Apache2::Build ();
use Apache::TestSmokePerl ();
use Apache::TestTrace;
use ModPerl::TestReport ();
@@ -40,12 +41,12 @@ use ModPerl::TestRun ();
use ModPerl::Code ();
use ModPerl::BuildMM ();
-use constant WIN32 => Apache::Build::WIN32;
-use constant BUILD_APREXT => Apache::Build::BUILD_APREXT;
+use constant WIN32 => Apache2::Build::WIN32;
+use constant BUILD_APREXT => Apache2::Build::BUILD_APREXT;
our $VERSION;
-my $build = Apache::Build->new(init => 1);
+my $build = Apache2::Build->new(init => 1);
my $code = ModPerl::Code->new;
win32_fetch_apxs() if WIN32;
@@ -55,7 +56,6 @@ perl_version_check($build);
local %ModPerl::BuildMM::PM = (
'lib/typemap' => 'blib/lib/Apache2/typemap',
- 'lib/Apache2.pm' => 'blib/lib/Apache2.pm',
);
# these h files need to be installed system-wide so 3rd party XS
@@ -63,14 +63,13 @@ local %ModPerl::BuildMM::PM = (
my @xs_h_files = map catfile("xs", $_),
qw(modperl_xs_sv_convert.h modperl_xs_typedefs.h modperl_xs_util.h
APR/PerlIO/modperl_apr_perlio.h);
-
-my @exe_files = map "bin/$_", qw(mp2doc mp2bug);
+my @exe_files = map "bin/$_", qw(mp2bug);
ModPerl::BuildMM::WriteMakefile(
- NAME => 'mod_perl',
+ NAME => 'mod_perl2',
VERSION => '2.0.0-RC5',
NO_META => 1,
- ABSTRACT_FROM => 'lib/mod_perl.pm',
+ ABSTRACT_FROM => 'lib/mod_perl2.pm',
EXE_FILES => \@exe_files,
DEFINE => get_DEFINE(),
macro => {
@@ -126,55 +125,44 @@ sub configure {
set_modperl_version();
if ($old_modperl_version) {
- $old_modperl_version =~ s/(\d\d)(\d\d)/$1_$2/;
+ $old_modperl_version =~ s/(\d\d\d?)(\d\d)/$1_$2/;
my $vstring = "mod_perl/$old_modperl_version";
print "$vstring installation detected...";
- if ($build->{MP_INST_APACHE2}) {
- print "ok (installing relative to Apache2/)\n";
+ my $prefix;
+ /^PREFIX=(.*)/ && $1 && ($prefix = canonpath glob($1)) for @ARGV;
+
+ # check that it's a full path
+ my $path = canonpath $old_modperl_pm;
+ # XXX: doesn't handle relative paths yet
+ # if PREFIX=/foo/bar is used, and it's not the same as the
+ # path where mod_perl < 1.999_22 is installed
+ if ($prefix && $path !~ /^$prefix/) {
+ print "ok (will install mod_perl/$VERSION into PREFIX=$prefix, " .
+ "no collision)\n";
}
else {
- my $prefix;
- /^PREFIX=(.*)/ && $1 && ($prefix = canonpath glob($1)) for @ARGV;
-
- # check that it's a full path
- my $mp1_path = canonpath $old_modperl_version;
- # XXX: doesn't handle relative paths yet
- # if PREFIX=/foo/bar is used, and it's not the same as the
- # path where mod_perl 1 is installed, we don't need to require
- # MP_INST_APACHE2
- if ($prefix && $mp1_path !~ /^$prefix/) {
- print "ok (will install mod_perl 2 into PREFIX=$prefix, " .
- "no collision)\n";
- }
- else {
- print " not ok\n\n";
- error <<EOI;
-Cannot install mod_perl/$VERSION on top of $vstring.
-Add the MP_INST_APACHE2=1 option or answer 'yes'
-to the next question
-EOI
- my $prompt = "Is it OK to install relative to Apache2/?";
- if ($build->prompt_y($prompt)) {
- $build->{MP_INST_APACHE2} = 1;
- }
- else {
- error <<EOI;
+ print " not ok\n\n";
+ print <<EOI;
+Cannot install mod_perl/$VERSION on top of $vstring
+due to a major API change between mod_perl 1.999_21 and 1.999_22.
+Please nuke the prior mod_perl installation from your site_lib,
+use a different perl to run the installation process, or use the
+PREFIX option when creating your Makefile. see
-The answer is 'No' => aborting...
+ http://perl.apache.org/somelinkwellwritelater
-To build mod_perl 2 either add MP_INST_APACHE2=1 Makefile.PL option
-or first remove mod_perl $old_modperl_version files, including
-$old_modperl_pm
+for more details.
+aborting...
EOI
exit 1;
- }
- }
}
}
+ else {
+ print "no prior mod_perl version found - good.\n";
- $build->generate_apache2_pm;
+ }
# On Win32, in order to decouple APR::* from mod_perl.so, we
# make up a static library MP_APR_LIB of the symbols required from
@@ -283,7 +271,7 @@ EOI
exit(1);
}
- printf "Configuring Apache/%s mod_perl/%s Perl/v%vd\n",
+ printf "Configuring Apache/%s mod_perl2/%s Perl/v%vd\n",
$httpd_version, $VERSION, $^V;
my $apr_config = $build->get_apr_config; #cache it
@@ -302,7 +290,7 @@ EOI
debug "unlink...$_" if -e $_ && unlink;
}
- #ModPerl::BuildMM will use Apache::BuildConfig in subdir/Makefile.PL's
+ #ModPerl::BuildMM will use Apache2::BuildConfig in subdir/Makefile.PL's
$build->save;
ModPerl::TestRun->generate_script;
@@ -368,7 +356,7 @@ EOI
sub post_configure {
#now have any data subdir/Makefile.PL's save, e.g. XS
- $build = Apache::Build->build_config;
+ $build = Apache2::Build->build_config;
$build->write_src_makefile;
$build->save_ldopts;
@@ -386,13 +374,6 @@ sub post_configure {
" LoadModule perl_module modules/$build->{MODPERL_LIB_DSO}\n";
}
- if ($build->{MP_INST_APACHE2}) {
- warning "Apache Perl modules will be installed relative to Apache2/";
- warning "Don't forget to:",
- "- configure 'PerlModule Apache2' in httpd.conf",
- "- or 'use Apache2 ();' in a startup script";
- }
-
$build->save;
}
@@ -465,9 +446,9 @@ sub clean_files {
}
sub set_modperl_version {
- require './lib/mod_perl.pm';
+ require './lib/mod_perl2.pm';
- $VERSION = $mod_perl::VERSION_TRIPLET;
+ $VERSION = $mod_perl2::VERSION_TRIPLET;
open my $fh, 'Changes';
while (<$fh>) {
@@ -480,7 +461,7 @@ sub set_modperl_version {
close $fh;
$build->{VERSION} = $VERSION;
- $build->{API_VERSION} = $mod_perl::API_VERSION;
+ $build->{API_VERSION} = $mod_perl2::API_VERSION;
}
# needs to be run after configure() when apxs is setup
@@ -489,7 +470,7 @@ sub perl_version_check {
my $perl_version = $];
$perl_version =~ s/5.00(\d)(?:00(\d))?/"5.$1." . ($2||0)/e;
- my $perl_threads = Apache::Build::PERL_HAS_ITHREADS ? "w/" : "w/o";
+ my $perl_threads = Apache2::Build::PERL_HAS_ITHREADS ? "w/" : "w/o";
my $perl_string = "Using Perl $perl_version $perl_threads ithreads";
my $mpm = $build->mpm_name();
@@ -499,7 +480,7 @@ sub perl_version_check {
push @fail, "Perl 5.8 or higher"
unless $] >= 5.008;
push @fail, "Perl built with ithreads (build perl with -Dusethreads)"
- unless Apache::Build::PERL_HAS_ITHREADS();
+ unless Apache2::Build::PERL_HAS_ITHREADS();
if (@fail) {
error "$perl_string and '$mpm' mpm httpd.",
"Failed requirements:",
@@ -510,7 +491,7 @@ sub perl_version_check {
else {
# before 5.8.2, perl_shutdown is incomplete (in the case of ithreads
# each PerlInterpreter * gets tossed so it works)
- if ($build->should_build_apache && !Apache::Build::PERL_HAS_ITHREADS) {
+ if ($build->should_build_apache && !Apache2::Build::PERL_HAS_ITHREADS) {
# before 5.8.2, perl_shutdown is incomplete
if ($] < 5.008_002) {
error "static $mpm mpm requires a threaded ".
@@ -605,7 +586,7 @@ package MY;
use Config;
use constant WIN32 => $^O eq 'MSWin32';
-use constant BUILD_APREXT => Apache::Build::BUILD_APREXT;
+use constant BUILD_APREXT => Apache2::Build::BUILD_APREXT;
my $apache_test_install;
BEGIN {
View
4 ModPerl-Registry/Makefile.PL
@@ -7,7 +7,7 @@ use lib grep { -d } map "$FindBin::Bin/../$_", qw(lib Apache-Test/lib);
use ModPerl::BuildMM ();
use Apache::TestSmokePerl ();
-use Apache::Build ();
+use Apache2::Build ();
# enable 'make test|clean'
use Apache::TestMM qw(test clean);
@@ -22,7 +22,7 @@ my @scripts = qw(t/TEST t/SMOKE);
# accept the configs from comman line
Apache::TestMM::filter_args();
-my $build = Apache::Build->build_config;
+my $build = Apache2::Build->build_config;
if ($build->should_build_apache) {
push @Apache::TestMM::Argv, ('httpd' => $build->{httpd});
}
View
2  ModPerl-Registry/README
@@ -1 +1 @@
-to be written
+to be written
View
88 ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
@@ -26,12 +26,12 @@ use warnings FATAL => 'all';
our $VERSION = '1.99';
-use Apache::Response ();
-use Apache::RequestRec ();
-use Apache::RequestUtil ();
-use Apache::RequestIO ();
-use Apache::Log ();
-use Apache::Access ();
+use Apache2::Response ();
+use Apache2::RequestRec ();
+use Apache2::RequestUtil ();
+use Apache2::RequestIO ();
+use Apache2::Log ();
+use Apache2::Access ();
use APR::Table ();
@@ -42,7 +42,7 @@ use File::Spec::Functions ();
use File::Basename;
use APR::Const -compile => qw(EACCES ENOENT);
-use Apache::Const -compile => qw(:common &OPT_EXECCGI);
+use Apache2::Const -compile => qw(:common &OPT_EXECCGI);
use ModPerl::Const -compile => 'EXIT';
unless (defined $ModPerl::Registry::MarkLine) {
@@ -62,11 +62,11 @@ use constant D_NOISE => 8;
# the debug level can be overriden on the main server level of
# httpd.conf with:
# PerlSetVar ModPerl::RegistryCooker::DEBUG 4
-use Apache::ServerUtil ();
+use Apache2::ServerUtil ();
use constant DEBUG => 0;
#XXX: below currently crashes the server on win32
-# defined Apache->server->dir_config('ModPerl::RegistryCooker::DEBUG')
-# ? Apache->server->dir_config('ModPerl::RegistryCooker::DEBUG')
+# defined Apache2->server->dir_config('ModPerl::RegistryCooker::DEBUG')
+# ? Apache2->server->dir_config('ModPerl::RegistryCooker::DEBUG')
# : D_NONE;
#########################################################################
@@ -97,7 +97,7 @@ unless (defined $ModPerl::RegistryCooker::NameWithVirtualHost) {
# func: new
# dflt: new
# args: $class - class to bless into
-# $r - Apache::Request object
+# $r - Apache2::RequestRec object
# desc: create the class's object and bless it
# rtrn: the newly created object
#########################################################################
@@ -113,7 +113,7 @@ sub new {
# func: init
# dflt: init
# desc: initializes the data object's fields: REQ FILENAME URI
-# args: $r - Apache::Request object
+# args: $r - Apache2::RequestRec object
# rtrn: nothing
#########################################################################
@@ -128,11 +128,11 @@ sub init {
# dflt: handler
# desc: the handler() sub that is expected by Apache
# args: $class - handler's class
-# $r - Apache::Request object
+# $r - Apache2::RequestRec object
# (o)can be called as handler($r) as well (without leading $class)
# rtrn: handler's response status
# note: must be implemented in a sub-class unless configured as
-# Apache::Foo->handler in httpd.conf (because of the
+# Apache2::Foo->handler in httpd.conf (because of the
# __PACKAGE__, which is tied to the file)
#########################################################################
@@ -158,9 +158,9 @@ sub default_handler {
if ($self->should_compile) {
my $rc = $self->can_compile;
- return $rc unless $rc == Apache::OK;
+ return $rc unless $rc == Apache2::OK;
$rc = $self->convert_script_to_compiled_handler;
- return $rc unless $rc == Apache::OK;
+ return $rc unless $rc == Apache2::OK;
}
# handlers shouldn't set $r->status but return it, so we reset the
@@ -168,7 +168,7 @@ sub default_handler {
my $old_status = $self->{REQ}->status;
my $rc = $self->run;
my $new_status = $self->{REQ}->status($old_status);
- return ($rc == Apache::OK && $old_status != $new_status)
+ return ($rc == Apache2::OK && $old_status != $new_status)
? $new_status
: $rc;
}
@@ -178,7 +178,7 @@ sub default_handler {
# dflt: run
# desc: executes the compiled code
# args: $self - registry blessed object
-# rtrn: execution status (Apache::?)
+# rtrn: execution status (Apache2::?)
#########################################################################
sub run {
@@ -196,7 +196,7 @@ sub run {
%orig_inc = %INC;
}
- my $rc = Apache::OK;
+ my $rc = Apache2::OK;
{ # run the code and preserve warnings setup when it's done
no warnings FATAL => 'all';
#local $^W = 0;
@@ -216,14 +216,14 @@ sub run {
# use the END blocks return status if the script's execution
# was successful
- $rc = $new_rc if $rc == Apache::OK;
+ $rc = $new_rc if $rc == Apache2::OK;
}
}
if ($self->should_reset_inc_hash) {
# to avoid the bite of require'ing a file with no package delaration
- # Apache::PerlRun in mod_perl 1.15_01 started to localize %INC
+ # Apache2::PerlRun in mod_perl 1.15_01 started to localize %INC
# later on it has been adjusted to preserve loaded .pm files,
# which presumably contained the package declaration
for (keys %INC) {
@@ -235,7 +235,7 @@ sub run {
$self->flush_namespace;
- #XXX: $self->chdir_file("$Apache::Server::CWD/");
+ #XXX: $self->chdir_file("$Apache2::Server::CWD/");
return $rc;
}
@@ -255,19 +255,19 @@ sub can_compile {
my $self = shift;
my $r = $self->{REQ};
- return Apache::DECLINED if -d $r->my_finfo;
+ return Apache2::DECLINED if -d $r->my_finfo;
$self->{MTIME} = -M _;
- if (!($r->allow_options & Apache::OPT_EXECCGI)) {
+ if (!($r->allow_options & Apache2::OPT_EXECCGI)) {
$r->log_error("Options ExecCGI is off in this directory",
$self->{FILENAME});
- return Apache::FORBIDDEN;
+ return Apache2::FORBIDDEN;
}
$self->debug("can compile $self->{FILENAME}") if DEBUG & D_NOISE;
- return Apache::OK;
+ return Apache2::OK;
}
#########################################################################
@@ -362,13 +362,13 @@ sub namespace_from_uri {
sub convert_script_to_compiled_handler {
my $self = shift;
- my $rc = Apache::OK;
+ my $rc = Apache2::OK;
$self->debug("Adding package $self->{PACKAGE}") if DEBUG & D_NOISE;
# get the script's source
$rc = $self->read_script;
- return $rc unless $rc == Apache::OK;
+ return $rc unless $rc == Apache2::OK;
# convert the shebang line opts into perl code
my $shebang = $self->shebang_to_perl;
@@ -403,10 +403,10 @@ sub convert_script_to_compiled_handler {
"\n}"; # last line comment without newline?
$rc = $self->compile(\$eval);
- return $rc unless $rc == Apache::OK;
+ return $rc unless $rc == Apache2::OK;
$self->debug(qq{compiled package \"$self->{PACKAGE}\"}) if DEBUG & D_NOISE;
- #$self->chdir_file("$Apache::Server::CWD/");
+ #$self->chdir_file("$Apache2::Server::CWD/");
# if(my $opt = $r->dir_config("PerlRunOnce")) {
# $r->child_terminate if lc($opt) eq "on";
@@ -528,7 +528,7 @@ sub flush_namespace_normal {
# dflt: read_script
# desc: reads the script in
# args: $self - registry blessed object
-# rtrn: Apache::OK on success, some other code on failure
+# rtrn: Apache2::OK on success, some other code on failure
# efct: initializes the CODE field with the source script
#########################################################################
@@ -542,15 +542,15 @@ sub read_script {
$self->log_error("$@");
if (ref $@ eq 'APR::Error') {
- return Apache::FORBIDDEN if $@ == APR::EACCES;
- return Apache::NOT_FOUND if $@ == APR::ENOENT;
+ return Apache2::FORBIDDEN if $@ == APR::EACCES;
+ return Apache2::NOT_FOUND if $@ == APR::ENOENT;
}
else {
- return Apache::SERVER_ERROR;
+ return Apache2::SERVER_ERROR;
}
}
- return Apache::OK;
+ return Apache2::OK;
}
#########################################################################
@@ -565,8 +565,8 @@ sub read_script {
my %switches = (
'T' => sub {
- Apache::ServerRec::warn("-T switch is ignored, enable " .
- "with 'PerlSwitches -T' in httpd.conf\n")
+ Apache2::ServerRec::warn("-T switch is ignored, enable " .
+ "with 'PerlSwitches -T' in httpd.conf\n")
unless ${^TAINT};
"";
},
@@ -682,7 +682,7 @@ sub compile {
# dflt: error_check
# desc: checks $@ for errors
# args: $self - registry blessed object
-# rtrn: Apache::SERVER_ERROR if $@ is set, Apache::OK otherwise
+# rtrn: Apache2::SERVER_ERROR if $@ is set, Apache2::OK otherwise
#########################################################################
sub error_check {
@@ -693,9 +693,9 @@ sub error_check {
# (see modperl_perl_exit() and modperl_errsv() C functions)
if ($@ && !(ref $@ eq 'APR::Error' && $@ == ModPerl::EXIT)) {
$self->log_error($@);
- return Apache::SERVER_ERROR;
+ return Apache2::SERVER_ERROR;
}
- return Apache::OK;
+ return Apache2::OK;
}
@@ -764,23 +764,23 @@ sub uncache_myself {
my($class) = __PACKAGE__->cache_table_common();
unless (defined $class) {
- Apache->warn("$$: cannot figure out cache symbol table for $package");
+ Apache2->warn("$$: cannot figure out cache symbol table for $package");
return;
}
if (exists $class->{$package} && exists $class->{$package}{mtime}) {
- Apache->warn("$$: uncaching $package\n") if DEBUG & D_COMPILE;
+ Apache2->warn("$$: uncaching $package\n") if DEBUG & D_COMPILE;
delete $class->{$package}{mtime};
}
else {
- Apache->warn("$$: cannot find $package in cache");
+ Apache2->warn("$$: cannot find $package in cache");
}
}
# XXX: should go away when finfo() is ported to 2.0 (don't want to
# depend on compat.pm)
-sub Apache::RequestRec::my_finfo {
+sub Apache2::RequestRec::my_finfo {
my $r = shift;
stat $r->filename;
\*_;
View
14 ModPerl-Registry/lib/ModPerl/RegistryLoader.pm
@@ -18,13 +18,13 @@ use strict;
use warnings;
use ModPerl::RegistryCooker ();
-use Apache::ServerUtil ();
+use Apache2::ServerUtil ();
use APR::Pool ();
use Carp;
use File::Spec ();
-use Apache::Const -compile => qw(OK HTTP_OK OPT_EXECCGI);
+use Apache2::Const -compile => qw(OK HTTP_OK OPT_EXECCGI);
our @ISA = ();
@@ -71,7 +71,7 @@ sub handler {
$self->warn("Trying to guess filename based on uri")
if $self->{debug};
- $filename = File::Spec->catfile(Apache::ServerUtil::server_root,
+ $filename = File::Spec->catfile(Apache2::ServerUtil::server_root,
$guess);
unless (-e $filename) {
$self->warn("Cannot find guessed file: $filename",
@@ -108,13 +108,13 @@ sub handler {
sub get_server_name { return $_[0]->{virthost} if exists $_[0]->{virthost} }
sub filename { shift->{filename} }
-sub status { Apache::HTTP_OK }
+sub status { Apache2::HTTP_OK }
sub my_finfo { shift->{filename} }
sub uri { shift->{uri} }
sub path_info {}
-sub allow_options { Apache::OPT_EXECCGI } #will be checked again at run-time
+sub allow_options { Apache2::OPT_EXECCGI } #will be checked again at run-time
sub log_error { shift; die @_ if $@; warn @_; }
-sub run { return Apache::OK } # don't run the script
+sub run { return Apache2::OK } # don't run the script
sub server { shift }
sub is_virtual { exists shift->{virthost} }
@@ -153,7 +153,7 @@ sub load_package {
sub warn {
my $self = shift;
- Apache->warn(__PACKAGE__ . ": @_\n");
+ Apache2->warn(__PACKAGE__ . ": @_\n");
}
1;
View
4 ModPerl-Registry/t/TEST.PL
@@ -24,12 +24,12 @@ use constant MIN_CLIENTS => 2;
use File::Spec::Functions qw(catdir);
use File::Basename qw(dirname);
-use Apache::Build;
+use Apache2::Build;
# default timeout in secs (threaded mpms are extremely slow to
# startup, due to a slow perl_clone operation)
use constant DEFAULT_STARTUP_TIMEOUT =>
- Apache::Build->build_config->mpm_is_threaded() ? 180 : 90;
+ Apache2::Build->build_config->mpm_is_threaded() ? 180 : 90;
# subclass new_test_config to add some config vars which will be
# replaced in generated httpd.conf
View
10 ModPerl-Registry/t/cgi-bin/304.pl
@@ -4,12 +4,12 @@
# manually handle 'If-Modified-Since' requests
use APR::Date ();
-use Apache::Util ();
-use Apache::RequestRec ();
+use Apache2::Util ();
+use Apache2::RequestRec ();
use constant FMT => '%a, %d %b %Y %H:%M:%S %Z';
use constant GMT => 1;
-use Apache::Const -compile => qw(HTTP_NOT_MODIFIED);
+use Apache2::Const -compile => qw(HTTP_NOT_MODIFIED);
my $last_modified = "Sun, 29 Oct 2000 15:43:29 GMT";
@@ -30,11 +30,11 @@
#warn "if_modified_since_secs $if_modified_since_secs\n\n";
if ($last_modified_secs < $if_modified_since_secs) {
- $status = Apache::HTTP_NOT_MODIFIED;
+ $status = Apache2::HTTP_NOT_MODIFIED;
$body = '';
}
-my $date = Apache::Util::ht_time($r->pool, $r->request_time, FMT, GMT);
+my $date = Apache2::Util::ht_time($r->pool, $r->request_time, FMT, GMT);
print <<HEADERS;
Status: $status
View
12 ModPerl-Registry/t/cgi-bin/ithreads_io_n_tie.pl
@@ -3,19 +3,19 @@
#
# there is a problem when STDOUT is internally opened to an
-# Apache::PerlIO layer is cloned on a new thread start. PerlIO_clone
+# Apache2::PerlIO layer is cloned on a new thread start. PerlIO_clone
# in perl_clone() is called too early, before PL_defstash is
# cloned. As PerlIO_clone calls PerlIOApache_getarg, which calls
# gv_fetchpv via sv_setref_pv and boom the segfault happens.
#
# at the moment we should either not use an internally opened to
-# :Apache streams, so the config must be:
+# :Apache2 streams, so the config must be:
#
# SetHandler modperl
#
# and then either use $r->print("foo") or tie *STDOUT, $r + print "foo"
#
-# or close and re-open STDOUT to :Apache *after* the thread was spawned
+# or close and re-open STDOUT to :Apache2 *after* the thread was spawned
#
# the above discussion equally applies to STDIN
#
@@ -39,14 +39,14 @@
}
{
- # close and re-open STDOUT to :Apache *after* the thread was
+ # close and re-open STDOUT to :Apache2 *after* the thread was
# spawned
my $thr = threads->new(
sub {
my $id = shift;
close STDOUT;
- open STDOUT, ">:Apache", $r
- or die "can't open STDOUT via :Apache layer : $!";
+ open STDOUT, ">:Apache2", $r
+ or die "can't open STDOUT via :Apache2 layer : $!";
print "thread $id\n";
return 1;
}, 2);
View
8 ModPerl-Registry/t/cgi-bin/redirect-cookie.pl
@@ -1,7 +1,7 @@
# test env vars
-use Apache::URI ();
-use Apache::Const -compile => qw(REDIRECT SERVER_ERROR);
+use Apache2::URI ();
+use Apache2::Const -compile => qw(REDIRECT SERVER_ERROR);
my $r = shift;
my $path = $r->args || '';
@@ -9,10 +9,10 @@
$r->err_headers_out->set('Set-Cookie' => "mod_perl=ubercool; path=/");
$r->headers_out->set(Location => " http://$server$path");
-$r->status(Apache::REDIRECT);
+$r->status(Apache2::REDIRECT);
# exit status is completely ignored in Registry
# due to $r->status hacking
-return Apache::SERVER_ERROR;
+return Apache2::SERVER_ERROR;
__END__
View
2  ModPerl-Registry/t/cgi-bin/redirect.pl
@@ -1,6 +1,6 @@
# test env vars
-use Apache::URI ();
+use Apache2::URI ();
my $r = shift;
my $path = $r->args || '';
View
4 ModPerl-Registry/t/cgi-bin/runtime_error_n_status_change.pl
@@ -3,9 +3,9 @@ BEGIN
t_server_log_error_is_expected();
}
-use Apache::Const -compile => qw(NOT_FOUND);
+use Apache2::Const -compile => qw(NOT_FOUND);
my $r = shift;
-$r->status(Apache::NOT_FOUND);
+$r->status(Apache2::NOT_FOUND);
$r->print("Content-type: text/plain\n\n");
$r->print(no_such_func());
View
2  ModPerl-Registry/t/cgi-bin/special_blocks.pl
@@ -2,7 +2,7 @@
# test BEGIN/END blocks
-use Apache::RequestRec ();
+use Apache2::RequestRec ();
use vars qw($query);
$query = '' unless defined $query;
View
4 ModPerl-Registry/t/cgi-bin/status_change.pl
@@ -1,5 +1,5 @@
-use Apache::Const -compile => qw(NOT_FOUND);
+use Apache2::Const -compile => qw(NOT_FOUND);
my $r = shift;
-$r->status(Apache::NOT_FOUND);
+$r->status(Apache2::NOT_FOUND);
$r->print("Content-type: text/plain\n\n");
View
2  ModPerl-Registry/t/cgi.t
@@ -5,7 +5,7 @@ use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw(GET);
-plan tests => 2, need_min_module_version CGI => 2.87;
+plan tests => 2, need_min_module_version CGI => 3.08;
my $url = "/registry/cgi.pl";
my $res = GET $url;
View
8 ModPerl-Registry/t/conf/extra.conf.in
@@ -12,13 +12,9 @@
# make sure that we test under Taint and warnings mode enabled
PerlSwitches -wT
-PerlModule Apache2
-
PerlSwitches -I@ServerRoot@/../lib \
-I@ServerRoot@/../../Apache-Test/lib \
-I@ServerRoot@/../../lib \
- -I@ServerRoot@/../../blib/lib/Apache2 \
- -I@ServerRoot@/../../blib/arch/Apache2 \
-I@ServerRoot@/../../blib/lib \
-I@ServerRoot@/../../blib/arch
@@ -26,8 +22,8 @@ PerlSwitches -I@ServerRoot@/../lib \
PerlRequire @ServerRoot@/conf/modperl_extra_startup.pl
#### DEVMODE: Remove in production ###
-PerlModule Apache::Reload
-PerlInitHandler Apache::Reload
+PerlModule Apache2::Reload
+PerlInitHandler Apache2::Reload
PerlSetVar ReloadAll Off
PerlSetVar ReloadModules "ModPerl::*"
View
12 ModPerl-Registry/t/conf/modperl_extra_startup.pl
@@ -3,20 +3,20 @@
use ModPerl::RegistryLoader ();
-use Apache::ServerRec ();
-use Apache::ServerUtil ();
-use Apache::Process ();
+use Apache2::ServerRec ();
+use Apache2::ServerUtil ();
+use Apache2::Process ();
use DirHandle ();
-my $proc = Apache->server->process;
+my $proc = Apache2->server->process;
my $pool = $proc->pool;
# can't use catfile with server_root as it contains unix dir
# separators and in a few of our particular tests we compare against
# win32 separators. in general avoid using server_root_relative in your
# code, see the manpage for more details
-my $base_dir = Apache::ServerUtil::server_root_relative($pool, "cgi-bin");
+my $base_dir = Apache2::ServerUtil::server_root_relative($pool, "cgi-bin");
# test the scripts pre-loading by explicitly specifying uri => filename
my $rl = ModPerl::RegistryLoader->new(package => "ModPerl::Registry");
@@ -33,7 +33,7 @@
sub trans {
my $uri = shift;
$uri =~ s|^/registry_bb/|cgi-bin/|;
- return Apache::ServerUtil::server_root_relative($pool, $uri);
+ return Apache2::ServerUtil::server_root_relative($pool, $uri);
}
my $rl = ModPerl::RegistryLoader->new(
View
2  bin/mp2bug
@@ -25,7 +25,7 @@ if (IS_MOD_PERL_BUILD) {
unshift @INC, "$FindBin::Bin/../lib";
}
else {
- eval { require Apache2 };
+ eval { require mod_perl2 };
if ($@) {
die "This script requires mod_perl 2.0\n", "$@";
}
View
18 bin/mp2doc
@@ -1,18 +0,0 @@
-#!perl
-# Copyright 2003-2005 The Apache Software Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-use Apache2;
-use Pod::Perldoc;
-exit( Pod::Perldoc->run() );
View
6 build/source_scan.pl
@@ -3,13 +3,13 @@
use lib qw(lib Apache-Test/lib);
use strict;
-use Apache::ParseSource ();
+use Apache2::ParseSource ();
use ModPerl::ParseSource ();
use ModPerl::FunctionMap ();
use ModPerl::WrapXS (); #XXX: we should not need to require this here
-my $p = Apache::ParseSource->new(prefixes => ModPerl::FunctionMap->prefixes,
- @ARGV);
+my $p = Apache2::ParseSource->new(prefixes => ModPerl::FunctionMap->prefixes,
+ @ARGV);
$p->parse;
View
121 lib/Apache/Build.pm → lib/Apache2/Build.pm
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-package Apache::Build;
+package Apache2::Build;
use 5.006;
use strict;
@@ -25,11 +25,10 @@ use File::Spec::Functions qw(catfile catdir canonpath rel2abs devnull
use File::Basename;
use ExtUtils::Embed ();
-use constant IS_MOD_PERL_BUILD => grep { -e "$_/lib/mod_perl.pm" } qw(. ..);
+use constant IS_MOD_PERL_BUILD => grep { -e "$_/lib/mod_perl2.pm" } qw(. ..);
use constant AIX => $^O eq 'aix';
use constant DARWIN => $^O eq 'darwin';
-use constant CYGWIN => $^O eq 'cygwin';
use constant IRIX => $^O eq 'irix';
use constant HPUX => $^O eq 'hpux';
use constant OPENBSD => $^O eq 'openbsd';
@@ -110,7 +109,7 @@ sub find_apxs_util {
$apxs = ''; # not found
- my @trys = ($Apache::Build::APXS,
+ my @trys = ($Apache2::Build::APXS,
$self->{MP_APXS},
$ENV{MP_APXS},
catfile $self->{MP_AP_PREFIX}, 'bin', 'apxs');
@@ -550,10 +549,6 @@ sub perl_ccopts {
}
}
- if (CYGWIN) {
- $cflags .= " -DCYGWIN ";
- }
-
$cflags;
}
@@ -670,7 +665,7 @@ sub find_in_inc {
my $name = shift;
for (@INC) {
my $file;
- if (-e ($file = "$_/auto/Apache/$name")) {
+ if (-e ($file = "$_/auto/Apache2/$name")) {
return $file;
}
}
@@ -773,7 +768,7 @@ EOF
#--- constructors ---
-my $bpm = 'Apache/BuildConfig.pm';
+my $bpm = 'Apache2/BuildConfig.pm';
sub build_config {
my $self = shift;
@@ -785,15 +780,15 @@ sub build_config {
#reload if Makefile.PL has regenerated
unshift @INC, 'lib';
delete $INC{$bpm};
- eval { require Apache::BuildConfig; };
+ eval { require Apache2::BuildConfig; };
shift @INC;
}
else {
- eval { require Apache::BuildConfig; };
+ eval { require Apache2::BuildConfig; };
}
return bless {}, (ref($self) || $self) if $@;
- return Apache::BuildConfig::->new;
+ return Apache2::BuildConfig::->new;
}
sub new {
@@ -815,7 +810,7 @@ sub new {
sub DESTROY {}
my %default_files = (
- 'build_config' => 'lib/Apache/BuildConfig.pm',
+ 'build_config' => 'lib/Apache2/BuildConfig.pm',
'ldopts' => 'src/modules/perl/ldopts',
'makefile' => 'src/modules/perl/Makefile',
);
@@ -877,14 +872,14 @@ sub save {
open my $fh, '>', $file or die "open $file: $!";
#work around autosplit braindeadness
- my $package = 'package Apache::BuildConfig';
+ my $package = 'package Apache2::BuildConfig';
print $fh noedit_warning_hash();
print $fh <<EOF;
$package;
-use Apache::Build ();
+use Apache2::Build ();
sub new {
$obj;
@@ -903,7 +898,7 @@ sub rebuild {
print "Running: $command\n";
system $command;
}
-# % perl -MApache::Build -e rebuild
+# % perl -MApache2::Build -e rebuild
*main::rebuild = \&rebuild if $0 eq '-e';
#--- attribute access ---
@@ -950,7 +945,7 @@ sub dir {
# might end up finding 1.x headers anyhow
# unless ($dir and -d $dir) {
# for (@INC) {
-# last if -d ($dir = "$_/auto/Apache/include");
+# last if -d ($dir = "$_/auto/Apache2/include");
# }
# }
return $self->{dir} = $dir ? canonpath(rel2abs $dir) : undef;
@@ -1181,14 +1176,14 @@ sub apr_includedir {
sub mmn_eq {
my($class, $dir) = @_;
- return 1 if WIN32; #just assume, till Apache::Build works under win32
+ return 1 if WIN32; #just assume, till Apache2::Build works under win32
my $instsrc;
{
local @INC = grep { !/blib/ } @INC;
my $instdir;
for (@INC) {
- last if -d ($instdir = "$_/auto/Apache/include");
+ last if -d ($instdir = "$_/auto/Apache2/include");
}
$instsrc = $class->new(dir => $instdir);
}
@@ -1550,8 +1545,7 @@ sub mp_apr_blib {
my $self = shift;
return unless (my $mp_apr_lib = $self->{MP_APR_LIB});
my $lib_mp_apr_lib = 'lib' . $mp_apr_lib;
- my @dirs = $self->{MP_INST_APACHE2} ?
- qw(blib arch Apache2 auto) : qw(blib arch auto);
+ my @dirs = qw(blib arch auto);
my $apr_blib = catdir $self->{cwd}, @dirs, $lib_mp_apr_lib;
my $full_libname = $lib_mp_apr_lib . $Config{lib_ext};
return ($apr_blib, $full_libname);
@@ -1812,8 +1806,7 @@ sub typemaps {
# for post install use
for (@INC) {
# make sure not to pick mod_perl 1.0 typemap
- next if $self->{MP_INST_APACHE2} && $_ !~ /Apache2$/;
- my $file = "$_/auto/Apache/typemap";
+ my $file = "$_/auto/Apache2/typemap";
push @typemaps, $file if -e $file;
}
@@ -1974,72 +1967,22 @@ sub define {
return "";
}
-# in case MP_INST_APACHE2=0 we shouldn't try to adjust @INC
-# because it may pick older Apache2 from the previous install
-sub generate_apache2_pm {
- my $self = shift;
-
- my $fixup = !$self->{MP_INST_APACHE2}
- ? '# MP_INST_APACHE2=0, do nothing'
- : <<'EOF';
-BEGIN {
- my @dirs = ();
-
- for my $path (@INC) {
- my $dir = "$path/Apache2";
- next unless -d $dir;
- push @dirs, $dir;
- }
-
- if (@dirs) {
- unshift @INC, @dirs;
- }
-
- # now re-org the libs to have first devel libs, then blib libs,
- # and only then perl core libs
- use File::Basename qw(dirname);
- my $project_root = $blib ? dirname(dirname($blib)) : '';
- if ($project_root) {
- my (@a, @b, @c);
- for (@INC) {
- if (m|^\Q$project_root\E|) {
- m|blib| ? push @b, $_ : push @a, $_;
- }
- else {
- push @c, $_;
- }
- }
- @INC = (@a, @b, @c);
- }
-
-}
-EOF
-
- my $content = join "\n\n", noedit_warning_hash(),
- 'package Apache2;', $fixup, "1;";
- my $file = catfile qw(lib Apache2.pm);
- open my $fh, '>', $file or die "Can't open $file: $!";
- print $fh $content;
- close $fh;
-
-}
-
1;
__END__
=head1 NAME
-Apache::Build - Methods for locating and parsing bits of Apache source code
+Apache2::Build - Methods for locating and parsing bits of Apache source code
=head1 SYNOPSIS
- use Apache::Build ();
- my $build = Apache::Build->new;
+ use Apache2::Build ();
+ my $build = Apache2::Build->new;
# rebuild mod_perl with build opts from the previous build
% cd modperl-2.0
- % perl -MApache::Build -e rebuild
+ % perl -MApache2::Build -e rebuild
=head1 DESCRIPTION
@@ -2051,12 +1994,12 @@ can use this knowledge to rebuild it using the same options. Simply
chdir to the mod_perl source directory and run:
% cd modperl-2.0
- % perl -MApache::Build -e rebuild
+ % perl -MApache2::Build -e rebuild
If you want to rebuild not yet installed, but already built mod_perl,
run from its root directory:
- % perl -Ilib -MApache::Build -e rebuild
+ % perl -Ilib -MApache2::Build -e rebuild
=head1 METHODS
@@ -2064,9 +2007,9 @@ run from its root directory:
=item new
-Create an object blessed into the B<Apache::Build> class.
+Create an object blessed into the B<Apache2::Build> class.
- my $build = Apache::Build->new;
+ my $build = Apache2::Build->new;
=item dir
@@ -2095,12 +2038,12 @@ Example:
use ExtUtils::MakeMaker;
- use Apache::Build ();
+ use Apache2::Build ();
WriteMakefile(
- 'NAME' => 'Apache::Module',
+ 'NAME' => 'Apache2::Module',
'VERSION' => '0.01',
- 'INC' => Apache::Build->new->inc,
+ 'INC' => Apache2::Build->new->inc,
);
@@ -2131,14 +2074,14 @@ Example:
use ExtUtils::MakeMaker;
- use Apache::Build ();
+ use Apache2::Build ();
WriteMakefile(
- 'NAME' => 'Apache::Module',
+ 'NAME' => 'Apache2::Module',
'VERSION' => '0.01',
- 'INC' => Apache::Build->new->inc,
+ 'INC' => Apache2::Build->new->inc,
'dynamic_lib' => {
- 'OTHERLDFLAGS' => Apache::Build->new->otherldflags,
+ 'OTHERLDFLAGS' => Apache2::Build->new->otherldflags,
},
);
View
26 lib/Apache/ParseSource.pm → lib/Apache2/ParseSource.pm
@@ -12,12 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-package Apache::ParseSource;
+package Apache2::ParseSource;
use strict;
use warnings FATAL => 'all';
-use Apache::Build ();
+use Apache2::Build ();
use Config;
use File::Basename;
use File::Spec::Functions qw(catdir);
@@ -28,14 +28,14 @@ sub new {
my $class = shift;
my $self = bless {
- config => Apache::Build->build_config,
+ config => Apache2::Build->build_config,
@_,
}, $class;
my $prefixes = join '|', @{ $self->{prefixes} || [qw(ap_ apr_)] };
$self->{prefix_re} = qr{^($prefixes)};
- $Apache::Build::APXS ||= $self->{apxs};
+ $Apache2::Build::APXS ||= $self->{apxs};
$self;
}
@@ -58,7 +58,7 @@ sub DESTROY {
}
{
- package Apache::ParseSource::Scan;
+ package Apache2::ParseSource::Scan;
our @ISA = qw(ModPerl::CScan);
@@ -109,7 +109,7 @@ sub scan {
$c->set(Defines => join ' ', map "-D$_", @defines);
- bless $c, 'Apache::ParseSource::Scan';
+ bless $c, 'Apache2::ParseSource::Scan';
}
sub include_dirs {
@@ -202,7 +202,7 @@ sub find_includes_wanted {
my $dir = $File::Find::dir;
push @includes, "$dir/$_";
},
- (Apache::Build::WIN32 ? '' : follow => 1),
+ (Apache2::Build::WIN32 ? '' : follow => 1),
}, $dir);
}
return @includes;
@@ -227,7 +227,7 @@ sub generate_cscan_file {
}
my %defines_wanted = (
- Apache => {
+ Apache2 => {
common => [qw{OK DECLINED DONE}],
config => [qw{DECLINE_CMD}],
context => [qw(NOT_IN_ GLOBAL_ONLY)],
@@ -273,7 +273,7 @@ while (my($class, $groups) = each %defines_wanted) {
}
my %enums_wanted = (
- Apache => { map { $_, 1 } qw(cmd_how input_mode filter_type conn_keepalive) },
+ Apache2 => { map { $_, 1 } qw(cmd_how input_mode filter_type conn_keepalive) },
APR => { map { $_, 1 } qw(apr_shutdown_how apr_read_type apr_lockmech) },
);
@@ -305,7 +305,7 @@ sub get_constants {
#maintain a few handy shortcuts from 1.xx
#aliases are defined in ModPerl::Code
- push @{ $constants{'Apache'}->{common} },
+ push @{ $constants{'Apache2'}->{common} },
qw(NOT_FOUND FORBIDDEN AUTH_REQUIRED SERVER_ERROR REDIRECT);
return \%constants;
@@ -490,7 +490,7 @@ sub get_structs {
sub write_functions_pm {
my $self = shift;
my $file = shift || 'FunctionTable.pm';
- my $name = shift || 'Apache::FunctionTable';
+ my $name = shift || 'Apache2::FunctionTable';
$self->write_pm($file, $name, $self->get_functions);
}
@@ -498,7 +498,7 @@ sub write_functions_pm {
sub write_structs_pm {
my $self = shift;
my $file = shift || 'StructureTable.pm';
- my $name = shift || 'Apache::StructureTable';
+ my $name = shift || 'Apache2::StructureTable';
$self->write_pm($file, $name, $self->get_structs);
}
@@ -506,7 +506,7 @@ sub write_structs_pm {
sub write_constants_pm {
my $self = shift;
my $file = shift || 'ConstantsTable.pm';
- my $name = shift || 'Apache::ConstantsTable';
+ my $name = shift || 'Apache2::ConstantsTable';
$self->write_pm($file, $name, $self->get_constants);
}
View
28 lib/Apache/PerlSections.pm → lib/Apache2/PerlSections.pm
@@ -12,22 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-package Apache::PerlSections;
+package Apache2::PerlSections;
use strict;
use warnings FATAL => 'all';
our $VERSION = '2.00';
-use Apache::CmdParms ();
-use Apache::Directive ();
+use Apache2::CmdParms ();
+use Apache2::Directive ();
use APR::Table ();
-use Apache::ServerRec ();
-use Apache::ServerUtil ();
-use Apache::Const -compile => qw(OK);
+use Apache2::ServerRec ();
+use Apache2::ServerUtil ();
+use Apache2::Const -compile => qw(OK);
use constant SPECIAL_NAME => 'PerlConfig';
-use constant SPECIAL_PACKAGE => 'Apache::ReadConfig';
+use constant SPECIAL_PACKAGE => 'Apache2::ReadConfig';
sub new {
my($package, @args) = @_;
@@ -39,7 +39,7 @@ sub directives { return shift->{'directives'} ||= [] }
sub package { return shift->{'args'}->{'package'} }
my @saved;
-sub save { return $Apache::PerlSections::Save }
+sub save { return $Apache2::PerlSections::Save }
sub saved { return @saved }
sub handler : method {
@@ -71,7 +71,7 @@ sub handler : method {
$self->post_config();
- Apache::OK;
+ Apache2::OK;
}
sub symdump {
@@ -83,7 +83,7 @@ sub symdump {
$self->{symbols} = [];
#XXX: Here would be a good place to warn about NOT using
- # Apache::ReadConfig:: directly in <Perl> sections
+ # Apache2::ReadConfig:: directly in <Perl> sections
foreach my $pack ($self->package, $self->SPECIAL_PACKAGE) {
#XXX: Shamelessly borrowed from Devel::Symdump;
while (my ($key, $val) = each(%{ *{"$pack\::"} })) {
@@ -206,14 +206,14 @@ sub post_config {
sub dump {
my $class = shift;
- require Apache::PerlSections::Dump;
- return Apache::PerlSections::Dump->dump(@_);
+ require Apache2::PerlSections::Dump;
+ return Apache2::PerlSections::Dump->dump(@_);
}
sub store {
my $class = shift;
- require Apache::PerlSections::Dump;
- return Apache::PerlSections::Dump->store(@_);
+ require Apache2::PerlSections::Dump;
+ return Apache2::PerlSections::Dump->store(@_);
}
1;
View
6 lib/Apache/PerlSections/Dump.pm → lib/Apache2/PerlSections/Dump.pm
@@ -12,15 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-package Apache::PerlSections::Dump;
+package Apache2::PerlSections::Dump;
use strict;
use warnings FATAL => 'all';
our $VERSION = '0.01';
-use Apache::PerlSections;
-our @ISA = qw(Apache::PerlSections);
+use Apache2::PerlSections;
+our @ISA = qw(Apache2::PerlSections);
use Data::Dumper;
View
38 lib/Apache/Reload.pm → lib/Apache2/Reload.pm
@@ -12,26 +12,26 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-package Apache::Reload;
+package Apache2::Reload;
use strict;
use warnings FATAL => 'all';
-use mod_perl 1.99;
+use mod_perl2;
our $VERSION = '0.09';
-use Apache::Const -compile => qw(OK);
+use Apache2::Const -compile => qw(OK);
-use Apache::Connection;
-use Apache::ServerUtil;
-use Apache::RequestUtil;
+use Apache2::Connection;
+use Apache2::ServerUtil;
+use Apache2::RequestUtil;
use ModPerl::Util ();
use vars qw(%INCS %Stat $TouchTime);
-%Stat = ($INC{"Apache/Reload.pm"} => time);
+%Stat = ($INC{"Apache2/Reload.pm"} => time);
$TouchTime = time;
@@ -81,7 +81,7 @@ sub unregister_module {
# $r if invoked as 'PerlInitHandler'
sub handler {
my $o = shift;
- $o = $o->base_server if ref($o) eq 'Apache::Connection';
+ $o = $o->base_server if ref($o) eq 'Apache2::Connection';
my $DEBUG = ref($o) && (lc($o->dir_config("ReloadDebug") || '') eq 'on');
@@ -95,8 +95,8 @@ sub handler {
if ($TouchFile) {
warn "Checking mtime of $TouchFile\n" if $DEBUG;
- my $touch_mtime = (stat $TouchFile)[9] || return Apache::OK;
- return Apache::OK unless $touch_mtime > $TouchTime;
+ my $touch_mtime = (stat $TouchFile)[9] || return 1;
+ return 1 unless $touch_mtime > $TouchTime;
$TouchTime = $touch_mtime;
open my $fh, $TouchFile or die "Can't open '$TouchFile': $!";
$TouchModules = <$fh>;
@@ -104,10 +104,10 @@ sub handler {
}
if (ref($o) && (lc($o->dir_config("ReloadAll") || 'on') eq 'on')) {
- *Apache::Reload::INCS = \%INC;
+ *Apache2::Reload::INCS = \%INC;
}
else {
- *Apache::Reload::INCS = \%INCS;
+ *Apache2::Reload::INCS = \%INCS;
my $ExtraList =
$TouchModules ||
(ref($o) && $o->dir_config("ReloadModules")) ||
@@ -119,22 +119,22 @@ sub handler {
$prefix =~ s/::/\//g;
foreach my $match (keys %INC) {
if ($match =~ /^\Q$prefix\E/) {
- $Apache::Reload::INCS{$match} = $INC{$match};
+ $Apache2::Reload::INCS{$match} = $INC{$match};
}
}
}
else {
- Apache::Reload->register_module($_);