Older blog entries for mglazer (starting at number 213)

I finished work on a very simple and light modular templating and application tool.

Similar to my 4arrow.com/test/t/ template and macro tool this one adds a Virtual URI based engine and a corresponding structured template/macro containers.

A cache container which should duplicated the template one but doesn't have to.

The library directory contains the code that the templates reference in their structured pre-defined designs.

So the file distro looks like this:

.htaccess (mod_rewrite rules) index.php (interface) cfg.php (global configurations)

core/ (core scripts such as the template parser) library/ (PHP classes that are referenced within the templates) cache/ (container for parsed templates matched to URIs) template/ (container for pre-parsed templates matched to URIs)

Example template:

<xpc:date id="1" format="r" date="NOW" type="unix" />

<xpc:cache file="/test2.html" time="3600" path="cache/" type="encode">

<xpc:include file="templates/inc/header.html"/>

Date :<xpc:date id="2" format="r" date="NOW" type="unix" />
Uri: /test2.html

<xpc:include file="templates/inc/footer.html"/>


The only to notice for now is when you reference two of the same tagnames use a id attribute that is unique for each.

You may also notice that you can cache individual blocks of nested pre-parsed tags.

Each template file can have a corresponding macro file which will automatically be slurped by using the naming convention like so: template: index.html template's macros: index_mcr.html

The template tags "xpc:name_here" are all based in teh 'library' folder and all follow a similar pre-defined structure.

I will move the demo distro to a web serving box for public display shortly.

9 Sep 2002 (updated 9 Sep 2002 at 12:22 UTC) »

New and Updated free, open source, GPL, FSF approved License for PHPortal-Xpc.

View the new license Online:


4 Sep 2002 (updated 4 Sep 2002 at 18:57 UTC) »

Final ToDos for PHPortal version 0.2.4

  1. Add more default Methods and Rights to auto and manuall installs
  2. Inline Check for Access Permissions Method
  3. PHPortal Method Object PHP limitations

When the above is done I will also release the demo site wher you can play with the PHPortal management administration.

I set up the wireless LinkSys router hub network.

The only issue was i had all kinds of other network adapters, you need to disable them for this work.

Right click 'My Computer' click on the hardware profiles tab and click on each of the extraneous network adapter and select 'disable.'

As I am settign up a demo site with full PHPortal administration I am also working to enhance PHPortal.

Specifically the limiting of PHP code allowed within the PHPortal methods (which are just pure PHP code disguised in a structured function design).

Beyond that also the security abilties need to be greatly ehanced so they can be much more specific. As of now we have permissions like 'add' where it should really be 'addDocument", 'addMethod'...

Beyond even that the ability to add new permissions need to be structured for each application.

My idea is on install each product gets installed along with any of its default settings such as Product permiissions. On delete of a product vice versa.

So for the initall install manual and hack setup I will need to specifically add the Product methods for each app that is setup in the standard install.

I also recieved some complaints about the manuall install with regards to the encrypted default passwords not working.

Needs some investigating not sure what the problem is there yet...

I'm setting up my first LinkSys wireless home network this weekend, any bets on how many support calls it will take if any? I've heard anywhere from 1-5 is the norm.

I am adding the ability to limit PHP functions, variables, and files to PHPortal methods.

Unlike Zope, PHPortal Methods can call any PHP code.

This is a big hindrance to ACL rights in regards to PHPortal.

This is also the main reason why I have not been yet able to setup a demo site.

I am now setting a option to read the Method for specific PHP var,func, and file pre-defined restrictions per user role/user for each method.

Hopefully as setup the appropriate way to run this i will get that much closer to finally create a fully functional demo site for PHPortal in which anyone can utilize the PHPortal admin.

I just got mcrypt support for my PHP:

    // Open the cipher
    $td = mcrypt_module_open ('rijndael-256', '', 'ofb', '');

// Create the IV and determine the keysize length $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_DEV_RANDOM); $ks = mcrypt_enc_get_key_size ($td);

// Create key $key = substr (md5 ('very secret key'), 0, $ks);

// Intialize encryption mcrypt_generic_init ($td, $key, $iv);

// Encrypt data $encrypted = mcrypt_generic ($td, 'This is very important data');

// Show string echo trim ($encrypted)."\n";

// Terminate encryption handler mcrypt_generic_deinit ($td);

// Initialize encryption module for decryption mcrypt_generic_init ($td, $key, $iv);

// Decrypt encrypted string $decrypted = mdecrypt_generic ($td, $encrypted);

// Terminate decryption handle and close module mcrypt_generic_deinit ($td); mcrypt_module_close ($td);

// Show string echo trim ($decrypted)."\n";

I am introducing a tangent to PHPortal, Mini-PHPortal.

This application is a standalone one-time build of many PHPortal concepts and JSP/Java Ideas in PHP. What will be added to and changed will be the component libaries themselves.

Mini-PHPortal uses my Xpc Templator (http://4arrow.com/test/t/) and PHPortal (http://sf.net/projects/xpc/) Concepts.

The first release will be the last release (as far as I can tell right now) of the core code.

Here is the abstract: Mini-PHPortal is a Hybrid of PHPortal. Mini-PHPortal combines the structure of Java Beans, with the interface of JSP Custom tags, and the simplicity of PHP in a completely transparent and utterly modular virtual web intreface middleware for the easy use and production of re-usuable software components.

The basic idea is that we use the PHPortal virtual URIs and map them to a local template file directory structure that maps the URIs being requested. Therefore, all URI requests get sent through the main Mini-PHPortal handler.

CODE FLOW: Once the Link is requested and handled Mini-PHPortal maps the request to a flat file directory structure.

The template is then called and any accompanying macro files that template builds with.

The template and macro files are then parsed for special Xpc tags. These tags are references to the applications that are then called an acted upon.

These applications follow a specific code structure. Any application that is referenced whether that is a caching application, administrative, Template editor etc.. all come from the same libraries directory and follow the same patterns.

The directory structure is as follows:

(file).htaccess Sends all URI requests to the index.php file below

(file)index.php Handles all URI requests sent from the .htaccess file, calls the core libs to do the code run on the URI request.

(file)config.php General and global configs. Per site/domain setup is not built-in like PHPortal it would be a separate application in the 'libraries' directory.

(Directory)core/ The core classes that are executed on each URI request.

(Directory)libraries/ All the applications that are referenced within template tags reside here.

(Directory)templates/ The virtual file directory that matches the URI request and has template tag calls to the libraries applications.

The central idea is that everything is a class library that is called by a template tag reference. This would include the actual template editor, template caching, access rights, and the general administration itself.

Besides the above mentioned tools I will try to build before the initial release I will also try to port the Xpc content type transformations but not necessarily as a core class but instead as a component class. Since it is probably bigger than most it will be a good test case to see what to do in large component type application situations.

PHPortal Demo Site with Administration coming soon.

I am working on a partitioned PHPortal demo site that visitors can use to play with the PHPortal administration.

Due to security concerns this may be a bit tricky and therefore take some time. More coming soon as things progress.

I am also getting word of Windows user's bugs and will have to look into that too, my first guess being the cache/ftp.

My New thing is:

Replication of the the basic format and use of Java Beans and Java Custom Tags in JSP for PHP.

This does come into play with PHPortal-Xpc. Specifically with the App Builder.

JBeans and JTags offer a standard protocol in which to write applications, a standard interface in which to reference your formatted apps and a sort of middle-ware to make it all happen.

So what we have is three layers.

1. The parser that interprets and calls the repective references.

2. The formatted class libs/apps.

3. The template that calls the class libs and pass arguments.

I will set up the classic hello world for each as well as a Datetime app samples.

204 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!