summaryrefslogtreecommitdiff
path: root/build.xml
diff options
context:
space:
mode:
authorwei <>2007-05-09 02:51:02 +0000
committerwei <>2007-05-09 02:51:02 +0000
commite2614a35a70f609bccc1d65df6f1b92ff1fef5ef (patch)
treee50ba7375212d2275cc2d866d220adca254eadf1 /build.xml
parent733cc375da74f9bf0fd3d71989bb20d503dbbb7b (diff)
Add compact db demo, add THtmlArea::EnableCompression, add ClientSide options for TColorPicker
Diffstat (limited to 'build.xml')
-rw-r--r--build.xml89
1 files changed, 72 insertions, 17 deletions
diff --git a/build.xml b/build.xml
index d4cccf51..fa384404 100644
--- a/build.xml
+++ b/build.xml
@@ -156,24 +156,24 @@
<target name="compact-collections" description="Collections">
<mkdir dir="${build.compact.dir}" />
<mkdir dir="${build.compact.dir}/docs" />
- <compact-package output="${build.compact.dir}/collections.php" strip="${compact-strip-comments}">
+ <mkdir dir="${build.compact.dir}/prado-db" />
+ <compact-package output="${build.compact.dir}/prado-db/collections.php" strip="${compact-strip-comments}">
<filelist dir="framework" files="PradoBase.php,TComponent.php,Exceptions/TException.php,interfaces.php" />
<filelist dir="framework/Collections" files="TList.php,TMap.php,TAttributeCollection.php,TPagedList.php,TPagedDataSource.php" />
</compact-package>
- <delete file="${build.compact.dir}/messages.txt" />
- <copy file="framework/Exceptions/messages.txt" tofile="${build.compact.dir}/messages.txt" />
+ <delete file="${build.compact.dir}/prado-db/messages.txt" />
+ <copy file="framework/Exceptions/messages.txt" tofile="${build.compact.dir}/prado-db/messages.txt" />
<copy file="COPYRIGHT" tofile="${build.compact.dir}/COPYRIGHT" />
<copy file="HISTORY" tofile="${build.compact.dir}/HISTORY" />
<delete file="${build.compact.dir}/readme.txt" />
- <append text="PRADO Framework for PHP 5, version ${prado.version}. See docs/ directory for documentation."
- destFile="${build.compact.dir}/readme.txt" />
+ <append destFile="${build.compact.dir}/readme.txt">PRADO Framework for PHP 5, version ${prado.version}. See docs/ directory for documentation.</append>
<prado-quickstart-docs output="${build.compact.dir}/docs"
pages="Advanced/Collections.page,Fundamentals/Components.page"/>
</target>
<target name="compact-db" description="Database" depends="compact-collections">
- <compact-package output="${build.compact.dir}/db.php" strip="${compact-strip-comments}">
+ <compact-package output="${build.compact.dir}/prado-db/db.php" strip="${compact-strip-comments}">
<filelist dir="framework/Data"
files="TDbConnection.php, TDbCommand.php, TDbDataReader.php, TDbTransaction.php"/>
<filelist dir="framework/Data/Common"
@@ -183,28 +183,28 @@
</target>
<target name="compact-db-sqlite" description="Sqlite Database" depends="compact-db">
- <compact-package output="${build.compact.dir}/db-sqlite.php" strip="${compact-strip-comments}">
+ <compact-package output="${build.compact.dir}/prado-db/db-sqlite.php" strip="${compact-strip-comments}">
<filelist dir="framework/Data/Common/Sqlite"
files="TSqliteCommandBuilder.php,TSqliteMetaData.php,TSqliteTableColumn.php,TSqliteTableInfo.php" />
</compact-package>
</target>
<target name="compact-db-mysql" description="Mysql Database" depends="compact-db">
- <compact-package output="${build.compact.dir}/db-mysql.php" strip="${compact-strip-comments}">
+ <compact-package output="${build.compact.dir}/prado-db/db-mysql.php" strip="${compact-strip-comments}">
<filelist dir="framework/Data/Common/Mysql"
files="TMysqlCommandBuilder.php,TMysqlMetaData.php,TMysqlTableColumn.php,TMysqlTableInfo.php" />
</compact-package>
</target>
<target name="compact-db-pgsql" description="Pgsql Database" depends="compact-db">
- <compact-package output="${build.compact.dir}/db-pgsql.php" strip="${compact-strip-comments}">
+ <compact-package output="${build.compact.dir}/prado-db/db-pgsql.php" strip="${compact-strip-comments}">
<filelist dir="framework/Data/Common/Pgsql"
files="TPgsqlCommandBuilder.php,TPgsqlMetaData.php,TPgsqlTableColumn.php,TPgsqlTableInfo.php" />
</compact-package>
</target>
<target name="compact-db-mssql" description="Mssql Database" depends="compact-db">
- <compact-package output="${build.compact.dir}/db-mssql.php" strip="${compact-strip-comments}">
+ <compact-package output="${build.compact.dir}/prado-db/db-mssql.php" strip="${compact-strip-comments}">
<filelist dir="framework/Data/Common/Mssql"
files="TMssqlCommandBuilder.php,TMssqlMetaData.php,TMssqlTableColumn.php,TMssqlTableInfo.php" />
</compact-package>
@@ -214,26 +214,26 @@
<target name="compact-db-all" depends="compact-db-sqlite,compact-db-mysql,compact-db-pgsql,compact-db-mssql" />
<target name="compact-table-gateway" description="Package Active Record" depends="compact-db-all">
- <compact-package output="${build.compact.dir}/table-gateway.php" strip="${compact-strip-comments}">
+ <compact-package output="${build.compact.dir}/prado-db/table-gateway.php" strip="${compact-strip-comments}">
<filelist dir="framework/Data/DataGateway"
files="TDataGatewayCommand.php, TSqlCriteria.php, TTableGateway.php"/>
</compact-package>
</target>
<target name="compact-active-record" description="Package Active Record" depends="compact-table-gateway">
- <compact-package output="${build.compact.dir}/active-record.php" strip="${compact-strip-comments}">
+ <compact-package output="${build.compact.dir}/prado-db/active-record.php" strip="${compact-strip-comments}">
<filelist dir="framework/Data/ActiveRecord"
files="TActiveRecord.php,TActiveRecordManager.php,Exceptions/TActiveRecordException.php,TActiveRecordCriteria.php,TActiveRecordGateway.php,TActiveRecordStateRegistry.php" />
<filelist dir="framework/Data/ActiveRecord/Relations"
files="TActiveRecordRelation.php,TActiveRecordRelationContext.php,TActiveRecordHasOne.php,TActiveRecordHasManyAssociation.php,TActiveRecordHasMany.php,TActiveRecordBelongsTo.php" />
</compact-package>
<append file="framework/Data/ActiveRecord/Exceptions/messages.txt"
- destfile="${build.compact.dir}/messages.txt" />
+ destfile="${build.compact.dir}/prado-db/messages.txt" />
<prado-quickstart-docs output="${build.compact.dir}/docs" pages="Database/ActiveRecord.page" />
</target>
- <target name="compact-sqlmap" description="Package Active Record" depends="compact-db-all">
- <compact-package output="${build.compact.dir}/sqlmap.php" strip="${compact-strip-comments}">
+ <target name="compact-sqlmap" description="Package SqlMap" depends="compact-db-all">
+ <compact-package output="${build.compact.dir}/prado-db/sqlmap.php" strip="${compact-strip-comments}">
<filelist dir="framework/Data/SqlMap" files="TSqlMapManager.php,TSqlMapGateway.php" />
<filelist dir="framework/Data/SqlMap/DataMapper"
files="TSqlMapException.php,TSqlMapTypeHandlerRegistry.php,TSqlMapCache.php,TPropertyAccess.php,TLazyLoadList.php,TSqlMapPagedList.php"/>
@@ -243,10 +243,65 @@
files="IMappedStatement.php,TMappedStatement.php,TCachingStatement.php,TUpdateMappedStatement.php,TDeleteMappedStatement.php,TInsertMappedStatement.php,TPreparedCommand.php,TPreparedStatement.php,TPreparedStatementFactory.php,TSelectMappedStatement.php,TSimpleDynamicSql.php,TStaticSql.php"/>
</compact-package>
<append file="framework/Data/SqlMap/DataMapper/messages.txt"
- destfile="${build.compact.dir}/messages.txt" />
+ destfile="${build.compact.dir}/prado-db/messages.txt" />
<prado-quickstart-docs output="${build.compact.dir}/docs" pages="Database/SqlMap.page" />
</target>
-
+
+ <target name="compact-northwind" description="Northwind example">
+ <copy todir="${build.compact.dir}/examples">
+ <fileset dir="demos/northwind-db/protected/" >
+ <include name="database/**/*"/>
+ <include name="data/**/*"/>
+ </fileset>
+ </copy>
+ <delete file="${build.compact.dir}/examples/example.php" />
+ <append destfile="${build.compact.dir}/examples/example.php"><![CDATA[<?php
+
+include('../prado-db/collections.php');
+include('../prado-db/db.php');
+include('../prado-db/db-sqlite.php');
+include('../prado-db/table-gateway.php');
+include('../prado-db/active-record.php');
+include('../prado-db/sqlmap.php');
+
+$sqlite_dir = './data';
+$sqlite_db = $sqlite_dir.'/Northwind.db';
+if(!is_file($sqlite_db))
+ die("Unable to find database file $sqlite_db");
+if(!is_writable($sqlite_dir))
+ die("Please make sure that the directory $sqlite_dir is writable by PHP process.");
+if(!is_writable($sqlite_db))
+ die("Please make sure that the sqlite database file $sqlite_db is writable by PHP process.");
+
+//add directory "database" for autoload
+$class_dir = realpath(dirname(__FILE__).'/database');
+set_include_path(get_include_path().PATH_SEPARATOR.$class_dir);
+spl_autoload_register(array('PradoBase', 'autoload'));
+
+$conn = new TDbConnection("sqlite:$sqlite_db");
+//set default database connection
+TActiveRecordManager::getInstance()->setDbConnection($conn);
+
+$manager = new TSqlMapManager($conn);
+$manager->configureXml('./database/sqlmap.xml');
+$sqlmap = $manager->getSqlMapGateway();
+
+//start playing
+
+foreach(Employee::finder()->findAll() as $employee)
+ var_dump($employee->LastName);
+
+foreach(Region::finder()->withTerritories()->findAll() as $region)
+{
+ var_dump($region->RegionDescription);
+ foreach($region->Territories as $territory)
+ var_dump($territory->TerritoryDescription);
+}
+
+var_dump($sqlmap->queryForList('products-with-price', 50));
+
+?>]]></append>
+ </target>
<target name="compact-all" description="All packages" depends="compact-active-record,compact-sqlmap" />
<!-- end compact packaging -->