Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
d6b1d490
Commit
d6b1d490
authored
May 31, 2007
by
pookey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
porting over more of the docs to docbook
parent
bf3b4d6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
31 deletions
+123
-31
README
manual/docbook/README
+10
-0
doctrine.xml
manual/docbook/doctrine.xml
+113
-31
No files found.
manual/docbook/README
View file @
d6b1d490
...
...
@@ -16,3 +16,13 @@ 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
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.
manual/docbook/doctrine.xml
View file @
d6b1d490
...
...
@@ -103,14 +103,6 @@
</sect2>
</sect1>
<sect1
id=
"getting-started"
>
<title>
Getting Started
</title>
<para>
The installation of doctrine is very easy. Just get the latest revision of Doctrine from
<ulink
url=
"http://doctrine.pengus.net/svn/trunk"
>
http://doctrine.pengus.net/svn/trunk
</ulink>
.
</para>
</sect1>
<sect1
id=
"contributing"
>
<title>
Contributing
</title>
<para>
...
...
@@ -123,6 +115,97 @@
email the users mailing list.
</para>
</sect1>
<sect1
id=
"installation"
>
<title>
Installation
</title>
<para>
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.
</para>
<para>
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.
</para>
<screen>
<prompt>
bash $
</prompt><command>
svn checkout http://doctrine.pengus.net/svn/trunk
</command>
</screen>
<para>
Daily snapshots can be found at
<ulink
url=
"http://doctrine.pengus.net/downloads/"
>
http://doctrine.pengus.net/downloads/
</ulink>
and the latest daily snapshot can always be found at
<ulink
url=
"http://doctrine.pengus.net/downloads/latest-snapshot.tar.gz"
>
http://doctrine.pengus.net/downloads/latest-snapshot.tar.gz
</ulink>
</para>
</sect1>
<sect1
id=
"include-and-autoload"
>
<title>
Include and autoload
</title>
<para>
In order to use Doctrine in your project it must first be included.
</para>
<programlisting
role=
"php"
>
<![CDATA[
<?php
require_once('path-to-doctrine/lib/Doctrine.php');
?>
]]>
</programlisting>
<para>
Doctrine support
<ulink
url=
"http://www.php.net/autoload"
>
Autoloading
</ulink>
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:
</para>
<para>
If you do use the
<emphasis>
__autoload
</emphasis>
function for your own
logic you can use it.
</para>
<programlisting
role=
"php"
>
<![CDATA[
<?php
function __autoload($class) {
Doctrine::autoload($class);
}
?>
]]>
</programlisting>
<para>
If your project uses autoload and/or you have other libraries that use
it you could use
<ulink
url=
"http://www.php.net/manual/en/function.spl-autoload-register.php"
>
spl_autoload_register
</ulink>
to register more then one autoloading function.
</para>
<programlisting
role=
"php"
>
<![CDATA[
<?php
spl_autoload_register(array('Doctrine', 'autoload'));
?>
]]>
</programlisting>
</sect1>
<sect1
id=
"compiling"
>
<title>
Compiling
</title>
<para>
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.
</para>
<programlisting
role=
"php"
>
<![CDATA[
<?php
Doctrine::compile();
// on some other script:
require_once('path_to_doctrine/Doctrine.compiled.php');
?>
]]>
</programlisting>
</sect1>
</chapter>
<chapter
id=
"connection-management"
>
...
...
@@ -172,34 +255,33 @@
</para>
<programlisting
role=
"php"
>
<![CDATA[
<?php
// 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."\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";
}
<?php
// 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."\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";
}
}
?>
]]>
</programlisting>
</sect1>
</chapter>
<chapter
id=
"native-sql"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment