Skip to content
Snippets Groups Projects
Commit 0a1962aa authored by Kevin Abel's avatar Kevin Abel
Browse files

Remove the rest of the old PEAR directory

parent a03e3597
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 747 deletions
Technical choices for Cache_Lite...
-----------------------------------
To begin, the main goals of Cache_Lite :
- performances
- safe use (even on very high traffic or with NFS (file locking doesn't work
with NFS))
- flexibility (can be used by the end user or as a part of a larger script)
For speed reasons, it has been decided to focus on the file container (the
faster one). So, cache is only stored in files. The class is optimized for that.
If you want to use a different cache container, have a look to PEAR/Cache.
For speed reasons too, the class 'Cache_Lite' has do be independant (so no
'require_once' at all in 'Cache_Lite.php'). But, a conditional include_once
is allowed. For example, when an error is detected, the class include dynamicaly
the PEAR base class 'PEAR.php' to be able to use PEAR::raiseError(). But, in
most cases, PEAR.php isn't included.
For the second goal (safe use), there is three (optional) mecanisms :
- File Locking : seems to work fine (but not with distributed file system
like NFS...)
- WriteControl : the cache is read and compared just after being stored
(efficient but not perfect)
- ReadControl : a control key (crc32(), md5() ou strlen()) is embeded is the
cache file and compared just after reading (the most efficient
but the slowest)
<?php
/**
* Template Definition for template_style1.dwt
*/
require_once 'UNL/DWT.php';
class UNL_DWT_Template_style1 extends UNL_DWT
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
var $__template = 'Template_style1.tpl'; // template name
var $doctitle = "<title>Sample Template Style 1</title>"; // string()
var $head = ""; // string()
var $header = "Header"; // string()
var $leftnav = "<p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut. </p>"; // string()
var $content = "<h2>Subheading</h2> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </p> <p> Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>"; // string()
var $footer = "Footer"; // string()
/* Static get */
function staticGet($k,$v=NULL) { return UNL_DWT::staticGet('UNL_DWT_Template_style1',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}
This diff is collapsed.
[UNL_DWT]
dwt_location = /Users/bbieber/Documents/workspace/UNL_Search/trunk/lib/docs/UNL_DWT/docs/examples/
class_location = /Users/bbieber/Documents/workspace/UNL_Search/trunk/lib/docs/UNL_DWT/docs/examples/
tpl_location = /Users/bbieber/Documents/workspace/UNL_Search/trunk/lib/docs/UNL_DWT/docs/examples/
class_prefix = UNL_DWT_
\ No newline at end of file
<?php
/**
* This example uses the DWT object generated by: '/usr/local/bin/php /Users/bbieber/Documents/workspace/UNL_Search/trunk/lib/php/UNL/DWT/createTemplates.php /Users/bbieber/Documents/workspace/UNL_Search/trunk/lib/docs/UNL_DWT/docs/examples/example.ini'
*
*/
ini_set('display_errors',true);
error_reporting(E_ALL|E_STRICT);
require_once 'UNL/DWT.php';
if ('/Users/bbieber/Documents/workspace/UNL_Search/trunk/lib/data' == '@'.'DATA_DIR@') {
$configfile = 'example.test.ini';
} else {
$configfile = '/Users/bbieber/Documents/workspace/UNL_Search/trunk/lib/docs/UNL_DWT/docs/examples/example.ini';
}
$config = parse_ini_file($configfile, true);
foreach($config as $class=>$values) {
UNL_DWT::$options = $values;
}
$page = UNL_DWT::factory('Template_style1');
$page->header = "Example Using Template Style 1";
$page->leftnav = "<ul><li><a href='http://pear.unl.edu/'>UNL PEAR Channel</a></li></ul>";
$page->content = "<p>This example demonstrates the usefulness of the DWT object generator for Dreamweaver Templates.</p>";
$page->content .= "<p>Included with the DWT package is a Dreamweaver template with 4 editable regions [template_style1.dwt]. This page is rendered using the DWT class created from that template.</p>";
$page->content .= "<p>To create classes for your Templates, create a .ini file with the location of your Dreamweaver templates (dwt's) and then run the createTemplates.php script to generate objects for each of your template files.</p>";
$page->content .= "<p>Here is the ini file used to create the Template_style1:<pre><code>".file_get_contents($configfile)."</code></pre></p>";
$page->content .= "<p>And the command used to create the template classes:<pre><code>/usr/local/bin/php /Users/bbieber/Documents/workspace/UNL_Search/trunk/lib/php/UNL/DWT/createTemplates.php /Users/bbieber/Documents/workspace/UNL_Search/trunk/lib/docs/UNL_DWT/docs/examples/example.ini</code></pre></p>";
$page->footer = "<a href='mailto:brett.bieber@gmail.com'>Brett Bieber</a>";
echo $page->toHtml();
\ No newline at end of file
<?php
require_once 'UNL/DWT/Scanner.php';
$file = file_get_contents(dirname(__FILE__).'/'.'template_style1.dwt');
$scanned = new UNL_DWT_Scanner($file);
echo $scanned->leftnav;
echo $scanned->content;
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment