Apache-Singleton-0.17000755000766000024 013140377200 14526 5ustar00mschoutstaff000000000000README100644000766000024 73413140377200 15453 0ustar00mschoutstaff000000000000Apache-Singleton-0.17Apache::Singleton is Copyright (C) 2009, Michael Schout. WHAT IS THIS? Apache::Singleton works the same as Class::Singleton, but with various object lifetime (scope) under mod_perl or mod_perl2. See the Class::Singleton manpage first. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires these other CPAN modules: Test::More 0.32 or later mod_perl or mod_perl2 Changes100644000766000024 430713140377200 16106 0ustar00mschoutstaff000000000000Apache-Singleton-0.17Revision history for Perl extension Apache::Singleton. 0.17 2017-08-02 - Kwalitee: include META.json, declare minimum perl version, enable warnings 0.16 2014-11-07 - fix signature test due to MYMETA.* in new EU::MM - Work around global destruction order issue by integrating on proposed patch to Class::Singleton [#68534] (Thanks Steve Hay!) 0.15 2012-04-02 - fixed test: limit MaxClient to 1. process/printer_instance.t expects the same apache to handle each request. [RT 76244] 0.14 2011-12-06 - load Apache::Singleton::Request if necessary [RT 71218] - note that PerlOptions +GlobalRequest is required for Apache::Singleton::Request 0.13 2011-05-29 - No changes. Rebuild tarball in WinZip compatible way. 0.12 2011-05-28 - Use Dist::Zilla for distribution building - Copy args passed to instance() to constructor 0.11 Tue Nov 24 2009 - added real test suite using Apache::Test - reorganized test files - removed _delegator() from Apache::Singleton. it causes problems under MP2 0.10 Sun Nov 22 2009 *** new maintainer: Michael Schout - updated Makefile.PL - added META_MERGE to Makefile.PL - update so mod_perl2 2.0 >= RC5 is supported - split out test mocks into t/lib - add mod_perl2 tests - sign the dist, add signature test - check for mod_perl version in Makefile.PL. if mod_perl2, require >= 1.9922 - update README - remove META.yml from repo, make dist generates it 0.06 Tue Oct 19 17:29:05 JST 2004 - removed dependency on Cache::Cache in Makefile.PL * Added mod_perl2 support Thanks to Frank Wiles 0.05 Tue Dec 25 05:59:55 JST 2001 - Compatibility: defaults to Process in non-mod_perl environment 0.04 Sun Dec 23 21:20:04 JST 2001 - Fixed docs - pulled off Server subclass: it was completely broken 0.03 Sat Dec 22 22:29:50 JST 2001 - Added test for multiple classes * Added Request, Process, Server subclasses 0.02 Sat Dec 22 16:58:34 JST 2001 - use pnotes instead of register_cleanup (Thanks to Perrin Harkins ) 0.01 Thu Dec 20 12:45:29 2001 - original version; created by h2xs 1.19 LICENSE100644000766000024 4366313140377200 15650 0ustar00mschoutstaff000000000000Apache-Singleton-0.17This software is copyright (c) 2009 by Michael Schout. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2009 by Michael Schout. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2009 by Michael Schout. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End META.yml100644000766000024 173613140377200 16067 0ustar00mschoutstaff000000000000Apache-Singleton-0.17--- abstract: 'Singleton class for mod_perl' author: - 'Michael Schout ' build_requires: Apache2::RequestIO: '0' Apache2::RequestRec: '0' Apache::Test: '1.35' Apache::TestRequest: '0' Apache::TestRunPerl: '0' Test::More: '0' lib: '0' mod_perl2: '0' perl: '5.006' configure_requires: perl: '5.006' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Apache-Singleton requires: Apache: '0' Apache2::RequestUtil: '0' Apache::Test: '1.35' base: '0' constant: '0' perl: '5.006' strict: '0' warnings: '0' resources: bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Apache-Singleton homepage: http://search.cpan.org/dist/Apache-Singleton/ repository: git://github.com/mschout/apache-singleton.git version: '0.17' x_serialization_backend: 'YAML::Tiny version 1.69' MANIFEST100644000766000024 162513140377200 15744 0ustar00mschoutstaff000000000000Apache-Singleton-0.17# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.009. Changes LICENSE MANIFEST MANIFEST.SKIP META.json META.yml Makefile.PL README SIGNATURE lib/Apache/Singleton.pm lib/Apache/Singleton/Process.pm lib/Apache/Singleton/Request.pm t/TEST.PL t/apache/singleton/process/printer_instance.t t/apache/singleton/request/printer_instance.t t/author-pod-syntax.t t/author-signature.t t/compile.t t/conf/extra.conf.in t/lib/Printer/Device/PerProcess.pm t/lib/Printer/Device/PerRequest.pm t/lib/Printer/PerProcess.pm t/lib/Printer/PerRequest.pm t/mock/Apache.pm t/mock/Apache2/RequestUtil.pm t/mock/Mock/Apache.pm t/mock/mod_perl.pm t/mock/mod_perl2.pm t/multiclass.t t/new_instance.t t/process.t t/request.t t/request_mp2.t t/response/TestApache/Singleton/Process/printer_instance.pm t/response/TestApache/Singleton/Request/printer_instance.pm t/response/TestApache/Singleton/request.pm t/singleton.t t000755000766000024 013140377200 14712 5ustar00mschoutstaff000000000000Apache-Singleton-0.17TEST.PL100644000766000024 61113140377200 16044 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t#!perl use strict; use warnings FATAL => 'all'; use lib qw(blib/lib); use Apache::TestRunPerl (); # mod_auth can cause test failures if in the wrong spot in the # Apache chain, so we just make sure it does not get added. (test case: static # mod_perl build and everything else as a DSO). Apache::TestConfig::autoconfig_skip_module_add('mod_auth.c'); Apache::TestRunPerl->new->run(@ARGV); SIGNATURE100644000766000024 736513140377200 16106 0ustar00mschoutstaff000000000000Apache-Singleton-0.17This file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.80. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 SHA1 22fdfa46c326d9b155bd25ded0113fd5a61da9be Changes SHA1 7723a717e5d5b325e5435fd706668cc096fb959c LICENSE SHA1 42768289228e94d064d46da5017be2dc70cb3518 MANIFEST SHA1 cd700cf2990e3f2b44504da1541bbd1a8dd30eea MANIFEST.SKIP SHA1 ec3573b394d54b6236cd2a423edc112808ddb30f META.json SHA1 878360a3e39b41cc0a7fa21966774d8cac122a35 META.yml SHA1 81e5d114ad5d8ffc0dac0e70aa05675315aaf0cd Makefile.PL SHA1 0f8939d79505ac256542824b3a5aacd70adc440b README SHA1 67a28c6d46f900fc34bc6df842094a7943ae44b0 lib/Apache/Singleton.pm SHA1 b32b34558630fa496498676d0d88c6bff55c18ca lib/Apache/Singleton/Process.pm SHA1 f0f1983c25819ec0d9c296b75e4581fd243ea59f lib/Apache/Singleton/Request.pm SHA1 ae6746c529ae00390016998223e17e046c0bf402 t/TEST.PL SHA1 6a442ecd0fe896777fc6a9c15bcc77f58c6af0a6 t/apache/singleton/process/printer_instance.t SHA1 0125edfa8087ea24461c5a398ab50713b57969d0 t/apache/singleton/request/printer_instance.t SHA1 8efad25309730a4d501fb40fc03eda4697303372 t/author-pod-syntax.t SHA1 19cc343f8a85c6805bbeb02580487483a6283887 t/author-signature.t SHA1 3c1df8a086f535819467ab89b944e13a7ac60d4b t/compile.t SHA1 2b1a6e84dbd7d106ae16f2ce86b03464ca2f2caa t/conf/extra.conf.in SHA1 cdbf5ce2a047f203dffd6b7476d5ae079fbf439d t/lib/Printer/Device/PerProcess.pm SHA1 eda1c07023b8de065df9315ae0473fc5c7e188bc t/lib/Printer/Device/PerRequest.pm SHA1 c1b5f84ff25a702d204912a659dcd03828827481 t/lib/Printer/PerProcess.pm SHA1 a498a952edc27a7be0ab8299b8bc77b7ca3b0538 t/lib/Printer/PerRequest.pm SHA1 be744f1752e7bbb5bf38e7e899acdbc943df736c t/mock/Apache.pm SHA1 17f648a7902e56e902a5753e255cdeaa8877d3b8 t/mock/Apache2/RequestUtil.pm SHA1 3182eeaa36b1c11ddd2ca3d57ae11780ad2d0a8b t/mock/Mock/Apache.pm SHA1 c8a0ecbfe110fb1c6ce6ecd2aa96a210476b473d t/mock/mod_perl.pm SHA1 dd998242b6632ee0ba45fb85fa8ebdb3539cecf6 t/mock/mod_perl2.pm SHA1 6906be1fbc63eec20c4385beddef2af2533d5106 t/multiclass.t SHA1 0379a5b667e982d96348c7a2d2ba8f8474a268b7 t/new_instance.t SHA1 2217c3ebca493dddf5e60d2f75884718ef689467 t/process.t SHA1 24dadebd6a0799135df8885524b3fd9a0a20e148 t/request.t SHA1 030a93c377abdbf9645e7c5d4b6af950d0a1b26f t/request_mp2.t SHA1 7275132dcaf45ecfa79e8c4f04614bf56848a83f t/response/TestApache/Singleton/Process/printer_instance.pm SHA1 f64ff004c0a77e6e4f144496bdb10da9668efd77 t/response/TestApache/Singleton/Request/printer_instance.pm SHA1 15978707f609815b9d1234c883157a7872c046f0 t/response/TestApache/Singleton/request.pm SHA1 734b6548a02d5c2a810c0f89aae0bdef7fca8339 t/singleton.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIVAwUBWYH+gKQl27WkM10aAQhOSw//TcOpkk93LycTcxXsC415jPxlN9Yn2/h3 gf5SFrdwDg/OqFmtj5bgaMzKcbr4qf3IlVqId0NmEwcR4MJdhUlKxB4jmvMniGGu nw5Z30hDVcFJQwlyBtziG0uTlEdylFCrdJtXpy7xjRWBsKRKOX2EpXfuOS0lmj17 HOoUlBi1vO33ukIH+ppzj8darJWg4/1PwfPt9DbQgCtMLViJhoNHjoBqvL2yx1LS AWLr7v9xK2O4Q6f2fdtgJ1+rMp8hYNxX3hC5bzqQQTfJKr1DIuxLvnQ0Mo6m3oDE xP7wOuHtmNCg2umUpw62cUgyHDOeQ+t9kMxHj3FmC28dgcwnykunBbKL/+IMghrD 3l6uCdPZWY9q8xM1UPaQ1t5Ub+UMLj4pjWyAkt/vxHzYz1W4kDqzuKTl62rb7nM1 If+icHU4stTqh/5qPndtXifvIst7zKW6Awd9DVtqmsfjfT40tOG0pS/hRtFkyk9S g62+TTUnHf+2TwMsLq7L2T756pWKKqWtRK1VLGoIbFZxF3fFPJ1VpxzsPH8ZLplP 5nB+HOASPJlK4o7kLVZKYpRmRkDAVl1MImXuLROsAJtKFP1ZkZzVALoG8FBY+p86 idjMvqe2ZUGOvUMRWqEu97vw3/AiACMopJ5ny87DsbhE7Q1zilAziybsRAP/Ghei EAW1W3jaNO8= =Krvc -----END PGP SIGNATURE----- META.json100644000766000024 417213140377200 16234 0ustar00mschoutstaff000000000000Apache-Singleton-0.17{ "abstract" : "Singleton class for mod_perl", "author" : [ "Michael Schout " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Apache-Singleton", "prereqs" : { "configure" : { "requires" : { "perl" : "5.006" } }, "develop" : { "requires" : { "Dist::Zilla" : "5", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::Plugin::RemovePrereqs" : "0", "Dist::Zilla::PluginBundle::MSCHOUT" : "0", "Software::License::Perl_5" : "0", "Test::Pod" : "1.41", "Test::Signature" : "0" } }, "runtime" : { "requires" : { "Apache" : "0", "Apache2::RequestUtil" : "0", "Apache::Test" : "1.35", "base" : "0", "constant" : "0", "perl" : "5.006", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "Apache2::RequestIO" : "0", "Apache2::RequestRec" : "0", "Apache::Test" : "1.35", "Apache::TestRequest" : "0", "Apache::TestRunPerl" : "0", "Test::More" : "0", "lib" : "0", "mod_perl2" : "0", "perl" : "5.006" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-apache-singleton at rt.cpan.org", "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Apache-Singleton" }, "homepage" : "http://search.cpan.org/dist/Apache-Singleton/", "repository" : { "type" : "git", "url" : "git://github.com/mschout/apache-singleton.git", "web" : "https://github.com/mschout/apache-singleton" } }, "version" : "0.17", "x_serialization_backend" : "Cpanel::JSON::XS version 3.0217" } Makefile.PL100644000766000024 471413140377200 16567 0ustar00mschoutstaff000000000000Apache-Singleton-0.17use 5.006; use strict; use ExtUtils::MakeMaker; # minimum Apache::Test version. # 1.26 fixes Test::Builder problems use constant MIN_APACHE_TEST_VERSION => 1.26; use constant HAVE_APACHE_TEST => eval { require Apache::Test && Apache::Test->VERSION >= MIN_APACHE_TEST_VERSION }; my @CleanFiles; if (HAVE_APACHE_TEST) { require Apache::TestMM; Apache::TestMM->import(qw(test clean)); push @CleanFiles, 't/TEST'; Apache::TestMM::filter_args(); Apache::TestMM::generate_script('t/TEST'); } else { print "Skipping Apache::Test setup (Apache::Test 1.26 or later required)\n"; } my %conf = ( NAME => 'Apache::Singleton', VERSION_FROM => 'lib/Apache/Singleton.pm', PREREQ_PM => { 'Test::More' => 0.32, 'Apache::Test' => MIN_APACHE_TEST_VERSION, }, clean => { FILES => join ' ', @CleanFiles } ); if (mod_perl_version() == 2) { # require 2.0 RC5 (Apache -> Apache2) $conf{PREREQ_PM}{mod_perl2} = 1.999022; } else { $conf{PREREQ_PM}{mod_perl} = 0; } if (MM->can('signature_target')) { $conf{SIGN} = 1; } if ($] >= 5.005) { $conf{ABSTRACT_FROM} = 'lib/Apache/Singleton.pm'; $conf{AUTHOR} = 'Michael Schout '; } if ($ExtUtils::MakeMaker::VERSION >= 6.48) { $conf{META_MERGE} = { no_index => { directory => [qw(t)] }, resources => { bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache-Singleton', repository => 'http://github.com/mschout/apache-singleton', homepage => 'http://github.com/mschout/apache-singleton/downloads' } }; } WriteMakefile(%conf); sub mod_perl_version { # try to figure out what version of mod_perl is installed. eval { require mod_perl }; unless ($@) { if ($mod_perl::VERSION < 1.99) { return 1; } elsif ($mod_perl::VERSION < 1.999022) { # this is mod_perl2 < 2.0 RC5 (1.999_21 or earlier). # Apache renamed to Apache2 in 1.999_22 die "mod_perl 2.0.0 RC5 (1.999022) or later is required ", "for this module\n", " found version $mod_perl::VERSION at ", $INC{'mod_perl.pm'}; } } eval { require mod_perl2; }; unless ($@) { return 2; } # we didn't fine a supported version issue a warning, and assume version 2. warn "no supported mod_perl version was found. assuming version 2\n"; return 2; } compile.t100644000766000024 11513140377200 16644 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/tuse strict; use Test::More tests => 1; BEGIN { use_ok 'Apache::Singleton' } process.t100644000766000024 114313140377200 16714 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/tuse strict; use lib qw(t/mock t/lib lib); use Test::More tests => 4; use Mock::Apache; use mod_perl; use Printer::PerProcess; use Printer::Device::PerProcess; my $printer_a = Printer::PerProcess->instance; my $printer_b = Printer::PerProcess->instance; my $printer_d1 = Printer::Device::PerProcess->instance; my $printer_d2 = Printer::Device::PerProcess->instance; is "$printer_a", "$printer_b", 'same printer'; isnt "$printer_a", "$printer_d1", 'not same printer'; is "$printer_d1", "$printer_d2", 'same printer'; $printer_a->{foo} = 'bar'; is $printer_a->{foo}, $printer_b->{foo}, "attributes shared"; request.t100644000766000024 116313140377200 16730 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/tuse strict; use lib qw(t/mock t/lib lib); use Test::More tests => 4; use Mock::Apache; use mod_perl; # simulate MP1 use Printer::PerRequest; use Printer::Device::PerRequest; my $printer_a = Printer::PerRequest->instance; my $printer_b = Printer::PerRequest->instance; my $printer_d1 = Printer::Device::PerRequest->instance; my $printer_d2 = Printer::Device::PerRequest->instance; is "$printer_a", "$printer_b", 'same printer'; isnt "$printer_a", "$printer_d1", 'not same printer'; is "$printer_d1", "$printer_d2", 'same printer'; $printer_a->{foo} = 'bar'; is $printer_a->{foo}, $printer_b->{foo}, "attributes shared"; MANIFEST.SKIP100644000766000024 115413140377200 16506 0ustar00mschoutstaff000000000000Apache-Singleton-0.17\B\.git\b \B\.gitignore\b # Avoid Makemaker generated and utility files. \bMANIFEST\.bak \bMakefile$ \bblib/ \bMakeMaker-\d \bpm_to_blib\.ts$ \bpm_to_blib$ \bblibdirs\.ts$ # 6.18 through 6.25 generated this # Avoid temp and backup files. ~$ \.old$ \#$ \b\.# \.bak$ # Avoid Devel::Cover files. \bcover_db\b # Apache::Test generated files ^t/TEST$ ^t/SMOKE$ ^t/conf/apache_test_config.pm$ ^t/conf/extra.conf$ ^t/conf/httpd.conf$ ^t/conf/modperl_inc.pl$ ^t/conf/modperl_startup.pl$ ^t/htdocs/index.html$ ^t/logs # Apache::Test generated tests ^t/apache/singleton/request.t$ ^MYMETA\. ^\.travis.yml$ ^dist.ini$ singleton.t100644000766000024 63713140377200 17227 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/tuse strict; use lib qw(t/mock lib); use Test::More tests => 2; use Mock::Apache; package Printer; use base qw(Apache::Singleton); package main; { my $printer_a = Printer->instance; my $printer_b = Printer->instance; is "$printer_a", "$printer_b", 'same printer'; } { my $printer_a = Printer->instance; my $printer_b = Printer->instance; is "$printer_a", "$printer_b", 'same printer'; } multiclass.t100644000766000024 100713140377200 17415 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/tuse strict; use lib qw(t/mock lib); use Test::More tests => 3; use Mock::Apache; package Printer; use base qw(Apache::Singleton); package Printer::Device; use base qw(Apache::Singleton); package main; my $printer_a = Printer->instance; my $printer_b = Printer->instance; my $printer_d1 = Printer::Device->instance; my $printer_d2 = Printer::Device->instance; is "$printer_a", "$printer_b", 'same printer'; isnt "$printer_a", "$printer_d1", 'not same printer'; is "$printer_d1", "$printer_d2", 'same printer'; request_mp2.t100644000766000024 122313140377200 17503 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t#!perl # # tests for mod_perl2 # use strict; use lib qw(t/mock t/lib lib); use Test::More tests => 4; use Mock::Apache; use mod_perl2; # simulate MP2 use Printer::PerRequest; use Printer::Device::PerRequest; my $printer_a = Printer::PerRequest->instance; my $printer_b = Printer::PerRequest->instance; my $printer_d1 = Printer::Device::PerRequest->instance; my $printer_d2 = Printer::Device::PerRequest->instance; is "$printer_a", "$printer_b", 'same printer'; isnt "$printer_a", "$printer_d1", 'not same printer'; is "$printer_d1", "$printer_d2", 'same printer'; $printer_a->{foo} = 'bar'; is $printer_a->{foo}, $printer_b->{foo}, "attributes shared"; new_instance.t100644000766000024 63013140377200 17673 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t#!/usr/bin/env perl # use strict; use lib qw(t/mock lib); use Test::More; use Mock::Apache; package Printer; use base qw(Apache::Singleton); package main; my $printer_a = Printer->instance(foo => 'bar'); my $printer_b = Printer->instance; isa_ok $printer_a, 'Printer'; isa_ok $printer_b, 'Printer'; # both should have foo => bar is $printer_a->{foo}, 'bar'; is $printer_b->{foo}, 'bar'; done_testing; mock000755000766000024 013140377200 15643 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/tApache.pm100644000766000024 10313140377200 17474 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/mockpackage Apache; sub request { bless {}, 'Mock::Apache'; } 1; mod_perl.pm100644000766000024 15613140377200 20124 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/mock# dummy mod_perl package for tests # just set mod_perl::VERSION package mod_perl; our $VERSION = '1.27'; 1; mod_perl2.pm100644000766000024 16113140377200 20202 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/mock# dummy mod_perl2 for tests. # just set $mod_perl::VERSION to 2.00 package mod_perl; our $VERSION = '2.00'; 1; conf000755000766000024 013140377200 15637 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/textra.conf.in100644000766000024 53713140377200 20363 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/conf PerlOptions +GlobalRequest # needed so $mod_perl::VERSION is available PerlModule mod_perl2 # needed so $mod_perl::VERSION is available PerlModule mod_perl # RT #76244 # printer_instance.t expects the same apache to handle each request. MaxClients 1 # vim: ft=apache author-signature.t100644000766000024 65713140377200 20530 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t#!perl -w BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::AuthorSignatureTest use strict; use warnings; use Test::More; unless (eval { require Test::Signature; 1 }) { plan skip_all => 'Test::Signature is required for this test'; } Test::Signature::signature_ok(); done_testing; Mock000755000766000024 013140377200 16534 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/mockApache.pm100644000766000024 22313140377200 20370 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/mock/Mockpackage Mock::Apache; my %pnotes; sub pnotes { my($self, $key, $val) = @_; $pnotes{$key} = $val if $val; return $pnotes{$key}; } 1; author-pod-syntax.t100644000766000024 45413140377200 20630 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Apache000755000766000024 013140377200 16376 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/libSingleton.pm100644000766000024 741613140377200 21046 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/lib/Apache# # This file is part of Apache-Singleton # # This software is copyright (c) 2009 by Michael Schout. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # package Apache::Singleton; $Apache::Singleton::VERSION = '0.17'; # ABSTRACT: Singleton class for mod_perl use strict; use warnings; # load appropriate subclass if ($ENV{MOD_PERL}) { require Apache::Singleton::Request; } else { require Apache::Singleton::Process; } sub instance { my $class = shift; my $instance = $class->_get_instance; unless (defined $instance) { $instance = $class->_new_instance(@_); $class->_set_instance($instance); } return $instance; } sub _new_instance { my $class = shift; my %args = (@_ && ref $_[0] eq 'HASH') ? %{ $_[0] } : @_; bless { %args }, $class; } # Abstract methods, but compatible default sub _get_instance { my $class = shift; if ($ENV{MOD_PERL}) { $class->Apache::Singleton::Request::_get_instance(@_); } else { $class->Apache::Singleton::Process::_get_instance(@_); } } sub _set_instance { my $class = shift; if ($ENV{MOD_PERL}) { $class->Apache::Singleton::Request::_set_instance(@_); } else { $class->Apache::Singleton::Process::_set_instance(@_); } } 1; __END__ =pod =head1 NAME Apache::Singleton - Singleton class for mod_perl =head1 VERSION version 0.17 =head1 SYNOPSIS package Printer; # default: # Request for mod_perl env # Process for non-mod_perl env use base qw(Apache::Singleton); package Printer::PerRequest; use base qw(Apache::Singleton::Request); package Printer::PerProcess; use base qw(Apache::Singleton::Process); =head1 DESCRIPTION Apache::Singleton works the same as Class::Singleton, but with various object lifetime (B). See L first. =head1 OBJECT LIFETIME By inheriting one of the following sublasses of Apache::Singleton, you can change the scope of your object. =over 4 =item Request use base qw(Apache::Singleton::Request); One instance for one request. Apache::Singleton will remove instance on each request. Implemented using mod_perl C API. In mod_perl environment (where C<$ENV{MOD_PERL}> is defined), this is the default scope, so inheriting from Apache::Singleton would do the same effect. B: You need C in your apache configuration in order to use the I lifetime method. =item Process use base qw(Apache::Singleton::Process); One instance for one httpd process. Implemented using package global. In non-mod_perl environment, this is the default scope, and you may notice this is the same beaviour with Class::Singleton ;) So you can use this module safely under non-mod_perl environment. =back =head1 CREDITS Original idea by Matt Sergeant Ematt@sergeant.orgE and Perrin Harkins Eperrin@elem.comE. Initial implementation and versions 0.01 to 0.07 by Tatsuhiko Miyagawa Emiyagawa@bulknews.netE. =head1 SEE ALSO L, L, L =head1 SOURCE The development version is on github at L and may be cloned from L =head1 BUGS Please report any bugs or feature requests to bug-apache-singleton@rt.cpan.org or through the web interface at: http://rt.cpan.org/Public/Dist/Display.html?Name=Apache-Singleton =head1 AUTHOR Michael Schout =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Michael Schout. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Printer000755000766000024 013140377200 17103 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/libPerProcess.pm100644000766000024 12513140377200 21644 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/lib/Printerpackage Printer::PerProcess; use strict; use base 'Apache::Singleton::Process'; 1; PerRequest.pm100644000766000024 12513140377200 21656 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/lib/Printerpackage Printer::PerRequest; use strict; use base 'Apache::Singleton::Request'; 1; Apache2000755000766000024 013140377200 17106 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/mockRequestUtil.pm100644000766000024 12113140377200 22044 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/mock/Apache2package Apache2::RequestUtil; sub request { bless {}, 'Mock::Apache'; } 1; Singleton000755000766000024 013140377200 20340 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/lib/ApacheProcess.pm100644000766000024 331013140377200 22451 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/lib/Apache/Singleton# # This file is part of Apache-Singleton # # This software is copyright (c) 2009 by Michael Schout. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # package Apache::Singleton::Process; $Apache::Singleton::Process::VERSION = '0.17'; # ABSTRACT: One instance per One Process use strict; use warnings; use base 'Apache::Singleton'; no strict 'refs'; my %INSTANCES; sub _get_instance { my $class = shift; $class = ref $class || $class; return $INSTANCES{$class}; } sub _set_instance { my($class, $instance) = @_; $class = ref $class || $class; $INSTANCES{$class} = $instance; } END { # dereferences and causes orderly destruction of all instances undef(%INSTANCES); } 1; __END__ =pod =head1 NAME Apache::Singleton::Process - One instance per One Process =head1 VERSION version 0.17 =head1 SYNOPSIS package Printer; use base qw(Apache::Singleton::Process); =head1 DESCRIPTION See L. =head1 SEE ALSO L =head1 SOURCE The development version is on github at L and may be cloned from L =head1 BUGS Please report any bugs or feature requests to bug-apache-singleton@rt.cpan.org or through the web interface at: http://rt.cpan.org/Public/Dist/Display.html?Name=Apache-Singleton =head1 AUTHOR Michael Schout =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Michael Schout. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Request.pm100644000766000024 371713140377200 22476 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/lib/Apache/Singleton# # This file is part of Apache-Singleton # # This software is copyright (c) 2009 by Michael Schout. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # package Apache::Singleton::Request; $Apache::Singleton::Request::VERSION = '0.17'; # ABSTRACT: One instance per One Request use strict; use warnings; use base 'Apache::Singleton'; BEGIN { use constant MP2 => $mod_perl::VERSION >= 1.99 ? 1 : 0; if (MP2) { require Apache2::RequestUtil; } else { require Apache; } } sub _get_instance { my $class = shift; my $r = MP2 ? Apache2::RequestUtil->request : Apache->request; my $key = "apache_singleton_$class"; return $r->pnotes($key); } sub _set_instance { my($class, $instance) = @_; my $r = MP2 ? Apache2::RequestUtil->request : Apache->request; my $key = "apache_singleton_$class"; $r->pnotes($key => $instance); } 1; __END__ =pod =head1 NAME Apache::Singleton::Request - One instance per One Request =head1 VERSION version 0.17 =head1 SYNOPSIS # in httpd.conf PerlOptions +GlobalRequest # in your module (e.g.: Printer.pm) package Printer; use base qw(Apache::Singleton::Request); =head1 DESCRIPTION See L. =head1 SEE ALSO L =head1 SOURCE The development version is on github at L and may be cloned from L =head1 BUGS Please report any bugs or feature requests to bug-apache-singleton@rt.cpan.org or through the web interface at: http://rt.cpan.org/Public/Dist/Display.html?Name=Apache-Singleton =head1 AUTHOR Michael Schout =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2009 by Michael Schout. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Device000755000766000024 013140377200 20302 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/lib/PrinterPerProcess.pm100644000766000024 17213140377200 23045 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/lib/Printer/Devicepackage Printer::Device::PerProcess; use strict; use warnings FATAL => 'all'; use base 'Apache::Singleton::Process'; 1; PerRequest.pm100644000766000024 17213140377200 23057 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/lib/Printer/Devicepackage Printer::Device::PerRequest; use strict; use warnings FATAL => 'all'; use base 'Apache::Singleton::Request'; 1; Singleton000755000766000024 013140377200 22533 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/response/TestApacherequest.pm100644000766000024 166313140377200 24727 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/response/TestApache/Singletonpackage TestApache::Singleton::request; use strict; use warnings FATAL => 'all'; use constant MP2 => $mod_perl::VERSION >= 1.99; use Apache::Singleton::Request; use Printer::PerRequest; use Printer::Device::PerRequest; if (MP2) { require Apache2::RequestRec; require Apache2::RequestIO; } no strict 'refs'; use Test::More; use Apache::Test '-withtestmore'; sub handler { my $r = shift; plan $r, tests => 4; my $printer_a = Printer::PerRequest->instance; my $printer_b = Printer::PerRequest->instance; my $printer_d1 = Printer::Device::PerRequest->instance; my $printer_d2 = Printer::Device::PerRequest->instance; is "$printer_a", "$printer_b", 'same printer'; isnt "$printer_a", "$printer_d2", 'not same printer'; is "$printer_d1", "$printer_d2", 'same printer device'; $printer_a->{foo} = 'bar'; is $printer_a->{foo}, $printer_b->{foo}, 'attributes are shared'; 0; } 1; process000755000766000024 013140377200 21613 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/apache/singletonprinter_instance.t100644000766000024 54413140377200 25472 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/apache/singleton/process#!perl # # test that printer instances persist across requests # use strict; use Test::More tests => 1; use Apache::TestRequest 'GET_BODY'; my $printer_a = GET_BODY "/TestApache__Singleton__Process__printer_instance"; my $printer_b = GET_BODY "/TestApache__Singleton__Process__printer_instance"; is $printer_a, $printer_b, 'printers are same instance'; request000755000766000024 013140377200 21625 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/apache/singletonprinter_instance.t100644000766000024 54413140377200 25504 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/apache/singleton/request#!perl # # test that printer instances do not persist across requests # use strict; use Test::More tests => 1; use Apache::TestRequest 'GET_BODY'; my $printer_a = GET_BODY "/TestApache__Singleton__Request__printer_instance"; my $printer_b = GET_BODY "/TestApache__Singleton__Request__printer_instance"; isnt $printer_a, $printer_b, 'not same instance'; Process000755000766000024 013140377200 24151 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/response/TestApache/Singletonprinter_instance.pm100644000766000024 72413140377200 30201 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/response/TestApache/Singleton/Processpackage TestApache::Singleton::Process::printer_instance; use strict; use warnings FATAL => 'all'; use constant MP2 => $mod_perl::VERSION >= 1.99; use Printer::PerProcess; if (MP2) { require Apache2::RequestRec; require Apache2::RequestIO; } sub handler { my $r = shift; $r->content_type('text/plain'); if (!MP2) { $r->send_http_header; } my $printer = Printer::PerProcess->instance; $r->write("$printer"); 0; } 1; Request000755000766000024 013140377200 24163 5ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/response/TestApache/Singletonprinter_instance.pm100644000766000024 72413140377200 30213 0ustar00mschoutstaff000000000000Apache-Singleton-0.17/t/response/TestApache/Singleton/Requestpackage TestApache::Singleton::Request::printer_instance; use strict; use warnings FATAL => 'all'; use constant MP2 => $mod_perl::VERSION >= 1.99; use Printer::PerRequest; if (MP2) { require Apache2::RequestRec; require Apache2::RequestIO; } sub handler { my $r = shift; $r->content_type('text/plain'); if (!MP2) { $r->send_http_header; } my $printer = Printer::PerRequest->instance; $r->write("$printer"); 0; } 1;