Whatīs PasHyPer?

PasHyPer is a Pascal Hypertext Preprocessor.
The preprocessor works reading a HTML page and finding for pascal programs into this page.
On found a pascal program, the preprocessor compiles and run the script. All this is made in side server.

—Why Pascal—

Pascal is a very popular programming language because itīs clean, easy and readeable. Why pascal is out of web as script language? I donīt know! If you like pascal, join us. Help us to build a Pascal Hypertext Preprocessor.

—About PasHyPer Now—

PasHyPer was compiled with FPC - FreePascal Compiler.

PasHyPer suports a subset of standard pascal and is missing several wanted improvements.
Reserved Words are the same of standard pascal, but not yet suports set, case, downto, array, of, record, type and signs as [].

PasHyPer suports the types integer, real, string, boolean and char.
The string type is a pointer to bytes managed by itself PasHyPer. The size of string is 1024 bytes for now. May be the max size of a WORD.

PasHyPer can run a enough set of functions and procedures of standard pascal and some functions to connection with MySQL database.
PasHyPer have a unique cgi function (cgi_getenv) that retrives all the values of pages server.

PasHyPer manage uploads files, but need the programmer to pointer the directory of uploaded files with chdir procedure.
The size of uploaded files is limited to space in disk or space quote.

PasHyPer not yet with work typed files. Only text files is available for read/write.

PasHyPer not writes to files. This is a decision not a limitation.

PasHyPer suports comments in Borland way only: {comment...}

PasHyPer suports on only a directive: $INCLUDE.

PasHyPer file include is limited to 16KB for now. Because this limit, you must write small libraries. This turns PasHyPer faster and usefull with economic memory.

PasHyPer chdir procedure is virtual. It changes to a directory into directory root declared into pashyper.ini (see config file bellow). If you declare as directory root in pashyper.ini the string /home/carlos/pashyper/site01 and changes the directory with chdir to /home/carlos/pashyper/anotherdirectory will generate a error. The same with assign a file. So, if you must refere to file or directory into think root directory as "/". An alias can override the path to directory root. But you cannot use an alias to assign a file.

PasHyPer handle date like FPC and Delphi/Kylix: it's a real value. The time part of datetime type is not implemented. This is the fracionary part of a real. The date values may be different of FPC/Delphi values.

PasHyPer and Apache

PasHyPer, for now, don't have a module to Apache. But some integration may be using the file httpd.conf. To do this, you need put into file httpd.conf four lines:

ScriptAlias /pas/ "<pashyper directory>" (ex: "c:/pashyper/")
AddType application/x-httpd-pas .pas .pp
AddHandler application/x-httpd-pas .pas .pp
Action application/x-httpd-pas "/pas/pashyper[.exe]"

If you not yet setup the CGI directory, then put the following lines into httpd.conf:

<Directory "pashyperdirectory">
    AllowOverride All
    Options ExecCGI FollowSymlinks Includes
    Order allow,deny
    Allow from all
</Directory>


PasHyPer Config File

The pashyper.ini file must be placed into PasHyPer directory. If you use MySQL, you must write the config file. The pashyper.ini is a plain text file, with sections, keys and values, in format:

[section]
key=value
# Line commented is started by a "#"

The sections possible for now are root, aliases and mysql. The keys are: directory, in root section to indicate a directory as "/" directory; path in mysql section to indicate mysql client library path (without file name); lib in mysql section to pointer to mysql client library file (only the file name).

In aliases section you can put aliases that will be replaced by the indicated value. For example, if you put into file healthplan01=/home/mydocs/health/plans/01/page.htm, when PasHyPer found healthplan01 as parameter to filename* it will replace by the indicated value. For now, only full string is translated (i.e., no compare is made with substring). The aliases, for now, overrides the root directory declared into root section.

Example:
    [root]
    directory=/home/carlos/programming/pashyper/
    charset=iso8859-1
    uploaded=/home/carlos/programming/pashyper/uploaded

    [mysql]
    path=/usr/lib/
    lib=libmysqlclient.so

    [aliases]
    #overrides path
    readme=/home/carlos/programming/HTML/pashyper/readme.htm*

* The parameter filename is used in following way:

http://www.mydom.com/cgi-bin/pashyper?filename=name_of_myfile&anotherparam=...

to indicate to pashyper how file it process. The extention assumed as default is .htm, but the file may be a image, a video, a text, etc. In this case you must indicate the file extention (pashyper selects media type based on file extention). PasHyPer accept wildcards in aliases section. If you write kc*=c:\pashyper\site01\index.htm, all word that start with kc in filename parameter will translated to c:\pashyper\site01\index.htm.

To do

PasHyPer need debugging all internal functions, procedures and operators. This is made with little codes for each case.

PasHyPer need little libraries that provides facilities to programmer. This is made using the $include clasule.

a) utf-8 routines to writes output and read input.

b) url encode and decode routines don't works properly in linux. AllocMem may be crashes when running under linux. Trying don't use ansistring but pchar.

c) md5 and base64 encrypt routines to work natively.

d) images and other binary files can be served by PasHyPer. But if you use pashyper to output very images per page, the performance is down. For now, references as http://.../pashyper?filename=<a_image_file> must be not used or skippep.

d) ssl security is not implemented.

You...

You can help this project if you like Pascal Language and know Pascal Language. You can debug it, write examples code, write documentation, translating text, coding short libraries, etc. Only if you know and like Pascal Language.

© 2008 Carlos Alberto de Oliveira - carlosnatal@yahoo.com.br