From 8dbfcf468a5c2f5902724c7a299e8bc1197b920b Mon Sep 17 00:00:00 2001 From: zYne Date: Mon, 19 Feb 2007 20:00:40 +0000 Subject: [PATCH] --- manual/documentation2.php | 267 +++++++++++++++++++++++++++++++ manual/menu.php | 327 ++++++++++++++++++++++++++++++++++++++ manual/styles/basic.css | 46 +++++- 3 files changed, 639 insertions(+), 1 deletion(-) create mode 100644 manual/documentation2.php create mode 100644 manual/menu.php diff --git a/manual/documentation2.php b/manual/documentation2.php new file mode 100644 index 000000000..7680e2ff9 --- /dev/null +++ b/manual/documentation2.php @@ -0,0 +1,267 @@ +highlighter = new PHP_Highlight; + } + public function parseIndex2($index) + { + $ret = array(); + $path = array(); + $counters = array(); + + foreach ($index as $k => $v) { + if (empty($v)) { + continue; + } + $v = rtrim($v); + $i = count($path) - 1; + + $i = ($i > 0) ? $i : 0; + + $indent = substr_count($v, ' '); + + if ( ! isset($counters[$indent])) { + $counters[$indent] = 0; + } + + if ($indent > $i) { + $counters[$indent]++; + + $path[] = trim($v); + } else { + $steps = abs($i - $indent); + + $key = ($i - $steps); + while ($steps--) { + array_pop($path); + array_pop($counters); + } + + $counters[$key]++; + + $path[$key] = trim($v); + } + + $chapterName = implode(' - ', $path); + + $ret[] = array('index' => implode('.', $counters), + 'name' => $chapterName); + + } + return $ret; + } + /** + if ($indent == $i) { + $path[$i] = $v; + } else { + */ + public function parseIndex($index, $path = array(), $counters = array()) + { + $ret = array(); + + foreach ($index as $k => $v) { + $i = count($path) - 1; + + $counters[$i]++; + + if (is_array($v)) { + if ( ! is_numeric($k)) { + $tmp = $path; + $tmp[] = $k; + + $chapterName = ( ! empty($path)) ? implode(' - ', $path) . ' - ' . $k : $k; + + $ret[] = array('index' => implode('.', $counters), + 'name' => $chapterName); + } + + $ret = array_merge($ret, $this->parseIndex($v, $tmp, $counters)); + } else { + $chapterName = ( ! empty($path)) ? implode(' - ', $path) . ' - ' . $v : $v; + + $ret[] = array('index' => implode('.', $counters), + 'name' => $chapterName); + } + } + return $ret; + } + public function renderBlock($name) { + + if(file_exists("docs/$name.php")) { + $c = file_get_contents("docs/$name.php"); + + if(substr($c, 0, 5) == "
"; + } + } + if(file_exists("codes/$name.php")) { + $c = file_get_contents("codes/$name.php"); + $c = trim($c); + $this->renderCode($c); + } + } + public function renderCode($code = null) { + if( ! empty($code)) { + + $this->highlighter->loadString($code); + + print ""; + print ""; + print "
"; + + $this->highlighter->toHtml(); + print "
"; + } + } +} +print "
";
+$doc = new DocTool();
+
+function renderCode($code = null)
+{
+    global $doc;
+    
+    return $doc->renderCode($code);
+}
+$i   = $doc->parseIndex2($a);
+
+//print_r($i);
+
+?>
+
+    
+        
+ + + + + + + + + + + + +
+ Doctrine - PHP Data Persistence and ORM Tool +
+
+
+ $v) { + $indexes = explode('.', $v['index']); + $level = count($indexes); + $e = explode(' - ', $v['name']); + + print '
 '. $v['index'] . '. " . end($e) ."
"; + } + } else { + + + $e = explode(' - ', $_GET['chapter']); + $subchapters = false; + $found = false; + + foreach ($i as $k => $v) { + if ($found) { + if (strncmp($v['name'], $_GET['chapter'], strlen($_GET['chapter'])) === 0) { + $subchapters = true; + } + break; + } + $parts = explode(' - ', $v['name']); + $indexes = explode('.', $v['index']); + + if ($v['name'] === $_GET['chapter']) { + $prev = $i[($k - 1)]; + $next = $i[($k + 1)]; + $foundKey = ($k + 1); + $found = $v; + } + + } + + ?> + + + + + + +
+ +
>Prev>Next
 
+ + + + + +
+ + + Table of contents
+
+ + ' . implode(' - ', $p); ?>
+ + + + +
+ + renderBlock($found['name']); + } + + + ?> +
+
+
diff --git a/manual/menu.php b/manual/menu.php new file mode 100644 index 000000000..cd568d9a9 --- /dev/null +++ b/manual/menu.php @@ -0,0 +1,327 @@ +Getting started + Requirements + Installation + Compiling + Starting new project + Working with existing databases + Introduction + Making the first import + Import options +Connection management + Opening a new connection + Lazy-connecting to database + Managing connections + Connection-component binding +Object relational mapping + Introduction + Table and class naming + Columns + Column naming + Column aliases + Default values + Data types + Introduction + Type modifiers + Boolean + Integer + Float + String + Array + Object + Blob + Clob + Timestamp + Time + Date + Enum + Gzip + About type conversion + Constraints and validators + Notnull + Max - Min + Record identifiers + Introduction + Autoincremented + Natural + Composite + Sequence + Indexes + Introduction + Adding indexes + Index options + Special indexes + Relations + Introduction + Relation aliases + Foreign key associations + One-to-One + One-to-Many, Many-to-One + Tree structure + Join table associations + One-to-One + One-to-Many, Many-to-One + Many-to-Many + Self-referencing + Inheritance + One table many classes + One table one class + Column aggregation + Hierarchical data + Introduction + About + Setting up + Node interface + Tree interface + Traversing or Walking Trees + Read me + Adjacency list + Introduction + Nested set + Introduction + Setting up + Tree options + Node support + Tree support + Read me + Materialized path + Introduction + Examples +Working with objects + Dealing with relations + Creating related records + Retrieving related records + Updating related records + Deleting related records + Working with associations + Component overview + Manager + Introduction + Opening a new connection + Managing connections + Connection + Introduction + Available drivers + Getting a table object + Flushing the connection + Querying the database + Getting connection state + Record + Introduction + Creating new records + Retrieving existing records + Accessing properties + Updating records + Deleting records + Getting record state + Getting object copy + Serializing + Checking Existence + Callbacks + Collection + Introduction + Accessing elements + Adding new elements + Getting collection count + Saving the collection + Deleting collection + Key mapping + Loading related records + Collection expanding + Table + Introduction + Getting table information + Finder methods + Custom table classes + Custom finders + Getting relation objects + Fetching objects +Configuration + Introduction + Levels of configuration + Setting attributes + Portability + Identifier quoting + Table creation + Fetching strategy + Batch size + Session lockmode + Event listener + Validation + Offset collection limit +Advanced components + Eventlisteners + Introduction + Creating new listener + List of events + Listening events + Chaining + AccessorInvoker + Creating a logger + Validators + Introduction + More Validation + Valid or Not Valid + List of predefined validators + View + Intoduction + Managing views + Using views + Cache + Introduction + Query cache + Locking Manager + Introduction + Examples + Planned + Technical Details + Maintainer + Db_Profiler + Introduction + Basic usage + Advanced usage + Hook + Introduction + Building queries + List of parsers + Query + Introduction + selecting tables + limiting the query results + setting query conditions + HAVING conditions + sorting query results + RawSql + Introduction + Using SQL + Adding components + Method overloading + Db + Introduction + Connecting to a database + Using event listeners + Chaining listeners + Exceptions + Overview + List of exceptions +DQL (Doctrine Query Language) + Introduction + SELECT queries + DISTINCT keyword + Aggregate values + UPDATE queries + DELETE queries + FROM clause + WHERE clause + Conditional expressions + Literals + Input parameters + Operators and operator precedence + Between expressions + In expressions + Like Expressions + Null Comparison Expressions + Empty Collection Comparison Expressions + Collection Member Expressions + Exists Expressions + All and Any Expressions + Subqueries + Functional Expressions + String functions + Arithmetic functions + Datetime functions + Collection functions + GROUP BY, HAVING clauses + ORDER BY clause + Introduction + Sorting by an aggregate value + Using random order + LIMIT and OFFSET clauses + Introduction + Driver portability + The limit-subquery-algorithm + Examples + BNF +Native SQL + Scalar queries + Component queries + Fetching multiple components +Transactions + Introduction + Unit of work + Nesting + Savepoints + Locking strategies + Pessimistic locking + Optimistic locking + Lock modes + Isolation levels + Deadlocks +Caching + Introduction + Availible options + Drivers + Memcache + APC + Sqlite +Database abstraction + Modules + Export + Introduction + Creating new table + Altering table + Import + Introduction + Getting table info + Getting foreign key info + Getting view info + Util + Using explain + DataDict + Getting portable type + Getting database declaration + Reserved keywords + Drivers + Oracle + Making unsuported functions work + Mysql + Tips and tricks +Technology + Architecture + Design patterns used + Speed + Internal optimizations + DELETE + INSERT + UPDATE +Real world examples + User management system + Forum application + Album lister +Coding standards + Overview + Scope + Goals + PHP File Formatting + General + Indentation + Maximum line length + Line termination + Naming Conventions + Classes + Interfaces + Filenames + Functions and methods + Variables + Constants + Record columns + Coding Style + PHP code demarcation + Strings + Arrays + Classes + Functions and methods + Control statements + Inline documentation + Testing + Writing tests + diff --git a/manual/styles/basic.css b/manual/styles/basic.css index 09d560b1d..e0067c677 100644 --- a/manual/styles/basic.css +++ b/manual/styles/basic.css @@ -30,7 +30,7 @@ ul { line-height: 1.5em; } td { -font-size: 13 px; +font-size: 14 px; font-family: Verdana, Arial, Helvetica; } @@ -49,6 +49,32 @@ cellpadding: 0; cellspacing: 0; border-height: 1 px; } +div { +line-height: 1.5em; +} +div.level1 { +font-size: 15px; +background: #E0E0E0; +} +div.level2 { +line-height: 1.8 em; +background: #E9E9E9; +} +div.level3 { +background: #EFEFEF; +} +div.level4 { +background: #F5F5F5; +} +div.level5 { + +} +div.index { +border-style: solid; +border-color: #A0A0A0; +border-shadow: none; +border-width: thin; +} b.title { color: #A50A3D; } @@ -64,3 +90,21 @@ color: #367FAC; a { color: #367FAC; } +font.level1 { +font-size: 17 px; +line-height: 2.0 em; +font-weight: bold; +margin-left: 0px; +} +font.level2 { +font-size: 15 px; +margin-left: 30px; +} +font.level3 { +font-size: 13 px; +margin-left: 60px; +} +font.level4 { +font-size: 11 px; +margin-left: 90px; +}