Author: Tobias Schlitt
Date: 2006-01-18 10:21:55 +0100 (Wed, 18 Jan 2006)
New Revision: 1953
Log:
- Added example on how to include PHP sources to RST.
- Added first example skeleton.
- Added common autoload include for examples.
Added:
packages/ConsoleTools/trunk/docs/tutorial_autoload.php
packages/ConsoleTools/trunk/docs/tutorial_example_01.php
Modified:
packages/ConsoleTools/trunk/docs/tutorial.txt
Modified: packages/ConsoleTools/trunk/docs/tutorial.txt
===================================================================
--- packages/ConsoleTools/trunk/docs/tutorial.txt 2006-01-18 09:09:21 UTC
(rev 1952)
+++ packages/ConsoleTools/trunk/docs/tutorial.txt 2006-01-18 09:21:55 UTC
(rev 1953)
@@ -9,17 +9,15 @@
The ConsoleTools components provides several useful tools to build
applications that run on a computers console (sometimes also called Shell or
command line). Usually one would not expect to see a component like this for a
-language like PHP, but since PHP4 more and more features were included in PHP
+language like PHP, but since PHP 4 more and more features were included in PHP
which make the language quite neat as a shell scripting language. Indeed you
can find many situations, where a console based application extends the
functionality of a web application perfectly or where a pure shell application
makes sense to be written in PHP. For example eZ publish has several shell
scripts included, which perform tasks like clearing caches.
-The ConsoleTools package will be used for eZ publish 4.0 to realize this
-applications. But until then, they can offer you a solid and comfortable basis
-for your shell scripts also. The ConsoleTools components offers several
-(mostly independant) classes to perform different tasks. The main classes are:
+The ConsoleTools components offers several (mostly independant) classes to
+perform different tasks. The main classes are:
Class overview
==============
@@ -88,16 +86,17 @@
As already mentioned, the class ezcConsoleOutput is the tool of choice for
printing text to the console. Let's look at a basic example:
+.. include:: tutorial_example_01.php
+ :literal
-
..
Local Variables:
mode: rst
fill-column: 79
- End:
+ End:
vim: et syn=rst tw=79
Added: packages/ConsoleTools/trunk/docs/tutorial_autoload.php
===================================================================
--- packages/ConsoleTools/trunk/docs/tutorial_autoload.php 2006-01-18
09:09:21 UTC (rev 1952)
+++ packages/ConsoleTools/trunk/docs/tutorial_autoload.php 2006-01-18
09:21:55 UTC (rev 1953)
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Autoload ezc classes
+ *
+ * @param string $class_name
+ */
+function __autoload( $class_name )
+{
+ if ( ezcBase::autoload( $class_name ) )
+ {
+ return;
+ }
+ if ( strpos( $class_name, '_' ) !== false )
+ {
+ $file = str_replace( '_', '/', $class_name ) . '.php';
+ require_once( $file );
+ }
+}
+
+?>
Property changes on: packages/ConsoleTools/trunk/docs/tutorial_autoload.php
___________________________________________________________________
Name: svn:eol-style
+ native
Added: packages/ConsoleTools/trunk/docs/tutorial_example_01.php
===================================================================
--- packages/ConsoleTools/trunk/docs/tutorial_example_01.php 2006-01-18
09:09:21 UTC (rev 1952)
+++ packages/ConsoleTools/trunk/docs/tutorial_example_01.php 2006-01-18
09:21:55 UTC (rev 1953)
@@ -0,0 +1,3 @@
+<?php
+
+require_once './tutorial_autoload.php';
Property changes on: packages/ConsoleTools/trunk/docs/tutorial_example_01.php
___________________________________________________________________
Name: svn:eol-style
+ native
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components