Older blog entries for mglazer (starting at number 376)

Some cool client side PHP caching tricks I use in PHPortal.

/* ------- FIRST ------ */

$x->obj_data['attr']['timestamps']['V'][] = $x->obj_data['attr']['date_modified']['V'];

if ( $x->internal_run_end == 'yes' ) {

$timestamp = max ( $x->obj_data['attr']['timestamps']['V'] );

$tsstring = gmdate ( 'D, d M Y H:i:s ', $timestamp ) . 'GMT';

if ( $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $tsstring ) { header("HTTP/1.1 304 Not Modified"); exit; } else { header ( 'Last-Modified: ' . $tsstring ); } }

/* ------- SECOND ------ */

$timestamp = $x->obj_data['attr']['date_modified']['V'];

$tsstring = gmdate ( 'D, d M Y H:i:s ', $timestamp ) . 'GMT';

if ( $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $tsstring ) { header("HTTP/1.1 304 Not Modified"); exit; } else { header ( 'Last-Modified: ' . $tsstring ); }

Software Programming:

Some of my original work includes:

  1. Object Modeling
    1. Editor
    2. Stoyboard
    3. Controller
  2. URI Objects
  3. ACL User Group Access
  4. Templating
    1. Tools
    2. Static, Parser, Compiler, Cacher, Components, Layout control, Navigatrion, Theme Sets
    3. Manager ( TMS)
  5. Database Stores
    1. Layers
    2. Caching
    3. Manager
    4. Builder - Application Builder, Database Builder
  6. Forming
    1. Generation
    2. Static
    3. Dynamic Object Model Database to be Modeled
    4. Processor
    5. Manager
  7. Content-Type Conversions
    1. XML, RSS, PDF, TEXT, VXML, WML...
13 Jan 2003 (updated 4 Aug 2011 at 18:15 UTC) »
12 Jan 2003 (updated 12 Jan 2003 at 05:26 UTC) »
Star of David KeyBoard Key and Font.

This:

<b style="font:normal 15px Wingdings;">Y<\b>

Makes this:
Y

How about a White background and Blue star you say? Ok, one minute.

Y

Larger? Ok.

Y

Y

9 Jan 2003 (updated 4 Aug 2011 at 18:16 UTC) »

I am creating a storyline /storyboard dhtml frameset like the flash keyframe layer frame for my object model array (OMA) editor.

Each layer is a screen or webpage each keyframe is an event or action that
is assigned a handler and its all based on an array that can be run by a controller
to execute your web apps.

Its an easy way to map out your application screens and actions as a object
model array that can also be executed based on your settings.

Each layer or screen represents a controller file and each keyframe or action
event repreesnts that controller file or class method or function.

The OMA' s controller calls the appropriate screen and action based on your
predefined object action controlls.

Its pretty simple but extremely usefull for application builders.

I already create a utalitarian OMA editor that works on any given array to
add, edit, and delete nodes or sub-arrays.

The OMA schema consists of:


object instance identifier

libs to load prior to any calls.

screen caller

action caller

default screen

default action

All screens


All events for each screen


args for event



<hr>

9 Jan 2003 (updated 4 Aug 2011 at 18:16 UTC) »
8 Jan 2003 (updated 4 Aug 2011 at 18:16 UTC) »
8 Jan 2003 (updated 4 Aug 2011 at 18:16 UTC) »

Object Model Array (OMA) Editor.

I am creating a OMA web editor that allows you to add, edit, delete, copy (save as new), move up, or move down an infinite depth tree array. Mostly finished except for the move up and down part.

Infinite depth and recursivity are the hallmarks of great language constructs.

Save, Commit, Rollback.

I am emulating the above within my CSV text db layer. Basically works by making a temp copy of the recordset object requested.

So we have two copies to work with.

The temp copy is only used as a backup.
All temp copies are serialized and cached and not dragged along.

When a save and change occurs to our recordset CSV object the working copy does change and a new temp is made of that new object. The recordset is now locked to the editing end user only, it is still viewable but not editable to others.

So, to the end user the object appears changed but only to them. When they want to commit the changes they become permanent and all related recordset object serialized caches are destroyed. The changes to the recordset object once commited are now present to other end users and unlocked.

On a rollback command we rollback to each previous temp object serialized cache state for our recordset object.

For a discard all or rollback all we discard all changes and all temp objects except the first one which replaces the current active, no changes are saved, and the recordset object is unlocked to editing to other allowed end users.

Now, defining our recordset can be simplistic such as by db.table or smarter by db.table.primary_id_row.

The concept is similar to my db Smart Caching one except it is not for simply caching select recordsets for end users viewing but for end users editing.

This is a simple way to add a transactional quality to small or text type databases.

PRAX is BAX.

I was going over some XML database routines and recalled the PRAX PHP port from Perl and why I didn't like it several years ago.

It is a simple and well done PHP class that handles a XML file as a recordset object of database fields and values. It takes a given XML file with a given XML file node, as a table, and returns a easy to use object to reference that specific XML file node or table as db rows.

The problem was the PRAX record XML objects didn't contain the XML attributes. In my PHP Object dbs I always use properties as a separate table that is associated to my main objects table as row attributes.

For instance, a table for a faq might have lots of attributes such as IP adde, date etc... within the content table, I don't like that. Since these might change I put those parts of a table (attributes) into a separate one and relate them. This way it is easier and quicker to handle a row's property values.

I decided to add that ability to the PRAX lib.

6 Jan 2003 (updated 6 Jan 2003 at 21:36 UTC) »
PHPortal version 0.2.7 released!

I am pleased to announce the release of PHPortal version 0.2.7 beta.

This is a major enhancement release with over 15 changes.

Downloads:
http://prdownloads.sf.net/xpc/

Sourceforge project:
http://sf.net/projects/xpc/

Developer's live/demo site:
http://dev.4arrow.com/
http://demo.phportal.org

PHPortal 0.2.7 Changes:

  1. Template Compiling Option.

    TEMPLATE COMPILER ON:
    $t->COMPILE = true;
    TEMPLATE COMPILER OFF:
    $t->COMPILE = false

    Depedencies. a 'c_templates' folder is required within the core 'tpl' class directory that is chmod 777 (writable) if FTP is not enabled.

  2. vhost new object type can make a folder into a unique domain for multiple website hosting and maintenance via one administration folder.

    Depedencies: Requires a master.php file wthin the apps/sites/cfgs directory that is used for all vhost objects.

    BUG: man.xpc access from a vhost domain not available yet must go through the master.php file domain.

  3. Object insatiation Caching

    Deficiencies: All libs must be loaded now before the session is started so if you start a session with a app lib you must name it and the app must out and die or else the session won't stick if it returns and then you must use cookies instead.

  4. Updated HTML_TreeMenu now can be used for a pulldown menu and has been separated from main manage class. Most code has been segregated in preparation for custom management interfaces. This will be not just new html template sets but also modified functionality. the ability to use the core management classes with a new interface that is completely different or the same dependent on your needs.

  5. Windows capable.

  6. Localhost domain capable top-level domain not required anymore.

  7. FTP class now can alternate between using file functions instead of ftp functions class should be renamed to 'file.'

  8. Configurations form uses the core 'form' class static form builder and processor object model.

  9. Inline PHPortal object refences from within Document types can now reference objects with a space in its ID by using urlencoding space = %20.

  10. PHPortal inline object reference tags used in document object types now use the prefix syntax of '_XPC:' instead of 'XPC:' the underscore enables both XML and WYSIWYG Html Editor viewing. This is still optional in this release for backwards compatibility.

    BUG: In the PHPortal Method Object type an enlcosed tag even with the new prefix syntax still has issues (not visible within WYSIWYG html editor). The Html WYSIWYG Html Editor now does not display Html document header tags (i.e. 'html', ' head', 'meta', 'body' ... ) Editing html headers or XML within the default WYSIWYG Html Editor is not recommended.

    NOTE: If editing a PHPortal Document with XPC inline object reference closed tags ( no open tags) remembwr to save the your edits from the source view.

  11. Removed the xpcMethods and Load_lib method name aliases from the PHPortal 'gate' core class now must use Meth or Lib.

  12. New central and local help system.

  13. New optional DB caching of select statement recordsets.

  14. Database Caching Option.

    DATABASE CACHER ON:
    $s->set_cache ( true );
    DATABASE CACHER OFF:
    $s->set_cache ( false );

    The return of the $s->sql_execute functionwill be a multi-dimensional array and you will not have to use a sql free result or fetch array. To get the number of rows use the PHP function 'count.'

    Depedencies: a 'cached' folder is required within the core 'sql' class directory that is chmod 777 (writable) if FTP is not enabled.

  15. FTP not required can now use file system functions for writing to directories yet they will then have to be made writable manually. Which is less secure than the FTP methods which doesn't leave wrtiable directories.

  16. All of a container object's attributes are now included with the 'top_' prefix for the $x->obj_data['attr'] array.

TODOS:

  1. Undo Panel

  2. Find Panel

  3. Owner Panel

  4. Add / Delete Product

  5. Version Integration

  6. Access Rule

  7. Define Access Permissions

  8. News App Object Type

  9. Local User Roles

  10. Import/Export Folder Hierarchies and Misc. Properties.

  11. Management left nav object tree folder object custom folder icons

yeupou, I use XMLRPC with cross-posting to send my PHPortal Project releases to multiple sites (via XML-RPC, SOAP, FORM POST ... ) at once. I usually post to sourceforge, freshmeat, my XLog, cmsinfo, phpbuilder, zend, hotscripts, phpfoundries, various private mailing lists...

I am working on unique remote cross-posting or one message to multiple servers with unique content, but haven't done it yet so it is still a bit quirky, nonetheless a excellent and worthy critique of something... what was the the bother again!?

5 Jan 2003 (updated 4 Aug 2011 at 18:17 UTC) »

367 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!