From f7ddc264d832d163494904da67ca96856335487b Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Sat, 24 May 2014 01:54:04 +0200 Subject: Simple autoloader for examples and tests. --- example/index.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'example') diff --git a/example/index.php b/example/index.php index b8a6938..a0aa03c 100644 --- a/example/index.php +++ b/example/index.php @@ -2,11 +2,12 @@ # Example program to demonstrate the STE... -require_once(dirname(__FILE__) . "/../ste.php"); +require_once(dirname(__FILE__) . "/../steloader.php"); +use \kch42\ste; # Initialize an STECore instance -$ste = new \ste\STECore( - new \ste\FilesystemStorageAccess( # The STECore needs a StorageAccess implementation, we are using the FilesystemStorageAccess, which comes with STE. +$ste = new ste\STECore( + new ste\FilesystemStorageAccess( # The STECore needs a StorageAccess implementation, we are using the FilesystemStorageAccess, which comes with STE. dirname(__FILE__) . "/templates/src", # FilesystemStorageAccess needs a directory, where the Templates are... dirname(__FILE__) . "/templates/transc" # ...and a directory for the transcompiled templates (write permissions needed). ) @@ -32,7 +33,7 @@ $ste->register_tag("repeat", { $output = ""; if(!is_numeric($params["n"])) - throw new \ste\RuntimeError("Sorry, but parameter n must be a number..."); + throw new ste\RuntimeError("Sorry, but parameter n must be a number..."); for($i = 0; $i < $params["n"]; ++$i) $output .= $sub($ste); -- cgit v1.2.3-70-g09d2