removed old documentation files
This commit is contained in:
parent
10b6e115d0
commit
ac89acd39b
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 247 KiB |
@ -1,773 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<XMI xmlns:UML="http://schema.omg.org/spec/UML/1.3" verified="false" timestamp="2006-08-26T02:49:51" xmi.version="1.2" >
|
||||
<XMI.header>
|
||||
<XMI.documentation>
|
||||
<XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter>
|
||||
<XMI.exporterVersion>1.5.4</XMI.exporterVersion>
|
||||
<XMI.exporterEncoding>UnicodeUTF8</XMI.exporterEncoding>
|
||||
</XMI.documentation>
|
||||
<XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
|
||||
</XMI.header>
|
||||
<XMI.content>
|
||||
<UML:Model isSpecification="false" isLeaf="false" isRoot="false" xmi.id="m1" isAbstract="false" name="UML Model" >
|
||||
<UML:Namespace.ownedElement>
|
||||
<UML:Stereotype isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="10629" isRoot="false" isAbstract="false" name="datatype" />
|
||||
<UML:Stereotype isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="12471" isRoot="false" isAbstract="false" name="__toString" />
|
||||
<UML:Stereotype isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="13117" isRoot="false" isAbstract="false" name="<<__toString>>" />
|
||||
<UML:Stereotype isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="13123" isRoot="false" isAbstract="false" name="<<__clone>>" />
|
||||
<UML:Stereotype isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="17077" isRoot="false" isAbstract="false" name="<<__set>>" />
|
||||
<UML:Stereotype isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="17100" isRoot="false" isAbstract="false" name="<<__get>>" />
|
||||
<UML:Stereotype isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="20200" isRoot="false" isAbstract="false" name="interface" />
|
||||
<UML:DataType stereotype="10629" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="10628" isRoot="false" isAbstract="false" name="array" />
|
||||
<UML:DataType stereotype="10629" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="10646" isRoot="false" isAbstract="false" name="string" />
|
||||
<UML:DataType stereotype="10629" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="10655" isRoot="false" isAbstract="false" name="bool" />
|
||||
<UML:DataType stereotype="10629" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="10664" isRoot="false" isAbstract="false" name="int" />
|
||||
<UML:DataType stereotype="10629" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="10721" isRoot="false" isAbstract="false" name="float" />
|
||||
<UML:DataType stereotype="10629" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="10754" isRoot="false" isAbstract="false" name="ArrayObject" />
|
||||
<UML:DataType stereotype="10629" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="10804" isRoot="false" isAbstract="false" name="object" />
|
||||
<UML:DataType stereotype="10629" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="16856" isRoot="false" isAbstract="false" name="mixed" />
|
||||
<UML:Class comment="Builds a Doctrine_Record base class definition based on a schema." isSpecification="false" isLeaf="false" visibility="implementation" namespace="m1" xmi.id="1171" isRoot="false" isAbstract="false" name="Doctrine_Import_Builder_BaseClass" >
|
||||
<UML:GeneralizableElement.generalization>
|
||||
<UML:Generalization xmi.idref="4683" />
|
||||
</UML:GeneralizableElement.generalization>
|
||||
<UML:Classifier.feature>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="implementation" xmi.id="1201" isRoot="false" isAbstract="false" isQuery="false" name="build" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="1202" value="" type="3133" name="schema" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="6720" isRoot="false" isAbstract="false" isQuery="false" name="setOuputPath" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="6728" value="" type="10646" name="path" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class comment="Holds information on a database table" isSpecification="false" isLeaf="false" visibility="implementation" namespace="m1" xmi.id="1172" isRoot="false" isAbstract="false" name="Doctrine_Schema_Table" >
|
||||
<UML:GeneralizableElement.generalization>
|
||||
<UML:Generalization xmi.idref="17154" />
|
||||
</UML:GeneralizableElement.generalization>
|
||||
<UML:Classifier.feature>
|
||||
<UML:Attribute comment="Columns of the table" isSpecification="false" visibility="private" xmi.id="10854" type="1173" name="childs" />
|
||||
<UML:Attribute comment="Unique key fields" isSpecification="false" visibility="public" xmi.id="1196" type="1173" name="uniqueKeys" />
|
||||
<UML:Attribute comment="Indexed columns" isSpecification="false" visibility="public" xmi.id="1412" type="1173" name="indexes" />
|
||||
<UML:Attribute comment="Table name" isSpecification="false" visibility="public" xmi.id="1180" type="10646" name="name" />
|
||||
<UML:Attribute isSpecification="false" visibility="public" xmi.id="1193" type="1173" name="primaryKeys" />
|
||||
<UML:Attribute comment="Check constraint definition" isSpecification="false" visibility="public" xmi.id="3483" type="10646" name="check" />
|
||||
<UML:Attribute comment="Character encoding e.g. ISO-8859-1 or UTF-8 etc." isSpecification="false" visibility="public" xmi.id="3561" type="10646" name="charset" />
|
||||
<UML:Attribute comment="Description or comment given in the schema" isSpecification="false" visibility="public" xmi.id="2869" type="10646" name="description" />
|
||||
<UML:Operation stereotype="13117" isSpecification="false" isLeaf="false" visibility="public" xmi.id="12527" isRoot="false" isAbstract="false" isQuery="false" name="__toString" />
|
||||
<UML:Operation stereotype="13123" isSpecification="false" isLeaf="false" visibility="public" xmi.id="14734" isRoot="false" isAbstract="false" isQuery="false" name="__clone" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="15514" isRoot="false" isAbstract="false" isQuery="false" name="isValid" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46706" type="10655" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="33801" isRoot="false" isAbstract="false" isQuery="false" name="addColumn" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46707" type="1173" />
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="33802" value="null" type="1173" name="column" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class comment="Holds information on a database table field" isSpecification="false" isLeaf="false" visibility="implementation" namespace="m1" xmi.id="1173" isRoot="false" isAbstract="false" name="Doctrine_Schema_Column" >
|
||||
<UML:GeneralizableElement.generalization>
|
||||
<UML:Generalization xmi.idref="17222" />
|
||||
</UML:GeneralizableElement.generalization>
|
||||
<UML:Classifier.feature>
|
||||
<UML:Attribute comment="Column name" isSpecification="false" visibility="public" xmi.id="1182" type="10646" name="name" />
|
||||
<UML:Attribute comment="Column type e.g. varchar, char, int etc." isSpecification="false" visibility="public" xmi.id="1184" type="10646" name="type" />
|
||||
<UML:Attribute comment="Field max length" isSpecification="false" visibility="public" xmi.id="1185" type="10664" name="length" />
|
||||
<UML:Attribute comment="Is an autoincrement column" isSpecification="false" visibility="public" xmi.id="1404" type="10655" name="autoincrement" />
|
||||
<UML:Attribute comment="Default field value" isSpecification="false" visibility="public" xmi.id="1408" type="10646" name="default" />
|
||||
<UML:Attribute comment="Is not null" isSpecification="false" visibility="public" xmi.id="2842" type="10655" name="notNull" />
|
||||
<UML:Attribute comment="Column comment" isSpecification="false" visibility="public" xmi.id="2848" type="10646" name="description" />
|
||||
<UML:Attribute comment="Column level check constraint" isSpecification="false" visibility="public" xmi.id="3472" type="10646" name="check" />
|
||||
<UML:Attribute comment="Character encoding e.g. ISO-8859-1 or UTF-8 etc." isSpecification="false" visibility="public" xmi.id="3545" type="10646" name="charset" />
|
||||
<UML:Operation stereotype="12471" isSpecification="false" isLeaf="false" visibility="public" xmi.id="12470" isRoot="false" isAbstract="false" isQuery="false" name="__toString" />
|
||||
<UML:Operation stereotype="13123" isSpecification="false" isLeaf="false" visibility="public" xmi.id="15461" isRoot="false" isAbstract="false" isQuery="false" name="__clone" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="15468" isRoot="false" isAbstract="false" isQuery="false" name="isValid" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46708" type="10655" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="1174" isRoot="false" isAbstract="false" name="Doctrine" >
|
||||
<UML:Classifier.feature>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="1176" isRoot="false" isAbstract="false" isQuery="false" name="import" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter comment="Folder where classes will be stored" isSpecification="false" visibility="private" xmi.id="1179" value="" type="10646" name="path" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class comment="Reads a database using the given PDO connection and constructs a database schema" isSpecification="false" isLeaf="false" visibility="implementation" namespace="m1" xmi.id="1195" isRoot="false" isAbstract="false" name="Doctrine_Import_Reader_Db" >
|
||||
<UML:GeneralizableElement.generalization>
|
||||
<UML:Generalization xmi.idref="1465" />
|
||||
</UML:GeneralizableElement.generalization>
|
||||
<UML:Classifier.feature>
|
||||
<UML:Attribute isSpecification="false" visibility="private" xmi.id="1199" type="10804" name="pdo" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="implementation" xmi.id="1237" isRoot="false" isAbstract="false" isQuery="false" name="read" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46709" type="3133" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="1200" isRoot="false" isAbstract="false" isQuery="false" name="setPdo" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="1321" value="" type="10804" name="pdo" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class comment="Main responsible of performing import operation. Delegates database schema reading to a reader object and passes the result to a builder object which builds a Doctrine data model." isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="1213" isRoot="false" isAbstract="false" name="Doctrine_Import" >
|
||||
<UML:Classifier.feature>
|
||||
<UML:Attribute isSpecification="false" visibility="private" xmi.id="4416" type="1432" name="reader" />
|
||||
<UML:Attribute isSpecification="false" visibility="private" xmi.id="4733" type="4623" name="builder" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="1229" isRoot="false" isAbstract="false" isQuery="false" name="import" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="8628" isRoot="false" isAbstract="false" isQuery="false" name="setReader" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="8629" value="" type="1432" name="reader" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="8685" isRoot="false" isAbstract="false" isQuery="false" name="setBuilder" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="8686" value="" type="4623" name="builder" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="1276" isRoot="false" isAbstract="false" name="Doctrine_DataDict" >
|
||||
<UML:Classifier.feature>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="1284" isRoot="false" isAbstract="false" isQuery="false" name="getDoctrineType" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46710" type="10628" />
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="1286" value="" type="10646" name="columnName" />
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="1288" value="" type="10646" name="columnLength" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class comment="Holds information on a foreign key relation." isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="1401" isRoot="false" isAbstract="false" name="Doctrine_Schema_Relation" >
|
||||
<UML:GeneralizableElement.generalization>
|
||||
<UML:Generalization xmi.idref="17376" />
|
||||
</UML:GeneralizableElement.generalization>
|
||||
<UML:Classifier.feature>
|
||||
<UML:Attribute comment="Columns that refer to another table" isSpecification="false" visibility="public" xmi.id="1475" type="1173" name="referencingFields" />
|
||||
<UML:Attribute comment="Columns that are referred from another table" isSpecification="false" visibility="public" xmi.id="1484" type="1173" name="referredFields" />
|
||||
<UML:Attribute comment="ON UPDATE or ON DELETE action" isSpecification="false" visibility="public" xmi.id="1658" initialValue="1" name="ACTION_RESTRICT" ownerScope="classifier" />
|
||||
<UML:Attribute comment="ON UPDATE or ON DELETE action" isSpecification="false" visibility="public" xmi.id="1682" initialValue="2" name="ACTION_SET_NULL" ownerScope="classifier" />
|
||||
<UML:Attribute comment="ON UPDATE or ON DELETE action" isSpecification="false" visibility="public" xmi.id="1713" initialValue="3" name="ACTION_CASCADE" ownerScope="classifier" />
|
||||
<UML:Attribute comment="ON UPDATE or ON DELETE action" isSpecification="false" visibility="public" xmi.id="1942" initialValue="4" name="ACTION_NO_ACTION" ownerScope="classifier" />
|
||||
<UML:Attribute comment="ON UPDATE or ON DELETE action" isSpecification="false" visibility="public" xmi.id="2448" initialValue="5" name="ACTION_SET_DEFAULT" ownerScope="classifier" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="1552" isRoot="false" isAbstract="false" isQuery="false" name="setRelationBetween" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="1554" value="" type="1173" name="referringColumns" />
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="1556" value="" type="1173" name="referencedColumns" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation stereotype="13117" isSpecification="false" isLeaf="false" visibility="public" xmi.id="12848" isRoot="false" isAbstract="false" isQuery="false" name="__toString" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="15332" isRoot="false" isAbstract="false" isQuery="false" name="isValid" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46711" type="10655" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class comment="Is responsible of reading a database definitions from a source and costructing a database schema" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="1432" isRoot="false" isAbstract="true" name="Doctrine_Import_Reader" >
|
||||
<UML:Classifier.feature>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="1434" isRoot="false" isAbstract="true" isQuery="false" name="read" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46712" type="3133" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class comment="Holds information on a database" isSpecification="false" isLeaf="false" visibility="implementation" namespace="m1" xmi.id="1437" isRoot="false" isAbstract="false" name="Doctrine_Schema_Database" >
|
||||
<UML:GeneralizableElement.generalization>
|
||||
<UML:Generalization xmi.idref="17131" />
|
||||
</UML:GeneralizableElement.generalization>
|
||||
<UML:Classifier.feature>
|
||||
<UML:Attribute comment="Tables in the database" isSpecification="false" visibility="private" xmi.id="2970" type="1172" name="childs" />
|
||||
<UML:Attribute comment="Database name" isSpecification="false" visibility="public" xmi.id="1612" type="10646" name="name" />
|
||||
<UML:Attribute comment="Database driver type" isSpecification="false" visibility="public" xmi.id="3116" type="10646" name="type" />
|
||||
<UML:Attribute comment="Database server version" isSpecification="false" visibility="public" xmi.id="3122" type="10646" name="version" />
|
||||
<UML:Attribute comment="The underlaying engine in the database e.g. InnoDB or MyISAM in MySQL." isSpecification="false" visibility="public" xmi.id="3149" type="10646" name="engine" />
|
||||
<UML:Attribute comment="Character encoding e.g. ISO-8859-1 or UTF-8 etc." isSpecification="false" visibility="public" xmi.id="3572" type="10646" name="charset" />
|
||||
<UML:Attribute comment="Foreign key constraints in the database" isSpecification="false" visibility="public" xmi.id="15281" type="1401" name="foreignKeyRelations" />
|
||||
<UML:Operation stereotype="13123" isSpecification="false" isLeaf="false" visibility="public" xmi.id="12323" isRoot="false" isAbstract="false" isQuery="false" name="__clone" />
|
||||
<UML:Operation stereotype="13117" isSpecification="false" isLeaf="false" visibility="public" xmi.id="13116" isRoot="false" isAbstract="false" isQuery="false" name="__toString" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="15857" isRoot="false" isAbstract="false" isQuery="false" name="isValid" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46713" type="10655" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="33687" isRoot="false" isAbstract="false" isQuery="false" name="addTable" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46714" type="1172" />
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="33688" value="null" type="1172" name="table" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class isSpecification="false" isLeaf="false" visibility="implementation" namespace="m1" xmi.id="2546" isRoot="false" isAbstract="false" name="Doctrine_Import_Reader_Xml_Propel" >
|
||||
<UML:GeneralizableElement.generalization>
|
||||
<UML:Generalization xmi.idref="2583" />
|
||||
</UML:GeneralizableElement.generalization>
|
||||
<UML:Classifier.feature>
|
||||
<UML:Attribute isSpecification="false" visibility="private" xmi.id="6397" type="10646" name="xml" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="implementation" xmi.id="2558" isRoot="false" isAbstract="false" isQuery="false" name="read" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46715" type="3133" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="6410" isRoot="false" isAbstract="false" isQuery="false" name="setXml" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="28680" value="" type="10646" name="xml" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class comment="Holds information on one to many databases" isSpecification="false" isLeaf="false" visibility="implementation" namespace="m1" xmi.id="3133" isRoot="false" isAbstract="false" name="Doctrine_Schema" >
|
||||
<UML:GeneralizableElement.generalization>
|
||||
<UML:Generalization xmi.idref="46395" />
|
||||
</UML:GeneralizableElement.generalization>
|
||||
<UML:Classifier.feature>
|
||||
<UML:Attribute comment="Holds any number of databases contained in the schema" isSpecification="false" visibility="private" xmi.id="3774" type="1437" name="childs" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="12191" isRoot="false" isAbstract="false" isQuery="false" name="addDatabase" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="12192" value="" type="1437" name="database" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation stereotype="13117" isSpecification="false" isLeaf="false" visibility="public" xmi.id="13035" isRoot="false" isAbstract="false" isQuery="false" name="__toString" />
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="15870" isRoot="false" isAbstract="false" isQuery="false" name="isValid" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46716" type="10655" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class comment="Is responsible of building Doctrine structure based on a database schema." isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="4623" isRoot="false" isAbstract="true" name="Doctrine_Import_Builder" >
|
||||
<UML:Classifier.feature>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="4640" isRoot="false" isAbstract="true" isQuery="false" name="build" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="4641" value="" type="3133" name="schema" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="7384" isRoot="false" isAbstract="false" name="Doctrine_Import_Reader_Exception" />
|
||||
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="7414" isRoot="false" isAbstract="false" name="Doctrine_Schema_Exception" />
|
||||
<UML:Class isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="7640" isRoot="false" isAbstract="false" name="Doctrine_Import_Builder_Exception" />
|
||||
<UML:Class comment="Catches any non-property call from child classes and throws an exception." isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="16973" isRoot="false" isAbstract="true" name="Doctrine_Schema_Object" >
|
||||
<UML:Classifier.feature>
|
||||
<UML:Operation stereotype="17077" isSpecification="false" isLeaf="false" visibility="public" xmi.id="17044" isRoot="false" isAbstract="false" isQuery="false" name="__set" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="17045" value="" type="10646" name="$property" />
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="17066" value="" type="16856" name="$value" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation stereotype="17100" isSpecification="false" isLeaf="false" visibility="public" xmi.id="17088" isRoot="false" isAbstract="false" isQuery="false" name="__get" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter isSpecification="false" visibility="private" xmi.id="17089" value="" type="10646" name="$property" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="implementation" xmi.id="46548" isRoot="false" isAbstract="false" isQuery="false" name="count" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46717" type="10655" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="implementation" xmi.id="46562" isRoot="false" isAbstract="false" isQuery="false" name="getIterator" />
|
||||
</UML:Classifier.feature>
|
||||
</UML:Class>
|
||||
<UML:Interface stereotype="20200" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="20291" isRoot="false" isAbstract="true" name="IteratorAggregate" >
|
||||
<UML:Classifier.feature>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="34688" isRoot="false" isAbstract="false" isQuery="false" name="getIterator" />
|
||||
</UML:Classifier.feature>
|
||||
</UML:Interface>
|
||||
<UML:Interface stereotype="20200" isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="20362" isRoot="false" isAbstract="true" name="Countable" >
|
||||
<UML:Classifier.feature>
|
||||
<UML:Operation isSpecification="false" isLeaf="false" visibility="public" xmi.id="20453" isRoot="false" isAbstract="false" isQuery="false" name="count" >
|
||||
<UML:BehavioralFeature.parameter>
|
||||
<UML:Parameter kind="return" xmi.id="46718" type="10664" />
|
||||
</UML:BehavioralFeature.parameter>
|
||||
</UML:Operation>
|
||||
</UML:Classifier.feature>
|
||||
</UML:Interface>
|
||||
<UML:Package isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="32898" isRoot="false" isAbstract="false" name="PHP" >
|
||||
<UML:Namespace.ownedElement/>
|
||||
</UML:Package>
|
||||
<UML:Association isSpecification="false" visibility="public" namespace="m1" xmi.id="1186" name="owns \/" >
|
||||
<UML:Association.connection>
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="1187" aggregation="composite" type="1173" name="" multiplicity="*" />
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="1188" aggregation="none" type="1172" name="" multiplicity="1" />
|
||||
</UML:Association.connection>
|
||||
</UML:Association>
|
||||
<UML:Association isSpecification="false" visibility="public" namespace="m1" xmi.id="1440" name="" >
|
||||
<UML:Association.connection>
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="1441" aggregation="composite" type="1437" name="" />
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="1442" aggregation="none" type="1172" name="" />
|
||||
</UML:Association.connection>
|
||||
</UML:Association>
|
||||
<UML:Association isSpecification="false" visibility="public" namespace="m1" xmi.id="1446" name="" >
|
||||
<UML:Association.connection>
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="1447" aggregation="composite" type="1437" name="" />
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="1448" aggregation="none" type="1172" name="" />
|
||||
</UML:Association.connection>
|
||||
</UML:Association>
|
||||
<UML:Association isSpecification="false" visibility="public" namespace="m1" xmi.id="1452" name="" >
|
||||
<UML:Association.connection>
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="1453" aggregation="composite" type="1172" name="" />
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="1454" aggregation="none" type="1437" name="" />
|
||||
</UML:Association.connection>
|
||||
</UML:Association>
|
||||
<UML:Generalization isSpecification="false" child="1195" visibility="public" namespace="m1" xmi.id="1465" parent="1432" discriminator="" name="" />
|
||||
<UML:Generalization isSpecification="false" child="2546" visibility="public" namespace="m1" xmi.id="2583" parent="1432" discriminator="" name="" />
|
||||
<UML:Dependency isSpecification="false" visibility="public" namespace="m1" xmi.id="4378" client="1213" name="" supplier="1174" />
|
||||
<UML:Generalization isSpecification="false" child="1171" visibility="public" namespace="m1" xmi.id="4683" parent="4623" discriminator="" name="" />
|
||||
<UML:Dependency isSpecification="false" visibility="public" namespace="m1" xmi.id="4925" client="1174" name="calls" supplier="1213" />
|
||||
<UML:Dependency isSpecification="false" visibility="public" namespace="m1" xmi.id="7523" client="1171" name="" supplier="1276" />
|
||||
<UML:Dependency comment="Doctrine importing is delegated to an object responsible of importing" isSpecification="false" visibility="public" namespace="m1" xmi.id="8028" client="1174" name="delegates" supplier="1213" />
|
||||
<UML:Dependency isSpecification="false" visibility="public" namespace="m1" xmi.id="8862" client="1171" name="get translation" supplier="1276" />
|
||||
<UML:Association isSpecification="false" visibility="public" namespace="m1" xmi.id="15225" name="" >
|
||||
<UML:Association.connection>
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="15226" aggregation="composite" type="1401" name="" />
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="15227" aggregation="none" type="1437" name="" />
|
||||
</UML:Association.connection>
|
||||
</UML:Association>
|
||||
<UML:Association isSpecification="false" visibility="public" namespace="m1" xmi.id="15253" name="" >
|
||||
<UML:Association.connection>
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="15254" aggregation="composite" type="1437" name="" />
|
||||
<UML:AssociationEnd isSpecification="false" visibility="public" changeability="changeable" isNavigable="true" xmi.id="15255" aggregation="none" type="1401" name="" />
|
||||
</UML:Association.connection>
|
||||
</UML:Association>
|
||||
<UML:Generalization isSpecification="false" child="1437" visibility="public" namespace="m1" xmi.id="17131" parent="16973" discriminator="" name="" />
|
||||
<UML:Generalization isSpecification="false" child="1172" visibility="public" namespace="m1" xmi.id="17154" parent="16973" discriminator="" name="" />
|
||||
<UML:Generalization isSpecification="false" child="1173" visibility="public" namespace="m1" xmi.id="17222" parent="16973" discriminator="" name="" />
|
||||
<UML:Generalization isSpecification="false" child="1401" visibility="public" namespace="m1" xmi.id="17376" parent="16973" discriminator="" name="" />
|
||||
<UML:Abstraction isSpecification="false" visibility="public" namespace="m1" xmi.id="20498" client="1172" name="" supplier="20362" />
|
||||
<UML:Abstraction isSpecification="false" visibility="public" namespace="m1" xmi.id="20582" client="1172" name="" supplier="20362" />
|
||||
<UML:Abstraction isSpecification="false" visibility="public" namespace="m1" xmi.id="20862" client="1173" name="" supplier="20291" />
|
||||
<UML:Abstraction isSpecification="false" visibility="public" namespace="m1" xmi.id="20907" client="1172" name="" supplier="20291" />
|
||||
<UML:Abstraction isSpecification="false" visibility="public" namespace="m1" xmi.id="21121" client="1437" name="" supplier="20362" />
|
||||
<UML:Abstraction isSpecification="false" visibility="public" namespace="m1" xmi.id="21152" client="1437" name="" supplier="20291" />
|
||||
<UML:Abstraction isSpecification="false" visibility="public" namespace="m1" xmi.id="21183" client="3133" name="" supplier="20362" />
|
||||
<UML:Abstraction isSpecification="false" visibility="public" namespace="m1" xmi.id="21214" client="3133" name="" supplier="20291" />
|
||||
<UML:Generalization isSpecification="false" child="3133" visibility="public" namespace="m1" xmi.id="46395" parent="16973" discriminator="" name="" />
|
||||
<UML:Abstraction isSpecification="false" visibility="public" namespace="m1" xmi.id="46422" client="16973" name="" supplier="20291" />
|
||||
<UML:Abstraction isSpecification="false" visibility="public" namespace="m1" xmi.id="46509" client="16973" name="" supplier="20362" />
|
||||
</UML:Namespace.ownedElement>
|
||||
</UML:Model>
|
||||
</XMI.content>
|
||||
<XMI.extensions xmi.extender="umbrello" >
|
||||
<docsettings viewid="1170" documentation="" uniqueid="46718" />
|
||||
<diagrams>
|
||||
<diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" linewidth="0" zoom="75" showgrid="0" showopsig="1" usefillcolor="1" snapx="10" canvaswidth="1997" snapy="10" showatts="1" xmi.id="1170" documentation="Holds information on a foreign key relation" type="402" showops="1" showpackage="0" name="Doctrine_Import" localid="900000" showstereotype="0" showscope="1" snapcsgrid="0" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="#ff0000" canvasheight="1721" >
|
||||
<widgets>
|
||||
<classwidget usesdiagramfillcolour="0" width="274" showattsigs="601" usesdiagramusefillcolour="0" x="127" y="790" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="63" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="1171" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="0" width="558" showattsigs="601" usesdiagramusefillcolour="0" x="642" y="866" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="234" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="1172" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="0" width="196" showattsigs="601" usesdiagramusefillcolour="0" x="832" y="1152" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="234" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="1173" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="0" width="214" showattsigs="601" usesdiagramusefillcolour="0" x="59" y="37" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="45" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="1174" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="0" width="325" showattsigs="601" usesdiagramusefillcolour="0" x="714" y="134" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="72" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="1195" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="0" width="323" showattsigs="601" usesdiagramusefillcolour="0" x="112" y="197" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="108" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="1213" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<notewidget usesdiagramfillcolour="1" width="241" usesdiagramusefillcolour="1" x="255" y="385" linewidth="none" fillcolour="none" height="144" usefillcolor="1" isinstance="0" xmi.id="1260" showstereotype="1" text="Main responsible of performing import operation. Delegates database schema reading to a reader object and passes the result to a builder object which builds a Doctrine data model." font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<classwidget usesdiagramfillcolour="0" width="473" showattsigs="601" usesdiagramusefillcolour="0" x="43" y="1071" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="45" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="1276" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<notewidget usesdiagramfillcolour="1" width="156" usesdiagramusefillcolour="1" x="162" y="1196" linewidth="none" fillcolour="none" height="87" usefillcolor="1" isinstance="0" xmi.id="1296" showstereotype="1" text="Translates a native database column name to a Doctrine column definition." font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<notewidget usesdiagramfillcolour="1" width="212" usesdiagramusefillcolour="1" x="770" y="253" linewidth="none" fillcolour="none" height="102" usefillcolor="1" isinstance="0" xmi.id="1304" showstereotype="1" text="Reads a database using the given PDO connection and constructs a database schema" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<notewidget usesdiagramfillcolour="1" width="220" usesdiagramusefillcolour="1" x="267" y="889" linewidth="none" fillcolour="none" height="72" usefillcolor="1" isinstance="0" xmi.id="1308" showstereotype="1" text="Builds a Doctrine_Record base class definition based on a schema." font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<notewidget usesdiagramfillcolour="1" width="133" usesdiagramusefillcolour="1" x="1351" y="994" linewidth="none" fillcolour="none" height="109" usefillcolor="1" isinstance="0" xmi.id="1310" showstereotype="1" text="Holds information on a database table" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<notewidget usesdiagramfillcolour="1" width="126" usesdiagramusefillcolour="1" x="1346" y="1210" linewidth="none" fillcolour="none" height="120" usefillcolor="1" isinstance="0" xmi.id="1312" showstereotype="1" text="Holds information on a database table field" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<classwidget usesdiagramfillcolour="0" width="769" showattsigs="601" usesdiagramusefillcolour="0" x="583" y="1439" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="198" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="1401" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="0" width="335" showattsigs="601" usesdiagramusefillcolour="0" x="672" y="40" drawascircle="0" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="46" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="1432" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,50,1,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="0" width="505" showattsigs="601" usesdiagramusefillcolour="0" x="691" y="573" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="216" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="1437" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="0" width="271" showattsigs="601" usesdiagramusefillcolour="0" x="1055" y="134" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="72" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="2546" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="0" width="383" showattsigs="601" usesdiagramusefillcolour="0" x="768" y="430" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="90" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="3133" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<boxwidget usesdiagramfillcolour="1" width="979" usesdiagramusefillcolour="1" x="568" y="424" linewidth="none" fillcolour="none" height="1293" usefillcolor="1" isinstance="0" xmi.id="3299" showstereotype="1" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="#000000" />
|
||||
<floatingtext usesdiagramfillcolour="1" width="263" usesdiagramusefillcolour="1" x="539" y="423" linewidth="none" posttext="" role="700" fillcolour="none" height="24" usefillcolor="1" pretext="" isinstance="0" xmi.id="3320" showstereotype="1" text="Value holding of schema" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<boxwidget usesdiagramfillcolour="1" width="978" usesdiagramusefillcolour="1" x="536" y="0" linewidth="none" fillcolour="none" height="404" usefillcolor="1" isinstance="0" xmi.id="3966" showstereotype="1" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="#000000" />
|
||||
<floatingtext usesdiagramfillcolour="1" width="225" usesdiagramusefillcolour="1" x="559" y="10" linewidth="none" posttext="" role="700" fillcolour="none" height="22" usefillcolor="1" pretext="" isinstance="0" xmi.id="4017" text="Database schema reading facility" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<boxwidget usesdiagramfillcolour="1" width="464" usesdiagramusefillcolour="1" x="32" y="546" linewidth="none" fillcolour="none" height="849" usefillcolor="1" isinstance="0" xmi.id="4133" showstereotype="1" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="#000000" />
|
||||
<floatingtext usesdiagramfillcolour="1" width="184" usesdiagramusefillcolour="1" x="39" y="559" linewidth="none" posttext="" role="700" fillcolour="none" height="22" usefillcolor="1" pretext="" isinstance="0" xmi.id="4154" text="Structure rebuilding facility" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<boxwidget usesdiagramfillcolour="1" width="464" usesdiagramusefillcolour="1" x="34" y="5" linewidth="none" fillcolour="none" height="194" usefillcolor="1" isinstance="0" xmi.id="4175" showstereotype="1" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="#000000" />
|
||||
<floatingtext usesdiagramfillcolour="1" width="186" usesdiagramusefillcolour="1" x="26" y="5" linewidth="none" posttext="" role="700" fillcolour="none" height="22" usefillcolor="1" pretext="" isinstance="0" xmi.id="4196" showstereotype="1" text="Doctrine core additions" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<classwidget usesdiagramfillcolour="0" width="293" showattsigs="601" usesdiagramusefillcolour="0" x="118" y="679" drawascircle="0" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="45" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="4623" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,50,1,0,0,0,0" linecolor="#ff0000" />
|
||||
<notewidget usesdiagramfillcolour="1" width="156" usesdiagramusefillcolour="1" x="523" y="643" linewidth="none" fillcolour="none" height="79" usefillcolor="1" isinstance="0" xmi.id="6446" showstereotype="1" text="Holds information on a database" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<notewidget usesdiagramfillcolour="1" width="147" usesdiagramusefillcolour="1" x="1291" y="416" linewidth="none" fillcolour="none" height="98" usefillcolor="1" isinstance="0" xmi.id="6468" showstereotype="1" text="Holds information on one to many databases" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<notewidget usesdiagramfillcolour="1" width="159" usesdiagramusefillcolour="1" x="1371" y="1481" linewidth="none" fillcolour="none" height="83" usefillcolor="1" isinstance="0" xmi.id="6546" showstereotype="1" text="Holds information on a foreign key relation." font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<notewidget usesdiagramfillcolour="1" width="234" usesdiagramusefillcolour="1" x="1073" y="275" linewidth="none" fillcolour="none" height="69" usefillcolor="1" isinstance="0" xmi.id="7319" showstereotype="1" text="Reads a Propel XML schema definiton and constructs a database schema based on it" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<classwidget usesdiagramfillcolour="0" width="263" showattsigs="601" usesdiagramusefillcolour="0" x="1242" y="9" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="7384" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="1" width="214" showattsigs="601" usesdiagramusefillcolour="1" x="547" y="451" showopsigs="601" linewidth="none" fillcolour="none" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="7414" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="none" />
|
||||
<classwidget usesdiagramfillcolour="0" width="262" showattsigs="601" usesdiagramusefillcolour="0" x="209" y="1324" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="36" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="7640" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,0,0,0,0,0" linecolor="#ff0000" />
|
||||
<classwidget usesdiagramfillcolour="0" width="285" showattsigs="601" usesdiagramusefillcolour="0" x="1242" y="585" drawascircle="0" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="99" usefillcolor="1" showpubliconly="0" showattributes="1" isinstance="0" xmi.id="16973" showoperations="1" showpackage="0" showscope="1" font="Sans Serif,10,-1,5,75,1,0,0,0,0" linecolor="#ff0000" />
|
||||
<notewidget usesdiagramfillcolour="1" width="159" usesdiagramusefillcolour="1" x="1485" y="408" linewidth="none" fillcolour="none" height="114" usefillcolor="1" isinstance="0" xmi.id="17245" showstereotype="1" text="Catches any non-property call from child classes and throws an exception." font="Sans Serif,10,-1,0,50,0,0,0,0,0" linecolor="none" />
|
||||
<interfacewidget usesdiagramfillcolour="0" width="156" usesdiagramusefillcolour="0" x="1614" y="664" drawascircle="0" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="153" usefillcolor="1" showpubliconly="0" isinstance="0" xmi.id="20291" showoperations="1" showpackage="0" showscope="1" showstereotype="1" font="Sans Serif,10,-1,5,75,1,0,0,0,0" linecolor="#ff0000" />
|
||||
<interfacewidget usesdiagramfillcolour="0" width="102" usesdiagramusefillcolour="0" x="1648" y="864" drawascircle="0" showopsigs="601" linewidth="none" fillcolour="#ffffc0" height="63" usefillcolor="1" showpubliconly="0" isinstance="0" xmi.id="20362" showoperations="1" showpackage="0" showscope="1" showstereotype="1" font="Sans Serif,10,-1,5,75,1,0,0,0,0" linecolor="#ff0000" />
|
||||
<floatingtext usesdiagramfillcolour="1" width="99" usesdiagramusefillcolour="1" x="1586" y="609" linewidth="none" posttext="" role="700" fillcolour="none" height="22" usefillcolor="1" pretext="" isinstance="0" xmi.id="21344" showstereotype="1" text="SPL interfaces" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<boxwidget usesdiagramfillcolour="1" width="239" usesdiagramusefillcolour="1" x="1575" y="597" linewidth="none" fillcolour="none" height="363" usefillcolor="1" isinstance="0" xmi.id="46214" showstereotype="1" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="#000000" />
|
||||
</widgets>
|
||||
<messages/>
|
||||
<associations>
|
||||
<assocwidget totalcounta="3" indexa="2" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="1260" widgetaid="1213" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="327" starty="305" />
|
||||
<endpoint endx="375" endy="385" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="1296" widgetaid="1276" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="279" starty="1116" />
|
||||
<endpoint endx="240" endy="1196" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="1304" widgetaid="1195" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="876" starty="206" />
|
||||
<endpoint endx="876" endy="253" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="3" indexa="2" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="1308" widgetaid="1171" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="309" starty="853" />
|
||||
<endpoint endx="377" endy="889" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="1172" widgetaid="1310" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="1351" starty="1048" />
|
||||
<endpoint endx="1200" endy="983" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="1173" widgetaid="1312" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="1346" starty="1270" />
|
||||
<endpoint endx="1028" endy="1269" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" totalcountb="4" indexb="2" linewidth="none" widgetbid="1432" widgetaid="1195" xmi.id="1465" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="876" starty="134" />
|
||||
<endpoint endx="839" endy="86" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="5" indexa="1" visibilityB="200" totalcountb="3" indexb="1" linewidth="none" widgetbid="1173" widgetaid="1401" xmi.id="1475" type="510" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="736" starty="1439" />
|
||||
<endpoint endx="897" endy="1386" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="32" usesdiagramusefillcolour="1" x="682" y="1400" linewidth="none" posttext="" role="702" fillcolour="none" height="32" usefillcolor="1" pretext="" isinstance="0" xmi.id="42350" showstereotype="1" text="1" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<floatingtext usesdiagramfillcolour="1" width="130" usesdiagramusefillcolour="1" x="1863" y="1424" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="+" isinstance="0" xmi.id="42349" showstereotype="1" text="referencingFields" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="5" indexa="2" visibilityB="200" totalcountb="3" indexb="2" linewidth="none" widgetbid="1173" widgetaid="1401" xmi.id="1484" type="510" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="890" starty="1439" />
|
||||
<endpoint endx="962" endy="1386" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="32" usesdiagramusefillcolour="1" x="1055" y="1339" linewidth="none" posttext="" role="702" fillcolour="none" height="32" usefillcolor="1" pretext="" isinstance="0" xmi.id="42352" text="1" font="Sans Serif,10,-1,0,50,0,0,0,0,0" linecolor="none" />
|
||||
<floatingtext usesdiagramfillcolour="1" width="108" usesdiagramusefillcolour="1" x="1079" y="1373" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="+" isinstance="0" xmi.id="42351" showstereotype="1" text="referredFields" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" totalcountb="4" indexb="3" linewidth="none" widgetbid="1432" widgetaid="2546" xmi.id="2583" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="1190" starty="134" />
|
||||
<endpoint endx="923" endy="86" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="3" indexa="1" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="1437" widgetaid="3133" xmi.id="3774" type="510" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="895" starty="520" />
|
||||
<endpoint endx="943" endy="573" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="32" usesdiagramusefillcolour="1" x="861" y="535" linewidth="none" posttext="" role="702" fillcolour="none" height="32" usefillcolor="1" pretext="" isinstance="0" xmi.id="42354" text="*" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<floatingtext usesdiagramfillcolour="1" width="94" usesdiagramusefillcolour="1" x="948" y="547" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="+" isinstance="0" xmi.id="42353" text="childs" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" linewidth="none" widgetbid="4623" widgetaid="1171" xmi.id="4683" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="264" starty="790" />
|
||||
<endpoint endx="264" endy="724" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="3" indexa="1" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="4623" widgetaid="1213" xmi.id="4733" type="501" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="219" starty="305" />
|
||||
<endpoint endx="264" endy="679" />
|
||||
<point x="221" y="319" />
|
||||
<point x="219" y="288" />
|
||||
<point x="228" y="361" />
|
||||
<point x="229" y="372" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="32" usesdiagramusefillcolour="1" x="181" y="645" linewidth="none" posttext="" role="702" fillcolour="none" height="32" usefillcolor="1" pretext="" isinstance="0" xmi.id="42356" text="1" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<floatingtext usesdiagramfillcolour="1" width="72" usesdiagramusefillcolour="1" x="190" y="655" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="+" isinstance="0" xmi.id="42355" text="builder" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="6468" widgetaid="3133" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="1151" starty="475" />
|
||||
<endpoint endx="1291" endy="465" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="1437" widgetaid="6446" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="679" starty="682" />
|
||||
<endpoint endx="691" endy="681" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="1401" widgetaid="6546" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="1371" starty="1522" />
|
||||
<endpoint endx="1352" endy="1538" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="7319" widgetaid="2546" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="1190" starty="206" />
|
||||
<endpoint endx="1190" endy="275" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" linewidth="none" widgetbid="1213" widgetaid="1174" xmi.id="8028" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="166" starty="82" />
|
||||
<endpoint endx="273" endy="197" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="72" usesdiagramusefillcolour="1" x="140" y="133" linewidth="none" posttext="" role="703" fillcolour="none" height="22" usefillcolor="1" pretext="" isinstance="0" xmi.id="42357" text="delegates" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="3" indexa="1" totalcountb="2" indexb="1" linewidth="none" widgetbid="1276" widgetaid="1171" xmi.id="8862" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="218" starty="853" />
|
||||
<endpoint endx="279" endy="1071" />
|
||||
<point x="228" y="894" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="103" usesdiagramusefillcolour="1" x="253" y="982" linewidth="none" posttext="" role="703" fillcolour="none" height="22" usefillcolor="1" pretext="" isinstance="0" xmi.id="42358" text="get translation" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="4" indexb="1" linewidth="none" widgetbid="1432" widgetaid="1213" xmi.id="4416" type="501" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="435" starty="251" />
|
||||
<endpoint endx="755" endy="86" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="32" usesdiagramusefillcolour="1" x="729" y="91" linewidth="none" posttext="" role="702" fillcolour="none" height="32" usefillcolor="1" pretext="" isinstance="0" xmi.id="42360" showstereotype="1" text="1" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
<floatingtext usesdiagramfillcolour="1" width="69" usesdiagramusefillcolour="1" x="564" y="109" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="+" isinstance="0" xmi.id="42359" showstereotype="1" text="reader" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" linewidth="none" widgetbid="16973" widgetaid="1437" xmi.id="17131" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="1196" starty="681" />
|
||||
<endpoint endx="1242" endy="634" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="3" indexa="2" totalcountb="5" indexb="1" linewidth="none" widgetbid="16973" widgetaid="1172" xmi.id="17154" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="1014" starty="866" />
|
||||
<endpoint endx="1299" endy="684" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="6" indexa="5" totalcountb="5" indexb="2" linewidth="none" widgetbid="16973" widgetaid="1173" xmi.id="17222" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="995" starty="1152" />
|
||||
<endpoint endx="1356" endy="684" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="3" indexa="2" visibilityB="200" totalcountb="2" indexb="1" linewidth="none" widgetbid="17245" widgetaid="16973" roleBdoc="" documentation="" roleAdoc="" type="513" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="1432" starty="585" />
|
||||
<endpoint endx="1564" endy="522" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="5" indexa="4" totalcountb="5" indexb="3" linewidth="none" widgetbid="16973" widgetaid="1401" xmi.id="17376" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="1198" starty="1439" />
|
||||
<endpoint endx="1413" endy="684" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="3" indexa="2" visibilityB="200" totalcountb="5" indexb="3" linewidth="none" widgetbid="1401" widgetaid="1437" xmi.id="15281" type="510" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="1027" starty="789" />
|
||||
<endpoint endx="1044" endy="1439" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="149" usesdiagramusefillcolour="1" x="1814" y="1400" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="+" isinstance="0" xmi.id="42361" showstereotype="1" text="foreignKeyRelations" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="3" indexa="1" visibilityB="200" totalcountb="3" indexb="1" linewidth="none" widgetbid="1172" widgetaid="1437" xmi.id="2970" type="510" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="859" starty="789" />
|
||||
<endpoint endx="828" endy="866" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="57" usesdiagramusefillcolour="1" x="1144" y="834" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="+" isinstance="0" xmi.id="42362" text="childs" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="5" indexa="1" visibilityB="200" totalcountb="6" indexb="1" linewidth="none" widgetbid="1173" widgetaid="1172" xmi.id="1196" type="510" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="753" starty="1100" />
|
||||
<endpoint endx="864" endy="1152" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="94" usesdiagramusefillcolour="1" x="999" y="1116" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="+" isinstance="0" xmi.id="43899" showstereotype="1" text="uniqueKeys" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="5" indexa="2" visibilityB="200" totalcountb="6" indexb="2" linewidth="none" widgetbid="1173" widgetaid="1172" xmi.id="1412" type="510" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="865" starty="1100" />
|
||||
<endpoint endx="897" endy="1152" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="70" usesdiagramusefillcolour="1" x="1109" y="1122" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="+" isinstance="0" xmi.id="43904" showstereotype="1" text="indexes" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="5" indexa="3" visibilityB="200" totalcountb="6" indexb="3" linewidth="none" widgetbid="1173" widgetaid="1172" xmi.id="1193" type="510" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="976" starty="1100" />
|
||||
<endpoint endx="930" endy="1152" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="100" usesdiagramusefillcolour="1" x="1118" y="1122" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="+" isinstance="0" xmi.id="43909" showstereotype="1" text="primaryKeys" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="5" indexa="4" visibilityB="201" totalcountb="6" indexb="4" linewidth="none" widgetbid="1173" widgetaid="1172" xmi.id="10854" type="510" changeabilityA="900" changeabilityB="900" linecolor="none" visibilityA="200" >
|
||||
<linepath>
|
||||
<startpoint startx="1088" starty="1100" />
|
||||
<endpoint endx="962" endy="1152" />
|
||||
</linepath>
|
||||
<floatingtext usesdiagramfillcolour="1" width="51" usesdiagramusefillcolour="1" x="1125" y="1122" linewidth="none" posttext="" role="710" fillcolour="none" height="22" usefillcolor="1" pretext="-" isinstance="0" xmi.id="43914" showstereotype="1" text="childs" font="Sans Serif,10,-1,5,50,0,0,0,0,0" linecolor="none" />
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="3" indexa="2" totalcountb="3" indexb="1" linewidth="none" widgetbid="16973" widgetaid="3133" xmi.id="46395" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="1023" starty="520" />
|
||||
<endpoint endx="1337" endy="585" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" linewidth="none" widgetbid="20291" widgetaid="16973" xmi.id="46422" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="1527" starty="634" />
|
||||
<endpoint endx="1614" endy="740" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
<assocwidget totalcounta="5" indexa="4" totalcountb="2" indexb="1" linewidth="none" widgetbid="20362" widgetaid="16973" xmi.id="46509" linecolor="none" >
|
||||
<linepath>
|
||||
<startpoint startx="1470" starty="684" />
|
||||
<endpoint endx="1699" endy="864" />
|
||||
</linepath>
|
||||
</assocwidget>
|
||||
</associations>
|
||||
</diagram>
|
||||
</diagrams>
|
||||
<listview>
|
||||
<listitem open="1" type="800" label="Views" >
|
||||
<listitem open="1" type="801" label="Logical View" >
|
||||
<listitem open="1" type="813" id="1174" >
|
||||
<listitem open="0" type="815" id="1176" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="1276" >
|
||||
<listitem open="0" type="815" id="1284" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="1213" >
|
||||
<listitem open="0" type="814" id="4416" />
|
||||
<listitem open="0" type="814" id="4733" />
|
||||
<listitem open="0" type="815" id="1229" />
|
||||
<listitem open="0" type="815" id="8628" />
|
||||
<listitem open="0" type="815" id="8685" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="4623" >
|
||||
<listitem open="0" type="815" id="4640" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="1171" >
|
||||
<listitem open="0" type="815" id="1201" />
|
||||
<listitem open="0" type="815" id="6720" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="7640" />
|
||||
<listitem open="1" type="813" id="1432" >
|
||||
<listitem open="0" type="815" id="1434" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="1195" >
|
||||
<listitem open="0" type="814" id="1199" />
|
||||
<listitem open="0" type="815" id="1237" />
|
||||
<listitem open="0" type="815" id="1200" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="7384" />
|
||||
<listitem open="1" type="813" id="2546" >
|
||||
<listitem open="0" type="814" id="6397" />
|
||||
<listitem open="0" type="815" id="2558" />
|
||||
<listitem open="0" type="815" id="6410" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="3133" >
|
||||
<listitem open="0" type="814" id="3774" />
|
||||
<listitem open="0" type="815" id="12191" />
|
||||
<listitem open="0" type="815" id="13035" />
|
||||
<listitem open="0" type="815" id="15870" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="1173" >
|
||||
<listitem open="0" type="814" id="1182" />
|
||||
<listitem open="0" type="814" id="1184" />
|
||||
<listitem open="0" type="814" id="1185" />
|
||||
<listitem open="0" type="814" id="1404" />
|
||||
<listitem open="0" type="814" id="1408" />
|
||||
<listitem open="0" type="814" id="2842" />
|
||||
<listitem open="0" type="814" id="2848" />
|
||||
<listitem open="0" type="814" id="3472" />
|
||||
<listitem open="0" type="814" id="3545" />
|
||||
<listitem open="0" type="815" id="12470" />
|
||||
<listitem open="0" type="815" id="15461" />
|
||||
<listitem open="0" type="815" id="15468" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="1437" >
|
||||
<listitem open="0" type="814" id="2970" />
|
||||
<listitem open="0" type="814" id="1612" />
|
||||
<listitem open="0" type="814" id="3116" />
|
||||
<listitem open="0" type="814" id="3122" />
|
||||
<listitem open="0" type="814" id="3149" />
|
||||
<listitem open="0" type="814" id="3572" />
|
||||
<listitem open="0" type="814" id="15281" />
|
||||
<listitem open="0" type="815" id="12323" />
|
||||
<listitem open="0" type="815" id="13116" />
|
||||
<listitem open="0" type="815" id="15857" />
|
||||
<listitem open="0" type="815" id="33687" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="7414" />
|
||||
<listitem open="1" type="813" id="16973" >
|
||||
<listitem open="0" type="815" id="17044" />
|
||||
<listitem open="0" type="815" id="17088" />
|
||||
<listitem open="0" type="815" id="46548" />
|
||||
<listitem open="0" type="815" id="46562" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="1401" >
|
||||
<listitem open="0" type="814" id="1475" />
|
||||
<listitem open="0" type="814" id="1484" />
|
||||
<listitem open="0" type="814" id="1658" />
|
||||
<listitem open="0" type="814" id="1682" />
|
||||
<listitem open="0" type="814" id="1713" />
|
||||
<listitem open="0" type="814" id="1942" />
|
||||
<listitem open="0" type="814" id="2448" />
|
||||
<listitem open="0" type="815" id="1552" />
|
||||
<listitem open="0" type="815" id="12848" />
|
||||
<listitem open="0" type="815" id="15332" />
|
||||
</listitem>
|
||||
<listitem open="1" type="813" id="1172" >
|
||||
<listitem open="0" type="814" id="10854" />
|
||||
<listitem open="0" type="814" id="1196" />
|
||||
<listitem open="0" type="814" id="1412" />
|
||||
<listitem open="0" type="814" id="1180" />
|
||||
<listitem open="0" type="814" id="1193" />
|
||||
<listitem open="0" type="814" id="3483" />
|
||||
<listitem open="0" type="814" id="3561" />
|
||||
<listitem open="0" type="814" id="2869" />
|
||||
<listitem open="0" type="815" id="12527" />
|
||||
<listitem open="0" type="815" id="14734" />
|
||||
<listitem open="0" type="815" id="15514" />
|
||||
<listitem open="0" type="815" id="33801" />
|
||||
</listitem>
|
||||
<listitem open="1" type="817" id="20362" >
|
||||
<listitem open="0" type="815" id="20453" />
|
||||
</listitem>
|
||||
<listitem open="1" type="817" id="20291" >
|
||||
<listitem open="0" type="815" id="34688" />
|
||||
</listitem>
|
||||
<listitem open="1" type="818" id="32898" />
|
||||
<listitem open="1" type="830" label="Datatypes" >
|
||||
<listitem open="1" type="829" id="10754" />
|
||||
<listitem open="1" type="829" id="10628" />
|
||||
<listitem open="1" type="829" id="10655" />
|
||||
<listitem open="1" type="829" id="10721" />
|
||||
<listitem open="1" type="829" id="10664" />
|
||||
<listitem open="1" type="829" id="16856" />
|
||||
<listitem open="1" type="829" id="10804" />
|
||||
<listitem open="1" type="829" id="10646" />
|
||||
</listitem>
|
||||
</listitem>
|
||||
<listitem open="1" type="802" label="Use Case View" />
|
||||
<listitem open="1" type="821" label="Component View" />
|
||||
<listitem open="1" type="827" label="Deployment View" />
|
||||
<listitem open="1" type="836" label="Entity Relationship Model" />
|
||||
</listitem>
|
||||
</listview>
|
||||
<codegeneration>
|
||||
<codegenerator language="PHP5" />
|
||||
</codegeneration>
|
||||
</XMI.extensions>
|
||||
</XMI>
|
@ -1,160 +0,0 @@
|
||||
<table width=100% cellspacing=0 cellpadding=0>
|
||||
<tr>
|
||||
<td class='bordered' valign='top'>
|
||||
<?php
|
||||
if ( ! isset($_GET['chapter'])) {
|
||||
|
||||
foreach ($i as $k => $v) {
|
||||
$indexes = explode('.', $v['index']);
|
||||
$level = count($indexes);
|
||||
$e = explode(' - ', $v['name']);
|
||||
$file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'docs' . DIRECTORY_SEPARATOR . $v['name'] . '.php';
|
||||
|
||||
print '<div class=level' . $level . '><font class=level' . $level . '> '. $v['index'] . '. <a href=documentation2.php?chapter='
|
||||
. urlencode($v['name']) . ">" . end($e) ."</a></font>";
|
||||
if ( ! file_exists($file)) {
|
||||
//print "<font color='red'>[code]</font>";
|
||||
}
|
||||
print "</div>";
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<table width=100% cellspacing=5 cellpadding=1>
|
||||
<tr>
|
||||
<td align='center' colspan=2>
|
||||
<b class='title'>
|
||||
<?php
|
||||
$chapter = array_shift($parts);
|
||||
print 'Chapter ' . $indexes[0] . '. ' . $chapter;
|
||||
?>
|
||||
</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align='left'>
|
||||
<?php
|
||||
if(isset($prev)) {
|
||||
?>
|
||||
<b><a href=documentation2.php?chapter=<?php print urlencode($prev['name']); ?>>Prev</a></b>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td align='right'>
|
||||
<?php
|
||||
if(isset($next)) {
|
||||
?>
|
||||
<b><a href=documentation2.php?chapter=<?php print urlencode($next['name']); ?>>Next</a></b></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
|
||||
|
||||
<b class='title'>
|
||||
<?php
|
||||
|
||||
//print implode('.', $indexes) . '. ' . implode(' - ', $parts);
|
||||
?>
|
||||
</b>
|
||||
<hr>
|
||||
<b class='title'>
|
||||
<?php
|
||||
print implode('.', $indexes) . '. ';
|
||||
$stack = array();
|
||||
$links = array();
|
||||
$tmp = array_merge(array($chapter), $parts);
|
||||
foreach($tmp as $k => $v) {
|
||||
$stack[] = $v;
|
||||
$links[] = "<a href=documentation2.php?chapter=" . urlencode(implode(' - ', $stack)) . '>' . $v . '</a>';
|
||||
}
|
||||
print implode(' - ', $links);
|
||||
?>
|
||||
<br \>
|
||||
</b>
|
||||
<hr class='small'>
|
||||
<?php
|
||||
if ($subchapters) {
|
||||
?>
|
||||
<b class='title'>
|
||||
<div class='level1'> Table of contents</div>
|
||||
</b>
|
||||
<?php
|
||||
for ($x = $foundKey; $x < count($i); $x++) {
|
||||
$p = explode(' - ', $i[$x]['name']);
|
||||
$count = (count($parts) + 1);
|
||||
$l = count($p) - count($parts);
|
||||
while($count--) {
|
||||
array_shift($p);
|
||||
}
|
||||
if ( ! empty($p)) {
|
||||
print "<div class=level" . $l . '><font class=level' . $l . '>' . $i[$x]['index'];
|
||||
?>
|
||||
|
||||
<a href=documentation2.php?chapter=<?php print urlencode($i[$x]['name']) . '>' . end($p); ?></a>
|
||||
</font></div>
|
||||
<?php
|
||||
}
|
||||
if (strncmp($i[$x]['name'], $_GET['chapter'], strlen($_GET['chapter'])) !== 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$doc->renderBlock($found['name']);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td width=10>
|
||||
</td>
|
||||
<td valign='top' width=300>
|
||||
<div class='smallmenu'>
|
||||
<font class=smallmenu> -- <a href=documentation2.php>index</a></font><br \>
|
||||
<?php
|
||||
foreach ($i as $k => $v) {
|
||||
$indexes = explode('.', $v['index']);
|
||||
$level = count($indexes);
|
||||
$e = explode(' - ', $v['name']);
|
||||
if($level === 1) {
|
||||
$level++;
|
||||
print '<font class=smallmenu> '. $v['index'] . '. <a href=documentation2.php?chapter='
|
||||
. urlencode($v['name']) . ">" . end($e) ."</a></font><br \>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
@ -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
|
@ -1,29 +0,0 @@
|
||||
WORK IN PROGRESS!!!
|
||||
|
||||
Please feel free to contribute, but these docs are currently being developed
|
||||
by Ian P. Christian <pookey@pookey.co.uk>.
|
||||
|
||||
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.
|
@ -1,373 +0,0 @@
|
||||
<chapter id="connection-management">
|
||||
<title>Connection Management</title>
|
||||
<sect1 id="dsn">
|
||||
<title>DSN, the Data Source Name</title>
|
||||
<para>
|
||||
In order to connect to a database through Doctrine, you have to create a
|
||||
valid DSN - data source name.
|
||||
</para>
|
||||
<para>
|
||||
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 <ulink
|
||||
url="http://www.php.net/manual/en/function.PDO-construct.php">http://www.php.net/manual/en/function.PDO-construct.php.</ulink>
|
||||
</para>
|
||||
<para>
|
||||
The DSN consists in the following parts:
|
||||
</para>
|
||||
<variablelist>
|
||||
<title>DSN components</title>
|
||||
<varlistentry>
|
||||
<term>phptype</term>
|
||||
<listitem>
|
||||
Database backend used in PHP (i.e. mysql , pgsql etc.)
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>dbsyntax</term>
|
||||
<listitem>
|
||||
Database used with regards to SQL syntax etc.
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>protocol</term>
|
||||
<listitem>
|
||||
Communication protocol to use ( i.e. tcp, unix etc.)
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>hostspec</term>
|
||||
<listitem>
|
||||
Host specification (hostname[:port])
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>database</term>
|
||||
<listitem>
|
||||
Database to use on the DBMS server
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>username</term>
|
||||
<listitem>
|
||||
User name for login
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>password</term>
|
||||
<listitem>
|
||||
Password for login
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>proto_opts</term>
|
||||
<listitem>
|
||||
Maybe used with protocol
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>option</term>
|
||||
<listitem>
|
||||
option: Additional connection options in URI query string format. options get separated by &. The Following table shows a non complete list of options:
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<variablelist>
|
||||
<title>List of Options</title>
|
||||
<varlistentry>
|
||||
<term>name</term>
|
||||
<listitem>
|
||||
Some backends support setting the client charset.
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>new_link</term>
|
||||
<listitem>
|
||||
Some RDBMS do not create new connections when connecting to the same
|
||||
host multiple times. This option will attempt to force a new
|
||||
connection
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>
|
||||
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:
|
||||
</para>
|
||||
<programlisting>
|
||||
phptype(dbsyntax)://username:password@protocol+hostspec/database?option=value
|
||||
</programlisting>
|
||||
|
||||
|
||||
<para>
|
||||
Most variations are allowed:
|
||||
</para>
|
||||
<programlisting>
|
||||
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
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
The currently supported database backends are:
|
||||
</para>
|
||||
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
|
||||
|
||||
<para>
|
||||
A second DSN format is supported phptype(syntax)://user:pass@protocol(proto_opts)/database
|
||||
</para>
|
||||
|
||||
|
||||
<para>
|
||||
If your database, option values, username or password contain characters used to delineate DSN parts, you can escape them via URI hex encodings:
|
||||
</para>
|
||||
: = %3a
|
||||
/ = %2f
|
||||
@ = %40
|
||||
+ = %2b
|
||||
( = %28
|
||||
) = %29
|
||||
? = %3f
|
||||
= = %3d
|
||||
& = %26
|
||||
|
||||
|
||||
<important>
|
||||
Please note, that some features may be not supported by all database backends.
|
||||
</important>
|
||||
|
||||
<example>
|
||||
<title>Connect to database through a socket</title>
|
||||
<programlisting>
|
||||
mysql://user@unix(/path/to/socket)/pear
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Connect to database on a non standard port</title>
|
||||
<programlisting>
|
||||
pgsql://user:pass@tcp(localhost:5555)/pear
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Connect to SQLite on a Unix machine using options</title>
|
||||
<programlisting>
|
||||
sqlite:////full/unix/path/to/file.db?mode=0666
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Connect to SQLite on a Windows machine using options</title>
|
||||
<programlisting>
|
||||
sqlite:///c:/full/windows/path/to/file.db?mode=0666
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Connect to MySQLi using SSL</title>
|
||||
<programlisting>
|
||||
mysqli://user:pass@localhost/pear?key=client-key.pem&cert=client-cert.pem
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<sect1 id="new-conn">
|
||||
<title>Opening a new connection</title>
|
||||
|
||||
<para>
|
||||
Opening a new database connection in Doctrine is very easy. If you wish
|
||||
to use PDO (<ulink url="http://www.php.net/PDO">www.php.net/PDO</ulink>)
|
||||
you can just initalize a new PDO object:
|
||||
</para>
|
||||
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
$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();
|
||||
}
|
||||
?>]]></programlisting>
|
||||
|
||||
<para>
|
||||
If your database extension isn't supported by PDO you can use special
|
||||
Doctrine_Adapter class (if availible). The following example uses DB2
|
||||
adapter:
|
||||
</para>
|
||||
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
$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();
|
||||
}
|
||||
?>]]></programlisting>
|
||||
|
||||
<para>
|
||||
The next step is opening a new Doctrine_Connection.
|
||||
</para>
|
||||
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
$conn = Doctrine_Manager::connection($dbh);
|
||||
?>]]></programlisting>
|
||||
</sect1>
|
||||
<sect1 id="lazy-conn">
|
||||
<title>Lazy Connections</title>
|
||||
<para>
|
||||
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).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
// 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');
|
||||
?>]]></programlisting>
|
||||
</sect1>
|
||||
<sect1 id="managing-conn">
|
||||
<title>Managing Connections</title>
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
// Doctrine_Manager controls all the connections
|
||||
$manager = Doctrine_Manager::getInstance();
|
||||
|
||||
// open first connection
|
||||
$conn = $manager->openConnection(new PDO('dsn','username','password'), 'connection 1');
|
||||
?>]]></programlisting>
|
||||
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
// open first connection
|
||||
$conn = Doctrine_Manager::connection(new PDO('dsn','username','password'), 'connection 1');
|
||||
|
||||
$conn2 = Doctrine_Manager::connection();
|
||||
// $conn2 == $conn
|
||||
?>]]></programlisting>
|
||||
|
||||
<para>
|
||||
The current connection is the lastly opened connection.
|
||||
</para>
|
||||
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
// open second connection
|
||||
$conn2 = $manager->openConnection(new PDO('dsn2','username2','password2'), 'connection 2');
|
||||
|
||||
$manager->getCurrentConnection(); // $conn2
|
||||
?>]]></programlisting>
|
||||
|
||||
<para>
|
||||
You can change the current connection by calling setCurrentConnection().
|
||||
</para>
|
||||
|
||||
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
|
||||
$manager->setCurrentConnection('connection 1');
|
||||
|
||||
$manager->getCurrentConnection(); // $conn
|
||||
|
||||
?>]]></programlisting>
|
||||
|
||||
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
// iterating through connections
|
||||
foreach($manager as $conn) {
|
||||
|
||||
}
|
||||
?>]]></programlisting>
|
||||
</sect1>
|
||||
<sect1 id="conn-component-binding">
|
||||
<title>Connection-component binding</title>
|
||||
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
$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();
|
||||
?>]]></programlisting>
|
||||
</sect1>
|
||||
</chapter>
|
@ -1,147 +0,0 @@
|
||||
<?xml version="1.0" encoding='ISO-8859-1'?>
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
|
||||
|
||||
[
|
||||
<!ENTITY chap1 SYSTEM "intro.xml">
|
||||
<!ENTITY chap2 SYSTEM "conn-mgt.xml">
|
||||
]>
|
||||
|
||||
<book id="doctrinebook">
|
||||
|
||||
<bookinfo>
|
||||
<title>Doctrine Documentation</title>
|
||||
<author>
|
||||
<firstname>Konsta</firstname>
|
||||
<surname>Vesterinen</surname>
|
||||
<authorblurb>The creator and lead developer.</authorblurb>
|
||||
</author>
|
||||
<author>
|
||||
<firstname>Ian</firstname>
|
||||
<othername>P.</othername>
|
||||
<surname>Christian</surname>
|
||||
<email>pookey@pookey.co.uk</email>
|
||||
<authorblurb>Junior developer and documentation maintainer.</authorblurb>
|
||||
</author>
|
||||
<copyright>
|
||||
<holder>Doctrine Project</holder>
|
||||
<year>2007</year>
|
||||
</copyright>
|
||||
<legalnotice id="legalnotice">
|
||||
<para>
|
||||
The contents of this document are licensed under the Creative Commons
|
||||
<ulink url="http://creativecommons.org/licenses/by-sa/2.0/">Attribution-ShareAlike License</ulink>.
|
||||
</para>
|
||||
</legalnotice>
|
||||
|
||||
<abstract>
|
||||
<para>
|
||||
Documentation for the PHP Doctrine project.
|
||||
</para>
|
||||
<para>
|
||||
This document was generated <?dbtimestamp format="Y-m-d H:M:S"?>.
|
||||
</para>
|
||||
</abstract>
|
||||
</bookinfo>
|
||||
|
||||
&chap1;
|
||||
&chap2;
|
||||
|
||||
<chapter id="object-relational-mapping">
|
||||
<title>Object Relational Mapping</title>
|
||||
</chapter>
|
||||
|
||||
<chapter id="working-with-objects">
|
||||
<title>Working With Objects</title>
|
||||
</chapter>
|
||||
|
||||
<chapter id="configuration">
|
||||
<title>Configuration</title>
|
||||
</chapter>
|
||||
|
||||
<chapter id="advanced-components">
|
||||
<title>Advanced Components</title>
|
||||
</chapter>
|
||||
|
||||
<chapter id="dql">
|
||||
<title>DQL (Doctrine Query Lanaguage)</title>
|
||||
<sect1 id="dql-intro">
|
||||
<title>Introduction</title>
|
||||
<para>
|
||||
Doctrine Query Language(DQL) is an Object Query Language created for helping users in complex object retrieval.
|
||||
</para>
|
||||
<para>
|
||||
You should always consider using DQL(or raw SQL) when retrieving relational data efficiently (eg. when fetching users and their phonenumbers).
|
||||
</para>
|
||||
<para>
|
||||
When compared to using raw SQL, DQL has several benefits:
|
||||
</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para>From the start it has been designed to retrieve records(objects) not result set rows.</para></listitem>
|
||||
<listitem><para>DQL understands relations so you don't have to type manually sql joins and join conditions.</para></listitem>
|
||||
<listitem><para>DQL is portable on different databases</para></listitem>
|
||||
<listitem><para>DQL has some very complex built-in algorithms like (the record limit algorithm) which can help developer to efficiently retrieve objects.</para></listitem>
|
||||
<listitem><para>It supports some functions that can save time when dealing with one-to-many, many-to-many relational data with conditional fetching.</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para>
|
||||
If the power of DQL isn't enough, you should consider using the rawSql API for object population.
|
||||
</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";
|
||||
}
|
||||
}
|
||||
?>]]></programlisting>
|
||||
</sect1>
|
||||
|
||||
</chapter>
|
||||
|
||||
<chapter id="native-sql">
|
||||
<title>Native SQL</title>
|
||||
</chapter>
|
||||
|
||||
<chapter id="transactions">
|
||||
<title>Transactions</title>
|
||||
</chapter>
|
||||
|
||||
<chapter id="caching">
|
||||
<title>Caching</title>
|
||||
</chapter>
|
||||
|
||||
<chapter id="database-abstraction">
|
||||
<title>Database Abstraction</title>
|
||||
</chapter>
|
||||
|
||||
<chapter id="technology">
|
||||
<title>Technology</title>
|
||||
</chapter>
|
||||
|
||||
<chapter id="real-world-examples">
|
||||
<title>Real World Examples</title>
|
||||
</chapter>
|
||||
|
||||
<chapter id="coding-standards">
|
||||
<title>Coding Standards</title>
|
||||
</chapter>
|
||||
|
||||
</book>
|
@ -1,397 +0,0 @@
|
||||
<chapter id="introduction">
|
||||
<title>Introduction</title>
|
||||
<sect1 id="about-doctrine">
|
||||
<title>About Doctrine</title>
|
||||
<para>
|
||||
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).
|
||||
</para>
|
||||
<para>
|
||||
Doctrine Query Language implements EJB 3 OQL specificiation and expands
|
||||
it a bit further (it has special LIMIT and OFFSET clauses).
|
||||
</para>
|
||||
<sect2 id="intro-example">
|
||||
<title>Example</title>
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
|
||||
// include the doctrine library
|
||||
require_once('lib/Doctrine.php');
|
||||
|
||||
// register the doctrine autoload function
|
||||
spl_autoload_register(array('Doctrine', 'autoload'));
|
||||
|
||||
// define the user class
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
// 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!
|
||||
}
|
||||
?>]]></programlisting>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="features">
|
||||
<title>Features</title>
|
||||
<sect3 id="features-general">
|
||||
<title>
|
||||
General Features
|
||||
</title>
|
||||
<itemizedlist>
|
||||
<listitem>Fully object-oriented following best practices and design patterns</listitem>
|
||||
<listitem>Multiple databases</listitem>
|
||||
<listitem>Database connection pooling with connection-record -registry</listitem>
|
||||
<listitem>Runtime configuration (no XML needed!)</listitem>
|
||||
<listitem>Very modular structure (only uses the needed features)</listitem>
|
||||
<listitem>The runtime components can be compiled into a single fileM</listitem>
|
||||
<listitem>Leveled configuration (attributes can be set at global, connection and table levels)</listitem>
|
||||
</itemizedlist>
|
||||
</sect3>
|
||||
<sect3 id="features-abstraction">
|
||||
<title>
|
||||
Database Abstraction
|
||||
</title>
|
||||
<itemizedlist>
|
||||
<listitem>A DSN (data source name) or array format for specifying database servers</listitem>
|
||||
<listitem>Datatype abstraction and on demand datatype conversion</listitem>
|
||||
<listitem>supports PDO</listitem>
|
||||
<listitem>Database query profiling</listitem>
|
||||
<listitem>Query caching</listitem>
|
||||
<listitem>Sequence / autoincrement emulation</listitem>
|
||||
<listitem>Replace emulation</listitem>
|
||||
<listitem>RDBMS management methods (creating, dropping, altering)</listitem>
|
||||
<listitem>SQL function call abstraction</listitem>
|
||||
<listitem>SQL expression abstraction</listitem>
|
||||
<listitem>Pattern matching abstraction</listitem>
|
||||
<listitem>Portable error codes</listitem>
|
||||
<listitem>Nested transactions</listitem>
|
||||
<listitem>Transaction isolation abstraction</listitem>
|
||||
<listitem>Transaction savepoint abstraction</listitem>
|
||||
<listitem>Index/Unique Key/Primary Key support</listitem>
|
||||
<listitem>Ability to read the information schema</listitem>
|
||||
<listitem>Reverse engineering schemas from an existing database</listitem>
|
||||
<listitem>LIMIT / OFFSET emulation </listitem>
|
||||
</itemizedlist>
|
||||
</sect3>
|
||||
<sect3 id="features-orm">
|
||||
<title>
|
||||
Object Relational Mapping
|
||||
</title>
|
||||
<sect4 id="features-orm-general">
|
||||
<title>
|
||||
General Features
|
||||
</title>
|
||||
<itemizedlist>
|
||||
<listitem>Validators</listitem>
|
||||
<listitem>Transactional errorStack for easy retrieval of all errors</listitem>
|
||||
<listitem>EventListeners</listitem>
|
||||
<listitem>UnitOfWork pattern (easy saving of all pending objects)</listitem>
|
||||
<listitem>Uses ActiveRecord pattern</listitem>
|
||||
<listitem>State-wise records and transactions</listitem>
|
||||
<listitem>Importing existing database schemas to Doctrine ActiveRecord objects</listitem>
|
||||
<listitem>Exporting Doctrine ActiveRecords to database (= automatic table creation)</listitem>
|
||||
</itemizedlist>
|
||||
</sect4>
|
||||
<sect4 id="features-orm-mapping">
|
||||
<title>
|
||||
Mapping
|
||||
</title>
|
||||
<itemizedlist>
|
||||
<listitem>Composite, Natural, Autoincremented and Sequential identifiers</listitem>
|
||||
<listitem>PHP Array / Object data types for columns (automatic serialization/unserialization)</listitem>
|
||||
<listitem>Gzip datatype for all databases</listitem>
|
||||
<listitem>Emulated enum datatype for all databases</listitem>
|
||||
<listitem>Datatype abstraction</listitem>
|
||||
<listitem>Column aggregation inheritance</listitem>
|
||||
<listitem>One-class-one-table inheritance as well as One-table</listitem>
|
||||
<listitem>One-to-many, many-to-one, one-to-one and many-to-many relations</listitem>
|
||||
<listitem>Self-referencing relations even for association table relations</listitem>
|
||||
<listitem>Relation aliases</listitem>
|
||||
</itemizedlist>
|
||||
</sect4>
|
||||
|
||||
<sect4 id="features-orm-population">
|
||||
<title>
|
||||
Object population
|
||||
</title>
|
||||
<itemizedlist>
|
||||
<listitem>DQL (Doctrine Query Language), an EJB 3 spec compliant OQL</listitem>
|
||||
<listitem>The limit-subquery-algorithm</listitem>
|
||||
<listitem>OO-style query API for both DQL and raw SQL</listitem>
|
||||
<listitem>Object population from database views</listitem>
|
||||
<listitem>Object population through raw SQL</listitem>
|
||||
</itemizedlist>
|
||||
</sect4>
|
||||
|
||||
<sect4 id="features-orm-locking">
|
||||
<title>
|
||||
Transactions and locking
|
||||
</title>
|
||||
<itemizedlist>
|
||||
<listitem>Pessimistic offline locking</listitem>
|
||||
<listitem>Savepoints, transaction isolation levels and nested transactions</listitem>
|
||||
<listitem>Transactional query optimization (gathering of DELETE statements) </listitem>
|
||||
</itemizedlist>
|
||||
</sect4>
|
||||
</sect3>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="requirements">
|
||||
<title>Requirements</title>
|
||||
<para>
|
||||
Doctrine requires PHP >= 5.1, and it doesn't require any external libraries.
|
||||
It runs on both windows and *nix based platforms.
|
||||
</para>
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
<para>
|
||||
Doctrine also requires a little adodb-hack for table creation,
|
||||
which comes with doctrine.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="community">
|
||||
<title>Community</title>
|
||||
<para>
|
||||
Doctrine has 3 mailing lists, an IRC channel, a forum, and a wiki/trac.
|
||||
</para>
|
||||
<sect2 id="community-mailinglist">
|
||||
<title>Mailing Lists</title>
|
||||
<para>
|
||||
The 'user' mailing list is for discussing the usage of doctrine.
|
||||
To subscribe to this list, send a blank email to
|
||||
<email>doctrine-user+subscribe@lists.pengus.net</email>
|
||||
</para>
|
||||
<para>
|
||||
The 'dev' mailing list is used for discussion of the development
|
||||
of doctrine. To subscribe to this list, send a blank email to
|
||||
<email>doctrine-dev+subscribe@lists.pengus.net</email>
|
||||
</para>
|
||||
<para>
|
||||
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
|
||||
<email>doctrine-svn+subscribe@lists.pengus.net</email>
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2 id="community-irc">
|
||||
<title>IRC</title>
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2 id="community-wiki">
|
||||
<title>Wiki and Trac</title>
|
||||
<para>
|
||||
A wiki/trac install can be found at <ulink
|
||||
url="http://doctrine.pengus.net/trac">http://doctrine.pengus.net/trac</ulink>
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2 id="community-forum">
|
||||
<title>Forum</title>
|
||||
<para>
|
||||
The Doctrine forum can be found here:
|
||||
<ulink url="http://www.phpbbserver.com/phpdoctrine/">http://www.phpbbserver.com/phpdoctrine/</ulink>
|
||||
</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="contributing">
|
||||
<title>Contributing/Reporting Bugs</title>
|
||||
<para>
|
||||
Doctrine is constantly under development, and is always happy for new
|
||||
developers to contribute to the project.
|
||||
</para>
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
<para>
|
||||
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.
|
||||
</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 <ulink url="http://subversion.tigris.org/">subversion</ulink>
|
||||
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>mkdir <replaceable>doctrine</replaceable></command>
|
||||
<prompt>bash $ </prompt><command>cd <replaceable>doctrine</replaceable></command>
|
||||
<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, you must first include the main
|
||||
library file called 'Doctrine.php'.
|
||||
</para>
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
require_once('path-to-doctrine/lib/Doctrine.php');
|
||||
?>]]></programlisting>
|
||||
<para>
|
||||
Doctrine supports <ulink
|
||||
url="http://www.php.net/autoload">Autoloading</ulink> 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.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can use the <emphasis>__autoload</emphasis> function to call the
|
||||
'Doctrine::autoload($class)' method, for example:
|
||||
</para>
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
function __autoload($class) {
|
||||
Doctrine::autoload($class);
|
||||
}
|
||||
?>]]></programlisting>
|
||||
|
||||
<para>
|
||||
If your project already uses autoload or you have other libraries
|
||||
that use it, you can use <ulink
|
||||
url="http://www.php.net/manual/en/function.spl-autoload-register.php">spl_autoload_register</ulink>
|
||||
to register multiple autoloading functions.
|
||||
</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 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.
|
||||
</para>
|
||||
<para>
|
||||
In cases where this might fail, a Doctrine_Exception is thrown 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>
|
||||
|
||||
<sect1 id="new-project">
|
||||
<title>Starting a new project</title>
|
||||
<para>
|
||||
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 <ulink
|
||||
url="http://www.martinfowler.com/eaaCatalog/activeRecord.html">Active
|
||||
Record pattern</ulink>
|
||||
</para>
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
<para>
|
||||
Below is a short example:
|
||||
</para>
|
||||
<para>
|
||||
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:
|
||||
</para>
|
||||
<programlisting role="php"><![CDATA[
|
||||
<?php
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
?>]]></programlisting>
|
||||
<para>
|
||||
We now have a user model that supports basic CRUD opperations!
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
@ -1,9 +0,0 @@
|
||||
<?xml version='1.0'?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets-1.70.1/xhtml/chunk.xsl"/>
|
||||
<xsl:import href="/home/clients/jhassine/doctrine/trunk/manual/docbook/programlisting/colorer.xsl"/>
|
||||
<xsl:import href="/home/clients/jhassine/doctrine/trunk/manual/docbook/programlisting/colorer-html.xsl"/>
|
||||
<xsl:param name="html.stylesheet" select="'../doctrine.css'"/>
|
||||
<xsl:param name="section.autolabel" select="1"/>
|
||||
<xsl:param name="section.label.includes.component.label" select="1"/><!-- adds section numbering, ie '1.3.1. Mailing Lists' -->
|
||||
</xsl:stylesheet>
|
@ -1,9 +0,0 @@
|
||||
body, p, td
|
||||
{
|
||||
font-family: arial, "lucida console", sans-serif
|
||||
}
|
||||
.programlisting
|
||||
{
|
||||
margin: 10px;
|
||||
background-color: #eeeeee;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<?xml version='1.0'?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets-1.70.1/xhtml/docbook.xsl"/>
|
||||
<xsl:import href="/home/clients/jhassine/doctrine/trunk/manual/docbook/programlisting/colorer.xsl"/>
|
||||
<xsl:import href="/home/clients/jhassine/doctrine/trunk/manual/docbook/programlisting/colorer-html.xsl"/>
|
||||
<xsl:param name="html.stylesheet" select="'doctrine.css'"/>
|
||||
<xsl:param name="section.autolabel" select="1"/>
|
||||
<xsl:param name="section.label.includes.component.label" select="1"/><!-- adds section numbering, ie '1.3.1. Mailing Lists' -->
|
||||
</xsl:stylesheet>
|
@ -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
|
||||
|
@ -1,64 +0,0 @@
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:syn="http://ns.laxan.com/text-vimcolor/1" version="1.0">
|
||||
<!-- $Id: colorer-html.xsl,v 1.2 2006/04/29 05:48:16 olpa Exp $ -->
|
||||
|
||||
<xsl:template match="syn:Comment">
|
||||
<span style="color:#0000FF;">
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Constant">
|
||||
<span style="color:#FF00FF;">
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Identifier">
|
||||
<span style="color:#008B8B;">
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Statement">
|
||||
<span style="color:#A52A2A; font-weight:bold;">
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:PreProc">
|
||||
<span style="color:#A020F0;">
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Type">
|
||||
<span style="color:#2E8B57; font-weight:bold;">
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Special">
|
||||
<span style="color:#6A5ACD;">
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Underlined">
|
||||
<span style="color:#000000; text-decoration:underline;">
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Error">
|
||||
<span style="color:#FFFFFF; background:#FF0000 none;">
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Todo">
|
||||
<span style="color:#0000FF; background: #FFFF00 none;">
|
||||
<xsl:apply-templates />
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@ -1,22 +0,0 @@
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
|
||||
version = "1.0"
|
||||
xmlns:s = "http://xsieve.sourceforge.net"
|
||||
xmlns:syn = "http://ns.laxan.com/text-vimcolor/1"
|
||||
extension-element-prefixes="s">
|
||||
<!-- $Id: colorer-one.xsl,v 1.1 2006/05/22 04:23:51 olpa Exp $ -->
|
||||
|
||||
<xsl:import href="colorer.xsl" />
|
||||
|
||||
<xsl:template match="node()|@*">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="node()|@*" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="programlisting | screen[starts-with(@role,'colorer:')]">
|
||||
<xsl:apply-imports />
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
@ -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)))))))))))))
|
@ -1,54 +0,0 @@
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
|
||||
version = "1.0"
|
||||
xmlns:s = "http://xsieve.sourceforge.net"
|
||||
xmlns:syn = "http://ns.laxan.com/text-vimcolor/1"
|
||||
extension-element-prefixes="s">
|
||||
<!-- $Id: colorer.xsl,v 1.6 2006/04/29 04:30:03 olpa Exp $ -->
|
||||
|
||||
<xsl:param name="colorer.bin">/home/clients/jhassine/doctrine/trunk/manual/docbook/programlisting/vimcolor/vimcolor-wrapper</xsl:param>
|
||||
<xsl:param name="colorer.params">--format xml</xsl:param>
|
||||
<xsl:param name="colorer.param.type">--filetype </xsl:param>
|
||||
<xsl:param name="colorer.param.outfile">--output </xsl:param>
|
||||
|
||||
<s:init>
|
||||
(load-from-path "sxml-utils.scm")
|
||||
(load-from-path "colorer.scm")
|
||||
(load-from-path "run-colorer.scm")
|
||||
</s:init>
|
||||
|
||||
<!-- ProgramListing is colorized -->
|
||||
<xsl:template match="programlisting[parent::syn:syntax] | screen[parent::syn:syntax]" priority="2">
|
||||
<xsl:apply-imports/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Colorize ProgramListing -->
|
||||
<xsl:template match="programlisting | screen[starts-with(@role,'colorer:')]">
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="self::screen"><xsl:value-of select="substring-after(@role,':')"/></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="@role"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<s:scheme>
|
||||
(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))))
|
||||
</s:scheme>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:syntax">
|
||||
<xsl:apply-templates select="node()"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
@ -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
|
@ -1 +0,0 @@
|
||||
xsieve/experiments/programlisting/colors
|
@ -1 +0,0 @@
|
||||
:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve
|
@ -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 $< >$@
|
@ -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
|
||||
);
|
@ -1,12 +0,0 @@
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
|
||||
version = "1.0">
|
||||
|
||||
<xsl:template match="node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
@ -1,58 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Syntax highlighting for DocBook program listings</title>
|
||||
</head>
|
||||
<body style="background:#ffffff;">
|
||||
<h1>Syntax highlighting for DocBook program listings</h1>
|
||||
<p>Highlight content of <tt>ProgramListing</tt> using <a href="http://xsieve.sourceforge.net/">XSieve</a> and Vim. Example:</p>
|
||||
<table border="0" cellspacing="5" cellpadding="5">
|
||||
<tr>
|
||||
<th valign="top">DocBook</th>
|
||||
<td>
|
||||
<pre style="background:#f0f0f0;"><programlisting role="xml">
|
||||
&lt;para>Hello, <emphasis>&amp;who;</emphasis
|
||||
>!&lt;/para> <co id="who-entity"/>
|
||||
</programlisting></pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>HTML result </th>
|
||||
<td>
|
||||
<pre style="background:#f0f0f0;">
|
||||
<span style="color:#008B8B;"><para></span>Hello, <span class="emphasis"><em><span style="color:#2E8B57; font-weight:bold;">&</span><span style="color:#A52A2A; font-weight:bold;">who</span><span style="color:#2E8B57; font-weight:bold;">;</span></em></span>!<span style="color:#008B8B;"></para></span> (1)</pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a href="xsieve-programlisting.zip">Download</a> xsieve-programlisting.zip.
|
||||
|
||||
<h2>Usage</h2>
|
||||
|
||||
<p>Set the correct path to the script <tt>vimcolor-wrapper</tt> in <tt>colorer.xsl</tt>.</p>
|
||||
|
||||
<p>Create an XSLT wrapper which imports DocBook and colorer stylesheets:</p>
|
||||
|
||||
<pre style="background:#f0f0f0;">
|
||||
<font color="#008b8b"><</font><font color="#6a5acd">xsl</font><font color="#0000ff">:</font><font color="#a52a2a"><b>stylesheet</b></font><font color="#008b8b"> ...></font>
|
||||
...
|
||||
<font color="#008b8b"><</font><font color="#6a5acd">xsl</font><font color="#0000ff">:</font><font color="#a52a2a"><b>import</b></font><font color="#008b8b"> </font><font color="#2e8b57"><b>href</b></font>=<font color="#ff00ff">"..../docbook.xsl"</font><font color="#008b8b">></font> (1)
|
||||
<font color="#008b8b"><</font><font color="#6a5acd">xsl</font><font color="#0000ff">:</font><font color="#a52a2a"><b>import</b></font><font color="#008b8b"> </font><font color="#2e8b57"><b>href</b></font>=<font color="#ff00ff">"..../colorer.xsl"</font><font color="#008b8b">></font> (2)
|
||||
<font color="#008b8b"><</font><font color="#6a5acd">xsl</font><font color="#0000ff">:</font><font color="#a52a2a"><b>import</b></font><font color="#008b8b"> </font><font color="#2e8b57"><b>href</b></font>=<font color="#ff00ff">"..../colorer-html.xsl"</font><font color="#008b8b">></font> (3)
|
||||
|
||||
... Your DocBook customization layer ...
|
||||
|
||||
<font color="#008b8b"></</font><font color="#6a5acd">xsl</font><font color="#0000ff">:</font><font color="#a52a2a"><b>stylesheet</b></font><font color="#008b8b">></font>
|
||||
</pre>
|
||||
|
||||
<p><b>(1)</b> The path to the DocBook XSLT stylesheet. For example, <tt>/usr/share/xml/docbook/xsl-stylesheets/html/docbook.xsl</tt><br />
|
||||
<b>(2)</b> The path to the colorer XSLT stylesheet.<br />
|
||||
<b>(3)</b> Or <tt>colorer-fo.xsl</tt> for FO output.</p>
|
||||
|
||||
<h2>Test data</h2>
|
||||
|
||||
<p>The package contains test files <tt>test.xml</tt>, <tt>testdoc.xsl</tt> and <tt>testdoc.html</tt>. Use them as the starting point:</p>
|
||||
|
||||
<pre>xsieve -o testdoc.html --param callout.graphics 0 testdoc.xsl test.xml</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -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
|
||||
|
@ -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))))))))
|
@ -1 +0,0 @@
|
||||
~/p/xsieve/opt/bin/xsieve --xinclude -o testdoc.html testdoc.xsl testdoc.xml
|
@ -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
|
@ -1 +0,0 @@
|
||||
~/p/xsieve/opt/bin/xsieve --xinclude -o testdoc.html colorer-one.xsl /home/olpa/p/xsieve/example/hello/doc/listing2.xml
|
@ -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
|
@ -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)))
|
||||
))))))))
|
@ -1,13 +0,0 @@
|
||||
(load "sxml-utils.scm")
|
||||
(load "colorer.scm")
|
||||
|
||||
(define main-tree '(programlisting (*PI* a "b") (@ (format "linespecific")) "<article id=\"hw\">
|
||||
<title>Hello</title>
|
||||
<para>Hello <object>World</object>!</para>
|
||||
</article>"))
|
||||
|
||||
(define h-tree "")
|
||||
|
||||
(define result (colorer:join-markup main-tree h-tree '(h)))
|
||||
|
||||
(write result)
|
@ -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")
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<article>
|
||||
<title>Testing Syntax Highlighting</title>
|
||||
<para>Testing syntax highlighting</para>
|
||||
<programlisting role="xml">
|
||||
<para>Hello, <emphasis>&who;</emphasis
|
||||
>!</para> <co id="who-entity"/>
|
||||
</programlisting>
|
||||
</article>
|
@ -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"))
|
||||
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Article with code</title><meta name="generator" content="DocBook XSL Stylesheets V1.70.1" /></head><body><div class="article" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id2434734"></a>Article with code</h2></div></div><hr /></div><p>A sample code:</p><div class="example"><a id="id2433082"></a><p class="title"><b>Example 1. </b></p><div class="example-contents"><div class="article" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id2434675"></a>Testing Syntax Highlighting</h2></div></div><hr /></div><p>Testing syntax highlighting</p><pre class="programlisting">
|
||||
<span xmlns="" xmlns:syn="http://ns.laxan.com/text-vimcolor/1" style="color:#008B8B;"><para></span>Hello, <span class="emphasis"><em><span xmlns="" xmlns:syn="http://ns.laxan.com/text-vimcolor/1" style="color:#2E8B57; font-weight:bold;">&</span><span xmlns="" xmlns:syn="http://ns.laxan.com/text-vimcolor/1" style="color:#A52A2A; font-weight:bold;">who</span><span xmlns="" xmlns:syn="http://ns.laxan.com/text-vimcolor/1" style="color:#2E8B57; font-weight:bold;">;</span></em></span>!<span xmlns="" xmlns:syn="http://ns.laxan.com/text-vimcolor/1" style="color:#008B8B;"></para></span> <a id="who-entity"></a><img src="images/callouts/1.png" alt="1" border="0" />
|
||||
</pre></div></div></div><br class="example-break" /></div></body></html>
|
@ -1,7 +0,0 @@
|
||||
<article>
|
||||
<title>Article with code</title>
|
||||
<para>A sample code:</para>
|
||||
<example>
|
||||
<xi:include href="test.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
</example>
|
||||
</article>
|
@ -1,10 +0,0 @@
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
|
||||
version = "1.0">
|
||||
|
||||
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets-1.70.1/xhtml/docbook.xsl"/>
|
||||
<xsl:import href="colorer.xsl"/>
|
||||
<xsl:import href="colorer-html.xsl"/>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
@ -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////
|
@ -1 +0,0 @@
|
||||
xsieve/experiments/programlisting/vimcolor
|
@ -1 +0,0 @@
|
||||
:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve
|
@ -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".
|
@ -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
|
||||
|
@ -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 <qef@laxan.com>
|
||||
|
||||
|
||||
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
|
@ -1,2 +0,0 @@
|
||||
D/Path////
|
||||
D/Text////
|
@ -1 +0,0 @@
|
||||
xsieve/experiments/programlisting/vimcolor/lib
|
@ -1 +0,0 @@
|
||||
:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve
|
@ -1,2 +0,0 @@
|
||||
/Class.pm/1.1/Fri Apr 28 07:17:33 2006//
|
||||
D/Class////
|
@ -1 +0,0 @@
|
||||
xsieve/experiments/programlisting/vimcolor/lib/Path
|
@ -1 +0,0 @@
|
||||
:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve
|
@ -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<Path::Class> 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<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, C<Path::Class> uses C<File::Spec> internally, wrapping all
|
||||
the unsightly details so you can concentrate on your application code.
|
||||
Whereas C<File::Spec> provides functions for some common path
|
||||
manipulations, C<Path::Class> provides an object-oriented model of the
|
||||
world of path specifications and their underlying semantics.
|
||||
C<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). C<Path::Class> creates
|
||||
objects representing files and directories, and provides methods that
|
||||
relate them to each other. For instance, the following C<File::Spec>
|
||||
code:
|
||||
|
||||
my $absolute = File::Spec->file_name_is_absolute(
|
||||
File::Spec->catfile( @dirs, $file )
|
||||
);
|
||||
|
||||
can be written using C<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 C<Path::Class>.
|
||||
|
||||
Using C<Path::Class> can help solve real problems in your code too -
|
||||
for instance, how many people actually take the "volume" (like C<C:>
|
||||
on Windows) into account when writing C<File::Spec>-using code? I
|
||||
thought not. But if you use C<Path::Class>, your file and directory objects
|
||||
will know what volumes they refer to and do the right thing.
|
||||
|
||||
The guts of the C<Path::Class> code live in the C<Path::Class::File>
|
||||
and C<Path::Class::Dir> 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<use>, i.e. C<use Path::Class ()>.
|
||||
|
||||
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<File::Spec>, 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<foo/bar> and then ask for a list of files in the directory
|
||||
F<foo>, you may find a file called F<bar.> instead of the F<bar> 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
|
@ -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
|
@ -1 +0,0 @@
|
||||
xsieve/experiments/programlisting/vimcolor/lib/Path/Class
|
@ -1 +0,0 @@
|
||||
:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve
|
@ -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<Path::Class::Dir> class contains functionality for manipulating
|
||||
directory names in a cross-platform way.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=over 4
|
||||
|
||||
=item $dir = Path::Class::Dir->new( <dir1>, <dir2>, ... )
|
||||
|
||||
=item $dir = dir( <dir1>, <dir2>, ... )
|
||||
|
||||
Creates a new C<Path::Class::Dir> 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</var/tmp> 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<dir()>) 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<Path::Class::Dir> 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<C:> on Windows, C<Macintosh HD:> 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<Path::Class::File> objects always
|
||||
return false, and C<Path::Class::Dir> 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</usr/local> 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( <dir1>, <dir2>, ..., <file> )
|
||||
|
||||
Returns a C<Path::Class::File> 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( <dir1>, <dir2>, ... )
|
||||
|
||||
Returns a new C<Path::Class::Dir> object representing a subdirectory
|
||||
of C<$dir>.
|
||||
|
||||
=item $parent = $dir->parent
|
||||
|
||||
Returns the parent directory of C<$dir>. Note that this is the
|
||||
I<logical> 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<Path::Class::File> and/or C<Path::Class::Dir>
|
||||
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<foo> will be F<foo/bar> and F<foo/baz>, not
|
||||
F<bar> and F<baz>.
|
||||
|
||||
Ordinarily C<children()> will not include the I<self> and I<parent>
|
||||
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<all> parameter:
|
||||
|
||||
@c = $dir->children(); # Just the children
|
||||
@c = $dir->children(all => 1); # All entries
|
||||
|
||||
=item $abs = $dir->absolute
|
||||
|
||||
Returns a C<Path::Class::Dir> object representing C<$dir> as an
|
||||
absolute path. An optional argument, given as either a string or a
|
||||
C<Path::Class::Dir> 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<Path::Class::Dir> object representing C<$dir> as a
|
||||
relative path. An optional argument, given as either a string or a
|
||||
C<Path::Class::Dir> 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<specs>, not whether C<$dir> actually contains C<$other> on the
|
||||
filesystem.
|
||||
|
||||
The C<$other> argument may be a C<Path::Class::Dir> object, a
|
||||
C<Path::Class::File> 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<Path::Class::Dir> object representing C<$dir> as it would
|
||||
be specified on a system of type C<$type>. Known types include
|
||||
C<Unix>, C<Win32>, C<Mac>, C<VMS>, and C<OS2>, i.e. anything for which
|
||||
there is a subclass of C<File::Spec>.
|
||||
|
||||
Any generated objects (subdirectories, files, parents, etc.) will also
|
||||
retain this type.
|
||||
|
||||
=item $foreign = Path::Class::Dir->new_foreign($type, @args)
|
||||
|
||||
Returns a C<Path::Class::Dir> object representing C<$dir> as it would
|
||||
be specified on a system of type C<$type>. Known types include
|
||||
C<Unix>, C<Win32>, C<Mac>, C<VMS>, and C<OS2>, i.e. anything for which
|
||||
there is a subclass of C<File::Spec>.
|
||||
|
||||
The arguments in C<@args> are the same as they would be specified in
|
||||
C<new()>.
|
||||
|
||||
=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<splice> or
|
||||
C<substr> functions; they return C<LENGTH> elements starting at
|
||||
C<OFFSET>. If C<LENGTH> is omitted, returns all the elements starting
|
||||
at C<OFFSET> up to the end of the list. If C<LENGTH> is negative,
|
||||
returns the elements from C<OFFSET> onward except for C<-LENGTH>
|
||||
elements at the end. If C<OFFSET> is negative, it counts backward
|
||||
C<OFFSET> elements from the end of the list. If C<OFFSET> and
|
||||
C<LENGTH> are both omitted, the entire list is returned.
|
||||
|
||||
In a scalar context, C<dir_list()> with no arguments returns the
|
||||
number of entries in the directory list; C<dir_list(OFFSET)> returns
|
||||
the single element at that offset; C<dir_list(OFFSET, LENGTH)> 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<IO::Dir> object. If the opening fails, C<undef> 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<Path::Class::File>'s C<remove()> method.
|
||||
|
||||
=item $dir_or_file = $dir->next()
|
||||
|
||||
A convenient way to iterate through directory contents. The first
|
||||
time C<next()> is called, it will C<open()> the directory and read the
|
||||
first item from it, returning the result as a C<Path::Class::Dir> or
|
||||
C<Path::Class::File> object (depending, of course, on its actual
|
||||
type). Each subsequent call to C<next()> 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<next()> 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<callback> subroutine for
|
||||
each entry. This is a lot like what the C<File::Find> module does,
|
||||
and of course C<File::Find> will work fine on C<Path::Class> objects,
|
||||
but the advantage of the C<recurse()> method is that it will also feed
|
||||
your callback routine C<Path::Class> objects rather than just pathname
|
||||
strings.
|
||||
|
||||
The C<recurse()> method requires a C<callback> parameter specifying
|
||||
the subroutine to invoke for each entry. It will be passed the
|
||||
C<Path::Class> object as its first argument.
|
||||
|
||||
C<recurse()> also accepts two boolean parameters, C<depthfirst> and
|
||||
C<preorder> 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<except> C<< depthfirst => 0, preorder => 0 >>.
|
||||
|
||||
=item $st = $file->stat()
|
||||
|
||||
Invokes C<< File::stat::stat() >> on this directory and returns a
|
||||
C<File::stat> object representing the result.
|
||||
|
||||
=item $st = $file->lstat()
|
||||
|
||||
Same as C<stat()>, but if C<$file> is a symbolic link, C<lstat()>
|
||||
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
|
@ -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;
|
@ -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<Path::Class::File> class contains functionality for manipulating
|
||||
file names in a cross-platform way.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=over 4
|
||||
|
||||
=item $file = Path::Class::File->new( <dir1>, <dir2>, ..., <file> )
|
||||
|
||||
=item $file = file( <dir1>, <dir2>, ..., <file> )
|
||||
|
||||
Creates a new C<Path::Class::File> 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</var/tmp> 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<Path::Class::File> 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<C:> on Windows, C<Macintosh HD:> 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<Path::Class::File> objects always
|
||||
return false, and C<Path::Class::Dir> 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</usr/local/foo.txt> 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<Path::Class::Dir> object representing the directory
|
||||
containing this file.
|
||||
|
||||
=item $dir = $file->parent
|
||||
|
||||
A synonym for the C<dir()> method.
|
||||
|
||||
=item $abs = $file->absolute
|
||||
|
||||
Returns a C<Path::Class::File> object representing C<$file> as an
|
||||
absolute path. An optional argument, given as either a string or a
|
||||
C<Path::Class::Dir> 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<Path::Class::File> object representing C<$file> as a
|
||||
relative path. An optional argument, given as either a string or a
|
||||
C<Path::Class::Dir> 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<Path::Class::File> object representing C<$file> as it would
|
||||
be specified on a system of type C<$type>. Known types include
|
||||
C<Unix>, C<Win32>, C<Mac>, C<VMS>, and C<OS2>, i.e. anything for which
|
||||
there is a subclass of C<File::Spec>.
|
||||
|
||||
Any generated objects (subdirectories, files, parents, etc.) will also
|
||||
retain this type.
|
||||
|
||||
=item $foreign = Path::Class::File->new_foreign($type, @args)
|
||||
|
||||
Returns a C<Path::Class::File> object representing a file as it would
|
||||
be specified on a system of type C<$type>. Known types include
|
||||
C<Unix>, C<Win32>, C<Mac>, C<VMS>, and C<OS2>, i.e. anything for which
|
||||
there is a subclass of C<File::Spec>.
|
||||
|
||||
The arguments in C<@args> are the same as they would be specified in
|
||||
C<new()>.
|
||||
|
||||
=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<IO::File> object. If the opening
|
||||
fails, C<undef> 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<touch()> will I<make> 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<chomp()> run on each line of the file, pass a true value
|
||||
for the C<chomp> or C<chomped> 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<remove()> is better than simply calling Perl's C<unlink()> function,
|
||||
because on some platforms (notably VMS) you actually may need to call
|
||||
C<unlink()> several times before all versions of the file are gone -
|
||||
the C<remove()> method handles this process for you.
|
||||
|
||||
=item $st = $file->stat()
|
||||
|
||||
Invokes C<< File::stat::stat() >> on this file and returns a
|
||||
C<File::stat> object representing the result.
|
||||
|
||||
=item $st = $file->lstat()
|
||||
|
||||
Same as C<stat()>, but if C<$file> is a symbolic link, C<lstat()>
|
||||
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
|
@ -1,2 +0,0 @@
|
||||
/VimColor.pm/1.1/Fri Apr 28 07:16:26 2006//
|
||||
D/VimColor////
|
@ -1 +0,0 @@
|
||||
xsieve/experiments/programlisting/vimcolor/lib/Text
|
@ -1 +0,0 @@
|
||||
:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve
|
@ -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 .= "<span class=\"syn$_->[0]\">" .
|
||||
_xml_escape($_->[1]) .
|
||||
'</span>';
|
||||
}
|
||||
|
||||
$html .= "</pre>\n\n </body>\n</html>\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 .= "<syn:syntax xmlns:syn=\"$NAMESPACE_ID\"";
|
||||
$xml .= ' filename="' . _xml_escape($filename) . '"'
|
||||
if defined $filename;;
|
||||
$xml .= '>';
|
||||
}
|
||||
|
||||
foreach (@$syntax) {
|
||||
$xml .= _xml_escape($_->[1]), next
|
||||
if $_->[0] eq '';
|
||||
|
||||
$xml .= "<syn:$_->[0]>" .
|
||||
_xml_escape($_->[1]) .
|
||||
"</syn:$_->[0]>";
|
||||
}
|
||||
|
||||
$xml .= "</syn:syntax>\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 <link>.
|
||||
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 = "<style>\n";
|
||||
if ($self->{html_stylesheet}) {
|
||||
$stylesheet .= _xml_escape($self->{html_stylesheet});
|
||||
}
|
||||
else {
|
||||
my $file = $self->{html_stylesheet_file};
|
||||
$file = file($SHARED, 'light.css')->stringify
|
||||
unless defined $file;
|
||||
unless (ref $file) {
|
||||
$file = IO::File->new($file, 'r')
|
||||
or croak "error reading stylesheet '$file': $!";
|
||||
}
|
||||
local $/;
|
||||
$stylesheet .= _xml_escape(<$file>);
|
||||
}
|
||||
$stylesheet .= "</style>\n";
|
||||
}
|
||||
else {
|
||||
$stylesheet =
|
||||
"<link rel=\"stylesheet\" type=\"text/css\" href=\"" .
|
||||
_xml_escape($self->{html_stylesheet_url} ||
|
||||
"file://$SHARED/light.css") .
|
||||
"\" />\n";
|
||||
}
|
||||
|
||||
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" .
|
||||
" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n" .
|
||||
"<html>\n" .
|
||||
" <head>\n" .
|
||||
" <title>$title</title>\n" .
|
||||
" $stylesheet" .
|
||||
" </head>\n" .
|
||||
" <body>\n\n" .
|
||||
"<pre>";
|
||||
}
|
||||
|
||||
# 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;
|
||||
$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;
|
||||
_add_markup($syntax, '', $1), redo LOOP
|
||||
if $data =~ /\G([^<>]+)/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/&g/>/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<new> function (as shown above in the SYNOPSIS) and then call methods
|
||||
to get the markup out.
|
||||
|
||||
=head1 METHODS
|
||||
|
||||
=over 4
|
||||
|
||||
=item new(I<options>)
|
||||
|
||||
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<syntax_mark_file> 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<file> option. A reference to a string will also work.
|
||||
|
||||
The C<syntax_mark_string> 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<new()>, can be overridden
|
||||
when calling C<syntax_mark_file> and C<syntax_mark_string>, so you can
|
||||
use the same object to process multiple files of different types.
|
||||
|
||||
=item html_full_page
|
||||
|
||||
By default the C<html()> output method returns a fragment of HTML, not a
|
||||
full file. To make useful output this must be wrapped in a C<E<lt>preE<gt>>
|
||||
element and a stylesheet must be included from somewhere. Setting the
|
||||
C<html_full_page> option will instead make the C<html()> 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<html()> method is more appropriate.
|
||||
|
||||
=item html_inline_stylesheet
|
||||
|
||||
Turned on by default, but has no effect unless C<html_full_page> 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
|
||||
C<E<lt>styleE<gt>> element. Turn it off to instead use a C<E<lt>linkE<gt>>
|
||||
to reference an external stylesheet (recommended if putting more than one
|
||||
page on the web).
|
||||
|
||||
=item html_stylesheet
|
||||
|
||||
Ignored unless C<html_full_page> and C<html_inline_stylesheet> 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<html_full_page> and C<html_inline_stylesheet> 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<html_stylesheet>
|
||||
are given, the supplied stylesheet F<light.css> will be used instead.
|
||||
|
||||
=item html_stylesheet_url
|
||||
|
||||
Ignored unless C<html_full_page> is enabled and C<html_inline_stylesheet>
|
||||
is disabled.
|
||||
|
||||
This can be used to supply the URL (relative or absolute) or the stylesheet
|
||||
to be referenced from the HTML C<E<lt>linkE<gt>> element in the header.
|
||||
If this isn't given it will default to using a C<file:> URL to reference
|
||||
the supplied F<light.css> 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 <syn:syntax>, 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<syn:>, so
|
||||
an C<xmlns:syn> 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<vim>.
|
||||
|
||||
=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<undef> 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<vim_let()> method.
|
||||
|
||||
=back
|
||||
|
||||
=item vim_let(I<name> =E<gt> I<value>, ...)
|
||||
|
||||
Change the options that are set with the Vim C<let> command when Vim
|
||||
is run. See C<new()> for details.
|
||||
|
||||
=item syntax_mark_file(I<file>, I<options...>)
|
||||
|
||||
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<file> or C<string>
|
||||
option was passed to C<new()>.
|
||||
|
||||
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<filetype>
|
||||
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<string>, I<options...>)
|
||||
|
||||
Does the same as C<syntax_mark_file> (see above) but uses a string as input.
|
||||
I<string> can also be a reference to a string.
|
||||
Returns the object it was called on. Supports the C<filetype> option
|
||||
just as C<syntax_mark_file> does.
|
||||
|
||||
=item html()
|
||||
|
||||
Return XHTML markup based on the Vim syntax colouring of the input file.
|
||||
|
||||
Unless the C<html_full_page> 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 C<E<lt>spanE<gt>> elements
|
||||
wrapped round appropriate pieces of text. Each one will have a C<class>
|
||||
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<syn>,
|
||||
for example C<synComment>. For the full list see the section
|
||||
HIGHLIGHTING TYPES below.
|
||||
|
||||
=item xml()
|
||||
|
||||
Returns markup in a simple XML vocabulary. Unless the C<xml_root_element>
|
||||
option is turned off (it's on by default) this will produce a complete XML
|
||||
document, with all the markup inside a C<E<lt>syntaxE<gt>> 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 C<E<lt>syntaxE<gt>> element will declare the namespace for all the
|
||||
elements prodeced, which will be C<http://ns.laxan.com/text-vimcolor/1>.
|
||||
It will also have an attribute called C<filename>, which will be set to the
|
||||
value returned by the C<input_filename> 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<marked()> 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<syn> added. For XML
|
||||
output, these will be the names of elements which will all be in the
|
||||
namespace C<http://ns.laxan.com/text-vimcolor/1>.
|
||||
|
||||
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<Apache::VimColor>
|
||||
|
||||
=item L<Kwiki::VimMode>
|
||||
|
||||
=item L<Template-Plugin-VimColor>
|
||||
|
||||
=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 E<lt>qef@laxan.comE<gt>
|
||||
|
||||
The Vim script F<mark.vim> is a crufted version of F<2html.vim> by
|
||||
Bram Moolenaar E<lt>Bram@vim.orgE<gt> and
|
||||
David Ne\v{c}as (Yeti) E<lt>yeti@physics.muni.czE<gt>.
|
||||
|
||||
=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:
|
@ -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
|
@ -1 +0,0 @@
|
||||
xsieve/experiments/programlisting/vimcolor/lib/Text/VimColor
|
@ -1 +0,0 @@
|
||||
:pserver:anonymous@xsieve.cvs.sourceforge.net:/cvsroot/xsieve
|
@ -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 }
|
@ -1,128 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
This is an XSLT/XSL-FO stylesheet designed to be used with the XML
|
||||
output of the Perl module Text::VimColor.
|
||||
|
||||
This is designed to make the highlighting look like the default gvim
|
||||
colour scheme, with 'background=light'.
|
||||
|
||||
Geoff Richards <qef@laxan.com>
|
||||
|
||||
This XSL file (light.xsl) is public domain. Do what you want with it.
|
||||
|
||||
Bugs: background colouring doesn't work in FOP.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:syn="http://ns.laxan.com/text-vimcolor/1">
|
||||
|
||||
<xsl:template match="syn:syntax">
|
||||
<fo:root>
|
||||
|
||||
<fo:layout-master-set>
|
||||
|
||||
<!-- Master for odd (right hand) pages -->
|
||||
<fo:simple-page-master master-name="recto"
|
||||
page-height="297mm" page-width="210mm"
|
||||
margin-top="10mm" margin-left="25mm"
|
||||
margin-bottom="10mm" margin-right="15mm">
|
||||
<fo:region-body margin-top="10mm" margin-bottom="10mm"/>
|
||||
<fo:region-before extent="10mm"/>
|
||||
<fo:region-after extent="10mm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<!-- Master for even (left hand) pages -->
|
||||
<fo:simple-page-master master-name="verso"
|
||||
page-height="297mm" page-width="210mm"
|
||||
margin-top="10mm" margin-left="15mm"
|
||||
margin-bottom="10mm" margin-right="25mm">
|
||||
<fo:region-body margin-top="10mm" margin-bottom="10mm"/>
|
||||
<fo:region-before extent="10mm"/>
|
||||
<fo:region-after extent="10mm"/>
|
||||
</fo:simple-page-master>
|
||||
|
||||
<fo:page-sequence-master master-name="recto-verso">
|
||||
<fo:repeatable-page-master-alternatives>
|
||||
<fo:conditional-page-master-reference
|
||||
master-name="recto" odd-or-even="odd"/>
|
||||
<fo:conditional-page-master-reference
|
||||
master-name="verso" odd-or-even="even"/>
|
||||
</fo:repeatable-page-master-alternatives>
|
||||
</fo:page-sequence-master>
|
||||
|
||||
</fo:layout-master-set>
|
||||
|
||||
<fo:page-sequence master-reference="recto">
|
||||
|
||||
<!-- Header -->
|
||||
<fo:static-content flow-name="xsl-region-before">
|
||||
<fo:block text-align="end" font-size="10pt"
|
||||
font-family="sans-serif" font-style="italic">
|
||||
<xsl:value-of select="@filename"/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<!-- Footer -->
|
||||
<fo:static-content flow-name="xsl-region-after">
|
||||
<fo:block text-align="end" font-size="10pt" font-family="sans-serif">
|
||||
<fo:page-number/>
|
||||
</fo:block>
|
||||
</fo:static-content>
|
||||
|
||||
<!-- Body text -->
|
||||
<fo:flow flow-name="xsl-region-body">
|
||||
<fo:block font-family="monospace" font-size="10pt" line-height="12pt"
|
||||
white-space-collapse="false">
|
||||
<xsl:apply-templates/>
|
||||
</fo:block>
|
||||
</fo:flow>
|
||||
|
||||
</fo:page-sequence>
|
||||
|
||||
</fo:root>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Comment">
|
||||
<fo:inline color="#0000FF"><xsl:apply-templates/></fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Constant">
|
||||
<fo:inline color="#FF00FF"><xsl:apply-templates/></fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Identifier">
|
||||
<fo:inline color="#008B8B"><xsl:apply-templates/></fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Statement">
|
||||
<fo:inline color="#A52A2A" font-weight="bold"><xsl:apply-templates/></fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:PreProc">
|
||||
<fo:inline color="#A020F0"><xsl:apply-templates/></fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Type">
|
||||
<fo:inline color="#2E8B57" font-weight="bold"><xsl:apply-templates/></fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Special">
|
||||
<fo:inline color="#6A5ACD"><xsl:apply-templates/></fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Underlined">
|
||||
<fo:inline text-decoration="underline"><xsl:apply-templates/></fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Error">
|
||||
<fo:inline color="#FFFFFF" background-color="#FF0000"><xsl:apply-templates/></fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="syn:Todo">
|
||||
<fo:inline color="#0000FF" background-color="#FFFF00"><xsl:apply-templates/></fo:inline>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@ -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 <qef@laxan.com>
|
||||
" Based loosely on 2html.vim, by Bram Moolenaar <Bram@vim.org>,
|
||||
" modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>.
|
||||
|
||||
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 \<C-W>pa" . strtrans(s:new) . "\n\e\<C-W>p"
|
||||
let s:lnum = s:lnum + 1
|
||||
+
|
||||
endwhile
|
||||
|
||||
" Strip whitespace from the ends of lines
|
||||
%s:\s\+$::e
|
||||
|
||||
wincmd p
|
||||
normal dd
|
@ -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 = '<stdout>';
|
||||
}
|
||||
|
||||
@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<file-type>
|
||||
|
||||
Set the type of the file explicitly. The I<file-type> argument should be
|
||||
something which Vim will recognise when set with its C<filetype> option.
|
||||
Examples are C<perl>, C<cpp> (for C++) and C<sh> (for Unix shell scripts).
|
||||
These names are case sensitive, and should usually be all-lowercase.
|
||||
|
||||
=item --format I<output-format>
|
||||
|
||||
The output format to generate. Must be one of the following:
|
||||
|
||||
=over 4
|
||||
|
||||
=item html
|
||||
|
||||
Generate XHTML output, with text marked with C<E<lt>spanE<gt>> elements
|
||||
with C<class> 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<fop> 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<output-filename>
|
||||
|
||||
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 C<E<lt>linkE<gt>> element.
|
||||
|
||||
=item --let I<name>=I<value>
|
||||
|
||||
When Vim is run the value of I<name> will be set to I<value> using
|
||||
Vim's C<let> 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<vim_let> setting and method in
|
||||
the Perl module.
|
||||
|
||||
=item --unlet I<name>
|
||||
|
||||
Prevent the value of I<name> being set with Vim's C<let> command.
|
||||
This can be used to turn off default settings.
|
||||
|
||||
This option corresponds to the C<vim_let> setting and method in
|
||||
the Perl module, when used with a value of C<undef>.
|
||||
|
||||
=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<background-color> property on
|
||||
C<E<lt>fo:inlineE<gt>>. 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 E<lt>qef@laxan.comE<gt>
|
||||
|
||||
=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
|
@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
DIR=`dirname $0`
|
||||
|
||||
PERL5LIB=$DIR/lib:$PERL5LIB
|
||||
export PERL5LIB
|
||||
|
||||
$DIR/text-vimcolor "$@"
|
||||
|
@ -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:
|
||||
<code type="bash">
|
||||
svn co http://doctrine.pengus.net/svn/trunk .
|
||||
</code>
|
||||
|
||||
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]
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
||||
|
||||
|
||||
<code type="php">
|
||||
|
||||
?></code>
|
||||
|
@ -1,34 +0,0 @@
|
||||
|
||||
|
||||
<code type="php">
|
||||
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
|
||||
</code>
|
@ -1,36 +0,0 @@
|
||||
Creating a new listener is very easy. You can set the listener in global, connection or factory level.
|
||||
|
||||
<code type="php">
|
||||
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());
|
||||
</code>
|
@ -1,48 +0,0 @@
|
||||
Here is a list of availible events and their parameters:
|
||||
|
||||
<code type="php">
|
||||
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);
|
||||
}
|
||||
</code>
|
@ -1,14 +0,0 @@
|
||||
|
||||
<code type="php">
|
||||
$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();
|
||||
</code>
|
@ -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.
|
||||
|
@ -1,4 +0,0 @@
|
||||
|
||||
<code type="php">
|
||||
$hook = new Doctrine_Hook($table, $fields);
|
||||
</code>
|
@ -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...
|
||||
<code type="php">
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
</code>
|
||||
|
||||
At the page where the transaction finishes...
|
||||
<code type="php">
|
||||
// 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
|
||||
}
|
||||
</code>
|
@ -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.
|
||||
|
@ -1,3 +0,0 @@
|
||||
Roman Borschel - romanb at #doctrine (freenode)
|
||||
|
||||
Don't hesitate to contact me if you have questions, ideas, ect.
|
@ -1,2 +0,0 @@
|
||||
- Possibility to release locks of a specific Record type (i.e. releasing all locks on 'User'
|
||||
objects).
|
@ -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.
|
||||
|
@ -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.
|
||||
|
||||
<code type="php">
|
||||
// turning on validation
|
||||
|
||||
Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VLD, true);
|
||||
</code>
|
@ -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. ||
|
||||
|
@ -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:
|
||||
|
||||
|
||||
<code type="php">
|
||||
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(<fieldName>, <error code/identifier>)
|
||||
$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"));
|
||||
}
|
||||
}
|
||||
</code>
|
@ -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.
|
||||
|
||||
<code type="php">
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
</code>
|
@ -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.
|
||||
|
@ -1,16 +0,0 @@
|
||||
|
||||
<code type="php">
|
||||
$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();
|
||||
</code>
|
@ -1,15 +0,0 @@
|
||||
|
||||
|
||||
<code type="php">
|
||||
$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();
|
||||
</code>
|
@ -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
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user