diff --git a/manual/architecture/Doctrine.dia b/manual/architecture/Doctrine.dia deleted file mode 100644 index e713fc160..000000000 Binary files a/manual/architecture/Doctrine.dia and /dev/null differ diff --git a/manual/architecture/Doctrine_Import.png b/manual/architecture/Doctrine_Import.png deleted file mode 100644 index 23557fb99..000000000 Binary files a/manual/architecture/Doctrine_Import.png and /dev/null differ diff --git a/manual/architecture/Doctrine_Import.xmi b/manual/architecture/Doctrine_Import.xmi deleted file mode 100644 index e118b47ce..000000000 --- a/manual/architecture/Doctrine_Import.xmi +++ /dev/null @@ -1,773 +0,0 @@ - - - - - umbrello uml modeller http://uml.sf.net - 1.5.4 - UnicodeUTF8 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/manual/content.php b/manual/content.php deleted file mode 100644 index 74fa7ab6e..000000000 --- a/manual/content.php +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - -
- $v) { - $indexes = explode('.', $v['index']); - $level = count($indexes); - $e = explode(' - ', $v['name']); - $file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'docs' . DIRECTORY_SEPARATOR . $v['name'] . '.php'; - - print '
 '. $v['index'] . '. " . end($e) .""; - if ( ! file_exists($file)) { - //print "[code]"; - } - print "
"; - } - } 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']) { - if (isset($i[($k - 1)])) { - $prev = $i[($k - 1)]; - } - if (isset($i[($k + 1)])) { - $next = $i[($k + 1)]; - } - - $foundKey = ($k + 1); - $found = $v; - } - } - ?> - - - - - - - - - - - - -
- - - -
- - >Prev - - - - >Next
- - - - - -
- - $v) { - $stack[] = $v; - $links[] = "' . $v . ''; - } - print implode(' - ', $links); - ?> -
-
-
- - -
Table of contents
-
- ' . $i[$x]['index']; - ?> - - ' . end($p); ?> - - renderBlock($found['name']); - } - ?> -
-
- -
-   -- index
- $v) { - $indexes = explode('.', $v['index']); - $level = count($indexes); - $e = explode(' - ', $v['name']); - if($level === 1) { - $level++; - print ' '. $v['index'] . '. " . end($e) ."
"; - } - } - ?> -
-
diff --git a/manual/docbook/Makefile b/manual/docbook/Makefile deleted file mode 100644 index da3b7063c..000000000 --- a/manual/docbook/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -XSLSTYLE=doctrine.xsl -XSLSTYLE_CHUNKED=doctrine-chunked.xsl -%.html: book/%.xml - /usr/local/bin/xsieve -xinclude --output $@ $(XSLSTYLE) $< - /usr/local/bin/xsieve -xinclude --stringparam base.dir html/ $(XSLSTYLE_CHUNKED) $< - -html: doctrine.html diff --git a/manual/docbook/README b/manual/docbook/README deleted file mode 100644 index 2f870ac1f..000000000 --- a/manual/docbook/README +++ /dev/null @@ -1,29 +0,0 @@ -WORK IN PROGRESS!!! - -Please feel free to contribute, but these docs are currently being developed -by Ian P. Christian . - -Find me on IRC and talk to me if you want to help. - -Pleaes use xmllint to validate your changes BEFORE committing. - -Please follow the intenting format used in the file. -*2 SPACES* for indenting. -That's SPACES not TABS :) - -For documentation about docbook XSL, visit: -http://www.sagehill.net/docbookxsl/index.html - -For information about docbook itself, google - there's LOTS of sites. -This is a good reference: -http://xml.web.cern.ch/XML/goossens/dbatcern/index.html -the 'definitive guide' can be found here: -http://www.docbook.org/tdg/en/html/docbook.html - -Xsieve is used for syntax highlighting: - -http://xsieve.sourceforge.net/ - -Downloaded from CVS, it has 'experiments/programlisting' directory -containing stuff for the highlighting - check the makefile -to see how it works. diff --git a/manual/docbook/book/conn-mgt.xml b/manual/docbook/book/conn-mgt.xml deleted file mode 100644 index 02a9be477..000000000 --- a/manual/docbook/book/conn-mgt.xml +++ /dev/null @@ -1,373 +0,0 @@ - - Connection Management - - DSN, the Data Source Name - - In order to connect to a database through Doctrine, you have to create a - valid DSN - data source name. - - - Doctrine supports both PEAR DB/MDB2 like data source names as well as PDO - style data source names. The following section deals with PEAR like data - source names. If you need more info about the PDO-style data source names - see http://www.php.net/manual/en/function.PDO-construct.php. - - - The DSN consists in the following parts: - - - DSN components - - phptype - - Database backend used in PHP (i.e. mysql , pgsql etc.) - - - - dbsyntax - - Database used with regards to SQL syntax etc. - - - - protocol - - Communication protocol to use ( i.e. tcp, unix etc.) - - - - hostspec - - Host specification (hostname[:port]) - - - - database - - Database to use on the DBMS server - - - - username - - User name for login - - - - password - - Password for login - - - - proto_opts - - Maybe used with protocol - - - - option - - option: Additional connection options in URI query string format. options get separated by &. The Following table shows a non complete list of options: - - - - - - List of Options - - name - - Some backends support setting the client charset. - - - - new_link - - Some RDBMS do not create new connections when connecting to the same - host multiple times. This option will attempt to force a new - connection - - - - - - The DSN can either be provided as an associative array or as a string. The - string format of the supplied DSN is in its fullest form: - - -phptype(dbsyntax)://username:password@protocol+hostspec/database?option=value - - - - - Most variations are allowed: - - - phptype://username:password@protocol+hostspec:110//usr/db_file.db - phptype://username:password@hostspec/database - phptype://username:password@hostspec - phptype://username@hostspec - phptype://hostspec/database - phptype://hostspec - phptype:///database - phptype:///database?option=value&anotheroption=anothervalue - phptype(dbsyntax) - phptype - - - - The currently supported database backends are: - - fbsql -> FrontBase? - ibase -> InterBase? / Firebird (requires PHP 5) - mssql -> Microsoft SQL Server (NOT for Sybase. Compile PHP --with-mssql) - mysql -> MySQL? - mysqli -> MySQL? (supports new authentication protocol) (requires PHP 5) - oci8 -> Oracle 7/8/9/10 - pgsql -> PostgreSQL? - querysim -> QuerySim? - sqlite -> SQLite 2 - - - A second DSN format is supported phptype(syntax)://user:pass@protocol(proto_opts)/database - - - - - If your database, option values, username or password contain characters used to delineate DSN parts, you can escape them via URI hex encodings: - - : = %3a - / = %2f - @ = %40 - + = %2b - ( = %28 - ) = %29 - ? = %3f - = = %3d - & = %26 - - - - Please note, that some features may be not supported by all database backends. - - - - Connect to database through a socket - - mysql://user@unix(/path/to/socket)/pear - - - - - Connect to database on a non standard port - - pgsql://user:pass@tcp(localhost:5555)/pear - - - - - Connect to SQLite on a Unix machine using options - - sqlite:////full/unix/path/to/file.db?mode=0666 - - - - - Connect to SQLite on a Windows machine using options - - sqlite:///c:/full/windows/path/to/file.db?mode=0666 - - - - - Connect to MySQLi using SSL - - mysqli://user:pass@localhost/pear?key=client-key.pem&cert=client-cert.pem - - - - - Opening a new connection - - - Opening a new database connection in Doctrine is very easy. If you wish - to use PDO (www.php.net/PDO) - you can just initalize a new PDO object: - - - getMessage(); - } -?>]]> - - - If your database extension isn't supported by PDO you can use special - Doctrine_Adapter class (if availible). The following example uses DB2 - adapter: - - - getMessage(); - } -?>]]> - - - The next step is opening a new Doctrine_Connection. - - - ]]> - - - Lazy Connections - - Lazy-connecting to database is handled via Doctrine_Db wrapper. When - using Doctrine_Db instead of PDO / Doctrine_Adapter, lazy-connecting to - database is being performed (that means Doctrine will only connect to - database when needed). - - - - This feature can be very useful when using for example page caching, - hence not actually needing a database connection on every request. - Remember connecting to database is an expensive operation. - - query('FROM User u'); -?>]]> - - - Managing Connections - - From the start Doctrine has been designed to work with multiple - connections. Unless separately specified Doctrine always uses the current - connection for executing the queries. The following example uses - openConnection() second argument as an optional connection alias. - - - openConnection(new PDO('dsn','username','password'), 'connection 1'); -?>]]> - - - For convenience Doctrine_Manager provides static method connection() - which opens new connection when arguments are given to it and returns the - current connection when no arguments have been speficied. - - - ]]> - - - The current connection is the lastly opened connection. - - - openConnection(new PDO('dsn2','username2','password2'), 'connection 2'); - - $manager->getCurrentConnection(); // $conn2 -?>]]> - - - You can change the current connection by calling setCurrentConnection(). - - - - setCurrentConnection('connection 1'); - - $manager->getCurrentConnection(); // $conn - -?>]]> - - - - You can iterate over the opened connection by simple passing the manager - object to foreach clause. This is possible since Doctrine_Manager - implements special IteratorAggregate interface. - - - ]]> - - - Connection-component binding - - - Doctrine allows you to bind connections to components (= your - ActiveRecord? classes). This means everytime a component issues a query - or data is being fetched from the table the component is pointing at - Doctrine will use the bound connection. - - - openConnection(new PDO('dsn','username','password'), 'connection 1'); - - $conn2 = $manager->openConnection(new PDO('dsn2','username2','password2'), 'connection 2'); - - $manager->bindComponent('User', 'connection 1'); - - $manager->bindComponent('Group', 'connection 2'); - - $q = new Doctrine_Query(); - - // Doctrine uses 'connection 1' for fetching here - $users = $q->from('User u')->where('u.id IN (1,2,3)')->execute(); - - // Doctrine uses 'connection 2' for fetching here - $groups = $q->from('Group g')->where('g.id IN (1,2,3)')->execute(); -?>]]> - - diff --git a/manual/docbook/book/doctrine.xml b/manual/docbook/book/doctrine.xml deleted file mode 100644 index 943ee74fd..000000000 --- a/manual/docbook/book/doctrine.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - -]> - - - - - Doctrine Documentation - - Konsta - Vesterinen - The creator and lead developer. - - - Ian - P. - Christian - pookey@pookey.co.uk - Junior developer and documentation maintainer. - - - Doctrine Project - 2007 - - - - The contents of this document are licensed under the Creative Commons - Attribution-ShareAlike License. - - - - - - Documentation for the PHP Doctrine project. - - - This document was generated . - - - - - &chap1; - &chap2; - - - Object Relational Mapping - - - - Working With Objects - - - - Configuration - - - - Advanced Components - - - - DQL (Doctrine Query Lanaguage) - - Introduction - - Doctrine Query Language(DQL) is an Object Query Language created for helping users in complex object retrieval. - - - You should always consider using DQL(or raw SQL) when retrieving relational data efficiently (eg. when fetching users and their phonenumbers). - - - When compared to using raw SQL, DQL has several benefits: - - - - From the start it has been designed to retrieve records(objects) not result set rows. - DQL understands relations so you don't have to type manually sql joins and join conditions. - DQL is portable on different databases - DQL has some very complex built-in algorithms like (the record limit algorithm) which can help developer to efficiently retrieve objects. - It supports some functions that can save time when dealing with one-to-many, many-to-many relational data with conditional fetching. - - - - If the power of DQL isn't enough, you should consider using the rawSql API for object population. - - - getTable('User')->findAll(); - foreach($users as $user) { - print $user->name."\n"; - foreach($user->Phonenumber as $phonenumber) { - print $phonenumber."\n"; - } - } - - // same thing implemented much more efficiently: - // (using only one sql query for object population) - - $users = $conn->query("FROM User.Phonenumber"); - foreach($users as $user) { - print $user->name."\n"; - foreach($user->Phonenumber as $phonenumber) { - print $phonenumber."\n"; - } - } -?>]]> - - - - - - Native SQL - - - - Transactions - - - - Caching - - - - Database Abstraction - - - - Technology - - - - Real World Examples - - - - Coding Standards - - - diff --git a/manual/docbook/book/intro.xml b/manual/docbook/book/intro.xml deleted file mode 100644 index 6512a3f65..000000000 --- a/manual/docbook/book/intro.xml +++ /dev/null @@ -1,397 +0,0 @@ - - Introduction - - About Doctrine - - Doctrine is a Object Relational Mapping and database abstraction - framework for PHP. The DBAL part of Doctrine derives from MDB2. The key - idea is to provide very intuitive and easy-to-use persistency solution - (eg. RoR ActiveRecord) with all the advanced features from the more - heavy-weight solutions (eg. Hibernate). - - - Doctrine Query Language implements EJB 3 OQL specificiation and expands - it a bit further (it has special LIMIT and OFFSET clauses). - - - Example - - You might not understand exactly what's happening at this stage, but - this example is to give you a general idea of the power of Doctrine. - - - hasColumn('name','string',30); - $this->hasColumn('username','string',20); - $this->hasColumn('password','string',16); - $this->hasColumn('created','integer',11); - } - } - - // create a new user - $user = new User(); - $user->username = "pookey"; - $user->password = "a password!"; - $user->created = time(); - - // save the user - $user->save(); - - // lets find the user.... - $query = new Doctrine_Query(); - $query->query('SELECT u.* FROM User u WHERE u.username = ?'); - $users = $query->execute(array('pookey')); - if (count($users)) - { - // we found our user! - } - else - { - // we didn't find our user, oh no! - } -?>]]> - - - - - Features - - - General Features - - - Fully object-oriented following best practices and design patterns - Multiple databases - Database connection pooling with connection-record -registry - Runtime configuration (no XML needed!) - Very modular structure (only uses the needed features) - The runtime components can be compiled into a single fileM - Leveled configuration (attributes can be set at global, connection and table levels) - - - - - Database Abstraction - - - A DSN (data source name) or array format for specifying database servers - Datatype abstraction and on demand datatype conversion - supports PDO - Database query profiling - Query caching - Sequence / autoincrement emulation - Replace emulation - RDBMS management methods (creating, dropping, altering) - SQL function call abstraction - SQL expression abstraction - Pattern matching abstraction - Portable error codes - Nested transactions - Transaction isolation abstraction - Transaction savepoint abstraction - Index/Unique Key/Primary Key support - Ability to read the information schema - Reverse engineering schemas from an existing database - LIMIT / OFFSET emulation - - - - - Object Relational Mapping - - - - General Features - - - Validators - Transactional errorStack for easy retrieval of all errors - EventListeners - UnitOfWork pattern (easy saving of all pending objects) - Uses ActiveRecord pattern - State-wise records and transactions - Importing existing database schemas to Doctrine ActiveRecord objects - Exporting Doctrine ActiveRecords to database (= automatic table creation) - - - - - Mapping - - - Composite, Natural, Autoincremented and Sequential identifiers - PHP Array / Object data types for columns (automatic serialization/unserialization) - Gzip datatype for all databases - Emulated enum datatype for all databases - Datatype abstraction - Column aggregation inheritance - One-class-one-table inheritance as well as One-table - One-to-many, many-to-one, one-to-one and many-to-many relations - Self-referencing relations even for association table relations - Relation aliases - - - - - - Object population - - - DQL (Doctrine Query Language), an EJB 3 spec compliant OQL - The limit-subquery-algorithm - OO-style query API for both DQL and raw SQL - Object population from database views - Object population through raw SQL - - - - - - Transactions and locking - - - Pessimistic offline locking - Savepoints, transaction isolation levels and nested transactions - Transactional query optimization (gathering of DELETE statements) - - - - - - - Requirements - - Doctrine requires PHP >= 5.1, and it doesn't require any external libraries. - It runs on both windows and *nix based platforms. - - - For database abstraction Doctrine uses PDO which is bundled with php by - default. You will need PDO support for whatever database you intend to - use, and if you want to be able to run the included unit tests, you - will need SQLite support. - - - Doctrine also requires a little adodb-hack for table creation, - which comes with doctrine. - - - - - Community - - Doctrine has 3 mailing lists, an IRC channel, a forum, and a wiki/trac. - - - Mailing Lists - - The 'user' mailing list is for discussing the usage of doctrine. - To subscribe to this list, send a blank email to - doctrine-user+subscribe@lists.pengus.net - - - The 'dev' mailing list is used for discussion of the development - of doctrine. To subscribe to this list, send a blank email to - doctrine-dev+subscribe@lists.pengus.net - - - The 'svn' mailing list is a read-only list, which users and developers - can subscribe to to receive commit logs to the SVN repository. This - list is quite high traffic, as every commit to the repository results - in an email containing the changelog entry and diffs of the changed - files. - To subscribe to this list, send a blank email to - doctrine-svn+subscribe@lists.pengus.net - - - - IRC - - The #doctrine IRC channel can be found on the freenode network. The fastest way of getting bugs fixed and features being implemented is joining our irc channel and pointing out the issue to one of the developers. - - - - Wiki and Trac - - A wiki/trac install can be found at http://doctrine.pengus.net/trac - - - - Forum - - The Doctrine forum can be found here: - http://www.phpbbserver.com/phpdoctrine/ - - - - - - Contributing/Reporting Bugs - - Doctrine is constantly under development, and is always happy for new - developers to contribute to the project. - - - To get an account on trac to submit bugs and make suggestions, or to get - access to commit to the SVN repository, please visit the IRC channel, or - email the users mailing list. - - - If you are unsure as to wether you have found a bug or not, please - consider joining us on IRC, or maining the user mailing list to confirm - your problem. - - - - - Installation - - As of the time of writing, there is no stable release of doctrine. That is not to say - that it's unstable, but simply that the best way to install it is to aquire it from - SVN. - - - To get the latest copy, simple check out 'trunk' from SVN. You will - need subversion - install to check out doctrine. If you are unable to install subversion - for whatever reason, see below for details on downloading a snapshot. - - - bash $ mkdir doctrine - bash $ cd doctrine - bash $ svn checkout http://doctrine.pengus.net/svn/trunk . - - - Daily snapshots can be found at - http://doctrine.pengus.net/downloads/ - and the latest daily snapshot can always be found at - http://doctrine.pengus.net/downloads/latest-snapshot.tar.gz - - - - - Include and autoload - - In order to use Doctrine in your project, you must first include the main - library file called 'Doctrine.php'. - - ]]> - - Doctrine supports Autoloading for including - files so that you don't have to include anything more then the base - file. There are two different strategies that can be used to do this, - as shown below. - - - - You can use the __autoload function to call the - 'Doctrine::autoload($class)' method, for example: - - ]]> - - - If your project already uses autoload or you have other libraries - that use it, you can use spl_autoload_register - to register multiple autoloading functions. - - - ]]> - - - - Compiling - - Compiling is a method for making a single file of the most used doctrine - runtime components. Including this compiled file instead of multiple files - (in worst cases dozens of files) can improve performance by an order of - magnitude. - - - In cases where this might fail, a Doctrine_Exception is thrown detailing - the error. - - ]]> - - - - Starting a new project - - Doctrine_Record is the basic component of every doctrine-based project. - There should be atleast one Doctrine_Record for each of your database - tables. Doctrine_Record follows the Active - Record pattern - - - Doctrine auto-creates database tables and always adds a primary key - column named 'id' to tables that don't have any primary keys - specified. The only thing you need to do to create database tables is - defining a class which extends Doctrine_Record and setting a - setTableDefinition method with hasColumn() method calls. - - - Below is a short example: - - - We want to create a database table called 'user' with columns - id(primary key), name, username, password and created. Provided that - you have already installed Doctrine these few lines of code are all you - need: - - hasColumn('name','string',30); - $this->hasColumn('username','string',20); - $this->hasColumn('password','string',16); - $this->hasColumn('created','integer',11); - } - } -?>]]> - - We now have a user model that supports basic CRUD opperations! - - - diff --git a/manual/docbook/doctrine-chunked.xsl b/manual/docbook/doctrine-chunked.xsl deleted file mode 100644 index 52686cfb0..000000000 --- a/manual/docbook/doctrine-chunked.xsl +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/manual/docbook/doctrine.css b/manual/docbook/doctrine.css deleted file mode 100644 index ad36c545a..000000000 --- a/manual/docbook/doctrine.css +++ /dev/null @@ -1,9 +0,0 @@ -body, p, td -{ - font-family: arial, "lucida console", sans-serif -} -.programlisting -{ - margin: 10px; - background-color: #eeeeee; -} diff --git a/manual/docbook/doctrine.xsl b/manual/docbook/doctrine.xsl deleted file mode 100644 index 0b93eac7c..000000000 --- a/manual/docbook/doctrine.xsl +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/manual/docbook/programlisting/README b/manual/docbook/programlisting/README deleted file mode 100644 index 137be4857..000000000 --- a/manual/docbook/programlisting/README +++ /dev/null @@ -1,19 +0,0 @@ -Making syntax highlighting work -------------------------------- - - ~/p/xsieve/opt/bin/xsieve -xinclude -o testdoc.html testdoc.xsl testdoc.xml - -Development in this directory will be cancelled. -Something like $XSIEVE/examples/syntax_highlighting will be used. - - -colorer.scm: the main part, uniting trees -run-colorer.scm: low-level driver to execute a colorizing program -colorer.xsl: processing of "programlisting" - -testdoc.* + test.xml: testing -run.sh: run "testdoc" conversion - -testdata.xml, test.scm: testing -test-one.scm: testing - diff --git a/manual/docbook/programlisting/colorer-html.xsl b/manual/docbook/programlisting/colorer-html.xsl deleted file mode 100644 index 3a428c166..000000000 --- a/manual/docbook/programlisting/colorer-html.xsl +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/manual/docbook/programlisting/colorer-one.xsl b/manual/docbook/programlisting/colorer-one.xsl deleted file mode 100644 index f52f07f03..000000000 --- a/manual/docbook/programlisting/colorer-one.xsl +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/manual/docbook/programlisting/colorer.scm b/manual/docbook/programlisting/colorer.scm deleted file mode 100644 index ff1d97f2d..000000000 --- a/manual/docbook/programlisting/colorer.scm +++ /dev/null @@ -1,131 +0,0 @@ -; $Id: colorer.scm,v 1.8 2006/04/29 04:49:48 olpa Exp $ - -; construct a tree from the text and path -; "ignore" is a list of path element which shouldn't be added to the tree -; each path item is either symbol, which is the node name, -; either (symbol (@ ...)), which is the node name and the attribute node. -; It is supposed that elements with attributes aren't in the ignore list. -(define (colorer:path-to-tree text path ignore) - (let loop ((tree text) (path path)) - (if (null? path) - tree - (let ( - (cur (car path)) - (nodeset (cons tree '()))) - (loop - (if (pair? cur) - (append cur nodeset) - (if (memq cur ignore) tree (cons cur nodeset))) - (cdr path)))))) - -; A fragment of the text node handler -(define-macro (%colorer:on-text) - (quote (let loop ((cur cur)) - (let* ( - (len-buf (string-length buf)) - (len-cur (string-length cur)) - (len-min (min len-buf len-cur))) - (if (> len-cur 0) ; the text node in the h-tree isn't finished yet? - (let ( - (result ; result is either a tree, eiter #f - (if (zero? len-buf) ; the text node in the main tree finished? - #f - (colorer:path-to-tree - (substring buf 0 len-min) - path - ignore)))) - ; Update buffer, switch to the main tree traversing, - ; continue h-tree traversing on switching back - (set! buf (substring buf len-min len-buf)) - (call-with-current-continuation (lambda (here) - (set! walker here) - (yield result))) - (loop (substring cur len-min len-cur)))))))) - -; A fragment of the node and attribute handler -(define-macro (%colorer:on-pair) - (quote (let ((elem (car cur))) - (if (eq? elem '@) - ; attribute: attach to the path - (set-car! path (list (car path) cur)) - ; element: update path, continue traversing - (let ((path (cons (car cur) path))) - (for-each - (lambda (kid) (loop kid path)) - (cdr cur))))))) - -; generator of highlighted chunks. -; Creation: -; (define highlighter (colorer:join-markup-stepper highlight-tree ignore)) -; Usage step: -; (highlighter more-buf) -; where more-buf either text, either #f. Each step returns either a -; subtree, either #f if buffer is over. -(define (colorer:join-markup-stepper highlight-tree ignore) - (letrec ( - (buf #f) - (yield #f) - ; The main loop - (walker-loop (lambda (cur path) - (let loop ((cur cur) (path path)) - (if (pair? cur) - (%colorer:on-pair) - (%colorer:on-text))) - ; The highlighting tree is over. Stop looping. - ; If the main tree isn't over (impossible), - ; just return the data from main tree. - (set! walker (lambda (dummy) - (if (and buf (> (string-length buf) 0)) - (let ((old-buf buf)) - (set! buf #f) - (yield old-buf)) - (yield #f)))) - (walker 'dummy))) - ; Set buffer, continue looping - (walker-entry - (lambda (new-buf) - (if new-buf - (set! buf new-buf)) - (call-with-current-continuation (lambda (here) - (set! yield here) - (walker 'resume))))) - ; Use once, than re-set - (walker - (lambda (dummy) - (set! walker walker-loop) - (walker-loop highlight-tree '())))) - ; create generator - walker-entry)) - -; add the colorer namespace to the tree -(define (colorer:wrap-by-ns tree) - `(syn:syntax (@ (@ - (*NAMESPACES* (syn "http://ns.laxan.com/text-vimcolor/1")))) - ,tree)) - -; join main markup with highlighting markup -(define colorer:id (lambda x x)) -(define (colorer:join-markup main-tree highlight-tree ignore) - (let ((stepper (colorer:join-markup-stepper highlight-tree ignore))) - (colorer:wrap-by-ns - ; Walk over the main tree - (pre-post-order main-tree `( - ; Comments, entities etc are not possible, so only few special cases - (*PI* *preorder* . ,colorer:id) - (@ *preorder* . ,colorer:id) - (*default* . ,colorer:id) - ; Text node: split on highlighted subtrees - (*text* . ,(lambda (trigger str) - (let loop ( - (chunks '()) - (tree (stepper str))) - (if tree - ; Loop while trees are being generated - (loop (cons tree chunks) (stepper #f)) - ; The node is processed. If there is only one chunk, return - ; it, otherwise wrap the nodeset of chunks by a dummy - ; element. Handle also impossible case of absense of chunks. - (cond - ((null? chunks) "") - ((null? (cdr chunks)) (car chunks)) - (else (cons 'syn:syntax (reverse chunks))))))))))))) diff --git a/manual/docbook/programlisting/colorer.xsl b/manual/docbook/programlisting/colorer.xsl deleted file mode 100644 index dc6e800f8..000000000 --- a/manual/docbook/programlisting/colorer.xsl +++ /dev/null @@ -1,54 +0,0 @@ - - - -/home/clients/jhassine/doctrine/trunk/manual/docbook/programlisting/vimcolor/vimcolor-wrapper ---format xml ---filetype ---output - - -(load-from-path "sxml-utils.scm") -(load-from-path "colorer.scm") -(load-from-path "run-colorer.scm") - - - - - - - - - - - - - - - - - (let* ( - (highlighted-tree (run-colorer (x:eval "string(.)") (x:eval "string($type)"))) - (current (x:current)) - (united-tree - (if (not highlighted-tree) - #f - (colorer:join-markup current highlighted-tree '())))) - (x:apply-templates - 'with-param 'colorized #t - (if united-tree - united-tree - (colorer:wrap-by-ns current)))) - - - - - - - - - diff --git a/manual/docbook/programlisting/colors/CVS/Entries b/manual/docbook/programlisting/colors/CVS/Entries deleted file mode 100644 index ad1b5e69d..000000000 --- a/manual/docbook/programlisting/colors/CVS/Entries +++ /dev/null @@ -1,3 +0,0 @@ -/Makefile/1.1/Mon May 22 04:24:28 2006// -/vim2xslt.pl/1.1/Mon May 22 04:24:28 2006// -D diff --git a/manual/docbook/programlisting/colors/CVS/Repository b/manual/docbook/programlisting/colors/CVS/Repository deleted file mode 100644 index ad9972d74..000000000 --- a/manual/docbook/programlisting/colors/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -xsieve/experiments/programlisting/colors diff --git a/manual/docbook/programlisting/colors/CVS/Root b/manual/docbook/programlisting/colors/CVS/Root deleted file mode 100644 index d6bc77dba..000000000 --- a/manual/docbook/programlisting/colors/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve diff --git a/manual/docbook/programlisting/colors/Makefile b/manual/docbook/programlisting/colors/Makefile deleted file mode 100644 index ef77aed8f..000000000 --- a/manual/docbook/programlisting/colors/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -vim_colors_dir = /usr/share/vim/colors - -vim_files := $(wildcard $(vim_colors_dir)/*.vim) -xslt_files = $(patsubst %.vim,%.xsl,$(notdir $(vim_files))) - -all: $(xslt_files) - -%.xsl: $(vim_colors_dir)/%.vim - perl vim2xslt.pl $< >$@ diff --git a/manual/docbook/programlisting/colors/vim2xslt.pl b/manual/docbook/programlisting/colors/vim2xslt.pl deleted file mode 100644 index 41cdf9090..000000000 --- a/manual/docbook/programlisting/colors/vim2xslt.pl +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/perl -# Take vim colors file and convert it to an XSLT stylesheet - -# The only types vim-textcolor produces -my %syntax_data = ( - 'Comment' => undef, - 'Constant' => undef, - 'Identifier' => undef, - 'Statement' => undef, - 'PreProc' => undef, - 'Type' => undef, - 'Special' => undef, - 'Underlined' => undef, - 'Error' => undef, - 'Todo' => undef -); diff --git a/manual/docbook/programlisting/id.xsl b/manual/docbook/programlisting/id.xsl deleted file mode 100644 index a08887d36..000000000 --- a/manual/docbook/programlisting/id.xsl +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/manual/docbook/programlisting/index.html b/manual/docbook/programlisting/index.html deleted file mode 100644 index af1d6ad0a..000000000 --- a/manual/docbook/programlisting/index.html +++ /dev/null @@ -1,58 +0,0 @@ - - -Syntax highlighting for DocBook program listings - - -

Syntax highlighting for DocBook program listings

-

Highlight content of ProgramListing using XSieve and Vim. Example:

- - - - - - - - - -
DocBook -
<programlisting role="xml">
-&lt;para>Hello, <emphasis>&amp;who;</emphasis
- >!&lt;/para> <co id="who-entity"/>
-</programlisting>
-
HTML result    -
-<para>Hello, &who;!</para> (1)
-
- -Download xsieve-programlisting.zip. - -

Usage

- -

Set the correct path to the script vimcolor-wrapper in colorer.xsl.

- -

Create an XSLT wrapper which imports DocBook and colorer stylesheets:

- -
-<xsl:stylesheet ...>
-...
-<xsl:import href="..../docbook.xsl">       (1)
-<xsl:import href="..../colorer.xsl">       (2)
-<xsl:import href="..../colorer-html.xsl">  (3)
-
-... Your DocBook customization layer ...
-
-</xsl:stylesheet>
-
- -

(1) The path to the DocBook XSLT stylesheet. For example, /usr/share/xml/docbook/xsl-stylesheets/html/docbook.xsl
-(2) The path to the colorer XSLT stylesheet.
-(3) Or colorer-fo.xsl for FO output.

- -

Test data

- -

The package contains test files test.xml, testdoc.xsl and testdoc.html. Use them as the starting point:

- -
xsieve -o testdoc.html --param callout.graphics 0 testdoc.xsl test.xml
- - - diff --git a/manual/docbook/programlisting/mkdist.sh b/manual/docbook/programlisting/mkdist.sh deleted file mode 100644 index 5851cf3f8..000000000 --- a/manual/docbook/programlisting/mkdist.sh +++ /dev/null @@ -1,6 +0,0 @@ -rm -rf xsieve-programlisting.zip xsieve-programlisting -mkdir xsieve-programlisting -rsync -av --exclude CVS vimcolor xsieve-programlisting/ -cp colorer.xsl colorer-html.xsl testdoc.xsl index.html sxml-utils.scm colorer.scm run-colorer.scm test.xml testdoc.html xsieve-programlisting/ -zip xsieve-programlisting.zip -r xsieve-programlisting - diff --git a/manual/docbook/programlisting/run-colorer.scm b/manual/docbook/programlisting/run-colorer.scm deleted file mode 100644 index b4b40afde..000000000 --- a/manual/docbook/programlisting/run-colorer.scm +++ /dev/null @@ -1,51 +0,0 @@ -; Run colorer and return the result as SXML -; $Id: run-colorer.scm,v 1.6 2006/04/29 05:47:24 olpa Exp $ - -(define colorer-bin #f) -(define colorer-params #f) -(define colorer-param-type #f) -(define colorer-param-outfile #f) - -; Initialize colorer variables (only once) -(define (init-colorer-variables) - (if (not colorer-bin) (begin - (set! colorer-bin (x:eval "string($colorer.bin)")) - (set! colorer-params (x:eval "string($colorer.params)")) - (set! colorer-param-type (x:eval "string($colorer.param.type)")) - (set! colorer-param-outfile (x:eval "string($colorer.param.outfile)"))))) - -(define-macro (no-errors . body) - `(catch #t (lambda () ,@body) (lambda (dummy . args) #f))) - -(define (run-colorer program-text program-type) - ; Some sanity check - (init-colorer-variables) - (if (not (and program-text (> (string-length program-text) 0))) - #f - (let* ( - ; Construct command line to run the colorer - (infile (tmpnam)) ; for the program text - (outfile (tmpnam)) ; for the colored tokens - (cmdline (string-append - colorer-bin " " colorer-params " " - (if (and program-type (> (string-length program-type) 0)) - (string-append colorer-param-type program-type " ") - "") - colorer-param-outfile outfile " " infile))) - ;(display "Command line: ")(display cmdline)(newline) - ; Ignore errors - (no-errors - ; Write the program text to the file and execute the colorer - (with-output-to-file infile - (lambda () (display program-text))) - ;(system (string-append "cp " infile " lastin")) ; DEBUG - (system cmdline) - ;(system (string-append "cp " outfile " last")) ; DEBUG - ; Load the XML result, cleanup and return the result - (let* ( - (eval-str (string-append "document('file://" outfile "')")) - (tree (x:eval eval-str))) - (no-errors (delete-file outfile)) - (no-errors (delete-file infile)) - ; drop "*TOP*" and drop namespace declaration from "syn:syntax" - (cons 'syn:syntax (cdr (cdadar tree)))))))) diff --git a/manual/docbook/programlisting/run.sh b/manual/docbook/programlisting/run.sh deleted file mode 100644 index 277dd5f20..000000000 --- a/manual/docbook/programlisting/run.sh +++ /dev/null @@ -1 +0,0 @@ -~/p/xsieve/opt/bin/xsieve --xinclude -o testdoc.html testdoc.xsl testdoc.xml diff --git a/manual/docbook/programlisting/run2.sh b/manual/docbook/programlisting/run2.sh deleted file mode 100644 index 7150b7268..000000000 --- a/manual/docbook/programlisting/run2.sh +++ /dev/null @@ -1,2 +0,0 @@ -#~/p/xsieve/opt/bin/xsieve --xinclude -o testdoc.html testdoc.xsl /home/olpa/p/xsieve/doc/book/xsieve.xml -~/p/xsieve/opt/bin/xsieve -o testdoc.html testdoc.xsl xsieve.xml diff --git a/manual/docbook/programlisting/run3.sh b/manual/docbook/programlisting/run3.sh deleted file mode 100644 index 72bc7787f..000000000 --- a/manual/docbook/programlisting/run3.sh +++ /dev/null @@ -1 +0,0 @@ -~/p/xsieve/opt/bin/xsieve --xinclude -o testdoc.html colorer-one.xsl /home/olpa/p/xsieve/example/hello/doc/listing2.xml diff --git a/manual/docbook/programlisting/run4.sh b/manual/docbook/programlisting/run4.sh deleted file mode 100644 index 5c8215d0f..000000000 --- a/manual/docbook/programlisting/run4.sh +++ /dev/null @@ -1,2 +0,0 @@ -#~/p/xsieve/opt/bin/xsieve --xinclude -o testdoc.html testdoc.xsl /home/olpa/p/xsieve/doc/book/xsieve.xml -~/p/xsieve/opt/bin/xsieve -o testdoc.html --param callout.graphics 0 testdoc.xsl /home/olpa/p/xsieve/doc/project/xtech2006/programlisting/test.xml diff --git a/manual/docbook/programlisting/sxml-utils.scm b/manual/docbook/programlisting/sxml-utils.scm deleted file mode 100644 index 1b42fd514..000000000 --- a/manual/docbook/programlisting/sxml-utils.scm +++ /dev/null @@ -1,35 +0,0 @@ -; $Id: sxml-utils.scm,v 1.1 2006/03/02 04:32:58 olpa Exp $ -; A copy-paste of a part of the SXML library - -; from CVS: SSAX/lib/SXML-tree-trans.scm -(define (pre-post-order tree bindings) - (let* ((default-binding (assq '*default* bindings)) - (text-binding (or (assq '*text* bindings) default-binding)) - (text-handler ; Cache default and text bindings - (and text-binding - (if (procedure? (cdr text-binding)) - (cdr text-binding) (cddr text-binding))))) - (let loop ((tree tree)) - (cond - ((null? tree) '()) - ((not (pair? tree)) - (let ((trigger '*text*)) - (if text-handler (text-handler trigger tree) - (error "Unknown binding for " trigger " and no default")))) - ((not (symbol? (car tree))) (map loop tree)) ; tree is a nodelist - (else ; tree is an SXML node - (let* ((trigger (car tree)) - (binding (or (assq trigger bindings) default-binding))) - (cond - ((not binding) - (error "Unknown binding for " trigger " and no default")) - ((not (pair? (cdr binding))) ; must be a procedure: handler - (apply (cdr binding) trigger (map loop (cdr tree)))) - ((eq? '*preorder* (cadr binding)) - (apply (cddr binding) tree)) - ((eq? '*macro* (cadr binding)) - (loop (apply (cddr binding) tree))) - (else ; (cadr binding) is a local binding - (apply (cddr binding) trigger - (pre-post-order (cdr tree) (append (cadr binding) bindings))) - )))))))) diff --git a/manual/docbook/programlisting/test-one.scm b/manual/docbook/programlisting/test-one.scm deleted file mode 100644 index d63d38e06..000000000 --- a/manual/docbook/programlisting/test-one.scm +++ /dev/null @@ -1,13 +0,0 @@ -(load "sxml-utils.scm") -(load "colorer.scm") - -(define main-tree '(programlisting (*PI* a "b") (@ (format "linespecific")) "
- Hello - Hello World! -
")) - -(define h-tree "") - -(define result (colorer:join-markup main-tree h-tree '(h))) - -(write result) diff --git a/manual/docbook/programlisting/test.scm b/manual/docbook/programlisting/test.scm deleted file mode 100644 index aa7db8615..000000000 --- a/manual/docbook/programlisting/test.scm +++ /dev/null @@ -1,16 +0,0 @@ -; $Id: test.scm,v 1.2 2006/03/02 06:01:06 olpa Exp $ - -(define (test-case main-tree h-tree expected-result) - (display "------- Running a test case...") - (let ((result (caddr (colorer:join-markup main-tree h-tree '(h))))) - (if (equal? result expected-result) - (begin - (display "Ok")(newline)) - (begin - (display "Error")(newline) - (display "Expected: ")(write expected-result)(newline) - (display "Result: ")(write result)(newline))))) - -(load "sxml-utils.scm") -(load "colorer.scm") -(load "testdata.scm") diff --git a/manual/docbook/programlisting/test.xml b/manual/docbook/programlisting/test.xml deleted file mode 100644 index e4e101224..000000000 --- a/manual/docbook/programlisting/test.xml +++ /dev/null @@ -1,9 +0,0 @@ - -
- Testing Syntax Highlighting - Testing syntax highlighting - -<para>Hello, &who;!</para> - -
diff --git a/manual/docbook/programlisting/testdata.scm b/manual/docbook/programlisting/testdata.scm deleted file mode 100644 index 966d2efe1..000000000 --- a/manual/docbook/programlisting/testdata.scm +++ /dev/null @@ -1,65 +0,0 @@ -; test cases for joining parallel markup -; $Id: testdata.scm,v 1.2 2006/03/02 05:58:55 olpa Exp $ -; (test-case in-xml also-xml joined-xml) - -; the simplest test, no highlighting at all -(test-case - '(i "012") - '(h "012") - '(i "012")) - -; the simplest test, some highlighting -(test-case - '(i "012") - '(h "0" (a "1") "2") - '(i (colorer:dummy "0" (a "1") "2"))) - -; the size of text is different -(test-case - '(i "0123456789") - '(h (a "01") "234" (b "56") "7") - '(i (colorer:dummy (a "01") "234" (b "56") "7" "89"))) - -(test-case - '(i "01234567") - '(h "0" (a "12") "345" (b "5789")) - '(i (colorer:dummy "0" (a "12") "345" (b "67")))) - -; the text of the main tree is not corrupted -(test-case - '(i "012345") - '(h "ab" (c "cd") "ef") - '(i (colorer:dummy "01" (c "23") "45"))) - -; attributes are saved -(test-case - '(i "012345") - '(h "01" - (a (@ (a1 "a1") (a2 "a2")) - (b (@ (b1 "b1") (b2 "b2")) - "23")) - "45") - '(i (colorer:dummy "01" - (a (@ (a1 "a1") (a2 "a2")) - (b (@ (b1 "b1") (b2 "b2")) - "23")) - "45"))) - -; ordering and nesting of empty tags -(test-case - '(i "012" (x (y)) (z) "34") - '(h "01" (a "23") "4") - '(i (colorer:dummy "01" (a "2")) (x (y)) (z) (colorer:dummy (a "3") "4"))) - -; intersecting at left -(test-case - '(i "01" (a "2345" (b "67"))) - '(h "012" (x (y "3456")) "7") - '(i "01" (a (colorer:dummy "2" (x (y "345"))) (b (colorer:dummy (x (y "6")) "7"))))) - -; intersecting at right -(test-case - '(i "01" (a "23" (b "45") "6") "78") - '(h "01234" (x (y "56")) "78") - '(i "01" (a "23" (b (colorer:dummy "4" (x (y "5")))) (x (y "6"))) "78")) - diff --git a/manual/docbook/programlisting/testdoc.html b/manual/docbook/programlisting/testdoc.html deleted file mode 100644 index 6e0b7839c..000000000 --- a/manual/docbook/programlisting/testdoc.html +++ /dev/null @@ -1,5 +0,0 @@ - - -Article with code

Article with code


A sample code:

Example 1. 

Testing Syntax Highlighting


Testing syntax highlighting

-<para>Hello, &who;!</para> 1
-

diff --git a/manual/docbook/programlisting/testdoc.xml b/manual/docbook/programlisting/testdoc.xml deleted file mode 100644 index e042e5e64..000000000 --- a/manual/docbook/programlisting/testdoc.xml +++ /dev/null @@ -1,7 +0,0 @@ -
- Article with code - A sample code: - - - -
diff --git a/manual/docbook/programlisting/testdoc.xsl b/manual/docbook/programlisting/testdoc.xsl deleted file mode 100644 index 9e04280f9..000000000 --- a/manual/docbook/programlisting/testdoc.xsl +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/manual/docbook/programlisting/vimcolor/CVS/Entries b/manual/docbook/programlisting/vimcolor/CVS/Entries deleted file mode 100644 index f27b0ee20..000000000 --- a/manual/docbook/programlisting/vimcolor/CVS/Entries +++ /dev/null @@ -1,6 +0,0 @@ -/README/1.1/Fri Apr 28 07:09:09 2006// -/README-Path-Class/1.1/Fri Apr 28 07:09:09 2006// -/README-Text-VimColor/1.1/Fri Apr 28 07:09:09 2006// -/text-vimcolor/1.1/Fri Apr 28 07:09:09 2006// -/vimcolor-wrapper/1.1/Fri Apr 28 07:09:09 2006// -D/lib//// diff --git a/manual/docbook/programlisting/vimcolor/CVS/Repository b/manual/docbook/programlisting/vimcolor/CVS/Repository deleted file mode 100644 index 53ac94a43..000000000 --- a/manual/docbook/programlisting/vimcolor/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -xsieve/experiments/programlisting/vimcolor diff --git a/manual/docbook/programlisting/vimcolor/CVS/Root b/manual/docbook/programlisting/vimcolor/CVS/Root deleted file mode 100644 index d6bc77dba..000000000 --- a/manual/docbook/programlisting/vimcolor/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve diff --git a/manual/docbook/programlisting/vimcolor/README b/manual/docbook/programlisting/vimcolor/README deleted file mode 100644 index de5a14f1b..000000000 --- a/manual/docbook/programlisting/vimcolor/README +++ /dev/null @@ -1,8 +0,0 @@ -Command-line syntax highlighting based on vim - -It uses Perl modules Text::VimColor and Path::Class. -Perl libraries of these modules are copied to "lib". - -The program "vimcolor-wrapper" sets the path to the -local copy of the libraries and runs the original -script "text-vimcolor". diff --git a/manual/docbook/programlisting/vimcolor/README-Path-Class b/manual/docbook/programlisting/vimcolor/README-Path-Class deleted file mode 100644 index 194b5f396..000000000 --- a/manual/docbook/programlisting/vimcolor/README-Path-Class +++ /dev/null @@ -1,127 +0,0 @@ -NAME - Path::Class - Cross-platform path specification manipulation - -SYNOPSIS - use Path::Class; - - my $dir = dir('foo', 'bar'); # Path::Class::Dir object - my $file = file('bob', 'file.txt'); # Path::Class::File object - - # Stringifies to 'foo/bar' on Unix, 'foo\bar' on Windows, etc. - print "dir: $dir\n"; - - # Stringifies to 'bob/file.txt' on Unix, 'bob\file.txt' on Windows - print "file: $file\n"; - - my $subdir = $dir->subdir('baz'); # foo/bar/baz - my $parent = $subdir->parent; # foo/bar - my $parent2 = $parent->parent; # foo - - my $dir2 = $file->dir; # bob - - # Work with foreign paths - use Path::Class qw(foreign_file foreign_dir); - my $file = foreign_file('Mac', ':foo:file.txt'); - print $file->dir; # :foo: - print $file->as_foreign('Win32'); # foo\file.txt - - # Interact with the underlying filesystem: - - # $dir_handle is an IO::Dir object - my $dir_handle = $dir->open or die "Can't read $dir: $!"; - - # $file_handle is an IO::File object - my $file_handle = $file->open($mode) or die "Can't read $file: $!"; - -DESCRIPTION - `Path::Class' is a module for manipulation of file and directory - specifications (strings describing their locations, like - `'/home/ken/foo.txt'' or `'C:\Windows\Foo.txt'') in a cross-platform - manner. It supports pretty much every platform Perl runs on, including - Unix, Windows, Mac, VMS, Epoc, Cygwin, OS/2, and NetWare. - - The well-known module `File::Spec' also provides this service, but it's - sort of awkward to use well, so people sometimes avoid it, or use it in - a way that won't actually work properly on platforms significantly - different than the ones they've tested their code on. - - In fact, `Path::Class' uses `File::Spec' internally, wrapping all the - unsightly details so you can concentrate on your application code. - Whereas `File::Spec' provides functions for some common path - manipulations, `Path::Class' provides an object-oriented model of the - world of path specifications and their underlying semantics. - `File::Spec' doesn't create any objects, and its classes represent the - different ways in which paths must be manipulated on various platforms - (not a very intuitive concept). `Path::Class' creates objects - representing files and directories, and provides methods that relate - them to each other. For instance, the following `File::Spec' code: - - my $absolute = File::Spec->file_name_is_absolute( - File::Spec->catfile( @dirs, $file ) - ); - - can be written using `Path::Class' as - - my $absolute = Path::Class::File->new( @dirs, $file )->is_absolute; - - or even as - - my $absolute = file( @dirs, $file )->is_absolute; - - Similar readability improvements should happen all over the place when - using `Path::Class'. - - Using `Path::Class' can help solve real problems in your code too - for - instance, how many people actually take the "volume" (like `C:' on - Windows) into account when writing `File::Spec'-using code? I thought - not. But if you use `Path::Class', your file and directory objects will - know what volumes they refer to and do the right thing. - - The guts of the `Path::Class' code live in the `Path::Class::File' and - `Path::Class::Dir' modules, so please see those modules' documentation - for more details about how to use them. - - EXPORT - - The following functions are exported by default. - - file - A synonym for `Path::Class::File->new'. - - dir A synonym for `Path::Class::Dir->new'. - - If you would like to prevent their export, you may explicitly pass an - empty list to perl's `use', i.e. `use Path::Class ()'. - - The following are exported only on demand. - - foreign_file - A synonym for `Path::Class::File->new_foreign'. - - foreign_dir - A synonym for `Path::Class::Dir->new_foreign'. - -Notes on Cross-Platform Compatibility - Although it is much easier to write cross-platform-friendly code with - this module than with `File::Spec', there are still some issues to be - aware of. - - * Some platforms, notably VMS and some older versions of DOS (I - think), all filenames must have an extension. Thus if you create a - file called foo/bar and then ask for a list of files in the - directory foo, you may find a file called bar. instead of the bar - you were expecting. Thus it might be a good idea to use an extension - in the first place. - -AUTHOR - Ken Williams, KWILLIAMS@cpan.org - -COPYRIGHT - Copyright (c) Ken Williams. All rights reserved. - - This library is free software; you can redistribute it and/or modify it - under the same terms as Perl itself. - -SEE ALSO - Path::Class::Dir, Path::Class::File, File::Spec - diff --git a/manual/docbook/programlisting/vimcolor/README-Text-VimColor b/manual/docbook/programlisting/vimcolor/README-Text-VimColor deleted file mode 100644 index 38b37e8d0..000000000 --- a/manual/docbook/programlisting/vimcolor/README-Text-VimColor +++ /dev/null @@ -1,25 +0,0 @@ -Text::VimColor --------------- - -This module tries to markup text files according to their syntax. It can -be used to produce web pages with pretty-printed colourful source code -samples. It can produce output in the following formats: - -The module comes with a command line program, text-vimcolor, which makes -it easy to do 'ad-hoc' syntax coloring jobs. - - - Geoff Richards - - -Release procedure ------------------ - - * Update the version number in lib/Text/VimColor.pm and META.yml - * Update the changelog with a new section for a matching version number - and the correct date and time - * Copy the ChangeLog into place (from 'debian' directory in my CVS) - * Realclean, make and test - * Make the dist, take it to another machine and build and test there - * Commit everything, and set tag like 'Release_0_07-1' - * Upload to CPAN diff --git a/manual/docbook/programlisting/vimcolor/lib/CVS/Entries b/manual/docbook/programlisting/vimcolor/lib/CVS/Entries deleted file mode 100644 index cc0a28410..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/CVS/Entries +++ /dev/null @@ -1,2 +0,0 @@ -D/Path//// -D/Text//// diff --git a/manual/docbook/programlisting/vimcolor/lib/CVS/Repository b/manual/docbook/programlisting/vimcolor/lib/CVS/Repository deleted file mode 100644 index 43c4fcd3b..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -xsieve/experiments/programlisting/vimcolor/lib diff --git a/manual/docbook/programlisting/vimcolor/lib/CVS/Root b/manual/docbook/programlisting/vimcolor/lib/CVS/Root deleted file mode 100644 index d6bc77dba..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve diff --git a/manual/docbook/programlisting/vimcolor/lib/Path/CVS/Entries b/manual/docbook/programlisting/vimcolor/lib/Path/CVS/Entries deleted file mode 100644 index 7166213fb..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Path/CVS/Entries +++ /dev/null @@ -1,2 +0,0 @@ -/Class.pm/1.1/Fri Apr 28 07:17:33 2006// -D/Class//// diff --git a/manual/docbook/programlisting/vimcolor/lib/Path/CVS/Repository b/manual/docbook/programlisting/vimcolor/lib/Path/CVS/Repository deleted file mode 100644 index 43ef3dddb..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Path/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -xsieve/experiments/programlisting/vimcolor/lib/Path diff --git a/manual/docbook/programlisting/vimcolor/lib/Path/CVS/Root b/manual/docbook/programlisting/vimcolor/lib/Path/CVS/Root deleted file mode 100644 index d6bc77dba..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Path/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve diff --git a/manual/docbook/programlisting/vimcolor/lib/Path/Class.pm b/manual/docbook/programlisting/vimcolor/lib/Path/Class.pm deleted file mode 100644 index 3829279df..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Path/Class.pm +++ /dev/null @@ -1,177 +0,0 @@ -package Path::Class; - -$VERSION = '0.15'; -@ISA = qw(Exporter); -@EXPORT = qw(file dir); -@EXPORT_OK = qw(file dir foreign_file foreign_dir); - -use strict; -use Exporter; -use Path::Class::File; -use Path::Class::Dir; - -sub file { Path::Class::File->new(@_) } -sub dir { Path::Class::Dir ->new(@_) } -sub foreign_file { Path::Class::File->new_foreign(@_) } -sub foreign_dir { Path::Class::Dir ->new_foreign(@_) } - - -1; -__END__ - -=head1 NAME - -Path::Class - Cross-platform path specification manipulation - -=head1 SYNOPSIS - - use Path::Class; - - my $dir = dir('foo', 'bar'); # Path::Class::Dir object - my $file = file('bob', 'file.txt'); # Path::Class::File object - - # Stringifies to 'foo/bar' on Unix, 'foo\bar' on Windows, etc. - print "dir: $dir\n"; - - # Stringifies to 'bob/file.txt' on Unix, 'bob\file.txt' on Windows - print "file: $file\n"; - - my $subdir = $dir->subdir('baz'); # foo/bar/baz - my $parent = $subdir->parent; # foo/bar - my $parent2 = $parent->parent; # foo - - my $dir2 = $file->dir; # bob - - # Work with foreign paths - use Path::Class qw(foreign_file foreign_dir); - my $file = foreign_file('Mac', ':foo:file.txt'); - print $file->dir; # :foo: - print $file->as_foreign('Win32'); # foo\file.txt - - # Interact with the underlying filesystem: - - # $dir_handle is an IO::Dir object - my $dir_handle = $dir->open or die "Can't read $dir: $!"; - - # $file_handle is an IO::File object - my $file_handle = $file->open($mode) or die "Can't read $file: $!"; - -=head1 DESCRIPTION - -C is a module for manipulation of file and directory -specifications (strings describing their locations, like -C<'/home/ken/foo.txt'> or C<'C:\Windows\Foo.txt'>) in a cross-platform -manner. It supports pretty much every platform Perl runs on, -including Unix, Windows, Mac, VMS, Epoc, Cygwin, OS/2, and NetWare. - -The well-known module C also provides this service, but -it's sort of awkward to use well, so people sometimes avoid it, or use -it in a way that won't actually work properly on platforms -significantly different than the ones they've tested their code on. - -In fact, C uses C internally, wrapping all -the unsightly details so you can concentrate on your application code. -Whereas C provides functions for some common path -manipulations, C provides an object-oriented model of the -world of path specifications and their underlying semantics. -C doesn't create any objects, and its classes represent -the different ways in which paths must be manipulated on various -platforms (not a very intuitive concept). C creates -objects representing files and directories, and provides methods that -relate them to each other. For instance, the following C -code: - - my $absolute = File::Spec->file_name_is_absolute( - File::Spec->catfile( @dirs, $file ) - ); - -can be written using C as - - my $absolute = Path::Class::File->new( @dirs, $file )->is_absolute; - -or even as - - my $absolute = file( @dirs, $file )->is_absolute; - -Similar readability improvements should happen all over the place when -using C. - -Using C can help solve real problems in your code too - -for instance, how many people actually take the "volume" (like C -on Windows) into account when writing C-using code? I -thought not. But if you use C, your file and directory objects -will know what volumes they refer to and do the right thing. - -The guts of the C code live in the C -and C modules, so please see those -modules' documentation for more details about how to use them. - -=head2 EXPORT - -The following functions are exported by default. - -=over 4 - -=item file - -A synonym for C<< Path::Class::File->new >>. - -=item dir - -A synonym for C<< Path::Class::Dir->new >>. - -=back - -If you would like to prevent their export, you may explicitly pass an -empty list to perl's C, i.e. C. - -The following are exported only on demand. - -=over 4 - -=item foreign_file - -A synonym for C<< Path::Class::File->new_foreign >>. - -=item foreign_dir - -A synonym for C<< Path::Class::Dir->new_foreign >>. - -=back - -=head1 Notes on Cross-Platform Compatibility - -Although it is much easier to write cross-platform-friendly code with -this module than with C, there are still some issues to be -aware of. - -=over 4 - -=item * - -Some platforms, notably VMS and some older versions of DOS (I think), -all filenames must have an extension. Thus if you create a file -called F and then ask for a list of files in the directory -F, you may find a file called F instead of the F you -were expecting. Thus it might be a good idea to use an extension in -the first place. - -=back - -=head1 AUTHOR - -Ken Williams, KWILLIAMS@cpan.org - -=head1 COPYRIGHT - -Copyright (c) Ken Williams. All rights reserved. - -This library is free software; you can redistribute it and/or -modify it under the same terms as Perl itself. - - -=head1 SEE ALSO - -Path::Class::Dir, Path::Class::File, File::Spec - -=cut diff --git a/manual/docbook/programlisting/vimcolor/lib/Path/Class/CVS/Entries b/manual/docbook/programlisting/vimcolor/lib/Path/Class/CVS/Entries deleted file mode 100644 index 7414cc4c0..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Path/Class/CVS/Entries +++ /dev/null @@ -1,4 +0,0 @@ -/Dir.pm/1.1/Fri Apr 28 07:17:33 2006// -/Entity.pm/1.1/Fri Apr 28 07:17:33 2006// -/File.pm/1.1/Fri Apr 28 07:17:33 2006// -D diff --git a/manual/docbook/programlisting/vimcolor/lib/Path/Class/CVS/Repository b/manual/docbook/programlisting/vimcolor/lib/Path/Class/CVS/Repository deleted file mode 100644 index 806095ae4..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Path/Class/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -xsieve/experiments/programlisting/vimcolor/lib/Path/Class diff --git a/manual/docbook/programlisting/vimcolor/lib/Path/Class/CVS/Root b/manual/docbook/programlisting/vimcolor/lib/Path/Class/CVS/Root deleted file mode 100644 index d6bc77dba..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Path/Class/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve diff --git a/manual/docbook/programlisting/vimcolor/lib/Path/Class/Dir.pm b/manual/docbook/programlisting/vimcolor/lib/Path/Class/Dir.pm deleted file mode 100644 index 2fe96a497..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Path/Class/Dir.pm +++ /dev/null @@ -1,584 +0,0 @@ -package Path::Class::Dir; - -use strict; -use Path::Class::File; -use Path::Class::Entity; -use Carp(); -use base qw(Path::Class::Entity); - -use IO::Dir (); -use File::Path (); - -sub new { - my $self = shift->SUPER::new(); - my $s = $self->_spec; - - my $first = (@_ == 0 ? $s->curdir : - $_[0] eq '' ? (shift, $s->rootdir) : - shift() - ); - - ($self->{volume}, my $dirs) = $s->splitpath( $s->canonpath($first) , 1); - $self->{dirs} = [$s->splitdir($s->catdir($dirs, @_))]; - - return $self; -} - -sub is_dir { 1 } - -sub as_foreign { - my ($self, $type) = @_; - - my $foreign = do { - local $self->{file_spec_class} = $self->_spec_class($type); - $self->SUPER::new; - }; - - # Clone internal structure - $foreign->{volume} = $self->{volume}; - my ($s, $fs) = ($self->_spec, $foreign->_spec); - $foreign->{dirs} = [ map {$_ eq $s->updir ? $fs->updir : $_} @{$self->{dirs}}]; - return $foreign; -} - -sub stringify { - my $self = shift; - my $s = $self->_spec; - return $s->catpath($self->{volume}, - $s->catdir(@{$self->{dirs}}), - ''); -} - -sub volume { shift()->{volume} } - -sub file { - local $Path::Class::Foreign = $_[0]->{file_spec_class} if $_[0]->{file_spec_class}; - return Path::Class::File->new(@_); -} - -sub dir_list { - my $self = shift; - my $d = $self->{dirs}; - return @$d unless @_; - - my $offset = shift; - if ($offset < 0) { $offset = $#$d + $offset + 1 } - - return wantarray ? @$d[$offset .. $#$d] : $d->[$offset] unless @_; - - my $length = shift; - if ($length < 0) { $length = $#$d + $length + 1 - $offset } - return @$d[$offset .. $length + $offset - 1]; -} - -sub subdir { - my $self = shift; - return $self->new($self, @_); -} - -sub parent { - my $self = shift; - my $dirs = $self->{dirs}; - my ($curdir, $updir) = ($self->_spec->curdir, $self->_spec->updir); - - if ($self->is_absolute) { - my $parent = $self->new($self); - pop @{$parent->{dirs}}; - return $parent; - - } elsif ($self eq $curdir) { - return $self->new($updir); - - } elsif (!grep {$_ ne $updir} @$dirs) { # All updirs - return $self->new($self, $updir); # Add one more - - } elsif (@$dirs == 1) { - return $self->new($curdir); - - } else { - my $parent = $self->new($self); - pop @{$parent->{dirs}}; - return $parent; - } -} - -sub relative { - # File::Spec->abs2rel before version 3.13 returned the empty string - # when the two paths were equal - work around it here. - my $self = shift; - my $rel = $self->_spec->abs2rel($self->stringify, @_); - return $self->new( length $rel ? $rel : $self->_spec->curdir ); -} - -sub open { IO::Dir->new(@_) } -sub mkpath { File::Path::mkpath(shift()->stringify, @_) } -sub rmtree { File::Path::rmtree(shift()->stringify, @_) } - -sub remove { - rmdir( shift() ); -} - -sub recurse { - my $self = shift; - my %opts = (preorder => 1, depthfirst => 0, @_); - - my $callback = $opts{callback} - or Carp::croak( "Must provide a 'callback' parameter to recurse()" ); - - my @queue = ($self); - - my $visit_entry; - my $visit_dir = - $opts{depthfirst} && $opts{preorder} - ? sub { - my $dir = shift; - $callback->($dir); - unshift @queue, $dir->children; - } - : $opts{preorder} - ? sub { - my $dir = shift; - $callback->($dir); - push @queue, $dir->children; - } - : sub { - my $dir = shift; - $visit_entry->($_) foreach $dir->children; - $callback->($dir); - }; - - $visit_entry = sub { - my $entry = shift; - if ($entry->is_dir) { $visit_dir->($entry) } # Will call $callback - else { $callback->($entry) } - }; - - while (@queue) { - $visit_entry->( shift @queue ); - } -} - -sub children { - my ($self, %opts) = @_; - - my $dh = $self->open or Carp::croak( "Can't open directory $self: $!" ); - - my @out; - while (my $entry = $dh->read) { - # XXX What's the right cross-platform way to do this? - next if (!$opts{all} && ($entry eq '.' || $entry eq '..')); - push @out, $self->file($entry); - $out[-1] = $self->subdir($entry) if -d $out[-1]; - } - return @out; -} - -sub next { - my $self = shift; - unless ($self->{dh}) { - $self->{dh} = $self->open or Carp::croak( "Can't open directory $self: $!" ); - } - - my $next = $self->{dh}->read; - unless (defined $next) { - delete $self->{dh}; - return undef; - } - - # Figure out whether it's a file or directory - my $file = $self->file($next); - $file = $self->subdir($next) if -d $file; - return $file; -} - -sub subsumes { - my ($self, $other) = @_; - die "No second entity given to subsumes()" unless $other; - - $other = ref($self)->new($other) unless UNIVERSAL::isa($other, __PACKAGE__); - $other = $other->dir unless $other->is_dir; - - if ($self->is_absolute) { - $other = $other->absolute; - } elsif ($other->is_absolute) { - $self = $self->absolute; - } - - $self = $self->cleanup; - $other = $other->cleanup; - - if ($self->volume) { - return 0 unless $other->volume eq $self->volume; - } - - # The root dir subsumes everything - return 1 if $self eq ref($self)->new(''); - - my $i = 0; - while ($i <= $#{ $self->{dirs} }) { - return 0 unless exists $other->{dirs}[$i]; - return 0 if $self->{dirs}[$i] ne $other->{dirs}[$i]; - $i++; - } - return 1; -} - -1; -__END__ - -=head1 NAME - -Path::Class::Dir - Objects representing directories - -=head1 SYNOPSIS - - use Path::Class qw(dir); # Export a short constructor - - my $dir = dir('foo', 'bar'); # Path::Class::Dir object - my $dir = Path::Class::Dir->new('foo', 'bar'); # Same thing - - # Stringifies to 'foo/bar' on Unix, 'foo\bar' on Windows, etc. - print "dir: $dir\n"; - - if ($dir->is_absolute) { ... } - - my $v = $dir->volume; # Could be 'C:' on Windows, empty string - # on Unix, 'Macintosh HD:' on Mac OS - - $dir->cleanup; # Perform logical cleanup of pathname - - my $file = $dir->file('file.txt'); # A file in this directory - my $subdir = $dir->subdir('george'); # A subdirectory - my $parent = $dir->parent; # The parent directory, 'foo' - - my $abs = $dir->absolute; # Transform to absolute path - my $rel = $abs->relative; # Transform to relative path - my $rel = $abs->relative('/foo'); # Relative to /foo - - print $dir->as_foreign('MacOS'); # :foo:bar: - print $dir->as_foreign('Win32'); # foo\bar - - # Iterate with IO::Dir methods: - my $handle = $dir->open; - while (my $file = $handle->read) { - $file = $dir->file($file); # Turn into Path::Class::File object - ... - } - - # Iterate with Path::Class methods: - while (my $file = $dir->next) { - # $file is a Path::Class::File or Path::Class::Dir object - ... - } - - -=head1 DESCRIPTION - -The C class contains functionality for manipulating -directory names in a cross-platform way. - -=head1 METHODS - -=over 4 - -=item $dir = Path::Class::Dir->new( , , ... ) - -=item $dir = dir( , , ... ) - -Creates a new C object and returns it. The -arguments specify names of directories which will be joined to create -a single directory object. A volume may also be specified as the -first argument, or as part of the first argument. You can use -platform-neutral syntax: - - my $dir = dir( 'foo', 'bar', 'baz' ); - -or platform-native syntax: - - my $dir = dir( 'foo/bar/baz' ); - -or a mixture of the two: - - my $dir = dir( 'foo/bar', 'baz' ); - -All three of the above examples create relative paths. To create an -absolute path, either use the platform native syntax for doing so: - - my $dir = dir( '/var/tmp' ); - -or use an empty string as the first argument: - - my $dir = dir( '', 'var', 'tmp' ); - -If the second form seems awkward, that's somewhat intentional - paths -like C or C<\Windows> aren't cross-platform concepts in the -first place (many non-Unix platforms don't have a notion of a "root -directory"), so they probably shouldn't appear in your code if you're -trying to be cross-platform. The first form is perfectly natural, -because paths like this may come from config files, user input, or -whatever. - -As a special case, since it doesn't otherwise mean anything useful and -it's convenient to define this way, C<< Path::Class::Dir->new() >> (or -C) refers to the current directory (C<< File::Spec->curdir >>). -To get the current directory as an absolute path, do C<< -dir()->absolute >>. - -=item $dir->stringify - -This method is called internally when a C object is -used in a string context, so the following are equivalent: - - $string = $dir->stringify; - $string = "$dir"; - -=item $dir->volume - -Returns the volume (e.g. C on Windows, C on Mac OS, -etc.) of the directory object, if any. Otherwise, returns the empty -string. - -=item $dir->is_dir - -Returns a boolean value indicating whether this object represents a -directory. Not surprisingly, C objects always -return false, and C objects always return true. - -=item $dir->is_absolute - -Returns true or false depending on whether the directory refers to an -absolute path specifier (like C or C<\Windows>). - -=item $dir->cleanup - -Performs a logical cleanup of the file path. For instance: - - my $dir = dir('/foo//baz/./foo')->cleanup; - # $dir now represents '/foo/baz/foo'; - -=item $file = $dir->file( , , ..., ) - -Returns a C object representing an entry in C<$dir> -or one of its subdirectories. Internally, this just calls C<< -Path::Class::File->new( @_ ) >>. - -=item $subdir = $dir->subdir( , , ... ) - -Returns a new C object representing a subdirectory -of C<$dir>. - -=item $parent = $dir->parent - -Returns the parent directory of C<$dir>. Note that this is the -I parent, not necessarily the physical parent. It really -means we just chop off entries from the end of the directory list -until we cain't chop no more. If the directory is relative, we start -using the relative forms of parent directories. - -The following code demonstrates the behavior on absolute and relative -directories: - - $dir = dir('/foo/bar'); - for (1..6) { - print "Absolute: $dir\n"; - $dir = $dir->parent; - } - - $dir = dir('foo/bar'); - for (1..6) { - print "Relative: $dir\n"; - $dir = $dir->parent; - } - - ########### Output on Unix ################ - Absolute: /foo/bar - Absolute: /foo - Absolute: / - Absolute: / - Absolute: / - Absolute: / - Relative: foo/bar - Relative: foo - Relative: . - Relative: .. - Relative: ../.. - Relative: ../../.. - -=item @list = $dir->children - -Returns a list of C and/or C -objects listed in this directory, or in scalar context the number of -such objects. Obviously, it is necessary for C<$dir> to -exist and be readable in order to find its children. - -Note that the children are returned as subdirectories of C<$dir>, -i.e. the children of F will be F and F, not -F and F. - -Ordinarily C will not include the I and I -entries C<.> and C<..> (or their equivalents on non-Unix systems), -because that's like I'm-my-own-grandpa business. If you do want all -directory entries including these special ones, pass a true value for -the C parameter: - - @c = $dir->children(); # Just the children - @c = $dir->children(all => 1); # All entries - -=item $abs = $dir->absolute - -Returns a C object representing C<$dir> as an -absolute path. An optional argument, given as either a string or a -C object, specifies the directory to use as the base -of relativity - otherwise the current working directory will be used. - -=item $rel = $dir->relative - -Returns a C object representing C<$dir> as a -relative path. An optional argument, given as either a string or a -C object, specifies the directory to use as the base -of relativity - otherwise the current working directory will be used. - -=item $boolean = $dir->subsumes($other) - -Returns true if this directory spec subsumes the other spec, and false -otherwise. Think of "subsumes" as "contains", but we only look at the -I, not whether C<$dir> actually contains C<$other> on the -filesystem. - -The C<$other> argument may be a C object, a -C object, or a string. In the latter case, we -assume it's a directory. - - # Examples: - dir('foo/bar' )->subsumes(dir('foo/bar/baz')) # True - dir('/foo/bar')->subsumes(dir('/foo/bar/baz')) # True - dir('foo/bar' )->subsumes(dir('bar/baz')) # False - dir('/foo/bar')->subsumes(dir('foo/bar')) # False - - -=item $foreign = $dir->as_foreign($type) - -Returns a C object representing C<$dir> as it would -be specified on a system of type C<$type>. Known types include -C, C, C, C, and C, i.e. anything for which -there is a subclass of C. - -Any generated objects (subdirectories, files, parents, etc.) will also -retain this type. - -=item $foreign = Path::Class::Dir->new_foreign($type, @args) - -Returns a C object representing C<$dir> as it would -be specified on a system of type C<$type>. Known types include -C, C, C, C, and C, i.e. anything for which -there is a subclass of C. - -The arguments in C<@args> are the same as they would be specified in -C. - -=item @list = $dir->dir_list([OFFSET, [LENGTH]]) - -Returns the list of strings internally representing this directory -structure. Each successive member of the list is understood to be an -entry in its predecessor's directory list. By contract, C<< -Path::Class->new( $dir->dir_list ) >> should be equivalent to C<$dir>. - -The semantics of this method are similar to Perl's C or -C functions; they return C elements starting at -C. If C is omitted, returns all the elements starting -at C up to the end of the list. If C is negative, -returns the elements from C onward except for C<-LENGTH> -elements at the end. If C is negative, it counts backward -C elements from the end of the list. If C and -C are both omitted, the entire list is returned. - -In a scalar context, C with no arguments returns the -number of entries in the directory list; C returns -the single element at that offset; C returns -the final element that would have been returned in a list context. - -=item $fh = $dir->open() - -Passes C<$dir> to C<< IO::Dir->open >> and returns the result as an -C object. If the opening fails, C is returned and -C<$!> is set. - -=item $dir->mkpath($verbose, $mode) - -Passes all arguments, including C<$dir>, to C<< File::Path::mkpath() ->> and returns the result (a list of all directories created). - -=item $dir->rmtree($verbose, $cautious) - -Passes all arguments, including C<$dir>, to C<< File::Path::rmtree() ->> and returns the result (the number of files successfully deleted). - -=item $dir->remove() - -Removes the directory, which must be empty. Returns a boolean value -indicating whether or not the directory was successfully removed. -This method is mainly provided for consistency with -C's C method. - -=item $dir_or_file = $dir->next() - -A convenient way to iterate through directory contents. The first -time C is called, it will C the directory and read the -first item from it, returning the result as a C or -C object (depending, of course, on its actual -type). Each subsequent call to C will simply iterate over the -directory's contents, until there are no more items in the directory, -and then the undefined value is returned. For example, to iterate -over all the regular files in a directory: - - while (my $file = $dir->next) { - next unless -f $file; - my $fh = $file->open('r') or die "Can't read $file: $!"; - ... - } - -If an error occurs when opening the directory (for instance, it -doesn't exist or isn't readable), C will throw an exception -with the value of C<$!>. - -=item $dir->recurse( callback => sub {...} ) - -Iterates through this directory and all of its children, and all of -its children's children, etc., calling the C subroutine for -each entry. This is a lot like what the C module does, -and of course C will work fine on C objects, -but the advantage of the C method is that it will also feed -your callback routine C objects rather than just pathname -strings. - -The C method requires a C parameter specifying -the subroutine to invoke for each entry. It will be passed the -C object as its first argument. - -C also accepts two boolean parameters, C and -C that control the order of recursion. The default is a -preorder, breadth-first search, i.e. C<< depthfirst => 0, preorder => 1 >>. -At the time of this writing, all combinations of these two parameters -are supported I C<< depthfirst => 0, preorder => 0 >>. - -=item $st = $file->stat() - -Invokes C<< File::stat::stat() >> on this directory and returns a -C object representing the result. - -=item $st = $file->lstat() - -Same as C, but if C<$file> is a symbolic link, C -stats the link instead of the directory the link points to. - -=back - -=head1 AUTHOR - -Ken Williams, ken@mathforum.org - -=head1 SEE ALSO - -Path::Class, Path::Class::File, File::Spec - -=cut diff --git a/manual/docbook/programlisting/vimcolor/lib/Path/Class/Entity.pm b/manual/docbook/programlisting/vimcolor/lib/Path/Class/Entity.pm deleted file mode 100644 index 44cf4be76..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Path/Class/Entity.pm +++ /dev/null @@ -1,67 +0,0 @@ -package Path::Class::Entity; - -use strict; -use File::Spec; -use File::stat (); - -use overload - ( - q[""] => 'stringify', - fallback => 1, - ); - -sub new { - my $from = shift; - my ($class, $fs_class) = (ref($from) - ? (ref $from, $from->{file_spec_class}) - : ($from, $Path::Class::Foreign)); - return bless {file_spec_class => $fs_class}, $class; -} - -sub is_dir { 0 } - -sub _spec_class { - my ($class, $type) = @_; - - die "Invalid system type '$type'" unless ($type) = $type =~ /^(\w+)$/; # Untaint - my $spec = "File::Spec::$type"; - eval "require $spec; 1" or die $@; - return $spec; -} - -sub new_foreign { - my ($class, $type) = (shift, shift); - local $Path::Class::Foreign = $class->_spec_class($type); - return $class->new(@_); -} - -sub _spec { $_[0]->{file_spec_class} || 'File::Spec' } - -sub is_absolute { - # 5.6.0 has a bug with regexes and stringification that's ticked by - # file_name_is_absolute(). Help it along. - $_[0]->_spec->file_name_is_absolute($_[0]->stringify) -} - -sub cleanup { - my $self = shift; - my $cleaned = $self->new( $self->_spec->canonpath($self) ); - %$self = %$cleaned; - return $self; -} - -sub absolute { - my $self = shift; - return $self if $self->is_absolute; - return $self->new($self->_spec->rel2abs($self->stringify, @_)); -} - -sub relative { - my $self = shift; - return $self->new($self->_spec->abs2rel($self->stringify, @_)); -} - -sub stat { File::stat::stat("$_[0]") } -sub lstat { File::stat::lstat("$_[0]") } - -1; diff --git a/manual/docbook/programlisting/vimcolor/lib/Path/Class/File.pm b/manual/docbook/programlisting/vimcolor/lib/Path/Class/File.pm deleted file mode 100644 index c4d837c0f..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Path/Class/File.pm +++ /dev/null @@ -1,311 +0,0 @@ -package Path::Class::File; - -use strict; -use Path::Class::Dir; -use Path::Class::Entity; -use base qw(Path::Class::Entity); - -use IO::File (); - -sub new { - my $self = shift->SUPER::new; - my $file = pop(); - my @dirs = @_; - - my ($volume, $dirs, $base) = $self->_spec->splitpath($file); - - if (length $dirs) { - push @dirs, $self->_spec->catpath($volume, $dirs, ''); - } - - $self->{dir} = @dirs ? Path::Class::Dir->new(@dirs) : undef; - $self->{file} = $base; - - return $self; -} - -sub as_foreign { - my ($self, $type) = @_; - local $Path::Class::Foreign = $self->_spec_class($type); - my $foreign = ref($self)->SUPER::new; - $foreign->{dir} = $self->{dir}->as_foreign($type) if defined $self->{dir}; - $foreign->{file} = $self->{file}; - return $foreign; -} - -sub stringify { - my $self = shift; - return $self->{file} unless defined $self->{dir}; - return $self->_spec->catfile($self->{dir}->stringify, $self->{file}); -} - -sub dir { - my $self = shift; - return $self->{dir} if defined $self->{dir}; - return Path::Class::Dir->new($self->_spec->curdir); -} -BEGIN { *parent = \&dir; } - -sub volume { - my $self = shift; - return '' unless defined $self->{dir}; - return $self->{dir}->volume; -} - -sub basename { shift->{file} } -sub open { IO::File->new(@_) } - -sub openr { $_[0]->open('r') or die "Can't read $_[0]: $!" } -sub openw { $_[0]->open('w') or die "Can't write $_[0]: $!" } - -sub touch { - my $self = shift; - if (-e $self) { - my $now = time(); - utime $now, $now, $self; - } else { - $self->openw; - } -} - -sub slurp { - my ($self, %args) = @_; - my $fh = $self->openr; - - if ($args{chomped} or $args{chomp}) { - chomp( my @data = <$fh> ); - return wantarray ? @data : join '', @data; - } - - local $/ unless wantarray; - return <$fh>; -} - -sub remove { - my $file = shift->stringify; - return unlink $file unless -e $file; # Sets $! correctly - 1 while unlink $file; - return not -e $file; -} - -1; -__END__ - -=head1 NAME - -Path::Class::File - Objects representing files - -=head1 SYNOPSIS - - use Path::Class qw(file); # Export a short constructor - - my $file = file('foo', 'bar.txt'); # Path::Class::File object - my $file = Path::Class::File->new('foo', 'bar.txt'); # Same thing - - # Stringifies to 'foo/bar.txt' on Unix, 'foo\bar.txt' on Windows, etc. - print "file: $file\n"; - - if ($file->is_absolute) { ... } - - my $v = $file->volume; # Could be 'C:' on Windows, empty string - # on Unix, 'Macintosh HD:' on Mac OS - - $file->cleanup; # Perform logical cleanup of pathname - - my $dir = $file->dir; # A Path::Class::Dir object - - my $abs = $file->absolute; # Transform to absolute path - my $rel = $file->relative; # Transform to relative path - -=head1 DESCRIPTION - -The C class contains functionality for manipulating -file names in a cross-platform way. - -=head1 METHODS - -=over 4 - -=item $file = Path::Class::File->new( , , ..., ) - -=item $file = file( , , ..., ) - -Creates a new C object and returns it. The -arguments specify the path to the file. Any volume may also be -specified as the first argument, or as part of the first argument. -You can use platform-neutral syntax: - - my $dir = file( 'foo', 'bar', 'baz.txt' ); - -or platform-native syntax: - - my $dir = dir( 'foo/bar/baz.txt' ); - -or a mixture of the two: - - my $dir = dir( 'foo/bar', 'baz.txt' ); - -All three of the above examples create relative paths. To create an -absolute path, either use the platform native syntax for doing so: - - my $dir = dir( '/var/tmp/foo.txt' ); - -or use an empty string as the first argument: - - my $dir = dir( '', 'var', 'tmp', 'foo.txt' ); - -If the second form seems awkward, that's somewhat intentional - paths -like C or C<\Windows> aren't cross-platform concepts in the -first place, so they probably shouldn't appear in your code if you're -trying to be cross-platform. The first form is perfectly fine, -because paths like this may come from config files, user input, or -whatever. - -=item $file->stringify - -This method is called internally when a C object is -used in a string context, so the following are equivalent: - - $string = $file->stringify; - $string = "$file"; - -=item $file->volume - -Returns the volume (e.g. C on Windows, C on Mac OS, -etc.) of the object, if any. Otherwise, returns the empty string. - -=item $file->basename - -Returns the name of the file as a string, without the directory -portion (if any). - -=item $file->is_dir - -Returns a boolean value indicating whether this object represents a -directory. Not surprisingly, C objects always -return false, and C objects always return true. - -=item $file->is_absolute - -Returns true or false depending on whether the file refers to an -absolute path specifier (like C or C<\Windows\Foo.txt>). - -=item $file->cleanup - -Performs a logical cleanup of the file path. For instance: - - my $file = file('/foo//baz/./foo.txt')->cleanup; - # $file now represents '/foo/baz/foo.txt'; - -=item $dir = $file->dir - -Returns a C object representing the directory -containing this file. - -=item $dir = $file->parent - -A synonym for the C method. - -=item $abs = $file->absolute - -Returns a C object representing C<$file> as an -absolute path. An optional argument, given as either a string or a -C object, specifies the directory to use as the base -of relativity - otherwise the current working directory will be used. - -=item $rel = $file->relative - -Returns a C object representing C<$file> as a -relative path. An optional argument, given as either a string or a -C object, specifies the directory to use as the base -of relativity - otherwise the current working directory will be used. - -=item $foreign = $file->as_foreign($type) - -Returns a C object representing C<$file> as it would -be specified on a system of type C<$type>. Known types include -C, C, C, C, and C, i.e. anything for which -there is a subclass of C. - -Any generated objects (subdirectories, files, parents, etc.) will also -retain this type. - -=item $foreign = Path::Class::File->new_foreign($type, @args) - -Returns a C object representing a file as it would -be specified on a system of type C<$type>. Known types include -C, C, C, C, and C, i.e. anything for which -there is a subclass of C. - -The arguments in C<@args> are the same as they would be specified in -C. - -=item $fh = $file->open($mode, $permissions) - -Passes the given arguments, including C<$file>, to C<< IO::File->new >> -(which in turn calls C<< IO::File->open >> and returns the result -as an C object. If the opening -fails, C is returned and C<$!> is set. - -=item $fh = $file->openr() - -A shortcut for - - $fh = $file->open('r') or die "Can't read $file: $!"; - -=item $fh = $file->openw() - -A shortcut for - - $fh = $file->open('w') or die "Can't write $file: $!"; - -=item $file->touch - -Sets the modification and access time of the given file to right now, -if the file exists. If it doesn't exist, C will I it -exist, and - YES! - set its modification and access time to now. - -=item $file->slurp() - -In a scalar context, returns the contents of C<$file> in a string. In -a list context, returns the lines of C<$file> (according to how C<$/> -is set) as a list. If the file can't be read, this method will throw -an exception. - -If you want C run on each line of the file, pass a true value -for the C or C parameters: - - my @lines = $file->slurp(chomp => 1); - -=item $file->remove() - -This method will remove the file in a way that works well on all -platforms, and returns a boolean value indicating whether or not the -file was successfully removed. - -C is better than simply calling Perl's C function, -because on some platforms (notably VMS) you actually may need to call -C several times before all versions of the file are gone - -the C method handles this process for you. - -=item $st = $file->stat() - -Invokes C<< File::stat::stat() >> on this file and returns a -C object representing the result. - -=item $st = $file->lstat() - -Same as C, but if C<$file> is a symbolic link, C -stats the link instead of the file the link points to. - -=back - -=head1 AUTHOR - -Ken Williams, ken@mathforum.org - -=head1 SEE ALSO - -Path::Class, Path::Class::Dir, File::Spec - -=cut diff --git a/manual/docbook/programlisting/vimcolor/lib/Text/CVS/Entries b/manual/docbook/programlisting/vimcolor/lib/Text/CVS/Entries deleted file mode 100644 index 34b726339..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Text/CVS/Entries +++ /dev/null @@ -1,2 +0,0 @@ -/VimColor.pm/1.1/Fri Apr 28 07:16:26 2006// -D/VimColor//// diff --git a/manual/docbook/programlisting/vimcolor/lib/Text/CVS/Repository b/manual/docbook/programlisting/vimcolor/lib/Text/CVS/Repository deleted file mode 100644 index 17d6158fa..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Text/CVS/Repository +++ /dev/null @@ -1 +0,0 @@ -xsieve/experiments/programlisting/vimcolor/lib/Text diff --git a/manual/docbook/programlisting/vimcolor/lib/Text/CVS/Root b/manual/docbook/programlisting/vimcolor/lib/Text/CVS/Root deleted file mode 100644 index d6bc77dba..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Text/CVS/Root +++ /dev/null @@ -1 +0,0 @@ -:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve diff --git a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor.pm b/manual/docbook/programlisting/vimcolor/lib/Text/VimColor.pm deleted file mode 100644 index dfca060a0..000000000 --- a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor.pm +++ /dev/null @@ -1,845 +0,0 @@ -package Text::VimColor; -use warnings; -use strict; - -use IO::File; -use File::Copy qw( copy ); -use File::Temp qw( tempfile ); -use Path::Class qw( file ); -use Carp; - -die "Text::VimColor can't see where it's installed" - unless -f __FILE__; -our $SHARED = file(__FILE__)->dir->subdir('VimColor')->stringify; - -our $VERSION = '0.11'; -our $VIM_COMMAND = 'vim'; -our @VIM_OPTIONS = (qw( -RXZ -i NONE -u NONE -N ), "+set nomodeline"); -our $NAMESPACE_ID = 'http://ns.laxan.com/text-vimcolor/1'; - -our %VIM_LET = ( - perl_include_pod => 1, - 'b:is_bash' => 1, -); - -our %SYNTAX_TYPE = ( - Comment => 1, - Constant => 1, - Identifier => 1, - Statement => 1, - PreProc => 1, - Type => 1, - Special => 1, - Underlined => 1, - Error => 1, - Todo => 1, -); - -# Set to true to print the command line used to run Vim. -our $DEBUG = 0; - -sub new -{ - my ($class, %options) = @_; - - $options{vim_command} = $VIM_COMMAND - unless defined $options{vim_command}; - $options{vim_options} = \@VIM_OPTIONS - unless defined $options{vim_options}; - - $options{html_inline_stylesheet} = 1 - unless exists $options{html_inline_stylesheet}; - $options{xml_root_element} = 1 - unless exists $options{xml_root_element}; - - $options{vim_let} = { - %VIM_LET, - (exists $options{vim_let} ? %{$options{vim_let}} : ()), - }; - - croak "only one of the 'file' or 'string' options should be used" - if defined $options{file} && defined $options{string}; - - my $self = bless \%options, $class; - $self->_do_markup - if defined $options{file} || defined $options{string}; - - return $self; -} - -sub vim_let -{ - my ($self, %option) = @_; - - while (my ($name, $value) = each %option) { - $self->{vim_let}->{$name} = $value; - } - - return $self; -} - -sub syntax_mark_file -{ - my ($self, $file, %options) = @_; - - local $self->{filetype} = exists $options{filetype} ? $options{filetype} - : $self->{filetype}; - - local $self->{file} = $file; - $self->_do_markup; - - return $self; -} - -sub syntax_mark_string -{ - my ($self, $string, %options) = @_; - - local $self->{filetype} = exists $options{filetype} ? $options{filetype} - : $self->{filetype}; - - local $self->{string} = $string; - $self->_do_markup; - - return $self; -} - -sub html -{ - my ($self) = @_; - my $syntax = $self->marked; - - my $html = ''; - $html .= $self->_html_header - if $self->{html_full_page}; - - foreach (@$syntax) { - $html .= _xml_escape($_->[1]), next - if $_->[0] eq ''; - - $html .= "[0]\">" . - _xml_escape($_->[1]) . - ''; - } - - $html .= "\n\n \n\n" - if $self->{html_full_page}; - - return $html; -} - -sub xml -{ - my ($self) = @_; - my $syntax = $self->marked; - - my $xml = ''; - if ($self->{xml_root_element}) { - my $filename = $self->input_filename; - $xml .= "[1]), next - if $_->[0] eq ''; - - $xml .= "[0]>" . - _xml_escape($_->[1]) . - "[0]>"; - } - - $xml .= "\n" - if $self->{xml_root_element}; - - return $xml; -} - -sub marked -{ - my ($self) = @_; - - exists $self->{syntax} - or croak "an input file or string must be specified, either to 'new' or". - " 'syntax_mark_file/string'"; - - return $self->{syntax}; -} - -sub input_filename -{ - my ($self) = @_; - - my $file = $self->{file}; - return $file if defined $file && !ref $file; - - return undef; -} - -# Return a string consisting of the start of an XHTML file, with a stylesheet -# either included inline or referenced with a . -sub _html_header -{ - my ($self) = @_; - - my $input_filename = $self->input_filename; - my $title = defined $self->{html_title} ? _xml_escape($self->{html_title}) - : defined $input_filename ? _xml_escape($input_filename) - : '[untitled]'; - - my $stylesheet; - if ($self->{html_inline_stylesheet}) { - $stylesheet = "\n"; - } - else { - $stylesheet = - "{html_stylesheet_url} || - "file://$SHARED/light.css") . - "\" />\n"; - } - - "\n" . - "\n" . - " \n" . - " $title\n" . - " $stylesheet" . - " \n" . - " \n\n" . - "
";
-}
-
-# Return a string safe to put in XML text or attribute values.  It doesn't
-# escape single quotes (') because we don't use those to quote
-# attribute values.
-sub _xml_escape
-{
-   my ($s) = @_;
-   $s =~ s/&/&/g;
-   $s =~ s//>/g;
-   $s =~ s/"/"/g;
-   return $s;
-}
-
-# Actually run Vim and turn the script's output into a datastructure.
-sub _do_markup
-{
-   my ($self) = @_;
-   my $vim_syntax_script = file($SHARED, 'mark.vim')->stringify;
-
-   croak "Text::VimColor syntax script '$vim_syntax_script' not installed"
-      unless -f $vim_syntax_script && -r $vim_syntax_script;
-
-   my $filename = $self->{file};
-   my $input_is_temporary = 0;
-   if (ref $self->{file}) {
-      my $fh;
-      ($fh, $filename) = tempfile();
-      $input_is_temporary = 1;
-
-      binmode $self->{file};
-      binmode $fh;
-      copy($self->{file}, $fh);
-   }
-   elsif (exists $self->{string}) {
-      my $fh;
-      ($fh, $filename) = tempfile();
-      $input_is_temporary = 1;
-
-      binmode $fh;
-      print $fh (ref $self->{string} ? ${$self->{string}} : $self->{string});
-   }
-   else {
-      croak "input file '$filename' not found"
-         unless -f $filename;
-      croak "input file '$filename' not accessible"
-         unless -r $filename;
-   }
-
-   # Create a temp file to put the output in.
-   my ($out_fh, $out_filename) = tempfile();
-
-   # Create a temp file for the 'script', which is given to vim
-   # with the -s option.  This is necessary because it tells Vim not
-   # to delay for 2 seconds after displaying a message.
-   my ($script_fh, $script_filename) = tempfile();
-   my $filetype = $self->{filetype};
-   my $filetype_set = defined $filetype ? ":set filetype=$filetype" : '';
-   my $vim_let = $self->{vim_let};
-   print $script_fh (map { ":let $_=$vim_let->{$_}\n" }
-                     grep { defined $vim_let->{$_} }
-                     keys %$vim_let),
-                    ":filetype on\n",
-                    "$filetype_set\n",
-                    ":source $vim_syntax_script\n",
-                    ":write! $out_filename\n",
-                    ":qall!\n";
-   close $script_fh;
-
-   $self->_run(
-      $self->{vim_command},
-      @{$self->{vim_options}},
-      $filename,
-      '-s', $script_filename,
-   );
-
-   unlink $filename
-      if $input_is_temporary;
-   unlink $out_filename;
-   unlink $script_filename;
-
-   my $data = do { local $/; <$out_fh> };
-
-   # Convert line endings to ones appropriate for the current platform.
-   $data =~ s/\x0D\x0A?/\n/g;
-
-   my $syntax = [];
-   LOOP: {
-      _add_markup($syntax, $1, $2), redo LOOP
-         if $data =~ /\G>(.*?)>(.*?)<\1]+)/cgs;
-   }
-
-   $self->{syntax} = $syntax;
-}
-
-# Given an array ref ($syntax), we add a new syntax chunk to it, unescaping
-# the text and making sure that consecutive chunks of the same type are
-# merged.
-sub _add_markup
-{
-   my ($syntax, $type, $text) = @_;
-
-   # Ignore types we don't know about.  At least one syntax file (xml.vim)
-   # can produce these.  It happens when a syntax type isn't 'linked' to
-   # one of the predefined types.
-   $type = ''
-      unless exists $SYNTAX_TYPE{$type};
-
-   # Unescape ampersands and pointies.
-   $text =~ s/&l//g;
-   $text =~ s/&a/&/g;
-
-   if (@$syntax && $syntax->[-1][0] eq $type) {
-      # Concatenate consecutive bits of the same type.
-      $syntax->[-1][1] .= $text;
-   }
-   else {
-      # A new chunk of marked-up text.
-      push @$syntax, [ $type, $text ];
-   }
-}
-
-# This is a private internal method which runs a program.
-# It takes a list of the program name and arguments.
-sub _run
-{
-   my ($self, $prog, @args) = @_;
-
-   if ($DEBUG) {
-      print STDERR __PACKAGE__."::_run: $prog " .
-            join(' ', map { s/'/'\\''/g; "'$_'" } @args) . "\n";
-   }
-
-   my ($err_fh, $err_filename) = tempfile();
-   my $old_fh = select($err_fh);
-   $| = 1;
-   select($old_fh);
-
-   my $pid = fork;
-   if ($pid) {
-      my $gotpid = waitpid($pid, 0);
-      croak "couldn't run the program '$prog'" if $gotpid == -1;
-      my $error = $? >> 8;
-      if ($error) {
-         seek $err_fh, 0, 0;
-         my $errout = do { local $/; <$err_fh> };
-         $errout =~ s/\n+\z//;
-         close $err_fh;
-         unlink $err_filename;
-         my $details = $errout eq '' ? '' :
-                       "\nVim wrote this error output:\n$errout\n";
-         croak "$prog returned an error code of '$error'$details";
-      }
-      close $err_fh;
-      unlink $err_filename;
-   }
-   else {
-      defined $pid
-         or croak "error forking to run $prog: $!";
-      open STDIN, '/dev/null';
-      open STDOUT, '>/dev/null';
-      open STDERR, '>&=' . fileno($err_fh)
-         or croak "can't connect STDERR to temporary file '$err_filename': $!";
-      exec $prog $prog, @args;
-      die "\n";   # exec() will already have sent a suitable error message.
-   }
-}
-
-1;
-
-__END__
-
-=head1 NAME
-
-Text::VimColor - syntax color text in HTML or XML using Vim
-
-=head1 SYNOPSIS
-
-   use Text::VimColor;
-   my $syntax = Text::VimColor->new(
-      file => $0,
-      filetype => 'perl',
-   );
-
-   print $syntax->html;
-   print $syntax->xml;
-
-=head1 DESCRIPTION
-
-This module tries to markup text files according to their syntax.  It can
-be used to produce web pages with pretty-printed colourful source code
-samples.  It can produce output in the following formats:
-
-=over 4
-
-=item HTML
-
-Valid XHTML 1.0, with the exact colouring and style left to a CSS stylesheet
-
-=item XML
-
-Pieces of text are marked with XML elements in a simple vocabulary,
-which can be converted to other formats, for example, using XSLT
-
-=item Perl array
-
-A simple Perl data structure, so that Perl code can be used to turn it
-into whatever is needed
-
-=back
-
-This module works by running the Vim text editor and getting it to apply its
-excellent syntax highlighting (aka 'font-locking') to an input file, and mark
-pieces of text according to whether it thinks they are comments, keywords,
-strings, etc.  The Perl code then reads back this markup and converts it
-to the desired output format.
-
-This is an object-oriented module.  To use it, create an object with
-the C function (as shown above in the SYNOPSIS) and then call methods
-to get the markup out.
-
-=head1 METHODS
-
-=over 4
-
-=item new(I)
-
-Returns a syntax highlighting object.  Pass it a hash of options.
-
-The following options are recognised:
-
-=over 4
-
-=item file
-
-The file to syntax highlight.  Can be either a filename or an open file handle.
-
-Note that using a filename might allow Vim to guess the file type from its
-name if none is specified explicitly.
-
-If the file isn't specified while creating the object, it can be given later
-in a call to the C method (see below), allowing a single
-Text::VimColor object to be used with multiple input files.
-
-=item string
-
-Use this to pass a string to be used as the input.  This is an alternative
-to the C option.  A reference to a string will also work.
-
-The C method (see below) is another way to use a string
-as input.
-
-=item filetype
-
-Specify the type of file Vim should expect, in case Vim's automatic
-detection by filename or contents doesn't get it right.  This is
-particularly important when providing the file as a string of file
-handle, since Vim won't be able to use the file extension to guess
-the file type.
-
-The filetypes recognised by Vim are short strings like 'perl' or 'lisp'.
-They are the names of files in the 'syntax' directory in the Vim
-distribution.
-
-This option, whether or not it is passed to C, can be overridden
-when calling C and C, so you can
-use the same object to process multiple files of different types.
-
-=item html_full_page
-
-By default the C output method returns a fragment of HTML, not a
-full file.  To make useful output this must be wrapped in a CpreE>
-element and a stylesheet must be included from somewhere.  Setting the
-C option will instead make the C method return a
-complete stand-alone XHTML file.
-
-Note that while this is useful for testing, most of the time you'll want to
-put the syntax highlighted source code in a page with some other content,
-in which case the default output of the C method is more appropriate.
-
-=item html_inline_stylesheet
-
-Turned on by default, but has no effect unless C is also
-enabled.
-
-This causes the CSS stylesheet defining the colours to be used
-to render the markup to be be included in the HTML output, in a
-CstyleE> element.  Turn it off to instead use a ClinkE>
-to reference an external stylesheet (recommended if putting more than one
-page on the web).
-
-=item html_stylesheet
-
-Ignored unless C and C are both
-enabled.
-
-This can be set to a stylesheet to include inline in the HTML output (the
-actual CSS, not the filename of it).
-
-=item html_stylesheet_file
-
-Ignored unless C and C are both
-enabled.
-
-This can be the filename of a stylesheet to copy into the HTML output,
-or a file handle to read one from.  If neither this nor C
-are given, the supplied stylesheet F will be used instead.
-
-=item html_stylesheet_url
-
-Ignored unless C is enabled and C
-is disabled.
-
-This can be used to supply the URL (relative or absolute) or the stylesheet
-to be referenced from the HTML ClinkE> element in the header.
-If this isn't given it will default to using a C URL to reference
-the supplied F stylesheet, which is only really useful for testing.
-
-=item xml_root_element
-
-By default this is true.  If set to a false value, XML output will not be
-wrapped in a root element called , but will be otherwise the
-same.  This could allow XML output for several files to be concatenated,
-but to make it valid XML a root element must be added.  Disabling this
-option will also remove the binding of the namespace prefix C, so
-an C attribute would have to be added elsewhere.
-
-=item vim_command
-
-The name of the executable which will be run to invoke Vim.
-The default is C.
-
-=item vim_options
-
-A reference to an array of options to pass to Vim.  The default options are:
-
-   qw( -RXZ -i NONE -u NONE -N )
-
-=item vim_let
-
-A reference to a hash of options to set in Vim before the syntax file
-is loaded.  Each of these is set using the C<:let> command to the value
-specified.  No escaping is done on the values, they are executed exactly
-as specified.
-
-Values in this hash override some default options.  Use a value of
-C to prevent a default option from being set at all.  The
-defaults are as follows:
-
-   (
-      perl_include_pod => 1,     # Recognize POD inside Perl code
-      'b:is_bash' => 1,          # Allow Bash syntax in shell scripts
-   )
-
-These settings can be modified later with the C method.
-
-=back
-
-=item vim_let(I =E I, ...)
-
-Change the options that are set with the Vim C command when Vim
-is run.  See C for details.
-
-=item syntax_mark_file(I, I)
-
-Mark up the specified file.  Subsequent calls to the output methods will then
-return the markup.  It is not necessary to call this if a C or C
-option was passed to C.
-
-Returns the object it was called on, so an output method can be called
-on it directly:
-
-   my $syntax = Text::VimColor->new(
-      vim_command => '/usr/local/bin/special-vim',
-   );
-
-   foreach (@files) {
-      print $syntax->syntax_mark_file($_)->html;
-   }
-
-You can override the filetype set in new() by passing in a C
-option, like so:
-
-   $syntax->syntax_mark_file($filename, filetype => 'perl');
-
-This option will only affect the syntax colouring for that one call,
-not for any subsequent ones on the same object.
-
-=item syntax_mark_string(I, I)
-
-Does the same as C (see above) but uses a string as input.
-I can also be a reference to a string.
-Returns the object it was called on.  Supports the C option
-just as C does.
-
-=item html()
-
-Return XHTML markup based on the Vim syntax colouring of the input file.
-
-Unless the C option is set, this will only return a fragment
-of HTML, which can then be incorporated into a full page.  The fragment
-will be valid as either HTML and XHTML.
-
-The only markup used for the actual text will be CspanE> elements
-wrapped round appropriate pieces of text.  Each one will have a C
-attribute set to a name which can be tied to a foreground and background
-color in a stylesheet.  The class names used will have the prefix C,
-for example C.  For the full list see the section
-HIGHLIGHTING TYPES below.
-
-=item xml()
-
-Returns markup in a simple XML vocabulary.  Unless the C
-option is turned off (it's on by default) this will produce a complete XML
-document, with all the markup inside a CsyntaxE> element.
-
-This XML output can be transformed into other formats, either using programs
-which read it with an XML parser, or using XSLT.  See the
-text-vimcolor(1) program for an example of how XSLT can be used with
-XSL-FO to turn this into PDF.
-
-The markup will consist of mixed content with elements wrapping pieces
-of text which Vim recognized as being of a particular type.  The names of
-the elements used are the ones listed in the HIGHLIGHTING TYPES section
-below.
-
-The CsyntaxE> element will declare the namespace for all the
-elements prodeced, which will be C.
-It will also have an attribute called C, which will be set to the
-value returned by the C method, if that returns something
-other than undef.
-
-The XML namespace is also available as C<$Text::VimColor::NAMESPACE_ID>.
-
-=item marked()
-
-This output function returns the marked-up text in the format which the module
-stores it in internally.  The data looks like this:
-
-   use Data::Dumper;
-   print Dumper($syntax->marked);
-
-   $VAR1 = [
-      [ 'Statement', 'my' ],
-      [ '', ' ' ],
-      [ 'Identifier', '$syntax' ],
-      [ '', ' = ' ],
-       ...
-   ];
-
-The C method returns a reference to an array.  Each item in the
-array is itself a reference to an array of two items: the first is one of
-the names listed in the HIGHLIGHTING TYPES section below (or the empty
-string if none apply), and the second is the actual piece of text.
-
-=item input_filename()
-
-Returns the filename of the input file, or undef if a filename wasn't
-specified.
-
-=back
-
-=head1 HIGHLIGHTING TYPES
-
-The following list gives the names of highlighting types which will be
-set for pieces of text.  For HTML output, these will appear as CSS class
-names, except that they will all have the prefix C added.  For XML
-output, these will be the names of elements which will all be in the
-namespace C.
-
-Here is the complete list:
-
-=over 4
-
-=item *
-
-Comment
-
-=item *
-
-Constant
-
-=item *
-
-Identifier
-
-=item *
-
-Statement
-
-=item *
-
-PreProc
-
-=item *
-
-Type
-
-=item *
-
-Special
-
-=item *
-
-Underlined
-
-=item *
-
-Error
-
-=item *
-
-Todo
-
-=back
-
-=head1 RELATED  MODULES
-
-These modules allow Text::VimColor to be used more easily in particular
-environments:
-
-=over 4
-
-=item L
-
-=item L
-
-=item L
-
-=back
-
-=head1 SEE ALSO
-
-=over 4
-
-=item text-vimcolor(1)
-
-A simple command line interface to this module's features.  It can be used
-to produce HTML and XML output, and can also generate PDF output using
-an XSLT/XSL-FO stylesheet and the FOP processor.
-
-=item http://www.vim.org/
-
-Everything to do with the Vim text editor.
-
-=item http://ungwe.org/blog/
-
-The author's weblog, which uses this module.  It is used to make the code
-samples look pretty.
-
-=back
-
-=head1 BUGS
-
-Quite a few, actually:
-
-=over 4
-
-=item *
-
-Apparently this module doesn't always work if run from within a 'gvim'
-window, although I've been unable to reproduce this so far.
-CPAN bug #11555.
-
-=item *
-
-Things can break if there is already a Vim swapfile, but sometimes it
-seems to work.
-
-=item *
-
-There should be a way of getting a DOM object back instead of an XML string.
-
-=item *
-
-It should be possible to choose between HTML and XHTML, and perhaps there
-should be some control over the DOCTYPE declaration when a complete file is
-produced.
-
-=item *
-
-With Vim versions earlier than 6.2 there is a 2 second delay each time
-Vim is run.
-
-=item *
-
-It doesn't work on Windows.  I am unlikely to fix this, but if anyone
-who knows Windows can sort it out let me know.
-
-=back
-
-=head1 AUTHOR
-
-Geoff Richards Eqef@laxan.comE
-
-The Vim script F is a crufted version of F<2html.vim> by
-Bram Moolenaar EBram@vim.orgE and
-David Ne\v{c}as (Yeti) Eyeti@physics.muni.czE.
-
-=head1 COPYRIGHT
-
-Copyright 2002-2006, Geoff Richards.
-
-This library is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
-=cut
-
-# Local Variables:
-# mode: perl
-# perl-indent-level: 3
-# perl-continued-statement-offset: 3
-# End:
-# vi:ts=3 sw=3 expandtab:
diff --git a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/CVS/Entries b/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/CVS/Entries
deleted file mode 100644
index 77e5c8bf4..000000000
--- a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/CVS/Entries
+++ /dev/null
@@ -1,4 +0,0 @@
-/light.css/1.1/Fri Apr 28 07:16:26 2006//
-/light.xsl/1.1/Fri Apr 28 07:16:26 2006//
-/mark.vim/1.1/Fri Apr 28 07:16:26 2006//
-D
diff --git a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/CVS/Repository b/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/CVS/Repository
deleted file mode 100644
index 432233476..000000000
--- a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/CVS/Repository
+++ /dev/null
@@ -1 +0,0 @@
-xsieve/experiments/programlisting/vimcolor/lib/Text/VimColor
diff --git a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/CVS/Root b/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/CVS/Root
deleted file mode 100644
index d6bc77dba..000000000
--- a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/CVS/Root
+++ /dev/null
@@ -1 +0,0 @@
-:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve
diff --git a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/light.css b/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/light.css
deleted file mode 100644
index 9a67b1cb9..000000000
--- a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/light.css
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * A stylesheet designed to be used with the HTML output of the
- * Perl module Text::Highlight::Vim.
- *
- * This is designed to make the highlighting look like the default gvim
- * colour scheme, with 'background=light'.
- *
- * Geoff Richards (qef@laxan.com)
- *
- * This CSS file (light.css) is public domain.  Do what you want with it.
- * That doesn't mean that HTML with this CSS in is public domain.
- */
-
-body { color: black; background: white none }
-
-A:link { color: #00F; background: white none }
-A:visited { color: #909; background: white none }
-A:hover { color: #F00; background: white none }
-A:active { color: #F00; background: white none }
-
-.synComment    { color: #0000FF }
-.synConstant   { color: #FF00FF }
-.synIdentifier { color: #008B8B }
-.synStatement  { color: #A52A2A ; font-weight: bold }
-.synPreProc    { color: #A020F0 }
-.synType       { color: #2E8B57 ; font-weight: bold }
-.synSpecial    { color: #6A5ACD }
-.synUnderlined { color: #000000 ; text-decoration: underline }
-.synError      { color: #FFFFFF ; background: #FF0000 none }
-.synTodo       { color: #0000FF ; background: #FFFF00 none }
diff --git a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/light.xsl b/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/light.xsl
deleted file mode 100644
index 5b217de86..000000000
--- a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/light.xsl
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
-
-
-
- 
-  
-
-   
-
-    
-    
-     
-     
-     
-    
-
-    
-    
-     
-     
-     
-    
-
-    
-     
-      
-      
-     
-    
-
-   
-
-   
-
-    
-    
-     
-      
-     
-    
-
-    
-    
-     
-      
-     
-    
-
-    
-    
-     
-      
-     
-    
-
-   
-
-  
- 
-
- 
-  
- 
-
- 
-  
- 
-
- 
-  
- 
-
- 
-  
- 
-
- 
-  
- 
-
- 
-  
- 
-
- 
-  
- 
-
- 
-  
- 
-
- 
-  
- 
-
- 
-  
- 
-
-
diff --git a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/mark.vim b/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/mark.vim
deleted file mode 100644
index 22ed73f58..000000000
--- a/manual/docbook/programlisting/vimcolor/lib/Text/VimColor/mark.vim
+++ /dev/null
@@ -1,67 +0,0 @@
-" mark.vim - turn Vim syntax highlighting into an ad-hoc markup language that
-" can be parsed by the Text::VimColor Perl module.
-"
-" Maintainer: Geoff Richards 
-" Based loosely on 2html.vim, by Bram Moolenaar ,
-"   modified by David Ne\v{c}as (Yeti) .
-
-set report=1000000
-
-" For some reason (I'm sure it used to work) we now need to get Vim
-" to make another attempt to detect the filetype if it wasn't set
-" explicitly.
-if !strlen(&filetype)
-   filetype detect
-endif
-syn on
-
-" Set up the output buffer.
-new
-set modifiable
-set paste
-
-" Expand tabs. Without this they come out as '^I'.
-set isprint+=9
-
-wincmd p
-
-" Loop over all lines in the original text
-let s:end = line("$")
-let s:lnum = 1
-while s:lnum <= s:end
-
-  " Get the current line
-  let s:line = getline(s:lnum)
-  let s:len = strlen(s:line)
-  let s:new = ""
-
-  " Loop over each character in the line
-  let s:col = 1
-  while s:col <= s:len
-    let s:startcol = s:col " The start column for processing text
-    let s:id = synID(s:lnum, s:col, 1)
-    let s:col = s:col + 1
-    " Speed loop (it's small - that's the trick)
-    " Go along till we find a change in synID
-    while s:col <= s:len && s:id == synID(s:lnum, s:col, 1) | let s:col = s:col + 1 | endwhile
-
-    " Output the text with the same synID, with class set to c{s:id}
-    let s:id = synIDtrans(s:id)
-    let s:name = synIDattr(s:id, 'name')
-    let s:new = s:new . '>' . s:name . '>' . substitute(substitute(substitute(strpart(s:line, s:startcol - 1, s:col - s:startcol), '&', '\&a', 'g'), '<', '\&l', 'g'), '>', '\&g', 'g') . '<' . s:name . '<'
-
-    if s:col > s:len
-      break
-    endif
-  endwhile
-
-  exe "normal \pa" . strtrans(s:new) . "\n\e\p"
-  let s:lnum = s:lnum + 1
-  +
-endwhile
-
-" Strip whitespace from the ends of lines
-%s:\s\+$::e
-
-wincmd p
-normal dd
diff --git a/manual/docbook/programlisting/vimcolor/text-vimcolor b/manual/docbook/programlisting/vimcolor/text-vimcolor
deleted file mode 100755
index 12c1ee1cc..000000000
--- a/manual/docbook/programlisting/vimcolor/text-vimcolor
+++ /dev/null
@@ -1,278 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-use Text::VimColor;
-use Getopt::Long;
-use File::Temp qw( tempfile );
-use IO::File;
-use Path::Class qw( file );
-
-my $XSL_STYLESHEET = file($Text::VimColor::SHARED, 'light.xsl');
-
-# Default values for options.
-my $filetype;
-my $format;
-my $usage;
-my $output_filename;
-my $html_full_page;
-my $html_no_inline_stylesheet;
-my @let;
-my @unlet;
-
-my $option = GetOptions(
-   'debug' => \$Text::VimColor::DEBUG,
-   'filetype=s' => \$filetype,
-   'format=s' => \$format,
-   'help' => \$usage,
-   'output=s' => \$output_filename,
-   'full-page' => \$html_full_page,
-   'no-inline-stylesheet' => \$html_no_inline_stylesheet,
-   'let=s' => \@let,
-   'unlet=s' => \@unlet,
-   'usage' => \$usage,
-);
-
-if ($usage) {
-   print STDERR
-      "Usage: $0 --format html|xml [options] filename\n",
-      "       $0 --format pdf --output foo.pdf [options] filename\n",
-      "(the output is written to standard output, except in PDF\n",
-      "mode, where you have to supply a filename for the output.)\n",
-      "\n",
-      "Options:\n",
-      "    --debug      turn on Text::VimColor debugging mode\n",
-      "    --filetype   set Vim filetype name, if it can't be guessed from\n",
-      "                 the file's name or contents\n",
-      "    --format     set format to use for output, can be xml,\n",
-      "                 html, or pdf\n",
-      "    --help       show this helpful message\n",
-      "    --output     set filename to write output to (required with\n",
-      "                 PDF format, otherwise defaults to standard output)\n",
-      "    --full-page  output a complete HTML page, not just a fragment\n",
-      "    --no-inline-stylesheet\n",
-      "                 don't include the stylesheet in a complete HTML page\n",
-      "    --let        set a Vim variable with the Vim :let command\n",
-      "    --unlet      turn off default setting of a Vim variable\n";
-}
-
-defined $format
-   or die "$0: an output format must be specified (html, pdf or xml).\n";
-
-$format = lc $format;
-$format eq 'html' || $format eq 'pdf' || $format eq 'xml'
-   or die "$0: invalid output format '$format' (must be html, pdf or xml).\n";
-
-my $output;
-if (defined $output_filename) {
-   $output = IO::File->new($output_filename, 'w')
-      or die "$0: error opening output file '$output_filename': $!\n";
-}
-else {
-   $format ne 'pdf'
-      or die "$0: an output file must be specified with '--format pdf'.\n";
-
-   $output = \*STDOUT;
-   $output_filename = '';
-}
-
-@ARGV <= 1
-   or die "$0: only one input filename should be specified.\n";
-
-my $file = @ARGV ? shift : \*STDIN;
-
-my $syntax = Text::VimColor->new(
-   filetype => $filetype,
-   html_full_page => $html_full_page,
-   html_inline_stylesheet => !$html_no_inline_stylesheet,
-);
-
-# Handle the --let and --unlet options.
-foreach (@unlet) {
-   $syntax->vim_let($_ => undef);
-}
-foreach (@let) {
-   my ($name, $value) = /^(.*?)=(.*)\z/
-      or die "$0: bad --let option '$_'\n";
-   print STDERR "[$name] [$value]\n";
-   $syntax->vim_let($name => $value);
-}
-
-$syntax->syntax_mark_file($file);
-
-if ($format eq 'xml') {
-   print $output $syntax->xml
-      or die "$0: error writing to output file '$output_filename': $!\n";
-}
-elsif ($format eq 'html') {
-   print $output $syntax->html
-      or die "$0: error writing to output file '$output_filename': $!\n";
-}
-else {   # ($format eq 'pdf')
-   my ($fh, $tmp_filename) = tempfile();
-   print $fh $syntax->xml
-      or die "$0: error writing to temporary file '$tmp_filename': $!\n";
-
-   system('fop', '-xsl', $XSL_STYLESHEET,
-                 '-xml', $tmp_filename,
-                 '-pdf', $output_filename) == 0
-      or die "$0: error running 'fop' (exit code was $?).\n";
-
-   unlink $tmp_filename
-      or die "$0: error deleting temporary file '$tmp_filename': $!\n";
-}
-
-exit 0;
-
-__END__
-
-=head1 NAME
-
-text-vimcolor - command-line program to syntax color a file in HTML, XML or PDF
-
-=head1 SYNOPSIS
-
-   $ text-vimcolor --format html --full-page FILENAME > OUTPUT.html
-   $ text-vimcolor --format xml FILENAME > OUTPUT.xml
-   $ text-vimcolor --format pdf FILENAME --output OUTPUT.pdf
-
-=head1 DESCRIPTION
-
-This program uses the Vim text editor to highlight text according to its
-syntax, and turn the highlighting into HTML, XML or PDF output.  It works
-with any file type which Vim itself can highlight.  Usually Vim will be
-able to autodetect the file format based on the filename (and sometimes the
-contents of the file).
-
-Exactly one filename should be given on the command line to name the input
-file.  If none is given input will instead be read from stdin (the standard
-input).
-
-If Vim can't guess the file type automatically, it can be specified explicitly
-using the C<--filetype> option.  For example:
-
-   $ text-vimcolor --format html --filetype prolog foo.pl > foo.html
-
-This program is a command line interface to the Perl module Text::VimColor.
-
-=head1 OPTIONS
-
-The following options are understood:
-
-=over 4
-
-=item --help
-
-Show a summary of the usage, including a list of options.
-
-=item --debug
-
-Turns on debugging in the underlying Perl module.  This makes it print
-the command used to run Vim.
-
-=item --filetype I
-
-Set the type of the file explicitly.  The I argument should be
-something which Vim will recognise when set with its C option.
-Examples are C, C (for C++) and C (for Unix shell scripts).
-These names are case sensitive, and should usually be all-lowercase.
-
-=item --format I
-
-The output format to generate.  Must be one of the following:
-
-=over 4
-
-=item html
-
-Generate XHTML output, with text marked with CspanE> elements
-with C attributes.  A CSS stylesheet should be used to define the
-coloring, etc., for the output.  See the C<--full-page> option below.
-
-=item xml
-
-Output is in a simple XML vocabulary.  This can then be used by other
-software to do further transformations (e.g., using XSLT).
-
-=item pdf
-
-XML output is generated and fed to the FOP XSL-FO processor, with an
-appropriate XSL style sheet.  The stylesheet uses XSLT to transform the
-normal XML output into XSL-FO, which is then rendered to PDF.  For this
-to work, the command C must be available.  An output file must be
-specified with C<--output> with this format.
-
-=back
-
-Full details of the HTML and XML output formats can be found in the
-documentation for Text::VimColor.
-
-=item --output I
-
-Specifies the name of the output file (which will end up containing either
-HTML, XML or PDF).  If this option is omitted, the output will be sent
-to stdout (the standard output).  This option is required when the output
-format is PDF (because of limitations in FOP).
-
-=item --full-page
-
-When the output format is HTML, this option will make the output a complete
-HTML page, rather than just a fragment of HTML.  A CSS stylesheet will be
-inserted inline into the output, so the output will be useable as it is.
-
-=item --no-inline-stylesheet
-
-When the output format is HTML and C<--fullpage> is given, a stylesheet
-is normally inserted in-line in the output file.  If this option is given it
-will instead be referenced with a ClinkE> element.
-
-=item --let I=I
-
-When Vim is run the value of I will be set to I using
-Vim's C command.  More than one of these options can be set.
-The value is not quoted or escaped in any way, so it can be an expression.
-These settings take precedence over C<--unlet> options.
-
-This option corresponds to the C setting and method in
-the Perl module.
-
-=item --unlet I
-
-Prevent the value of I being set with Vim's C command.
-This can be used to turn off default settings.
-
-This option corresponds to the C setting and method in
-the Perl module, when used with a value of C.
-
-=back
-
-=head1 BUGS
-
-=over 4
-
-=item *
-
-The PDF output option often doesn't work, because it is dependent on FOP,
-which often doesn't work.  This is also why it is mind numbingly slow.
-
-=item *
-
-FOP (0.20.3) seems to ignore the C property on
-Cfo:inlineE>.  If that's what it's meant to do, how do you set the
-background color on part of a line?
-
-=back
-
-=head1 AUTHOR
-
-Geoff Richards Eqef@laxan.comE
-
-=head1 COPYRIGHT
-
-Copyright 2002-2006, Geoff Richards.
-
-This program is free software; you can redistribute it and/or
-modify it under the same terms as Perl.
-
-=cut
-
-# vi:ts=3 sw=3 expandtab
diff --git a/manual/docbook/programlisting/vimcolor/vimcolor-wrapper b/manual/docbook/programlisting/vimcolor/vimcolor-wrapper
deleted file mode 100755
index 422824b45..000000000
--- a/manual/docbook/programlisting/vimcolor/vimcolor-wrapper
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-DIR=`dirname $0`
-
-PERL5LIB=$DIR/lib:$PERL5LIB
-export PERL5LIB
-
-$DIR/text-vimcolor "$@"
-
diff --git a/manual/docs-fr/Getting started - Installation.php b/manual/docs-fr/Getting started - Installation.php
deleted file mode 100644
index c1c636380..000000000
--- a/manual/docs-fr/Getting started - Installation.php	
+++ /dev/null
@@ -1,17 +0,0 @@
-L'installation de Doctrine est très simple. Il suffit de récupérer la dernière version de Doctrine sur http://doctrine.pengus.net/svn/trunk.
-
-Pour ce faire, vous avez besoin d'un client Subversion (SVN).
-
-Pour "emprunter" (checkout) Doctrine dans répertoire courant en utiliser l'outil de lignes de commande **svn**, utilisez le code suivant:
-
-svn co http://doctrine.pengus.net/svn/trunk . 
-
-
-Si vous n'avez pas de client SVN, choisissez-en un dans la liste ci-dessous.
-Trouver l'option **Checkout** et entrez http://doctrine.pengus.net/svn/trunk dans le champ **path** ou **repository url**.
-Aucune authentification n'est requise pour récupérer Doctrine.
-
-* [http://tortoisesvn.tigris.org/ TortoiseSVN] une application Windows qui s'intègre directement dans l'exporateur de fichier.
-* [http://www.apple.com/downloads/macosx/development_tools/svnx.html svnx] une interface graphique SVN pour Mac
-* Eclipse possède une intégration SVN grâce au plugin [http://subclipse.tigris.org/ subeclipse]
-
diff --git a/manual/docs/Advanced components - Cache - Introduction.php b/manual/docs/Advanced components - Cache - Introduction.php
deleted file mode 100644
index c6a22e778..000000000
--- a/manual/docs/Advanced components - Cache - Introduction.php	
+++ /dev/null
@@ -1,3 +0,0 @@
-Caching is one of the most influental things when it comes to performance tuning. Doctrine_Cache provides means for 
-caching queries and for managing the cached queries. 
-
diff --git a/manual/docs/Advanced components - Cache - Query cache.php b/manual/docs/Advanced components - Cache - Query cache.php
deleted file mode 100644
index 8b1378917..000000000
--- a/manual/docs/Advanced components - Cache - Query cache.php	
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/manual/docs/Advanced components - Db_Profiler - Advanced usage.php b/manual/docs/Advanced components - Db_Profiler - Advanced usage.php
deleted file mode 100644
index 8b1378917..000000000
--- a/manual/docs/Advanced components - Db_Profiler - Advanced usage.php	
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/manual/docs/Advanced components - Db_Profiler - Basic usage.php b/manual/docs/Advanced components - Db_Profiler - Basic usage.php
deleted file mode 100644
index 8b1378917..000000000
--- a/manual/docs/Advanced components - Db_Profiler - Basic usage.php	
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/manual/docs/Advanced components - Db_Profiler - Introduction.php b/manual/docs/Advanced components - Db_Profiler - Introduction.php
deleted file mode 100644
index f852130fe..000000000
--- a/manual/docs/Advanced components - Db_Profiler - Introduction.php	
+++ /dev/null
@@ -1,15 +0,0 @@
-
-Doctrine_Db_Profiler is an eventlistener for Doctrine_Db. It provides flexible query profiling. Besides the sql strings
-the query profiles include elapsed time to run the queries. This allows inspection of the queries that have been performed without the
-need for adding extra debugging code to model classes.
-
-
-
-Doctrine_Db_Profiler can be enabled by adding it as an eventlistener for Doctrine_Db.
-
-
-
-
-
-?>
-
diff --git a/manual/docs/Advanced components - Evenlisteners - AccessorInvoker.php b/manual/docs/Advanced components - Evenlisteners - AccessorInvoker.php
deleted file mode 100644
index 450276d8f..000000000
--- a/manual/docs/Advanced components - Evenlisteners - AccessorInvoker.php	
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-class User { 
-    public function setTableDefinition() {
-        $this->hasColumn("name", "string", 200);
-        $this->hasColumn("password", "string", 32);
-    }
-    public function setPassword($password) {
-        return md5($password);
-    }
-    public function getName($name) {
-        return strtoupper($name);
-    }
-}
-
-$user = new User();
-
-$user->name = 'someone';
-
-print $user->name; // someone
-
-$user->password = '123'; 
-
-print $user->password; // 123
-
-$user->setAttribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener_AccessorInvoker());
-
-print $user->name; // SOMEONE
-
-$user->password = '123';
-
-print $user->password; // 202cb962ac59075b964b07152d234b70
-
diff --git a/manual/docs/Advanced components - Eventlisteners - AccessorInvoker.php b/manual/docs/Advanced components - Eventlisteners - AccessorInvoker.php
deleted file mode 100644
index 8b1378917..000000000
--- a/manual/docs/Advanced components - Eventlisteners - AccessorInvoker.php	
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/manual/docs/Advanced components - Eventlisteners - Chaining.php b/manual/docs/Advanced components - Eventlisteners - Chaining.php
deleted file mode 100644
index 8b1378917..000000000
--- a/manual/docs/Advanced components - Eventlisteners - Chaining.php	
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/manual/docs/Advanced components - Eventlisteners - Creating a logger.php b/manual/docs/Advanced components - Eventlisteners - Creating a logger.php
deleted file mode 100644
index 8b1378917..000000000
--- a/manual/docs/Advanced components - Eventlisteners - Creating a logger.php	
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/manual/docs/Advanced components - Eventlisteners - Creating new listener.php b/manual/docs/Advanced components - Eventlisteners - Creating new listener.php
deleted file mode 100644
index 2324c9d24..000000000
--- a/manual/docs/Advanced components - Eventlisteners - Creating new listener.php	
+++ /dev/null
@@ -1,36 +0,0 @@
-Creating a new listener is very easy. You can set the listener in global, connection or factory level.
-
-
-class MyListener extends Doctrine_EventListener {
-    public function onLoad(Doctrine_Record $record) {
-        print $record->getTable()->getComponentName()." just got loaded!";
-    }
-    public function onSave(Doctrine_Record $record) {
-        print "saved data access object!";
-    }
-}
-class MyListener2 extends Doctrine_EventListener {
-    public function onPreUpdate() {
-        try {
-            $record->set("updated",time());
-        } catch(InvalidKeyException $e) { 
-        }
-    }
-}
-
-
-// setting global listener
-$manager = Doctrine_Manager::getInstance();
-
-$manager->setAttribute(Doctrine::ATTR_LISTENER,new MyListener());
-
-// setting connection level listener
-$conn = $manager->openConnection($dbh);
-
-$conn->setAttribute(Doctrine::ATTR_LISTENER,new MyListener2());
-
-// setting factory level listener
-$table = $conn->getTable("User");
-
-$table->setAttribute(Doctrine::ATTR_LISTENER,new MyListener());
-
diff --git a/manual/docs/Advanced components - Eventlisteners - Introduction.php b/manual/docs/Advanced components - Eventlisteners - Introduction.php
deleted file mode 100644
index 8b1378917..000000000
--- a/manual/docs/Advanced components - Eventlisteners - Introduction.php	
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/manual/docs/Advanced components - Eventlisteners - List of events.php b/manual/docs/Advanced components - Eventlisteners - List of events.php
deleted file mode 100644
index 5ac4f36f9..000000000
--- a/manual/docs/Advanced components - Eventlisteners - List of events.php	
+++ /dev/null
@@ -1,48 +0,0 @@
-Here is a list of availible events and their parameters: 
-
-
-interface Doctrine_EventListener_Interface {
-
-    public function onLoad(Doctrine_Record $record);
-    public function onPreLoad(Doctrine_Record $record);
-
-    public function onUpdate(Doctrine_Record $record);
-    public function onPreUpdate(Doctrine_Record $record);
-
-    public function onCreate(Doctrine_Record $record);
-    public function onPreCreate(Doctrine_Record $record);
-
-    public function onSave(Doctrine_Record $record);
-    public function onPreSave(Doctrine_Record $record);
-
-    public function onInsert(Doctrine_Record $record);
-    public function onPreInsert(Doctrine_Record $record);
-
-    public function onDelete(Doctrine_Record $record);
-    public function onPreDelete(Doctrine_Record $record);
-
-    public function onEvict(Doctrine_Record $record);
-    public function onPreEvict(Doctrine_Record $record);
-
-    public function onSleep(Doctrine_Record $record);
-    
-    public function onWakeUp(Doctrine_Record $record);
-    
-    public function onClose(Doctrine_Connection $connection);
-    public function onPreClose(Doctrine_Connection $connection);
-    
-    public function onOpen(Doctrine_Connection $connection);
-
-    public function onTransactionCommit(Doctrine_Connection $connection);
-    public function onPreTransactionCommit(Doctrine_Connection $connection);
-
-    public function onTransactionRollback(Doctrine_Connection $connection);
-    public function onPreTransactionRollback(Doctrine_Connection $connection);
-
-    public function onTransactionBegin(Doctrine_Connection $connection);
-    public function onPreTransactionBegin(Doctrine_Connection $connection);
-    
-    public function onCollectionDelete(Doctrine_Collection $collection);
-    public function onPreCollectionDelete(Doctrine_Collection $collection);
-}
-
diff --git a/manual/docs/Advanced components - Eventlisteners - Listening events.php b/manual/docs/Advanced components - Eventlisteners - Listening events.php
deleted file mode 100644
index b15b8d5a8..000000000
--- a/manual/docs/Advanced components - Eventlisteners - Listening events.php	
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-$table = $conn->getTable("User");
-
-$table->setEventListener(new MyListener2());
-
-// retrieve user whose primary key is 2
-$user    = $table->find(2);
-
-$user->name = "John Locke";
-
-// update event will be listened and current time will be assigned to the field 'updated' 
-$user->save();
-
diff --git a/manual/docs/Advanced components - Hook - Building queries.php b/manual/docs/Advanced components - Hook - Building queries.php
deleted file mode 100644
index 8b1378917..000000000
--- a/manual/docs/Advanced components - Hook - Building queries.php	
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/manual/docs/Advanced components - Hook - Introduction.php b/manual/docs/Advanced components - Hook - Introduction.php
deleted file mode 100644
index 11c0f6e9f..000000000
--- a/manual/docs/Advanced components - Hook - Introduction.php	
+++ /dev/null
@@ -1,4 +0,0 @@
-Many web applications have different kinds of lists. The lists may contain data from multiple components (= database tables) and
-they may have actions such as paging, sorting and setting conditions. Doctrine_Hook helps building these lists. It has a simple API for
-building search criteria forms as well as building a DQL query from the 'hooked' parameters.
-
diff --git a/manual/docs/Advanced components - Hook - List of parsers.php b/manual/docs/Advanced components - Hook - List of parsers.php
deleted file mode 100644
index 8b1378917..000000000
--- a/manual/docs/Advanced components - Hook - List of parsers.php	
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/manual/docs/Advanced components - Hook - Parameter hooking.php b/manual/docs/Advanced components - Hook - Parameter hooking.php
deleted file mode 100644
index 01cb62a8b..000000000
--- a/manual/docs/Advanced components - Hook - Parameter hooking.php	
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-$hook = new Doctrine_Hook($table, $fields);
-
diff --git a/manual/docs/Advanced components - Locking Manager - Examples.php b/manual/docs/Advanced components - Locking Manager - Examples.php
deleted file mode 100644
index 02333ba89..000000000
--- a/manual/docs/Advanced components - Locking Manager - Examples.php	
+++ /dev/null
@@ -1,63 +0,0 @@
-The following code snippet demonstrates the use of Doctrine's pessimistic offline locking capabilities.
-
-At the page where the lock is requested...
-
-
-// Get a locking manager instance
-$lockingMngr = new Doctrine_Locking_Manager_Pessimistic();
-
-try
-{
-    // Ensure that old locks which timed out are released 
-    // before we try to acquire our lock
-    // 300 seconds = 5 minutes timeout
-    $lockingMngr->releaseAgedLocks(300);
-
-    // Try to get the lock on a record
-    $gotLock = $lockingMngr->getLock(
-     // The record to lock. This can be any Doctrine_Record
-                        $myRecordToLock,
-    // The unique identifier of the user who is trying to get the lock
-                       'Bart Simpson'
-               );
-
-    if($gotLock)
-    {
-        echo "Got lock!";
-        // ... proceed
-    }
-    else
-    {
-        echo "Sorry, someone else is currently working on this record";
-    }
-}
-catch(Doctrine_Locking_Exception $dle)
-{
-    echo $dle->getMessage();
-    // handle the error
-}
-
-
-
-At the page where the transaction finishes...
-
-// Get a locking manager instance
-$lockingMngr = new Doctrine_Locking_Manager_Pessimistic();
-
-try
-{
-    if($lockingMngr->releaseLock($myRecordToUnlock, 'Bart Simpson'))
-    {
-        echo "Lock released";
-    }
-    else
-    {
-        echo "Record was not locked. No locks released.";
-    }
-}
-catch(Doctrine_Locking_Exception $dle)
-{
-    echo $dle->getMessage();
-    // handle the error
-}
-
diff --git a/manual/docs/Advanced components - Locking Manager - Introduction.php b/manual/docs/Advanced components - Locking Manager - Introduction.php
deleted file mode 100644
index e5f23a56c..000000000
--- a/manual/docs/Advanced components - Locking Manager - Introduction.php	
+++ /dev/null
@@ -1,35 +0,0 @@
-[**Note**: The term 'Transaction' doesnt refer to database transactions here but to the general meaning of this term]
-
-[**Note**: This component is in **Alpha State**]
-
-
-
-Locking is a mechanism to control concurrency. The two most well known locking strategies
-are optimistic and pessimistic locking. The following is a short description of these
-two strategies from which only pessimistic locking is currently supported by Doctrine.
-
-
-
-**Optimistic Locking:**
-
-The state/version of the object(s) is noted when the transaction begins.
-When the transaction finishes the noted state/version of the participating objects is compared
-to the current state/version. When the states/versions differ the objects have been modified 
-by another transaction and the current transaction should fail.
-This approach is called 'optimistic' because it is assumed that it is unlikely that several users
-will participate in transactions on the same objects at the same time.
-
-
-
-**Pessimistic Locking:**
-
-The objects that need to participate in the transaction are locked at the moment
-the user starts the transaction. No other user can start a transaction that operates on these objects
-while the locks are active. This ensures that the user who starts the transaction can be sure that
-noone else modifies the same objects until he has finished his work.
-
-
-
-Doctrine's pessimistic offline locking capabilities can be used to control concurrency during actions or procedures
-that take several HTTP request and response cycles and/or a lot of time to complete.
-
diff --git a/manual/docs/Advanced components - Locking Manager - Maintainer.php b/manual/docs/Advanced components - Locking Manager - Maintainer.php
deleted file mode 100644
index 43d6b676e..000000000
--- a/manual/docs/Advanced components - Locking Manager - Maintainer.php	
+++ /dev/null
@@ -1,3 +0,0 @@
-Roman Borschel - romanb at #doctrine (freenode)
-
-Don't hesitate to contact me if you have questions, ideas, ect.
diff --git a/manual/docs/Advanced components - Locking Manager - Planned.php b/manual/docs/Advanced components - Locking Manager - Planned.php
deleted file mode 100644
index 1f37ddab2..000000000
--- a/manual/docs/Advanced components - Locking Manager - Planned.php	
+++ /dev/null
@@ -1,2 +0,0 @@
-- Possibility to release locks of a specific Record type (i.e. releasing all locks on 'User'
-objects).
diff --git a/manual/docs/Advanced components - Locking Manager - Technical Details.php b/manual/docs/Advanced components - Locking Manager - Technical Details.php
deleted file mode 100644
index b886529d1..000000000
--- a/manual/docs/Advanced components - Locking Manager - Technical Details.php	
+++ /dev/null
@@ -1,6 +0,0 @@
-The pessimistic offline locking manager stores the locks in the database (therefore 'offline').
-The required locking table is automatically created when you try to instantiate an instance
-of the manager and the ATTR_CREATE_TABLES is set to TRUE.
-This behaviour may change in the future to provide a centralised and consistent table creation
-procedure for installation purposes.
-
diff --git a/manual/docs/Advanced components - Validators - Introduction.php b/manual/docs/Advanced components - Validators - Introduction.php
deleted file mode 100644
index 26c8d993b..000000000
--- a/manual/docs/Advanced components - Validators - Introduction.php	
+++ /dev/null
@@ -1,29 +0,0 @@
-Validation in Doctrine is a way to enforce your business rules in the model part of the MVC architecture.
-You can think of this validation as a gateway that needs to be passed right before data gets into the
-persistent data store. The definition of these business rules takes place at the record level, that means
-in your active record model classes (classes derived from Doctrine_Record).
-The first thing you need to do to be able to use this kind of validation is to enable it globally.
-This is done through the Doctrine_Manager (see the code below).
-
-
-
-Once you enabled validation, you'll get a bunch of validations automatically:
-
-
-
-- Data type validations: All values assigned to columns are checked for the right type. That means
-if you specified a column of your record as type 'integer', Doctrine will validate that
-any values assigned to that column are of this type. This kind of type validation tries to
-be as smart as possible since PHP is a loosely typed language. For example 2 as well as "7"
-are both valid integers whilst "3f" is not. Type validations occur on every column (since every
-column definition needs a type).
-
-
-- Length validation: As the name implies, all values assigned to columns are validated to make
-sure that the value does not exceed the maximum length.
-
-
-// turning on validation
-
-Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VLD, true);
-
diff --git a/manual/docs/Advanced components - Validators - List of predefined validators.php b/manual/docs/Advanced components - Validators - List of predefined validators.php
deleted file mode 100644
index 72c27e511..000000000
--- a/manual/docs/Advanced components - Validators - List of predefined validators.php	
+++ /dev/null
@@ -1,14 +0,0 @@
-Here is a list of predefined validators. You cannot use these names for your custom validators.
-
-|| **name** || **arguments** || **task**      ||
-|| email 		|| 							 || Check if value is valid email.|| 
-|| notblank || 							 || Check if value is not blank.||
-|| notnull  ||               || Check if value is not null.||
-|| country  ||               || Check if valid is valid country code.||
-|| ip       ||               || Checks if value is valid IP (internet protocol) address.||
-|| htmlcolor ||              || Checks if value is valid html color.||
-|| nospace  ||               || Check if value has no space chars. ||
-|| range    || [min,max]     || Checks if value is in range specified by arguments.||
-|| unique   ||							 || Checks if value is unique in its database table. ||
-|| regexp   || [expression]  || Check if valie matches a given regexp. ||
-
diff --git a/manual/docs/Advanced components - Validators - More Validation.php b/manual/docs/Advanced components - Validators - More Validation.php
deleted file mode 100644
index cd15b8bab..000000000
--- a/manual/docs/Advanced components - Validators - More Validation.php	
+++ /dev/null
@@ -1,72 +0,0 @@
-The type and length validations are handy but most of the time they're not enough. Therefore
-Doctrine provides some mechanisms that can be used to validate your data in more detail.
-
-
-
-Validators: Validators are an easy way to specify further validations. Doctrine has a lot of predefined
-validators that are frequently needed such as email, country, ip, range and regexp validators. You
-find a full list of available validators at the bottom of this page. You can specify which validators
-apply to which column through the 4th argument of the hasColumn() method.
-If that is still not enough and you need some specialized validation that is not yet available as
-a predefined validator you have three options:
-
-
-
-- You can write the validator on your own.
-
-- You can propose your need for a new validator to a Doctrine developer.
-
-- You can use validation hooks.
-
-
-
-The first two options are advisable if it is likely that the validation is of general use
-and is potentially applicable in many situations. In that case it is a good idea to implement
-a new validator. However if the validation is special it is better to use hooks provided by Doctrine:
-
-
-
-- validate() (Executed every time the record gets validated)
-
-- validateOnInsert() (Executed when the record is new and gets validated)
-
-- validateOnUpdate() (Executed when the record is not new and gets validated)
-
-
-
-If you need a special validation in your active record
-you can simply override one of these methods in your active record class (a descendant of Doctrine_Record).
-Within thess methods you can use all the power of PHP to validate your fields. When a field
-doesnt pass your validation you can then add errors to the record's error stack.
-The following code snippet shows an example of how to define validators together with custom
-validation:
-
-
-
-class User extends Doctrine_Record {
-    public function setUp() {
-        $this->ownsOne("Email","User.email_id");
-    }
-    public function setTableDefinition() {
-        // no special validators used only types 
-        // and lengths will be validated
-        $this->hasColumn("name","string",15);
-        $this->hasColumn("email_id","integer");
-        $this->hasColumn("created","integer",11);
-    }
-    // Our own validation
-    protected function validate() {
-        if ($this->name == 'God') {
-            // Blasphemy! Stop that! ;-)
-            // syntax: add(, )
-            $this->getErrorStack()->add('name', 'forbiddenName');
-        }
-    }
-}
-class Email extends Doctrine_Record {
-    public function setTableDefinition() {
-        // validators 'email' and 'unique' used
-        $this->hasColumn("address","string",150, array("email", "unique"));
-    }
-}  
-
diff --git a/manual/docs/Advanced components - Validators - Valid or Not Valid.php b/manual/docs/Advanced components - Validators - Valid or Not Valid.php
deleted file mode 100644
index dc68f14d7..000000000
--- a/manual/docs/Advanced components - Validators - Valid or Not Valid.php	
+++ /dev/null
@@ -1,61 +0,0 @@
-Now that you know how to specify your business rules in your models, it is time to look at how to 
-deal with these rules in the rest of your application.
-
-
-
-Implicit validation:
-
-Whenever a record is going to be saved to the persistent data store (i.e. through calling $record->save())
-the full validation procedure is executed. If errors occur during that process an exception of the type
-Doctrine_Validator_Exception will be thrown. You can catch that exception and analyze the errors by
-using the instance method Doctine_Validator_Exception::getInvalidRecords(). This method returns
-an ordinary array with references to all records that did not pass validation. You can then
-further explore the errors of each record by analyzing the error stack of each record.
-The error stack of a record can be obtained with the instance method Doctrine_Record::getErrorStack().
-Each error stack is an instance of the class Doctrine_Validator_ErrorStack. The error stack
-provides an easy to use interface to inspect the errors.
-
-
-
-Explicit validation:
-
-You can explicitly trigger the validation for any record at any time. For this purpose Doctrine_Record
-provides the instance method Doctrine_Record::isValid(). This method returns a boolean value indicating
-the result of the validation. If the method returns FALSE, you can inspect the error stack in the same
-way as seen above except that no exception is thrown, so you simply obtain
-the error stack of the record that didnt pass validation through Doctrine_Record::getErrorStack().
-
-
-
-The following code snippet shows an example of handling implicit validation which caused a Doctrine_Validator_Exception.
-
-
-try {
-    $user->name = "this is an example of too long name";
-    $user->Email->address = "drink@@notvalid..";
-    $user->save();
-} catch(Doctrine_Validator_Exception $e) {
-    // Note: you could also use $e->getInvalidRecords(). The direct way
-    // used here is just more simple when you know the records you're dealing with.
-    $userErrors = $user->getErrorStack();
-    $emailErrors = $user->Email->getErrorStack();
-    
-    /* Inspect user errors */
-    foreach($userErrors as $fieldName => $errorCodes) {
-        switch ($fieldName) {
-            case 'name':
-                // $user->name is invalid. inspect the error codes if needed.
-            break;
-        }
-    }
-    
-    /* Inspect email errors */
-    foreach($emailErrors as $fieldName => $errorCodes) {
-        switch ($fieldName) {
-            case 'address':
-                // $user->Email->address is invalid. inspect the error codes if needed.
-            break;
-        }
-    }
-}
-
diff --git a/manual/docs/Advanced components - View - Intoduction.php b/manual/docs/Advanced components - View - Intoduction.php
deleted file mode 100644
index cf7c6391c..000000000
--- a/manual/docs/Advanced components - View - Intoduction.php	
+++ /dev/null
@@ -1,3 +0,0 @@
-Database views can greatly increase the performance of complex queries. You can think of them as 
-cached queries. Doctrine_View provides integration between database views and DQL queries.
-
diff --git a/manual/docs/Advanced components - View - Managing views.php b/manual/docs/Advanced components - View - Managing views.php
deleted file mode 100644
index 647aec997..000000000
--- a/manual/docs/Advanced components - View - Managing views.php	
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-$conn = Doctrine_Manager::getInstance()
-        ->openConnection(new PDO("dsn","username","password"));
-
-$query = new Doctrine_Query($conn);
-$query->from('User.Phonenumber')->limit(20);
-
-$view  = new Doctrine_View($query, 'MyView');
-
-// creating a database view
-$view->create();
-
-// dropping the view from the database
-$view->drop();
-
diff --git a/manual/docs/Advanced components - View - Using views.php b/manual/docs/Advanced components - View - Using views.php
deleted file mode 100644
index 676bfc206..000000000
--- a/manual/docs/Advanced components - View - Using views.php	
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-$conn = Doctrine_Manager::getInstance()
-        ->openConnection(new PDO("dsn","username","password"));
-
-$query = new Doctrine_Query($conn);
-$query->from('User.Phonenumber')->limit(20);
-
-// hook the query into appropriate view
-$view  = new Doctrine_View($query, 'MyView');
-
-// now fetch the data from the view
-$coll  = $view->execute();
-
diff --git a/manual/docs/Cache - Configuration.php b/manual/docs/Cache - Configuration.php
deleted file mode 100644
index bcdb4d39f..000000000
--- a/manual/docs/Cache - Configuration.php	
+++ /dev/null
@@ -1,26 +0,0 @@
-There are couple of availible Cache attributes on Doctrine:
-
-    * Doctrine::ATTR_CACHE_SIZE
-        
-            *  Defines which cache container Doctrine uses
-            *  Possible values: Doctrine::CACHE_* (for example Doctrine::CACHE_FILE)
-        
-    * Doctrine::ATTR_CACHE_DIR
-        
-        *  cache directory where .cache files are saved
-        *  the default cache dir is %ROOT%/cachedir, where
-        %ROOT% is automatically converted to doctrine root dir
-        
-    * Doctrine::ATTR_CACHE_SLAM
-        
-            *  On very busy servers whenever you start the server or modify files you can create a race of many processes all trying to cache the same file at the same time. This option sets the percentage of processes that will skip trying to cache an uncached file. Or think of it as the probability of a single process to skip caching. For example, setting apc.slam_defense to 75 would mean that there is a 75% chance that the process will not cache an uncached file. So, the higher the setting the greater the defense against cache slams. Setting this to 0 disables this feature
-        
-    * Doctrine::ATTR_CACHE_SIZE
-        
-            *  Cache size attribute
-        
-    * Doctrine::ATTR_CACHE_TTL
-        
-            *  How often the cache is cleaned
-        
-
diff --git a/manual/docs/Cache - Overview.php b/manual/docs/Cache - Overview.php
deleted file mode 100644
index a909a7d52..000000000
--- a/manual/docs/Cache - Overview.php	
+++ /dev/null
@@ -1,49 +0,0 @@
-Doctrine has very comprehensive and fast caching solution.
-Its cache is **always up-to-date**.
-In order to achieve this doctrine does the following things:
-
-
-
-|| 1. Every Doctrine_Table has its own cache directory. The default is cache/componentname/. All the cache files are saved into that directory.
-The format of each cache file is [primarykey].cache.
-
-
-
-2. When retrieving records from the database doctrine always tries to hit the cache first.
-
-
-
-3. If a record (Doctrine_Record) is retrieved from database or inserted into database it will be saved into cache.
-
-
-
-4. When a Data Access Object is deleted or updated it will be deleted from the cache ||
-
-
-
-Now one might wonder that this kind of solution won't work since eventually the cache will be a copy of database!
-So doctrine does the following things to ensure the cache won't get too big:
-
-
-
-|| 1. Every time a cache file is accessed the id of that record will be added into the $fetched property of Doctrine_Cache
-
-
-
-2. At the end of each script the Doctrine_Cache destructor will write all these primary keys at the end of a stats.cache file
-
-
-
-3. Doctrine does propabalistic cache cleaning. The default interval is 200 page loads (= 200 constructed Doctrine_Managers). Basically this means
-that the average number of page loads between cache cleans is 200.
-
-
-
-4. On every cache clean stats.cache files are being read and the least accessed cache files
-(cache files that have the smallest id occurance in the stats file) are then deleted. 
-For example if the cache size is set to 200 and the number of files in cache is 300, then 100 least accessed files are being deleted.
-Doctrine also clears every stats.cache file. ||
-
-
-
-So for every 199 fast page loads there is one page load which suffers a little overhead from the cache cleaning operation.
diff --git a/manual/docs/Caching - Availible options.php b/manual/docs/Caching - Availible options.php
deleted file mode 100644
index a640a9459..000000000
--- a/manual/docs/Caching - Availible options.php	
+++ /dev/null
@@ -1,18 +0,0 @@
-Doctrine_Cache offers many options for performance fine-tuning:
-
-*  savePropability 
-
-Option that defines the propability of which
-a query is getting cached.
-
-
-
-*  cleanPropability 
-
-Option that defines the propability the actual cleaning will occur
-when calling Doctrine_Cache::clean();
-
-
-
-*  statsPropability
-
    diff --git a/manual/docs/Caching - Introduction.php b/manual/docs/Caching - Introduction.php deleted file mode 100644 index a65af93b7..000000000 --- a/manual/docs/Caching - Introduction.php +++ /dev/null @@ -1,63 +0,0 @@ - -Doctrine_Cache offers an intuitive and easy-to-use query caching solution. It provides the following things: - - * Multiple cache backends to choose from (including Memcached, APC and Sqlite) - - - - - * Manual tuning and/or self-optimization. Doctrine_Cache knows how to optimize itself, yet it leaves user - full freedom of whether or not he/she wants to take advantage of this feature. - - - - - * Advanced options for fine-tuning. Doctrine_Cache has many options for fine-tuning performance. - - - - - * Cache hooks itself directly into Doctrine_Db eventlistener system allowing it to be easily added on-demand. - - - - - -Doctrine_Cache hooks into Doctrine_Db eventlistener system allowing pluggable caching. -It evaluates queries and puts SELECT statements in cache. The caching is based on propabalistics. For example -if savePropability = 0.1 there is a 10% chance that a query gets cached. - - - -Now eventually the cache would grow very big, hence Doctrine uses propabalistic cache cleaning. -When calling Doctrine_Cache::clean() with cleanPropability = 0.25 there is a 25% chance of the clean operation being invoked. -What the cleaning does is that it first reads all the queries in the stats file and sorts them by the number of times occurred. -Then if the size is set to 100 it means the cleaning operation will leave 100 most issued queries in cache and delete all other cache entries. - - - - - - - - -Initializing a new cache instance: - - - - -\$dbh = new Doctrine_Db('mysql:host=localhost;dbname=test', \$user, \$pass); - -\$cache = new Doctrine_Cache('memcache'); - -// register it as a Doctrine_Db listener - -\$dbh->addListener(\$cache); -?> - - - -Now you know how to set up the query cache. In the next chapter you'll learn how to tweak the cache in order to get maximum performance. - - - diff --git a/manual/docs/Coding standards - Coding Style - Arrays.php b/manual/docs/Coding standards - Coding Style - Arrays.php deleted file mode 100644 index 63b5c7973..000000000 --- a/manual/docs/Coding standards - Coding Style - Arrays.php +++ /dev/null @@ -1,28 +0,0 @@ - -* Negative numbers are not permitted as indices. - - -* An indexed array may be started with any non-negative number, however this is discouraged and it is recommended that all arrays have a base index of 0. - - -* When declaring indexed arrays with the array construct, a trailing space must be added after each comma delimiter to improve readability. - - -* It is also permitted to declare multiline indexed arrays using the "array" construct. In this case, each successive line must be padded with spaces. - - -* When declaring associative arrays with the array construct, it is encouraged to break the statement into multiple lines. In this case, each successive line must be padded with whitespace such that both the keys and the values are aligned: - - - -$sampleArray = array('Doctrine', 'ORM', 1, 2, 3); - - -$sampleArray = array(1, 2, 3, - $a, $b, $c, - 56.44, $d, 500); - - -$sampleArray = array('first' => 'firstValue', - 'second' => 'secondValue'); - diff --git a/manual/docs/Coding standards - Coding Style - Classes.php b/manual/docs/Coding standards - Coding Style - Classes.php deleted file mode 100644 index f27eec354..000000000 --- a/manual/docs/Coding standards - Coding Style - Classes.php +++ /dev/null @@ -1,30 +0,0 @@ - -* Classes must be named by following the naming conventions. - - -* The brace is always written right after the class name (or interface declaration). - - -* Every class must have a documentation block that conforms to the PHPDocumentor standard. - - -* Any code within a class must be indented four spaces. - - -* Only one class is permitted per PHP file. - - -* Placing additional code in a class file is NOT permitted. - -This is an example of an acceptable class declaration: - - - - -/** - * Documentation here - */ -class Doctrine_SampleClass { - // entire content of class - // must be indented four spaces -} diff --git a/manual/docs/Coding standards - Coding Style - Control statements.php b/manual/docs/Coding standards - Coding Style - Control statements.php deleted file mode 100644 index 20711f2fe..000000000 --- a/manual/docs/Coding standards - Coding Style - Control statements.php +++ /dev/null @@ -1,68 +0,0 @@ - - -* Control statements based on the if and elseif constructs must have a single space before the opening parenthesis of the conditional, and a single space after the closing parenthesis. - - -* Within the conditional statements between the parentheses, operators must be separated by spaces for readability. Inner parentheses are encouraged to improve logical grouping of larger conditionals. - - -* The opening brace is written on the same line as the conditional statement. The closing brace is always written on its own line. Any content within the braces must be indented four spaces. - - -if (\$foo != 2) { - \$foo = 2; -} - -* For "if" statements that include "elseif" or "else", the formatting must be as in these examples: - - -if (\$foo != 1) { - \$foo = 1; -} else { - \$foo = 3; -} -if (\$foo != 2) { - \$foo = 2; -} elseif (\$foo == 1) { - \$foo = 3; -} else { - \$foo = 11; -} - - -* PHP allows for these statements to be written without braces in some circumstances, the following format for if statements is also allowed: - - -if (\$foo != 1) - \$foo = 1; -else - \$foo = 3; - -if (\$foo != 2) - \$foo = 2; -elseif (\$foo == 1) - \$foo = 3; -else - \$foo = 11; - - -* Control statements written with the "switch" construct must have a single space before the opening parenthesis of the conditional statement, and also a single space after the closing parenthesis. - - -* All content within the "switch" statement must be indented four spaces. Content under each "case" statement must be indented an additional four spaces but the breaks must be at the same indentation level as the "case" statements. - - -switch (\$case) { - case 1: - case 2: - break; - case 3: - break; - default: - break; -} -?> - -* The construct default may never be omitted from a switch statement. - - diff --git a/manual/docs/Coding standards - Coding Style - Functions and methods.php b/manual/docs/Coding standards - Coding Style - Functions and methods.php deleted file mode 100644 index fdb99a3e1..000000000 --- a/manual/docs/Coding standards - Coding Style - Functions and methods.php +++ /dev/null @@ -1,89 +0,0 @@ - - -* Methods must be named by following the naming conventions. - - -* Methods must always declare their visibility by using one of the private, protected, or public constructs. - - -* Like classes, the brace is always written right after the method name. There is no space between the function name and the opening parenthesis for the arguments. - - -* Functions in the global scope are strongly discouraged. - - -* This is an example of an acceptable function declaration in a class: - - - -/** - * Documentation Block Here - */ -class Foo { - /** - * Documentation Block Here - */ - public function bar() { - // entire content of function - // must be indented four spaces - } -} - -* Passing by-reference is permitted in the function declaration only: - - -/** - * Documentation Block Here - */ -class Foo { - /** - * Documentation Block Here - */ - public function bar(&\$baz) { - } -} - - -* Call-time pass by-reference is prohibited. - - -* The return value must not be enclosed in parentheses. This can hinder readability and can also break code if a method is later changed to return by reference. - - -/** - * Documentation Block Here - */ -class Foo { - /** - * WRONG - */ - public function bar() { - return(\$this->bar); - } - /** - * RIGHT - */ - public function bar() { - return \$this->bar; - } -} - -* Function arguments are separated by a single trailing space after the comma delimiter. This is an example of an acceptable function call for a function that takes three arguments: - - -threeArguments(1, 2, 3); -?> - -* Call-time pass by-reference is prohibited. See the function declarations section for the proper way to pass function arguments by-reference. - - -* For functions whose arguments permitted arrays, the function call may include the "array" construct and can be split into multiple lines to improve readability. In these cases, the standards for writing arrays still apply: - - -threeArguments(array(1, 2, 3), 2, 3); - -threeArguments(array(1, 2, 3, 'Framework', - 'Doctrine', 56.44, 500), 2, 3); -?> - - diff --git a/manual/docs/Coding standards - Coding Style - Inline documentation.php b/manual/docs/Coding standards - Coding Style - Inline documentation.php deleted file mode 100644 index 3bf61d3e9..000000000 --- a/manual/docs/Coding standards - Coding Style - Inline documentation.php +++ /dev/null @@ -1,36 +0,0 @@ -Documentation Format - -* All documentation blocks ("docblocks") must be compatible with the phpDocumentor format. Describing the phpDocumentor format is beyond the scope of this document. For more information, visit: http://phpdoc.org/ - - -Methods: - -* Every method, must have a docblock that contains at a minimum: - - - -* A description of the function - - - -* All of the arguments - - - -* All of the possible return values - - - - -* It is not necessary to use the "@access" tag because the access level is already known from the "public", "private", or "protected" construct used to declare the function. - - - -* If a function/method may throw an exception, use @throws: - - - - -* @throws exceptionclass [description] - - diff --git a/manual/docs/Coding standards - Coding Style - PHP code demarcation.php b/manual/docs/Coding standards - Coding Style - PHP code demarcation.php deleted file mode 100644 index 5d58ff372..000000000 --- a/manual/docs/Coding standards - Coding Style - PHP code demarcation.php +++ /dev/null @@ -1,5 +0,0 @@ -PHP code must always be delimited by the full-form, standard PHP tags () - -Short tags are never allowed. For files containing only PHP code, the closing tag must always be omitted - - diff --git a/manual/docs/Coding standards - Coding Style - Strings.php b/manual/docs/Coding standards - Coding Style - Strings.php deleted file mode 100644 index 4a276d2e7..000000000 --- a/manual/docs/Coding standards - Coding Style - Strings.php +++ /dev/null @@ -1,37 +0,0 @@ - -* When a string is literal (contains no variable substitutions), the apostrophe or "single quote" must always used to demarcate the string: - - -* When a literal string itself contains apostrophes, it is permitted to demarcate the string with quotation marks or "double quotes". This is especially encouraged for SQL statements: - - -* Variable substitution is permitted using the following form: - - - -* Strings may be concatenated using the "." operator. A space must always be added before and after the "." operator to improve readability: - - - -* When concatenating strings with the "." operator, it is permitted to break the statement into multiple lines to improve readability. In these cases, each successive line should be padded with whitespace such that the "."; operator is aligned under the "=" operator: - - - - -// literal string -$string = 'something'; - -// string contains apostrophes -$sql = "SELECT id, name FROM people WHERE name = 'Fred' OR name = 'Susan'"; - -// variable substitution -$greeting = "Hello $name, welcome back!"; - -// concatenation -$framework = 'Doctrine' . ' ORM ' . 'Framework'; - -// concatenation line breaking - -$sql = "SELECT id, name FROM user " - . "WHERE name = ? " - . "ORDER BY name ASC"; diff --git a/manual/docs/Coding standards - Naming Conventions - Classes.php b/manual/docs/Coding standards - Naming Conventions - Classes.php deleted file mode 100644 index 9986e5391..000000000 --- a/manual/docs/Coding standards - Naming Conventions - Classes.php +++ /dev/null @@ -1,14 +0,0 @@ - -* The Doctrine ORM Framework uses the same class naming convention as PEAR and Zend framework, where the names of the classes directly -map to the directories in which they are stored. The root level directory of the Doctrine Framework is the "Doctrine/" directory, -under which all classes are stored hierarchially. - - -* Class names may only contain alphanumeric characters. Numbers are permitted in class names but are discouraged. -Underscores are only permitted in place of the path separator, eg. the filename "Doctrine/Table/Exception.php" must map to the class name "Doctrine_Table_Exception". - - -* If a class name is comprised of more than one word, the first letter of each new word must be capitalized. Successive capitalized letters -are not allowed, e.g. a class "XML_Reader" is not allowed while "Xml_Reader" is acceptable. - - diff --git a/manual/docs/Coding standards - Naming Conventions - Constants.php b/manual/docs/Coding standards - Naming Conventions - Constants.php deleted file mode 100644 index ae68ead82..000000000 --- a/manual/docs/Coding standards - Naming Conventions - Constants.php +++ /dev/null @@ -1,17 +0,0 @@ -Following rules must apply to all constants used within Doctrine framework: - -* Constants may contain both alphanumeric characters and the underscore. - -* Constants must always have all letters capitalized. - -* For readablity reasons, words in constant names must be separated by underscore characters. For example, ATTR_EXC_LOGGING is permitted but ATTR_EXCLOGGING is not. - -* Constants must be defined as class members by using the "const" construct. Defining constants in the global scope with "define" is NOT permitted. - - - -class Doctrine_SomeClass { - const MY_CONSTANT = 'something'; -} -print Doctrine_SomeClass::MY_CONSTANT; - diff --git a/manual/docs/Coding standards - Naming Conventions - Filenames.php b/manual/docs/Coding standards - Naming Conventions - Filenames.php deleted file mode 100644 index 263701db7..000000000 --- a/manual/docs/Coding standards - Naming Conventions - Filenames.php +++ /dev/null @@ -1,20 +0,0 @@ - -* For all other files, only alphanumeric characters, underscores, and the dash character ("-") are permitted. Spaces are prohibited. - - - -* Any file that contains any PHP code must end with the extension ".php". These examples show the acceptable filenames for containing the class names from the examples in the section above: - - - -Doctrine/Db.php - - - -Doctrine/Connection/Transaction.php - - - -* File names must follow the mapping to class names described above. - - diff --git a/manual/docs/Coding standards - Naming Conventions - Functions and methods.php b/manual/docs/Coding standards - Naming Conventions - Functions and methods.php deleted file mode 100644 index a768ad020..000000000 --- a/manual/docs/Coding standards - Naming Conventions - Functions and methods.php +++ /dev/null @@ -1,21 +0,0 @@ - -* Function names may only contain alphanumeric characters. Underscores are not permitted. Numbers are permitted in function names but are discouraged. - - - -* Function names must always start with a lowercase letter. When a function name consists of more than one word, the first letter of each new word must be capitalized. This is commonly called the "studlyCaps" or "camelCaps" method. - - - -* Verbosity is encouraged. Function names should be as verbose as is practical to enhance the understandability of code. - - - -* For object-oriented programming, accessors for objects should always be prefixed with either "get" or "set". This applies to all classes except for Doctrine_Record which has some accessor methods prefixed with 'obtain' and 'assign'. The reason -for this is that since all user defined ActiveRecords inherit Doctrine_Record, it should populate the get / set namespace as little as possible. - - - -* Functions in the global scope ("floating functions") are NOT permmitted. All static functions should be wrapped in a static class. - - diff --git a/manual/docs/Coding standards - Naming Conventions - Interfaces.php b/manual/docs/Coding standards - Naming Conventions - Interfaces.php deleted file mode 100644 index 52e90d58a..000000000 --- a/manual/docs/Coding standards - Naming Conventions - Interfaces.php +++ /dev/null @@ -1,15 +0,0 @@ - -* Interface classes must follow the same conventions as other classes (see above), however must end with the word "Interface" -(unless the interface is approved not to contain it such as Doctrine_Overloadable). Some examples: - - - - -Doctrine_Db_EventListener_Interface - - - -Doctrine_EventListener_Interface - - - diff --git a/manual/docs/Coding standards - Naming Conventions - Record columns.php b/manual/docs/Coding standards - Naming Conventions - Record columns.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Coding standards - Naming Conventions - Record columns.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Coding standards - Naming Conventions - Variables.php b/manual/docs/Coding standards - Naming Conventions - Variables.php deleted file mode 100644 index 102214560..000000000 --- a/manual/docs/Coding standards - Naming Conventions - Variables.php +++ /dev/null @@ -1,30 +0,0 @@ -All variables must satisfy the following conditions: - - -* Variable names may only contain alphanumeric characters. Underscores are not permitted. Numbers are permitted in variable names but are discouraged. - - - -* Variable names must always start with a lowercase letter and follow the "camelCaps" capitalization convention. - - - -* Verbosity is encouraged. Variables should always be as verbose as practical. Terse variable names such as "$i" and "$n" are discouraged for anything other than the smallest loop contexts. If a loop contains more than 20 lines of code, the variables for the indices need to have more descriptive names. - - - -* Within the framework certain generic object variables should always use the following names: - - - * Doctrine_Connection -> //$conn// - * Doctrine_Collection -> //$coll// - * Doctrine_Manager -> //$manager// - * Doctrine_Query -> //$query// - * Doctrine_Db -> //$db// - - - There are cases when more descriptive names are more appropriate (for example when multiple objects of the same class are used in same context), - in that case it is allowed to use different names than the ones mentioned. - - - diff --git a/manual/docs/Coding standards - Overview - Goals.php b/manual/docs/Coding standards - Overview - Goals.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Coding standards - Overview - Goals.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Coding standards - Overview - Scope.php b/manual/docs/Coding standards - Overview - Scope.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Coding standards - Overview - Scope.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Coding standards - PHP File Formatting - General.php b/manual/docs/Coding standards - PHP File Formatting - General.php deleted file mode 100644 index a166c26fa..000000000 --- a/manual/docs/Coding standards - PHP File Formatting - General.php +++ /dev/null @@ -1,7 +0,0 @@ -For files that contain only PHP code, the closing tag ("?>") is never permitted. It is not required by PHP. Not including it prevents trailing whitespace from being accidentally injected into the output. - - - -IMPORTANT: Inclusion of arbitrary binary data as permitted by __HALT_COMPILER() is prohibited from any Doctrine framework PHP file or files derived from them. Use of this feature is only permitted for special installation scripts. - - diff --git a/manual/docs/Coding standards - PHP File Formatting - Indentation.php b/manual/docs/Coding standards - PHP File Formatting - Indentation.php deleted file mode 100644 index 48089411d..000000000 --- a/manual/docs/Coding standards - PHP File Formatting - Indentation.php +++ /dev/null @@ -1,2 +0,0 @@ -Use an indent of 4 spaces, with no tabs. - diff --git a/manual/docs/Coding standards - PHP File Formatting - Line termination.php b/manual/docs/Coding standards - PHP File Formatting - Line termination.php deleted file mode 100644 index 810e3f209..000000000 --- a/manual/docs/Coding standards - PHP File Formatting - Line termination.php +++ /dev/null @@ -1,11 +0,0 @@ - -* Line termination is the standard way for Unix text files. Lines must end only with a linefeed (LF). Linefeeds are represented as ordinal 10, or hexadecimal 0x0A. - - -* Do not use carriage returns (CR) like Macintosh computers (0x0D). - - -* Do not use the carriage return/linefeed combination (CRLF) as Windows computers (0x0D, 0x0A). - - - diff --git a/manual/docs/Coding standards - PHP File Formatting - Maximum line length.php b/manual/docs/Coding standards - PHP File Formatting - Maximum line length.php deleted file mode 100644 index 3d45cd32c..000000000 --- a/manual/docs/Coding standards - PHP File Formatting - Maximum line length.php +++ /dev/null @@ -1,2 +0,0 @@ -The target line length is 80 characters, i.e. developers should aim keep code as close to the 80-column boundary as is practical. However, longer lines are acceptable. The maximum length of any line of PHP code is 120 characters. - diff --git a/manual/docs/Coding standards - Testing - Writing tests.php b/manual/docs/Coding standards - Testing - Writing tests.php deleted file mode 100644 index 5698664a0..000000000 --- a/manual/docs/Coding standards - Testing - Writing tests.php +++ /dev/null @@ -1,56 +0,0 @@ -**CLASSES** - - - -* -All test classes should be referring to a class or specific testing aspect of some class. - - - -For example //Doctrine_Record_TestCase// is a valid name since its referring to class named -//Doctrine_Record//. - - - -//Doctrine_Record_State_TestCase// is also a valid name since its referring to testing the state aspect -of the Doctrine_Record class. - - - -However something like //Doctrine_PrimaryKey_TestCase// is not valid since its way too generic. - - - -* Every class should have atleast one TestCase equivalent -* All testcase classes should inherit Doctrine_UnitTestCase - - - - -**METHODS** - - - -* All methods should support agile documentation; if some method failed it should be evident from the name of the test method what went wrong. -Also the test method names should give information of the system they test. - - -For example //Doctrine_Export_Pgsql_TestCase::testCreateTableSupportsAutoincPks()// is a valid test method name. Just by looking at it we know -what it is testing. Also we can run agile documentation tool to get little up-to-date system information. - - - -NOTE: Commonly used testing method naming convention TestCase::test[methodName] is *NOT* allowed in Doctrine. So in this case -Doctrine_Export_Pgsql_TestCase::testCreateTable()** would not be allowed! - - - -* Test method names can often be long. However the content within the methods should rarely be more than dozen lines long. If you need several assert-calls -divide the method into smaller methods. - -**ASSERTIONS** - - - -* There should never be assertions within any loops and rarely within functions. - diff --git a/manual/docs/Configuration - Custom getters and setters.php b/manual/docs/Configuration - Custom getters and setters.php deleted file mode 100644 index b264d58fa..000000000 --- a/manual/docs/Configuration - Custom getters and setters.php +++ /dev/null @@ -1,22 +0,0 @@ - - -class Customer extends Doctrine_Record { - public function setUp() { - // setup code goes here - } - public function setTableDefinition() { - // table definition code goes here - } - - public function getAvailibleProducts() { - // some code - } - public function setName($name) { - if($this->isValidName($name)) - $this->set("name",$name); - } - public function getName() { - return $this->get("name"); - } -} - diff --git a/manual/docs/Configuration - Custom primary key column.php b/manual/docs/Configuration - Custom primary key column.php deleted file mode 100644 index 7cb9b3cde..000000000 --- a/manual/docs/Configuration - Custom primary key column.php +++ /dev/null @@ -1,10 +0,0 @@ - - -// custom primary key column name - -class Group extends Doctrine_Record { - public function setUp() { - $this->setPrimaryKeyColumn("group_id"); - } -} - diff --git a/manual/docs/Configuration - Introduction.php b/manual/docs/Configuration - Introduction.php deleted file mode 100644 index 35c67ae59..000000000 --- a/manual/docs/Configuration - Introduction.php +++ /dev/null @@ -1,6 +0,0 @@ - - -$manager = Doctrine_Manager::getInstance(); - -$manager->setAttribute(Doctrine::ATTR_LISTENER, new MyListener()); - diff --git a/manual/docs/Configuration - Levels of configuration.php b/manual/docs/Configuration - Levels of configuration.php deleted file mode 100644 index f86272d9e..000000000 --- a/manual/docs/Configuration - Levels of configuration.php +++ /dev/null @@ -1,41 +0,0 @@ -Doctrine has a three-level configuration structure. You can set configuration attributes in global, connection and table level. -If the same attribute is set on both lower level and upper level, the uppermost attribute will always be used. So for example -if user first sets default fetchmode in global level to Doctrine::FETCH_BATCH and then sets 'example' table fetchmode to Doctrine::FETCH_LAZY, -the lazy fetching strategy will be used whenever the records of 'example' table are being fetched. - - - - -* Global level - - The attributes set in global level will affect every connection and every table in each connection. - -* Connection level - - The attributes set in connection level will take effect on each table in that connection. - -* Table level - - The attributes set in table level will take effect only on that table. - - - -// setting a global level attribute -$manager = Doctrine_Manager::getInstance(); - -$manager->setAttribute(Doctrine::ATTR_VLD, false); - -// setting a connection level attribute -// (overrides the global level attribute on this connection) - -$conn = $manager->openConnection(new PDO('dsn', 'username', 'pw')); - -$conn->setAttribute(Doctrine::ATTR_VLD, true); - -// setting a table level attribute -// (overrides the connection/global level attribute on this table) - -$table = $conn->getTable('User'); - -$table->setAttribute(Doctrine::ATTR_LISTENER, new UserListener()); - diff --git a/manual/docs/Configuration - List of attributes.php b/manual/docs/Configuration - List of attributes.php deleted file mode 100644 index ffdd94e75..000000000 --- a/manual/docs/Configuration - List of attributes.php +++ /dev/null @@ -1,44 +0,0 @@ - * Doctrine::ATTR_LISTENER - * Doctrine::ATTR_FETCHMODE = 2; - - * Doctrine::ATTR_CACHE_DIR = 3; - - * Doctrine::ATTR_CACHE_TTL = 4; - - * Doctrine::ATTR_CACHE_SIZE = 5; - - * Doctrine::ATTR_CACHE_SLAM = 6; - - * Doctrine::ATTR_CACHE = 7; - - * Doctrine::ATTR_BATCH_SIZE = 8; - - * Doctrine::ATTR_PK_COLUMNS = 9; - /** - * primary key type attribute - */ - * Doctrine::ATTR_PK_TYPE = 10; - /** - * locking attribute - */ - * Doctrine::ATTR_LOCKMODE = 11; - /** - * validatate attribute - */ - * Doctrine::ATTR_VLD = 12; - /** - * name prefix attribute - */ - * Doctrine::ATTR_NAME_PREFIX = 13; - /** - * create tables attribute - */ - * Doctrine::ATTR_CREATE_TABLES = 14; - /** - * collection key attribute - */ - * Doctrine::ATTR_COLL_KEY = 15; - /** - * collection limit attribute - */ - * Doctrine::ATTR_COLL_LIMIT = 16; diff --git a/manual/docs/Configuration - Setting attributes - Batch size.php b/manual/docs/Configuration - Setting attributes - Batch size.php deleted file mode 100644 index b5324f23b..000000000 --- a/manual/docs/Configuration - Setting attributes - Batch size.php +++ /dev/null @@ -1,6 +0,0 @@ - - -// setting default batch size for batch collections - -$manager->setAttribute(Doctrine::ATTR_BATCH_SIZE, 7); - diff --git a/manual/docs/Configuration - Setting attributes - Event listener.php b/manual/docs/Configuration - Setting attributes - Event listener.php deleted file mode 100644 index 61cf10e8d..000000000 --- a/manual/docs/Configuration - Setting attributes - Event listener.php +++ /dev/null @@ -1,6 +0,0 @@ - - -// setting default event listener - -$manager->setAttribute(Doctrine::ATTR_LISTENER, new MyListener()); - diff --git a/manual/docs/Configuration - Setting attributes - Fetching strategy.php b/manual/docs/Configuration - Setting attributes - Fetching strategy.php deleted file mode 100644 index 518fbae0b..000000000 --- a/manual/docs/Configuration - Setting attributes - Fetching strategy.php +++ /dev/null @@ -1,6 +0,0 @@ - - -// sets the default collection type (fetching strategy) - -$manager->setAttribute(Doctrine::ATTR_FETCHMODE, Doctrine::FETCH_LAZY); - diff --git a/manual/docs/Configuration - Setting attributes - Identifier quoting.php b/manual/docs/Configuration - Setting attributes - Identifier quoting.php deleted file mode 100644 index 77f627e58..000000000 --- a/manual/docs/Configuration - Setting attributes - Identifier quoting.php +++ /dev/null @@ -1,59 +0,0 @@ - -You can quote the db identifiers (table and field names) with quoteIdentifier(). The delimiting style depends on which database driver is being used. NOTE: just because you CAN use delimited identifiers, it doesn't mean you SHOULD use them. In general, they end up causing way more problems than they solve. Anyway, it may be necessary when you have a reserved word as a field name (in this case, we suggest you to change it, if you can). - -Some of the internal Doctrine methods generate queries. Enabling the "quote_identifier" attribute of Doctrine you can tell Doctrine to quote the identifiers in these generated queries. For all user supplied queries this option is irrelevant. - -Portability is broken by using the following characters inside delimited identifiers: - - - - - -* backtick (`) -- due to MySQL - -* double quote (") -- due to Oracle - -* brackets ([ or ]) -- due to Access - - -Delimited identifiers are known to generally work correctly under the following drivers: - - - -* Mssql - -* Mysql - -* Oracle - -* Pgsql - -* Sqlite - -* Firebird - - - -When using the quoteIdentifiers option, all of the field identifiers will be automatically quoted in the resulting SQL statements: - - - - -\$conn->setAttribute('quote_identifiers', true); -?> - - - - - -will result in a SQL statement that all the field names are quoted with the backtick '`' operator (in MySQL). - - -
    SELECT * FROM `sometable` WHERE `id` = '123'
    - - -as opposed to: - - -
    SELECT * FROM sometable WHERE id='123'
    - diff --git a/manual/docs/Configuration - Setting attributes - Offset collection limit.php b/manual/docs/Configuration - Setting attributes - Offset collection limit.php deleted file mode 100644 index 1c6879b28..000000000 --- a/manual/docs/Configuration - Setting attributes - Offset collection limit.php +++ /dev/null @@ -1,6 +0,0 @@ - - -// sets the default offset collection limit - -$manager->setAttribute(Doctrine::ATTR_COLL_LIMIT, 10); - diff --git a/manual/docs/Configuration - Setting attributes - Portability.php b/manual/docs/Configuration - Setting attributes - Portability.php deleted file mode 100644 index c6e09ac53..000000000 --- a/manual/docs/Configuration - Setting attributes - Portability.php +++ /dev/null @@ -1,122 +0,0 @@ -Each database management system (DBMS) has it's own behaviors. For example, some databases capitalize field names in their output, some lowercase them, while others leave them alone. These quirks make it difficult to port your scripts over to another server type. PEAR Doctrine:: strives to overcome these differences so your program can switch between DBMS's without any changes. - -You control which portability modes are enabled by using the portability configuration option. Configuration options are set via factory() and setOption(). - -The portability modes are bitwised, so they can be combined using | and removed using ^. See the examples section below on how to do this. - - - -Portability Mode Constants - - - - -//Doctrine::PORTABILITY_ALL (default)// - - - -turn on all portability features. this is the default setting. - - - -//Doctrine::PORTABILITY_DELETE_COUNT// - - - -Force reporting the number of rows deleted. Some DBMS's don't count the number of rows deleted when performing simple DELETE FROM tablename queries. This mode tricks such DBMS's into telling the count by adding WHERE 1=1 to the end of DELETE queries. - - - -//Doctrine::PORTABILITY_EMPTY_TO_NULL// - - - -Convert empty strings values to null in data in and output. Needed because Oracle considers empty strings to be null, while most other DBMS's know the difference between empty and null. - - - -//Doctrine::PORTABILITY_ERRORS// - - - -Makes certain error messages in certain drivers compatible with those from other DBMS's - - - - -Table 33-1. Error Code Re-mappings - -Driver Description Old Constant New Constant -mysql, mysqli unique and primary key constraints Doctrine::ERROR_ALREADY_EXISTS Doctrine::ERROR_CONSTRAINT -mysql, mysqli not-null constraints Doctrine::ERROR_CONSTRAINT Doctrine::ERROR_CONSTRAINT_NOT_NULL - - - - -//Doctrine::PORTABILITY_FIX_ASSOC_FIELD_NAMES// - - - -This removes any qualifiers from keys in associative fetches. some RDBMS , like for example SQLite, will be default use the fully qualified name for a column in assoc fetches if it is qualified in a query. - - - -//Doctrine::PORTABILITY_FIX_CASE// - - - -Convert names of tables and fields to lower or upper case in all methods. The case depends on the 'field_case' option that may be set to either CASE_LOWER (default) or CASE_UPPER - - - -//Doctrine::PORTABILITY_NONE// - - - -Turn off all portability features - - - -//Doctrine::PORTABILITY_NUMROWS// - - - -Enable hack that makes numRows() work in Oracle - - - -//Doctrine::PORTABILITY_RTRIM// - - - -Right trim the data output for all data fetches. This does not applied in drivers for RDBMS that automatically right trim values of fixed length character values, even if they do not right trim value of variable length character values. - - - - - -Using setAttribute() to enable portability for lowercasing and trimming - - - - -$conn->setAttribute('portability', - Doctrine::PORTABILITY_FIX_CASE | Doctrine::PORTABILITY_RTRIM); - -?> - - - - - - -Using setAttribute() to enable all portability options except trimming - - - - - -$conn->setAttribute('portability', - Doctrine::PORTABILITY_ALL ^ Doctrine::PORTABILITY_RTRIM); -?> - diff --git a/manual/docs/Configuration - Setting attributes - Session lockmode.php b/manual/docs/Configuration - Setting attributes - Session lockmode.php deleted file mode 100644 index 82fb24a7e..000000000 --- a/manual/docs/Configuration - Setting attributes - Session lockmode.php +++ /dev/null @@ -1,6 +0,0 @@ - - -// setting default lockmode - -$manager->setAttribute(Doctrine::ATTR_LOCKMODE, Doctrine::LOCK_PESSIMISTIC); - diff --git a/manual/docs/Configuration - Setting attributes - Table creation.php b/manual/docs/Configuration - Setting attributes - Table creation.php deleted file mode 100644 index dd3e2c114..000000000 --- a/manual/docs/Configuration - Setting attributes - Table creation.php +++ /dev/null @@ -1,6 +0,0 @@ - - -// turns automatic table creation off - -$manager->setAttribute(Doctrine::ATTR_CREATE_TABLES, false); - diff --git a/manual/docs/Configuration - Setting attributes - Validation.php b/manual/docs/Configuration - Setting attributes - Validation.php deleted file mode 100644 index 91302dbf8..000000000 --- a/manual/docs/Configuration - Setting attributes - Validation.php +++ /dev/null @@ -1,6 +0,0 @@ - - -// turns transactional validation on - -$manager->setAttribute(Doctrine::ATTR_VLD, true); - diff --git a/manual/docs/Configuration - Setting default eventlistener.php b/manual/docs/Configuration - Setting default eventlistener.php deleted file mode 100644 index 8bf431544..000000000 --- a/manual/docs/Configuration - Setting default eventlistener.php +++ /dev/null @@ -1,11 +0,0 @@ - - -class Email extends Doctrine_Record { - public function setUp() { - $this->setAttribute(Doctrine::ATTR_LISTENER,new MyListener()); - } - public function setTableDefinition() { - $this->hasColumn("address","string",150,"email|unique"); - } -} - diff --git a/manual/docs/Configuration - Setting default fetchmode.php b/manual/docs/Configuration - Setting default fetchmode.php deleted file mode 100644 index 09e50959e..000000000 --- a/manual/docs/Configuration - Setting default fetchmode.php +++ /dev/null @@ -1,12 +0,0 @@ - - -// setting default fetchmode -// availible fetchmodes are Doctrine::FETCH_LAZY, Doctrine::FETCH_IMMEDIATE and Doctrine::FETCH_BATCH -// the default fetchmode is Doctrine::FETCH_LAZY - -class Address extends Doctrine_Record { - public function setUp() { - $this->setAttribute(Doctrine::ATTR_FETCHMODE,Doctrine::FETCH_IMMEDIATE); - } -} - diff --git a/manual/docs/Configuration - Using sequences.php b/manual/docs/Configuration - Using sequences.php deleted file mode 100644 index af5767efa..000000000 --- a/manual/docs/Configuration - Using sequences.php +++ /dev/null @@ -1,10 +0,0 @@ - - -// using sequences - -class User extends Doctrine_Record { - public function setUp() { - $this->setSequenceName("user_seq"); - } -} - diff --git a/manual/docs/Connection management - Connection-component binding.php b/manual/docs/Connection management - Connection-component binding.php deleted file mode 100644 index 825113e8d..000000000 --- a/manual/docs/Connection management - Connection-component binding.php +++ /dev/null @@ -1,24 +0,0 @@ - -Doctrine allows you to bind connections to components (= your ActiveRecord classes). This means everytime a component issues a query -or data is being fetched from the table the component is pointing at Doctrine will use the bound connection. - - - - -$conn = $manager->openConnection(new PDO('dsn','username','password'), 'connection 1'); - -$conn2 = $manager->openConnection(new PDO('dsn2','username2','password2'), 'connection 2'); - -$manager->bindComponent('User', 'connection 1'); - -$manager->bindComponent('Group', 'connection 2'); - -$q = new Doctrine_Query(); - -// Doctrine uses 'connection 1' for fetching here -$users = $q->from('User u')->where('u.id IN (1,2,3)')->execute(); - -// Doctrine uses 'connection 2' for fetching here -$groups = $q->from('Group g')->where('g.id IN (1,2,3)')->execute(); - - diff --git a/manual/docs/Connection management - DSN, the Data Source Name.php b/manual/docs/Connection management - DSN, the Data Source Name.php deleted file mode 100644 index 906a7f3db..000000000 --- a/manual/docs/Connection management - DSN, the Data Source Name.php +++ /dev/null @@ -1,106 +0,0 @@ -In order to connect to a database through Doctrine, you have to create a valid DSN - data source name. - -Doctrine supports both PEAR DB/MDB2 like data source names as well as PDO style data source names. The following section deals with PEAR like data source names. If you need more info about the PDO-style data source names see http://www.php.net/manual/en/function.PDO-construct.php. - -The DSN consists in the following parts: - -**phptype**: Database backend used in PHP (i.e. mysql , pgsql etc.) -**dbsyntax**: Database used with regards to SQL syntax etc. -**protocol**: Communication protocol to use ( i.e. tcp, unix etc.) -**hostspec**: Host specification (hostname[:port]) -**database**: Database to use on the DBMS server -**username**: User name for login -**password**: Password for login -**proto_opts**: Maybe used with protocol -**option**: Additional connection options in URI query string format. options get separated by &. The Following table shows a non complete list of options: - - -**List of options** - -|| //Name// || //Description// || -|| charset || Some backends support setting the client charset.|| -|| new_link || Some RDBMS do not create new connections when connecting to the same host multiple times. This option will attempt to force a new connection. || - -The DSN can either be provided as an associative array or as a string. The string format of the supplied DSN is in its fullest form: -`` phptype(dbsyntax)://username:password@protocol+hostspec/database?option=value `` - - - -Most variations are allowed: - - -phptype://username:password@protocol+hostspec:110//usr/db_file.db -phptype://username:password@hostspec/database -phptype://username:password@hostspec -phptype://username@hostspec -phptype://hostspec/database -phptype://hostspec -phptype:///database -phptype:///database?option=value&anotheroption=anothervalue -phptype(dbsyntax) -phptype - - - -The currently supported database backends are: -||//fbsql//|| -> FrontBase || -||//ibase//|| -> InterBase / Firebird (requires PHP 5) || -||//mssql//|| -> Microsoft SQL Server (NOT for Sybase. Compile PHP --with-mssql) || -||//mysql//|| -> MySQL || -||//mysqli//|| -> MySQL (supports new authentication protocol) (requires PHP 5) || -||//oci8 //|| -> Oracle 7/8/9/10 || -||//pgsql//|| -> PostgreSQL || -||//querysim//|| -> QuerySim || -||//sqlite//|| -> SQLite 2 || - - - -A second DSN format is supported phptype(syntax)://user:pass@protocol(proto_opts)/database - - - -If your database, option values, username or password contain characters used to delineate DSN parts, you can escape them via URI hex encodings: -``: = %3a`` -``/ = %2f`` -``@ = %40`` -``+ = %2b`` -``( = %28`` -``) = %29`` -``? = %3f`` -``= = %3d`` -``& = %26`` - - - - -Warning -Please note, that some features may be not supported by all database backends. - - -Example -**Example 1.** Connect to database through a socket - -mysql://user@unix(/path/to/socket)/pear - - -**Example 2.** Connect to database on a non standard port - -pgsql://user:pass@tcp(localhost:5555)/pear - - -**Example 3.** Connect to SQLite on a Unix machine using options - -sqlite:////full/unix/path/to/file.db?mode=0666 - - -**Example 4.** Connect to SQLite on a Windows machine using options - -sqlite:///c:/full/windows/path/to/file.db?mode=0666 - - -**Example 5.** Connect to MySQLi using SSL - -mysqli://user:pass@localhost/pear?key=client-key.pem&cert=client-cert.pem - - - diff --git a/manual/docs/Connection management - Lazy-connecting to database.php b/manual/docs/Connection management - Lazy-connecting to database.php deleted file mode 100644 index b0bef6e16..000000000 --- a/manual/docs/Connection management - Lazy-connecting to database.php +++ /dev/null @@ -1,22 +0,0 @@ - -Lazy-connecting to database is handled via Doctrine_Db wrapper. When using Doctrine_Db instead of PDO / Doctrine_Adapter, lazy-connecting -to database is being performed (that means Doctrine will only connect to database when needed). - -This feature can be very useful -when using for example page caching, hence not actually needing a database connection on every request. Remember connecting to database is an expensive operation. - - - - -// we may use PDO / PEAR like DSN -// here we use PEAR like DSN -$dbh = new Doctrine_Db('mysql://username:password@localhost/test'); -// !! no actual database connection yet !! - -// initalize a new Doctrine_Connection -$conn = Doctrine_Manager::connection($dbh); -// !! no actual database connection yet !! - -// connects database and performs a query -$conn->query('FROM User u'); - diff --git a/manual/docs/Connection management - Managing connections.php b/manual/docs/Connection management - Managing connections.php deleted file mode 100644 index c38db5b4a..000000000 --- a/manual/docs/Connection management - Managing connections.php +++ /dev/null @@ -1,78 +0,0 @@ - -From the start Doctrine has been designed to work with multiple connections. Unless separately specified Doctrine always uses the current connection -for executing the queries. The following example uses openConnection() second argument as an optional -connection alias. - - - - -// Doctrine_Manager controls all the connections - -$manager = Doctrine_Manager::getInstance(); - -// open first connection - -$conn = $manager->openConnection(new PDO('dsn','username','password'), 'connection 1'); - - - - -For convenience Doctrine_Manager provides static method connection() which opens new connection when arguments are given to it and returns the current -connection when no arguments have been speficied. - - - - -// open first connection - -$conn = Doctrine_Manager::connection(new PDO('dsn','username','password'), 'connection 1'); - -$conn2 = Doctrine_Manager::connection(); - -// $conn2 == $conn - - - - - - -The current connection is the lastly opened connection. - - - - -// open second connection - -$conn2 = $manager->openConnection(new PDO('dsn2','username2','password2'), 'connection 2'); - -$manager->getCurrentConnection(); // $conn2 - - - - -You can change the current connection by calling setCurrentConnection(). - - - - -$manager->setCurrentConnection('connection 1'); - -$manager->getCurrentConnection(); // $conn - - - - - -You can iterate over the opened connection by simple passing the manager object to foreach clause. This is possible since Doctrine_Manager implements -special IteratorAggregate interface. - - - - -// iterating through connections - -foreach($manager as $conn) { - -} - - diff --git a/manual/docs/Connection management - Opening a new connection.php b/manual/docs/Connection management - Opening a new connection.php deleted file mode 100644 index 3ef8827ee..000000000 --- a/manual/docs/Connection management - Opening a new connection.php +++ /dev/null @@ -1,44 +0,0 @@ - -Opening a new database connection in Doctrine is very easy. If you wish to use PDO (www.php.net/PDO) you can just initalize a new PDO object: - - - - -$dsn = 'mysql:dbname=testdb;host=127.0.0.1'; -$user = 'dbuser'; -$password = 'dbpass'; - -try { - $dbh = new PDO($dsn, $user, $password); -} catch (PDOException $e) { - echo 'Connection failed: ' . $e->getMessage(); -} - - - - -If your database extension isn't supported by PDO you can use special Doctrine_Adapter class (if availible). The following example uses db2 adapter: - - - - -$dsn = 'db2:dbname=testdb;host=127.0.0.1'; -$user = 'dbuser'; -$password = 'dbpass'; - -try { - $dbh = Doctrine_Adapter::connect($dsn, $user, $password); -} catch (PDOException $e) { - echo 'Connection failed: ' . $e->getMessage(); -} - - - - -The next step is opening a new Doctrine_Connection. - - - - -$conn = Doctrine_Manager::connection($dbh); - diff --git a/manual/docs/Connection modules - DataDict - Getting database declaration.php b/manual/docs/Connection modules - DataDict - Getting database declaration.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Connection modules - DataDict - Getting database declaration.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Connection modules - DataDict - Getting portable type.php b/manual/docs/Connection modules - DataDict - Getting portable type.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Connection modules - DataDict - Getting portable type.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Connection modules - DataDict - Reserved keywords.php b/manual/docs/Connection modules - DataDict - Reserved keywords.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Connection modules - DataDict - Reserved keywords.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Connection modules - Export - Altering table.php b/manual/docs/Connection modules - Export - Altering table.php deleted file mode 100644 index 8f98ce7d9..000000000 --- a/manual/docs/Connection modules - Export - Altering table.php +++ /dev/null @@ -1,96 +0,0 @@ - -Doctrine_Export drivers provide an easy database portable way of altering existing database tables. - - - -NOTE: if you only want to get the generated sql (and not execute it) use Doctrine_Export::alterTableSql() - - - - -\$dbh = new PDO('dsn','username','pw'); -\$conn = Doctrine_Manager::getInstance() - ->openConnection(\$dbh); - -\$a = array('add' => array('name' => array('type' => 'string', 'length' => 255))); - - -\$conn->export->alterTableSql('mytable', \$a); - -// On mysql this method returns: -// ALTER TABLE mytable ADD COLUMN name VARCHAR(255) -?> - - - -Doctrine_Export::alterTable() takes two parameters: - - - -: string //$name// : name of the table that is intended to be changed. - -: array //$changes// : associative array that contains the details of each type of change that is intended to be performed. -The types of changes that are currently supported are defined as follows: - -* //name// -New name for the table. - -* //add// - -Associative array with the names of fields to be added as indexes of the array. The value of each entry of the array should be set to another associative array with the properties of the fields to be added. The properties of the fields should be the same as defined by the Doctrine parser. - -* //remove// - -Associative array with the names of fields to be removed as indexes of the array. Currently the values assigned to each entry are ignored. An empty array should be used for future compatibility. - -* //rename// - -Associative array with the names of fields to be renamed as indexes of the array. The value of each entry of the array should be set to another associative array with the entry named name with the new field name and the entry named Declaration that is expected to contain the portion of the field declaration already in DBMS specific SQL code as it is used in the CREATE TABLE statement. - -* //change// - -Associative array with the names of the fields to be changed as indexes of the array. Keep in mind that if it is intended to change either the name of a field and any other properties, the change array entries should have the new names of the fields as array indexes. - - -The value of each entry of the array should be set to another associative array with the properties of the fields to that are meant to be changed as array entries. These entries should be assigned to the new values of the respective properties. The properties of the fields should be the same as defined by the Doctrine parser. - - - -$a = array('name' => 'userlist', - 'add' => array( - 'quota' => array( - 'type' => 'integer', - 'unsigned' => 1 - ) - ), - 'remove' => array( - 'file_limit' => array(), - 'time_limit' => array() - ), - 'change' => array( - 'name' => array( - 'length' => '20', - 'definition' => array( - 'type' => 'text', - 'length' => 20 - ) - ) - ), - 'rename' => array( - 'sex' => array( - 'name' => 'gender', - 'definition' => array( - 'type' => 'text', - 'length' => 1, - 'default' => 'M' - ) - ) - ) - - ); - -$dbh = new PDO('dsn','username','pw'); -$conn = Doctrine_Manager::getInstance()->openConnection($dbh); - -$conn->export->alterTable('mytable', $a); - diff --git a/manual/docs/Connection modules - Export - Creating new table.php b/manual/docs/Connection modules - Export - Creating new table.php deleted file mode 100644 index a8cff18e1..000000000 --- a/manual/docs/Connection modules - Export - Creating new table.php +++ /dev/null @@ -1,23 +0,0 @@ - - -$dbh = new PDO('dsn','username','pw'); -$conn = Doctrine_Manager::getInstance()->openConnection($dbh); - -$fields = array('id' => array( - 'type' => 'integer', - 'autoincrement' => true), - 'name' => array( - 'type' => 'string', - 'fixed' => true, - 'length' => 8) - ); -// the following option is mysql specific and -// skipped by other drivers -$options = array('type' => 'MYISAM'); - -$conn->export->createTable('mytable', $fields); - -// on mysql this executes query: -// CREATE TABLE mytable (id INT AUTO_INCREMENT PRIMARY KEY, -// name CHAR(8)); - diff --git a/manual/docs/Connection modules - Export - Introduction.php b/manual/docs/Connection modules - Export - Introduction.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Connection modules - Export - Introduction.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Connection modules - Import - Getting foreign key info.php b/manual/docs/Connection modules - Import - Getting foreign key info.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Connection modules - Import - Getting foreign key info.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Connection modules - Import - Getting table info.php b/manual/docs/Connection modules - Import - Getting table info.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Connection modules - Import - Getting table info.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Connection modules - Import - Getting view info.php b/manual/docs/Connection modules - Import - Getting view info.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Connection modules - Import - Getting view info.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Connection modules - Import - Introduction.php b/manual/docs/Connection modules - Import - Introduction.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Connection modules - Import - Introduction.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Connection modules - Util - Using explain.php b/manual/docs/Connection modules - Util - Using explain.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Connection modules - Util - Using explain.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - BNF.php b/manual/docs/DQL (Doctrine Query Language) - BNF.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - BNF.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - All and Any Expressions.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - All and Any Expressions.php deleted file mode 100644 index df6881476..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - All and Any Expressions.php +++ /dev/null @@ -1,48 +0,0 @@ -Syntax: - -operand comparison_operator ANY (subquery) -operand comparison_operator SOME (subquery) -operand comparison_operator ALL (subquery) - - -An ALL conditional expression returns true if the comparison operation is true for all values -in the result of the subquery or the result of the subquery is empty. An ALL conditional expression -is false if the result of the comparison is false for at least one row, and is unknown if neither true nor -false. - - - - - -FROM C WHERE C.col1 < ALL (FROM C2(col1)) - - -An ANY conditional expression returns true if the comparison operation is true for some -value in the result of the subquery. An ANY conditional expression is false if the result of the subquery -is empty or if the comparison operation is false for every value in the result of the subquery, and is -unknown if neither true nor false. - - -FROM C WHERE C.col1 > ANY (FROM C2(col1)) - - -The keyword SOME is an alias for ANY. - -FROM C WHERE C.col1 > SOME (FROM C2(col1)) - - - -The comparison operators that can be used with ALL or ANY conditional expressions are =, <, <=, >, >=, <>. The -result of the subquery must be same type with the conditional expression. - - - -NOT IN is an alias for <> ALL. Thus, these two statements are equal: - - - - -FROM C WHERE C.col1 <> ALL (FROM C2(col1)); -FROM C WHERE C.col1 NOT IN (FROM C2(col1)); - - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - All or Any Expressions.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - All or Any Expressions.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - All or Any Expressions.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Between expressions.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Between expressions.php deleted file mode 100644 index b28b04f64..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Between expressions.php +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Collection Member Expressions.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Collection Member Expressions.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Collection Member Expressions.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Contidional expression composition.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Contidional expression composition.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Empty Collection Comparison Expressions.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Empty Collection Comparison Expressions.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Empty Collection Comparison Expressions.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Exists Expressions.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Exists Expressions.php deleted file mode 100644 index adef302aa..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Exists Expressions.php +++ /dev/null @@ -1,25 +0,0 @@ -Syntax: - - [NOT ]EXISTS () - -The EXISTS operator returns TRUE if the subquery returns one or more rows and FALSE otherwise. - - - -The NOT EXISTS operator returns TRUE if the subquery returns 0 rows and FALSE otherwise. - - - -Finding all articles which have readers: - -FROM Article - WHERE EXISTS (FROM ReaderLog(id) - WHERE ReaderLog.article_id = Article.id) - -Finding all articles which don't have readers: - -FROM Article - WHERE NOT EXISTS (FROM ReaderLog(id) - WHERE ReaderLog.article_id = Article.id) - - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Identification variables.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Identification variables.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - In expressions.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - In expressions.php deleted file mode 100644 index 8b5ced618..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - In expressions.php +++ /dev/null @@ -1,23 +0,0 @@ -Syntax: - - IN (|) - -An IN conditional expression returns true if the //operand// is found from result of the //subquery// -or if its in the specificied comma separated //value list//, hence the IN expression is always false if the result of the subquery -is empty. - -When //value list// is being used there must be at least one element in that list. - - -FROM C1 WHERE C1.col1 IN (FROM C2(col1)); - -FROM User WHERE User.id IN (1,3,4,5) - - -The keyword IN is an alias for = ANY. Thus, these two statements are equal: - -FROM C1 WHERE C1.col1 = ANY (FROM C2(col1)); -FROM C1 WHERE C1.col1 IN (FROM C2(col1)); - - - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Input parameters.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Input parameters.php deleted file mode 100644 index 86ce0f904..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Input parameters.php +++ /dev/null @@ -1,15 +0,0 @@ - - - -// POSITIONAL PARAMETERS: -$users = $conn->query("FROM User WHERE User.name = ?", array('Arnold')); - -$users = $conn->query("FROM User WHERE User.id > ? AND User.name LIKE ?", array(50, 'A%')); - - -// NAMED PARAMETERS: - -$users = $conn->query("FROM User WHERE User.name = :name", array(':name' => 'Arnold')); - -$users = $conn->query("FROM User WHERE User.id > :id AND User.name LIKE :name", array(':id' => 50, ':name' => 'A%')); - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Like Expressions.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Like Expressions.php deleted file mode 100644 index 38b939126..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Like Expressions.php +++ /dev/null @@ -1,40 +0,0 @@ -Syntax: - -string_expression [NOT] LIKE pattern_value [ESCAPE escape_character] - - - - - -The string_expression must have a string value. The pattern_value is a string literal or a string-valued -input parameter in which an underscore (_) stands for any single character, a percent (%) character -stands for any sequence of characters (including the empty sequence), and all other characters stand for -themselves. The optional escape_character is a single-character string literal or a character-valued -input parameter (i.e., char or Character) and is used to escape the special meaning of the underscore -and percent characters in pattern_value. - - - -Examples: - - - -* address.phone LIKE ‘12%3’ is true for '123' '12993' and false for '1234' -* asentence.word LIKE ‘l_se’ is true for ‘lose’ and false for 'loose' -* aword.underscored LIKE ‘\_%’ ESCAPE '\' is true for '_foo' and false for 'bar' -* address.phone NOT LIKE ‘12%3’ is false for '123' and '12993' and true for '1234' - - - -If the value of the string_expression or pattern_value is NULL or unknown, the value of the LIKE -expression is unknown. If the escape_characteris specified and is NULL, the value of the LIKE expression -is unknown. - - - -// finding all users whose email ends with '@gmail.com' -$users = $conn->query("FROM User u, u.Email e WHERE e.address LIKE '%@gmail.com'"); - -// finding all users whose name starts with letter 'A' -$users = $conn->query("FROM User u WHERE u.name LIKE 'A%'"); - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Literals.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Literals.php deleted file mode 100644 index baef581c2..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Literals.php +++ /dev/null @@ -1,49 +0,0 @@ -**Strings** - - -A string literal is enclosed in single quotes—for example: 'literal'. A string literal that includes a single -quote is represented by two single quotes—for example: 'literal''s'. - -FROM User WHERE User.name = 'Vincent' - - -**Integers** - -Integer literals support the use of PHP integer literal syntax. - -FROM User WHERE User.id = 4 - - -**Floats** - -Float literals support the use of PHP float literal syntax. - -FROM Account WHERE Account.amount = 432.123 - - - - -**Booleans** - -The boolean literals are true and false. - - -FROM User WHERE User.admin = true - -FROM Session WHERE Session.is_authed = false - - - - -**Enums** - -The enumerated values work in the same way as string literals. - - -FROM User WHERE User.type = 'admin' - - - - -Predefined reserved literals are case insensitive, although its a good standard to write them in uppercase. - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Null Comparison Expressions.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Null Comparison Expressions.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Null Comparison Expressions.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Operators and operator precedence.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Operators and operator precedence.php deleted file mode 100644 index 4fdb7caed..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Operators and operator precedence.php +++ /dev/null @@ -1,25 +0,0 @@ -The operators are listed below in order of decreasing precedence. - -* Navigation operator (.) -* Arithmetic operators: - -+, - unary - -*, / multiplication and division - -+, - addition and subtraction - -* Comparison operators : =, >, >=, <, <=, <> (not equal), [NOT] LIKE, - -[NOT] IN, IS [NOT] NULL, IS [NOT] EMPTY - -* Logical operators: - -NOT - -AND - -OR - - - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Path expressions.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Path expressions.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Path expressions.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Subqueries.php b/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Subqueries.php deleted file mode 100644 index b576d31bc..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Conditional expressions - Subqueries.php +++ /dev/null @@ -1,33 +0,0 @@ -A subquery can contain any of the keywords or clauses that an ordinary SELECT query can contain. - - - -Some advantages of the subqueries: - -* They allow queries that are structured so that it is possible to isolate each part of a statement. - -* They provide alternative ways to perform operations that would otherwise require complex joins and unions. - -* They are, in many people's opinion, readable. Indeed, it was the innovation of subqueries that gave people the original idea of calling the early SQL “Structured Query Language.” - - - - -// finding all users which don't belong to any group 1 -$query = "FROM User WHERE User.id NOT IN - (SELECT u.id FROM User u - INNER JOIN u.Group g WHERE g.id = ?"; - -$users = $conn->query($query, array(1)); - -// finding all users which don't belong to any groups -// Notice: -// the usage of INNER JOIN -// the usage of empty brackets preceding the Group component - -$query = "FROM User WHERE User.id NOT IN - (SELECT u.id FROM User u - INNER JOIN u.Group g)"; - -$users = $conn->query($query); - diff --git a/manual/docs/DQL (Doctrine Query Language) - DELETE queries.php b/manual/docs/DQL (Doctrine Query Language) - DELETE queries.php deleted file mode 100644 index b7251349b..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - DELETE queries.php +++ /dev/null @@ -1,35 +0,0 @@ - -DELETE FROM - [WHERE ] - [ORDER BY ...] - [LIMIT ] - - -* The DELETE statement deletes records from //component_name// and returns the number of records deleted. - -* The optional WHERE clause specifies the conditions that identify which records to delete. -Without WHERE clause, all records are deleted. - -* If the ORDER BY clause is specified, the records are deleted in the order that is specified. - -* The LIMIT clause places a limit on the number of rows that can be deleted. -The statement will stop as soon as it has deleted //record_count// records. - - - - -$q = 'DELETE FROM Account WHERE id > ?'; - -$rows = $this->conn->query($q, array(3)); - -// the same query using the query interface - -$q = new Doctrine_Query(); - -$rows = $q->delete('Account') - ->from('Account a') - ->where('a.id > ?', 3) - ->execute(); - -print $rows; // the number of affected rows - diff --git a/manual/docs/DQL (Doctrine Query Language) - Examples.php b/manual/docs/DQL (Doctrine Query Language) - Examples.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Examples.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - FROM clause.php b/manual/docs/DQL (Doctrine Query Language) - FROM clause.php deleted file mode 100644 index 76d2ef548..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - FROM clause.php +++ /dev/null @@ -1,29 +0,0 @@ -Syntax: - - - -FROM [[LEFT | INNER] JOIN ] ... - - -The FROM clause indicates the component or components from which to retrieve records. -If you name more than one component, you are performing a join. -For each table specified, you can optionally specify an alias. - - - - - -* The default join type is //LEFT JOIN//. This join can be indicated by the use of either 'LEFT JOIN' clause or simply ',', hence the following queries are equal: - -SELECT u.*, p.* FROM User u LEFT JOIN u.Phonenumber - -SELECT u.*, p.* FROM User u, u.Phonenumber p - - -* //INNER JOIN// produces an intersection between two specified components (that is, each and every record in the first component is joined to each and every record in the second component). -So basically //INNER JOIN// can be used when you want to efficiently fetch for example all users which have one or more phonenumbers. - -SELECT u.*, p.* FROM User u INNER JOIN u.Phonenumber p - - - diff --git a/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - Arithmetic functions.php b/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - Arithmetic functions.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - Arithmetic functions.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - Collection functions.php b/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - Collection functions.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - Collection functions.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - Datetime functions.php b/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - Datetime functions.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - Datetime functions.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - String functions.php b/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - String functions.php deleted file mode 100644 index ba56bf16a..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Functional Expressions - String functions.php +++ /dev/null @@ -1,88 +0,0 @@ -* The //CONCAT// function returns a string that is a concatenation of its arguments. In the example above we -map the concatenation of users firstname and lastname to a value called name - - - -$q = new Doctrine_Query(); - -$users = $q->select('CONCAT(u.firstname, u.lastname) name')->from('User u')->execute(); - -foreach($users as $user) { - // here 'name' is not a property of $user, - // its a mapped function value - print $user->name; -} -?> - - - - - -* The second and third arguments of the //SUBSTRING// function denote the starting position and length of -the substring to be returned. These arguments are integers. The first position of a string is denoted by 1. -The //SUBSTRING// function returns a string. - - - -$q = new Doctrine_Query(); - -$users = $q->select('u.name')->from('User u')->where("SUBSTRING(u.name, 0, 1) = 'z'")->execute(); - -foreach($users as $user) { - print $user->name; -} -?> - - - - - -* The //TRIM// function trims the specified character from a string. If the character to be trimmed is not -specified, it is assumed to be space (or blank). The optional trim_character is a single-character string -literal or a character-valued input parameter (i.e., char or Character)[30]. If a trim specification is -not provided, BOTH is assumed. The //TRIM// function returns the trimmed string. - - - -$q = new Doctrine_Query(); - -$users = $q->select('u.name')->from('User u')->where("TRIM(u.name) = 'Someone'")->execute(); - -foreach($users as $user) { - print $user->name; -} -?> - - - -* The //LOWER// and //UPPER// functions convert a string to lower and upper case, respectively. They return a -string. - - - - -$q = new Doctrine_Query(); - -$users = $q->select('u.name')->from('User u')->where("LOWER(u.name) = 'someone'")->execute(); - -foreach($users as $user) { - print $user->name; -} -?> - - - -* The //LOCATE// function returns the position of a given string within a string, starting the search at a specified -position. It returns the first position at which the string was found as an integer. The first argument -is the string to be located; the second argument is the string to be searched; the optional third argument -is an integer that represents the string position at which the search is started (by default, the beginning of -the string to be searched). The first position in a string is denoted by 1. If the string is not found, 0 is -returned. - - - - -* The //LENGTH// function returns the length of the string in characters as an integer. - - - diff --git a/manual/docs/DQL (Doctrine Query Language) - Functions - Contains.php b/manual/docs/DQL (Doctrine Query Language) - Functions - Contains.php deleted file mode 100644 index 67b931d12..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Functions - Contains.php +++ /dev/null @@ -1,8 +0,0 @@ - - -$q = new Doctrine_Query(); - -$q->from('User')->where('User.Phonenumber.phonenumber.contains(?,?,?)'); - -$users = $q->execute(array('123 123 123', '0400 999 999', '+358 100 100')); - diff --git a/manual/docs/DQL (Doctrine Query Language) - Functions - Like.php b/manual/docs/DQL (Doctrine Query Language) - Functions - Like.php deleted file mode 100644 index 1c3aa1ceb..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Functions - Like.php +++ /dev/null @@ -1,8 +0,0 @@ - - -$q = new Doctrine_Query(); - -$q->from('User')->where('User.Phonenumber.phonenumber.like(?,?)'); - -$users = $q->execute(array('%123%', '456%')); - diff --git a/manual/docs/DQL (Doctrine Query Language) - Functions - Regexp.php b/manual/docs/DQL (Doctrine Query Language) - Functions - Regexp.php deleted file mode 100644 index 7ff724015..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Functions - Regexp.php +++ /dev/null @@ -1,8 +0,0 @@ - - -$q = new Doctrine_Query(); - -$q->from('User')->where('User.Phonenumber.phonenumber.regexp(?,?)'); - -$users = $q->execute(array('[123]', '^[3-5]')); - diff --git a/manual/docs/DQL (Doctrine Query Language) - GROUP BY, HAVING clauses.php b/manual/docs/DQL (Doctrine Query Language) - GROUP BY, HAVING clauses.php deleted file mode 100644 index c5905b4d6..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - GROUP BY, HAVING clauses.php +++ /dev/null @@ -1,47 +0,0 @@ - -* GROUP BY and HAVING clauses can be used for dealing with aggregate functions - - -* Following aggregate functions are availible on DQL: COUNT, MAX, MIN, AVG, SUM - - -Selecting alphabetically first user by name. - -SELECT MIN(u.name) FROM User u - - -Selecting the sum of all Account amounts. - -SELECT SUM(a.amount) FROM Account a - - - - -* Using an aggregate function in a statement containing no GROUP BY clause, results in grouping on all rows. In the example above -we fetch all users and the number of phonenumbers they have. - - -SELECT u.*, COUNT(p.id) FROM User u, u.Phonenumber p GROUP BY u.id - - - - -* The HAVING clause can be used for narrowing the results using aggregate values. In the following example we fetch -all users which have atleast 2 phonenumbers - -SELECT u.* FROM User u, u.Phonenumber p HAVING COUNT(p.id) >= 2 - - - - - - - -// retrieve all users and the phonenumber count for each user - -$users = $conn->query("SELECT u.*, COUNT(p.id) count FROM User u, u.Phonenumber p GROUP BY u.id"); - -foreach($users as $user) { - print $user->name . ' has ' . $user->Phonenumber[0]->count . ' phonenumbers'; -} - diff --git a/manual/docs/DQL (Doctrine Query Language) - GROUP BY, HAVING.php b/manual/docs/DQL (Doctrine Query Language) - GROUP BY, HAVING.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - GROUP BY, HAVING.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Introduction.php b/manual/docs/DQL (Doctrine Query Language) - Introduction.php deleted file mode 100644 index f3cddb132..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Introduction.php +++ /dev/null @@ -1,57 +0,0 @@ -Doctrine Query Language(DQL) is an Object Query Language created for helping users in complex object retrieval. -You should always consider using DQL(or raw SQL) when retrieving relational data efficiently (eg. when fetching users and their phonenumbers). - - - -When compared to using raw SQL, DQL has several benefits: - - - * From the start it has been designed to retrieve records(objects) not result set rows - - - * DQL understands relations so you don't have to type manually sql joins and join conditions - - - * DQL is portable on different databases - - - * DQL has some very complex built-in algorithms like (the record limit algorithm) which can help - developer to efficiently retrieve objects - - - * It supports some functions that can save time when dealing with one-to-many, many-to-many relational data with conditional fetching. - - -If the power of DQL isn't enough, you should consider using the rawSql API for object population. - - - -// DO NOT USE THE FOLLOWING CODE -// (using many sql queries for object population): - -$users = $conn->getTable('User')->findAll(); - -foreach($users as $user) { - print $user->name." -"; - foreach($user->Phonenumber as $phonenumber) { - print $phonenumber." -"; - } -} - -// same thing implemented much more efficiently: -// (using only one sql query for object population) - -$users = $conn->query("FROM User.Phonenumber"); - -foreach($users as $user) { - print $user->name." -"; - foreach($user->Phonenumber as $phonenumber) { - print $phonenumber." -"; - } -} - - diff --git a/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses - Driver portability.php b/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses - Driver portability.php deleted file mode 100644 index 00b692c75..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses - Driver portability.php +++ /dev/null @@ -1,23 +0,0 @@ -DQL LIMIT clause is portable on all supported databases. Special attention have been paid to following facts: - - - -* Only Mysql, Pgsql and Sqlite implement LIMIT / OFFSET clauses natively - - - -* In Oracle / Mssql / Firebird LIMIT / OFFSET clauses need to be emulated in driver specific way - - - -* The limit-subquery-algorithm needs to execute to subquery separately in mysql, since mysql doesn't yet support -LIMIT clause in subqueries - - -* Pgsql needs the order by fields to be preserved in SELECT clause, hence LS-algorithm needs to take this into consideration -when pgsql driver is used - - -* Oracle only allows < 30 object identifiers (= table/column names/aliases), hence the limit subquery must use as short aliases as possible -and it must avoid alias collisions with the main query. - diff --git a/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses - Introduction.php b/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses - Introduction.php deleted file mode 100644 index ce8497194..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses - Introduction.php +++ /dev/null @@ -1,4 +0,0 @@ -Propably the most complex feature DQL parser has to offer is its LIMIT clause parser. Not only -does the DQL LIMIT clause parser take care of LIMIT database portability it is capable of limiting the number of records instead -of rows by using complex query analysis and subqueries. - diff --git a/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses - The limit-subquery-algorithm.php b/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses - The limit-subquery-algorithm.php deleted file mode 100644 index 94af9def8..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses - The limit-subquery-algorithm.php +++ /dev/null @@ -1,77 +0,0 @@ -The limit-subquery-algorithm is an algorithm that DQL parser uses internally when one-to-many / many-to-many relational -data is being fetched simultaneously. This kind of special algorithm is needed for the LIMIT clause to limit the number -of records instead of sql result set rows. - - - -In the following example we have users and phonenumbers with their relation being one-to-many. Now lets say we want fetch the first 20 users -and all their related phonenumbers. - - - -Now one might consider that adding a simple driver specific LIMIT 20 at the end of query would return the correct results. -Thats wrong, since we you might get anything between 1-20 users as the first user might have 20 phonenumbers and then record set would consist of 20 rows. - - - -DQL overcomes this problem with subqueries and with complex but efficient subquery analysis. In the next example we are going to fetch first 20 users and all their phonenumbers with single efficient query. -Notice how the DQL parser is smart enough to use column aggregation inheritance even in the subquery and how its smart enough to use different aliases -for the tables in the subquery to avoid alias collisions. - - - - -DQL QUERY: -
    -SELECT u.id, u.name, p.* FROM User u LEFT JOIN u.Phonenumber p LIMIT 20
    -
    - -SQL QUERY: - -SELECT - e.id AS e__id, - e.name AS e__name, - p.id AS p__id, - p.phonenumber AS p__phonenumber, - p.entity_id AS p__entity_id -FROM entity e -LEFT JOIN phonenumber p ON e.id = p.entity_id -WHERE e.id IN ( -SELECT DISTINCT e2.id -FROM entity e2 -WHERE (e2.type = 0) LIMIT 20) AND (e.type = 0) - - - - - -In the next example we are going to fetch first 20 users and all their phonenumbers and only -those users that actually have phonenumbers with single efficient query, hence we use an INNER JOIN. -Notice how the DQL parser is smart enough to use the INNER JOIN in the subquery. - - - - -DQL QUERY: -
    -SELECT u.id, u.name, p.* FROM User u LEFT JOIN u.Phonenumber p LIMIT 20
    -
    - -SQL QUERY: - -SELECT - e.id AS e__id, - e.name AS e__name, - p.id AS p__id, - p.phonenumber AS p__phonenumber, - p.entity_id AS p__entity_id -FROM entity e -LEFT JOIN phonenumber p ON e.id = p.entity_id -WHERE e.id IN ( -SELECT DISTINCT e2.id -FROM entity e2 -INNER JOIN phonenumber p2 ON e2.id = p2.entity_id -WHERE (e2.type = 0) LIMIT 20) AND (e.type = 0) - - - diff --git a/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses.php b/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses.php deleted file mode 100644 index 810e4ef2e..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET clauses.php +++ /dev/null @@ -1,16 +0,0 @@ - - - - -// retrieve the first 20 users and all their associated phonenumbers - -$users = $conn->query("SELECT u.*, p.* FROM User u, u.Phonenumber p LIMIT 20"); - -foreach($users as $user) { - print ' --- '.$user->name.' --- \n'; - - foreach($user->Phonenumber as $p) { - print $p->phonenumber.'\n'; - } -} - diff --git a/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET.php b/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - LIMIT and OFFSET.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - ORDER BY clause - Introduction.php b/manual/docs/DQL (Doctrine Query Language) - ORDER BY clause - Introduction.php deleted file mode 100644 index 012901401..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - ORDER BY clause - Introduction.php +++ /dev/null @@ -1,25 +0,0 @@ -Record collections can be sorted efficiently at the database level using the ORDER BY clause. - -Syntax: - - [ORDER BY {ComponentAlias.columnName} - [ASC | DESC], ...] - - -Examples: - - - -FROM User.Phonenumber - ORDER BY User.name, Phonenumber.phonenumber - -FROM User u, u.Email e - ORDER BY e.address, u.id - -In order to sort in reverse order you can add the DESC (descending) keyword to the name of the column in the ORDER BY clause that you are sorting by. The default is ascending order; this can be specified explicitly using the ASC keyword. - - - -FROM User u, u.Email e - ORDER BY e.address DESC, u.id ASC; - diff --git a/manual/docs/DQL (Doctrine Query Language) - ORDER BY clause.php b/manual/docs/DQL (Doctrine Query Language) - ORDER BY clause.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - ORDER BY clause.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - ORDER BY.php b/manual/docs/DQL (Doctrine Query Language) - ORDER BY.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - ORDER BY.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/DQL (Doctrine Query Language) - Operators - Logical operators.php b/manual/docs/DQL (Doctrine Query Language) - Operators - Logical operators.php deleted file mode 100644 index d4325a5a2..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - Operators - Logical operators.php +++ /dev/null @@ -1,167 +0,0 @@ - -* - - -NOT, ! - - - - - Logical NOT. Evaluates to 1 if the - operand is 0, to 0 if - the operand is non-zero, and NOT NULL - returns NULL. - -DQL condition :** NOT 10 - - -> 0 - -DQL condition :** NOT 0 - - -> 1 - -DQL condition :** NOT NULL - - -> NULL - -DQL condition :** ! (1+1) - - -> 0 - -DQL condition :** ! 1+1 - - -> 1 - -
- - - - The last example produces 1 because the - expression evaluates the same way as - (!1)+1. - - -* - - - - - - - - AND - - - - - Logical AND. Evaluates to 1 if all - operands are non-zero and not NULL, to - 0 if one or more operands are - 0, otherwise NULL is - returned. - -DQL condition :** 1 AND 1 - - -> 1 - -DQL condition :** 1 AND 0 - - -> 0 - -DQL condition :** 1 AND NULL - - -> NULL - -DQL condition :** 0 AND NULL - - -> 0 - -DQL condition :** NULL AND 0 - - -> 0 - - - -* - - - OR - - - - - Logical OR. When both operands are - non-NULL, the result is - 1 if any operand is non-zero, and - 0 otherwise. With a - NULL operand, the result is - 1 if the other operand is non-zero, and - NULL otherwise. If both operands are - NULL, the result is - NULL. - -DQL condition :** 1 OR 1 - - -> 1 - -DQL condition :** 1 OR 0 - - -> 1 - -DQL condition :** 0 OR 0 - - -> 0 - -DQL condition :** 0 OR NULL - - -> NULL - -DQL condition :** 1 OR NULL - - -> 1 - - - -* - - - - - - XOR - - - - - Logical XOR. Returns NULL if either - operand is NULL. For - non-NULL operands, evaluates to - 1 if an odd number of operands is - non-zero, otherwise 0 is returned. - -DQL condition :** 1 XOR 1 - - -> 0 - -DQL condition :** 1 XOR 0 - - -> 1 - -DQL condition :** 1 XOR NULL - - -> NULL - -DQL condition :** 1 XOR 1 XOR 1 - - -> 1 - - - - - - a XOR b is mathematically equal to - (a AND (NOT b)) OR ((NOT a) and b). - - - - diff --git a/manual/docs/DQL (Doctrine Query Language) - SELECT queries - Aggregate values.php b/manual/docs/DQL (Doctrine Query Language) - SELECT queries - Aggregate values.php deleted file mode 100644 index c86fd0790..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - SELECT queries - Aggregate values.php +++ /dev/null @@ -1,16 +0,0 @@ -Aggregate value SELECT syntax: - - -// SELECT u.*, COUNT(p.id) num_posts FROM User u, u.Posts p WHERE u.id = 1 GROUP BY u.id - -$query = new Doctrine_Query(); - -$query->select('u.*, COUNT(p.id) num_posts') - ->from('User u, u.Posts p') - ->where('u.id = ?', 1) - ->groupby('u.id'); - -$users = $query->execute(); - -echo $users->Posts[0]->num_posts . ' posts found'; - diff --git a/manual/docs/DQL (Doctrine Query Language) - SELECT queries.php b/manual/docs/DQL (Doctrine Query Language) - SELECT queries.php deleted file mode 100644 index ef4cb5382..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - SELECT queries.php +++ /dev/null @@ -1,55 +0,0 @@ -SELECT statement syntax: - -SELECT - [ALL | DISTINCT] - , ... - [FROM - [WHERE ] - [GROUP BY - [ASC | DESC], ... ] - [HAVING ] - [ORDER BY - [ASC | DESC], ...] - [LIMIT OFFSET }] - - - -The SELECT statement is used for the retrieval of data from one or more components. - -* Each //select_expr// indicates a column or an aggregate function value that you want to retrieve. There must be at least one //select_expr// in every SELECT statement. - -SELECT a.name, a.amount FROM Account a - - -* An asterisk can be used for selecting all columns from given component. Even when using an asterisk the executed sql queries never actually use it -(Doctrine converts asterisk to appropriate column names, hence leading to better performance on some databases). - -SELECT a.* FROM Account a - -* FROM clause //components// indicates the component or components from which to retrieve records. - -SELECT a.* FROM Account a - -SELECT u.*, p.*, g.* FROM User u LEFT JOIN u.Phonenumber p LEFT JOIN u.Group g - -* The WHERE clause, if given, indicates the condition or conditions that the records must satisfy to be selected. //where_condition// is an expression that evaluates to true for each row to be selected. The statement selects all rows if there is no WHERE clause. - -SELECT a.* FROM Account a WHERE a.amount > 2000 - -* In the WHERE clause, you can use any of the functions and operators that DQL supports, except for aggregate (summary) functions - -* The HAVING clause can be used for narrowing the results with aggregate functions - -SELECT u.* FROM User u LEFT JOIN u.Phonenumber p HAVING COUNT(p.id) > 3 - -* The ORDER BY clause can be used for sorting the results - -SELECT u.* FROM User u ORDER BY u.name - -* The LIMIT and OFFSET clauses can be used for efficiently limiting the number of records to a given //row_count// - -SELECT u.* FROM User u LIMIT 20 - - - - diff --git a/manual/docs/DQL (Doctrine Query Language) - UPDATE queries.php b/manual/docs/DQL (Doctrine Query Language) - UPDATE queries.php deleted file mode 100644 index 21f1a8c74..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - UPDATE queries.php +++ /dev/null @@ -1,39 +0,0 @@ -UPDATE statement syntax: - -UPDATE //component_name// - SET //col_name1//=//expr1// [, //col_name2//=//expr2// ...] - [WHERE //where_condition//] - [ORDER BY ...] - [LIMIT //record_count//] - - -* The UPDATE statement updates columns of existing records in //component_name// with new values and returns the number of affected records. - -* The SET clause indicates which columns to modify and the values they should be given. - -* The optional WHERE clause specifies the conditions that identify which records to update. -Without WHERE clause, all records are updated. - -* The optional ORDER BY clause specifies the order in which the records are being updated. - -* The LIMIT clause places a limit on the number of records that can be updated. You can use LIMIT row_count to restrict the scope of the UPDATE. -A LIMIT clause is a **rows-matched restriction** not a rows-changed restriction. -The statement stops as soon as it has found //record_count// rows that satisfy the WHERE clause, whether or not they actually were changed. - - - -$q = 'UPDATE Account SET amount = amount + 200 WHERE id > 200'; - -$rows = $this->conn->query($q); - -// the same query using the query interface - -$q = new Doctrine_Query(); - -$rows = $q->update('Account') - ->set('amount', 'amount + 200') - ->where('id > 200') - ->execute(); - -print $rows; // the number of affected rows - diff --git a/manual/docs/DQL (Doctrine Query Language) - WHERE clause.php b/manual/docs/DQL (Doctrine Query Language) - WHERE clause.php deleted file mode 100644 index b2f32faa8..000000000 --- a/manual/docs/DQL (Doctrine Query Language) - WHERE clause.php +++ /dev/null @@ -1,23 +0,0 @@ -Syntax: - -WHERE - - -* The WHERE clause, if given, indicates the condition or conditions that the records must satisfy to be selected. - - - -* //where_condition// is an expression that evaluates to true for each row to be selected. - - - -* The statement selects all rows if there is no WHERE clause. - - - -* When narrowing results with aggregate function values HAVING clause should be used instead of WHERE clause - - - - - diff --git a/manual/docs/Database operations - Limit and offset.php b/manual/docs/Database operations - Limit and offset.php deleted file mode 100644 index 9dc98d60d..000000000 --- a/manual/docs/Database operations - Limit and offset.php +++ /dev/null @@ -1,8 +0,0 @@ - - -$sess = Doctrine_Manager::getInstance()->openConnection(new PDO("dsn","username","password")); - -// select first ten rows starting from the row 20 - -$sess->select("select * from user",10,20); - diff --git a/manual/docs/Database operations - Nested transactions.php b/manual/docs/Database operations - Nested transactions.php deleted file mode 100644 index ecdb3d370..000000000 --- a/manual/docs/Database operations - Nested transactions.php +++ /dev/null @@ -1,18 +0,0 @@ - - -try { - $conn->beginTransaction(); - - $user->save(); - - $conn->beginTransaction(); - $group->save(); - $email->save(); - - $conn->commit(); - - $conn->commit(); -} catch(Exception $e) { - $conn->rollback(); -} - diff --git a/manual/docs/Database operations - Query logging.php b/manual/docs/Database operations - Query logging.php deleted file mode 100644 index f3714c558..000000000 --- a/manual/docs/Database operations - Query logging.php +++ /dev/null @@ -1,16 +0,0 @@ - - - -// works only if you use doctrine database handler - -$dbh = $conn->getDBH(); - -$times = $dbh->getExecTimes(); - -// print all executed queries and their execution times - -foreach($dbh->getQueries() as $index => $query) { - print $query." ".$times[$index]; -} - - diff --git a/manual/docs/Database operations - Sequences.php b/manual/docs/Database operations - Sequences.php deleted file mode 100644 index a9f2e9e02..000000000 --- a/manual/docs/Database operations - Sequences.php +++ /dev/null @@ -1,8 +0,0 @@ - - -$sess = Doctrine_Manager::getInstance()->openConnection(new PDO("dsn","username","password")); - -// gets the next ID from a sequence - -$sess->getNextID($sequence); - diff --git a/manual/docs/Database operations - Transactions.php b/manual/docs/Database operations - Transactions.php deleted file mode 100644 index 04f5f624d..000000000 --- a/manual/docs/Database operations - Transactions.php +++ /dev/null @@ -1,15 +0,0 @@ - - -$sess = Doctrine_Manager::getInstance()->openConnection(new PDO("dsn","username","password")); -try { -$sess->beginTransaction(); - - // some database operations - -$sess->commit(); - -} catch(Exception $e) { - $sess->rollback(); -} - - diff --git a/manual/docs/Drivers - Mysql - Tips and tricks.php b/manual/docs/Drivers - Mysql - Tips and tricks.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Drivers - Mysql - Tips and tricks.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Drivers - Oracle - Making unsuported functions work.php b/manual/docs/Drivers - Oracle - Making unsuported functions work.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Drivers - Oracle - Making unsuported functions work.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Functions - Contains.php b/manual/docs/Functions - Contains.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Functions - Contains.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Functions - Like.php b/manual/docs/Functions - Like.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Functions - Like.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Functions - Regexp.php b/manual/docs/Functions - Regexp.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Functions - Regexp.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Compile.php b/manual/docs/Getting started - Compile.php deleted file mode 100644 index fc8e9146d..000000000 --- a/manual/docs/Getting started - Compile.php +++ /dev/null @@ -1,10 +0,0 @@ - -Doctrine is quite big framework and usually dozens of files are being included on each request. -This brings a lot of overhead. In fact these file operations are as time consuming as sending multiple queries to database server. -The clean separation of class per file works well in developing environment, however when project -goes commercial distribution the speed overcomes the clean separation of class per file -convention. - -Doctrine offers method called compile() to solve this issue. The compile method makes a single file of most used -Doctrine components which can then be included on top of your script. By default the file is created into Doctrine root by the name -Doctrine.compiled.php. - diff --git a/manual/docs/Getting started - Compiling.php b/manual/docs/Getting started - Compiling.php deleted file mode 100644 index 185d506af..000000000 --- a/manual/docs/Getting started - Compiling.php +++ /dev/null @@ -1,7 +0,0 @@ -Compiling is a method for making a single file of most used doctrine runtime components including the compiled file instead of multiple files (in worst cases dozens of files) can improve performance by an order of magnitude. In cases where this might fail, a Doctrine_Exception is throw detailing the error. - - -Doctrine::compile(); -// on some other script: -require_once('path_to_doctrine/Doctrine.compiled.php'); - diff --git a/manual/docs/Getting started - Data types - Array.php b/manual/docs/Getting started - Data types - Array.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Array.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - Blob.php b/manual/docs/Getting started - Data types - Blob.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Blob.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - Boolean.php b/manual/docs/Getting started - Data types - Boolean.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Boolean.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - Clob.php b/manual/docs/Getting started - Data types - Clob.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Clob.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - Date.php b/manual/docs/Getting started - Data types - Date.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Date.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - Enum.php b/manual/docs/Getting started - Data types - Enum.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Enum.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - Float.php b/manual/docs/Getting started - Data types - Float.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Float.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - Gzip.php b/manual/docs/Getting started - Data types - Gzip.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Gzip.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - Integer.php b/manual/docs/Getting started - Data types - Integer.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Integer.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - Object.php b/manual/docs/Getting started - Data types - Object.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Object.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - String.php b/manual/docs/Getting started - Data types - String.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - String.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Data types - Timestamp.php b/manual/docs/Getting started - Data types - Timestamp.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Data types - Timestamp.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Exporting classes - Export options.php b/manual/docs/Getting started - Exporting classes - Export options.php deleted file mode 100644 index 36ee78f09..000000000 --- a/manual/docs/Getting started - Exporting classes - Export options.php +++ /dev/null @@ -1,14 +0,0 @@ - -// export everything, table definitions and constraints - -$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_ALL); - -// export classes without constraints - -$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_TABLES ^ - Doctrine::EXPORT_CONSTRAINTS); - -// turn off exporting - -$manager->setAttribute(Doctrine::ATTR_EXPORT, Doctrine::EXPORT_NONE); - diff --git a/manual/docs/Getting started - Installation - Include and autoload.php b/manual/docs/Getting started - Installation - Include and autoload.php deleted file mode 100644 index 7be719150..000000000 --- a/manual/docs/Getting started - Installation - Include and autoload.php +++ /dev/null @@ -1,21 +0,0 @@ -In order to use Doctrine in your project it must first be included. - - -require_once('path-to-doctrine/lib/Doctrine.php'); - - -Doctrine support [http://www.php.net/autoload Autoloading] for including files so that you do not have to include anything more then the base file. There are two different strategies that can be used to do this: - -If you do use the **__autoload** function for your own logic you can use it. - - -function __autoload($class) { - Doctrine::autoload($class); -} - - -If your project uses autoload and/or you have other libraries that use it you could use [http://www.php.net/manual/en/function.spl-autoload-register.php spl_autoload_register] to register more then one autoloading function. - - -spl_autoload_register(array('Doctrine', 'autoload')); - diff --git a/manual/docs/Getting started - Installation.php b/manual/docs/Getting started - Installation.php deleted file mode 100644 index 39004bceb..000000000 --- a/manual/docs/Getting started - Installation.php +++ /dev/null @@ -1,15 +0,0 @@ -The installation of doctrine is very easy. Just get the latest revision of Doctrine from http://doctrine.pengus.net/svn/trunk. - -You need a SVN(Subversion) client for downloading Doctrine. - -In order to check out Doctrine in the current directory using the **svn** command line tool use the following code: - -svn co http://doctrine.pengus.net/svn/trunk . - - -If you do not have a SVN client, chose one from the list below. Find the **Checkout** option and enter http://doctrine.pengus.net/svn/trunk in the **path** or **repository url** parameter. There is no need for a username or password to check out Doctrine. - -* [http://tortoisesvn.tigris.org/ TortoiseSVN] a Windows application that integrates into Windows Explorer -* [http://www.apple.com/downloads/macosx/development_tools/svnx.html svnx] a Mac OS X GUI svn application -* Eclipse has SVN integration through the [http://subclipse.tigris.org/ subeclipse] plugin - diff --git a/manual/docs/Getting started - Requirements.php b/manual/docs/Getting started - Requirements.php deleted file mode 100644 index 6627dac6e..000000000 --- a/manual/docs/Getting started - Requirements.php +++ /dev/null @@ -1,3 +0,0 @@ -Doctrine requires PHP >= 5.1. it doesn't require any external libraries. -For database abstraction Doctrine uses PDO which is bundled with php by default. Doctrine also requires a little adodb-hack for table creation, which comes with doctrine. - diff --git a/manual/docs/Getting started - Setting table definition - Constraints and validators.php b/manual/docs/Getting started - Setting table definition - Constraints and validators.php deleted file mode 100644 index 86038c5ef..000000000 --- a/manual/docs/Getting started - Setting table definition - Constraints and validators.php +++ /dev/null @@ -1,44 +0,0 @@ -Following attributes are available for columns - - -|| name** || args** || description** || -|||||| »» Basic attributes || -|| **primary** || bool true || Defines column as a primary key column. || -|| **autoincrement** || bool true || Defines column as autoincremented column. If the underlying database doesn't support autoincrementation natively its emulated with triggers and sequence tables. -|| **default** || mixed default || Sets //default// as an application level default value for a column. When default value has been set for a column every time a record is created the specified column has the //default// as its value. -|| **zerofill** || boolean zerofill || Defines column as zerofilled column. Only supported by some drivers. -|| **unsigned** || boolean true || Defines column with integer type as unsigned. Only supported by some drivers. -|| **fixed** || boolean true || Defines string typed column as fixed length. -|| **enum** || array enum || Sets //enum// as an application level enum value list for a column. -|||||| »» Basic validators || -|| **unique** || bool true || Acts as database level unique constraint. Also validates that the specified column is unique. -|| **nospace** || bool true || Nospace validator. This validator validates that specified column doesn't contain any space/newline characters. - -|| **notblank** || bool true || Notblank validator. This validator validates that specified column doesn't contain only space/newline characters. Useful in for example comment posting applications where users are not allowed to post empty comments. -|| **notnull** || bool true || Acts as database level notnull constraint as well as notnull validator for the specified column. -|||||| »» Advanced validators || -|| **email** || bool true || Email validator. Validates that specified column is a valid email address. -|| **date** || bool true || Date validator. -|| **range** || array(min, max) || Range validator. Validates that the column is between //min// and //max//. -|| **country** || bool true || Country code validator validates that specified column has a valid country code. -|| **regexp ** || string regexp || Regular expression validator validates that specified column matches //regexp//. -|| **ip** || bool true || Ip validator validates that specified column is a valid internet protocol address. -|| **usstate** || bool true || Usstate validator validates that specified column is a valid usstate. - - - - -class User extends Doctrine_Record { - public function setTableDefinition() { - // the name cannot contain whitespace - $this->hasColumn("name", "string", 50, array("nospace" => true)); - - // the email should be a valid email - $this->hasColumn("email", "string", 200, array("email" => true)); - - // home_country should be a valid country code and not null - $this->hasColumn("home_country", "string", 2, array("country" => true, "notnull" => true)); - - } -} - diff --git a/manual/docs/Getting started - Setting table definition - Data types and lengths.php b/manual/docs/Getting started - Setting table definition - Data types and lengths.php deleted file mode 100644 index 1fbd2553c..000000000 --- a/manual/docs/Getting started - Setting table definition - Data types and lengths.php +++ /dev/null @@ -1,76 +0,0 @@ -Following data types are availible in doctrine: - -
  • ** string ** -
    The same as type 'string' in php -
  • ** float / double** -
    The same as type 'float' in php - -
  • ** integer** -
    The same as type 'integer' in php - -
  • ** boolean ** -
    The same as type 'boolean' in php - -
  • ** array ** - The same as type 'array' in php. Automatically serialized when saved into database and unserialized when retrieved from database. -
  • ** object ** - The same as type 'object' in php. Automatically serialized when saved into database and unserialized when retrieved from database. -
  • ** enum ** - -
  • ** timestamp ** -
    Database 'timestamp' type -
  • ** clob** -
    Database 'clob' type -
  • ** blob** -
    Database 'blob' type -
  • ** date ** -
    Database 'date' type - - -It should be noted that the length of the column affects in database level type -as well as application level validated length (the length that is validated with Doctrine validators). - - - -Example 1. Column named 'content' with type 'string' and length 3000 results in database type 'TEXT' of which has database level length of 4000. -However when the record is validated it is only allowed to have 'content' -column with maximum length of 3000. - - - -Example 2. Column with type 'integer' and length 1 results in 'TINYINT' on many databases. - - - - -In general Doctrine is smart enough to know which integer/string type to use depending on the specified length. - - - - - -class Article extends Doctrine_Record { - public function setTableDefinition() { - // few mapping examples: - - // maps into VARCHAR(100) on mysql - $this->hasColumn("title","string",100); - - // maps into TEXT on mysql - $this->hasColumn("content","string",4000); - - // maps into TINYINT on mysql - $this->hasColumn("type","integer",1); - - // maps into INT on mysql - $this->hasColumn("type2","integer",11); - - // maps into BIGINT on mysql - $this->hasColumn("type3","integer",20); - - // maps into TEXT on mysql - // (serialized and unserialized automatically by doctrine) - $this->hasColumn("types","array",4000); - - } -} - diff --git a/manual/docs/Getting started - Setting table definition - Default values.php b/manual/docs/Getting started - Setting table definition - Default values.php deleted file mode 100644 index d8796d568..000000000 --- a/manual/docs/Getting started - Setting table definition - Default values.php +++ /dev/null @@ -1,22 +0,0 @@ - -Doctrine supports default values for all data types. When default value is attached to a record column this means two of things. -First this value is attached to every newly created Record. - - - - -hasColumn('name', 'string', 50, array('default' => 'default name')); - } -} - -\$user = new User(); -print \$user->name; // default name -?> - - -Also when exporting record class to database DEFAULT //value// is attached to column definition statement. - - diff --git a/manual/docs/Getting started - Setting table definition - Enum emulation.php b/manual/docs/Getting started - Setting table definition - Enum emulation.php deleted file mode 100644 index dde1a901f..000000000 --- a/manual/docs/Getting started - Setting table definition - Enum emulation.php +++ /dev/null @@ -1,23 +0,0 @@ -Doctrine offers enum data type emulation for all databases. The enum data type of Doctrine maps to -integer on database. Doctrine takes care of converting the enumerated value automatically to its valuelist equivalent when a record is being fetched -and the valuelist value back to its enumerated equivalent when record is being saved. - - -class Article extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn("title","string", 200); - - // maps to TINYINT on mysql - $this->hasColumn("section", "enum", 2, array('values' => array("PHP","Python","Java","Ruby"))); - } -} -$article = new Article; -$article->title = 'My first php article'; -// doctrine auto-converts the section to integer when the -// record is being saved -$article->section = 'PHP'; -$article->save(); - -// on insert query with values 'My first php article' and 0 -// would be issued - diff --git a/manual/docs/Getting started - Setting table definition - Table options.php b/manual/docs/Getting started - Setting table definition - Table options.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Getting started - Setting table definition - Table options.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Getting started - Setting table definition.php b/manual/docs/Getting started - Setting table definition.php deleted file mode 100644 index 0d8d5fedc..000000000 --- a/manual/docs/Getting started - Setting table definition.php +++ /dev/null @@ -1,16 +0,0 @@ - - -class Email extends Doctrine_Record { - public function setTableDefinition() { - /** - * email table has one column named 'address' which is - * php type 'string' - * maximum length 200 - * database constraints: UNIQUE - * validators: email, unique - * - */ - $this->hasColumn("address","string",200,"email|unique"); - } -} - diff --git a/manual/docs/Getting started - Starting new project.php b/manual/docs/Getting started - Starting new project.php deleted file mode 100644 index cef7e7f3a..000000000 --- a/manual/docs/Getting started - Starting new project.php +++ /dev/null @@ -1,29 +0,0 @@ -Doctrine_Record is the basic component of every doctrine-based project. -There should be atleast one Doctrine_Record for each of your database tables. -Doctrine_Record follows the [http://www.martinfowler.com/eaaCatalog/activeRecord.html Active Record pattern] - -Doctrine auto-creates database tables and always adds a primary key column named 'id' to tables that doesn't have any primary keys specified. Only thing you need to for creating database tables is defining a class which extends Doctrine_Record and setting a setTableDefinition method with hasColumn() method calls. - -An short example: - -We want to create a database table called 'user' with columns id(primary key), name, username, password and created. Provided that you have already installed Doctrine these few lines of code are all you need: - - -require_once('lib/Doctrine.php'); - -spl_autoload_register(array('Doctrine', 'autoload')); - -class User extends Doctrine_Record { - public function setTableDefinition() { - // set 'user' table columns, note that - // id column is always auto-created - - $this->hasColumn('name','string',30); - $this->hasColumn('username','string',20); - $this->hasColumn('password','string',16); - $this->hasColumn('created','integer',11); - } -} - - -We now have a user model that supports basic CRUD opperations! diff --git a/manual/docs/Getting started - Working with existing databases - Introduction.php b/manual/docs/Getting started - Working with existing databases - Introduction.php deleted file mode 100644 index c6c70882f..000000000 --- a/manual/docs/Getting started - Working with existing databases - Introduction.php +++ /dev/null @@ -1,3 +0,0 @@ -A common case when looking for ORM tools like Doctrine is that the database and the code that access it is growing large/complex. A more substantial tool is needed then manual SQL code. - -Doctrine has support for generating Doctrine_Record classes from your existing database. There is no need for you to manually write all the Doctrine_Record classes for your domain model. diff --git a/manual/docs/Getting started - Working with existing databases - Making the first import.php b/manual/docs/Getting started - Working with existing databases - Making the first import.php deleted file mode 100644 index b4a530b09..000000000 --- a/manual/docs/Getting started - Working with existing databases - Making the first import.php +++ /dev/null @@ -1,56 +0,0 @@ -Let's consider we have a mysql database called test with a single table called 'file'. - -The file table has been created with the following sql statement: - -{{CREATE TABLE file ( - id INT UNSIGNED AUTO_INCREMENT NOT NULL, - name VARCHAR(150), - size BIGINT, - modified BIGINT, - type VARCHAR(10), - content TEXT, - path TEXT, - PRIMARY KEY(id))}} - -Now we would like to convert it into Doctrine record class. It can be achieved easily with the following code snippet: - - -require_once('lib/Doctrine.php'); - -spl_autoload_register(array('Doctrine', 'autoload')); - -$conn = Doctrine_Manager::connection(new Doctrine_Db('mysql://root:dc34@localhost/test')); - -// import method takes one parameter: the import directory (the directory where -// the generated record files will be put in -$conn->import->import('myrecords'); - - -That's it! Now there should be a file called File.php in your myrecords directory. The file should look like: - - -/** - * This class has been auto-generated by the Doctrine ORM Framework - * Created: Saturday 10th of February 2007 01:03:15 PM - */ -class File extends Doctrine_Record -{ - public function setTableDefinition() - { - $this->hasColumn('id', 'integer', 4, array('notnull' => true, - 'primary' => true, - 'unsigned' > true, - 'autoincrement' => true)); - $this->hasColumn('name', 'string', 150); - $this->hasColumn('size', 'integer', 8); - $this->hasColumn('modified', 'integer', 8); - $this->hasColumn('type', 'string', 10); - $this->hasColumn('content', 'string', null); - $this->hasColumn('path', 'string', null); - } - public function setUp() - { - - } -} - diff --git a/manual/docs/Hierarchical data - Adjacency list - Introduction.php b/manual/docs/Hierarchical data - Adjacency list - Introduction.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Hierarchical data - Adjacency list - Introduction.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Hierarchical data - Examples.php b/manual/docs/Hierarchical data - Examples.php deleted file mode 100644 index 56198ad04..000000000 --- a/manual/docs/Hierarchical data - Examples.php +++ /dev/null @@ -1,401 +0,0 @@ - - - -require_once("path/to/Doctrine.php"); - -function __autoload($classname) { - - return Doctrine::autoload($classname); - -} - -// define our tree -class Menu extends Doctrine_Record { - public function setTableDefinition() { - - $this->setTableName('menu'); - - // add this your table definition to set the table as NestedSet tree implementation - $this->actsAsTree('NestedSet'); - - // you do not need to add any columns specific to the nested set implementation - // these are added for you - $this->hasColumn("name","string",30); - - } - - // this __toString() function is used to get the name for the path, see node::getPath - public function __toString() { - return $this->get('name'); - } -} - -// set connections to database -$dsn = 'mysql:dbname=nestedset;host=localhost'; -$user = 'user'; -$password = 'pass'; - -try { - $dbh = new PDO($dsn, $user, $password); -} catch (PDOException $e) { - echo 'Connection failed: ' . $e->getMessage(); -} - -$manager = Doctrine_Manager::getInstance(); - -$conn = $manager->openConnection($dbh); - -// create root -$root = new Menu(); -$root->set('name', 'root'); - -$manager->getTable('Menu')->getTree()->createRoot($root); - -// build tree -$two = new Menu(); -$two->set('name', '2'); -$root->getNode()->addChild($two); - -$one = new Menu(); -$one->set('name', '1'); -$one->getNode()->insertAsPrevSiblingOf($two); - -// refresh as node's lft and rgt values have changed -$two->refresh(); - -$three = new Menu(); -$three->set('name', '3'); -$three->getNode()->insertAsNextSiblingOf($two); -$two->refresh(); - -$one_one = new Menu(); -$one_one->set('name', '1.1'); -$one_one->getNode()->insertAsFirstChildOf($one); -$one->refresh(); - -$one_two = new Menu(); -$one_two->set('name', '1.2'); -$one_two->getNode()->insertAsLastChildOf($one); -$one_two->refresh(); - -$one_two_one = new Menu(); -$one_two_one->set('name', '1.2.1'); -$one_two->getNode()->addChild($one_two_one); - -$root->refresh(); -$four = new Menu(); -$four->set('name', '4'); -$root->getNode()->addChild($four); - -$root->refresh(); -$five = new Menu(); -$five->set('name', '5'); -$root->getNode()->addChild($five); - -$root->refresh(); -$six = new Menu(); -$six->set('name', '6'); -$root->getNode()->addChild($six); - -output_message('initial tree'); -output_tree($root); - -$one_one->refresh(); -$six->set('name', '1.0 (was 6)'); -$six->getNode()->moveAsPrevSiblingOf($one_one); - -$one_two->refresh(); -$five->refresh(); -$five->set('name', '1.3 (was 5)'); -$five->getNode()->moveAsNextSiblingOf($one_two); - -$one_one->refresh(); -$four->refresh(); -$four->set('name', '1.1.1 (was 4)'); -$four->getNode()->moveAsFirstChildOf($one_one); - -$root->refresh(); -$one_two_one->refresh(); -$one_two_one->set('name', 'last (was 1.2.1)'); -$one_two_one->getNode()->moveAsLastChildOf($root); - -output_message('transformed tree'); -output_tree($root); - -$one_one->refresh(); -$one_one->deleteNode(); - -output_message('delete 1.1'); -output_tree($root); - -// now test fetching root -$tree_root = $manager->getTable('Menu')->getTree()->findRoot(); -output_message('testing fetch root and outputting tree from the root node'); -output_tree($tree_root); - -// now test fetching the tree -output_message('testing fetching entire tree using tree::fetchTree()'); -$tree = $manager->getTable('Menu')->getTree()->fetchTree(); -while($node = $tree->next()) -{ - output_node($node); -} - -// now test fetching the tree -output_message('testing fetching entire tree using tree::fetchTree(), excluding root node'); -$tree = $manager->getTable('Menu')->getTree()->fetchTree(array('include_record' => false)); -while($node = $tree->next()) -{ - output_node($node); -} - -// now test fetching the branch -output_message('testing fetching branch for 1, using tree::fetchBranch()'); -$one->refresh(); -$branch = $manager->getTable('Menu')->getTree()->fetchBranch($one->get('id')); -while($node = $branch->next()) -{ - output_node($node); -} - -// now test fetching the tree -output_message('testing fetching branch for 1, using tree::fetchBranch() excluding node 1'); -$tree = $manager->getTable('Menu')->getTree()->fetchBranch($one->get('id'), array('include_record' => false)); -while($node = $tree->next()) -{ - output_node($node); -} - -// now perform some tests -output_message('descendants for 1'); -$descendants = $one->getNode()->getDescendants(); -while($descendant = $descendants->next()) -{ - output_node($descendant); -} - -// move one and children under two -$two->refresh(); -$one->getNode()->moveAsFirstChildOf($two); - -output_message('moved one as first child of 2'); -output_tree($root); - -output_message('descendants for 2'); -$two->refresh(); -$descendants = $two->getNode()->getDescendants(); -while($descendant = $descendants->next()) -{ - output_node($descendant); -} - -output_message('number descendants for 2'); -echo $two->getNode()->getNumberDescendants() .'
    '; - -output_message('children for 2 (notice excludes children of children, known as descendants)'); -$children = $two->getNode()->getChildren(); -while($child = $children->next()) -{ - output_node($child); -} - -output_message('number children for 2'); -echo $two->getNode()->getNumberChildren() .'
    '; - -output_message('path to 1'); -$path = $one->getNode()->getPath(' > '); -echo $path .' -'; - -output_message('path to 1 (including 1)'); -$path = $one->getNode()->getPath(' > ', true); -echo $path .' -'; - -output_message('1 has parent'); -$hasParent = $one->getNode()->hasParent(); -$msg = $hasParent ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('parent to 1'); -$parent = $one->getNode()->getParent(); -if($parent->exists()) -{ - echo $parent->get('name') .' -'; -} - -output_message('root isRoot?'); -$isRoot = $root->getNode()->isRoot(); -$msg = $isRoot ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('one isRoot?'); -$isRoot = $one->getNode()->isRoot(); -$msg = $isRoot ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('root hasParent'); -$hasParent = $root->getNode()->hasParent(); -$msg = $hasParent ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('root getParent'); -$parent = $root->getNode()->getParent(); -if($parent->exists()) -{ - echo $parent->get('name') .' -'; -} - -output_message('get first child of root'); -$record = $root->getNode()->getFirstChild(); -if($record->exists()) -{ - echo $record->get('name') .' -'; -} - -output_message('get last child of root'); -$record = $root->getNode()->getLastChild(); -if($record->exists()) -{ - echo $record->get('name') .' -'; -} - -$one_two->refresh(); - -output_message('get prev sibling of 1.2'); -$record = $one_two->getNode()->getPrevSibling(); -if($record->exists()) -{ - echo $record->get('name') .' -'; -} - -output_message('get next sibling of 1.2'); -$record = $one_two->getNode()->getNextSibling(); -if($record->exists()) -{ - echo $record->get('name') .' -'; -} - -output_message('siblings of 1.2'); -$siblings = $one_two->getNode()->getSiblings(); -foreach($siblings as $sibling) -{ - if($sibling->exists()) - echo $sibling->get('name') .' -'; -} - -output_message('siblings of 1.2 (including 1.2)'); -$siblings = $one_two->getNode()->getSiblings(true); -foreach($siblings as $sibling) -{ - if($sibling->exists()) - echo $sibling->get('name') .' -'; -} - -$new = new Menu(); -$new->set('name', 'parent of 1.2'); -$new->getNode()->insertAsParentOf($one_two); - -output_message('added a parent to 1.2'); -output_tree($root); - -try { - $dummy = new Menu(); - $dummy->set('name', 'dummy'); - $dummy->save(); -} -catch (Doctrine_Exception $e) -{ - output_message('You cannot save a node unless it is in the tree'); -} - -try { - $fake = new Menu(); - $fake->set('name', 'dummy'); - $fake->set('lft', 200); - $fake->set('rgt', 1); - $fake->save(); -} -catch (Doctrine_Exception $e) -{ - output_message('You cannot save a node with bad lft and rgt values'); -} - -// check last remaining tests -output_message('New parent is descendant of 1'); -$one->refresh(); -$res = $new->getNode()->isDescendantOf($one); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('New parent is descendant of 2'); -$two->refresh(); -$res = $new->getNode()->isDescendantOf($two); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('New parent is descendant of 1.2'); -$one_two->refresh(); -$res = $new->getNode()->isDescendantOf($one_two); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('New parent is descendant of or equal to 1'); -$one->refresh(); -$res = $new->getNode()->isDescendantOfOrEqualTo($one); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('New parent is descendant of or equal to 1.2'); -$one_two->refresh(); -$res = $new->getNode()->isDescendantOfOrEqualTo($one_two); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('New parent is descendant of or equal to 1.3'); -$five->refresh(); -$res = $new->getNode()->isDescendantOfOrEqualTo($new); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -function output_tree($root) -{ - // display tree - // first we must refresh the node as the tree has been transformed - $root->refresh(); - - // next we must get the iterator to traverse the tree from the root node - $traverse = $root->getNode()->traverse(); - - output_node($root); - // now we traverse the tree and output the menu items - while($item = $traverse->next()) - { - output_node($item); - } - - unset($traverse); -} - -function output_node($record) -{ - echo str_repeat('-', $record->getNode()->getLevel()) . $record->get('name') - . ' (has children:'.$record->getNode()->hasChildren().') ' - . ' (is leaf:'.$record->getNode()->isLeaf().') '.'
    '; -} - -function output_message($msg) -{ - echo " -**//$msg//**".' -'; -} -
    \ No newline at end of file diff --git a/manual/docs/Hierarchical data - Introduction - Node interface.php b/manual/docs/Hierarchical data - Introduction - Node interface.php deleted file mode 100644 index fd8db564c..000000000 --- a/manual/docs/Hierarchical data - Introduction - Node interface.php +++ /dev/null @@ -1,93 +0,0 @@ - - -interface Doctrine_Node_Interface { - - /** - * insert node into tree - */ - public function insertAsParentOf(Doctrine_Record $dest); - - public function insertAsPrevSiblingOf(Doctrine_Record $dest); - - public function insertAsNextSiblingOf(Doctrine_Record $dest); - - public function insertAsFirstChildOf(Doctrine_Record $dest); - - public function insertAsLastChildOf(Doctrine_Record $dest); - - public function addChild(Doctrine_Record $record); - - /** - * moves node (if has children, moves branch) - * - */ - public function moveAsPrevSiblingOf(Doctrine_Record $dest); - - public function moveAsNextSiblingOf(Doctrine_Record $dest); - - public function moveAsFirstChildOf(Doctrine_Record $dest); - - public function moveAsLastChildOf(Doctrine_Record $dest); - - /** - * node information - */ - public function getPrevSibling(); - - public function getNextSibling(); - - public function getSiblings($includeNode = false); - - public function getFirstChild(); - - public function getLastChild(); - - public function getChildren(); - - public function getDescendants(); - - public function getParent(); - - public function getAncestors(); - - public function getPath($seperator = ' > ', $includeNode = false); - - public function getLevel(); - - public function getNumberChildren(); - - public function getNumberDescendants(); - - /** - * node checks - */ - public function hasPrevSibling(); - - public function hasNextSibling(); - - public function hasChildren(); - - public function hasParent(); - - public function isLeaf(); - - public function isRoot(); - - public function isEqualTo(Doctrine_Record $subj); - - public function isDescendantOf(Doctrine_Record $subj); - - public function isDescendantOfOrEqualTo(Doctrine_Record $subj); - - public function isValidNode(); - - /** - * deletes node and it's descendants - */ - public function delete(); -} - -// if your model acts as tree you can retrieve the associated node object as follows -$record = $manager->getTable('Model')->find($pk); -$nodeObj = $record->getNode(); - \ No newline at end of file diff --git a/manual/docs/Hierarchical data - Introduction - Setting up.php b/manual/docs/Hierarchical data - Introduction - Setting up.php deleted file mode 100644 index 19db1ec5e..000000000 --- a/manual/docs/Hierarchical data - Introduction - Setting up.php +++ /dev/null @@ -1,24 +0,0 @@ - - -class Menu extends Doctrine_Record { - public function setTableDefinition() { - - $this->setTableName('menu'); - - // add this your table definition to set the table as NestedSet tree implementation - // $implName is 'NestedSet' or 'AdjacencyList' or 'MaterializedPath' - // $options is an assoc array of options, see implementation docs for options - $this->option('treeImpl', $implName); - $this->option('treeOptions', $options); - - // you do not need to add any columns specific to the nested set implementation, these are added for you - $this->hasColumn("name","string",30); - - } - - // this __toString() function is used to get the name for the path, see node::getPath() - public function __toString() { - return $this->get('name'); - } -} - \ No newline at end of file diff --git a/manual/docs/Hierarchical data - Introduction - Traversing or Walking Trees.php b/manual/docs/Hierarchical data - Introduction - Traversing or Walking Trees.php deleted file mode 100644 index 3282fb0d2..000000000 --- a/manual/docs/Hierarchical data - Introduction - Traversing or Walking Trees.php +++ /dev/null @@ -1,43 +0,0 @@ - - -/* - * traverse the entire tree from root - */ -$root = $manager->getTable('Model')->getTree()->fetchRoot(); -if($root->exists()) -{ - $tree = $root->traverse(); - while($node = $tree->next()) - { - // output your tree here - } -} - -// or the optimised approach using tree::fetchTree -$tree = $manager->getTable('Model')->getTree()->fetchTree(); -while($node = $tree->next()) -{ - // output tree here -} - -/* - * traverse a branch of the tree - */ -$record = $manager->getTable('Model')->find($pk); -if($record->exists()) -{ - $branch = $record->traverse(); - while($node = $branch->next()) - { - // output your tree here - } -} - -// or the optimised approach -$branch = $manager->getTable('Model')->getTree()->fetchBranch($pk); -while($node = $branch->traverse()) -{ - // output your tree here -} - - \ No newline at end of file diff --git a/manual/docs/Hierarchical data - Introduction - Tree interface.php b/manual/docs/Hierarchical data - Introduction - Tree interface.php deleted file mode 100644 index 0f0ebc23d..000000000 --- a/manual/docs/Hierarchical data - Introduction - Tree interface.php +++ /dev/null @@ -1,30 +0,0 @@ - - - -interface Doctrine_Tree_Interface { - - /** - * creates root node from given record or from a new record - */ - public function createRoot(Doctrine_Record $record = null); - - /** - * returns root node - */ - public function findRoot($root_id = 1); - - /** - * optimised method to returns iterator for traversal of the entire tree from root - */ - public function fetchTree($options = array()); - - /** - * optimised method that returns iterator for traversal of the tree from the given record's primary key - */ - public function fetchBranch($pk, $options = array()); -} - -// if your model acts as tree you can retrieve the associated tree object as follows -$treeObj = $manager->getTable('Model')->getTree(); - - \ No newline at end of file diff --git a/manual/docs/Hierarchical data - Introduction.php b/manual/docs/Hierarchical data - Introduction.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Hierarchical data - Introduction.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Hierarchical data - Materialized path - Introduction.php b/manual/docs/Hierarchical data - Materialized path - Introduction.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Hierarchical data - Materialized path - Introduction.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Hierarchical data - Nested set - Introduction.php b/manual/docs/Hierarchical data - Nested set - Introduction.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Hierarchical data - Nested set - Introduction.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Hierarchical data - Nested set - Setting up.php b/manual/docs/Hierarchical data - Nested set - Setting up.php deleted file mode 100644 index ed993414f..000000000 --- a/manual/docs/Hierarchical data - Nested set - Setting up.php +++ /dev/null @@ -1,22 +0,0 @@ - - -class Menu extends Doctrine_Record { - public function setTableDefinition() { - - $this->setTableName('menu'); - - // add this your table definition to set the table as NestedSet tree implementation - $this->option('treeImpl', 'NestedSet'); - $this->option('treeOptions', array()); - - // you do not need to add any columns specific to the nested set implementation, these are added for you - $this->hasColumn("name","string",30); - - } - - // this __toString() function is used to get the name for the path, see node::getPath() - public function __toString() { - return $this->get('name'); - } -} - \ No newline at end of file diff --git a/manual/docs/Hierarchical data - Nested set - Tree options.php b/manual/docs/Hierarchical data - Nested set - Tree options.php deleted file mode 100644 index be13f74c3..000000000 --- a/manual/docs/Hierarchical data - Nested set - Tree options.php +++ /dev/null @@ -1,27 +0,0 @@ - - -//use these options in the setTableDefinition -$options = array('hasManyRoots' => true, // enable many roots - 'rootColumnName' => 'root_id'); // set root column name, defaults to 'root_id' - -// To create new root nodes, if you have manually set the root_id, then it will be used -// otherwise it will automatically use the next available root id -$root = new Menu(); -$root->set('name', 'root'); - -// insert first root, will auto be assigned root_id = 1 -$manager->getTable('Menu')->getTree()->createRoot($root); - -$another_root = new Menu(); -$another_root->set('name', 'another root'); - -// insert another root, will auto be assigned root_id = 2 -$manager->getTable('Menu')->getTree()->createRoot($another_root); - -// fetching a specifc root -$root = $manager->getTable('Menu')->getTree()->fetchRoot(1); -$another_root = $manager->getTable('Menu')->getTree()->fetchRoot(2); - -// fetching all roots -$roots = $manager->getTable('Menu')->getTree()->fetchRoots(); - diff --git a/manual/docs/Hierarchical data - NestedSet - Introduction.php b/manual/docs/Hierarchical data - NestedSet - Introduction.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Hierarchical data - NestedSet - Introduction.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Native SQL - Component queries.php b/manual/docs/Native SQL - Component queries.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Native SQL - Component queries.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Native SQL - Fetching multiple components.php b/manual/docs/Native SQL - Fetching multiple components.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Native SQL - Fetching multiple components.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Native SQL - Scalar queries.php b/manual/docs/Native SQL - Scalar queries.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Native SQL - Scalar queries.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Object relational mapping - Columns - Column aliases.php b/manual/docs/Object relational mapping - Columns - Column aliases.php deleted file mode 100644 index 3cac396de..000000000 --- a/manual/docs/Object relational mapping - Columns - Column aliases.php +++ /dev/null @@ -1,15 +0,0 @@ -Doctrine offers a way of setting column aliases. This can be very useful when you want to keep the application logic separate from the -database logic. For example if you want to change the name of the database field all you need to change at your application is the column definition. - - -class Book extends Doctrine_Record -{ - public function setTableDefinition() - { - $this->hasColumn('bookName as name', 'string'); - } -} -$book = new Book(); -$book->name = 'Some book'; -$book->save(); - diff --git a/manual/docs/Object relational mapping - Columns - Column naming.php b/manual/docs/Object relational mapping - Columns - Column naming.php deleted file mode 100644 index fba098210..000000000 --- a/manual/docs/Object relational mapping - Columns - Column naming.php +++ /dev/null @@ -1,21 +0,0 @@ -One problem with database compatibility is that many databases differ in their behaviour of how the result set of a -query is returned. MySql leaves the field names unchanged, which means if you issue a query of the form -"SELECT myField FROM ..." then the result set will contain the field 'myField'. - - - - -Unfortunately, this is just the way MySql and some other databases do it. Postgres for example returns all field names in lowercase -whilst Oracle returns all field names in uppercase. "So what? In what way does this influence me when using Doctrine?", -you may ask. Fortunately, you don't have to bother about that issue at all. - - -Doctrine takes care of this problem -transparently. That means if you define a derived Record class and define a field called 'myField' you will always -access it through $record->myField (or $record['myField'], whatever you prefer) no matter whether you're using MySql -or Postgres or Oracle ect. - - - -In short: You can name your fields however you want, using under_scores, camelCase or whatever you prefer. - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Array.php b/manual/docs/Object relational mapping - Columns - Data types - Array.php deleted file mode 100644 index 5f4847f9c..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Array.php +++ /dev/null @@ -1,9 +0,0 @@ -This is the same as 'array' type in PHP. - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('arraytest', 'array', 10000); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Blob.php b/manual/docs/Object relational mapping - Columns - Data types - Blob.php deleted file mode 100644 index 62e4788c3..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Blob.php +++ /dev/null @@ -1,11 +0,0 @@ -Blob (Binary Large OBject) data type is meant to store data of undefined length that may be too large to store in text fields, like data that is usually stored in files. - -Blob fields are usually not meant to be used as parameters of query search clause (WHERE) unless the underlying DBMS supports a feature usually known as "full text search" - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('blobtest', 'blob'); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Boolean.php b/manual/docs/Object relational mapping - Columns - Data types - Boolean.php deleted file mode 100644 index 81e676b10..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Boolean.php +++ /dev/null @@ -1,13 +0,0 @@ -The boolean data type represents only two values that can be either 1 or 0. -Do not assume that these data types are stored as integers because some DBMS drivers may implement this -type with single character text fields for a matter of efficiency. -Ternary logic is possible by using null as the third possible value that may be assigned to fields of this type. - - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('booltest', 'boolean'); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Clob.php b/manual/docs/Object relational mapping - Columns - Data types - Clob.php deleted file mode 100644 index 5ec5bd7ba..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Clob.php +++ /dev/null @@ -1,14 +0,0 @@ -Clob (Character Large OBject) data type is meant to store data of undefined length that may be too large to store in text fields, like data that is usually stored in files. - -Clob fields are meant to store only data made of printable ASCII characters whereas blob fields are meant to store all types of data. - -Clob fields are usually not meant to be used as parameters of query search clause (WHERE) unless the underlying DBMS supports a feature usually known as "full text search" - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('clobtest', 'clob'); - } -} - - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Date.php b/manual/docs/Object relational mapping - Columns - Data types - Date.php deleted file mode 100644 index 9e33d2e4c..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Date.php +++ /dev/null @@ -1,20 +0,0 @@ -The date data type may represent dates with year, month and day. DBMS independent representation of dates is accomplished by using text strings formatted according to the IS0-8601 standard. - - - -The format defined by the ISO-8601 standard for dates is YYYY-MM-DD where YYYY is the number of the year (Gregorian calendar), MM is the number of the month from 01 to 12 and DD is the number of the day from 01 to 31. Months or days numbered below 10 should be padded on the left with 0. - - - -Some DBMS have native support for date formats, but for others the DBMS driver may have to represent them as integers or text values. In any case, it is always possible to make comparisons between date values as well sort query results by fields of this type. - - - - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('datetest', 'date'); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Enum.php b/manual/docs/Object relational mapping - Columns - Data types - Enum.php deleted file mode 100644 index 10fd48b51..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Enum.php +++ /dev/null @@ -1,18 +0,0 @@ -Doctrine has a unified enum type. Enum typed columns automatically convert the string values into index numbers and vice versa. The possible values for the column -can be specified with Doctrine_Record::setEnumValues(columnName, array values). - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('enumtest', 'enum', 4, - array( - 'values' => array( - 'php', - 'java', - 'python' - ) - ) - ); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Float.php b/manual/docs/Object relational mapping - Columns - Data types - Float.php deleted file mode 100644 index 2cbcb1eff..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Float.php +++ /dev/null @@ -1,9 +0,0 @@ -The float data type may store floating point decimal numbers. This data type is suitable for representing numbers within a large scale range that do not require high accuracy. The scale and the precision limits of the values that may be stored in a database depends on the DBMS that it is used. - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('floattest', 'float'); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Gzip.php b/manual/docs/Object relational mapping - Columns - Data types - Gzip.php deleted file mode 100644 index a6e46748d..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Gzip.php +++ /dev/null @@ -1,9 +0,0 @@ -Gzip datatype is the same as string except that its automatically compressed when persisted and uncompressed when fetched. This datatype can be useful when storing data with a large compressibility ratio, such as bitmap images. - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('gziptest', 'gzip'); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Integer.php b/manual/docs/Object relational mapping - Columns - Data types - Integer.php deleted file mode 100644 index b120a9337..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Integer.php +++ /dev/null @@ -1,14 +0,0 @@ -The integer type is the same as integer type in PHP. It may store integer values as large as each DBMS may handle. - -Fields of this type may be created optionally as unsigned integers but not all DBMS support it. -Therefore, such option may be ignored. Truly portable applications should not rely on the availability of this option. - -The integer type maps to different database type depending on the column length. - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('integertest', 'integer', 4, array('unsigned' => true)); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Introduction.php b/manual/docs/Object relational mapping - Columns - Data types - Introduction.php deleted file mode 100644 index 807d31707..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Introduction.php +++ /dev/null @@ -1,39 +0,0 @@ -All DBMS provide multiple choice of data types for the information that can be stored in their database table fields. -However, the set of data types made available varies from DBMS to DBMS. - - - -To simplify the interface with the DBMS supported by Doctrine, it was defined a base set of data types -that applications may access independently of the underlying DBMS. - - - -The Doctrine applications programming interface takes care of mapping data types -when managing database options. It is also able to convert that is sent to and received from the underlying DBMS using the respective driver. - - - -The following data type examples should be used with Doctrine's createTable() method. -The example array at the end of the data types section may be used with createTable() -to create a portable table on the DBMS of choice (please refer to the main Doctrine -documentation to find out what DBMS back ends are properly supported). -It should also be noted that the following examples do not cover the creation -and maintenance of indices, this chapter is only concerned with data types and the proper usage thereof. - - - -It should be noted that the length of the column affects in database level type as well as application level validated length (the length that is validated with Doctrine validators). - - - -Example 1. Column named 'content' with type 'string' and length 3000 results in database type 'TEXT' of which has database level length of 4000. However when the record is validated it is only allowed to have 'content' -column with maximum length of 3000. - - - -Example 2. Column with type 'integer' and length 1 results in 'TINYINT' on many databases. - - - -In general Doctrine is smart enough to know which integer/string type to use depending on the specified length. - - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Object.php b/manual/docs/Object relational mapping - Columns - Data types - Object.php deleted file mode 100644 index ab0170c01..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Object.php +++ /dev/null @@ -1,10 +0,0 @@ -Doctrine supports objects as column types. Basically you can set an object to a field and Doctrine handles automatically the serialization / unserialization -of that object. - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('objecttest', 'object'); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - String.php b/manual/docs/Object relational mapping - Columns - Data types - String.php deleted file mode 100644 index a1ab08fdb..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - String.php +++ /dev/null @@ -1,15 +0,0 @@ -The text data type is available with two options for the length: one that is explicitly length limited and another of undefined length that should be as large as the database allows. - -The length limited option is the most recommended for efficiency reasons. The undefined length option allows very large fields but may prevent the use of indexes, nullability and may not allow sorting on fields of its type. - -The fields of this type should be able to handle 8 bit characters. Drivers take care of DBMS specific escaping of characters of special meaning with the values of the strings to be converted to this type. - -By default Doctrine will use variable length character types. If fixed length types should be used can be controlled via the fixed modifier. - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('stringtest', 'string', 200, array('fixed' => true)); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Time.php b/manual/docs/Object relational mapping - Columns - Data types - Time.php deleted file mode 100644 index 3b9b639f2..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Time.php +++ /dev/null @@ -1,14 +0,0 @@ -The time data type may represent the time of a given moment of the day. DBMS independent representation of the time of the day is also accomplished by using text strings formatted according to the ISO-8601 standard. - -The format defined by the ISO-8601 standard for the time of the day is HH:MI:SS where HH is the number of hour the day from 00 to 23 and MI and SS are respectively the number of the minute and of the second from 00 to 59. Hours, minutes and seconds numbered below 10 should be padded on the left with 0. - -Some DBMS have native support for time of the day formats, but for others the DBMS driver may have to represent them as integers or text values. In any case, it is always possible to make comparisons between time values as well sort query results by fields of this type. - - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('timetest', 'time'); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Timestamp.php b/manual/docs/Object relational mapping - Columns - Data types - Timestamp.php deleted file mode 100644 index 9aeb7a9cb..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Timestamp.php +++ /dev/null @@ -1,12 +0,0 @@ -The timestamp data type is a mere combination of the date and the time of the day data types. -The representation of values of the time stamp type is accomplished by joining the date and time -string values in a single string joined by a space. Therefore, the format template is YYYY-MM-DD HH:MI:SS. -The represented values obey the same rules and ranges described for the date and time data types - - -class Test extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('timestamptest', 'timestamp'); - } -} - diff --git a/manual/docs/Object relational mapping - Columns - Data types - Type modifiers.php b/manual/docs/Object relational mapping - Columns - Data types - Type modifiers.php deleted file mode 100644 index 1c05837cb..000000000 --- a/manual/docs/Object relational mapping - Columns - Data types - Type modifiers.php +++ /dev/null @@ -1,57 +0,0 @@ -Within the Doctrine API there are a few modifiers that have been designed to aid in optimal table design. These are: - - - -* The notnull modifiers - -* The length modifiers - -* The default modifiers - -* unsigned modifiers for some field definitions, although not all DBMS's support this modifier for integer field types. - -* zerofill modifiers (not supported by all drivers) - -* collation modifiers (not supported by all drivers) - -* fixed length modifiers for some field definitions. - -Building upon the above, we can say that the modifiers alter the field definition to create more specific field types for specific usage scenarios. The notnull modifier will be used in the following way to set the default DBMS NOT NULL Flag on the field to true or false, depending on the DBMS's definition of the field value: In PostgreSQL the "NOT NULL" definition will be set to "NOT NULL", whilst in MySQL (for example) the "NULL" option will be set to "NO". In order to define a "NOT NULL" field type, we simply add an extra parameter to our definition array (See the examples in the following section) - - - - - - - - - -Using the above example, we can also explore the default field operator. Default is set in the same way as the notnull operator to set a default value for the field. This value may be set in any character set that the DBMS supports for text fields, and any other valid data for the field's data type. In the above example, we have specified a valid time for the "Time" data type, '12:34:05'. Remember that when setting default dates and times, as well as datetimes, you should research and stay within the epoch of your chosen DBMS, otherwise you will encounter difficult to diagnose errors! - - - - - - - - - - - - - - -The above example will create a character varying field of length 12 characters in the database table. If the length definition is left out, Doctrine will create a length of the maximum allowable length for the data type specified, which may create a problem with some field types and indexing. Best practice is to define lengths for all or most of your fields. - - diff --git a/manual/docs/Object relational mapping - Columns - Default values.php b/manual/docs/Object relational mapping - Columns - Default values.php deleted file mode 100644 index afebeb70b..000000000 --- a/manual/docs/Object relational mapping - Columns - Default values.php +++ /dev/null @@ -1,14 +0,0 @@ -Doctrine supports default values for all data types. When default value is attached to a record column this means two of things. -First this value is attached to every newly created Record. - - -class User extends Doctrine_record { - public function setTableDefinition() { - $this->hasColumn('name', 'string', 50, array('default' => 'default name')); - } -} -$user = new User(); -print $user->name; // default name - - -Also when exporting record class to database DEFAULT //value// is attached to column definition statement. diff --git a/manual/docs/Object relational mapping - Constraints and validators - Check.php b/manual/docs/Object relational mapping - Constraints and validators - Check.php deleted file mode 100644 index 0d3e5a86c..000000000 --- a/manual/docs/Object relational mapping - Constraints and validators - Check.php +++ /dev/null @@ -1,41 +0,0 @@ -Doctrine check constraints act as database level constraints as well as application level validators. When a record with check validators is exported additional CHECK constraints are being added to CREATE TABLE statement. - -Doctrine provides the following simple check operators: - -* '''gt''' -> greater than constraint ( > ) -* '''lt''' -> less than constraint ( < ) -* '''gte''' -> greater than or equal to constraint ( >= ) -* '''lte''' -> less than or equal to constraint ( <= ) - - -Consider the following example: - - -class Product extends Doctrine_Record -{ - public function setTableDefinition() - { - $this->hasColumn('id', 'integer', 4, 'primary'); - $this->hasColumn('price', 'decimal', 18, array('gt' => 0); - } -} - - -When exported the given class definition would execute the following statement (in pgsql): - -CREATE TABLE product ( - id INTEGER, - price NUMERIC CHECK (price > 0) - PRIMARY KEY(id)) - -So Doctrine optionally ensures even at the database level that the price of any product cannot be below zero. - -> NOTE: some databases don't support CHECK constraints. When this is the case Doctrine simple skips the creation of check constraints. - -If the Doctrine validators are turned on the given definition would also ensure that when a record is being saved its price is always greater than zero. - -If some of the prices of the saved products within a transaction is below zero, Doctrine throws Doctrine_Validator_Exception and automatically rolls back the transaction. diff --git a/manual/docs/Object relational mapping - Constraints and validators - Introduction.php b/manual/docs/Object relational mapping - Constraints and validators - Introduction.php deleted file mode 100644 index 34631e4a5..000000000 --- a/manual/docs/Object relational mapping - Constraints and validators - Introduction.php +++ /dev/null @@ -1,7 +0,0 @@ -Data types are a way to limit the kind of data that can be stored in a table. For many applications, however, the constraint they provide is too coarse. For example, a column containing a product price should probably only accept positive values. But there is no standard data type that accepts only positive numbers. Another issue is that you might want to constrain column data with respect to other columns or rows. For example, in a table containing product information, there should be only one row for each product number. -[source: http://www.postgresql.org/docs/8.2/static/ddl-constraints.html#AEN2032] - -Doctrine allows you to define *portable* constraints on columns and tables. Constraints give you as much control over the data in your tables as you wish. If a user attempts to store data in a column that would violate a constraint, an error is raised. This applies even if the value came from the default value definition. - -Doctrine constraints act as database level constraints as well as application level validators. This means double security: the database doesn't allow wrong kind of values and neither does the application. - diff --git a/manual/docs/Object relational mapping - Constraints and validators - Notnull.php b/manual/docs/Object relational mapping - Constraints and validators - Notnull.php deleted file mode 100644 index 1207cf9b6..000000000 --- a/manual/docs/Object relational mapping - Constraints and validators - Notnull.php +++ /dev/null @@ -1,23 +0,0 @@ -A not-null constraint simply specifies that a column must not assume the null value. A not-null constraint is always written as a column constraint. - -The following definition uses a notnull constraint for column 'name'. This means that the specified column doesn't accept -null values. - - -class User extends Doctrine_Record -{ - public function setTableDefinition() - { - $this->hasColumn('name', 'string', 200, array('notnull' => true, - 'primary' => true)); - } -} - - -When this class gets exported to database the following Sql statement would get executed (in Mysql): - -CREATE TABLE user (name VARCHAR(200) NOT NULL, PRIMARY KEY(name)) - -The notnull constraint also acts as an application level validator. This means that if Doctrine validators are turned on, Doctrine will automatically check that specified columns do not contain null values when saved. - -If those columns happen to contain null values Doctrine_Validator_Exception is raised. diff --git a/manual/docs/Object relational mapping - Constraints and validators - Unique.php b/manual/docs/Object relational mapping - Constraints and validators - Unique.php deleted file mode 100644 index 7c2dad0b3..000000000 --- a/manual/docs/Object relational mapping - Constraints and validators - Unique.php +++ /dev/null @@ -1,32 +0,0 @@ -Unique constraints ensure that the data contained in a column or a group of columns is unique with respect to all the rows in the table. - -In general, a unique constraint is violated when there are two or more rows in the table where the values of all of the columns included in the constraint are equal. However, two null values are not considered equal in this comparison. That means even in the presence of a unique constraint it is possible to store duplicate rows that contain a null value in at least one of the constrained columns. This behavior conforms to the SQL standard, but some databases do not follow this rule. So be careful when developing applications that are intended to be portable. - -The following definition uses a unique constraint for column 'name'. - - -class User extends Doctrine_Record -{ - public function setTableDefinition() - { - $this->hasColumn('name', 'string', 200, array('unique' => true)); - } -} - - ->> Note: You should only use unique constraints for other than primary key columns. Primary key columns are always unique. - -The following definition adds a unique constraint for columns 'name' and 'age'. - - -class User extends Doctrine_Record -{ - public function setTableDefinition() - { - $this->hasColumn('name', 'string', 200); - $this->hasColumn('age', 'integer', 2); - - $this->unique(array('name', 'age')); - } -} - diff --git a/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Introduction.php b/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Introduction.php deleted file mode 100644 index 0ccc6e8cf..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Introduction.php +++ /dev/null @@ -1,4 +0,0 @@ -Not yet implemented - - - diff --git a/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Node support.php b/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Node support.php deleted file mode 100644 index e2ea433ab..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Node support.php +++ /dev/null @@ -1 +0,0 @@ -Partially supported, available methods \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Read me.php b/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Read me.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Setting up.php b/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Setting up.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Tree options.php b/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Tree options.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Tree support.php b/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Tree support.php deleted file mode 100644 index e2ea433ab..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Adjacency list - Tree support.php +++ /dev/null @@ -1 +0,0 @@ -Partially supported, available methods \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Examples.php b/manual/docs/Object relational mapping - Hierarchical data - Examples.php deleted file mode 100644 index edb9cb4b6..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Examples.php +++ /dev/null @@ -1,404 +0,0 @@ -This is an example to show how you would set up and use the doctrine tree interface with the NestedSet implementation (currently the most comprehensively supported by Doctrine) - - - - - -require_once("path/to/Doctrine.php"); - -function __autoload($classname) { - - return Doctrine::autoload($classname); - -} - -// define our tree -class Menu extends Doctrine_Record { - public function setTableDefinition() { - - $this->setTableName('menu'); - - // add this your table definition to set the table as NestedSet tree implementation - $this->actsAsTree('NestedSet'); - - // you do not need to add any columns specific to the nested set implementation - // these are added for you - $this->hasColumn("name","string",30); - - } - - // this __toString() function is used to get the name for the path, see node::getPath - public function __toString() { - return $this->get('name'); - } -} - -// set connections to database -$dsn = 'mysql:dbname=nestedset;host=localhost'; -$user = 'user'; -$password = 'pass'; - -try { - $dbh = new PDO($dsn, $user, $password); -} catch (PDOException $e) { - echo 'Connection failed: ' . $e->getMessage(); -} - -$manager = Doctrine_Manager::getInstance(); - -$conn = $manager->openConnection($dbh); - -// create root -$root = new Menu(); -$root->set('name', 'root'); - -$manager->getTable('Menu')->getTree()->createRoot($root); - -// build tree -$two = new Menu(); -$two->set('name', '2'); -$root->getNode()->addChild($two); - -$one = new Menu(); -$one->set('name', '1'); -$one->getNode()->insertAsPrevSiblingOf($two); - -// refresh as node's lft and rgt values have changed -$two->refresh(); - -$three = new Menu(); -$three->set('name', '3'); -$three->getNode()->insertAsNextSiblingOf($two); -$two->refresh(); - -$one_one = new Menu(); -$one_one->set('name', '1.1'); -$one_one->getNode()->insertAsFirstChildOf($one); -$one->refresh(); - -$one_two = new Menu(); -$one_two->set('name', '1.2'); -$one_two->getNode()->insertAsLastChildOf($one); -$one_two->refresh(); - -$one_two_one = new Menu(); -$one_two_one->set('name', '1.2.1'); -$one_two->getNode()->addChild($one_two_one); - -$root->refresh(); -$four = new Menu(); -$four->set('name', '4'); -$root->getNode()->addChild($four); - -$root->refresh(); -$five = new Menu(); -$five->set('name', '5'); -$root->getNode()->addChild($five); - -$root->refresh(); -$six = new Menu(); -$six->set('name', '6'); -$root->getNode()->addChild($six); - -output_message('initial tree'); -output_tree($root); - -$one_one->refresh(); -$six->set('name', '1.0 (was 6)'); -$six->getNode()->moveAsPrevSiblingOf($one_one); - -$one_two->refresh(); -$five->refresh(); -$five->set('name', '1.3 (was 5)'); -$five->getNode()->moveAsNextSiblingOf($one_two); - -$one_one->refresh(); -$four->refresh(); -$four->set('name', '1.1.1 (was 4)'); -$four->getNode()->moveAsFirstChildOf($one_one); - -$root->refresh(); -$one_two_one->refresh(); -$one_two_one->set('name', 'last (was 1.2.1)'); -$one_two_one->getNode()->moveAsLastChildOf($root); - -output_message('transformed tree'); -output_tree($root); - -$one_one->refresh(); -$one_one->deleteNode(); - -output_message('delete 1.1'); -output_tree($root); - -// now test fetching root -$tree_root = $manager->getTable('Menu')->getTree()->findRoot(); -output_message('testing fetch root and outputting tree from the root node'); -output_tree($tree_root); - -// now test fetching the tree -output_message('testing fetching entire tree using tree::fetchTree()'); -$tree = $manager->getTable('Menu')->getTree()->fetchTree(); -while($node = $tree->next()) -{ - output_node($node); -} - -// now test fetching the tree -output_message('testing fetching entire tree using tree::fetchTree(), excluding root node'); -$tree = $manager->getTable('Menu')->getTree()->fetchTree(array('include_record' => false)); -while($node = $tree->next()) -{ - output_node($node); -} - -// now test fetching the branch -output_message('testing fetching branch for 1, using tree::fetchBranch()'); -$one->refresh(); -$branch = $manager->getTable('Menu')->getTree()->fetchBranch($one->get('id')); -while($node = $branch->next()) -{ - output_node($node); -} - -// now test fetching the tree -output_message('testing fetching branch for 1, using tree::fetchBranch() excluding node 1'); -$tree = $manager->getTable('Menu')->getTree()->fetchBranch($one->get('id'), array('include_record' => false)); -while($node = $tree->next()) -{ - output_node($node); -} - -// now perform some tests -output_message('descendants for 1'); -$descendants = $one->getNode()->getDescendants(); -while($descendant = $descendants->next()) -{ - output_node($descendant); -} - -// move one and children under two -$two->refresh(); -$one->getNode()->moveAsFirstChildOf($two); - -output_message('moved one as first child of 2'); -output_tree($root); - -output_message('descendants for 2'); -$two->refresh(); -$descendants = $two->getNode()->getDescendants(); -while($descendant = $descendants->next()) -{ - output_node($descendant); -} - -output_message('number descendants for 2'); -echo $two->getNode()->getNumberDescendants() .'
    '; - -output_message('children for 2 (notice excludes children of children, known as descendants)'); -$children = $two->getNode()->getChildren(); -while($child = $children->next()) -{ - output_node($child); -} - -output_message('number children for 2'); -echo $two->getNode()->getNumberChildren() .'
    '; - -output_message('path to 1'); -$path = $one->getNode()->getPath(' > '); -echo $path .' -'; - -output_message('path to 1 (including 1)'); -$path = $one->getNode()->getPath(' > ', true); -echo $path .' -'; - -output_message('1 has parent'); -$hasParent = $one->getNode()->hasParent(); -$msg = $hasParent ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('parent to 1'); -$parent = $one->getNode()->getParent(); -if($parent->exists()) -{ - echo $parent->get('name') .' -'; -} - -output_message('root isRoot?'); -$isRoot = $root->getNode()->isRoot(); -$msg = $isRoot ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('one isRoot?'); -$isRoot = $one->getNode()->isRoot(); -$msg = $isRoot ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('root hasParent'); -$hasParent = $root->getNode()->hasParent(); -$msg = $hasParent ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('root getParent'); -$parent = $root->getNode()->getParent(); -if($parent->exists()) -{ - echo $parent->get('name') .' -'; -} - -output_message('get first child of root'); -$record = $root->getNode()->getFirstChild(); -if($record->exists()) -{ - echo $record->get('name') .' -'; -} - -output_message('get last child of root'); -$record = $root->getNode()->getLastChild(); -if($record->exists()) -{ - echo $record->get('name') .' -'; -} - -$one_two->refresh(); - -output_message('get prev sibling of 1.2'); -$record = $one_two->getNode()->getPrevSibling(); -if($record->exists()) -{ - echo $record->get('name') .' -'; -} - -output_message('get next sibling of 1.2'); -$record = $one_two->getNode()->getNextSibling(); -if($record->exists()) -{ - echo $record->get('name') .' -'; -} - -output_message('siblings of 1.2'); -$siblings = $one_two->getNode()->getSiblings(); -foreach($siblings as $sibling) -{ - if($sibling->exists()) - echo $sibling->get('name') .' -'; -} - -output_message('siblings of 1.2 (including 1.2)'); -$siblings = $one_two->getNode()->getSiblings(true); -foreach($siblings as $sibling) -{ - if($sibling->exists()) - echo $sibling->get('name') .' -'; -} - -$new = new Menu(); -$new->set('name', 'parent of 1.2'); -$new->getNode()->insertAsParentOf($one_two); - -output_message('added a parent to 1.2'); -output_tree($root); - -try { - $dummy = new Menu(); - $dummy->set('name', 'dummy'); - $dummy->save(); -} -catch (Doctrine_Exception $e) -{ - output_message('You cannot save a node unless it is in the tree'); -} - -try { - $fake = new Menu(); - $fake->set('name', 'dummy'); - $fake->set('lft', 200); - $fake->set('rgt', 1); - $fake->save(); -} -catch (Doctrine_Exception $e) -{ - output_message('You cannot save a node with bad lft and rgt values'); -} - -// check last remaining tests -output_message('New parent is descendant of 1'); -$one->refresh(); -$res = $new->getNode()->isDescendantOf($one); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('New parent is descendant of 2'); -$two->refresh(); -$res = $new->getNode()->isDescendantOf($two); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('New parent is descendant of 1.2'); -$one_two->refresh(); -$res = $new->getNode()->isDescendantOf($one_two); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('New parent is descendant of or equal to 1'); -$one->refresh(); -$res = $new->getNode()->isDescendantOfOrEqualTo($one); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('New parent is descendant of or equal to 1.2'); -$one_two->refresh(); -$res = $new->getNode()->isDescendantOfOrEqualTo($one_two); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -output_message('New parent is descendant of or equal to 1.3'); -$five->refresh(); -$res = $new->getNode()->isDescendantOfOrEqualTo($new); -$msg = $res ? 'true' : 'false'; -echo $msg . '
    '; - -function output_tree($root) -{ - // display tree - // first we must refresh the node as the tree has been transformed - $root->refresh(); - - // next we must get the iterator to traverse the tree from the root node - $traverse = $root->getNode()->traverse(); - - output_node($root); - // now we traverse the tree and output the menu items - while($item = $traverse->next()) - { - output_node($item); - } - - unset($traverse); -} - -function output_node($record) -{ - echo str_repeat('-', $record->getNode()->getLevel()) . $record->get('name') - . ' (has children:'.$record->getNode()->hasChildren().') ' - . ' (is leaf:'.$record->getNode()->isLeaf().') '.'
    '; -} - -function output_message($msg) -{ - echo " -**//$msg//**".' -'; -} -
    \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Introduction - About.php b/manual/docs/Object relational mapping - Hierarchical data - Introduction - About.php deleted file mode 100644 index de76901b3..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Introduction - About.php +++ /dev/null @@ -1,27 +0,0 @@ - - -Most users at one time or another have dealt with hierarchical data in a SQL database and no doubt learned that the management of hierarchical data is not what a relational database is intended for. The tables of a relational database are not hierarchical (like XML), but are simply a flat list. Hierarchical data has a parent-child relationship that is not naturally represented in a relational database table. - - - -For our purposes, hierarchical data is a collection of data where each item has a single parent and zero or more children (with the exception of the root item, which has no parent). Hierarchical data can be found in a variety of database applications, including forum and mailing list threads, business organization charts, content management categories, and product categories. - - - -In a hierarchical data model, data is organized into a tree-like structure. The tree structure allows repeating information using parent/child relationships. For an explanation of the tree data structure, see here [http://en.wikipedia.org/wiki/Tree_data_structure" >http://en.wikipedia.org/wiki/Tree_data_structure] - - - -There are three major approaches to managing tree structures in relational databases, these are: - - - * the adjacency list model - * the nested set model (otherwise known as the modified pre-order tree traversal algorithm) - * materialized path model - - - - -These are explained in more detail in the following chapters, or see - -[http://www.dbazine.com/oracle/or-articles/tropashko4 http://www.dbazine.com/oracle/or-articles/tropashko4], [http://dev.mysql.com/tech-resources/articles/hierarchical-data.html http://dev.mysql.com/tech-resources/articles/hierarchical-data.html] \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Introduction - Node interface.php b/manual/docs/Object relational mapping - Hierarchical data - Introduction - Node interface.php deleted file mode 100644 index 16426c1f7..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Introduction - Node interface.php +++ /dev/null @@ -1,98 +0,0 @@ - - -The node interface, for inserting and manipulating nodes within the tree, is accessed on a record level. A full implementation of this interface will be as follows: - - - - -interface Doctrine_Node_Interface { - - /** - * insert node into tree - */ - public function insertAsParentOf(Doctrine_Record $dest); - - public function insertAsPrevSiblingOf(Doctrine_Record $dest); - - public function insertAsNextSiblingOf(Doctrine_Record $dest); - - public function insertAsFirstChildOf(Doctrine_Record $dest); - - public function insertAsLastChildOf(Doctrine_Record $dest); - - public function addChild(Doctrine_Record $record); - - /** - * moves node (if has children, moves branch) - * - */ - public function moveAsPrevSiblingOf(Doctrine_Record $dest); - - public function moveAsNextSiblingOf(Doctrine_Record $dest); - - public function moveAsFirstChildOf(Doctrine_Record $dest); - - public function moveAsLastChildOf(Doctrine_Record $dest); - - /** - * node information - */ - public function getPrevSibling(); - - public function getNextSibling(); - - public function getSiblings($includeNode = false); - - public function getFirstChild(); - - public function getLastChild(); - - public function getChildren(); - - public function getDescendants(); - - public function getParent(); - - public function getAncestors(); - - public function getPath($seperator = ' > ', $includeNode = false); - - public function getLevel(); - - public function getNumberChildren(); - - public function getNumberDescendants(); - - /** - * node checks - */ - public function hasPrevSibling(); - - public function hasNextSibling(); - - public function hasChildren(); - - public function hasParent(); - - public function isLeaf(); - - public function isRoot(); - - public function isEqualTo(Doctrine_Record $subj); - - public function isDescendantOf(Doctrine_Record $subj); - - public function isDescendantOfOrEqualTo(Doctrine_Record $subj); - - public function isValidNode(); - - /** - * deletes node and it's descendants - */ - public function delete(); -} - -// if your model acts as tree you can retrieve the associated node object as follows -$record = $manager->getTable('Model')->find($pk); -$nodeObj = $record->getNode(); - \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Introduction - Read me.php b/manual/docs/Object relational mapping - Hierarchical data - Introduction - Read me.php deleted file mode 100644 index 363f56157..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Introduction - Read me.php +++ /dev/null @@ -1,19 +0,0 @@ - - -If performing batch tree manipulation tasks, then remember to refresh your records (see record::refresh()), as any transformations of the tree are likely to affect all instances of records that you have in your scope. - - - -You can save an already existing node using record::save() without affecting it's position within the tree. Remember to never set the tree specific record attributes manually. - - - -If you are inserting or moving a node within the tree, you must use the appropriate node method. Note: you do not need to save a record once you have inserted it or moved it within the tree, any other changes to your record will also be saved within these operations. You cannot save a new record without inserting it into the tree. - - - -If you wish to delete a record, you MUST delete the node and not the record, using $record->deleteNode() or $record->getNode()->delete(). Deleting a node, will by default delete all its descendants. if you delete a record without using the node::delete() method you tree is likely to become corrupt (and fall down)! - - - -The difference between descendants and children is that descendants include children of children whereas children are direct descendants of their parent (real children not gran children and great gran children etc etc). \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Introduction - Setting up.php b/manual/docs/Object relational mapping - Hierarchical data - Introduction - Setting up.php deleted file mode 100644 index 10df55837..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Introduction - Setting up.php +++ /dev/null @@ -1,37 +0,0 @@ - - -Managing tree structures in doctrine is easy. Doctrine currently fully supports Nested Set, and plans to support the other implementations soon. To set your model to act as a tree, simply add the code below to your models table definition. - - - -Now that Doctrine knows that this model acts as a tree, it will automatically add any required columns for your chosen implementation, so you do not need to set any tree specific columns within your table definition. - - - -Doctrine has standard interface's for managing tree's, that are used by all the implementations. Every record in the table represents a node within the tree (the table), so doctrine provides two interfaces, Tree and Node. - - - - -class Menu extends Doctrine_Record { - public function setTableDefinition() { - - $this->setTableName('menu'); - - // add this your table definition to set the table as NestedSet tree implementation - // $implName is 'NestedSet' or 'AdjacencyList' or 'MaterializedPath' - // $options is an assoc array of options, see implementation docs for options - $this->option('treeImpl', $implName); - $this->option('treeOptions', $options); - - // you do not need to add any columns specific to the nested set implementation, these are added for you - $this->hasColumn("name","string",30); - - } - - // this __toString() function is used to get the name for the path, see node::getPath() - public function __toString() { - return $this->get('name'); - } -} - \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Introduction - Traversing or Walking Trees.php b/manual/docs/Object relational mapping - Hierarchical data - Introduction - Traversing or Walking Trees.php deleted file mode 100644 index b7d808e71..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Introduction - Traversing or Walking Trees.php +++ /dev/null @@ -1,52 +0,0 @@ - - -You can traverse a Tree in different ways, please see here for more information [http://en.wikipedia.org/wiki/Tree_traversal http://en.wikipedia.org/wiki/Tree_traversal]. - - - -The most common way of traversing a tree is Pre Order Traversal as explained in the link above, this is also what is known as walking the tree, this is the default approach when traversing a tree in Doctrine, however Doctrine does plan to provide support for Post and Level Order Traversal (not currently implemented) - - - - -/* - * traverse the entire tree from root - */ -$root = $manager->getTable('Model')->getTree()->fetchRoot(); -if($root->exists()) -{ - $tree = $root->traverse(); - while($node = $tree->next()) - { - // output your tree here - } -} - -// or the optimised approach using tree::fetchTree -$tree = $manager->getTable('Model')->getTree()->fetchTree(); -while($node = $tree->next()) -{ - // output tree here -} - -/* - * traverse a branch of the tree - */ -$record = $manager->getTable('Model')->find($pk); -if($record->exists()) -{ - $branch = $record->traverse(); - while($node = $branch->next()) - { - // output your tree here - } -} - -// or the optimised approach -$branch = $manager->getTable('Model')->getTree()->fetchBranch($pk); -while($node = $branch->traverse()) -{ - // output your tree here -} - - \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Introduction - Tree interface.php b/manual/docs/Object relational mapping - Hierarchical data - Introduction - Tree interface.php deleted file mode 100644 index 8638848f8..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Introduction - Tree interface.php +++ /dev/null @@ -1,35 +0,0 @@ - - -The tree interface, for creating and accessing the tree, is accessed on a table level. A full implementation of this interface would be as follows: - - - - - -interface Doctrine_Tree_Interface { - - /** - * creates root node from given record or from a new record - */ - public function createRoot(Doctrine_Record $record = null); - - /** - * returns root node - */ - public function findRoot($root_id = 1); - - /** - * optimised method to returns iterator for traversal of the entire tree from root - */ - public function fetchTree($options = array()); - - /** - * optimised method that returns iterator for traversal of the tree from the given record's primary key - */ - public function fetchBranch($pk, $options = array()); -} - -// if your model acts as tree you can retrieve the associated tree object as follows -$treeObj = $manager->getTable('Model')->getTree(); - - \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Introduction.php b/manual/docs/Object relational mapping - Hierarchical data - Introduction.php deleted file mode 100644 index fd40910d9..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Introduction.php +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/manual/docs/Object relational mapping - Hierarchical data - Materialized path - Introduction.php b/manual/docs/Object relational mapping - Hierarchical data - Materialized path - Introduction.php deleted file mode 100644 index 0ccc6e8cf..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Materialized path - Introduction.php +++ /dev/null @@ -1,4 +0,0 @@ -Not yet implemented - - - diff --git a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Introduction.php b/manual/docs/Object relational mapping - Hierarchical data - Nested set - Introduction.php deleted file mode 100644 index 187e3fc71..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Introduction.php +++ /dev/null @@ -1,14 +0,0 @@ - - -Basically Nested Set is optimized for traversing trees, as this can be done with minimal queries, however updating the tree can be costly as it will affect all rows within the table. - - - -For more information, read here: - -[http://www.sitepoint.com/article/hierarchical-data-database/2 http://www.sitepoint.com/article/hierarchical-data-database/2], -[http://dev.mysql.com/tech-resources/articles/hierarchical-data.html http://dev.mysql.com/tech-resources/articles/hierarchical-data.html] - - - - diff --git a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Node support.php b/manual/docs/Object relational mapping - Hierarchical data - Nested set - Node support.php deleted file mode 100644 index 24aec3f2c..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Node support.php +++ /dev/null @@ -1 +0,0 @@ -The nested set implementation fully supports the full Doctrine node interface \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Read me.php b/manual/docs/Object relational mapping - Hierarchical data - Nested set - Read me.php deleted file mode 100644 index a8b66b346..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Read me.php +++ /dev/null @@ -1,8 +0,0 @@ - - -The most effective way to traverse a tree from the root node, is to use the tree::fetchTree() method. -It will by default include the root node in the tree and will return an iterator to traverse the tree. - - - -To traverse a tree from a given node, it will normally cost 3 queries, one to fetch the starting node, one to fetch the branch from this node, and one to determine the level of the start node, the traversal algorithm with then determine the level of each subsequent node for you. \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Setting up.php b/manual/docs/Object relational mapping - Hierarchical data - Nested set - Setting up.php deleted file mode 100644 index 5f8dc320c..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Setting up.php +++ /dev/null @@ -1,27 +0,0 @@ - - -To set up your model as Nested Set, you must add the following code to your model's table definition. - - - - -class Menu extends Doctrine_Record { - public function setTableDefinition() { - - $this->setTableName('menu'); - - // add this your table definition to set the table as NestedSet tree implementation - $this->option('treeImpl', 'NestedSet'); - $this->option('treeOptions', array()); - - // you do not need to add any columns specific to the nested set implementation, these are added for you - $this->hasColumn("name","string",30); - - } - - // this __toString() function is used to get the name for the path, see node::getPath() - public function __toString() { - return $this->get('name'); - } -} - \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Tree options.php b/manual/docs/Object relational mapping - Hierarchical data - Nested set - Tree options.php deleted file mode 100644 index 8c870f12c..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Tree options.php +++ /dev/null @@ -1,36 +0,0 @@ - - -The nested implementation can be configured to allow your table to have multiple root nodes, and therefore multiple trees within the same table. - - - -The example below shows how to setup and use multiple roots based upon the set up above: - - - - -//use these options in the setTableDefinition -$options = array('hasManyRoots' => true, // enable many roots - 'rootColumnName' => 'root_id'); // set root column name, defaults to 'root_id' - -// To create new root nodes, if you have manually set the root_id, then it will be used -// otherwise it will automatically use the next available root id -$root = new Menu(); -$root->set('name', 'root'); - -// insert first root, will auto be assigned root_id = 1 -$manager->getTable('Menu')->getTree()->createRoot($root); - -$another_root = new Menu(); -$another_root->set('name', 'another root'); - -// insert another root, will auto be assigned root_id = 2 -$manager->getTable('Menu')->getTree()->createRoot($another_root); - -// fetching a specifc root -$root = $manager->getTable('Menu')->getTree()->fetchRoot(1); -$another_root = $manager->getTable('Menu')->getTree()->fetchRoot(2); - -// fetching all roots -$roots = $manager->getTable('Menu')->getTree()->fetchRoots(); - diff --git a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Tree support.php b/manual/docs/Object relational mapping - Hierarchical data - Nested set - Tree support.php deleted file mode 100644 index 1a8a56c24..000000000 --- a/manual/docs/Object relational mapping - Hierarchical data - Nested set - Tree support.php +++ /dev/null @@ -1 +0,0 @@ -The nested set implementation fully supports the full Doctrine tree interface \ No newline at end of file diff --git a/manual/docs/Object relational mapping - Indexes - Adding indexes.php b/manual/docs/Object relational mapping - Indexes - Adding indexes.php deleted file mode 100644 index ca619fbc5..000000000 --- a/manual/docs/Object relational mapping - Indexes - Adding indexes.php +++ /dev/null @@ -1,61 +0,0 @@ - -You can add indexes by simple calling Doctrine_Record::index('indexName', $definition) where $definition is the -definition array. - - - -An example of adding a simple index to field called 'name': - - - - -class IndexTest extends Doctrine_Record -{ - public function setTableDefinition() - { - \$this->hasColumn('name', 'string'); - - \$this->index('myindex', array('fields' => 'name'); - } -} -?> - - - -An example of adding a multi-column index to field called 'name': - - - - -class MultiColumnIndexTest extends Doctrine_Record -{ - public function setTableDefinition() - { - \$this->hasColumn('name', 'string'); - \$this->hasColumn('code', 'string'); - - \$this->index('myindex', array('fields' => array('name', 'code'))); - } -} -?> - - - -An example of adding a multiple indexes on same table: - - - - -class MultipleIndexTest extends Doctrine_Record -{ - public function setTableDefinition() - { - \$this->hasColumn('name', 'string'); - \$this->hasColumn('code', 'string'); - \$this->hasColumn('age', 'integer'); - - \$this->index('myindex', array('fields' => array('name', 'code'))); - \$this->index('ageindex', array('fields' => array('age')); - } -} -?> diff --git a/manual/docs/Object relational mapping - Indexes - Index options.php b/manual/docs/Object relational mapping - Indexes - Index options.php deleted file mode 100644 index dc5e1a6f6..000000000 --- a/manual/docs/Object relational mapping - Indexes - Index options.php +++ /dev/null @@ -1,38 +0,0 @@ - -Doctrine offers many index options, some of them being db-specific. Here is a full list of availible options: - - -sorting => string('ASC' / 'DESC') - what kind of sorting does the index use (ascending / descending) - -length => integer - index length (only some drivers support this) - -primary => boolean(true / false) - whether or not the index is primary index - -type => string('unique', -- supported by most drivers - 'fulltext', -- only availible on Mysql driver - 'gist', -- only availible on Pgsql driver - 'gin') -- only availible on Pgsql driver - - -class MultipleIndexTest extends Doctrine_Record -{ - public function setTableDefinition() - { - \$this->hasColumn('name', 'string'); - \$this->hasColumn('code', 'string'); - \$this->hasColumn('age', 'integer'); - - \$this->index('myindex', array( - 'fields' => array( - 'name' => - array('sorting' => 'ASC', - 'length' => 10), - 'code'), - 'type' => 'unique', - )); - } -} -?> diff --git a/manual/docs/Object relational mapping - Indexes - Introduction.php b/manual/docs/Object relational mapping - Indexes - Introduction.php deleted file mode 100644 index b2fca0275..000000000 --- a/manual/docs/Object relational mapping - Indexes - Introduction.php +++ /dev/null @@ -1,13 +0,0 @@ -Indexes are used to find rows with specific column values quickly. -Without an index, the database must begin with the first row and then read through the entire table to find the relevant rows. - - - -The larger the table, the more this consumes time. If the table has an index for the columns in question, the database -can quickly determine the position to seek to in the middle of the data file without having to look at all the data. -If a table has 1,000 rows, this is at least 100 times faster than reading rows one-by-one. - - - -Indexes come with a cost as they slow down the inserts and updates. However, in general you -should ***always*** use indexes for the fields that are used in sql where conditions. diff --git a/manual/docs/Object relational mapping - Indexes - Special indexes.php b/manual/docs/Object relational mapping - Indexes - Special indexes.php deleted file mode 100644 index 9812cd638..000000000 --- a/manual/docs/Object relational mapping - Indexes - Special indexes.php +++ /dev/null @@ -1,20 +0,0 @@ - -Doctrine supports many special indexes. These include Mysql FULLTEXT and Pgsql GiST indexes. -In the following example we define a Mysql FULLTEXT index for the field 'content'. - - - -hasColumn('name', 'string'); - \$this->hasColumn('content', 'string'); - - \$this->index('content', array('fields' => 'content', - 'type' => 'fulltext')); - } -} -?>"); diff --git a/manual/docs/Object relational mapping - Introduction.php b/manual/docs/Object relational mapping - Introduction.php deleted file mode 100644 index 863f719c1..000000000 --- a/manual/docs/Object relational mapping - Introduction.php +++ /dev/null @@ -1,41 +0,0 @@ -Doctrine_Record::hasColumn() takes 4 arguments: - -# **column name** -# **column type** -# **column length** -# **column constraints and validators** - - -class Email extends Doctrine_Record { - public function setTableDefinition() { - // setting custom table name: - $this->setTableName('emails'); - - $this->hasColumn('address', // name of the column - 'string', // column type - '200', // column length - array('notblank' => true, - 'email' => true // validators / constraints - ) - ); - - - $this->hasColumn('address2', // name of the column - 'string', // column type - '200', // column length - // validators / constraints without arguments can be - // specified also as as string with | separator - 'notblank|email' - ); - - // Doctrine even supports the following format for - // validators / constraints which have no arguments: - - $this->hasColumn('address3', // name of the column - 'string', // column type - '200', // column length - array('notblank', 'email') - ); - } -} - diff --git a/manual/docs/Object relational mapping - Record identifiers - Autoincremented.php b/manual/docs/Object relational mapping - Record identifiers - Autoincremented.php deleted file mode 100644 index e2eba833b..000000000 --- a/manual/docs/Object relational mapping - Record identifiers - Autoincremented.php +++ /dev/null @@ -1,11 +0,0 @@ -Autoincrement primary key is the most basic identifier and its usage is strongly encouraged. Sometimes you may want to use some other name than 'id' -for your autoinc primary key. It can be specified as follows: - - -class User extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('uid','integer',20,'primary|autoincrement'); - - } -} - diff --git a/manual/docs/Object relational mapping - Record identifiers - Composite.php b/manual/docs/Object relational mapping - Record identifiers - Composite.php deleted file mode 100644 index f401944f3..000000000 --- a/manual/docs/Object relational mapping - Record identifiers - Composite.php +++ /dev/null @@ -1,15 +0,0 @@ -Composite primary key can be used efficiently in association tables (tables that connect two components together). It is not recommended -to use composite primary keys in anywhere else as Doctrine does not support mapping relations on multiple columns. - - - -Due to this fact your doctrine-based system will scale better if it has autoincremented primary key even for association tables. - - -class Groupuser extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('user_id', 'integer', 20, 'primary'); - $this->hasColumn('group_id', 'integer', 20, 'primary'); - } -} - diff --git a/manual/docs/Object relational mapping - Record identifiers - Introduction.php b/manual/docs/Object relational mapping - Record identifiers - Introduction.php deleted file mode 100644 index 7446de7ee..000000000 --- a/manual/docs/Object relational mapping - Record identifiers - Introduction.php +++ /dev/null @@ -1,5 +0,0 @@ -Doctrine supports many kind of identifiers. For most cases it is recommended not to -specify any primary keys (Doctrine will then use field name 'id' as an autoincremented -primary key). When using table creation Doctrine is smart enough to emulate the -autoincrementation with sequences and triggers on databases that doesn't support it natively. - diff --git a/manual/docs/Object relational mapping - Record identifiers - Natural.php b/manual/docs/Object relational mapping - Record identifiers - Natural.php deleted file mode 100644 index 661cd4783..000000000 --- a/manual/docs/Object relational mapping - Record identifiers - Natural.php +++ /dev/null @@ -1,10 +0,0 @@ -Natural identifier is a property or combination of properties that is unique and non-null. The use of natural identifiers -is discouraged. You should consider using autoincremented or sequential primary keys as they make your system more scalable. - - -class User extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('name','string',200,'primary'); - } -} - diff --git a/manual/docs/Object relational mapping - Record identifiers - Sequence.php b/manual/docs/Object relational mapping - Record identifiers - Sequence.php deleted file mode 100644 index 6b4c8f8a6..000000000 --- a/manual/docs/Object relational mapping - Record identifiers - Sequence.php +++ /dev/null @@ -1,81 +0,0 @@ - -Doctrine supports sequences for generating record identifiers. Sequences are a way of offering unique IDs for data rows. If you do most of your work with e.g. MySQL, think of sequences as another way of doing AUTO_INCREMENT. - - - -Doctrine knows how to do sequence generation in the background so you don't have to worry about calling database specific queries - Doctrine does it for you, all you need to do -is define a column as a sequence column and optionally provide the name of the sequence table and the id column name of the sequence table. - - - -Consider the following record definition: - - - - -class Book extends Doctrine_Record { - public function setTableDefinition() - { - \$this->hasColumn('id', 'integer', null, array('primary', 'sequence')); - \$this->hasColumn('name', 'string'); - } -} -?> - - - -By default Doctrine uses the following format for sequence tables [tablename]_seq. If you wish to change this you can use the following -piece of code to change the formatting: - - - - -\$manager = Doctrine_Manager::getInstance(); -\$manager->setAttribute(Doctrine::ATTR_SEQNAME_FORMAT, -'%s_my_seq'); -?> - - - -Doctrine uses column named id as the sequence generator column of the sequence table. If you wish to change this globally (for all connections and all tables) -you can use the following code: - - - - -\$manager = Doctrine_Manager::getInstance(); -\$manager->setAttribute(Doctrine::ATTR_SEQCOL_NAME, -'my_seq_column'); -?> - - - -In the following example we do not wish to change global configuration we just want to make the id column to use sequence table called -book_sequence. It can be done as follows: - - - -class Book extends Doctrine_Record { - public function setTableDefinition() - { - \$this->hasColumn('id', 'integer', null, array('primary', 'sequence' => 'book_sequence')); - \$this->hasColumn('name', 'string'); - } -} -?> - - - -Here we take the preceding example a little further: we want to have a custom sequence column. Here it goes: - - - -class Book extends Doctrine_Record { - public function setTableDefinition() - { - \$this->hasColumn('id', 'integer', null, array('primary', 'sequence' => array('book_sequence', 'sequence'))); - \$this->hasColumn('name', 'string'); - } -} -?> - diff --git a/manual/docs/Object relational mapping - Record identifiers - Sequential.php b/manual/docs/Object relational mapping - Record identifiers - Sequential.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Object relational mapping - Record identifiers - Sequential.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Object relational mapping - Relations - Composites and aggregates.php b/manual/docs/Object relational mapping - Relations - Composites and aggregates.php deleted file mode 100644 index bdf774f06..000000000 --- a/manual/docs/Object relational mapping - Relations - Composites and aggregates.php +++ /dev/null @@ -1,14 +0,0 @@ -Doctrine supports aggregates and composites. When binding composites you can use methods Doctrine_Record::ownsOne() and Doctrine_Record::ownsMany(). When binding -aggregates you can use methods Doctrine_Record::hasOne() and Doctrine_Record::hasMany(). Basically using the owns* methods is like adding a database level ON CASCADE DELETE -constraint on related component with an exception that doctrine handles the deletion in application level. - - - -In Doctrine if you bind an Email to a User using ownsOne or ownsMany methods, everytime User record calls delete the associated -Email record is also deleted. - - - -Then again if you bind an Email to a User using hasOne or hasMany methods, everytime User record calls delete the associated -Email record is NOT deleted. - diff --git a/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-Many, Many-to-One.php b/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-Many, Many-to-One.php deleted file mode 100644 index 0f85f8b99..000000000 --- a/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-Many, Many-to-One.php +++ /dev/null @@ -1,19 +0,0 @@ - - -class User extends Doctrine_Record { - public function setUp() { - $this->ownsMany('Phonenumber','Phonenumber.user_id'); - } - public function setTableDefinition() { - $this->hasColumn('name','string',50); - $this->hasColumn('loginname','string',20); - $this->hasColumn('password','string',16); - } -} -class Phonenumber extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('phonenumber','string',50); - $this->hasColumn('user_id','integer'); - } -} - diff --git a/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-One.php b/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-One.php deleted file mode 100644 index 35614e4bb..000000000 --- a/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-One.php +++ /dev/null @@ -1,38 +0,0 @@ -Binding One-To-One foreign key associations is done with Doctrine_Record::ownsOne() and Doctrine_Record::hasOne() methods. -In the following example user owns one email and has one address. So the relationship between user and email is one-to-one composite. -The relationship between user and address is one-to-one aggregate. - - - -The Email component here is mapped to User component's column email_id hence their relation is called LOCALKEY relation. -On the other hand the Address component is mapped to User by it's user_id column hence the relation between User and Address is called -FOREIGNKEY relation. - - -class User extends Doctrine_Record { - public function setUp() { - $this->hasOne('Address','Address.user_id'); - $this->ownsOne('Email','User.email_id'); - $this->ownsMany('Phonenumber','Phonenumber.user_id'); - } - public function setTableDefinition() { - $this->hasColumn('name','string',50); - $this->hasColumn('loginname','string',20); - $this->hasColumn('password','string',16); - - // foreign key column for email ID - $this->hasColumn('email_id','integer'); - } -} -class Email extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('address','string',150); - } -} -class Address extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('street','string',50); - $this->hasColumn('user_id','integer'); - } -} - diff --git a/manual/docs/Object relational mapping - Relations - Foreign key associations - Tree structure.php b/manual/docs/Object relational mapping - Relations - Foreign key associations - Tree structure.php deleted file mode 100644 index eafa8ee36..000000000 --- a/manual/docs/Object relational mapping - Relations - Foreign key associations - Tree structure.php +++ /dev/null @@ -1,13 +0,0 @@ - - -class Task extends Doctrine_Record { - public function setUp() { - $this->hasOne('Task as Parent','Task.parent_id'); - $this->hasMany('Task as Subtask','Subtask.parent_id'); - } - public function setTableDefinition() { - $this->hasColumn('name','string',100); - $this->hasColumn('parent_id','integer'); - } -} - diff --git a/manual/docs/Object relational mapping - Relations - Foreign key constraints - Constraint actions.php b/manual/docs/Object relational mapping - Relations - Foreign key constraints - Constraint actions.php deleted file mode 100644 index 48314a010..000000000 --- a/manual/docs/Object relational mapping - Relations - Foreign key constraints - Constraint actions.php +++ /dev/null @@ -1,39 +0,0 @@ -//CASCADE//: -Delete or update the row from the parent table and automatically delete or update the matching rows in the child table. Both ON DELETE CASCADE and ON UPDATE CASCADE are supported. Between two tables, you should not define several ON UPDATE CASCADE clauses that act on the same column in the parent table or in the child table. - -//SET NULL// : -Delete or update the row from the parent table and set the foreign key column or columns in the child table to NULL. This is valid only if the foreign key columns do not have the NOT NULL qualifier specified. Both ON DELETE SET NULL and ON UPDATE SET NULL clauses are supported. - -//NO ACTION// : -In standard SQL, NO ACTION means no action in the sense that an attempt to delete or update a primary key value is not allowed to proceed if there is a related foreign key value in the referenced table. - -//RESTRICT// : -Rejects the delete or update operation for the parent table. NO ACTION and RESTRICT are the same as omitting the ON DELETE or ON UPDATE clause. - -//SET DEFAULT// : - -In the following example we define two classes, User and Phonenumber with their relation being one-to-many. We also add a foreign key constraint with onDelete cascade action. - - -class User extends Doctrine_Record -{ - public function setUp() - { - $this->hasMany('Phonenumber', 'Phonenumber.user_id', array('onDelete' => 'cascade')); - } - public function setTableDefinition() - { - $this->hasColumn('name', 'string', 50); - $this->hasColumn('loginname', 'string', 20); - $this->hasColumn('password', 'string', 16); - } -} -class Phonenumber extends Doctrine_Record -{ - public function setTableDefinition() - { - $this->hasColumn('phonenumber', 'string', 50); - $this->hasColumn('user_id', 'integer'); - } -} - diff --git a/manual/docs/Object relational mapping - Relations - Foreign key constraints - Introduction.php b/manual/docs/Object relational mapping - Relations - Foreign key constraints - Introduction.php deleted file mode 100644 index f518eec91..000000000 --- a/manual/docs/Object relational mapping - Relations - Foreign key constraints - Introduction.php +++ /dev/null @@ -1,50 +0,0 @@ -A foreign key constraint specifies that the values in a column (or a group of columns) must match the values appearing in some row of another table. In other words foreign key constraints maintain the referential integrity between two related tables. - -Say you have the product table with the following definition: - - -class Product extends Doctrine_Record -{ - public function setTableDefinition() - { - $this->hasColumn('id', 'integer', null, 'primary'); - $this->hasColumn('name', 'string'); - $this->hasColumn('price', 'decimal', 18); - } -} - - -Let's also assume you have a table storing orders of those products. We want to ensure that the order table only contains orders of products that actually exist. So we define a foreign key constraint in the orders table that references the products table: - - -class Order extends Doctrine_Record -{ - public function setTableDefinition() - { - $this->hasColumn('order_id', 'integer', null, 'primary'); - $this->hasColumn('product_id', 'integer'); - $this->hasColumn('quantity', 'integer'); - } - public function setUp() - { - $this->hasOne('Product', 'Order.product_id'); - - // foreign key columns should *always* have indexes - - $this->index('product_id', array('fields' => 'product_id')); - } -} - - -When exported the class 'Order' would execute the following sql: - -CREATE TABLE orders ( - order_id integer PRIMARY KEY, - product_id integer REFERENCES products (id), - quantity integer, - INDEX product_id_idx (product_id) -) - -Now it is impossible to create orders with product_no entries that do not appear in the products table. - -We say that in this situation the orders table is the referencing table and the products table is the referenced table. Similarly, there are referencing and referenced columns. diff --git a/manual/docs/Object relational mapping - Relations - Inheritance - Column aggregation.php b/manual/docs/Object relational mapping - Relations - Inheritance - Column aggregation.php deleted file mode 100644 index 0dd039512..000000000 --- a/manual/docs/Object relational mapping - Relations - Inheritance - Column aggregation.php +++ /dev/null @@ -1,86 +0,0 @@ -In the following example we have one database table called 'entity'. Users and groups are both entities and they share the same database table. - -The entity table has a column called 'type' which tells whether an entity is a group or a user. Then we decide that users are type 1 and groups type 2. - -The only thing we have to do is to create 3 records (the same as before) and add call the Doctrine_Table::setInheritanceMap() method inside the setUp() method. - - -class Entity extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('name','string',30); - $this->hasColumn('username','string',20); - $this->hasColumn('password','string',16); - $this->hasColumn('created','integer',11); - - // this column is used for column - // aggregation inheritance - $this->hasColumn('type', 'integer', 11); - } -} - -class User extends Entity { - public function setUp() { - $this->setInheritanceMap(array('type'=>1)); - } -} - -class Group extends Entity { - public function setUp() { - $this->setInheritanceMap(array('type'=>2)); - } -} - - -If we want to be able to fetch a record from the Entity table and automatically get a User record if the Entity we fetched is a user we have to do set the subclasses option in the parent class. The adjusted example: - - -class Entity extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('name','string',30); - $this->hasColumn('username','string',20); - $this->hasColumn('password','string',16); - $this->hasColumn('created','integer',11); - - // this column is used for column - // aggregation inheritance - $this->hasColumn('type', 'integer', 11); - $this->option('subclasses', array('User', 'Group')); - } -} - -class User extends Entity { - public function setUp() { - $this->setInheritanceMap(array('type'=>1)); - } -} - -class Group extends Entity { - public function setUp() { - $this->setInheritanceMap(array('type'=>2)); - } -} - - -We can then do the following given the previous table mapping. - - -$user = new User(); -$user->name='Bjarte S. Karlsen'; -$user->username='meus'; -$user->password='rat'; -$user->save(); - -$group = new Group(); -$group->name='Users'; -$group->username='users'; -$group->password='password'; -$group->save(); - -$q = new Doctrine_Query(); -$user = $q->from('Entity')->where('id=?')->execute(array($user->id))->getFirst(); - -$q = new Doctrine_Query(); -$group = $q->from('Entity')->where('id=?')->execute(array($group->id))->getFirst(); - - -The user object is here an instance of User while the group object is an instance of Group. diff --git a/manual/docs/Object relational mapping - Relations - Inheritance - One table many classes.php b/manual/docs/Object relational mapping - Relations - Inheritance - One table many classes.php deleted file mode 100644 index f4aa1be95..000000000 --- a/manual/docs/Object relational mapping - Relations - Inheritance - One table many classes.php +++ /dev/null @@ -1,24 +0,0 @@ -When it comes to handling inheritance Doctrine is very smart. -In the following example we have one database table called 'entity'. -Users and groups are both entities and they share the same database table. -The only thing we have to make is 3 records (Entity, Group and User). - - - -Doctrine is smart enough to know that the inheritance type here is one-table-many-classes. - - - -class Entity extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('name','string',30); - $this->hasColumn('username','string',20); - $this->hasColumn('password','string',16); - $this->hasColumn('created','integer',11); - } -} - -class User extends Entity { } - -class Group extends Entity { } - diff --git a/manual/docs/Object relational mapping - Relations - Inheritance - One table one class.php b/manual/docs/Object relational mapping - Relations - Inheritance - One table one class.php deleted file mode 100644 index c24a1eabc..000000000 --- a/manual/docs/Object relational mapping - Relations - Inheritance - One table one class.php +++ /dev/null @@ -1,34 +0,0 @@ -In the following example we have three database tables called 'entity', 'user' and 'group'. -Users and groups are both entities. -The only thing we have to do is write 3 classes (Entity, Group and User) and make iterative -setTableDefinition method calls. - - - - - -class Entity extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('name','string',30); - $this->hasColumn('username','string',20); - $this->hasColumn('password','string',16); - $this->hasColumn('created','integer',11); - } -} - -class User extends Entity { - public function setTableDefinition() { - // the following method call is needed in - // one-table-one-class inheritance - parent::setTableDefinition(); - } -} - -class Group extends Entity { - public function setTableDefinition() { - // the following method call is needed in - // one-table-one-class inheritance - parent::setTableDefinition(); - } -} - diff --git a/manual/docs/Object relational mapping - Relations - Introduction.php b/manual/docs/Object relational mapping - Relations - Introduction.php deleted file mode 100644 index c904cd9e1..000000000 --- a/manual/docs/Object relational mapping - Relations - Introduction.php +++ /dev/null @@ -1,3 +0,0 @@ -In Doctrine all record relations are being set with hasMany, hasOne, ownsMany and ownsOne methods. Doctrine supports almost any kind of database relation -from simple one-to-one foreign key relations to join table self-referencing relations. - diff --git a/manual/docs/Object relational mapping - Relations - Join table associations - Many-to-Many.php b/manual/docs/Object relational mapping - Relations - Join table associations - Many-to-Many.php deleted file mode 100644 index 1e9b35ecd..000000000 --- a/manual/docs/Object relational mapping - Relations - Join table associations - Many-to-Many.php +++ /dev/null @@ -1,75 +0,0 @@ -If you are coming from relational database background it may be familiar to you -how many-to-many associations are handled: an additional association table is needed. - - - -In many-to-many relations the relation between the two components is always an aggregate -relation and the association table is owned by both ends. For example in the case of users and groups -when user is being deleted the groups it belongs to are not being deleted and the associations between this user -and the groups it belongs to are being deleted. - - - -Sometimes you may not want that association table rows are being deleted when user / group is being deleted. You can override -this behoviour by setting the relations to association component (in this case Groupuser) explicitly. - - - -In the following example we have Groups and Users of which relation is defined as -many-to-many. In this case we also need to define an additional class called Groupuser. - - - -class User extends Doctrine_Record { - public function setUp() { - $this->hasMany('Group','Groupuser.group_id'); - } - public function setTableDefinition() { - $this->hasColumn('name','string',30); - } -} - -class Group extends Doctrine_Record { - public function setUp() { - $this->hasMany('User','Groupuser.user_id'); - } - public function setTableDefinition() { - $this->hasColumn('name','string',30); - } -} - -class Groupuser extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('user_id','integer'); - $this->hasColumn('group_id','integer'); - } -} - - -$user = new User(); - -// add two groups -$user->Group[0]->name = 'First Group'; - -$user->Group[1]->name = 'Second Group'; - -// save changes into database -$user->save(); - -// deleting the associations between user and groups it belongs to - -$user->Groupuser->delete(); - -$groups = new Doctrine_Collection($conn->getTable('Group')); - -$groups[0]->name = 'Third Group'; - -$groups[1]->name = 'Fourth Group'; - -$user->Group[2] = $groups[0]; -// $user will now have 3 groups - -$user->Group = $groups; -// $user will now have two groups 'Third Group' and 'Fourth Group' - - diff --git a/manual/docs/Object relational mapping - Relations - Join table associations - One-to-Many, Many-to-One.php b/manual/docs/Object relational mapping - Relations - Join table associations - One-to-Many, Many-to-One.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Object relational mapping - Relations - Join table associations - One-to-Many, Many-to-One.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Object relational mapping - Relations - Join table associations - One-to-One.php b/manual/docs/Object relational mapping - Relations - Join table associations - One-to-One.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Object relational mapping - Relations - Join table associations - One-to-One.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Object relational mapping - Relations - Join table associations - Self-referencing.php b/manual/docs/Object relational mapping - Relations - Join table associations - Self-referencing.php deleted file mode 100644 index b20062149..000000000 --- a/manual/docs/Object relational mapping - Relations - Join table associations - Self-referencing.php +++ /dev/null @@ -1,18 +0,0 @@ -Self-referencing with join tables is done as follows: - - -class User extends Doctrine_Record { - public function setUp() { - $this->hasMany('User as Friend','UserReference.user_id-user_id2'); - } - public function setTableDefinition() { - $this->hasColumn('name','string',30); - } -} -class UserReference extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('user_id','integer'); - $this->hasColumn('user_id2','integer'); - } -} - diff --git a/manual/docs/Object relational mapping - Relations - One-to-Many and One-to-One relationships.php b/manual/docs/Object relational mapping - Relations - One-to-Many and One-to-One relationships.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Object relational mapping - Relations - One-to-Many and One-to-One relationships.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Object relational mapping - Relations - Relation aliases.php b/manual/docs/Object relational mapping - Relations - Relation aliases.php deleted file mode 100644 index 7562b3d0d..000000000 --- a/manual/docs/Object relational mapping - Relations - Relation aliases.php +++ /dev/null @@ -1,28 +0,0 @@ -Doctrine supports relation aliases through 'as' keyword. - - -class Forum_Board extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('name', 'string', 100); - $this->hasColumn('description', 'string', 5000); - } - public function setUp() { - // notice the 'as' keyword here - $this->ownsMany('Forum_Thread as Threads', 'Forum_Thread.board_id'); - } -} - -class Forum_Thread extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn('board_id', 'integer', 10); - $this->hasColumn('updated', 'integer', 10); - $this->hasColumn('closed', 'integer', 1); - } - public function setUp() { - // notice the 'as' keyword here - $this->hasOne('Forum_Board as Board', 'Forum_Thread.board_id'); - } -} -$board = new Board(); -$board->Threads[0]->updated = time(); - diff --git a/manual/docs/Object relational mapping - Table and class naming.php b/manual/docs/Object relational mapping - Table and class naming.php deleted file mode 100644 index 5b8b37c37..000000000 --- a/manual/docs/Object relational mapping - Table and class naming.php +++ /dev/null @@ -1,29 +0,0 @@ -Doctrine automatically creates table names from the record class names. For this reason, it is recommended to name your record classes using the following rules: - - * Use CamelCase naming - * Underscores are allowed - * The first letter must be capitalized - * The class name cannot be one of the following (these keywords are reserved in DQL API): - - SELECT, FROM, WHERE, UPDATE, DELETE, JOIN, OUTER, INNER, LEFT, GROUP, ORDER, BY, HAVING, - - FETCH, DISTINCT, OBJECT, NULL, TRUE, FALSE, - - NOT, AND, OR, BETWEEN, LIKE, IN, - - AS, UNKNOWN, EMPTY, MEMBER, OF, IS, ASC, DESC, - - AVG, MAX, MIN, SUM, COUNT, - - MOD, UPPER, LOWER, TRIM, POSITION, - - CHARACTER_LENGTH, CHAR_LENGTH, BIT_LENGTH, CURRENT_TIME, CURRENT_DATE, - - CURRENT_TIMESTAMP, NEW, EXISTS, ALL, ANY, SOME. - - -Example. My_PerfectClass - - -If you need to use a different naming schema, you can override this using the setTableName() method in the setTableDefinition() method. - diff --git a/manual/docs/Object relational mapping - Table options.php b/manual/docs/Object relational mapping - Table options.php deleted file mode 100644 index 11c4af90f..000000000 --- a/manual/docs/Object relational mapping - Table options.php +++ /dev/null @@ -1,39 +0,0 @@ - -Doctrine offers various table options. All table options can be set via Doctrine_Record::option($optionName, $value) - - - -For example if you are using Mysql and want to use INNODB tables it can be done as follows: - - - - -class MyInnoDbRecord extends Doctrine_Record -{ - public function setTableDefinition() - { - \$this->hasColumn('name', 'string'); - - \$this->option('type', 'INNODB'); - } -} -?> - - -In the following example we set the collate and character set options: - - - - -class MyCustomOptionRecord extends Doctrine_Record -{ - public function setTableDefinition() - { - \$this->hasColumn('name', 'string'); - - \$this->option('collate', 'utf8_unicode_ci'); - \$this->option('charset', 'utf8'); - } -} -?> - diff --git a/manual/docs/Operators - Logical operators.php b/manual/docs/Operators - Logical operators.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Operators - Logical operators.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Performance - Internal optimizations - DELETE.php b/manual/docs/Performance - Internal optimizations - DELETE.php deleted file mode 100644 index 43353b8a2..000000000 --- a/manual/docs/Performance - Internal optimizations - DELETE.php +++ /dev/null @@ -1,25 +0,0 @@ - - -/** - * lets presume $users contains a collection of users - * each having 0-1 email and 0-* phonenumbers - */ -$users->delete(); -/** - * On connection drivers other than mysql doctrine would now perform three queries - * regardless of how many users, emails and phonenumbers there are - * - * the queries would look something like: - * DELETE FROM entity WHERE entity.id IN (1,2,3, ... ,15) - * DELETE FROM phonenumber WHERE phonenumber.id IN (4,6,7,8) - * DELETE FROM email WHERE email.id IN (1,2, ... ,10) - * - * On mysql doctrine is EVEN SMARTER! Now it would perform only one query! - * the query would look like: - * DELETE entity, email, phonenumber FROM entity - * LEFT JOIN phonenumber ON entity.id = phonenumber.entity_id, email - * WHERE (entity.email_id = email.id) && (entity.id IN(4, 5, 6, 7, 8, 9, 10, 11)) && (entity.type = 0) - */ - - - diff --git a/manual/docs/Performance - Internal optimizations - INSERT.php b/manual/docs/Performance - Internal optimizations - INSERT.php deleted file mode 100644 index 0202c5ce3..000000000 --- a/manual/docs/Performance - Internal optimizations - INSERT.php +++ /dev/null @@ -1,29 +0,0 @@ - - -// lets presume $users contains a collection of new users -// each having 0-1 email and 0-* phonenumbers -$users->save(); -/** - * now doctrine would perform prepared queries in the following order: - * - * first the emails since every user needs to get the primary key of their newly created email - * INSERT INTO email (address) VALUES (:address) - * INSERT INTO email (address) VALUES (:address) - * INSERT INTO email (address) VALUES (:address) - * - * then the users - * INSERT INTO entity (name,email_id) VALUES (:name,:email_id) - * INSERT INTO entity (name,email_id) VALUES (:name,:email_id) - * INSERT INTO entity (name,email_id) VALUES (:name,:email_id) - * - * and at last the phonenumbers since they need the primary keys of the newly created users - * INSERT INTO phonenumber (phonenumber,entity_id) VALUES (:phonenumber,:entity_id) - * INSERT INTO phonenumber (phonenumber,entity_id) VALUES (:phonenumber,:entity_id) - * INSERT INTO phonenumber (phonenumber,entity_id) VALUES (:phonenumber,:entity_id) - * INSERT INTO phonenumber (phonenumber,entity_id) VALUES (:phonenumber,:entity_id) - * INSERT INTO phonenumber (phonenumber,entity_id) VALUES (:phonenumber,:entity_id) - * - * These operations are considerably fast, since many databases perform multiple - * prepared queries very rapidly - */ - diff --git a/manual/docs/Real world examples - Album lister.php b/manual/docs/Real world examples - Album lister.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Real world examples - Album lister.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Real world examples - Forum application.php b/manual/docs/Real world examples - Forum application.php deleted file mode 100644 index b81dfaf1f..000000000 --- a/manual/docs/Real world examples - Forum application.php +++ /dev/null @@ -1,53 +0,0 @@ - - -class Forum_Category extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn("root_category_id", "integer", 10); - $this->hasColumn("parent_category_id", "integer", 10); - $this->hasColumn("name", "string", 50); - $this->hasColumn("description", "string", 99999); - } - public function setUp() { - $this->hasMany("Forum_Category as Subcategory", "Subcategory.parent_category_id"); - $this->hasOne("Forum_Category as Rootcategory", "Forum_Category.root_category_id"); - } -} -class Forum_Board extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn("category_id", "integer", 10); - $this->hasColumn("name", "string", 100); - $this->hasColumn("description", "string", 5000); - } - public function setUp() { - $this->hasOne("Forum_Category as Category", "Forum_Board.category_id"); - $this->ownsMany("Forum_Thread as Threads", "Forum_Thread.board_id"); - } -} - -class Forum_Entry extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn("author", "string", 50); - $this->hasColumn("topic", "string", 100); - $this->hasColumn("message", "string", 99999); - $this->hasColumn("parent_entry_id", "integer", 10); - $this->hasColumn("thread_id", "integer", 10); - $this->hasColumn("date", "integer", 10); - } - public function setUp() { - $this->hasOne("Forum_Entry as Parent", "Forum_Entry.parent_entry_id"); - $this->hasOne("Forum_Thread as Thread", "Forum_Entry.thread_id"); - } -} - -class Forum_Thread extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn("board_id", "integer", 10); - $this->hasColumn("updated", "integer", 10); - $this->hasColumn("closed", "integer", 1); - } - public function setUp() { - $this->hasOne("Forum_Board as Board", "Forum_Thread.board_id"); - $this->ownsMany("Forum_Entry as Entries", "Forum_Entry.thread_id"); - } -} - diff --git a/manual/docs/Real world examples - User management system.php b/manual/docs/Real world examples - User management system.php deleted file mode 100644 index 41c154fad..000000000 --- a/manual/docs/Real world examples - User management system.php +++ /dev/null @@ -1,120 +0,0 @@ -In the following example we make a user management system where - - - -1. Each user and group are entities - - - -2. User is an entity of type 0 - - - -3. Group is an entity of type 1 - - - -4. Each entity (user/group) has 0-1 email - - - -5. Each entity has 0-* phonenumbers - - - -6. If an entity is saved all its emails and phonenumbers are also saved - - - -7. If an entity is deleted all its emails and phonenumbers are also deleted - - - -8. When an entity is created and saved a current timestamp will be assigned to 'created' field - - - -9. When an entity is updated a current timestamp will be assigned to 'updated' field - - - -10. Entities will always be fetched in batches - - -class Entity extends Doctrine_Record { - public function setUp() { - $this->ownsOne("Email","Entity.email_id"); - $this->ownsMany("Phonenumber","Phonenumber.entity_id"); - $this->setAttribute(Doctrine::ATTR_FETCHMODE,Doctrine::FETCH_BATCH); - $this->setAttribute(Doctrine::ATTR_LISTENER,new EntityListener()); - } - public function setTableDefinition() { - $this->hasColumn("name","string",50); - $this->hasColumn("loginname","string",20); - $this->hasColumn("password","string",16); - $this->hasColumn("type","integer",1); - $this->hasColumn("created","integer",11); - $this->hasColumn("updated","integer",11); - $this->hasColumn("email_id","integer"); - } -} -class Group extends Entity { - public function setUp() { - parent::setUp(); - $this->hasMany("User","Groupuser.user_id"); - $this->setInheritanceMap(array("type"=>1)); - } -} -class User extends Entity { - public function setUp() { - parent::setUp(); - $this->hasMany("Group","Groupuser.group_id"); - $this->setInheritanceMap(array("type"=>0)); - } -} -class Groupuser extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn("group_id","integer"); - $this->hasColumn("user_id","integer"); - } -} - -class Phonenumber extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn("phonenumber","string",20); - $this->hasColumn("entity_id","integer"); - } -} -class Email extends Doctrine_Record { - public function setTableDefinition() { - $this->hasColumn("address","string",150,"email|unique"); - } -} -class EntityListener extends Doctrine_EventListener { - public function onPreUpdate(Doctrine_Record $record) { - $record->updated = time(); - } - public function onPreInsert(Doctrine_Record $record) { - $record->created = time(); - } -} - -// USER MANAGEMENT SYSTEM IN ACTION: - -$manager = Doctrine_Manager::getInstance(); - -$conn = $manager->openConnection(new PDO("DSN","username","password")); - -$user = new User(); - -$user->name = "Jack Daniels"; -$user->Email->address = "jackdaniels@drinkmore.info"; -$user->Phonenumber[0]->phonenumber = "123 123"; -$user->Phonenumber[1]->phonenumber = "133 133"; -$user->save(); - -$user->Group[0]->name = "beer lovers"; -$user->Group[0]->Email->address = "beerlovers@drinkmore.info"; -$user->Group[0]->save(); - - diff --git a/manual/docs/Runtime classes - Doctrine_Association.php b/manual/docs/Runtime classes - Doctrine_Association.php deleted file mode 100644 index 17a2a8859..000000000 --- a/manual/docs/Runtime classes - Doctrine_Association.php +++ /dev/null @@ -1 +0,0 @@ -Doctrine_Association represents a many-to-many association between database tables. diff --git a/manual/docs/Runtime classes - Doctrine_Collection.php b/manual/docs/Runtime classes - Doctrine_Collection.php deleted file mode 100644 index 3eee67814..000000000 --- a/manual/docs/Runtime classes - Doctrine_Collection.php +++ /dev/null @@ -1 +0,0 @@ -Doctrine_Collection is a collection of Data Access Objects. Doctrine_Collection represents a record set. diff --git a/manual/docs/Runtime classes - Doctrine_Collection_Batch.php b/manual/docs/Runtime classes - Doctrine_Collection_Batch.php deleted file mode 100644 index d894cbb1b..000000000 --- a/manual/docs/Runtime classes - Doctrine_Collection_Batch.php +++ /dev/null @@ -1 +0,0 @@ -Doctrine_Collection_Batch is a Doctrine_Collection with batch fetching strategy. diff --git a/manual/docs/Runtime classes - Doctrine_Collection_Immediate.php b/manual/docs/Runtime classes - Doctrine_Collection_Immediate.php deleted file mode 100644 index 88a47e37d..000000000 --- a/manual/docs/Runtime classes - Doctrine_Collection_Immediate.php +++ /dev/null @@ -1 +0,0 @@ -Doctrine_Collection_Immediate is a Doctrine_Collection with immediate fetching strategy. diff --git a/manual/docs/Runtime classes - Doctrine_Collection_Lazy.php b/manual/docs/Runtime classes - Doctrine_Collection_Lazy.php deleted file mode 100644 index 9e0fbcc21..000000000 --- a/manual/docs/Runtime classes - Doctrine_Collection_Lazy.php +++ /dev/null @@ -1 +0,0 @@ -Doctrine_Collection_Lazy is a Doctrine_Collection with lazy fetching strategy. diff --git a/manual/docs/Runtime classes - Doctrine_ForeignKey.php b/manual/docs/Runtime classes - Doctrine_ForeignKey.php deleted file mode 100644 index db22a18d6..000000000 --- a/manual/docs/Runtime classes - Doctrine_ForeignKey.php +++ /dev/null @@ -1 +0,0 @@ -Doctrine_ForeignKey represents a one-to-many association or one-to-one association between two database tables. diff --git a/manual/docs/Runtime classes - Doctrine_Manager.php b/manual/docs/Runtime classes - Doctrine_Manager.php deleted file mode 100644 index 3e40e60a8..000000000 --- a/manual/docs/Runtime classes - Doctrine_Manager.php +++ /dev/null @@ -1,2 +0,0 @@ -Doctrine_Manager is the base component of Doctrine ORM framework. Doctrine_Manager is a colletion of Doctrine_Connections. All the new connections are being -opened by Doctrine_Manager::openConnection(). diff --git a/manual/docs/Runtime classes - Doctrine_Record.php b/manual/docs/Runtime classes - Doctrine_Record.php deleted file mode 100644 index 0d522f176..000000000 --- a/manual/docs/Runtime classes - Doctrine_Record.php +++ /dev/null @@ -1,43 +0,0 @@ -Doctrine_Record is a wrapper for database row. - - - -$user = $table->find(2); - -// get state -$state = $user->getState(); - -print $user->name; - -print $user["name"]; - -print $user->get("name"); - -$user->name = "Jack Daniels"; - -$user->set("name","Jack Daniels"); - -// serialize record - -$serialized = serialize($user); - -$user = unserialize($serialized); - -// create a copy - -$copy = $user->copy(); - -// get primary key - -$id = $user->getID(); - -// print lots of useful info - -print $user; - -// save all the properties and composites -$user->save(); - -// delete this data access object and related objects -$user->delete(); - diff --git a/manual/docs/Runtime classes - Doctrine_Session.php b/manual/docs/Runtime classes - Doctrine_Session.php deleted file mode 100644 index 13549761f..000000000 --- a/manual/docs/Runtime classes - Doctrine_Session.php +++ /dev/null @@ -1,34 +0,0 @@ -Doctrine_Connection is a wrapper for database connection. It creates Doctrine_Tables and keeps track of all the created tables. -Doctrine_Connection provides things that are missing from PDO like sequence support and limit/offset emulation. - - - -$sess = $manager->openConnection(Doctrine_Db::getConnection("schema://username:password@hostname/database")); - -// get connection state: -switch($sess): - case Doctrine_Connection::STATE_BUSY: - // multiple open transactions - break; - case Doctrine_Connection::STATE_ACTIVE: - // one open transaction - break; - case Doctrine_Connection::STATE_CLOSED: - // closed state - break; - case Doctrine_Connection::STATE_OPEN: - // open state and zero open transactions - break; -endswitch; - -// getting database handler - -$dbh = $sess->getDBH(); - -// flushing the connection -$sess->flush(); - - -// print lots of useful info about connection: -print $sess; - diff --git a/manual/docs/Runtime classes - Doctrine_Table.php b/manual/docs/Runtime classes - Doctrine_Table.php deleted file mode 100644 index 90fbb5320..000000000 --- a/manual/docs/Runtime classes - Doctrine_Table.php +++ /dev/null @@ -1,2 +0,0 @@ -Doctrine_Table creates records and holds info of all foreign keys and associations. Doctrine_Table -represents a database table. diff --git a/manual/docs/Schema reference - Data types - Array.php b/manual/docs/Schema reference - Data types - Array.php deleted file mode 100644 index 7666e9bc7..000000000 --- a/manual/docs/Schema reference - Data types - Array.php +++ /dev/null @@ -1 +0,0 @@ -This is the same as 'array' type in PHP. diff --git a/manual/docs/Schema reference - Foreign keys - Introduction.php b/manual/docs/Schema reference - Foreign keys - Introduction.php deleted file mode 100644 index 24be45d15..000000000 --- a/manual/docs/Schema reference - Foreign keys - Introduction.php +++ /dev/null @@ -1,2 +0,0 @@ -A foreign key constraint specifies that the values in a column (or a group of columns) must match the values appearing in some row of another table. -In other words foreign key constraints maintain the referential integrity between two related tables. diff --git a/manual/docs/Technology - Architecture.php b/manual/docs/Technology - Architecture.php deleted file mode 100644 index 341c6bfa9..000000000 --- a/manual/docs/Technology - Architecture.php +++ /dev/null @@ -1,16 +0,0 @@ -Doctrine is divided into 3 main packages: - ->> Doctrine CORE - Doctrine - Doctrine_Manager - Doctrine_Connection - ->> Doctrine DBAL - Doctrine_Expression - Doctrine_Export - Doctrine_Import - Doctrine_Sequence - ->> Doctrine ORM - - diff --git a/manual/docs/Technology - Design patterns used.php b/manual/docs/Technology - Design patterns used.php deleted file mode 100644 index b0e37f586..000000000 --- a/manual/docs/Technology - Design patterns used.php +++ /dev/null @@ -1,34 +0,0 @@ -GoF [Gang Of Four] design patterns used: - - - * : [http://www.dofactory.com/Patterns/PatternSingleton.aspx Singleton] : For forcing only one instance of Doctrine_Manager - - * : [http://www.dofactory.com/Patterns/PatternComposite.aspx Composite] : For leveled configuration - - * : [http://www.dofactory.com/Patterns/PatternFactory.aspx Factory] : For connection driver loading and many other things - - * : [http://www.dofactory.com/Patterns/PatternObserver.aspx Observer] : For event listening - - * : [http://www.dofactory.com/Patterns/PatternFlyweight.aspx Flyweight] : For efficient usage of validators - - * : [http://www.dofactory.com/Patterns/PatternFlyweight.aspx Iterator] : For iterating through components [Tables, Connections, Records etc.] - - * : [http://www.dofactory.com/Patterns/PatternState.aspx State] : For state-wise connections - - * : [http://www.dofactory.com/Patterns/PatternStrategy.aspx Strategy] : For algorithm strategies - - - -Enterprise application design patterns used: - - - * : [http://www.martinfowler.com/eaaCatalog/activeRecord.html Active Record] : Doctrine is an implementation of this pattern - * : [http://www.martinfowler.com/eaaCatalog/unitOfWork.html UnitOfWork] : For maintaining a list of objects affected in a transaction - * : [http://www.martinfowler.com/eaaCatalog/identityField.html Identity Field] : For maintaining the identity between record and database row - * : [http://www.martinfowler.com/eaaCatalog/metadataMapping.html Metadata Mapping] : For Doctrine DataDict - * : [http://www.martinfowler.com/eaaCatalog/dependentMapping.html Dependent Mapping] : For mapping in general, since all records extend Doctrine_Record which performs all mappings - * : [http://www.martinfowler.com/eaaCatalog/foreignKeyMapping.html Foreign Key Mapping] : For one-to-one, one-to-many and many-to-one relationships - * : [http://www.martinfowler.com/eaaCatalog/associationTableMapping.html Association Table Mapping] : For association table mapping (most commonly many-to-many relationships) - * : [http://www.martinfowler.com/eaaCatalog/lazyLoad.html Lazy Load] : For lazy loading of objects and object properties - * : [http://www.martinfowler.com/eaaCatalog/queryObject.html Query Object] : DQL API is actually an extension to the basic idea of Query Object pattern - diff --git a/manual/docs/Technology - Internal optimizations - DELETE.php b/manual/docs/Technology - Internal optimizations - DELETE.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Technology - Internal optimizations - DELETE.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Technology - Internal optimizations - INSERT.php b/manual/docs/Technology - Internal optimizations - INSERT.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Technology - Internal optimizations - INSERT.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Technology - Internal optimizations - UPDATE.php b/manual/docs/Technology - Internal optimizations - UPDATE.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Technology - Internal optimizations - UPDATE.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Technology - Speed.php b/manual/docs/Technology - Speed.php deleted file mode 100644 index e410f7aef..000000000 --- a/manual/docs/Technology - Speed.php +++ /dev/null @@ -1,69 +0,0 @@ -* Lazy initialization** - -For collection elements - - - -* Subselect fetching** - -Doctrine knows how to fetch collections efficiently using a subselect. - - - -* Executing SQL statements later, when needed** - -The connection never issues an INSERT or UPDATE until it is actually needed. So if an exception occurs and you need to abort the transaction, some statements will never actually be issued. Furthermore, this keeps lock times in the database as short as possible (from the late UPDATE to the transaction end). - - - -* Join fetching** - -Doctrine knows how to fetch complex object graphs using joins and subselects - - - -* Multiple collection fetching strategies** - -Doctrine has multiple collection fetching strategies for performance tuning. - - - -* Dynamic mixing of fetching strategies** - -Fetching strategies can be mixed and for example users can be fetched in a batch collection while -users' phonenumbers are loaded in offset collection using only one query. - - - -* Driver specific optimizations** - -Doctrine knows things like bulk-insert on mysql - - - -* Transactional single-shot delete** - -Doctrine knows how to gather all the primary keys of the pending objects in delete list and performs only one sql delete statement per table. - - - -* Updating only the modified columns.** - -Doctrine always knows which columns have been changed. - - - -* Never inserting/updating unmodified objects.** - -Doctrine knows if the the state of the record has changed. - - - -* PDO for database abstraction** - -PDO is by far the fastest availible database abstraction layer for php. - - - - - diff --git a/manual/docs/Transactions - Deadlocks.php b/manual/docs/Transactions - Deadlocks.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Transactions - Deadlocks.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Transactions - Introduction.php b/manual/docs/Transactions - Introduction.php deleted file mode 100644 index 67c15d284..000000000 --- a/manual/docs/Transactions - Introduction.php +++ /dev/null @@ -1,44 +0,0 @@ -A database transaction is a unit of interaction with a database management system or similar system that is treated in a coherent -and reliable way independent of other transactions that must be either entirely completed or aborted. -Ideally, a database system will guarantee all of the ACID(Atomicity, Consistency, Isolation, and Durability) properties for each transaction. - -* [http://en.wikipedia.org/wiki/Atomicity Atomicity] refers to the ability of the DBMS to guarantee that either all of the tasks of a transaction are performed or none of them are. The transfer of funds can be completed or it can fail for a multitude of reasons, but atomicity guarantees that one account won't be debited if the other is not credited as well. - - -* [http://en.wikipedia.org/wiki/Database_consistency Consistency] refers to the database being in a legal state when the transaction begins and when it ends. This means that a transaction can't break the rules, or //integrity constraints//, of the database. If an integrity constraint states that all accounts must have a positive balance, then any transaction violating this rule will be aborted. - - -* [http://en.wikipedia.org/wiki/Isolation_%28computer_science%29 Isolation] refers to the ability of the application to make operations in a transaction appear isolated from all other operations. This means that no operation outside the transaction can ever see the data in an intermediate state; a bank manager can see the transferred funds on one account or the other, but never on both—even if she ran her query while the transfer was still being processed. More formally, isolation means the transaction history (or [http://en.wikipedia.org/wiki/Schedule_%28computer_science%29 schedule]) is [http://en.wikipedia.org/wiki/Serializability serializable]. For performance reasons, this ability is the most often relaxed constraint. See the [/wiki/Isolation_%28computer_science%29 isolation] article for more details. - - -* [http://en.wikipedia.org/wiki/Durability_%28computer_science%29 Durability] refers to the guarantee that once the user has been notified of success, the transaction will persist, and not be undone. This means it will survive system failure, and that the [http://en.wikipedia.org/wiki/Database_system database system] has checked the integrity constraints and won't need to abort the transaction. Typically, all transactions are written into a [http://en.wikipedia.org/wiki/Database_log log] that can be played back to recreate the system to its state right before the failure. A transaction can only be deemed committed after it is safely in the log. - - -- //from [http://www.wikipedia.org wikipedia]// - - - -In Doctrine all operations are wrapped in transactions by default. There are some things that should be noticed about how Doctrine works internally: - -* Doctrine uses application level transaction nesting. - - -* Doctrine always executes INSERT / UPDATE / DELETE queries at the end of transaction (when the outermost commit is called). The operations -are performed in the following order: all inserts, all updates and last all deletes. Doctrine knows how to optimize the deletes so that -delete operations of the same component are gathered in one query. - - - - -$conn->beginTransaction(); - -$user = new User(); -$user->name = 'New user'; -$user->save(); - -$user = $conn->getTable('User')->find(5); -$user->name = 'Modified user'; -$user->save(); - -$conn->commit(); // all the queries are executed here - diff --git a/manual/docs/Transactions - Isolation levels.php b/manual/docs/Transactions - Isolation levels.php deleted file mode 100644 index 438fc9551..000000000 --- a/manual/docs/Transactions - Isolation levels.php +++ /dev/null @@ -1,40 +0,0 @@ - -A transaction isolation level sets the default transactional behaviour. -As the name 'isolation level' suggests, the setting determines how isolated each transation is, -or what kind of locks are associated with queries inside a transaction. -The four availible levels are (in ascending order of strictness): - - - -//READ UNCOMMITTED//: Barely transactional, this setting allows for so-called 'dirty reads', -where queries inside one transaction are affected by uncommitted changes in another transaction. - - - -//READ COMMITTED//: Committed updates are visible within another transaction. - This means identical queries within a transaction can return differing results. This is the default in some DBMS's. - - - -//REPEATABLE READ//: Within a transaction, all reads are consistent. This is the default of Mysql INNODB engine. - - - -//SERIALIZABLE//: Updates are not permitted in other transactions if a transaction has run an ordinary SELECT query. - - - - -\$tx = \$conn->transaction; // get the transaction module - -// sets the isolation level to READ COMMITTED -\$tx->setIsolation('READ COMMITTED'); - -// sets the isolation level to SERIALIZABLE -\$tx->setIsolation('SERIALIZABLE'); - -// Some drivers (like Mysql) support the fetching of current transaction -// isolation level. It can be done as follows: -\$level = \$tx->getIsolation(); -?> - diff --git a/manual/docs/Transactions - Lock modes.php b/manual/docs/Transactions - Lock modes.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Transactions - Lock modes.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Transactions - Locking strategies - Optimistic locking.php b/manual/docs/Transactions - Locking strategies - Optimistic locking.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Transactions - Locking strategies - Optimistic locking.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Transactions - Locking strategies - Pessimistic locking.php b/manual/docs/Transactions - Locking strategies - Pessimistic locking.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Transactions - Locking strategies - Pessimistic locking.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Transactions - Nesting.php b/manual/docs/Transactions - Nesting.php deleted file mode 100644 index 4c6b8793c..000000000 --- a/manual/docs/Transactions - Nesting.php +++ /dev/null @@ -1,24 +0,0 @@ - - -function saveUserAndGroup(Doctrine_Connection $conn, User $user, Group $group) { - $conn->beginTransaction(); - - $user->save(); - - $group->save(); - - $conn->commit(); -} - -try { - $conn->beginTransaction(); - - saveUserAndGroup($conn,$user,$group); - saveUserAndGroup($conn,$user2,$group2); - saveUserAndGroup($conn,$user3,$group3); - - $conn->commit(); -} catch(Doctrine_Exception $e) { - $conn->rollback(); -} - diff --git a/manual/docs/Transactions - Savepoints.php b/manual/docs/Transactions - Savepoints.php deleted file mode 100644 index 60de08a17..000000000 --- a/manual/docs/Transactions - Savepoints.php +++ /dev/null @@ -1,65 +0,0 @@ - -Doctrine supports transaction savepoints. This means you can set named transactions and have them nested. - - - -The Doctrine_Transaction::beginTransaction(//$savepoint//) sets a named transaction savepoint with a name of //$savepoint//. -If the current transaction has a savepoint with the same name, the old savepoint is deleted and a new one is set. - - - - -try { - \$conn->beginTransaction(); - // do some operations here - - // creates a new savepoint called mysavepoint - \$conn->beginTransaction('mysavepoint'); - try { - // do some operations here - - \$conn->commit('mysavepoint'); - } catch(Exception \$e) { - \$conn->rollback('mysavepoint'); - } - \$conn->commit(); -} catch(Exception \$e) { - \$conn->rollback(); -} -?> - - - - -The Doctrine_Transaction::rollback(//$savepoint//) rolls back a transaction to the named savepoint. -Modifications that the current transaction made to rows after the savepoint was set are undone in the rollback. - -NOTE: Mysql, for example, does not release the row locks that were stored in memory after the savepoint. - - - -Savepoints that were set at a later time than the named savepoint are deleted. - - - -The Doctrine_Transaction::commit(//$savepoint//) removes the named savepoint from the set of savepoints of the current transaction. - - - -All savepoints of the current transaction are deleted if you execute a commit or rollback is being called without savepoint name parameter. - -try { - \$conn->beginTransaction(); - // do some operations here - - // creates a new savepoint called mysavepoint - \$conn->beginTransaction('mysavepoint'); - - // do some operations here - - \$conn->commit(); // deletes all savepoints -} catch(Exception \$e) { - \$conn->rollback(); // deletes all savepoints -} -?> - diff --git a/manual/docs/Transactions - Unit of work.php b/manual/docs/Transactions - Unit of work.php deleted file mode 100644 index 50e52d07d..000000000 --- a/manual/docs/Transactions - Unit of work.php +++ /dev/null @@ -1,19 +0,0 @@ - - -$conn->beginTransaction(); - -$user = new User(); -$user->name = 'New user'; -$user->save(); - -$user = $conn->getTable('User')->find(5); -$user->name = 'Modified user'; -$user->save(); - - -$pending = $conn->getInserts(); // an array containing one element - -$pending = $conn->getUpdates(); // an array containing one element - -$conn->commit(); // all the queries are executed here - diff --git a/manual/docs/Working with objects - Component overview - Collection - Accessing elements.php b/manual/docs/Working with objects - Component overview - Collection - Accessing elements.php deleted file mode 100644 index 861ff42ab..000000000 --- a/manual/docs/Working with objects - Component overview - Collection - Accessing elements.php +++ /dev/null @@ -1,17 +0,0 @@ -You can access the elements of Doctrine_Collection with set() and get() methods or with ArrayAccess interface. - - -$table = $conn->getTable("User"); - -$users = $table->findAll(); - -// accessing elements with ArrayAccess interface - -$users[0]->name = "Jack Daniels"; - -$users[1]->name = "John Locke"; - -// accessing elements with get() - -print $users->get(1)->name; - diff --git a/manual/docs/Working with objects - Component overview - Collection - Adding new elements.php b/manual/docs/Working with objects - Component overview - Collection - Adding new elements.php deleted file mode 100644 index eae643b72..000000000 --- a/manual/docs/Working with objects - Component overview - Collection - Adding new elements.php +++ /dev/null @@ -1,19 +0,0 @@ -When accessing single elements of the collection and those elements (records) don't exist Doctrine auto-adds them. - - - -In the following example -we fetch all users from database (there are 5) and then add couple of users in the collection. - - - -As with PHP arrays the indexes start from zero. - - -$users = $table->findAll(); - -print count($users); // 5 - -$users[5]->name = "new user 1"; -$users[6]->name = "new user 2"; - diff --git a/manual/docs/Working with objects - Component overview - Collection - Collection expanding.php b/manual/docs/Working with objects - Component overview - Collection - Collection expanding.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Working with objects - Component overview - Collection - Collection expanding.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Working with objects - Component overview - Collection - Deleting collection.php b/manual/docs/Working with objects - Component overview - Collection - Deleting collection.php deleted file mode 100644 index b5aa78ae3..000000000 --- a/manual/docs/Working with objects - Component overview - Collection - Deleting collection.php +++ /dev/null @@ -1,29 +0,0 @@ -Doctrine Collections can be deleted in very same way is Doctrine Records you just call delete() method. -As for all collections Doctrine knows how to perform single-shot-delete meaning it only performs one -database query for the each collection. - - - -For example if we have collection of users which own [0-*] phonenumbers. When deleting the collection -of users doctrine only performs two queries for this whole transaction. The queries would look something like: - - - -DELETE FROM user WHERE id IN (1,2,3, ... ,N) - -DELETE FROM phonenumber WHERE id IN (1,2,3, ... ,M) - - - - -It should also be noted that Doctrine is smart enough to perform single-shot-delete per table when transactions are used. -So if you are deleting a lot of records and want to optimize the operation just wrap the delete calls in Doctrine_Connection transaction. - - - -// delete all users with name 'John' - -$users = $table->findByDql("name LIKE '%John%'"); - -$users->delete(); - diff --git a/manual/docs/Working with objects - Component overview - Collection - Fetching strategies.php b/manual/docs/Working with objects - Component overview - Collection - Fetching strategies.php deleted file mode 100644 index da55b4238..000000000 --- a/manual/docs/Working with objects - Component overview - Collection - Fetching strategies.php +++ /dev/null @@ -1,124 +0,0 @@ -Whenever you fetch records with eg. Doctrine_Table::findAll or Doctrine_Connection::query methods an instance of -Doctrine_Collection is returned. There are many types of collections in Doctrine and it is crucial to understand -the differences of these collections. Remember choosing the right fetching strategy (collection type) is one of the most -influental things when it comes to boosting application performance. - - - -* Immediate Collection -Fetches all records and all record data immediately into collection memory. Use this collection only if you really need to show all that data -in web page. - - - -Example query: - -SELECT id, name, type, created FROM user - - - -* Batch Collection -Fetches all record primary keys into colletion memory. When individual collection elements are accessed this collection initializes proxy objects. -When the non-primary-key-property of a proxy object is accessed that object sends request to Batch collection which loads the data -for that specific proxy object as well as other objects close to that proxy object. - - - -Example queries: - -SELECT id FROM user - -SELECT id, name, type, created FROM user WHERE id IN (1,2,3,4,5) - -SELECT id, name, type, created FROM user WHERE id IN (6,7,8,9,10) - -[ ... ] - - -* Lazy Collection -Lazy collection is exactly same as Batch collection with batch size preset to one. - - - -Example queries: - -SELECT id FROM user - -SELECT id, name, type, created FROM user WHERE id = 1 - -SELECT id, name, type, created FROM user WHERE id = 2 - -SELECT id, name, type, created FROM user WHERE id = 3 - -[ ... ] - - -* Offset Collection -Offset collection is the same as immediate collection with the difference that it uses database provided limiting of queries. - - - -Example queries: - -SELECT id, name, type, created FROM user LIMIT 5 - -SELECT id, name, type, created FROM user LIMIT 5 OFFSET 5 - -SELECT id, name, type, created FROM user LIMIT 5 OFFSET 10 - -[ ... ] - - - - -$table = $conn->getTable("User"); - -$table->setAttribute(Doctrine::ATTR_FETCHMODE, Doctrine::FETCH_IMMEDIATE); - -$users = $table->findAll(); - -// or - -$users = $conn->query("FROM User-I"); // immediate collection - -foreach($users as $user) { - print $user->name; -} - - -$table->setAttribute(Doctrine::ATTR_FETCHMODE, Doctrine::FETCH_LAZY); - -$users = $table->findAll(); - -// or - -$users = $conn->query("FROM User-L"); // lazy collection - -foreach($users as $user) { - print $user->name; -} - -$table->setAttribute(Doctrine::ATTR_FETCHMODE, Doctrine::FETCH_BATCH); - -$users = $table->findAll(); - -// or - -$users = $conn->query("FROM User-B"); // batch collection - -foreach($users as $user) { - print $user->name; -} - -$table->setAttribute(Doctrine::ATTR_FETCHMODE, Doctrine::FETCH_OFFSET); - -$users = $table->findAll(); - -// or - -$users = $conn->query("FROM User-O"); // offset collection - -foreach($users as $user) { - print $user->name; -} - diff --git a/manual/docs/Working with objects - Component overview - Collection - Getting collection count.php b/manual/docs/Working with objects - Component overview - Collection - Getting collection count.php deleted file mode 100644 index 7e494d8a8..000000000 --- a/manual/docs/Working with objects - Component overview - Collection - Getting collection count.php +++ /dev/null @@ -1,11 +0,0 @@ -The Doctrine_Collection method count returns the number of elements currently in the collection. - - -$users = $table->findAll(); - -$users->count(); - -// or - -count($users); // Doctrine_Collection implements Countable interface - diff --git a/manual/docs/Working with objects - Component overview - Collection - Introduction.php b/manual/docs/Working with objects - Component overview - Collection - Introduction.php deleted file mode 100644 index 7b93bb3a0..000000000 --- a/manual/docs/Working with objects - Component overview - Collection - Introduction.php +++ /dev/null @@ -1,30 +0,0 @@ -Doctrine_Collection is a collection of records (see Doctrine_Record). As with records the collections can be deleted and saved using -Doctrine_Collection::delete() and Doctrine_Collection::save() accordingly. - - - -When fetching data from database with either DQL API (see Doctrine_Query) or rawSql API (see Doctrine_RawSql) the methods return an instance of -Doctrine_Collection by default. - - - -The following example shows how to initialize a new collection: - - -$conn = Doctrine_Manager::getInstance() - ->openConnection(new PDO("dsn", "username", "pw")); - -// initalizing a new collection -$users = new Doctrine_Collection($conn->getTable('User')); - -// alternative (propably easier) -$users = new Doctrine_Collection('User'); - -// adding some data -$coll[0]->name = 'Arnold'; - -$coll[1]->name = 'Somebody'; - -// finally save it! -$coll->save(); - diff --git a/manual/docs/Working with objects - Component overview - Collection - Key mapping.php b/manual/docs/Working with objects - Component overview - Collection - Key mapping.php deleted file mode 100644 index eb7f0cdcf..000000000 --- a/manual/docs/Working with objects - Component overview - Collection - Key mapping.php +++ /dev/null @@ -1,35 +0,0 @@ -Sometimes you may not want to use normal indexing for collection elements. For example in -some cases mapping primary keys as collection keys might be useful. The following example -demonstrates how this can be achieved. - - -// mapping id column - -$user = new User(); - -$user->setAttribute(Doctrine::ATTR_COLL_KEY, 'id'); - -// now user collections will use the values of -// id column as element indexes - -$users = $user->getTable()->findAll(); - -foreach($users as $id => $user) { - print $id . $user->name; -} - -// mapping name column - -$user = new User(); - -$user->setAttribute(Doctrine::ATTR_COLL_KEY, 'name'); - -// now user collections will use the values of -// name column as element indexes - -$users = $user->getTable()->findAll(); - -foreach($users as $name => $user) { - print $name . $user->type; -} - diff --git a/manual/docs/Working with objects - Component overview - Collection - Loading related records.php b/manual/docs/Working with objects - Component overview - Collection - Loading related records.php deleted file mode 100644 index b09d95ca3..000000000 --- a/manual/docs/Working with objects - Component overview - Collection - Loading related records.php +++ /dev/null @@ -1,24 +0,0 @@ -Doctrine provides means for efficiently retrieving all related records for all record elements. That means -when you have for example a collection of users you can load all phonenumbers for all users by simple calling -the loadRelated() method. - - -$users = $conn->query("FROM User"); - -// now lets load phonenumbers for all users - -$users->loadRelated("Phonenumber"); - -foreach($users as $user) { - print $user->Phonenumber->phonenumber; - // no additional db queries needed here -} - -// the loadRelated works an any relation, even associations: - -$users->loadRelated("Group"); - -foreach($users as $user) { - print $user->Group->name; -} - diff --git a/manual/docs/Working with objects - Component overview - Collection - Saving the collection.php b/manual/docs/Working with objects - Component overview - Collection - Saving the collection.php deleted file mode 100644 index 5ae46c44d..000000000 --- a/manual/docs/Working with objects - Component overview - Collection - Saving the collection.php +++ /dev/null @@ -1,11 +0,0 @@ -As with records the collection can be saved by calling the save method. - - -$users = $table->findAll(); - -$users[0]->name = "Jack Daniels"; - -$users[1]->name = "John Locke"; - -$users->save(); - diff --git a/manual/docs/Working with objects - Component overview - Connection - Available drivers.php b/manual/docs/Working with objects - Component overview - Connection - Available drivers.php deleted file mode 100644 index 418a5e7f2..000000000 --- a/manual/docs/Working with objects - Component overview - Connection - Available drivers.php +++ /dev/null @@ -1,12 +0,0 @@ -Doctrine has drivers for every PDO-supported database. The supported databases are: - -* FreeTDS / Microsoft SQL Server / Sybase -* Firebird/Interbase 6 -* Informix -* Mysql -* Oracle -* Odbc -* PostgreSQL -* Sqlite - - diff --git a/manual/docs/Working with objects - Component overview - Connection - Availible drivers.php b/manual/docs/Working with objects - Component overview - Connection - Availible drivers.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Working with objects - Component overview - Connection - Availible drivers.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Working with objects - Component overview - Connection - Flushing the connection.php b/manual/docs/Working with objects - Component overview - Connection - Flushing the connection.php deleted file mode 100644 index 3df54049d..000000000 --- a/manual/docs/Working with objects - Component overview - Connection - Flushing the connection.php +++ /dev/null @@ -1,14 +0,0 @@ -Creating new record (database row) is very easy. You can either use the Doctrine_Connection::create() or Doctrine_Table::create() -method to do this or just simple use the new operator. - - -$user = new User(); -$user->name = 'Jack'; - -$group = $conn->create('Group'); -$group->name = 'Drinking Club'; - -// saves all the changed objects into database - -$conn->flush(); - diff --git a/manual/docs/Working with objects - Component overview - Connection - Getting a table object.php b/manual/docs/Working with objects - Component overview - Connection - Getting a table object.php deleted file mode 100644 index 36fbf92b7..000000000 --- a/manual/docs/Working with objects - Component overview - Connection - Getting a table object.php +++ /dev/null @@ -1,13 +0,0 @@ -In order to get table object for specified record just call Doctrine_Record::getTable() or Doctrine_Connection::getTable(). - - -$manager = Doctrine_Manager::getInstance(); - -// open new connection - -$conn = $manager->openConnection(new PDO('dsn','username','password')); - -// getting a table object - -$table = $conn->getTable('User'); - diff --git a/manual/docs/Working with objects - Component overview - Connection - Getting connection state.php b/manual/docs/Working with objects - Component overview - Connection - Getting connection state.php deleted file mode 100644 index 11d41ad4b..000000000 --- a/manual/docs/Working with objects - Component overview - Connection - Getting connection state.php +++ /dev/null @@ -1,19 +0,0 @@ -Connection state gives you information about how active connection currently is. You can get the current state -by calling Doctrine_Connection::getState(). - - -switch($conn->getState()): - case Doctrine_Connection::STATE_ACTIVE: - // connection open and zero open transactions - break; - case Doctrine_Connection::STATE_ACTIVE: - // one open transaction - break; - case Doctrine_Connection::STATE_BUSY: - // multiple open transactions - break; - case Doctrine_Connection::STATE_CLOSED: - // connection closed - break; -endswitch; - diff --git a/manual/docs/Working with objects - Component overview - Connection - Introduction.php b/manual/docs/Working with objects - Component overview - Connection - Introduction.php deleted file mode 100644 index 2fcdce335..000000000 --- a/manual/docs/Working with objects - Component overview - Connection - Introduction.php +++ /dev/null @@ -1,22 +0,0 @@ -Doctrine_Connection is a wrapper for database connection. It handles several things: - -* Handles database portability things missing from PDO (eg. LIMIT / OFFSET emulation) - -* Keeps track of Doctrine_Table objects - -* Keeps track of records - -* Keeps track of records that need to be updated / inserted / deleted - -* Handles transactions and transaction nesting - -* Handles the actual querying of the database in the case of INSERT / UPDATE / DELETE operations - -* Can query the database using the DQL API (see Doctrine_Query) - -* Optionally validates transactions using Doctrine_Validator and gives -full information of possible errors. - - - - diff --git a/manual/docs/Working with objects - Component overview - Connection - Querying the database.php b/manual/docs/Working with objects - Component overview - Connection - Querying the database.php deleted file mode 100644 index d0a6a16cd..000000000 --- a/manual/docs/Working with objects - Component overview - Connection - Querying the database.php +++ /dev/null @@ -1,16 +0,0 @@ -Doctrine_Connection::query() is a simple method for efficient object retrieval. It takes one parameter (DQL query) and optionally prepared statement params. - - - -// select all users - -$users = $conn->query('FROM User'); - -// select all users where user email is jackdaniels@drinkmore.info - -$users = $conn->query("FROM User WHERE User.Email.address = 'jackdaniels@drinkmore.info'"); - -// using prepared statements - -$users = $conn->query('FROM User WHERE User.name = ?', array('Jack')); - diff --git a/manual/docs/Working with objects - Component overview - Db - Chaining listeners.php b/manual/docs/Working with objects - Component overview - Db - Chaining listeners.php deleted file mode 100644 index 26c0f08b6..000000000 --- a/manual/docs/Working with objects - Component overview - Db - Chaining listeners.php +++ /dev/null @@ -1,46 +0,0 @@ -Doctrine_Db supports event listener chaining. It means multiple listeners can be attached for -listening the events of a single instance of Doctrine_Db. - - - -For example you might want to add different aspects to your Doctrine_Db instance on-demand. These aspects may include -caching, query profiling etc. - - - - - - - -// using PDO dsn for connecting sqlite memory table - -$dbh = Doctrine_Db::getConnection('sqlite::memory:'); - -class Counter extends Doctrine_Db_EventListener { - private $queries = 0; - - public function onQuery(Doctrine_Db_Event $event) { - $this->queries++; - } - public function count() { - return count($this->queries); - } -} -class OutputLogger extends Doctrine_Overloadable { - public function __call($m, $a) { - print $m." called!"; - } -} -$counter = new Counter(); - -$dbh->addListener($counter); -$dbh->addListener(new OutputLogger()); - -$dbh->query("SELECT * FROM foo"); -// prints: -// onPreQuery called! -// onQuery called! - -print $counter->count(); // 1 - - diff --git a/manual/docs/Working with objects - Component overview - Db - Connecting to a database.php b/manual/docs/Working with objects - Component overview - Db - Connecting to a database.php deleted file mode 100644 index 6943796fc..000000000 --- a/manual/docs/Working with objects - Component overview - Db - Connecting to a database.php +++ /dev/null @@ -1,73 +0,0 @@ - -Doctrine_Db allows both PEAR-like DSN (data source name) as well as PDO like DSN as constructor parameters. - - - -Getting an instance of Doctrine_Db using PEAR-like DSN: - - - -"; -renderCode($str); -?> - - - -Getting an instance of Doctrine_Db using PDO-like DSN (PDO mysql driver): - - - -"; -renderCode($str); -?> - - - -Getting an instance of Doctrine_Db using PDO-like DSN (PDO sqlite with memory tables): - - - -"; -renderCode($str); -?> - - - - -Handling connection errors: - -query('SELECT * FROM foo') as \$row) { - print_r(\$row); - } - \$dbh = null; -} catch (PDOException \$e) { - print 'Error!: ' . \$e->getMessage() . ' -'; - die(); -} -?>"; -renderCode($str); -?> - - diff --git a/manual/docs/Working with objects - Component overview - Db - Introduction.php b/manual/docs/Working with objects - Component overview - Db - Introduction.php deleted file mode 100644 index 3d9a63531..000000000 --- a/manual/docs/Working with objects - Component overview - Db - Introduction.php +++ /dev/null @@ -1,19 +0,0 @@ -Doctrine_Db is a wrapper for PDO database object. Why should you consider using Doctrine_Db instead of PDO? - - - -1. It provides efficient eventlistener architecture, hence its easy to add new aspects to existing methods like on-demand-caching - - - -2. Doctrine_Db lazy-connects database. Creating an instance of Doctrine_Db doesn't directly connect database, hence -Doctrine_Db fits perfectly for application using for example page caching. - - - -3. It has many short cuts for commonly used fetching methods like Doctrine_Db::fetchOne(). - - - -4. Supports PEAR-like data source names as well as PDO data source names. - diff --git a/manual/docs/Working with objects - Component overview - Db - Using event listeners.php b/manual/docs/Working with objects - Component overview - Db - Using event listeners.php deleted file mode 100644 index 26b0b52ff..000000000 --- a/manual/docs/Working with objects - Component overview - Db - Using event listeners.php +++ /dev/null @@ -1,88 +0,0 @@ - -Doctrine_Db has a pluggable event listener architecture. It provides before and after -listeners for all relevant methods. Every listener method takes one parameter: a Doctrine_Db_Event object, which -holds info about the occurred event. - - - -Every listener object must either implement the Doctrine_Db_EventListener_Interface or Doctrine_Overloadable interface. -Using Doctrine_Overloadable interface -only requires you to implement __call() which is then used for listening all the events. - - -"; -renderCode($str); -?> - - - -For convience -you may want to make your listener class extend Doctrine_Db_EventListener which has empty listener methods, hence allowing you not to define -all the listener methods by hand. The following listener, 'MyLogger', is used for listening only onPreQuery and onQuery methods. - - -getQuery(); - } -} -?>"; -renderCode($str); -?> - - - -Now the next thing we need to do is bind the eventlistener objects to our database handler. - - - - - - -// using PDO dsn for connecting sqlite memory table - -$dbh = Doctrine_Db::getConnection('sqlite::memory:'); - -class MyLogger extends Doctrine_Db_EventListener { - public function onPreQuery(Doctrine_Db_Event $event) { - print "database is going to be queried!"; - } - public function onQuery(Doctrine_Db_Event $event) { - print "executed: " . $event->getQuery(); - } -} - -$dbh->setListener(new MyLogger()); - -$dbh->query("SELECT * FROM foo"); -// prints: -// database is going to be queried -// executed: SELECT * FROM foo - - -class MyLogger2 extends Doctrine_Overloadable { - public function __call($m, $a) { - print $m." called!"; - } -} - -$dbh->setListener(new MyLogger2()); - -$dbh->exec("DELETE FROM foo"); -// prints: -// onPreExec called! -// onExec called! - diff --git a/manual/docs/Working with objects - Component overview - Exceptions - List of exceptions.php b/manual/docs/Working with objects - Component overview - Exceptions - List of exceptions.php deleted file mode 100644 index cefd6b053..000000000 --- a/manual/docs/Working with objects - Component overview - Exceptions - List of exceptions.php +++ /dev/null @@ -1,25 +0,0 @@ -
    -InvalidKeyException
    -
    -Doctrine_Exception
    -
    -DQLException
    -
    -Doctrine_PrimaryKey_Exception          thrown when Doctrine_Record is loaded and there is no primary key field
    -
    -Doctrine_Refresh_Exception             thrown when Doctrine_Record is refreshed and the refreshed primary key doens't match the old one
    -
    -Doctrine_Find_Exception                thrown when user tries to find a Doctrine_Record for given primary key and that object is not found
    -
    -Doctrine_Naming_Exception              thrown when user defined Doctrine_Table is badly named
    -
    -
    -Doctrine_Connection_Exception             thrown when user tries to get the current
    -                                       connection and there are no open connections
    -
    -Doctrine_Table_Exception               thrown when user tries to initialize a new instance of Doctrine_Table,
    -                                       while there already exists an instance of that factory
    -
    -Doctrine_Mapping_Exception             thrown when user tries to get a foreign key object but the mapping is not done right
    -
    - diff --git a/manual/docs/Working with objects - Component overview - Exceptions - Overview.php b/manual/docs/Working with objects - Component overview - Exceptions - Overview.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Working with objects - Component overview - Exceptions - Overview.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Working with objects - Component overview - Manager - Introduction.php b/manual/docs/Working with objects - Component overview - Manager - Introduction.php deleted file mode 100644 index d89222fc1..000000000 --- a/manual/docs/Working with objects - Component overview - Manager - Introduction.php +++ /dev/null @@ -1,2 +0,0 @@ -Doctrine_Manager is the heart of every Doctrine based application. Doctrine_Manager handles all connections (database connections). - diff --git a/manual/docs/Working with objects - Component overview - Manager - Managing connections.php b/manual/docs/Working with objects - Component overview - Manager - Managing connections.php deleted file mode 100644 index 89c0dcfde..000000000 --- a/manual/docs/Working with objects - Component overview - Manager - Managing connections.php +++ /dev/null @@ -1,29 +0,0 @@ -Switching between connections in Doctrine is very easy, you just call Doctrine_Manager::setCurrentConnection() method. -You can access the connection by calling Doctrine_Manager::getConnection() or Doctrine_Manager::getCurrentConnection() if you only -want to get the current connection. - - -// Doctrine_Manager controls all the connections - -$manager = Doctrine_Manager::getInstance(); - -// open first connection - -$conn = $manager->openConnection(new PDO('dsn','username','password'), 'connection 1'); - -// open second connection - -$conn2 = $manager->openConnection(new PDO('dsn2','username2','password2'), 'connection 2'); - -$manager->getCurrentConnection(); // $conn2 - -$manager->setCurrentConnection('connection 1'); - -$manager->getCurrentConnection(); // $conn - -// iterating through connections - -foreach($manager as $conn) { - -} - diff --git a/manual/docs/Working with objects - Component overview - Manager - Opening a new connection.php b/manual/docs/Working with objects - Component overview - Manager - Opening a new connection.php deleted file mode 100644 index 22a1a7e41..000000000 --- a/manual/docs/Working with objects - Component overview - Manager - Opening a new connection.php +++ /dev/null @@ -1,22 +0,0 @@ -In order to get your first application started you first -need to get an instance of Doctrine_Manager which handles all the connections (database connections). -The second thing to do is to open a new connection. - - -// Doctrine_Manager controls all the connections - -$manager = Doctrine_Manager::getInstance(); - -// Doctrine_Connection -// a script may have multiple open connections -// (= multiple database connections) -$dbh = new PDO('dsn','username','password'); -$conn = $manager->openConnection(); - -// or if you want to use Doctrine Doctrine_Db and its -// performance monitoring capabilities - -$dsn = 'schema://username:password@dsn/dbname'; -$dbh = Doctrine_Db::getConnection($dsn); -$conn = $manager->openConnection(); - diff --git a/manual/docs/Working with objects - Component overview - Query - Aggregate functions.php b/manual/docs/Working with objects - Component overview - Query - Aggregate functions.php deleted file mode 100644 index b5db6f348..000000000 --- a/manual/docs/Working with objects - Component overview - Query - Aggregate functions.php +++ /dev/null @@ -1,16 +0,0 @@ - - -$q = new Doctrine_Query(); - -$q->from('User(COUNT(id))'); - -// returns an array -$a = $q->execute(); - -// selecting multiple aggregate values: -$q = new Doctrine_Query(); - -$q->from('User(COUNT(id)).Phonenumber(MAX(phonenumber))'); - -$a = $q->execute(); - diff --git a/manual/docs/Working with objects - Component overview - Query - Bound parameters.php b/manual/docs/Working with objects - Component overview - Query - Bound parameters.php deleted file mode 100644 index 1985b8f04..000000000 --- a/manual/docs/Working with objects - Component overview - Query - Bound parameters.php +++ /dev/null @@ -1,7 +0,0 @@ - - -$query->from("User") - ->where("User.name = ?"); - -$query->execute(array('Jack Daniels')); - diff --git a/manual/docs/Working with objects - Component overview - Query - DQL - SQL conversion.php b/manual/docs/Working with objects - Component overview - Query - DQL - SQL conversion.php deleted file mode 100644 index e68c79aed..000000000 --- a/manual/docs/Working with objects - Component overview - Query - DQL - SQL conversion.php +++ /dev/null @@ -1,63 +0,0 @@ -**SELECT**",$line); - $l = str_replace("FROM"," -**FROM**",$l); - $l = str_replace("LEFT JOIN"," -**LEFT JOIN**",$l); - $l = str_replace("INNER JOIN"," -**INNER JOIN**",$l); - $l = str_replace("WHERE"," -**WHERE**",$l); - $l = str_replace("AS","**AS**",$l); - $l = str_replace("ON","**ON**",$l); - $l = str_replace("ORDER BY","**ORDER BY**",$l); - $l = str_replace("LIMIT","**LIMIT**",$l); - $l = str_replace("OFFSET","**OFFSET**",$l); - $l = str_replace("DISTINCT","**DISTINCT**",$l); - $l = str_replace(" ","
    ",$l); - - print $l."
    "; - if(substr($l,0,3) == "SQL") print "
    "; -} -} -renderQueries($str); -*/ -?> - diff --git a/manual/docs/Working with objects - Component overview - Query - FROM - selecting tables.php b/manual/docs/Working with objects - Component overview - Query - FROM - selecting tables.php deleted file mode 100644 index 4ae494d2a..000000000 --- a/manual/docs/Working with objects - Component overview - Query - FROM - selecting tables.php +++ /dev/null @@ -1,48 +0,0 @@ - -The FROM clause indicates the component or components from which to retrieve records. -If you name more than one component, you are performing a join. -For each table specified, you can optionally specify an alias. Doctrine_Query offers easy to use -methods such as from(), addFrom(), leftJoin() and innerJoin() for managing the FROM part of your DQL query. - - - - -// find all users -\$q = new Doctrine_Query(); - -\$coll = \$q->from('User')->execute(); - -// find all users with only their names (and primary keys) fetched - -\$coll = \$q->select('u.name')->('User u'); -?> - - -The following example shows how to use leftJoin and innerJoin methods: - - - - -// find all groups - -$coll = $q->from("FROM Group"); - -// find all users and user emails - -$coll = $q->from("FROM User u LEFT JOIN u.Email e"); - -// find all users and user emails with only user name and -// age + email address loaded - -$coll = $q->select('u.name, u.age, e.address') - ->from('FROM User u') - ->leftJoin('u.Email e') - ->execute(); - -// find all users, user email and user phonenumbers - -$coll = $q->from('FROM User u') - ->innerJoin('u.Email e') - ->innerJoin('u.Phonenumber p') - ->execute(); - diff --git a/manual/docs/Working with objects - Component overview - Query - Fetching strategies.php b/manual/docs/Working with objects - Component overview - Query - Fetching strategies.php deleted file mode 100644 index 5c73a8e9c..000000000 --- a/manual/docs/Working with objects - Component overview - Query - Fetching strategies.php +++ /dev/null @@ -1,26 +0,0 @@ - - -// select all users and load the data directly (Immediate fetching strategy) - -$coll = $conn->query("FROM User-I"); - -// or - -$coll = $conn->query("FROM User-IMMEDIATE"); - -// select all users and load the data in batches - -$coll = $conn->query("FROM User-B"); - -// or - -$coll = $conn->query("FROM User-BATCH"); - -// select all user and use lazy fetching - -$coll = $conn->query("FROM User-L"); - -// or - -$coll = $conn->query("FROM User-LAZY"); - diff --git a/manual/docs/Working with objects - Component overview - Query - HAVING conditions.php b/manual/docs/Working with objects - Component overview - Query - HAVING conditions.php deleted file mode 100644 index e66ae467a..000000000 --- a/manual/docs/Working with objects - Component overview - Query - HAVING conditions.php +++ /dev/null @@ -1,17 +0,0 @@ - -Doctrine_Query provides having() method for adding HAVING conditions to the DQL query. This method is identical in function to the Doctrine_Query::where() method. - - - -If you call having() multiple times, the conditions are ANDed together; if you want to OR a condition, use orHaving(). - - - -\$q = new Doctrine_Query(); - -\$users = \$q->select('u.name') - ->from('User u') - ->leftJoin('u.Phonenumber p'); - ->having('COUNT(p.id) > 3'); -?> - diff --git a/manual/docs/Working with objects - Component overview - Query - Introduction.php b/manual/docs/Working with objects - Component overview - Query - Introduction.php deleted file mode 100644 index 5fbecf564..000000000 --- a/manual/docs/Working with objects - Component overview - Query - Introduction.php +++ /dev/null @@ -1,24 +0,0 @@ - -DQL (Doctrine Query Language) is a object query language which allows -you to find objects. DQL understands things like object relationships, polymorphism and -inheritance (including column aggregation inheritance). -For more info about DQL see the actual DQL chapter. - - - -Doctrine_Query along with Doctrine_Expression provide an easy-to-use wrapper for writing DQL queries. Creating a new -query object can be done by either using the new operator or by calling create method. The create method exists for allowing easy -method call chaining. - - -// initalizing a new Doctrine_Query (using the current connection) -$q = new Doctrine_Query(); - -// initalizing a new Doctrine_Query (using custom connection parameter) -// here $conn is an instance of Doctrine_Connection -$q = new Doctrine_Query($conn); - -// an example using the create method -// here we simple fetch all users -$users = new Doctrine_Query::create()->from('User')->execute(); - diff --git a/manual/docs/Working with objects - Component overview - Query - LIMIT and OFFSET - limiting the query results.php b/manual/docs/Working with objects - Component overview - Query - LIMIT and OFFSET - limiting the query results.php deleted file mode 100644 index 34e42ab3e..000000000 --- a/manual/docs/Working with objects - Component overview - Query - LIMIT and OFFSET - limiting the query results.php +++ /dev/null @@ -1,14 +0,0 @@ - - - -// find the first ten users and associated emails - -$q = new Doctrine_Query(); - -$coll = $q->from('User u LEFT JOIN u.Email e')->limit(10); - -// find the first ten users starting from the user number 5 - -$coll = $q->from('User u')->limit(10)->offset(5); - - diff --git a/manual/docs/Working with objects - Component overview - Query - Lazy property fetching.php b/manual/docs/Working with objects - Component overview - Query - Lazy property fetching.php deleted file mode 100644 index 777285716..000000000 --- a/manual/docs/Working with objects - Component overview - Query - Lazy property fetching.php +++ /dev/null @@ -1,7 +0,0 @@ - - - -// retrieve all users with only their properties id and name loaded - -$users = $conn->query("FROM User(id, name)"); - diff --git a/manual/docs/Working with objects - Component overview - Query - Method overloading.php b/manual/docs/Working with objects - Component overview - Query - Method overloading.php deleted file mode 100644 index ac9a8f05f..000000000 --- a/manual/docs/Working with objects - Component overview - Query - Method overloading.php +++ /dev/null @@ -1,22 +0,0 @@ -You can overload the query object by calling the dql query parts as methods. - - -$conn = Doctrine_Manager::getInstance()->openConnection(new PDO("dsn","username","password")); - -$query = new Doctrine_Query($conn); - -$query->from("User-b") - ->where("User.name LIKE 'Jack%'") - ->orderby("User.created") - ->limit(5); - -$users = $query->execute(); - -$query->from("User.Group.Phonenumber") - ->where("User.Group.name LIKE 'Actors%'") - ->orderby("User.name") - ->limit(10) - ->offset(5); - -$users = $query->execute(); - diff --git a/manual/docs/Working with objects - Component overview - Query - ORDER BY - sorting query results.php b/manual/docs/Working with objects - Component overview - Query - ORDER BY - sorting query results.php deleted file mode 100644 index 8cd3016d4..000000000 --- a/manual/docs/Working with objects - Component overview - Query - ORDER BY - sorting query results.php +++ /dev/null @@ -1,25 +0,0 @@ -ORDER BY - part works in much same way as SQL ORDER BY. - - -$q = new Doctrine_Query(); - -// find all users, sort by name descending - -$users = $q->from('User u')->orderby('u.name DESC'); - -// find all users sort by name ascending - -$users = $q->from('User u')->orderby('u.name ASC'); - -// find all users and their emails, sort by email address in ascending order - -$users = $q->from('User u')->leftJoin('u.Email e')->orderby('e.address'); - -// find all users and their emails, sort by user name and email address - -$users = $q->from('User u')->leftJoin('u.Email e') - ->addOrderby('u.name')->addOrderby('e.address'); - -// grab randomly 10 users -$users = $q->select('u.*, RAND() rand')->from('User u')->limit(10)->orderby('rand DESC'); - diff --git a/manual/docs/Working with objects - Component overview - Query - Relation operators.php b/manual/docs/Working with objects - Component overview - Query - Relation operators.php deleted file mode 100644 index 6886e3ad0..000000000 --- a/manual/docs/Working with objects - Component overview - Query - Relation operators.php +++ /dev/null @@ -1,27 +0,0 @@ -Doctrine provides two relation operators: '.' aka dot and ':' aka colon. - - - -The dot-operator is used for SQL LEFT JOINs and the colon-operator is used -for SQL INNER JOINs. Basically you should use dot operator if you want for example -to select all users and their phonenumbers AND it doesn't matter if the users actually have any phonenumbers. - - - -On the other hand if you want to select only the users which actually have phonenumbers you should use the colon-operator. - - -$query->from('User u')->innerJoin('u.Email e'); - -$query->execute(); - -// executed SQL query: -// SELECT ... FROM user INNER JOIN email ON ... - -$query->from('User u')->leftJoin('u.Email e'); - -$query->execute(); - -// executed SQL query: -// SELECT ... FROM user LEFT JOIN email ON ... - diff --git a/manual/docs/Working with objects - Component overview - Query - WHERE - setting query conditions.php b/manual/docs/Working with objects - Component overview - Query - WHERE - setting query conditions.php deleted file mode 100644 index 5974ddccf..000000000 --- a/manual/docs/Working with objects - Component overview - Query - WHERE - setting query conditions.php +++ /dev/null @@ -1,63 +0,0 @@ - -The WHERE clause, if given, indicates the condition or conditions that the records must satisfy to be selected. - -Doctrine_Query provides easy to use WHERE -part management methods where and addWhere. The where methods always overrides -the query WHERE -part whereas addWhere adds new condition to the WHERE -part stack. - - - -// find all groups where the group primary key is bigger than 10 - -\$coll = \$q->from('Group')->where('Group.id > 10'); - -// the same query using Doctrine_Expression component -\$e = \$q->expr; -\$coll = \$q->from('Group')->where(\$e->gt('Group.id', 10)); -?> - - - -Using regular expression operator: - - - -// find all users where users where user name matches -// a regular expression, regular expressions must be -// supported by the underlying database - -\$coll = \$conn->query(\"FROM User WHERE User.name REGEXP '[ad]'\ - - - -DQL has support for portable LIKE operator: - - - -// find all users and their associated emails -// where SOME of the users phonenumbers -// (the association between user and phonenumber -// tables is One-To-Many) starts with 123 - -\$coll = \$q->select('u.*, e.*') - ->from('User u LEFT JOIN u.Email e LEFT JOIN u.Phonenumber p') - ->where(\"p.phonenumber LIKE '123%'\ - - - -Using multiple conditions and condition nesting are also possible: - - - -// multiple conditions - -\$coll = \$q->select('u.*') - ->from('User u LEFT JOIN u.Email e') - ->where(\"u.name LIKE '%Jack%' AND e.address LIKE '%@drinkmore.info'\"); - -// nesting conditions - -\$coll = \$q->select('u.*') - ->from('User u LEFT JOIN u.Email e') - ->where(\"u.name LIKE '%Jack%' OR u.name LIKE '%John%') AND e.address LIKE '%@drinkmore.info'\
    - - diff --git a/manual/docs/Working with objects - Component overview - RawSql - Adding components.php b/manual/docs/Working with objects - Component overview - RawSql - Adding components.php deleted file mode 100644 index cfd8abbd5..000000000 --- a/manual/docs/Working with objects - Component overview - RawSql - Adding components.php +++ /dev/null @@ -1,24 +0,0 @@ -The following example represents a bit harder case where we select all entities and their associated phonenumbers using a left join. Again we -wrap all the columns in curly brackets but we also specify what tables associate to which components. - - - -First we specify that table entity maps to record class 'Entity' - - - -Then we specify that table phonenumber maps to Entity.Phonenumber (meaning phonenumber associated with an entity) - - -$query = new Doctrine_RawSql($conn); - -$query->parseQuery("SELECT {entity.*}, {phonenumber.*} - FROM entity - LEFT JOIN phonenumber - ON phonenumber.entity_id = entity.id"); - -$query->addComponent("entity", "Entity"); -$query->addComponent("phonenumber", "Entity.Phonenumber"); - -$entities = $query->execute(); - diff --git a/manual/docs/Working with objects - Component overview - RawSql - Introduction.php b/manual/docs/Working with objects - Component overview - RawSql - Introduction.php deleted file mode 100644 index 119940f3a..000000000 --- a/manual/docs/Working with objects - Component overview - RawSql - Introduction.php +++ /dev/null @@ -1,7 +0,0 @@ -In Doctrine you may express your queries in the native SQL dialect of your database. -This is useful if you want to use the full power of your database vendor's features (like query hints or the CONNECT keyword in Oracle). - - - -It should be noted that not all the sql is portable. So when you make database portable applications you might want to use the DQL API instead. - diff --git a/manual/docs/Working with objects - Component overview - RawSql - Method overloading.php b/manual/docs/Working with objects - Component overview - RawSql - Method overloading.php deleted file mode 100644 index 3e998ebed..000000000 --- a/manual/docs/Working with objects - Component overview - RawSql - Method overloading.php +++ /dev/null @@ -1,11 +0,0 @@ - - -$query = new Doctrine_RawSql($conn); - -$query->select('{entity.name}') - ->from('entity'); - -$query->addComponent("entity", "User"); - -$coll = $query->execute(); - diff --git a/manual/docs/Working with objects - Component overview - RawSql - Using SQL.php b/manual/docs/Working with objects - Component overview - RawSql - Using SQL.php deleted file mode 100644 index 350dfcf36..000000000 --- a/manual/docs/Working with objects - Component overview - RawSql - Using SQL.php +++ /dev/null @@ -1,24 +0,0 @@ -The rawSql component works in much same way as Zend_Db_Select. You may use method overloading like $q->from()->where() or just use -$q->parseQuery(). There are some differences though: - - - -1. In Doctrine_RawSql component you need to specify all the mapped table columns in curly brackets {} this is used for smart column aliasing. - - - -2. When joining multiple tables you need to specify the component paths with addComponent() method - - - -The following example represents a very simple case where no addComponent() calls are needed. -Here we select all entities from table entity with all the columns loaded in the records. - - - -$query = new Doctrine_RawSql($conn); - -$query->parseQuery("SELECT {entity.name} FROM entity"); - -$entities = $query->execute(); - diff --git a/manual/docs/Working with objects - Component overview - Record - Accessing properties.php b/manual/docs/Working with objects - Component overview - Record - Accessing properties.php deleted file mode 100644 index 0e9f4f2cb..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Accessing properties.php +++ /dev/null @@ -1,25 +0,0 @@ -You can retrieve existing objects (database rows) with Doctrine_Table or Doctrine_Connection. -Doctrine_Table provides simple methods like findBySql, findAll and find for finding objects whereas -Doctrine_Connection provides complete OQL API for retrieving objects (see chapter 9). - - -$user = $table->find(3); - -// access property through overloading - -$name = $user->name; - -// access property with get() - -$name = $user->get("name"); - -// access property with ArrayAccess interface - -$name = $user['name']; - -// iterating through properties - -foreach($user as $key => $value) { - -} - diff --git a/manual/docs/Working with objects - Component overview - Record - Adding records.php b/manual/docs/Working with objects - Component overview - Record - Adding records.php deleted file mode 100644 index 074911bcc..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Adding records.php +++ /dev/null @@ -1,3 +0,0 @@ -There are three possible ways to access the properties of a record (fields of database row). -You can use overloading, ArrayAccess interface or simply Doctrine_Record::get() method. -**Doctrine_Record objects have always all properties in lowercase**. diff --git a/manual/docs/Working with objects - Component overview - Record - Callbacks.php b/manual/docs/Working with objects - Component overview - Record - Callbacks.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Callbacks.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Working with objects - Component overview - Record - Checking Existence.php b/manual/docs/Working with objects - Component overview - Record - Checking Existence.php deleted file mode 100644 index 3048d6392..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Checking Existence.php +++ /dev/null @@ -1,11 +0,0 @@ - - -$record = new User(); - -$record->exists(); // false - -$record->name = 'someone'; -$record->save(); - -$record->exists(); // true - diff --git a/manual/docs/Working with objects - Component overview - Record - Creating new records.php b/manual/docs/Working with objects - Component overview - Record - Creating new records.php deleted file mode 100644 index 493eff574..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Creating new records.php +++ /dev/null @@ -1,24 +0,0 @@ -There are couple of ways for creating new records. Propably the easiest is using -native php new -operator. The other ways are calling Doctrine_Table::create() or Doctrine_Connection::create(). -The last two exists only for backward compatibility. The recommended way of creating new objects is the new operator. - - -$user = $conn->create("User"); - -// alternative way: - -$table = $conn->getTable("User"); - -$user = $table->create(); - -// the simpliest way: - -$user = new User(); - - -// records support array access -$user["name"] = "John Locke"; - -// save user into database -$user->save(); - diff --git a/manual/docs/Working with objects - Component overview - Record - Deleting records.php b/manual/docs/Working with objects - Component overview - Record - Deleting records.php deleted file mode 100644 index a3aa602be..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Deleting records.php +++ /dev/null @@ -1,19 +0,0 @@ -Deleting records in Doctrine is handled by Doctrine_Record::delete(), Doctrine_Collection::delete() and -Doctrine_Connection::delete() methods. - - -$table = $conn->getTable("User"); - -$user = $table->find(2); - -// deletes user and all related composite objects -if($user !== false) - $user->delete(); - - -$users = $table->findAll(); - - -// delete all users and their related composite objects -$users->delete(); - diff --git a/manual/docs/Working with objects - Component overview - Record - Getting object copy.php b/manual/docs/Working with objects - Component overview - Record - Getting object copy.php deleted file mode 100644 index a5243e670..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Getting object copy.php +++ /dev/null @@ -1,6 +0,0 @@ -Sometimes you may want to get a copy of your object (a new object with all properties copied). -Doctrine provides a simple method for this: Doctrine_Record::copy(). - - -$copy = $user->copy(); - diff --git a/manual/docs/Working with objects - Component overview - Record - Getting record state.php b/manual/docs/Working with objects - Component overview - Record - Getting record state.php deleted file mode 100644 index c4b7a1c9d..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Getting record state.php +++ /dev/null @@ -1,39 +0,0 @@ -Every Doctrine_Record has a state. First of all record can be transient or persistent. -Every record that is retrieved from database is persistent and every newly created record is transient. -If a Doctrine_Record is retrieved from database but the only loaded property is its primary key, then this record -has a state called proxy. - -Every transient and persistent Doctrine_Record is either clean or dirty. Doctrine_Record is clean when none of its properties are changed and -dirty when atleast one of its properties has changed. - - -$state = $record->state(); - -switch($state): - case Doctrine_Record::STATE_PROXY: - // record is in proxy state, - // meaning its persistent but not all of its properties are - // loaded from the database - break; - case Doctrine_Record::STATE_TCLEAN: - // record is transient clean, - // meaning its transient and - // none of its properties are changed - break; - case Doctrine_Record::STATE_TDIRTY: - // record is transient dirty, - // meaning its transient and - // some of its properties are changed - break; - case Doctrine_Record::STATE_DIRTY: - // record is dirty, - // meaning its persistent and - // some of its properties are changed - break; - case Doctrine_Record::STATE_CLEAN: - // record is clean, - // meaning its persistent and - // none of its properties are changed - break; -endswitch; - diff --git a/manual/docs/Working with objects - Component overview - Record - Introduction.php b/manual/docs/Working with objects - Component overview - Record - Introduction.php deleted file mode 100644 index f31c7cd73..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Introduction.php +++ /dev/null @@ -1,7 +0,0 @@ -Doctrine_Record is a wrapper for database row but along with that it speficies what relations it has -on other components and what columns it has. It may access the related components, hence its refered as an ActiveRecord. - - - -The classes that inherit Doctrine_Record are called components. There should be atleast one component for each database table. - diff --git a/manual/docs/Working with objects - Component overview - Record - Retrieving existing records.php b/manual/docs/Working with objects - Component overview - Record - Retrieving existing records.php deleted file mode 100644 index 00b7b6a3f..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Retrieving existing records.php +++ /dev/null @@ -1,27 +0,0 @@ -Doctrine provides many ways for record retrieval. The fastest ways for retrieving existing records -are the finder methods provided by Doctrine_Table. If you need to use more complex queries take a look at -DQL API and Doctrine_Connection::query method. - - -$table = $conn->getTable("User"); - -// find by primary key - -$user = $table->find(2); -if($user !== false) - print $user->name; - -// get all users -foreach($table->findAll() as $user) { - print $user->name; -} - -// finding by dql -foreach($table->findByDql("name LIKE '%John%'") as $user) { - print $user->created; -} - -// finding objects with DQL - -$users = $conn->query("FROM User WHERE User.name LIKE '%John%'"); - diff --git a/manual/docs/Working with objects - Component overview - Record - Serializing.php b/manual/docs/Working with objects - Component overview - Record - Serializing.php deleted file mode 100644 index df52c169e..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Serializing.php +++ /dev/null @@ -1,8 +0,0 @@ -Sometimes you may want to serialize your record objects (possibly for caching purposes). Records can be serialized, -but remember: Doctrine cleans all relations, before doing this. So remember to persist your objects into database before serializing them. - - -$string = serialize($user); - -$user = unserialize($string); - diff --git a/manual/docs/Working with objects - Component overview - Record - Updating records.php b/manual/docs/Working with objects - Component overview - Record - Updating records.php deleted file mode 100644 index 1b2b12def..000000000 --- a/manual/docs/Working with objects - Component overview - Record - Updating records.php +++ /dev/null @@ -1,16 +0,0 @@ -Updating objects is very easy, you just call the Doctrine_Record::save() method. The other way -(perhaps even easier) is to call Doctrine_Connection::flush() which saves all objects. It should be noted though -that flushing is a much heavier operation than just calling save method. - - -$table = $conn->getTable("User"); - - -$user = $table->find(2); - -if($user !== false) { - $user->name = "Jack Daniels"; - - $user->save(); -} - diff --git a/manual/docs/Working with objects - Component overview - Table - Custom finders.php b/manual/docs/Working with objects - Component overview - Table - Custom finders.php deleted file mode 100644 index 20c2f8816..000000000 --- a/manual/docs/Working with objects - Component overview - Table - Custom finders.php +++ /dev/null @@ -1,27 +0,0 @@ -You can add custom finder methods to your custom table object. These finder methods may use fast -Doctrine_Table finder methods or DQL API (Doctrine_Connection::query()). - - -class UserTable extends Doctrine_Table { - /** - * you can add your own finder methods here - */ - public function findByName($name) { - return $this->getConnection()->query("FROM User WHERE name LIKE '%$name%'"); - } -} -class User extends Doctrine_Record { } - -$conn = Doctrine_Manager::getInstance() - ->openConnection(new PDO("dsn","username","password")); - -// doctrine will now check if a class called UserTable exists -// and if it inherits Doctrine_Table - -$table = $conn->getTable("User"); - -print get_class($table); // UserTable - -$users = $table->findByName("Jack"); - - diff --git a/manual/docs/Working with objects - Component overview - Table - Custom table classes.php b/manual/docs/Working with objects - Component overview - Table - Custom table classes.php deleted file mode 100644 index 642a5d6b0..000000000 --- a/manual/docs/Working with objects - Component overview - Table - Custom table classes.php +++ /dev/null @@ -1,16 +0,0 @@ -Adding custom table classes is very easy. Only thing you need to do is name the classes as [componentName]Table and make them -inherit Doctrine_Table. - - - -// valid table object - -class UserTable extends Doctrine_Table { - -} - -// not valid [doesn't extend Doctrine_Table] -class GroupTable { } - - - diff --git a/manual/docs/Working with objects - Component overview - Table - Finder methods.php b/manual/docs/Working with objects - Component overview - Table - Finder methods.php deleted file mode 100644 index 2da4ab063..000000000 --- a/manual/docs/Working with objects - Component overview - Table - Finder methods.php +++ /dev/null @@ -1,24 +0,0 @@ -Doctrine_Table provides basic finder methods. These finder methods are very fast and should be used if you only need to fetch -data from one database table. If you need queries that use several components (database tables) use Doctrine_Connection::query(). - - -$table = $conn->getTable("User"); - -// find by primary key - -$user = $table->find(2); - -if($user !== false) - print $user->name; - - -// get all users -foreach($table->findAll() as $user) { - print $user->name; -} - -// finding by dql -foreach($table->findByDql("name LIKE '%John%'") as $user) { - print $user->created; -} - diff --git a/manual/docs/Working with objects - Component overview - Table - Getting relation objects.php b/manual/docs/Working with objects - Component overview - Table - Getting relation objects.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Working with objects - Component overview - Table - Getting relation objects.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Working with objects - Component overview - Table - Getting table information.php b/manual/docs/Working with objects - Component overview - Table - Getting table information.php deleted file mode 100644 index 3040b728b..000000000 --- a/manual/docs/Working with objects - Component overview - Table - Getting table information.php +++ /dev/null @@ -1,12 +0,0 @@ - - -$table = $conn->getTable('User'); - -// getting column names - -$names = $table->getColumnNames(); - -// getting column information - -$columns = $table->getColumns(); - diff --git a/manual/docs/Working with objects - Component overview - Table - Introduction.php b/manual/docs/Working with objects - Component overview - Table - Introduction.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Working with objects - Component overview - Table - Introduction.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/docs/Working with objects - Dealing with relations - Creating related records.php b/manual/docs/Working with objects - Dealing with relations - Creating related records.php deleted file mode 100644 index 8ba796e49..000000000 --- a/manual/docs/Working with objects - Dealing with relations - Creating related records.php +++ /dev/null @@ -1,16 +0,0 @@ -When accessing related records and if those records do not exists Doctrine automatically creates new records. - - -// NOTE: related record have always the first letter in uppercase -$email = $user->Email; - -$email->address = 'jackdaniels@drinkmore.info'; - -$user->save(); - -// alternative: - -$user->Email->address = 'jackdaniels@drinkmore.info'; - -$user->save(); - diff --git a/manual/docs/Working with objects - Dealing with relations - Deleting related records.php b/manual/docs/Working with objects - Dealing with relations - Deleting related records.php deleted file mode 100644 index 6db69eb99..000000000 --- a/manual/docs/Working with objects - Dealing with relations - Deleting related records.php +++ /dev/null @@ -1,12 +0,0 @@ -You can delete related records individually be calling delete() on each record. If you want to delete a whole record graph just call -delete on the owner record. - - -$user->Email->delete(); - -$user->Phonenumber[3]->delete(); - -// deleting user and all related objects: - -$user->delete(); - diff --git a/manual/docs/Working with objects - Dealing with relations - Retrieving related records.php b/manual/docs/Working with objects - Dealing with relations - Retrieving related records.php deleted file mode 100644 index b97e04be2..000000000 --- a/manual/docs/Working with objects - Dealing with relations - Retrieving related records.php +++ /dev/null @@ -1,10 +0,0 @@ -You can retrieve related records by the very same Doctrine_Record methods you've already propably used for accessing record properties. -When accessing related record you just simply use the class names. - - -print $user->Email['address']; - -print $user->Phonenumber[0]->phonenumber; - -print $user->Group[0]->name; - diff --git a/manual/docs/Working with objects - Dealing with relations - Updating related records.php b/manual/docs/Working with objects - Dealing with relations - Updating related records.php deleted file mode 100644 index 2f02323ea..000000000 --- a/manual/docs/Working with objects - Dealing with relations - Updating related records.php +++ /dev/null @@ -1,12 +0,0 @@ -You can update the related records by calling save for each related object / collection individually or by calling -save on the object that owns the other objects. You can also call Doctrine_Connection::flush which saves all pending objects. - - -$user->Email['address'] = 'koskenkorva@drinkmore.info'; - -$user->Phonenumber[0]->phonenumber = '123123'; - -$user->save(); - -// saves the email and phonenumber - diff --git a/manual/docs/Working with objects - Dealing with relations - Working with associations.php b/manual/docs/Working with objects - Dealing with relations - Working with associations.php deleted file mode 100644 index 8b1378917..000000000 --- a/manual/docs/Working with objects - Dealing with relations - Working with associations.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/manual/documentation.php b/manual/documentation.php deleted file mode 100644 index fea07ccef..000000000 --- a/manual/documentation.php +++ /dev/null @@ -1,888 +0,0 @@ -".$t."

    \n"; - $c = ""; - - if(file_exists("docs/$e.php")) { - rename("docs/$e.php","docs/$title - $t.php"); - } - if(file_exists("docs/$t.php")) { - rename("docs/$t.php","docs/$title - $t.php"); - } - if(file_exists("docs/$title - $t.php")) { - $c = file_get_contents("docs/$title - $t.php"); - if(substr($c,0,5) == "
    "; - } - $c = ""; - if(file_exists("codes/$e.php")) { - rename("codes/$e.php","codes/$title - $t.php"); - } - if(file_exists("codes/$t.php")) { - rename("codes/$t.php","codes/$title - $t.php"); - } - if(file_exists("codes/$title - $t.php")) { - print ""; - print ""; - print "
    "; - $c = file_get_contents("codes/$title - $t.php"); - $c = trim($c); - - $h->loadString($c); - print $h->toHtml(); - print "
    "; - } - print "
    "; -} -/** - 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; - }*/ -function render_block($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); - renderCode($c); - } -} - -function renderCode($c = null) { - global $h; - if( ! empty($c)) { - - $h->loadString($c); - - print ""; - print ""; - print "
    "; - - $h->toHtml(); - print "
    "; - } -} -function array2path($array, $path = '') { - $arrayValues = array(); - - $index = 1; - foreach ($array as $k => $value) { - $p = ($path !== '')?$path.".".$index:$index; - - if (is_scalar($value) || is_resource($value)) { - $arrayValues[$p] = $value; - } elseif (is_array($value)) { - $arrayValues[$p] = $k; - $arrayValues = $arrayValues + array2path($value, $p); - } - $index++; - } - - return $arrayValues; -} -$menu = array('Getting started' => - array( - 'Requirements', - 'Installation', - 'Compiling', - 'Starting new project', - 'Setting table definition' => array( - 'Introduction', - 'Table and class naming', - 'Field(Column) naming', - 'Column aliases', - 'Table options', - 'Data types and lengths', - 'Constraints and validators', - 'Default values', - 'Enum emulation', - ), - 'Working with existing databases' => array( - 'Introduction', - 'Making the first import', - 'Import options', - ), - - 'Record identifiers' => array( - 'Introduction', - 'Autoincremented', - 'Natural', - 'Composite', - 'Sequence'), - 'Indexes' => array( - 'Introduction', - 'Adding indexes', - 'Index options', - 'Special indexes', - ), - - - ), - 'Connection management' => - array( - 'Opening a new connection', - 'Lazy-connecting to database', - 'Managing connections', - 'Connection-component binding' - ), - 'Schema reference' => - array( - 'Data types' => array( - 'Introduction', - 'Type modifiers', - 'Boolean', - 'Integer', - 'Float', - 'String', - 'Array', - 'Object', - 'Blob', - 'Clob', - 'Timestamp', - 'Time', - 'Date', - 'Enum', - 'Gzip', - ), - 'Foreign keys' => array( - 'Introduction', - ), -/** - 'Column attributes' => array( - 'Introduction', - 'Primary', - 'Autoincrement', - 'Default', - 'Zerofill', - 'Collation', - 'Charset', - 'Unsigned', - 'Fixed', - 'Enum', - 'Unique', - 'Nospace', - 'Notblank', - 'Notnull', - 'Email', - 'Date', - 'Range', - 'Numeric', - 'Regexp', - 'Ip', - 'Usstate', - ), - - 'Identifiers' => array( - 'Introduction', - 'Autoincremented', - 'Natural', - 'Composite', - 'Sequential')*/ - - ), - 'Basic Components' => - array( - 'Manager' - => array('Introduction', - 'Opening a new connection', - 'Managing connections'), - 'Record' - => array('Introduction', - 'Creating new records', - 'Retrieving existing records', - 'Accessing properties', - 'Updating records', - 'Deleting records', - 'Getting record state', - 'Getting object copy', - 'Serializing', - 'Checking Existence', - 'Callbacks'), - 'Connection' - => array('Introduction', - 'Available drivers', - 'Getting a table object', - 'Flushing the connection', - 'Querying the database', - 'Getting connection state'), - - 'Collection' - => array('Introduction', - 'Accessing elements', - 'Adding new elements', - 'Getting collection count', - 'Saving the collection', - 'Deleting collection', - //'Fetching strategies', - 'Key mapping', - 'Loading related records', - 'Collection expanding', - ), - - 'Table' => array('Introduction', - 'Getting table information', - 'Finder methods', - 'Custom table classes', - 'Custom finders', - 'Getting relation objects'), - - 'Query' => array('Introduction', - 'FROM - selecting tables', - 'LIMIT and OFFSET - limiting the query results', - 'WHERE - setting query conditions', - 'HAVING conditions', - 'ORDER BY - sorting query results', - ), - 'RawSql' => array( - 'Introduction', - 'Using SQL', - 'Adding components', - 'Method overloading'), - 'Db' => array( - 'Introduction', - 'Connecting to a database', - 'Using event listeners', - 'Chaining listeners'), - /** - 'Statement - UNDER CONSTRUCTION' => array('Introduction', - 'Setting parameters', - 'Getting parameters', - 'Getting row count', - 'Executing the statement'), - */ - 'Exceptions' => array( - 'Overview', - 'List of exceptions' - ) - ), - 'Mapping object relations' => - array( - 'Introduction', - 'Composites and aggregates', - 'Relation aliases', - 'Foreign key associations' => array( - 'One-to-One', - 'One-to-Many, Many-to-One', - 'Tree structure'), - - 'Join table associations' => array( - 'One-to-One', - 'One-to-Many, Many-to-One', - 'Many-to-Many', - 'Self-referencing'), - 'Dealing with relations' => array( - 'Creating related records', - 'Retrieving related records', - 'Updating related records', - 'Deleting related records', - 'Working with associations'), - 'Inheritance' => - array('One table many classes', - 'One table one class', - 'Column aggregation' - ), - ), - 'Hierarchical data' => array( - 'Introduction' => array( - 'About', 'Setting up', 'Node interface', 'Tree interface', 'Traversing or Walking Trees', 'Read me'), - 'Adjacency list' => array( - 'Introduction'), - 'Nested set' => array( - 'Introduction', 'Setting up', 'Tree options', 'Node support', 'Tree support', 'Read me'), - 'Materialized path' => array( - 'Introduction', - ), - 'Examples' - ), - - - 'Configuration' => - array( - 'Introduction', - 'Levels of configuration', - 'Setting attributes' => array( - 'Portability', - 'Identifier quoting', - 'Table creation', - 'Fetching strategy', - 'Batch size', - 'Session lockmode', - 'Event listener', - 'Validation', - 'Offset collection limit' - ) - ), - - - - 'Advanced components' => array( - 'Eventlisteners' => - array( - 'Introduction', - 'Creating new listener', - 'List of events', - 'Listening events', - 'Chaining', - 'AccessorInvoker', - 'Creating a logger', - ), - 'Validators' => array( - 'Introduction', - 'More Validation', - 'Valid or Not Valid', - 'List of predefined validators' - ), - 'View' => array( - 'Intoduction', - 'Managing views', - 'Using views' - ), - 'Cache' => array( - 'Introduction', - 'Query cache'), - - 'Locking Manager' => array( - 'Introduction', - 'Examples', - 'Planned', - 'Technical Details', - 'Maintainer'), - 'Db_Profiler' => array( - 'Introduction', - 'Basic usage', - 'Advanced usage', - ), - 'Hook' => array( - 'Introduction', - 'Building queries', - 'List of parsers', - - ), - /** - 'Debugger' => array( - 'Introduction', - 'Debugging actions'), - 'Library' => array( - 'Introduction', - 'Using library functions'), - 'Iterator' => array( - 'Introduction', - 'BatchIterator', - 'ExpandableIterator', - 'OffsetIterator') - */ - ), - - 'DQL (Doctrine Query Language)' => - - array( - 'Introduction', - 'SELECT queries' => - array('DISTINCT keyword', - 'Aggregate values', - ), - 'UPDATE queries', - 'DELETE queries', - 'FROM clause', - 'WHERE clause', - 'Conditional expressions' => - array('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' => - array('String functions', - 'Arithmetic functions', - 'Datetime functions', - 'Collection functions'), - - 'GROUP BY, HAVING clauses', - 'ORDER BY clause' - => array('Introduction', - 'Sorting by an aggregate value', - 'Using random order'), - 'LIMIT and OFFSET clauses' => - array('Introduction', - 'Driver portability', - 'The limit-subquery-algorithm', - ), - - 'Examples', - 'BNF'), - - 'Transactions' => array( - 'Introduction', - 'Unit of work', - 'Nesting', - 'Savepoints', - 'Locking strategies' => - array('Pessimistic locking', - 'Optimistic locking'), - - 'Lock modes', - 'Isolation levels', - 'Deadlocks', - - ), - 'Caching' => array( - 'Introduction', - 'Availible options', - 'Drivers' => - array('Memcache', - 'APC', - 'Sqlite' - ), - - ), - 'Native SQL' => array( - 'Scalar queries', - 'Component queries', - 'Fetching multiple components', - ), - /** - 'Developer components' => array( - 'DataDict' => array( - 'Introduction', - 'Usage' - ), - 'IndexGenerator' => - array( - 'Introduction', - 'Usage'), - 'Relation' => array( - 'Introduction', - 'Types of relations', - ), - 'Null' => array( - 'Introduction', - 'Extremely fast null value checking' - ), - 'Access' => array( - 'Introduction', - 'Usage' - ), - 'Configurable' => array( - 'Introduction', - 'Usage' - ), - ), - */ - /** - 'Improving performance' => array( - 'Introduction', - 'Data types' => - array( - 'Enum', - ), - 'Primary keys' => array( - 'When to use surrogate primary keys', - ), - 'Constraints' => array( - 'General tips', - 'Foreign keys', - 'Triggers', - ), - 'Data manipulation' => array( - 'INSERT queries', - 'UPDATE queries', - 'DELETE queries', - ), - 'Indexes' => array( - 'General tips', - 'Using compound indexes', - ), - 'Transactions' => array( - 'General tips', - 'Locks', - 'Isolation', - ), - 'Data fetching' => array( - 'General tips', - ), - 'Normalization' => array( - - ), - 'Caching' => array( - 'General tips' - ), - 'Performance monitoring' => array( 'Using the database profiler') - - ), - */ - 'Connection modules' => array( - 'Export' => array('Introduction', - 'Creating new table', - 'Altering table' - ), - 'Import' => array('Introduction', - 'Getting table info', - 'Getting foreign key info', - 'Getting view info', - ), - 'Util' => array('Using explain'), - 'DataDict' => array('Getting portable type', - 'Getting database declaration', - 'Reserved keywords'), - ), - 'Drivers' => - array('Oracle' - => array('Making unsuported functions work'), - 'Mysql' - => array('Tips and tricks'), - ), - 'Technology' => array( - 'Architecture', - 'Design patterns used', - 'Speed', - 'Internal optimizations' => - - array('DELETE', - 'INSERT', - 'UPDATE'), - ), - 'Real world examples' => array('User management system','Forum application','Album lister'), - - 'Coding standards' => array( - 'Overview' => - array( - 'Scope', - 'Goals' - ), - 'PHP File Formatting' => array( - 'General', - 'Indentation', - 'Maximum line length', - 'Line termination' - ), - - 'Naming Conventions' => array( - 'Classes', - 'Interfaces', - 'Filenames', - 'Functions and methods', - 'Variables', - 'Constants', - 'Record columns', - ), - - - 'Coding Style' => array( - 'PHP code demarcation', - 'Strings', - 'Arrays', - 'Classes', - 'Functions and methods', - 'Control statements', - 'Inline documentation' - ), - 'Testing' => array( - 'Writing tests', - )) - ); - -$title = ''; -if (!empty($_REQUEST['index'])){ - $ex = explode(".",$_REQUEST["index"]); - $paths = array2path($menu); - if( isset($paths[$ex[0]])){ - $currIndex = ''; - for($i=0; $i - - - - -
    - - - - - - - - - - - - - - -
    - Doctrine - PHP Data Persistence and ORM Tool -
    -
    - - \n"; - foreach($menu as $title => $titles) { - print "
    " . $i . ". ".$title."
    \n"; - print "
    "; - $i2 = 1; - foreach($titles as $k => $t) { - $e = "$i.".$i2.""; - if(is_array($t)) { - print "
    ".$e." ".$k."
    \n"; - - $i3 = 1; - print "
    "; - foreach($t as $k2 => $v2) { - $str = ""; - if( ! file_exists("docs/$title - $k - $v2.php")) { - $missing[0]++; - $str .= " [ doc ] "; - //touch("docs/$title - $k - $v2.php"); - } - if( ! file_exists("codes/$title - $k - $v2.php")) { - $missing[1]++; - $str .= " [ code ] "; - //touch("codes/$title - $k - $v2.php"); - - } - - $e = implode(".",array($i,$i2,$i3)); - print "
    ".$e." ".$v2."
    \n"; - $i3++; - } - print "
    "; - - } else { - $str = ""; - if( ! file_exists("docs/$title - $t.php")) { - $missing[0]++; - $str .= " [ doc ] "; - //touch("docs/$title - $t.php"); - } - if( ! file_exists("codes/$title - $t.php")) { - $missing[1]++; - $str .= " [ code ] "; - //touch("codes/$title - $t.php"); - } - print "
    ".$e." ".$t."
    \n"; - } - $i2++; - - } - $i++; - print "
    "; - } - print "\n"; - - } else { - $i = 1; - // $paths was generated before, to display a correct document title - if( ! isset($paths[$ex[0]])) - exit; - - $break = false; - $tmp = $paths; - - foreach($tmp as $path => $title) { - $e = explode(".", $path); - if(count($e) > 2) { - unset($tmp[$path]); - } - } - - $prev = 1; - - foreach($tmp as $path => $title) { - if($break) - break; - - if($path === $_REQUEST["index"]) { - $break = true; - } else { - $prev = $path; - } - } - - $index = $_REQUEST['index']; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print "
    ".$paths[$ex[0]]."
    PrevNext
     
    "; - - - $tmp = $ex; - if(count($tmp) > 2) { - //array_pop($tmp); - } - foreach($tmp as $k => $v) { - $numbers[] = $v; - $curr = implode(".",$numbers); - $stack[] = $paths[$curr]; - } - if(isset($ex[1])) { - $name = implode(" - ", $stack); - - print "".$paths[$curr]."
    "; - - $n = $numbers; - - $o = $paths[$n[0]]; - $numpath = implode(".", array($n[0], $n[1])); - $o2 = $paths[$numpath]; - - $value = $menu[$o]; - if( ! is_array($value)) - exit; - - - if(in_array($o2, $value)) { - render_block($name); - } else { - $value = $menu[$o][$o2]; - - if(is_array($value)) { - foreach($value as $k => $title) { - $numpath2 = $numpath . '.' . ($k + 1); - print "
    ".$title."
    "; - - $s = $name." - ".$title; - - render_block($s); - } - } - } - } else { - - $tmp = $paths[$ex[0]]; - $i = 1; - foreach($menu[$tmp] as $title => $value) { - $n = $ex[0].".".$i; - - if(is_scalar($value)) { - print "
    ".$n.". ".$value."
    \n"; - } else { - print "
    ".$n.". ".$title."
    \n"; - } - $i++; - } - } - } - ?> -
    - -- index
    \n"; - foreach($menu as $title => $titles) { - print "
    ".$i.". ".$title."
    \n"; - $i++; - } - ?> -
    -
    - $titles) { - if($i == $ex[0]) { - - print $i.". ".$title."

    \n"; - $i2 = 1; - foreach($titles as $k => $t) { - $e = "$i.".$i2; - - if(is_array($t)) { - $tmp = "$title - $k"; - - if( ! isset($ex[1]) || $i2 != $ex[1]) { - $i2++; - continue; - } - - print $e." ".$k."


    \n"; - foreach($t as $k2 => $t2) { - if( ! isset($ex[1]) || $i2 != $ex[1]) - break; - $e = "$i.".$i2.".".($k2+1); - render($tmp,$t2,$e); - } - } else { - if( ! isset($ex[1])) { - render($title,$t,$e); - } - } - $i2++; - } - } - $i++; - - } - */ - ?> -
    -
    diff --git a/manual/documentation2.php b/manual/documentation2.php deleted file mode 100644 index 863426410..000000000 --- a/manual/documentation2.php +++ /dev/null @@ -1,154 +0,0 @@ -highlighter = new PHP_Highlight; - $this->wiki = new Text_Wiki; - } - 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; - } - - public function renderBlock($name) - { - - if (file_exists("docs/$name.php")) { - $c = file_get_contents("docs/$name.php"); - - if (substr($c, 0, 5) == "') !== false || - strpos($c, '
    ') !== false || - strpos($c, '
      ') !== false || - strpos($c, '

      ') !== false) { - print $c; - } else { - print $this->wiki->transform($c) . "

      "; - } - } - 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 -
      -
      - -
      -
      diff --git a/manual/export.php b/manual/export.php deleted file mode 100644 index d6cc083ad..000000000 --- a/manual/export.php +++ /dev/null @@ -1,105 +0,0 @@ -data['files'] = isset($_GET['files']) ? $_GET['files'] : null; - $this->data['path'] = isset($_GET['path']) ? $_GET['path'] : null; - - foreach($this->data as $k => $v) { - $this->data[$k] = stripslashes($v); - } - } - public function __get($name) { - if(isset($this->data[$name])) - return $this->data[$name]; - - return null; - } -} -function renderError($string) { - print "
      " . $string . "
      "; -} -$request = new Request(); -?> - - - -Doctrine ORM Framework - - - - - - - - -
      - - - -
      - - - - -
      - - - - - - - -
      - Doctrine Export -
      - - - - - - - -
      - This script is used for exporting existing Doctrine record classes to database schema. Doctrine tries to create database tables - - according to definitions given in the records. - - - - - - - - - - - - -
      Path :
      Files :
      -
      - path)) - renderError('Directory \'' . $request->path . '\' does not exist'); - - foreach($files as $k => $file) { - $file = $request->path . $file; - - if( ! file_exists($file)) { - renderError('File \'' . $file . '\' does not exist'); - - break; - } - $files[$k] = $file; - } - - } - ?> -
      - -
      -
      diff --git a/manual/features.php b/manual/features.php deleted file mode 100644 index 48524ba3f..000000000 --- a/manual/features.php +++ /dev/null @@ -1,97 +0,0 @@ - - - - - -
      - - - - - - - - - - -
      - Doctrine - PHP Data Persistence and ORM Tool -
      -
      - - -
        -GENERAL FEATURES -
          -
        • Fully object-oriented following best practices and design patterns -
        • Multiple databases -
        • Database connection pooling with connection-record -registry -
        • Runtime configuration (no XML needed!) -
        • Very modular structure (only uses the needed features) -
        • The runtime components can be compiled into a single file -
        • Leveled configuration (attributes can be set at global, connection and table levels) -
        -
        -DATABASE ABSTRACTION -
          -
        • A DSN (data source name) or array format for specifying database servers -
        • Datatype abstraction and on demand datatype conversion -
        • supports PDO -
        • Database query profiling -
        • Query caching -
        • Sequence / autoincrement emulation -
        • Replace emulation -
        • RDBMS management methods (creating, dropping, altering) -
        • SQL function call abstraction -
        • SQL expression abstraction -
        • Pattern matching abstraction -
        • Portable error codes -
        • Nested transactions -
        • Transaction isolation abstraction -
        • Transaction savepoint abstraction -
        • Index/Unique Key/Primary Key support -
        • Ability to read the information schema -
        • Reverse engineering schemas from an existing database -
        • LIMIT / OFFSET emulation -
        -
        -OBJECT RELATIONAL MAPPING -
          - General features -
        • Validators -
        • Transactional errorStack for easy retrieval of all errors -
        • EventListeners -
        • UnitOfWork pattern (easy saving of all pending objects) -
        • Uses ActiveRecord pattern -
        • State-wise records and transactions -
        • Importing existing database schemas to Doctrine ActiveRecord objects -
        • Exporting Doctrine ActiveRecords to database (= automatic table creation) -

          - Mapping -
        • Composite, Natural, Autoincremented and Sequential identifiers -
        • PHP Array / Object data types for columns (automatic serialization/unserialization) -
        • Gzip datatype for all databases -
        • Emulated enum datatype for all databases -
        • Datatype abstraction -
        • Column aggregation inheritance -
        • One-class-one-table inheritance as well as One-table -
        • One-to-many, many-to-one, one-to-one and many-to-many relations -
        • Self-referencing relations even for association table relations -
        • Relation aliases -

          - Object population -
        • DQL (Doctrine Query Language), an EJB 3 spec compliant OQL -
        • The limit-subquery-algorithm -
        • OO-style query API for both DQL and raw SQL -
        • Object population from database views -
        • Object population through raw SQL -

          - Transactions and locking -
        • Pessimistic offline locking -
        • Savepoints, transaction isolation levels and nested transactions -
        • Transactional query optimization (gathering of DELETE statements) -
        -
      -
      diff --git a/manual/highlight.php b/manual/highlight.php deleted file mode 100644 index 0498f51d3..000000000 --- a/manual/highlight.php +++ /dev/null @@ -1,570 +0,0 @@ - Formatted HTML - * * toHtmlComment => Formatted HTML, specifically for comments on messageboards - * * toList => Ordered lists - * * toArray => Associative array - * - * Highlighting can be inline (with styles), or the same as - * highlight_file() where colors are taken from php.ini. - * - * @author Aidan Lister - * @author Based on an idea by Matthew Harris - * @version 1.3.0 - * @link http://aidanlister.com/repos/v/PHP_Highlight.php - */ -if (!defined('T_ML_COMMENT')) { - define('T_ML_COMMENT', T_COMMENT); -} else { - define('T_DOC_COMMENT', T_ML_COMMENT); -} -class PHP_Highlight -{ - /** - * Hold highlight colors - * - * Contains an associative array of token types and colours. - * By default, it contains the colours as specified by php.ini - * - * For example, to change the colour of strings, use something - * simular to $h->highlight['string'] = 'blue'; - * - * @var array - * @access public - */ - var $highlight; - - /** - * Things to be replaced for formatting or otherwise reasons - * - * The first element contains the match array, the second the replace - * array. - * - * @var array - * @access public - */ - var $replace = array( - 0 => array("\t", ' '), - 1 => array('    ', ' ')); - - /** - * Format of the link to the PHP manual page - * - * @var string - * @access public - */ - var $manual = '%s'; - - /** - * Format of the span tag to be wrapped around each token - * - * @var string - * @access public - */ - var $span; - - /** - * Hold the source - * - * @var string - * @access private - */ - var $_source = false; - - /** - * Hold plaintext keys - * - * An array of lines which are plaintext - * - * @var array - * @access private - */ - var $_plaintextkeys = array(); - - - /** - * Constructor - * - * Populates highlight array - * - * @param bool $inline If inline styles rather than colors are to be used - * @param bool $plaintext Do not format code outside PHP tags - */ - function PHP_Highlight($inline = false) - { - // Inline - if ($inline === false) { - // Default colours from php.ini - /** - $this->highlight = array( - 'string' => ini_get('highlight.string'), - 'comment' => ini_get('highlight.comment'), - 'keyword' => ini_get('highlight.keyword'), - 'bg' => ini_get('highlight.bg'), - 'default' => ini_get('highlight.default'), - 'html' => ini_get('highlight.html') - ); - */ - $this->highlight = array( - 'string' => "#cb0864", - 'comment' => "#888888", - 'keyword' => "#118994", - 'bg' => "#222222", - 'default' => "#000000", - 'html' => ini_get('highlight.html') - ); - $this->span = '%s'; - } else { - // Basic styles - $this->highlight = array( - 'string' => 'string', - 'comment' => 'comment', - 'keyword' => 'keyword', - 'bg' => 'bg', - 'default' => 'default', - 'html' => 'html' - ); - $this->span = '%s'; - } - } - - - /** - * Load a file - * - * @access public - * @param string $file The file to load - * @return bool Returns TRUE - */ - function loadFile($file) - { - $this->_source = file_get_contents($file); - return true; - } - - - /** - * Load a string - * - * @access public - * @param string $string The string to load - * @return bool Returns TRUE - */ - function loadString($string) - { - $this->_source = $string; - return true; - } - - - /** - * Parse the loaded string into an array - * Source is returned with the element key corresponding to the line number - * - * @access public - * @param bool $funcref Reference functions to the PHP manual - * @param bool $blocks Whether to ignore processing plaintext - * @return array An array of highlighted source code - */ - function toArray($funcref = true, $blocks = false) - { - // Ensure source has been loaded - if ($this->_source == false) { - return false; - } - - // Init - $tokens = token_get_all($this->_source); - $manual = $this->manual; - $span = $this->span; - $i = 0; - $out = array(); - $out[$i] = ''; - - // Loop through each token - foreach ($tokens as $j => $token) { - // Single char - if (is_string($token)) { - // Skip token2color check for speed - $out[$i] .= sprintf($span, $this->highlight['keyword'], htmlspecialchars($token)); - - // Heredocs behave strangely - list($tb) = isset($tokens[$j - 1]) ? $tokens[$j - 1] : false; - if ($tb === T_END_HEREDOC) { - $out[++$i] = ''; - } - - continue; - } - - // Proper token - list ($token, $value) = $token; - - // Make the value safe - $value = htmlspecialchars($value); - $value = str_replace($this->replace[0], $this->replace[1], $value); - - // Process - if ($value === "\n") { - // End this line and start the next - $out[++$i] = ''; - } else { - // Function linking - if ($funcref === true && $token === T_STRING) { - // Look ahead 1, look ahead 2, and look behind 3 - if ((isset($tokens[$j + 1]) && $tokens[$j + 1] === '(' || - isset($tokens[$j + 2]) && $tokens[$j + 2] === '(') && - isset($tokens[$j - 3][0]) && $tokens[$j - 3][0] !== T_FUNCTION - && function_exists($value)) { - - // Insert the manual link - $value = sprintf($manual, $value, $value); - } - } - - // Explode token block - $lines = explode("\n", $value); - foreach ($lines as $jj => $line) { - $line = trim($line); - if ($line !== '') { - // This next line is helpful for debugging - //$out[$i] .= token_name($token); - - // Check for plaintext - if ($blocks === true && $token === T_INLINE_HTML) { - $this->_plaintextkeys[] = $i; - $out[$i] .= $line; - } else { - $out[$i] .= sprintf($span, $this->_token2color($token), $line); - } - } - - - // Start a new line - if (isset($lines[$jj + 1])) { - $out[++$i] = ''; - } - } - } - } - - return $out; - } - - - /** - * Convert the source to an ordered list. - * Each line is wrapped in
    • tags. - * - * @access public - * @param bool $return Return rather than print the results - * @param bool $funcref Reference functions to the PHP manual - * @param bool $blocks Whether to use code blocks around plaintext - * @return string A HTML ordered list - */ - function toList($return = false, $funcref = true, $blocks = true) - { - // Ensure source has been loaded - if ($this->_source == false) { - return false; - } - - // Format list - $source = $this->toArray($funcref, $blocks); - $out = "
        \n"; - foreach ($source as $i => $line) { - $out .= "
      1. "; - - // Some extra juggling for lines which are not code - if (empty($line)) { - $out .= ' '; - } elseif ($blocks === true && in_array($i, $this->_plaintextkeys)) { - $out .= $line; - } else { - $out .= "$line"; - } - - $out .= "
      2. \n"; - } - $out .= "
      \n"; - - if ($return === true) { - return $out; - } else { - echo $out; - } - } - - - /** - * Convert the source to formatted HTML. - * Each line ends with
      . - * - * @access public - * @param bool $return Return rather than print the results - * @param bool $linenum Display line numbers - * @param string $format Specify format of line numbers displayed - * @param bool $funcref Reference functions to the PHP manual - * @return string A HTML block of code - */ - function toHtml($return = false, $linenum = false, $format = null, $funcref = true) - { - // Ensure source has been loaded - if ($this->_source == false) { - return false; - } - - // Line numbering - if ($linenum === true && $format === null) { - $format = '%02d '; - } - - // Format code - $source = $this->toArray($funcref); - $out = "
      "; - foreach ($source as $i => $line) { - $out .= ' '; - - if ($linenum === true) { - $out .= sprintf($format, $i); - } - - $out .= empty($line) ? ' ' : $line; - $out .= "
      \n"; - } - $out .= "
      "; - - if ($return === true) { - return $out; - } else { - echo $out; - } - } - - - /** - * Convert the source to formatted HTML blocks. - * Each line ends with
      . - * - * This method ensures only PHP is between blocks. - * - * @access public - * @param bool $return Return rather than print the results - * @param bool $linenum Display line numbers - * @param string $format Specify format of line numbers displayed - * @param bool $reset Reset the line numbering each block - * @param bool $funcref Reference functions to the PHP manual - * @return string A HTML block of code - */ - function toHtmlBlocks($return = false, $linenum = false, $format = null, $reset = true, $funcref = true) - { - // Ensure source has been loaded - if ($this->_source == false) { - return false; - } - - // Default line numbering - if ($linenum === true && $format === null) { - $format = '%03d '; - } - - // Init - $source = $this->toArray($funcref, true); - $out = ''; - $wasplain = true; - $k = 0; - - // Loop through each line and decide which block to use - foreach ($source as $i => $line) { - // Empty line - if (empty($line)) { - if ($wasplain === true) { - $out .= ' '; - } else { - if (in_array($i+1, $this->_plaintextkeys)) { - $out .= "\n"; - - // Reset line numbers - if ($reset === true) { - $k = 0; - } - } else { - $out .= ' '; - // Add line number - if ($linenum === true) { - $out .= sprintf($format, ++$k); - } - } - } - - // Plain text - } elseif (in_array($i, $this->_plaintextkeys)) { - if ($wasplain === false) { - $out .= "\n"; - - // Reset line numbers - if ($reset === true) { - $k = 0; - } - } - - $wasplain = true; - $out .= str_replace(' ', ' ', $line); - - // Code - } else { - if ($wasplain === true) { - $out .= "\n"; - } - $wasplain = false; - - $out .= ' '; - // Add line number - if ($linenum === true) { - $out .= sprintf($format, ++$k); - } - $out .= $line; - } - - $out .= "
      \n"; - } - - // Add final code tag - if ($wasplain === false) { - $out .= "
      \n"; - } - - // Output method - if ($return === true) { - return $out; - } else { - echo $out; - } - } - - - /** - * Assign a color based on the name of a token - * - * @access private - * @param int $token The token - * @return string The color of the token - */ - function _token2color($token) - { - - switch ($token): - case T_CONSTANT_ENCAPSED_STRING: - return $this->highlight['string']; - break; - - case T_INLINE_HTML: - return $this->highlight['html']; - break; - - case T_COMMENT: - case T_DOC_COMMENT: - //case T_ML_COMMENT: - return $this->highlight['comment']; - break; - - case T_ABSTRACT: - case T_ARRAY: - case T_ARRAY_CAST: - case T_AS: - case T_BOOLEAN_AND: - case T_BOOLEAN_OR: - case T_BOOL_CAST: - case T_BREAK: - case T_CASE: - case T_CATCH: - case T_CLASS: - case T_CLONE: - case T_CONCAT_EQUAL: - case T_CONTINUE: - case T_DEFAULT: - case T_DOUBLE_ARROW: - case T_DOUBLE_CAST: - case T_ECHO: - case T_ELSE: - case T_ELSEIF: - case T_EMPTY: - case T_ENDDECLARE: - case T_ENDFOR: - case T_ENDFOREACH: - case T_ENDIF: - case T_ENDSWITCH: - case T_ENDWHILE: - case T_END_HEREDOC: - case T_EXIT: - case T_EXTENDS: - case T_FINAL: - case T_FOREACH: - case T_FUNCTION: - case T_GLOBAL: - case T_IF: - case T_INC: - case T_INCLUDE: - case T_INCLUDE_ONCE: - case T_INSTANCEOF: - case T_INT_CAST: - case T_ISSET: - case T_IS_EQUAL: - case T_IS_IDENTICAL: - case T_IS_NOT_IDENTICAL: - case T_IS_SMALLER_OR_EQUAL: - case T_NEW: - case T_OBJECT_CAST: - case T_OBJECT_OPERATOR: - case T_PAAMAYIM_NEKUDOTAYIM: - case T_PRIVATE: - case T_PROTECTED: - case T_PUBLIC: - case T_REQUIRE: - case T_REQUIRE_ONCE: - case T_RETURN: - case T_SL: - case T_SL_EQUAL: - case T_SR: - case T_SR_EQUAL: - case T_START_HEREDOC: - case T_STATIC: - case T_STRING_CAST: - case T_THROW: - case T_TRY: - case T_UNSET_CAST: - case T_VAR: - case T_WHILE: - return $this->highlight['keyword']; - break; - - case T_CLOSE_TAG: - case T_OPEN_TAG: - case T_OPEN_TAG_WITH_ECHO: - default: - return $this->highlight['default']; - - endswitch; - } - -} - -?> diff --git a/manual/images/docflash.jpg b/manual/images/docflash.jpg deleted file mode 100644 index 0e0d6a71b..000000000 Binary files a/manual/images/docflash.jpg and /dev/null differ diff --git a/manual/images/docflashbg.jpg b/manual/images/docflashbg.jpg deleted file mode 100644 index 3821958db..000000000 Binary files a/manual/images/docflashbg.jpg and /dev/null differ diff --git a/manual/images/docnew.gif b/manual/images/docnew.gif deleted file mode 100644 index 60a9c7080..000000000 Binary files a/manual/images/docnew.gif and /dev/null differ diff --git a/manual/images/gradient1.jpg b/manual/images/gradient1.jpg deleted file mode 100644 index 254ead776..000000000 Binary files a/manual/images/gradient1.jpg and /dev/null differ diff --git a/manual/images/gradient2.jpg b/manual/images/gradient2.jpg deleted file mode 100644 index 4c94fd978..000000000 Binary files a/manual/images/gradient2.jpg and /dev/null differ diff --git a/manual/images/gradient3.jpg b/manual/images/gradient3.jpg deleted file mode 100644 index cc86606f1..000000000 Binary files a/manual/images/gradient3.jpg and /dev/null differ diff --git a/manual/images/logo.jpg b/manual/images/logo.jpg deleted file mode 100644 index 8f3660ece..000000000 Binary files a/manual/images/logo.jpg and /dev/null differ diff --git a/manual/images/logotext.jpg b/manual/images/logotext.jpg deleted file mode 100644 index 127fa3663..000000000 Binary files a/manual/images/logotext.jpg and /dev/null differ diff --git a/manual/images/tausta2.jpg b/manual/images/tausta2.jpg deleted file mode 100644 index b79d65692..000000000 Binary files a/manual/images/tausta2.jpg and /dev/null differ diff --git a/manual/menu.php b/manual/menu.php deleted file mode 100644 index 6ea24785d..000000000 --- a/manual/menu.php +++ /dev/null @@ -1,346 +0,0 @@ -Getting started - Requirements - Installation - Include and autoload - Compiling - Starting new project - Working with existing databases - Introduction - Making the first import - Import options - Exporting classes - Introduction - Export options -Connection management - DSN, the Data Source Name - Opening a new connection - Lazy-connecting to database - Managing connections - Connection-component binding -Object relational mapping - Introduction - Table and class naming - Table options - 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 - Introduction - Notnull - Unique - Check - 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 - Foreign key constraints - Introduction - Constraint actions - 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 - Subqueries - Introduction - Comparisons using subqueries - Conditional expressions - ANY, IN and SOME - ALL - EXISTS and NOT EXISTS - Correlated subqueries - Subqueries in FROM clause - 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 deleted file mode 100644 index 7976a56d9..000000000 --- a/manual/styles/basic.css +++ /dev/null @@ -1,136 +0,0 @@ -body { -margin:10px auto 0px auto; -font-family: Verdana, Arial, Helvetica; -text-decoration: none; -} -input.big { -width: 400; -} -hr { -color: A50A3D; -} -hr.small { -color: A50A3D; -width: 100%; -align: left; -height: 1 px; -} -td.small { -font-family: Verdana, Arial, Helvetica; -font-size: 13 px; -} -div.sql { -background: #E8E8E8; - -} -dd { - line-height: 1.5em; -} -ul { - line-height: 1.5em; -} -td { -font-size: 14 px; -font-family: Verdana, Arial, Helvetica; -} - -table.dashed { -border-style: dashed; -border-color: 116699; -border-shadow: none; -border-width: 1 px; -} -table.error { -border-style: dashed; -border-color: red; -border-shadow: none; -border-width: 1 px; -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 { - -} -table.index { -border-style: solid; -border-color: #A0A0A0; -border-shadow: none; -border-width: thin; -} -td.bordered { -border-style: solid; -border-color: #A0A0A0; -border-shadow: none; -border-width: thin; -} -div.content { -margin: 5,5,5,5 px; -} -div.code { -font-family: monospace; -} -div.smallmenu { -border-style: solid; -border-color: #A0A0A0; -border-shadow: none; -border-width: thin; -background: #E9E9E9; -} -b.title { -color: #A50A3D; -} -u.title { -color: #367FAC; -} -a.big { -font-size: 14 px; -} -i { -color: #367FAC; -} -em { -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; -} -font.smallmenu { -font-size: 13 px; -font-weight: bold; -} diff --git a/manual/styles/steel.css b/manual/styles/steel.css deleted file mode 100644 index ad883fd95..000000000 --- a/manual/styles/steel.css +++ /dev/null @@ -1,46 +0,0 @@ -body { -margin: 10,0,0,0; -font-family: Verdana, Arial, Helvetica; -text-decoration: none; -background: #393939; -color: #dfdfdf; -} - -hr { -color: a3cb14; -} -hr.small { -color: a3cb14; -width: 100%; -align: left; -height: 1 px; -} -td.small { -font-family: Verdana, Arial, Helvetica; -font-size: 12 px; -} -td { -font-size: 12 px; -font-family: Verdana, Arial, Helvetica; -background: #393939; -} -joo { -color: A50A3D; -} -table.dashed { -border-style: solid; -border-color: 116699; -border-width: 1 px; -} -b.title { -color: #0090d9; -} -u.title { -color: #367FAC; -} -a.big { -font-size: 13 px; -} -a { -color: #a3cb14; -} diff --git a/manual/top.php b/manual/top.php deleted file mode 100644 index e251f3b91..000000000 --- a/manual/top.php +++ /dev/null @@ -1,28 +0,0 @@ - - - -Doctrine ORM Framework <?=$title?> - - - - - - - - -
      - -
      - - - - - -
      - - main | documentation | download | FAQ | about | forums - -
      -