_ _
/_\ _ _ __ _ _ _ | |_ __ _
/ _ \| '_/ _` | ' \| ' \/ _` |
/_/ \_\_| \__,_|_||_|_||_\__,_|
-- By Pepperfish
aranha@pepperfish.net
------[ Contents ]-------------------------------------------------------------
* What is Aranha
* What do you need to compile Aranha
* How to prepare Aranha
* How parameters work
* How to get Aranha from version control
------[ What is Aranha ]-------------------------------------------------------
Aranha is a web-application development platform. Or, in less 'buzzwords'
Aranha is a piece of software written to allow web applications to be written
more cleanly and more easily.
------[ What do you need to compile Aranha ]-----------------------------------
* A sensible C compilation environment including make and a sensible shell
* A little time
* And a FastCGI enabled webserver for using it
------[ How to prepare Aranha ]------------------------------------------------
First unpack the source (if you're reading this you may already have
managed to). We recommend out-of-tree building, but that's not
essential. Perform the following commands:
$ mkdir ++build
$ cd ++build
$ ../configure --prefix=/where/to/install
$ make check
$ [sudo] make install
Obviously you don't need the sudo if you're not installing into a
rootly place.
Now that you have installed aranha, you need to prepare you configuration.
Choose a place which will be your fastcgi root and make the directory...
$ mkdir /some/path
$ cd /some/path
$ ln -s /path/to/aranha/binary aranha.fcgi
$ cat > aranha.conf
preload="preload.lua"
^D
$ cat > preload.lua
Namespace { prefix="/" handler=Class "aranha.uri.classichandler" ("ahtml") }
^D
This prepares a configuration which says *.ahtml == wrapped files
(I.E. code embedded in HTML) and everything else is plain (I.E. code
with embedded html)
Next configure your web server appropriately to pass (for example)
.ara and .ahtml files through to the fastcgi.
Then put these test files in your docroot:
-------------8<-------------[ test.ara ]---------------------------------------
function serialise(xtab)
>>
<<
for k,v in pairs(xtab) do
if type(v) == "table" then
>>- |k#H|:<<
serialise(v)
>>
<<
else
>>- |k#H| = |v#H|
<<
end
end
>>
<<
end
request:parseParams()
if *request._params then
>>Parameters:<<
serialise(request._params)
end
>>Environment:<<
serialise(request.env)
-------------8<-------------[ test.ara ]---------------------------------------
And:
-------------8<-------------[ test.ahtml ]-------------------------------------
Example stuff
<< for k,v in pairs(request.env) >>
- |k#H| == |v#H|
<< end >>
-------------8<-------------[ test.ahtml ]-------------------------------------
They should both do the obvious thing.
------[ How parameters work ]--------------------------------------------------
In the very simplest of cases foo=bar&wibble=cake will do the obvious
thing. However aranha's parameter parsing system also supports
promotion to tables. So the foo=bar&foo=wibble will make foo into a
table whose array part contains bar and wibble. Also
foo.bar=wibble&foo.baz=cake will do the obvious thing with the hash
portion of the table. You shouldn't rely on the ordering of the
numeric part of tables unless you explicitly define with something
like foo.1=bar&foo.2=baz which will do the right thing.
------[ How to get Aranha from version control ]-------------------------------
Aranha is kept in a version control system called Bazaar. Bazaar is a
GNU Arch implementation sponsored by Canonical Ltd. You can see more
about Bazaar at http://bazaar.canonical.com/
First you need to get Bazaar. In Debian and Ubuntu you can just
apt-get install bazaar. Other distributions or operating systems may
require you to get the source and compile it yourself. It's fairly
easy to do.
Assuming you have bazaar and have identified yourself to it, you can
get the code from the arch-pqm@digital-scurf.org archive.
$ baz get \
http://arch.digital-scurf.org/arch-pqm@digital-scurf.org/aranha--dists--0 \
aranha
$ cd aranha
$ baz build-config configs/aranha.devel
$ cd aranha
$ ./prep-fresh.sh
------------------------------------------------------------------[ END ]------
Do not touch the following line:
arch-tag: a9c93823-5017-4f84-a020-ab0fdbcfda69
Do not touch the above line: