Permalink
Browse files

Convert Savant3 to pear2. Always throw exceptions, never load files i…

…nternally.
  • Loading branch information...
saltybeagle committed Aug 10, 2009
0 parents commit b6438c541c82c3abe6e3839333bf0abd055de4d5
Showing with 1,475 additions and 0 deletions.
  1. +1 −0 API-0.1.0
  2. +2 −0 CREDITS
  3. +5 −0 README
  4. +4 −0 RELEASE-0.1.0
  5. +22 −0 extrasetup.php
  6. +51 −0 package.xml
  7. +49 −0 package_compatible.xml
  8. +17 −0 packagexmlsetup.php
  9. +8 −0 src/Templates/Savant/Exception.php
  10. +86 −0 src/Templates/Savant/Filter.php
  11. +1,111 −0 src/Templates/Savant/Main.php
  12. +68 −0 src/Templates/Savant/Plugin.php
  13. +51 −0 stub.php
@@ -0,0 +1 @@
+Package PEAR2_Templates_Savant API release notes for version 0.1.0.
@@ -0,0 +1,2 @@
+;; put your info here
+Brett Bieber [saltybeagle] <saltybeagle@php.net> (lead)
5 README
@@ -0,0 +1,5 @@
+Savant is a powerful but lightweight object-oriented template system for PHP.
+
+Unlike other template systems, Savant by default does not compile your
+templates into PHP; instead, it uses PHP itself as its template language so you
+don't need to learn a new markup system.
@@ -0,0 +1,4 @@
+Port Savant3 to pear2.
+
+* Always throw exceptions.
+* Never load files internally.
@@ -0,0 +1,22 @@
+<?php
+/**
+ * This file is used to provide extra files/packages outside package.xml
+ */
+/**
+ * for example:
+if (basename(__DIR__) == 'trunk') {
+ $extrafiles = array(
+ new \pear2\Pyrus\Package(__DIR__ . '/../../HTTP_Request/trunk/package.xml'),
+ new \pear2\Pyrus\Package(__DIR__ . '/../../sandbox/Console_CommandLine/trunk/package.xml'),
+ new \pear2\Pyrus\Package(__DIR__ . '/../../MultiErrors/trunk/package.xml'),
+ new \pear2\Pyrus\Package(__DIR__ . '/../../Exception/trunk/package.xml'),
+ );
+} else {
+ $extrafiles = array(
+ new \pear2\Pyrus\Package(__DIR__ . '/../HTTP_Request/package.xml'),
+ new \pear2\Pyrus\Package(__DIR__ . '/../sandbox/Console_CommandLine/package.xml'),
+ new \pear2\Pyrus\Package(__DIR__ . '/../MultiErrors/package.xml'),
+ new \pear2\Pyrus\Package(__DIR__ . '/../Exception/package.xml'),
+ );
+}
+*/
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package version="2.1" xmlns="http://pear.php.net/dtd/package-2.1" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.1 http://pear.php.net/dtd/package-2.1.xsd">
+ <name>PEAR2_Templates_Savant</name>
+ <channel>pear2.php.net</channel>
+ <summary>Package PEAR2_Templates_Savant summary.
+</summary>
+ <description>
+Package detailed description here (found in README)</description>
+ <lead>
+ <name>Your Name</name>
+ <user>handle</user>
+ <email>handle@php.net</email>
+ <active>yes</active>
+ </lead>
+ <date>2009-08-09</date>
+ <time>18:45:47</time>
+ <version>
+ <release>0.1.0</release>
+ <api>0.1.0</api>
+ </version>
+ <stability>
+ <release>alpha</release>
+ <api>alpha</api>
+ </stability>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD License</license>
+ <notes>Package PEAR2_Templates_Savant release notes for version 0.1.0.
+
+Package PEAR2_Templates_Savant API release notes for version 0.1.0.</notes>
+ <contents>
+ <dir name="/">
+ <dir name="src" baseinstalldir="pear2">
+ <dir name="Templates">
+ <dir name="Savant">
+ <file role="php" name="Main.php"/>
+ </dir>
+ </dir>
+ </dir>
+ </dir>
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>5.2.0</min>
+ </php>
+ <pearinstaller>
+ <min>2.0.0a1</min>
+ </pearinstaller>
+ </required>
+ </dependencies>
+ <phprelease/>
+</package>
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package version="2.1" xmlns="http://pear.php.net/dtd/package-2.1" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.1 http://pear.php.net/dtd/package-2.1.xsd">
+ <name>PEAR2_Templates_Savant</name>
+ <channel>pear2.php.net</channel>
+ <summary>Package PEAR2_Templates_Savant summary.
+</summary>
+ <description>
+Package detailed description here (found in README)</description>
+ <lead>
+ <name>Your Name</name>
+ <user>handle</user>
+ <email>handle@php.net</email>
+ <active>yes</active>
+ </lead>
+ <date>2009-08-09</date>
+ <time>18:45:47</time>
+ <version>
+ <release>0.1.0</release>
+ <api>0.1.0</api>
+ </version>
+ <stability>
+ <release>alpha</release>
+ <api>alpha</api>
+ </stability>
+ <license uri="http://www.opensource.org/licenses/bsd-license.php">New BSD License</license>
+ <notes>Package PEAR2_Templates_Savant release notes for version 0.1.0.
+
+Package PEAR2_Templates_Savant API release notes for version 0.1.0.</notes>
+ <contents>
+ <dir name="/">
+ <file role="php" name="php/pear2/Templates/Savant/Main.php"/>
+ </dir>
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>5.2.0</min>
+ </php>
+ <pearinstaller>
+ <min>1.4.8</min>
+ </pearinstaller>
+ </required>
+ </dependencies>
+ <phprelease>
+ <filelist>
+ <install name="php/pear2/Templates/Savant/Main.php" as="pear2/Templates/Savant/Main.php"/>
+ </filelist>
+ </phprelease>
+</package>
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Extra package.xml settings such as dependencies.
+ */
+/**
+ * for example:
+$package->dependencies['required']->package['pear2.php.net/PEAR2_Autoload']->save();
+$package->dependencies['required']->package['pear2.php.net/PEAR2_Exception']->save();
+$package->dependencies['required']->package['pear2.php.net/PEAR2_MultiErrors']->save();
+$package->dependencies['required']->package['pear2.php.net/PEAR2_HTTP_Request']->save();
+
+$compatible->dependencies['required']->package['pear2.php.net/PEAR2_Autoload']->save();
+$compatible->dependencies['required']->package['pear2.php.net/PEAR2_Exception']->save();
+$compatible->dependencies['required']->package['pear2.php.net/PEAR2_MultiErrors']->save();
+$compatible->dependencies['required']->package['pear2.php.net/PEAR2_HTTP_Request']->save();
+*/
+?>
@@ -0,0 +1,8 @@
+<?php
+namespace pear2\Templates\Savant;
+
+interface Exception extends \Exception
+{
+
+}
+?>
@@ -0,0 +1,86 @@
+<?php
+
+/**
+*
+* Abstract Savant3_Filter class.
+*
+* @package Savant3
+*
+* @author Paul M. Jones <pmjones@ciaweb.net>
+*
+* @license http://www.gnu.org/copyleft/lesser.html LGPL
+*
+* @version $Id: Filter.php,v 1.5 2005/04/29 16:23:50 pmjones Exp $
+*
+*/
+
+/**
+*
+* Abstract Savant3_Filter class.
+*
+* You have to extend this class for it to be useful; e.g., "class
+* Savant3_Filter_example extends Savant3_Filter".
+*
+* @package Savant3
+*
+* @author Paul M. Jones <pmjones@ciaweb.net>
+*
+*/
+namespace pear2\Templates\Savant;
+abstract class Filter
+{
+
+
+ /**
+ *
+ * Optional reference to the calling Savant object.
+ *
+ * @access protected
+ *
+ * @var object
+ *
+ */
+
+ protected $Savant = null;
+
+
+ /**
+ *
+ * Constructor.
+ *
+ * @access public
+ *
+ * @param array $conf An array of configuration keys and values for
+ * this filter.
+ *
+ * @return void
+ *
+ */
+
+ public function __construct($conf = null)
+ {
+ settype($conf, 'array');
+ foreach ($conf as $key => $val) {
+ $this->$key = $val;
+ }
+ }
+
+
+ /**
+ *
+ * Stub method for extended behaviors.
+ *
+ * @access public
+ *
+ * @param string $text The text buffer to filter.
+ *
+ * @return string The text buffer after it has been filtered.
+ *
+ */
+
+ public static function filter($text)
+ {
+ return $text;
+ }
+}
+?>
Oops, something went wrong.

0 comments on commit b6438c5

Please sign in to comment.