perl/plp/.git
14 years agov3.23 release 3.23
Mischa POSLAWSKY [Wed, 21 Oct 2009 21:53:19 +0000 (23:53 +0200)]
v3.23 release

14 years agovim: reset style at plp block start
Mischa POSLAWSKY [Fri, 27 Feb 2009 22:15:19 +0000 (23:15 +0100)]
vim: reset style at plp block start

PLPperlblock should not be made 'transparent', because this incorrectly
preserves the current HTML highlight for default Perl code.  Mixing Perl and
HTML styling can lead to very strange and unwanted effects, like partially
marking the following code as a comment:

<!-- <: print not_a_comment(); :> -->

14 years agocapture actual test warnings
Mischa POSLAWSKY [Tue, 20 Oct 2009 22:02:20 +0000 (00:02 +0200)]
capture actual test warnings

Compare expected `use warnings` output to warnings produced by similar code
instead of hardcoding text.  It doesn't really matter what is said, as long
it's the same using plp.

Fixes (so far and afaik) a slight change introduced by Perl v5.11.0 in
"Useless use of a constant in void context" (adding details about which
constant).

14 years agofix tiny typo in PLP::HowTo title
Mischa POSLAWSKY [Tue, 20 Oct 2009 22:08:59 +0000 (00:08 +0200)]
fix tiny typo in PLP::HowTo title

14 years agoEscapeHTML function
Mischa POSLAWSKY [Mon, 11 Feb 2008 02:44:29 +0000 (02:44 +0000)]
EscapeHTML function

Another function to encode html/xml, this time (imho) the "right" way by
only quoting reserved characters.  The provided Entity() function would
often be unusable because of its overcomplete whitespace formatting.
This is a feature which I (have to) set up manually in many cases, which
seems very unfriendly for a module optimised for outputting HTML.

According to personal preferences, it only substitutes a minimal set of
entities:
- &amp; and &lt; (both required to prevent html interpretation)
- &gt; (for xml or otherwise to ease document parsing)
- &quot; (to make it usable in attribute values).

Single quotes (&#39; or &apos;) are left unquoted, assuming attributes are
always in double quotes (no reason to do otherwise).
Unlike Entity, it only handles a single argument, to allow for possible
options in the future (hopefully supporting a custom range of unsafe chars).
It also dies on failure (like trying to change read-only input), because
that is a user mistake which should not go unnoticed.

The name was devised to be more consistent with other environments (also
anticipating new URI encoding and decoding):

* php                   htmlspecialchars  html_entity_decode urlrawencode       urldecode
* javascript                                                 encodeURIComponent decodeURIComponent
* ruby CGI              escapeHTML        unescapeHTML       escape             unescape
- CGI::Simple::Util     escapeHTML        unescapeHTML       escape             unescape
- CGI::Util             (simple_escape)                      escape             unescape
- HTML::Mason::Escapes  basic_html_escape                    url_escape
- HTML::Tiny            entity_encode                        url_encode         url_decode
* URI::Escape                                                uri_escape_utf8    uri_unescape
* XML::Quote            xml_quote         xml_dequote
- PLP (legacy)          Entity                               EncodeURI          DecodeURI
- PLP (redesign)        EscapeHTML        UnescapeHTML       EscapeURI          UnescapeURI

HTML:
- Escape etc used nearly everywhere (so the obvious choice).
- Decode is only used by php, but uglily and inconsistently.
- Quote seems most appropriate linguistically, but only used in one minority
  module.

URIs:
- Encode etc common in php and javascript.
- Escape etc used by ruby and several perl modules (including URI::Escape),
  and is still familiar to javascript users
- URI used in all significant environemnts; URL only in minor modules.

14 years agofix header output triggered by say() in perl 5.10.1+
Mischa POSLAWSKY [Sat, 17 Oct 2009 05:45:59 +0000 (07:45 +0200)]
fix header output triggered by say() in perl 5.10.1+

Since the latest Perl release, calling sendheaders() from within a say()
would (correctly) retain a custom output seperator, resulting in http
headers being sent incorrectly.

Easily fixed by resetting normal printing behaviour.

15 years agoresolve test directory
Mischa POSLAWSKY [Thu, 5 Jun 2008 17:47:14 +0000 (17:47 +0000)]
resolve test directory

File::Spec->tmpdir may return a symlink as well, so
c41c902ca6fd9f8e352267be64d (test in directories provided by Test::Spec)
still didn't fix darwin (in all cases).

The darwin I tested on gave a tmpdir like:
/var/folders/OJ/OJjGh2I+HBOinZB8Re8QVU+++TI/-Tmp-
but cpantesters machines are still using a symlinked /tmp.

Use Cwd to find the real path name, hopefully fixing all remaining cases.

15 years agoexclude PLP::Script from META.yml provides
Mischa POSLAWSKY [Thu, 5 Jun 2008 00:18:00 +0000 (00:18 +0000)]
exclude PLP::Script from META.yml provides

Saying we've got PLP::Script might have been useful to users looking
for it, but it seems to provide more disadvantages, confusing at least
search.cpan.org (thinks PLP is pod now).

15 years agocompact output in warnings test
Mischa POSLAWSKY [Thu, 5 Jun 2008 00:06:51 +0000 (00:06 +0000)]
compact output in warnings test

15 years agowarn pre-start() errors
Mischa POSLAWSKY [Wed, 4 Jun 2008 22:56:25 +0000 (22:56 +0000)]
warn pre-start() errors

Early warnings (cgi 403/404) should warn instead of print to STDERR.
This allows them to be handled by $SIG{__WARN__} (usually not set, but
used in tests).

15 years agotest in directories provided by Test::Spec
Mischa POSLAWSKY [Wed, 4 Jun 2008 21:56:48 +0000 (21:56 +0000)]
test in directories provided by Test::Spec

On darwin machines /tmp seems to be symlinked to /private/tmp, resulting
in different file names reported by <()> (uses rel2abs with dirname of
parent file) and Include() (uses rel2abs in cwd, so symlinks are
resolved).  Similarly, on windows the latter adds a drive name (C:\tmp).

F::S->tmpdir should provide a preresolved directory, so results are the
same.

15 years agofix perl 5.6 syntax error in t/50-cgi.t
Mischa POSLAWSKY [Wed, 4 Jun 2008 16:50:21 +0000 (16:50 +0000)]
fix perl 5.6 syntax error in t/50-cgi.t

> Bareword "STDOUT" not allowed while "strict subs" in use.

15 years agotest 403 and 404 responses
Mischa POSLAWSKY [Tue, 3 Jun 2008 07:27:54 +0000 (07:27 +0000)]
test 403 and 404 responses

15 years agodo not require server signature on page error
Mischa POSLAWSKY [Tue, 3 Jun 2008 07:32:42 +0000 (07:32 +0000)]
do not require server signature on page error

In rare cases, SERVER_SIGNATURE may not be set.  This isn't a problem,
but we need to check for definedness to prevent warnings.

15 years agofix missinginclude tests 3.22_01
Mischa POSLAWSKY [Tue, 3 Jun 2008 03:35:27 +0000 (03:35 +0000)]
fix missinginclude tests

Try to open the missing file in the same way PLP::source() will,
to obtain the same warning message.

For example MSWin32-x86-multi-thread said:
Can't open "C:\Perl\cpan\build\PLP-3.22-ZfVju5\missinginclude" (No such file or directory)
while several CPANTS linuxes were localized:
Can't open "/tmp/missinginclude" (Datei oder Verzeichnis nicht gefunden)

15 years agov3.22 release 3.22
Mischa POSLAWSKY [Mon, 2 Jun 2008 19:21:13 +0000 (19:21 +0000)]
v3.22 release

15 years agodeclare provides in META.yml
Mischa POSLAWSKY [Mon, 2 Jun 2008 19:14:59 +0000 (19:14 +0000)]
declare provides in META.yml

List provided modules (recommended by Kwalitee metayml_has_provides).
Module::Build would find the same data, but telling it to leave other
fields alone currently takes more effort than simply updating it
manually.  Maybe later.

15 years agorequire Test::YAML::Meta 0.10 for correct testing
Mischa POSLAWSKY [Sun, 1 Jun 2008 10:14:50 +0000 (10:14 +0000)]
require Test::YAML::Meta 0.10 for correct testing

Versions upto the current 0.09 do not parse repository resource url
correctly (Unknown protocol used in URL (git://)).  This will most
likely be fixed in the next version.

Addendum: confirmed by BARBIE 2008-06-02 10:34:18 GMT:
> Added 'git' as a valid url protocol in:
> Test-YAML-Meta-0.10

15 years agorewrite documentation of mod_perl as the only persistent backend
Mischa POSLAWSKY [Mon, 2 Jun 2008 08:10:52 +0000 (08:10 +0000)]
rewrite documentation of mod_perl as the only persistent backend

Update docs to reflect the multiple persistent backends (mod_perl was
mentioned specifically where FastCGI now qualifies as well).

15 years agoexpect unordered headers in tests
Mischa POSLAWSKY [Mon, 2 Jun 2008 07:10:27 +0000 (07:10 +0000)]
expect unordered headers in tests

Headers are stored as hash, which will be printed in semi-random order.
Sort all lines in output upto the first empty line, in order to compare
reliably.

15 years agofix delete %header
Mischa POSLAWSKY [Mon, 2 Jun 2008 06:56:40 +0000 (06:56 +0000)]
fix delete %header

Header value wasn't deleted case-insensitively.  Because the alias was
still removed correctly, it usually worked, but as of recently producing
warnings in sendheaders().

Also, delete returned the original key (not documented anywhere).
Change this to always return the deleted value, matching the behaviour
of normal hashes and user expectation.

15 years ago50-cgi.t: test PLP::Backend::CGI parse output of most plp features
Mischa POSLAWSKY [Tue, 2 Oct 2007 17:47:15 +0000 (19:47 +0200)]
50-cgi.t: test PLP::Backend::CGI parse output of most plp features

15 years agofix Exporter inclusion
Mischa POSLAWSKY [Mon, 2 Jun 2008 00:43:56 +0000 (00:43 +0000)]
fix Exporter inclusion

Revert recent change of including only import() from Exporter instead of
basing on it, as the latter fails on older Perls (smoke on versions
5.8.2 and below).  Broke PLP::Functions in these versions at
d9f3acb221a71e094318c7b5d3809aa81dbb5bb3 (use warnings in all modules).

15 years agov3.21 release 3.21
Mischa POSLAWSKY [Sat, 31 May 2008 20:05:16 +0000 (20:05 +0000)]
v3.21 release

15 years agotreat custom exit() as private for now
Mischa POSLAWSKY [Sat, 31 May 2008 21:53:00 +0000 (21:53 +0000)]
treat custom exit() as private for now

Do not require documentation coverage of PLP::Functions::exit,
it's supposed to be a transparant replacement of CORE::exit.

I'll probably move it outside of this module later (no side-effects
to make it usable without PLP), but that's a seperate fix.

15 years agoorder v3.21 Changes by significance
Mischa POSLAWSKY [Sat, 31 May 2008 21:37:08 +0000 (21:37 +0000)]
order v3.21 Changes by significance

15 years agodisable warnings within PLP::Script
Mischa POSLAWSKY [Sat, 31 May 2008 21:09:47 +0000 (21:09 +0000)]
disable warnings within PLP::Script

d9f3acb221a71e094318c7b5d3809aa81dbb5bb3 (use warnings in all modules)
would not only enable warnings in plp modules, but also users' code
evalled within.  Obviously not a nice thing to do.

15 years agoretain undef in encoding functions
Mischa POSLAWSKY [Sat, 31 May 2008 21:23:38 +0000 (21:23 +0000)]
retain undef in encoding functions

Entity(), DecodeURI(), and EncodeURI() should return undef for any
undefined input.  Only string behaviour was specified, so users relying
on this did so at their own risk (and they can always disable warnings
like the careless bitches they are :P).

Not too coincidently also silences warnings in PLP::Functions itself.

15 years agoundefined warnings while reading unknown headers
Mischa POSLAWSKY [Sat, 31 May 2008 20:35:54 +0000 (20:35 +0000)]
undefined warnings while reading unknown headers

Return undef for unaliased headers right away, instead of trying to find
$header{+undef}.  Result is the same (the '' header never exists at this
point), but without the warning.

15 years agofix undefined warning in apache cgi path
Mischa POSLAWSKY [Sat, 31 May 2008 19:57:57 +0000 (19:57 +0000)]
fix undefined warning in apache cgi path

PATH_INFO was intentionally declared undef in PLP::Backend::CGI, but
would be concatenated later (in Apache mode at least), giving warnings
since d9f3acb221a71e094318c7b5d3809aa81db (use warnings in all modules).

15 years agoonly test PLP::Functions in t/10-functions.t
Mischa POSLAWSKY [Sat, 31 May 2008 19:30:19 +0000 (19:30 +0000)]
only test PLP::Functions in t/10-functions.t

Functions could be used seperately from the rest of PLP, so do not
require everything.  This test is covered by t/50-cgi.t now.

15 years agofix PLP::everything() wrapper
Mischa POSLAWSKY [Sat, 31 May 2008 19:02:45 +0000 (19:02 +0000)]
fix PLP::everything() wrapper

CGI initiator everything() was moved in 96959bff080392067524996e6edbf954
(move backend interface modules into PLP::Backend:: namespace)
and made a method, but backwards compatibility wrapper doesn't call it
as such.  This breaks old plp.cgi scripts, completely negating the
purpose of this feature.

15 years agoorder tests
Mischa POSLAWSKY [Sat, 31 May 2008 18:51:02 +0000 (18:51 +0000)]
order tests

Prefix filenames so they sort in order of significance.

15 years agoadd charset to default content-type header if STDOUT is in UTF-8
Mischa POSLAWSKY [Fri, 30 May 2008 18:34:45 +0000 (18:34 +0000)]
add charset to default content-type header if STDOUT is in UTF-8

If output has utf8 layer enabled, it makes only sense to mark it as such
to clients.  Only available with PerlIO (as of Perl 5.8 afaict), but not
fatal (assume non-utf8) if it doesn't work.

Charset is only added at first read or change of the content-type value,
so it's not hardcoded to site defaults.  Requires an extra object
variable unfortunately, but the only way to make it useful (no page
runtime accomodation wouldn't give much advantage).

15 years agoundefined warnings during Fields parsing
Mischa POSLAWSKY [Fri, 30 May 2008 17:37:09 +0000 (17:37 +0000)]
undefined warnings during Fields parsing

Accessing undefined values pollutes error logs since
d9f3acb221a71e094318c7b5d3809aa81dbb5bb3 (use warnings in all modules).

15 years agotest pod coverage as far as applicable
Mischa POSLAWSKY [Fri, 30 May 2008 02:38:00 +0000 (02:38 +0000)]
test pod coverage as far as applicable

15 years agooutput multiline %headers as multiple headers of the same name
Mischa POSLAWSKY [Thu, 29 May 2008 21:47:57 +0000 (21:47 +0000)]
output multiline %headers as multiple headers of the same name

Allowing repeated HTTP headers (RFC2616 ยง4.2) even though this didn't
add much value afterall (one may also use commas).  It does prevent
(accidentally) malformed header values though, as most servers don't
seem to handle continuation lines.

15 years agoadd version numbers to versionless modules
Mischa POSLAWSKY [Thu, 29 May 2008 20:28:58 +0000 (20:28 +0000)]
add version numbers to versionless modules

15 years agouse warnings in all modules
Mischa POSLAWSKY [Thu, 29 May 2008 20:27:33 +0000 (20:27 +0000)]
use warnings in all modules

15 years agoimprove plpinfo page
Mischa POSLAWSKY [Thu, 29 May 2008 20:13:29 +0000 (20:13 +0000)]
improve plpinfo page

Fix version display in Perl >= 5.10: $^V no longer consists out of
single characters for each level.  Use the recommended practise of
formatting with sprintf (see perlvar) which seems to work in at least
5.6.1 (ie good enough).

Add 'Perl API' version analogous to 'PHP API' in phpinfo().
Some fallbacks if variables are empty or undefined.

15 years agofix META.yml syntax
Mischa POSLAWSKY [Thu, 29 May 2008 18:04:40 +0000 (20:04 +0200)]
fix META.yml syntax

Bah, used lists where simple maps were expected (though this syntax is
used with optional_features and another project of mine, so slightly
excusable except for missing tests).

Also, Test::YAML::Meta wants keys of optional_features to conform to
/^[a-z_-]+$/.  This isn't mentioned anywhere in the specifications, but
a passing test is more useful than a minor stylistic detail.

Finally, while 'repository' apparantly still isn't an official resources
key, it _is_ mentioned as such (lowercased) in the specs.  In fact
everyone seems to use it like that, so I guess being technically
incorrect will be supported better.

15 years agoadd a few todo entries
Mischa POSLAWSKY [Wed, 28 May 2008 08:36:52 +0000 (08:36 +0000)]
add a few todo entries

15 years agov3.20 release 3.20
Mischa POSLAWSKY [Wed, 28 May 2008 07:09:41 +0000 (07:09 +0000)]
v3.20 release

15 years agoimprove lighttpd configuration samples
Mischa POSLAWSKY [Thu, 29 May 2008 16:58:32 +0000 (16:58 +0000)]
improve lighttpd configuration samples

Use the merge (+=) syntax so the user doesn't have to integrate any
existing options, and can simply add the snippet as is (even as a
seperate include, especially easy in a Debian setup).

Extend backend configuration examples with options for a directory index
of index.plp, and (static) source rejection.

15 years agokeep SCRIPT_* environment variables in CGI
Mischa POSLAWSKY [Wed, 28 May 2008 11:41:13 +0000 (11:41 +0000)]
keep SCRIPT_* environment variables in CGI

These are now identical to their PLP_* counterparts, and should be used
instead for familiarity (why rename for no apparant reason; SCRIPT_* now
contain their expected values so no reason to suggest otherwise).
Apache already has both.

15 years agolicense file from COPYING renamed LICENSE
Mischa POSLAWSKY [Wed, 28 May 2008 10:36:53 +0000 (10:36 +0000)]
license file from COPYING renamed LICENSE

While COPYING seems to be most frequently used overall, LICENSE is used
more in perl modules and recommended by Kwalitee guidelines.  Fine with
me either way, so use the name that breaks the least.

15 years agodo not import parent module in PLP::Backend::FastCGI
Mischa POSLAWSKY [Wed, 28 May 2008 10:23:50 +0000 (10:23 +0000)]
do not import parent module in PLP::Backend::FastCGI

FastCGI initialized normal CGI as well, providing unneeded CGI support.
Apparantly it's not in the way, but wrong nonetheless (and quite
confusing to be able to use the fastcgi module with cgi).

15 years agosuppress warning in PLP::Backend::CGI
Mischa POSLAWSKY [Wed, 28 May 2008 10:07:09 +0000 (10:07 +0000)]
suppress warning in PLP::Backend::CGI

Add parentheses to my $scalar argument to read() to verify it's really
only a single variable.  Works the same, but fixes a warning if run -w.

15 years agorestructure file locations
Mischa POSLAWSKY [Wed, 28 May 2008 08:41:06 +0000 (08:41 +0000)]
restructure file locations

Use root directories lib/ (pm and pod) and bin/ (executable scripts).
This is the common layout of modern modules, and in fact ever more
expected (by Module::Build for example).

15 years agocustom META.yml
Mischa POSLAWSKY [Sat, 22 Mar 2008 14:52:00 +0000 (14:52 +0000)]
custom META.yml

Automatically generated module information cannot ascertain certain
information, so I'd rather provide all YAML myself.

Compared to ExtUtils::MakeMaker 6.42 output, this adds resources,
recommends, and optional_features.

15 years agoseperate/rewritten README file
Shiar [Wed, 30 Apr 2008 05:00:45 +0000 (07:00 +0200)]
seperate/rewritten README file

Plain text README should be a minimal introductionary basics: intro
(first paragraph of pod description), installation, help, copyright.
Leave the pod (and only that) to be the full manual.  All users should
be able to run perldoc, without being held off by some wannabe text
conversion.

15 years agoset $PLP::interface to executing backend
Mischa POSLAWSKY [Wed, 28 May 2008 05:42:08 +0000 (05:42 +0000)]
set $PLP::interface to executing backend

Useful to know how we're running, as code may want to target specific
backends.  Currently undocumented so that behaviour can be changed
easily if need be.

15 years agochange to MIT license
Mischa POSLAWSKY [Mon, 24 Mar 2008 02:04:27 +0000 (04:04 +0200)]
change to MIT license

Add a proper license instead of the just saying 'public domain'
(arguably unfulfilling, see http://www.linuxjournal.com/article/6225).
The MIT or X11 license is similar in intent to the perceived PD,
and should provide all if not more rights to users.
It's essentially the same as the 2-clause BSD and ISC licenses.

With consent of the original copyright holder Juerd Waalboer:
> BTW, mocht je een echte licentie willen gebruiken, dan stel ik MIT
> voor als je je daar zelf in kunt vinden

15 years agotest for pod correctness
Mischa POSLAWSKY [Wed, 28 May 2008 04:15:54 +0000 (04:15 +0000)]
test for pod correctness

If Test::Pod is present, check the pod of files in our manifest.

15 years agoexpand backend documentation
Mischa POSLAWSKY [Wed, 28 May 2008 03:55:29 +0000 (03:55 +0000)]
expand backend documentation

Add descriptions for PLP::Backend::FastCGI and ::Apache explaining
their configuration and advantages, and recommend/reorder backends
accordingly.

Document a major bug in mod_perl2, and discourage its use for now.
Not investigated, but easily reproducable with:

<:
use Cwd qw(cwd);
say cwd, '<br>';
sleep 10;  # now request a plp from a different directory
say cwd, '<br>';

15 years agohandle fastcgi signals
Mischa POSLAWSKY [Wed, 7 May 2008 17:53:50 +0000 (17:53 +0000)]
handle fastcgi signals

http://www.fastcgi.com/devkit/doc/fcgi-spec.html#S7
> A Web server can request that a FastCGI application exit by sending it
> SIGTERM. If the application ignores SIGTERM the Web server can resort
> to SIGKILL.

So stop accepting new requests after receiving a TERM signal.  Allow the
current page to finish, we should assume it won't be long (long-running
scripts usually require customized destructors anyway, so don't account
for those).  This is quite important to prevent interrupted output.

According to http://www.fastcgi.com/docs/faq.html#Signals Apache
mod_fastcgi will send a SIGUSR1 in addition to the TERM.  Seems safe to
ignore these.

If a client aborts a connection, we'll get a SIGPIPE.  Because the page
may still have crucial actions to perform, we should ignore and finish
the code.  Pages can easily handle PIPEs themselves if wanted.

The LastCall method is used, even though FCGI 0.67 warns:
> Note that this method is still experimental and everything about it,
> including its name, is subject to change.

As it's stable since september 2001, I guess it'll be fine for now.

16 years agofix default text for pod links to other modules
Mischa POSLAWSKY [Mon, 24 Mar 2008 06:44:13 +0000 (06:44 +0000)]
fix default text for pod links to other modules

Do not provide an explicit link presentation for stand-alone module
references (no context, so let the renderer do what it thinks best).
In a running text we want the opposite though: make sure modules names
aren't 'linkified' when they shouldn't (e.g. "use the XML::Quote
manpage" when we mean just the module).

16 years agoshort TODO with planned features
Mischa POSLAWSKY [Mon, 24 Mar 2008 06:30:24 +0000 (06:30 +0000)]
short TODO with planned features

Note some of the things planned for near-future releases.

16 years agomove backend interface modules into PLP::Backend:: namespace
Mischa POSLAWSKY [Sat, 22 Mar 2008 14:47:33 +0000 (14:47 +0000)]
move backend interface modules into PLP::Backend:: namespace

Keep our namespace a bit organized.

16 years agofix exit constants usage in apache2
Mischa POSLAWSKY [Tue, 18 Mar 2008 01:52:41 +0000 (01:52 +0000)]
fix exit constants usage in apache2

Apache2::Const requires HTTP_* constants to be compiled before they can be
accessed. This caused at least a warning message at the end of each page,
usually:

Use of inherited AUTOLOAD for non-method Apache2::Const::OK() is deprecated

16 years agoupdate plp.cgi
Mischa POSLAWSKY [Mon, 17 Mar 2008 19:28:26 +0000 (20:28 +0100)]
update plp.cgi

Update plp.cgi intro comments to reflect new interfaces status.
To make it more usable out of the box, executable flag is set (so it can be
run directly) and uses interpreter from environment (/usr/bin/env should be
supported better than /usr/bin/perl).

16 years agomove detailed setup documentation to interface modules
Mischa POSLAWSKY [Mon, 17 Mar 2008 19:02:45 +0000 (20:02 +0100)]
move detailed setup documentation to interface modules

Only keep basic instructions for Lighttpd+mod_fastcgi and
Apache+mod_perl in PLP's main synopsis. Other configurations is given in
the pods of interface modules. These are linked at PLP#DESCRIPTION,
which now also contains an overview of supported servers.

Mod_perl configuration variables have also been moved into PLP::Apache.
In all, makes the main documentation much cleaner (uncluttered with
interface-specific details).

16 years agoadd license to Makefile definitions
Mischa POSLAWSKY [Sun, 16 Mar 2008 15:26:39 +0000 (16:26 +0100)]
add license to Makefile definitions

As recommended by Kwalitee indicator metayml_has_license.
Currently we specify public domain even though it's not listed in
Module::Build::Api and arguably not a valid license at all. Maybe change
our license later, or classify as 'unrestricted'.

16 years agogit exclude of compile-time files
Mischa POSLAWSKY [Sun, 16 Mar 2008 13:43:04 +0000 (14:43 +0100)]
git exclude of compile-time files

Ignore everything generated by/for make.

16 years agohandle request automatically on PLP::CGI import
Mischa POSLAWSKY [Sat, 15 Mar 2008 00:52:51 +0000 (01:52 +0100)]
handle request automatically on PLP::CGI import

As it's not used for much else, PLP::CGI can simply start running on
import. So like PLP::FastCGI, the executable only needs to C<use PLP::CGI>
(and C<require> for advanced usage).

No backwards compatibility issues, as the last release didn't have this
modularized (PLP wrapper works the same as before).

16 years agofix setting PLPcache from apache configuration
Mischa POSLAWSKY [Fri, 14 Mar 2008 23:40:49 +0000 (00:40 +0100)]
fix setting PLPcache from apache configuration

Apache has been split from PLP package, so need to specify variable
explicitly.

16 years agomake mod_perl request object a global in PLP::Apache only
Mischa POSLAWSKY [Fri, 14 Mar 2008 23:08:38 +0000 (00:08 +0100)]
make mod_perl request object a global in PLP::Apache only

No reason to always create $PLP::r, as it's only used with Apache.

16 years agoeg/plpinfo.plp demo/status page
Mischa POSLAWSKY [Tue, 2 Oct 2007 10:23:56 +0000 (12:23 +0200)]
eg/plpinfo.plp demo/status page

Demo page reporting about the current status of Perl and PLP. Useful as
test page (see if correct versions are loaded as they should, and what
variables are set), or at least as a somewhat larger example of a plp
page.

Modelled closely after PHP's phpinfo() output (even color scheme is the
same, albeit html is much cleaner) to keep it as familiar as possible to
php switcheroos.

16 years agoFastCGI interface (PLP::CGI extension using FCGI)
Mischa POSLAWSKY [Tue, 2 Oct 2007 10:23:27 +0000 (12:23 +0200)]
FastCGI interface (PLP::CGI extension using FCGI)

Do not exit from PLP::CGI, allowing it to be used consecutively.

Coincidentally, PLP::FastCGI does just that: extending the PLP::CGI
interface to handle FCGI requests. Its import() runs a PLP dispatcher,
so a FastCGI executable (example plp.fcgi is provided) only has to
C<use PLP::FastCGI>. If a server supports run arguments, a wrapper
script isn't even needed this way: just do /usr/bin/perl -MPLP::FastCGI.

PATH_TRANSLATED is explicitly removed from environment so file names are
gotten from SCRIPT_*, which mostly already point to the requested script
(at least much more correctly than can be determined from PATH_*).

This seems to work correctly on at least:
- Apache 1.3.34, 2.2.4, 2.2.8 with mod_fastcgi and mod_fcgid
- Lighttpd 1.4.7 and 1.4.18 with mod_fastcgi

Caching can be controlled by setting an environment variable PLP_CACHE
(unlike with mod_perl, no other means of configuration are provided).
If not specified, PLPcache will be turned on.

fcgi script

16 years agogeneralize reading post input
Mischa POSLAWSKY [Tue, 2 Oct 2007 10:08:26 +0000 (12:08 +0200)]
generalize reading post input

Input retrieval differs per server interface, so set $PLP::read to a
function providing a read of specified number of bytes. This differs
from $PLP::print as it's not just a name, because it won't be evalled
but called directly.

16 years ago404 handling for pre-parsed CGI handling
Mischa POSLAWSKY [Fri, 27 Jul 2007 19:13:52 +0000 (19:13 +0000)]
404 handling for pre-parsed CGI handling

When using SCRIPT_FILENAME provided by server, still make sure the file
exists. Lighttpd can provide non-existant files when setting check-local
is turned off.

PATH_TRANSLATED handling (i.e. Apache) is unaffected: always does 404
checking when walking the path.

16 years agoclean up CGI environment parsing
Mischa POSLAWSKY [Fri, 27 Jul 2007 18:36:22 +0000 (18:36 +0000)]
clean up CGI environment parsing

When parsing PATH_TRANSLATED, put results in SCRIPT_* variables. Create
additional PLP_* vars only later. This makes both cases result in the
same intermediate state, and therefor easier to follow.

16 years agoLighttpd CGI support
Mischa POSLAWSKY [Wed, 25 Jul 2007 16:05:42 +0000 (18:05 +0200)]
Lighttpd CGI support

In case no PATH_TRANSLATED environment var is present, assume request is
already parsed and SCRIPT_* pointing to target script (not plp handler).
This supports at least Lighttpd CGI requests.  Functionality unchanged
for Apache1/2 CGI.

16 years agouse recommended apache2 constants
Mischa POSLAWSKY [Mon, 30 Jul 2007 09:04:03 +0000 (11:04 +0200)]
use recommended apache2 constants

According to mod_perl documentation (porting/compat):

REDIRECT and similar constants have been deprecated in Apache for
years, in favor of the HTTP_* names (they no longer exist Apache
2.0). mod_perl 2.0 API performs the following aliasing behind the
scenes

16 years agomake PLP::Apache mod_perl 2.0 compatible
Mischa POSLAWSKY [Mon, 30 Jul 2007 08:22:28 +0000 (10:22 +0200)]
make PLP::Apache mod_perl 2.0 compatible

16 years agomove plp server handlers to respective modules
Mischa POSLAWSKY [Wed, 25 Jul 2007 16:21:02 +0000 (18:21 +0200)]
move plp server handlers to respective modules

Keep compatibility wrappers for handler() and everything().

16 years agotest-suite directory
Mischa POSLAWSKY [Wed, 4 Jul 2007 19:43:11 +0000 (21:43 +0200)]
test-suite directory

Anticipating more tests.

Also clarifies (limited) testing scope by filename.

17 years agoseperate modules for backend-specific code
Mischa POSLAWSKY [Sat, 31 Mar 2007 02:56:50 +0000 (04:56 +0200)]
seperate modules for backend-specific code

Split out initialization and other specifics for CGI and mod_perl (Apache).

17 years agoremove disabled Cwd include
Mischa POSLAWSKY [Sat, 31 Mar 2007 02:44:37 +0000 (04:44 +0200)]
remove disabled Cwd include

17 years agodocumentation fixes
Mischa POSLAWSKY [Sat, 31 Mar 2007 02:38:26 +0000 (04:38 +0200)]
documentation fixes

Typo, small mistake in example, unmarked code.

17 years agofix html of default error message
Mischa POSLAWSKY [Sat, 31 Mar 2007 02:35:08 +0000 (04:35 +0200)]
fix html of default error message

Remove unclosed and useless tag; consistent tag capitalization.

17 years agoreindent remaining 4-space+tab@8 code
Mischa POSLAWSKY [Sat, 31 Mar 2007 02:31:20 +0000 (04:31 +0200)]
reindent remaining 4-space+tab@8 code

Use only tabs for indenting, spaces for alignment.

17 years agotiny speedup decoding + in DecodeURI()
Mischa POSLAWSKY [Sat, 31 Mar 2007 02:08:21 +0000 (04:08 +0200)]
tiny speedup decoding + in DecodeURI()

17 years agov3.19 release 3.19
Mischa POSLAWSKY [Thu, 15 Sep 2005 19:10:40 +0000 (21:10 +0200)]
v3.19 release

17 years agominor code cleanups and clarifications
Mischa POSLAWSKY [Sat, 31 Mar 2007 01:43:13 +0000 (03:43 +0200)]
minor code cleanups and clarifications

17 years agocommon argument handling in functions
Mischa POSLAWSKY [Sat, 31 Mar 2007 01:13:23 +0000 (03:13 +0200)]
common argument handling in functions

Slightly cleaner and faster, and accepts read-only values in all functions.

17 years agochange code indenting to tabs
Mischa POSLAWSKY [Sat, 31 Mar 2007 01:08:27 +0000 (03:08 +0200)]
change code indenting to tabs

17 years agoremove undocumented function HiddenFields()
Mischa POSLAWSKY [Sat, 31 Mar 2007 01:01:39 +0000 (03:01 +0200)]
remove undocumented function HiddenFields()

17 years agoadd tests for all quoting functions
Mischa POSLAWSKY [Sat, 31 Mar 2007 00:59:40 +0000 (02:59 +0200)]
add tests for all quoting functions

17 years agoupdate text dump of documentation
Mischa POSLAWSKY [Sat, 31 Mar 2007 00:58:25 +0000 (02:58 +0200)]
update text dump of documentation

README regenerated from PLP.pm pod.

17 years agomakefile cleanup
Mischa POSLAWSKY [Sat, 31 Mar 2007 00:56:44 +0000 (02:56 +0200)]
makefile cleanup

Also drops perl <5.5 support, since PLP requires 5.6 anyway.

17 years agomodule Cwd not used in PLP; don't use
Mischa POSLAWSKY [Sat, 31 Mar 2007 00:53:52 +0000 (02:53 +0200)]
module Cwd not used in PLP; don't use

17 years agodocument caveats for quoting functions; fix documentation indenting/wrapping.
Mischa POSLAWSKY [Sat, 31 Mar 2007 00:52:19 +0000 (02:52 +0200)]
document caveats for quoting functions; fix documentation indenting/wrapping.

17 years agofix header sending for tied printing
Mischa POSLAWSKY [Sat, 31 Mar 2007 00:45:07 +0000 (02:45 +0200)]
fix header sending for tied printing

Headers were not sent on initial printf or print with empty first argument.

plp.tieprint.patch by Shiar 2002-08-21 18:54:45

17 years agonew maintainer: shiar
Mischa POSLAWSKY [Sat, 31 Mar 2007 00:41:17 +0000 (02:41 +0200)]
new maintainer: shiar

17 years agov3.18 release 3.18
Juerd Waalboer [Fri, 18 Oct 2002 18:37:35 +0000 (18:37 +0000)]
v3.18 release

17 years agoextend howto
Juerd Waalboer [Sat, 31 Mar 2007 00:35:23 +0000 (02:35 +0200)]
extend howto

Explain basic http authentication. Mention SQLite.

17 years agocleanup (minor things like punctuation, use spaces for docu indenting)
Juerd Waalboer [Sat, 31 Mar 2007 00:33:29 +0000 (02:33 +0200)]
cleanup (minor things like punctuation, use spaces for docu indenting)

17 years agooptional end tag for plp code
Juerd Waalboer [Sat, 31 Mar 2007 00:27:44 +0000 (02:27 +0200)]
optional end tag for plp code

17 years agofix header key conversion to match documentation
Juerd Waalboer [Sat, 31 Mar 2007 00:26:19 +0000 (02:26 +0200)]
fix header key conversion to match documentation

Really convert Content_Type to content-type.