|
From: <rd...@us...> - 2008-07-31 15:35:20
|
Revision: 740
http://digir.svn.sourceforge.net/digir/?rev=740&view=rev
Author: rdg
Date: 2008-07-31 15:35:10 +0000 (Thu, 31 Jul 2008)
Log Message:
-----------
New setting TP_CHECK_UPDATE_URL can be used to provide a custom link for automatic updates.
Modified Paths:
--------------
tapirlink/trunk/admin/check_update.php
tapirlink/trunk/www/localconfig_dist.php
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/admin/check_update.php
===================================================================
--- tapirlink/trunk/admin/check_update.php 2008-07-29 11:34:28 UTC (rev 739)
+++ tapirlink/trunk/admin/check_update.php 2008-07-31 15:35:10 UTC (rev 740)
@@ -24,6 +24,7 @@
// When TapirLink is installed with Subversion, this script can be used to check
// if there's a new stable version available, and in this case update the local copy.
+require_once('../www/tapir_globals.php');
require_once('../classes/TpUtils.php');
global $g_local_revision;
@@ -78,8 +79,7 @@
if ( empty( $output_svn_info ) )
{
- die( 'Could not use Subversion to determine the local installation revision number' );
- // Check if Subversion is installed and if it is in the path
+ die( 'Could not use Subversion to determine the local installation revision number. Please make sure that Subversion (command-line program called svn) is installed and is in the path for the Web Server user.' );
}
// Parse XML to get revision
@@ -96,7 +96,7 @@
xml_parser_free( $parser );
// Get latest recommended revision number
-$fh = TpUtils::OpenFile( 'http://rs.tdwg.org/tapir/software/tlink.xml' );
+$fh = TpUtils::OpenFile( TP_CHECK_UPDATE_URL );
if ( ! is_resource( $fh ) )
{
Modified: tapirlink/trunk/www/localconfig_dist.php
===================================================================
--- tapirlink/trunk/www/localconfig_dist.php 2008-07-29 11:34:28 UTC (rev 739)
+++ tapirlink/trunk/www/localconfig_dist.php 2008-07-31 15:35:10 UTC (rev 740)
@@ -235,6 +235,14 @@
//define('TP_FILE_RETRIEVAL_BEHAVIOUR', 'prefer_original' or 'prefer_local' or 'only_local');
/**
+* When using automatic updates, you can specify an alternative link to
+* indicate the latest stable revision number instead of the default link
+* below. Note: changing this setting is only recommended for those who are
+* closely monitoring TapirLink development.
+*/
+//define( 'TP_CHECK_UPDATE_URL', 'http://rs.tdwg.org/tapir/software/tlink.xml' );
+
+/**
* Note that it is also possible to change some of your default PHP operational
* parameters here. For example, you could change the include_path setting
* to work with your system if you do not have access to the PHP.ini file.
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2008-07-29 11:34:28 UTC (rev 739)
+++ tapirlink/trunk/www/tapir_globals.php 2008-07-31 15:35:10 UTC (rev 740)
@@ -495,6 +495,14 @@
}
//////////////////////////////////////////////////////
+// AUTOMATIC UPDATES
+
+if ( ! defined( 'TP_CHECK_UPDATE_URL' ) )
+{
+ define( 'TP_CHECK_UPDATE_URL', 'http://rs.tdwg.org/tapir/software/tlink.xml' );
+}
+
+//////////////////////////////////////////////////////
// UDDI
if ( ! defined( 'TP_UDDI_TMODEL_NAME' ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2008-08-01 15:18:16
|
Revision: 741
http://digir.svn.sourceforge.net/digir/?rev=741&view=rev
Author: rdg
Date: 2008-08-01 15:18:13 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
Included caching mechanism for count SQL in inventories and searches. Can be controlled with TP_SQL_COUNT_CACHE_LIFE_SECS.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpInventoryResponse.php
tapirlink/trunk/classes/TpSearchResponse.php
tapirlink/trunk/misc/diag_codes.xml
tapirlink/trunk/www/diagnostic_codes.html
tapirlink/trunk/www/localconfig_dist.php
tapirlink/trunk/www/tapir_diagnostics.php
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2008-07-31 15:35:10 UTC (rev 740)
+++ tapirlink/trunk/ChangeLog.txt 2008-08-01 15:18:13 UTC (rev 741)
@@ -7,6 +7,8 @@
was mapped to a field with a datatype other than datetime.
* Removed unnecessary verification to check if session.save_path is writable
when running the configurator.
+ * Included caching mechanism for count SQL in inventories and searches. Can
+ be controlled with TP_SQL_COUNT_CACHE_LIFE_SECS.
Release 0.6.0 (2008-04-30)
Modified: tapirlink/trunk/classes/TpInventoryResponse.php
===================================================================
--- tapirlink/trunk/classes/TpInventoryResponse.php 2008-07-31 15:35:10 UTC (rev 740)
+++ tapirlink/trunk/classes/TpInventoryResponse.php 2008-08-01 15:18:13 UTC (rev 741)
@@ -225,23 +225,61 @@
TpDiagnostics::Append( DC_DEBUG_MSG, 'SQL to count: '.$sql, DIAG_DEBUG );
- $encoded_sql = TpServiceUtils::EncodeSql( $sql, $db_encoding );
+ // Try to get count from cache if this feature is enabled
+ $cached_data = null;
- $result_set = &$cn->Execute( $encoded_sql );
+ if ( TP_USE_CACHE and TP_SQL_COUNT_CACHE_LIFE_SECS )
+ {
+ $cache_dir = TP_CACHE_DIR . '/' . $this->mRequest->GetResourceCode();
- if ( ! is_object( $result_set ) )
+ $cache_options = array( 'cache_dir' => $cache_dir );
+
+ $subdir = 'cnt';
+
+ $cache = new Cache( 'file', $cache_options );
+ $cache_id = $cache->generateID( $sql );
+ }
+
+ if ( $cached_data = $cache->get( $cache_id, $subdir ) )
{
- $this->Error( 'Failed to count matched records' );
+ $g_dlog->debug( 'Getting count from cache' );
- $r_data_source->ResetConnection();
+ TpDiagnostics::Append( DC_SYS_MSG, 'Count retrieved from cache', DIAG_WARN );
- return;
+ $matched = (int)$cached_data;
}
else
{
- $matched = $result_set->RecordCount();
+ $encoded_sql = TpServiceUtils::EncodeSql( $sql, $db_encoding );
- $result_set->Close();
+ $result_set = &$cn->Execute( $encoded_sql );
+
+ if ( ! is_object( $result_set ) )
+ {
+ $this->Error( 'Failed to count matched records' );
+
+ $r_data_source->ResetConnection();
+
+ return;
+ }
+ else
+ {
+ $matched = $result_set->RecordCount();
+
+ $result_set->Close();
+ }
+
+ // Save result in cache if this feature is enabled
+ if ( TP_USE_CACHE and TP_SQL_COUNT_CACHE_LIFE_SECS and
+ is_null( $cached_data ) )
+ {
+ $cache_expires = TP_SQL_COUNT_CACHE_LIFE_SECS;
+ $cached_data = $matched;
+
+ $cache->save( $cache_id, $cached_data, $cache_expires, $subdir );
+
+ $g_dlog->debug( 'Caching count SQL: '.$matched );
+ }
}
}
Modified: tapirlink/trunk/classes/TpSearchResponse.php
===================================================================
--- tapirlink/trunk/classes/TpSearchResponse.php 2008-07-31 15:35:10 UTC (rev 740)
+++ tapirlink/trunk/classes/TpSearchResponse.php 2008-08-01 15:18:13 UTC (rev 741)
@@ -409,23 +409,62 @@
TpDiagnostics::Append( DC_DEBUG_MSG, 'SQL to count: '.$sql, DIAG_DEBUG );
- $encoded_sql = TpServiceUtils::EncodeSql( $sql, $db_encoding );
+ // Try to get count from cache if this feature is enabled
+ $cached_data = null;
- $result_set = &$cn->Execute( $encoded_sql );
+ if ( TP_USE_CACHE and TP_SQL_COUNT_CACHE_LIFE_SECS )
+ {
+ $cache_dir = TP_CACHE_DIR . '/' . $this->mRequest->GetResourceCode();
- if ( ! is_object( $result_set ) )
+ $cache_options = array( 'cache_dir' => $cache_dir );
+
+ $subdir = 'cnt';
+
+ $cache = new Cache( 'file', $cache_options );
+ $cache_id = $cache->generateID( $sql );
+ }
+
+ if ( $cached_data = $cache->get( $cache_id, $subdir ) )
{
- $this->Error( 'Failed to count matched records' );
+ $g_dlog->debug( 'Getting count from cache' );
- $r_data_source->ResetConnection();
+ TpDiagnostics::Append( DC_SYS_MSG, 'Count retrieved from cache', DIAG_WARN );
- return;
+ $matched = (int)$cached_data;
}
else
{
- $matched = $result_set->RecordCount();
+ $encoded_sql = TpServiceUtils::EncodeSql( $sql, $db_encoding );
- $result_set->Close();
+ $result_set = &$cn->Execute( $encoded_sql );
+
+ if ( ! is_object( $result_set ) )
+ {
+ $this->Error( 'Failed to count matched records' );
+
+ $r_data_source->ResetConnection();
+
+ return;
+ }
+ else
+ {
+ $matched = $result_set->RecordCount();
+
+ $result_set->Close();
+ }
+
+
+ // Save result in cache if this feature is enabled
+ if ( TP_USE_CACHE and TP_SQL_COUNT_CACHE_LIFE_SECS and
+ is_null( $cached_data ) )
+ {
+ $cache_expires = TP_SQL_COUNT_CACHE_LIFE_SECS;
+ $cached_data = $matched;
+
+ $cache->save( $cache_id, $cached_data, $cache_expires, $subdir );
+
+ $g_dlog->debug( 'Caching count SQL: '.$matched );
+ }
}
}
Modified: tapirlink/trunk/misc/diag_codes.xml
===================================================================
--- tapirlink/trunk/misc/diag_codes.xml 2008-07-31 15:35:10 UTC (rev 740)
+++ tapirlink/trunk/misc/diag_codes.xml 2008-08-01 15:18:13 UTC (rev 741)
@@ -32,6 +32,9 @@
<code const="DC_DEBUG_MSG" value="DEBUG_MESSAGE" level="debug">
Displays a debug message.
</code>
+ <code const="DC_SYS_MSG" value="SYSTEM_MESSAGE" level="info">
+Displays a system message.
+</code>
<code const="DC_UNSUPPORTED_CAPABILITY" value="UNSUPPORTED_CAPABILITY" level="warning">
Indicates that a certain capability is not supported.
</code>
Modified: tapirlink/trunk/www/diagnostic_codes.html
===================================================================
--- tapirlink/trunk/www/diagnostic_codes.html 2008-07-31 15:35:10 UTC (rev 740)
+++ tapirlink/trunk/www/diagnostic_codes.html 2008-08-01 15:18:13 UTC (rev 741)
@@ -64,6 +64,13 @@
</td>
</tr>
<tr>
+<td>SYSTEM_MESSAGE</td>
+<td>info</td>
+<td>
+Displays a system message.
+</td>
+</tr>
+ <tr>
<td>UNSUPPORTED_CAPABILITY</td>
<td>warning</td>
<td>
Modified: tapirlink/trunk/www/localconfig_dist.php
===================================================================
--- tapirlink/trunk/www/localconfig_dist.php 2008-07-31 15:35:10 UTC (rev 740)
+++ tapirlink/trunk/www/localconfig_dist.php 2008-08-01 15:18:13 UTC (rev 741)
@@ -166,6 +166,12 @@
//define('TP_RESP_STRUCTURE_CACHE_LIFE_SECS', 31536000);
/**
+* Number of seconds that cached SQL counts will be used before forcing another
+* hit in the database. Default is once a week. Set to zero to disable this cache.
+*/
+//define( 'TP_SQL_COUNT_CACHE_LIFE_SECS', 604800 );
+
+/**
* Skin identifier (subdirectory name inside "www/skins" directory) indicating
* a set of XSLT and CSS files to be used on top of responses.
*/
Modified: tapirlink/trunk/www/tapir_diagnostics.php
===================================================================
--- tapirlink/trunk/www/tapir_diagnostics.php 2008-07-31 15:35:10 UTC (rev 740)
+++ tapirlink/trunk/www/tapir_diagnostics.php 2008-08-01 15:18:13 UTC (rev 741)
@@ -55,6 +55,12 @@
/****
+Displays a system message.
+*/
+define('DC_SYS_MSG','SYSTEM_MESSAGE');
+
+
+/****
Indicates that a certain capability is not supported.
*/
define('DC_UNSUPPORTED_CAPABILITY','UNSUPPORTED_CAPABILITY');
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2008-07-31 15:35:10 UTC (rev 740)
+++ tapirlink/trunk/www/tapir_globals.php 2008-08-01 15:18:13 UTC (rev 741)
@@ -328,6 +328,15 @@
}
/**
+* Number of seconds that cached SQL counts can be used before
+* forcing another hit in the dabatase. Default is once a week.
+*/
+if ( ! defined( 'TP_SQL_COUNT_CACHE_LIFE_SECS' ) )
+{
+ define( 'TP_SQL_COUNT_CACHE_LIFE_SECS', 604800 );
+}
+
+/**
* Indicates how file retrieval should happen. Possible values:
* prefer_original: Prefer original files directly specified in the request or
* inside other documents referenced by the request. These are
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2008-08-01 15:20:58
|
Revision: 742
http://digir.svn.sourceforge.net/digir/?rev=742&view=rev
Author: rdg
Date: 2008-08-01 15:20:52 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
Getting prepared for new release.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2008-08-01 15:18:13 UTC (rev 741)
+++ tapirlink/trunk/ChangeLog.txt 2008-08-01 15:20:52 UTC (rev 742)
@@ -1,16 +1,16 @@
-Release 0.6.1 (?)
---------------------------
-(revision ?)
-
- * Added support for automatic updates.
- * Bugfix: dateLastUpdated environment variable was not working if it
- was mapped to a field with a datatype other than datetime.
- * Removed unnecessary verification to check if session.save_path is writable
- when running the configurator.
- * Included caching mechanism for count SQL in inventories and searches. Can
- be controlled with TP_SQL_COUNT_CACHE_LIFE_SECS.
-
-
+Release 0.6.1 (2008-08-01)
+--------------------------
+(revision 742)
+
+ * Added support for automatic updates.
+ * Bugfix: dateLastUpdated environment variable was not working if it
+ was mapped to a field with a datatype other than datetime.
+ * Removed unnecessary verification to check if session.save_path is writable
+ when running the configurator.
+ * Included caching mechanism for count SQL in inventories and searches. Can
+ be controlled with TP_SQL_COUNT_CACHE_LIFE_SECS.
+
+
Release 0.6.0 (2008-04-30)
--------------------------
(revision 660)
@@ -26,7 +26,7 @@
will be loaded.
* Bugfix: Resuming the inclusion of new resources was probably not working
correctly in previous versions.
- * Configuration interface can now make use of debug logging.
+ * Configuration interface can now make use of debug logging.
* Bugfix: KVP filters were not working properly on PHP 4.x when they had
nested parenthesis.
* Many adjustments in the statistics module.
@@ -61,10 +61,10 @@
* Bugfix: When a node contained a concatenated mapping, it was being rejected.
if one of the mappings evaluated to NULL.
* Added alias support for output models.
- * Capabilities response now includes the local datatype for each mapped concept.^M
- * Removed ConceptNameServers element from capabilities response.^M
- * Bugfix: log-only requests were not working for search and inventory operations.^M
- * Bugfix: "next" attribute was not being included in the search summary when^M
+ * Capabilities response now includes the local datatype for each mapped concept.^M
+ * Removed ConceptNameServers element from capabilities response.^M
+ * Bugfix: log-only requests were not working for search and inventory operations.^M
+ * Bugfix: "next" attribute was not being included in the search summary when^M
no records were returned.
* Added xsd:dateTime to db timestamp conversion in filters.
* Added db timestamp to xsd:dateTime conversion in search and inventory responses.
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2008-08-01 15:18:13 UTC (rev 741)
+++ tapirlink/trunk/www/tapir_globals.php 2008-08-01 15:20:52 UTC (rev 742)
@@ -550,7 +550,7 @@
define( 'TP_MIN_PHP_VERSION', '4.2.3' );
-define( 'TP_VERSION', '0.6.0' );
+define( 'TP_VERSION', '0.6.1' );
$revision = '$Revision$.';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2008-08-01 16:58:46
|
Revision: 745
http://digir.svn.sourceforge.net/digir/?rev=745&view=rev
Author: rdg
Date: 2008-08-01 16:58:44 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
Updated revision number.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2008-08-01 16:57:29 UTC (rev 744)
+++ tapirlink/trunk/ChangeLog.txt 2008-08-01 16:58:44 UTC (rev 745)
@@ -1,6 +1,6 @@
Release 0.6.1 (2008-08-01)
--------------------------
-(revision 742)
+(revision 745)
* Added support for automatic updates.
* Bugfix: dateLastUpdated environment variable was not working if it
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2008-08-01 16:57:29 UTC (rev 744)
+++ tapirlink/trunk/www/tapir_globals.php 2008-08-01 16:58:44 UTC (rev 745)
@@ -552,6 +552,7 @@
define( 'TP_VERSION', '0.6.1' );
+
$revision = '$Revision$.';
$revision_regexp = '/^\$'.'Revision:\s(\d+)\s\$\.$/';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2008-10-26 12:38:47
|
Revision: 1946
http://digir.svn.sourceforge.net/digir/?rev=1946&view=rev
Author: rdg
Date: 2008-10-26 11:02:14 +0000 (Sun, 26 Oct 2008)
Log Message:
-----------
Treat mixed content more gracefully in complex types.
Modified Paths:
--------------
tapirlink/trunk/classes/TpSchemaInspector.php
tapirlink/trunk/classes/TpXmlGenerator.php
tapirlink/trunk/lib/phpxsd/XsComplexType.php
tapirlink/trunk/lib/phpxsd/XsSchemaParser.php
Modified: tapirlink/trunk/classes/TpSchemaInspector.php
===================================================================
--- tapirlink/trunk/classes/TpSchemaInspector.php 2008-10-26 11:00:12 UTC (rev 1945)
+++ tapirlink/trunk/classes/TpSchemaInspector.php 2008-10-26 11:02:14 UTC (rev 1946)
@@ -302,6 +302,15 @@
$type_has_attributes );
}
+ // Mixed content
+ if ( $r_type->IsMixed() )
+ {
+ $g_dlog->debug( 'Is mixed' );
+
+ // This will force automapped concepts to be added
+ $this->_CheckSimpleContent( $rXsElementDecl, $path, $min_occurs );
+ }
+
if ( $path == $this->mIndexingElement )
{
$this->mFoundIndexingElement = true;
@@ -321,7 +330,21 @@
}
else
{
- $this->mAcceptedPaths[$path] = $min_occurs;
+ if ( $r_type->IsMixed() )
+ {
+ if ( ! in_array( $path, $this->mRejectedPaths ) )
+ {
+ $this->mAcceptedPaths[$path] = $min_occurs;
+ }
+ }
+ else
+ {
+ if ( count( $this->mRejectedPaths ) == 0 or
+ $this->_HasAnAcceptedSubnode( $path ) )
+ {
+ $this->mAcceptedPaths[$path] = $min_occurs;
+ }
+ }
}
}
else
@@ -685,7 +708,7 @@
TpDiagnostics::Append( DC_CONTENT_UNAVAILABLE, $msg, DIAG_WARN );
- // Don't reject if it's a concatenation
+ // Don't reject if it's a concatenation ($num_mappings > 1)
if ( $num_mappings == 1 )
{
array_push( $this->mRejectedPaths, $path );
@@ -710,7 +733,7 @@
TpDiagnostics::Append( DC_CONTENT_UNAVAILABLE, $msg, DIAG_WARN );
- // Don't reject if it's a concatenation
+ // Don't reject if it's a concatenation ($num_mappings > 1)
if ( $num_mappings == 1 )
{
array_push( $this->mRejectedPaths, $path );
@@ -758,5 +781,21 @@
} // end of member function GetRejectedPaths
+ function _HasAnAcceptedSubnode( $path )
+ {
+ global $g_dlog;
+ foreach ( $this->mAcceptedPaths as $accepted_path => $num )
+ {
+ if ( strpos( $accepted_path, $path ) === 0 )
+ {
+ $g_dlog->debug( "$path is in $accepted_path" );
+ return true;
+ }
+ }
+
+ return false;
+
+ } // end of member function _HasAnAcceptedSubnode
+
} // end of TpSchemaInspector
?>
\ No newline at end of file
Modified: tapirlink/trunk/classes/TpXmlGenerator.php
===================================================================
--- tapirlink/trunk/classes/TpXmlGenerator.php 2008-10-26 11:00:12 UTC (rev 1945)
+++ tapirlink/trunk/classes/TpXmlGenerator.php 2008-10-26 11:02:14 UTC (rev 1946)
@@ -414,6 +414,22 @@
}
}
+ // Mixed content (treat as simple content with unknown type)
+
+ if ( $r_type->IsMixed() and empty( $current_subcontent_xml ) )
+ {
+ $g_dlog->debug( 'Is mixed' );
+
+ $value = $this->_GetSimpleContent( $rXsElementDecl, $path );
+
+ if ( ! is_null( $value ) )
+ {
+ $current_subcontent_xml = $value;
+
+ $content .= $current_subcontent_xml;
+ }
+ }
+
// Don't render complex elements without content
if ( empty( $attributes_xml ) and
empty( $base_subcontent_xml ) and
@@ -752,7 +768,7 @@
{
global $g_dlog;
- $g_dlog->debug( 'Getting mapped data' );
+ $g_dlog->debug( 'Getting mapped data');
$data = '';
Modified: tapirlink/trunk/lib/phpxsd/XsComplexType.php
===================================================================
--- tapirlink/trunk/lib/phpxsd/XsComplexType.php 2008-10-26 11:00:12 UTC (rev 1945)
+++ tapirlink/trunk/lib/phpxsd/XsComplexType.php 2008-10-26 11:02:14 UTC (rev 1946)
@@ -32,12 +32,14 @@
var $mDeclaredAttributeUses = array(); // XsAttributeUse objects
var $mrContentType;
var $mSimpleTypeDerivation;
+ var $mMixed;
- function XsComplexType( $name, $targetNamespace, $isGlobal )
+ function XsComplexType( $name, $targetNamespace, $isGlobal, $mixed )
{
parent::XsType( $name, $targetNamespace, $isGlobal );
$this->mIsSimple = false;
+ $this->mMixed = $mixed;
} // end of member function XsComplexType
@@ -77,6 +79,12 @@
} // end of member function HasSimpleContent
+ function IsMixed( )
+ {
+ return $this->mMixed;
+
+ } // end of member function IsMixed
+
/**
* Internal method called before serialization
*
@@ -86,7 +94,8 @@
{
return array_merge( parent::__sleep(), array( 'mDeclaredAttributeUses',
'mrContentType',
- 'mSimpleTypeDerivation' ) );
+ 'mSimpleTypeDerivation',
+ 'mMixed' ) );
} // end of member function __sleep
Modified: tapirlink/trunk/lib/phpxsd/XsSchemaParser.php
===================================================================
--- tapirlink/trunk/lib/phpxsd/XsSchemaParser.php 2008-10-26 11:00:12 UTC (rev 1945)
+++ tapirlink/trunk/lib/phpxsd/XsSchemaParser.php 2008-10-26 11:02:14 UTC (rev 1946)
@@ -517,8 +517,15 @@
$name = $attrs['name'];
}
- $xs_complex_type = new XsComplexType( $name, $namespace, $is_global );
+ $mixed = false;
+ if ( isset( $attrs['mixed'] ) and $attrs['mixed'] == 'true' )
+ {
+ $mixed = true;
+ }
+
+ $xs_complex_type = new XsComplexType( $name, $namespace, $is_global, $mixed );
+
if ( $is_global )
{
if ( $name == null )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-01-06 12:58:23
|
Revision: 1958
http://digir.svn.sourceforge.net/digir/?rev=1958&view=rev
Author: rdg
Date: 2009-01-06 12:58:21 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
Included basic checks when processing ping request (service configuration, database connection and runtime errors).
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpDataSourceForm.php
tapirlink/trunk/classes/TpPingResponse.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2009-01-06 12:29:26 UTC (rev 1957)
+++ tapirlink/trunk/ChangeLog.txt 2009-01-06 12:58:21 UTC (rev 1958)
@@ -10,7 +10,9 @@
didn't follow the expected (real) database encoding.
* Added support for mixed content elements, allowing TapirLink to be exchange
simple TCS (Taxonomic Concept Schema) data.
- * Fixed bug in SQL count caching mechanism when it was disabled.
+ * Fixed bug in SQL count caching mechanism when it was disabled.
+ * Included basic checks when processing ping request (service configuration,
+ database connection and runtime errors).
Release 0.6.1 (2008-08-01)
--------------------------
@@ -24,7 +26,6 @@
* Included caching mechanism for count SQL in inventories and searches. Can
be controlled with TP_SQL_COUNT_CACHE_LIFE_SECS.
-
Release 0.6.0 (2008-04-30)
--------------------------
(revision 660)
Modified: tapirlink/trunk/classes/TpDataSourceForm.php
===================================================================
--- tapirlink/trunk/classes/TpDataSourceForm.php 2009-01-06 12:29:26 UTC (rev 1957)
+++ tapirlink/trunk/classes/TpDataSourceForm.php 2009-01-06 12:58:21 UTC (rev 1958)
@@ -95,7 +95,7 @@
$r_data_source =& $this->mResource->GetDataSource();
// Validate connection
- if ( ! $r_data_source->validate() )
+ if ( ! $r_data_source->Validate() )
{
return;
}
Modified: tapirlink/trunk/classes/TpPingResponse.php
===================================================================
--- tapirlink/trunk/classes/TpPingResponse.php 2009-01-06 12:29:26 UTC (rev 1957)
+++ tapirlink/trunk/classes/TpPingResponse.php 2009-01-06 12:58:21 UTC (rev 1958)
@@ -21,6 +21,7 @@
*/
require_once('TpResponse.php');
+require_once('TpDiagnostics.php');
class TpPingResponse extends TpResponse
{
@@ -34,6 +35,32 @@
function Body()
{
+ $r_resource =& $this->mRequest->GetResource();
+
+ $r_resource->LoadConfig();
+
+ if ( ! $r_resource->IsValid() )
+ {
+ echo "\n<error>Service configuration error</error>";
+
+ return;
+ }
+
+ $r_data_source =& $r_resource->GetDatasource();
+
+ if ( ! $r_data_source->Validate() )
+ {
+ echo "\n<error>Database connection error</error>";
+
+ return;
+ }
+
+ if ( TpDiagnostics::Count( array( DIAG_ERROR, DIAG_FATAL ) ) )
+ {
+ echo "\n<error>Service runtime error</error>";
+ return;
+ }
+
echo "\n<pong/>";
} // end of member function Body
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-01-07 17:03:34
|
Revision: 1962
http://digir.svn.sourceforge.net/digir/?rev=1962&view=rev
Author: rdg
Date: 2009-01-07 17:03:29 +0000 (Wed, 07 Jan 2009)
Log Message:
-----------
Return HTTP 204 when envelope is disabled and query produced no result.
Modified Paths:
--------------
tapirlink/trunk/classes/TpSearchResponse.php
tapirlink/trunk/www/tapir_client.php
Modified: tapirlink/trunk/classes/TpSearchResponse.php
===================================================================
--- tapirlink/trunk/classes/TpSearchResponse.php 2009-01-07 17:01:17 UTC (rev 1961)
+++ tapirlink/trunk/classes/TpSearchResponse.php 2009-01-07 17:03:29 UTC (rev 1962)
@@ -65,6 +65,15 @@
} // end of member function Footer
+ function Process()
+ {
+ // This method is redefined here because in some cases it is necessary
+ // to replace headers (see "header" call inside TpXmlGenerator).
+ ob_start();
+ parent::Process();
+
+ } // end of member function Footer
+
function Body()
{
global $g_dlog;
@@ -531,6 +540,16 @@
{
echo "\n<search>";
}
+ else
+ {
+ // Avoid an empty XML response
+ if ( empty( $main_content ) )
+ {
+ header("HTTP/1.1 204 No Content");
+ //$this->Error( 'No content available for this query', 'info' );
+ return;
+ }
+ }
echo $main_content;
Modified: tapirlink/trunk/www/tapir_client.php
===================================================================
--- tapirlink/trunk/www/tapir_client.php 2009-01-07 17:01:17 UTC (rev 1961)
+++ tapirlink/trunk/www/tapir_client.php 2009-01-07 17:03:29 UTC (rev 1962)
@@ -161,7 +161,7 @@
if ( ! headers_sent() )
{
- header ( 'Content-type: text/xml' );
+ header( 'Content-type: text/xml' );
echo $response;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-01-20 18:11:34
|
Revision: 1966
http://digir.svn.sourceforge.net/digir/?rev=1966&view=rev
Author: rdg
Date: 2009-01-20 18:11:30 +0000 (Tue, 20 Jan 2009)
Log Message:
-----------
Added support to "IN" operator in KVP filters.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpFilter.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2009-01-09 17:39:46 UTC (rev 1965)
+++ tapirlink/trunk/ChangeLog.txt 2009-01-20 18:11:30 UTC (rev 1966)
@@ -18,6 +18,7 @@
application/rdf+xml.
* When a search returns no content and the envelope is turned off, TapirLink
now returns HTTP 204 (No Content).
+ * Added support to "IN" operator in KVP filters.
Release 0.6.1 (2008-08-01)
--------------------------
Modified: tapirlink/trunk/classes/TpFilter.php
===================================================================
--- tapirlink/trunk/classes/TpFilter.php 2009-01-09 17:39:46 UTC (rev 1965)
+++ tapirlink/trunk/classes/TpFilter.php 2009-01-20 18:11:30 UTC (rev 1966)
@@ -703,12 +703,40 @@
}
else if ( $opClass == 'in' )
{
- $error = "Invalid filter: Operator 'in' cannot be used in KVP requests";
- TpDiagnostics::Append( DC_INVALID_FILTER, $error, DIAG_ERROR );
+ $num_tokens = count( $tokens );
- $this->mIsValid = false;
+ if ( $num_tokens < 3 )
+ {
+ $error = "Invalid filter: wrong number of arguments to comparison ".
+ "operator '$opClass'";
+ TpDiagnostics::Append( DC_INVALID_FILTER, $error, DIAG_ERROR );
- return null;
+ $this->mIsValid = false;
+
+ return null;
+ }
+
+ $op = new TpComparisonOperator( COP_IN );
+
+ // Set base concept
+ if ( is_object( $tokens[$idx-1] ) and
+ strtolower( get_class( $tokens[$idx-1] ) ) == 'tpexpression' and
+ $tokens[$idx-1]->GetType() == EXP_CONCEPT )
+ {
+ $op->SetExpression( $tokens[$idx-1] );
+ }
+
+ // Set arguments
+ for ( $i = 2; $i < $num_tokens; ++$i )
+ {
+ $el = $tokens[$i];
+
+ if ( is_object( $el ) and
+ strtolower( get_class( $el ) ) == 'tpexpression' )
+ {
+ $op->SetExpression( $el );
+ }
+ }
}
return $op;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-02-25 17:28:00
|
Revision: 1981
http://digir.svn.sourceforge.net/digir/?rev=1981&view=rev
Author: rdg
Date: 2009-02-25 17:27:35 +0000 (Wed, 25 Feb 2009)
Log Message:
-----------
Replaced XML schema location used in responses with the official one mentioned in the spec.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2009-02-25 17:12:53 UTC (rev 1980)
+++ tapirlink/trunk/ChangeLog.txt 2009-02-25 17:27:35 UTC (rev 1981)
@@ -20,6 +20,11 @@
now returns HTTP 204 (No Content).
* Added support to "IN" operator in KVP filters.
* New TP_DIAG_LEVEL option can be used to control disgnostics display.
+ * Fixed bug when importing DiGIR configuration (resource entity was not being
+ imported and all contacts were accumulating in the host entity across
+ different resources).
+ * Replaced XML schema location used in responses with:
+ http://rs.tdwg.org/tapir/1.0/schema/tdwg_tapir.xsd
Release 0.6.1 (2008-08-01)
--------------------------
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2009-02-25 17:12:53 UTC (rev 1980)
+++ tapirlink/trunk/www/tapir_globals.php 2009-02-25 17:27:35 UTC (rev 1981)
@@ -575,7 +575,7 @@
define( 'TP_REVISION', $revision );
define( 'TP_NAMESPACE','http://rs.tdwg.org/tapir/1.0' );
-define( 'TP_SCHEMA_LOCATION','http://rs.tdwg.org/tapir/1.0/schema/tapir.xsd' );
+define( 'TP_SCHEMA_LOCATION','http://rs.tdwg.org/tapir/1.0/schema/tdwg_tapir.xsd' );
define( 'XMLSCHEMANS','http://www.w3.org/2001/XMLSchema' );
define( 'XMLSCHEMAINST','http://www.w3.org/2001/XMLSchema-instance' );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-02-25 20:41:11
|
Revision: 1982
http://digir.svn.sourceforge.net/digir/?rev=1982&view=rev
Author: rdg
Date: 2009-02-25 20:40:59 +0000 (Wed, 25 Feb 2009)
Log Message:
-----------
Added new metadata fields: region code, country code and zip code.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpEntity.php
tapirlink/trunk/classes/TpMetadataForm.php
tapirlink/trunk/classes/TpResourceMetadata.php
tapirlink/trunk/templates/TpMetadataForm.tmpl.php
tapirlink/trunk/www/skins/darwin/metadata.xsl
tapirlink/trunk/www/skins/default/metadata.xsl
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2009-02-25 17:27:35 UTC (rev 1981)
+++ tapirlink/trunk/ChangeLog.txt 2009-02-25 20:40:59 UTC (rev 1982)
@@ -25,6 +25,7 @@
different resources).
* Replaced XML schema location used in responses with:
http://rs.tdwg.org/tapir/1.0/schema/tdwg_tapir.xsd
+ * Added new metadata fields: region code, country code and zip code.
Release 0.6.1 (2008-08-01)
--------------------------
Modified: tapirlink/trunk/classes/TpEntity.php
===================================================================
--- tapirlink/trunk/classes/TpEntity.php 2009-02-25 17:27:35 UTC (rev 1981)
+++ tapirlink/trunk/classes/TpEntity.php 2009-02-25 20:40:59 UTC (rev 1982)
@@ -40,6 +40,9 @@
var $mLatitude;
var $mLongitude;
var $mAddress;
+ var $mRegionCode;
+ var $mCountryCode;
+ var $mZipCode;
function TpEntity( )
{
@@ -77,6 +80,12 @@
$this->mAddress = TpUtils::GetVar( $prefix.'_address', '' );
+ $this->mRegionCode = TpUtils::GetVar( $prefix.'_regionCode', '' );
+
+ $this->mCountryCode = TpUtils::GetVar( $prefix.'_countryCode', '' );
+
+ $this->mZipCode = TpUtils::GetVar( $prefix.'_zipCode', '' );
+
$this->mRelatedInformation = urldecode( TpUtils::GetVar( $prefix.'_relatedInformation', '' ) );
$this->mLongitude = TpUtils::GetVar( $prefix.'_longitude', '' );
@@ -210,6 +219,42 @@
} // end of member function SetAddress
+ function GetRegionCode( )
+ {
+ return $this->mRegionCode;
+
+ } // end of member function GetRegionCode
+
+ function SetRegionCode( $regionCode )
+ {
+ $this->mRegionCode = $regionCode;
+
+ } // end of member function SetRegionCode
+
+ function GetCountryCode( )
+ {
+ return $this->mCountryCode;
+
+ } // end of member function GetCountryCode
+
+ function SetCountryCode( $countryCode )
+ {
+ $this->mCountryCode = $countryCode;
+
+ } // end of member function SetCountryCode
+
+ function GetZipCode( )
+ {
+ return $this->mZipCode;
+
+ } // end of member function GetZipCode
+
+ function SetZipCode( $zipCode )
+ {
+ $this->mZipCode = $zipCode;
+
+ } // end of member function SetZipCode
+
function GetRelatedInformation( )
{
return $this->mRelatedInformation;
@@ -361,6 +406,21 @@
$xml .= TpUtils::MakeTag( '', 'address', $this->mAddress, $indent1 );
+ if ( ! empty( $this->mRegionCode ) )
+ {
+ $xml .= TpUtils::MakeTag( '', 'regionCode', $this->mRegionCode, $indent1 );
+ }
+
+ if ( ! empty( $this->mCountryCode ) )
+ {
+ $xml .= TpUtils::MakeTag( '', 'countryCode', $this->mCountryCode, $indent1 );
+ }
+
+ if ( ! empty( $this->mZipCode ) )
+ {
+ $xml .= TpUtils::MakeTag( '', 'zipCode', $this->mZipCode, $indent1 );
+ }
+
if ( ! empty( $this->mRelatedInformation ) )
{
$xml .= TpUtils::MakeTag( '', 'relatedInformation',
Modified: tapirlink/trunk/classes/TpMetadataForm.php
===================================================================
--- tapirlink/trunk/classes/TpMetadataForm.php 2009-02-25 17:27:35 UTC (rev 1981)
+++ tapirlink/trunk/classes/TpMetadataForm.php 2009-02-25 20:40:59 UTC (rev 1982)
@@ -306,8 +306,23 @@
else if ( $labelId == 'address')
{
$label = 'Address';
- $doc = 'Entity physical address.';
+ $doc = 'Address where the entity is located. It can include street name, street number, district, city, county and other complements. Use the next fields to specify state/province, country and zip code.';
}
+ else if ( $labelId == 'regionCode')
+ {
+ $label = 'Region';
+ $doc = 'Region (e.g., state or province) of the specified address. Use standard abbreviation accepted in the country.';
+ }
+ else if ( $labelId == 'countryCode')
+ {
+ $label = 'Country';
+ $doc = 'Country of the specified address.';
+ }
+ else if ( $labelId == 'zipCode')
+ {
+ $label = 'Zip code';
+ $doc = 'Zip or postal code of the specified address.';
+ }
else if ( $labelId == 'relatedInformation')
{
$label = 'Related information (URL)';
@@ -506,6 +521,256 @@
'PT5H' => '5 hours',
'PT10H' => '10 hours');
}
+ else if ( $id == 'countryCodes')
+ {
+ $options = array('' => '---',
+'AF' => 'AFGHANISTAN',
+'AX' => 'ÅLAND ISLANDS',
+'AL' => 'ALBANIA',
+'DZ' => 'ALGERIA',
+'AS' => 'AMERICAN SAMOA',
+'AD' => 'ANDORRA',
+'AO' => 'ANGOLA',
+'AI' => 'ANGUILLA',
+'AQ' => 'ANTARCTICA',
+'AG' => 'ANTIGUA AND BARBUDA',
+'AR' => 'ARGENTINA',
+'AM' => 'ARMENIA',
+'AW' => 'ARUBA',
+'AU' => 'AUSTRALIA',
+'AT' => 'AUSTRIA',
+'AZ' => 'AZERBAIJAN',
+'BS' => 'BAHAMAS',
+'BH' => 'BAHRAIN',
+'BD' => 'BANGLADESH',
+'BB' => 'BARBADOS',
+'BY' => 'BELARUS',
+'BE' => 'BELGIUM',
+'BZ' => 'BELIZE',
+'BJ' => 'BENIN',
+'BM' => 'BERMUDA',
+'BT' => 'BHUTAN',
+'BO' => 'BOLIVIA',
+'BA' => 'BOSNIA AND HERZEGOVINA',
+'BW' => 'BOTSWANA',
+'BV' => 'BOUVET ISLAND',
+'BR' => 'BRAZIL',
+'IO' => 'BRITISH INDIAN OCEAN TERRITORY',
+'BN' => 'BRUNEI DARUSSALAM',
+'BG' => 'BULGARIA',
+'BF' => 'BURKINA FASO',
+'BI' => 'BURUNDI',
+'KH' => 'CAMBODIA',
+'CM' => 'CAMEROON',
+'CA' => 'CANADA',
+'CV' => 'CAPE VERDE',
+'KY' => 'CAYMAN ISLANDS',
+'CF' => 'CENTRAL AFRICAN REPUBLIC',
+'TD' => 'CHAD',
+'CL' => 'CHILE',
+'CN' => 'CHINA',
+'CX' => 'CHRISTMAS ISLAND',
+'CC' => 'COCOS (KEELING) ISLANDS',
+'CO' => 'COLOMBIA',
+'KM' => 'COMOROS',
+'CG' => 'CONGO',
+'CD' => 'CONGO, THE DEMOCRATIC REPUBLIC OF THE',
+'CK' => 'COOK ISLANDS',
+'CR' => 'COSTA RICA',
+'CI' => 'CÔTE D\'IVOIRE',
+'HR' => 'CROATIA',
+'CU' => 'CUBA',
+'CY' => 'CYPRUS',
+'CZ' => 'CZECH REPUBLIC',
+'DK' => 'DENMARK',
+'DJ' => 'DJIBOUTI',
+'DM' => 'DOMINICA',
+'DO' => 'DOMINICAN REPUBLIC',
+'EC' => 'ECUADOR',
+'EG' => 'EGYPT',
+'SV' => 'EL SALVADOR',
+'GQ' => 'EQUATORIAL GUINEA',
+'ER' => 'ERITREA',
+'EE' => 'ESTONIA',
+'ET' => 'ETHIOPIA',
+'FK' => 'FALKLAND ISLANDS (MALVINAS)',
+'FO' => 'FAROE ISLANDS',
+'FJ' => 'FIJI',
+'FI' => 'FINLAND',
+'FR' => 'FRANCE',
+'GF' => 'FRENCH GUIANA',
+'PF' => 'FRENCH POLYNESIA',
+'TF' => 'FRENCH SOUTHERN TERRITORIES',
+'GA' => 'GABON',
+'GM' => 'GAMBIA',
+'GE' => 'GEORGIA',
+'DE' => 'GERMANY',
+'GH' => 'GHANA',
+'GI' => 'GIBRALTAR',
+'GR' => 'GREECE',
+'GL' => 'GREENLAND',
+'GD' => 'GRENADA',
+'GP' => 'GUADELOUPE',
+'GU' => 'GUAM',
+'GT' => 'GUATEMALA',
+'GG' => 'GUERNSEY',
+'GN' => 'GUINEA',
+'GW' => 'GUINEA-BISSAU',
+'GY' => 'GUYANA',
+'HT' => 'HAITI',
+'HM' => 'HEARD ISLAND AND MCDONALD ISLANDS',
+'VA' => 'HOLY SEE (VATICAN CITY STATE)',
+'HN' => 'HONDURAS',
+'HK' => 'HONG KONG',
+'HU' => 'HUNGARY',
+'IS' => 'ICELAND',
+'IN' => 'INDIA',
+'ID' => 'INDONESIA',
+'IR' => 'IRAN',
+'IQ' => 'IRAQ',
+'IE' => 'IRELAND',
+'IM' => 'ISLE OF MAN',
+'IL' => 'ISRAEL',
+'IT' => 'ITALY',
+'JM' => 'JAMAICA',
+'JP' => 'JAPAN',
+'JE' => 'JERSEY',
+'JO' => 'JORDAN',
+'KZ' => 'KAZAKHSTAN',
+'KE' => 'KENYA',
+'KI' => 'KIRIBATI',
+'KP' => 'KOREA, DEMOCRATIC PEOPLE\'S REPUBLIC OF',
+'KR' => 'KOREA, REPUBLIC OF',
+'KW' => 'KUWAIT',
+'KG' => 'KYRGYZSTAN',
+'LA' => 'LAO',
+'LV' => 'LATVIA',
+'LB' => 'LEBANON',
+'LS' => 'LESOTHO',
+'LR' => 'LIBERIA',
+'LY' => 'LIBYAN ARAB JAMAHIRIYA',
+'LI' => 'LIECHTENSTEIN',
+'LT' => 'LITHUANIA',
+'LU' => 'LUXEMBOURG',
+'MO' => 'MACAO',
+'MK' => 'MACEDONIA',
+'MG' => 'MADAGASCAR',
+'MW' => 'MALAWI',
+'MY' => 'MALAYSIA',
+'MV' => 'MALDIVES',
+'ML' => 'MALI',
+'MT' => 'MALTA',
+'MH' => 'MARSHALL ISLANDS',
+'MQ' => 'MARTINIQUE',
+'MR' => 'MAURITANIA',
+'MU' => 'MAURITIUS',
+'YT' => 'MAYOTTE',
+'MX' => 'MEXICO',
+'FM' => 'MICRONESIA',
+'MD' => 'MOLDOVA',
+'MC' => 'MONACO',
+'MN' => 'MONGOLIA',
+'ME' => 'MONTENEGRO',
+'MS' => 'MONTSERRAT',
+'MA' => 'MOROCCO',
+'MZ' => 'MOZAMBIQUE',
+'MM' => 'MYANMAR',
+'NA' => 'NAMIBIA',
+'NR' => 'NAURU',
+'NP' => 'NEPAL',
+'NL' => 'NETHERLANDS',
+'AN' => 'NETHERLANDS ANTILLES',
+'NC' => 'NEW CALEDONIA',
+'NZ' => 'NEW ZEALAND',
+'NI' => 'NICARAGUA',
+'NE' => 'NIGER',
+'NG' => 'NIGERIA',
+'NU' => 'NIUE',
+'NF' => 'NORFOLK ISLAND',
+'MP' => 'NORTHERN MARIANA ISLANDS',
+'NO' => 'NORWAY',
+'OM' => 'OMAN',
+'PK' => 'PAKISTAN',
+'PW' => 'PALAU',
+'PS' => 'PALESTINIAN TERRITORY, OCCUPIED',
+'PA' => 'PANAMA',
+'PG' => 'PAPUA NEW GUINEA',
+'PY' => 'PARAGUAY',
+'PE' => 'PERU',
+'PH' => 'PHILIPPINES',
+'PN' => 'PITCAIRN',
+'PL' => 'POLAND',
+'PT' => 'PORTUGAL',
+'PR' => 'PUERTO RICO',
+'QA' => 'QATAR',
+'RE' => 'RÉUNION',
+'RO' => 'ROMANIA',
+'RU' => 'RUSSIAN FEDERATION',
+'RW' => 'RWANDA',
+'BL' => 'SAINT BARTHÉLEMY',
+'SH' => 'SAINT HELENA',
+'KN' => 'SAINT KITTS AND NEVIS',
+'LC' => 'SAINT LUCIA',
+'MF' => 'SAINT MARTIN',
+'PM' => 'SAINT PIERRE AND MIQUELON',
+'VC' => 'SAINT VINCENT AND THE GRENADINES',
+'WS' => 'SAMOA',
+'SM' => 'SAN MARINO',
+'ST' => 'SAO TOME AND PRINCIPE',
+'SA' => 'SAUDI ARABIA',
+'SN' => 'SENEGAL',
+'RS' => 'SERBIA',
+'SC' => 'SEYCHELLES',
+'SL' => 'SIERRA LEONE',
+'SG' => 'SINGAPORE',
+'SK' => 'SLOVAKIA',
+'SI' => 'SLOVENIA',
+'SB' => 'SOLOMON ISLANDS',
+'SO' => 'SOMALIA',
+'ZA' => 'SOUTH AFRICA',
+'GS' => 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS',
+'ES' => 'SPAIN',
+'LK' => 'SRI LANKA',
+'SD' => 'SUDAN',
+'SR' => 'SURINAME',
+'SJ' => 'SVALBARD AND JAN MAYEN',
+'SZ' => 'SWAZILAND',
+'SE' => 'SWEDEN',
+'CH' => 'SWITZERLAND',
+'SY' => 'SYRIAN ARAB REPUBLIC',
+'TW' => 'TAIWAN, PROVINCE OF CHINA',
+'TJ' => 'TAJIKISTAN',
+'TZ' => 'TANZANIA',
+'TH' => 'THAILAND',
+'TL' => 'TIMOR-LESTE',
+'TG' => 'TOGO',
+'TK' => 'TOKELAU',
+'TO' => 'TONGA',
+'TT' => 'TRINIDAD AND TOBAGO',
+'TN' => 'TUNISIA',
+'TR' => 'TURKEY',
+'TM' => 'TURKMENISTAN',
+'TC' => 'TURKS AND CAICOS ISLANDS',
+'TV' => 'TUVALU',
+'UG' => 'UGANDA',
+'UA' => 'UKRAINE',
+'AE' => 'UNITED ARAB EMIRATES',
+'GB' => 'UNITED KINGDOM',
+'US' => 'UNITED STATES',
+'UM' => 'UNITED STATES MINOR OUTLYING ISLANDS',
+'UY' => 'URUGUAY',
+'UZ' => 'UZBEKISTAN',
+'VU' => 'VANUATU',
+'VE' => 'VENEZUELA',
+'VN' => 'VIET NAM',
+'VG' => 'VIRGIN ISLANDS, BRITISH',
+'VI' => 'VIRGIN ISLANDS, U.S.',
+'WF' => 'WALLIS AND FUTUNA',
+'EH' => 'WESTERN SAHARA',
+'YE' => 'YEMEN',
+'ZM' => 'ZAMBIA',
+'ZW' => 'ZIMBABWE');
+ }
return $options;
Modified: tapirlink/trunk/classes/TpResourceMetadata.php
===================================================================
--- tapirlink/trunk/classes/TpResourceMetadata.php 2009-02-25 17:27:35 UTC (rev 1981)
+++ tapirlink/trunk/classes/TpResourceMetadata.php 2009-02-25 20:40:59 UTC (rev 1982)
@@ -390,6 +390,18 @@
{
$r_entity->SetAddress( trim( $this->mCharData ) );
}
+ else if ( strcasecmp( $in_tag, 'regionCode' ) == 0 )
+ {
+ $r_entity->SetRegionCode( trim( $this->mCharData ) );
+ }
+ else if ( strcasecmp( $in_tag, 'countryCode' ) == 0 )
+ {
+ $r_entity->SetCountryCode( trim( $this->mCharData ) );
+ }
+ else if ( strcasecmp( $in_tag, 'zipCode' ) == 0 )
+ {
+ $r_entity->SetZipCode( trim( $this->mCharData ) );
+ }
else if ( strcasecmp( $in_tag, 'logoURL' ) == 0 )
{
$r_entity->SetLogoUrl( trim( $this->mCharData ) );
Modified: tapirlink/trunk/templates/TpMetadataForm.tmpl.php
===================================================================
--- tapirlink/trunk/templates/TpMetadataForm.tmpl.php 2009-02-25 17:27:35 UTC (rev 1981)
+++ tapirlink/trunk/templates/TpMetadataForm.tmpl.php 2009-02-25 20:40:59 UTC (rev 1982)
@@ -156,6 +156,15 @@
<br/>
<textarea name="<?php print($entity_prefix); ?>_address" rows="2" cols="<?php print($textarea_cols); ?>" wrap="soft"><?php print($entity->GetAddress()); ?></textarea>
<br/>
+<br/>
+<?php print($this->GetHtmlLabel('regionCode',false)); ?>
+<input type="text" name="<?php print($entity_prefix); ?>_regionCode" value="<?php print($entity->GetRegionCode()); ?>" size="5"/>
+<?php print($this->GetHtmlLabel('countryCode',false)); ?>
+<?php print(TpHtmlUtils::GetCombo($entity_prefix.'_countryCode',$entity->GetCountryCode(),$this->GetOptions('countryCodes'))); ?>
+<br/>
+<br/>
+<?php print($this->GetHtmlLabel('zipCode',false)); ?>
+<input type="text" name="<?php print($entity_prefix); ?>_zipCode" value="<?php print($entity->GetZipCode()); ?>" size="10"/>
<!-- entity coordinates -->
<?php print($this->GetHtmlLabel('longitude',false)); ?>
<input type="text" name="<?php print($entity_prefix); ?>_longitude" value="<?php print($entity->GetLongitude()); ?>" size="12"/>
Modified: tapirlink/trunk/www/skins/darwin/metadata.xsl
===================================================================
--- tapirlink/trunk/www/skins/darwin/metadata.xsl 2009-02-25 17:27:35 UTC (rev 1981)
+++ tapirlink/trunk/www/skins/darwin/metadata.xsl 2009-02-25 20:40:59 UTC (rev 1982)
@@ -76,7 +76,7 @@
</xsl:for-each><br/>
<br/>
- <span class="SubLabel">Address</span><br/><span class="RegularText"><xsl:value-of select="tapir:entity/tapir:address"/><xsl:if test="tapir:entity/geo:Point"><br/>(lat: <xsl:value-of select="tapir:entity/geo:Point/geo:lat"/>, long: <xsl:value-of select="tapir:entity/geo:Point/geo:long"/>)</xsl:if></span><br/>
+ <span class="SubLabel">Address</span><br/><span class="RegularText"><xsl:value-of select="tapir:entity/tapir:address"/><xsl:if test="tapir:entity/tapir:regionCode">, <xsl:value-of select="tapir:entity/tapir:regionCode"/></xsl:if><xsl:if test="tapir:entity/tapir:countryCode">, <xsl:value-of select="tapir:entity/tapir:countryCode"/></xsl:if><xsl:if test="tapir:entity/geo:Point"><br/>(lat: <xsl:value-of select="tapir:entity/geo:Point/geo:lat"/>, long: <xsl:value-of select="tapir:entity/geo:Point/geo:long"/>)</xsl:if></span><br/>
<br/>
<span class="SubLabel">Contacts</span><br/>
Modified: tapirlink/trunk/www/skins/default/metadata.xsl
===================================================================
--- tapirlink/trunk/www/skins/default/metadata.xsl 2009-02-25 17:27:35 UTC (rev 1981)
+++ tapirlink/trunk/www/skins/default/metadata.xsl 2009-02-25 20:40:59 UTC (rev 1982)
@@ -76,7 +76,7 @@
</xsl:for-each><br/>
<br/>
- <span class="SubLabel">Address</span><br/><span class="RegularText"><xsl:value-of select="tapir:entity/tapir:address"/><xsl:if test="tapir:entity/geo:Point"><br/>(lat: <xsl:value-of select="tapir:entity/geo:Point/geo:lat"/>, long: <xsl:value-of select="tapir:entity/geo:Point/geo:long"/>)</xsl:if></span><br/>
+ <span class="SubLabel">Address</span><br/><span class="RegularText"><xsl:value-of select="tapir:entity/tapir:address"/><xsl:if test="tapir:entity/tapir:regionCode">, <xsl:value-of select="tapir:entity/tapir:regionCode"/></xsl:if><xsl:if test="tapir:entity/tapir:countryCode">, <xsl:value-of select="tapir:entity/tapir:countryCode"/></xsl:if><xsl:if test="tapir:entity/geo:Point"><br/>(lat: <xsl:value-of select="tapir:entity/geo:Point/geo:lat"/>, long: <xsl:value-of select="tapir:entity/geo:Point/geo:long"/>)</xsl:if></span><br/>
<br/>
<span class="SubLabel">Contacts</span><br/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-03-21 20:26:45
|
Revision: 1985
http://digir.svn.sourceforge.net/digir/?rev=1985&view=rev
Author: rdg
Date: 2009-03-21 20:26:36 +0000 (Sat, 21 Mar 2009)
Log Message:
-----------
Added support to the new <rootElement> feature in output model definitions.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpOutputModel.php
tapirlink/trunk/classes/TpSchemaInspector.php
tapirlink/trunk/classes/TpXmlGenerator.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2009-03-21 20:25:04 UTC (rev 1984)
+++ tapirlink/trunk/ChangeLog.txt 2009-03-21 20:26:36 UTC (rev 1985)
@@ -25,8 +25,9 @@
different resources).
* Replaced XML schema location used in responses with:
http://rs.tdwg.org/tapir/1.0/schema/tdwg_tapir.xsd
- * Added new metadata fields: region code, country code and zip code.
+ * Added new metadata fields: entity type, region code, country code and zip code.
* Fixed bug when deserializing bibliographic citation.
+ * Added support to the new <rootElement> feature in output model definitions.
Release 0.6.1 (2008-08-01)
--------------------------
Modified: tapirlink/trunk/classes/TpOutputModel.php
===================================================================
--- tapirlink/trunk/classes/TpOutputModel.php 2009-03-21 20:25:04 UTC (rev 1984)
+++ tapirlink/trunk/classes/TpOutputModel.php 2009-03-21 20:26:36 UTC (rev 1985)
@@ -35,6 +35,7 @@
var $mLabel;
var $mDocumentation;
var $mLocation;
+ var $mRootElement;
var $mIndexingElement;
var $mMapping = array(); // node path => array of TpExpression
var $mAutomapping = false;
@@ -133,6 +134,19 @@
{
$g_dlog->debug( '[Response Structure]' );
}
+ // <rootElement>
+ else if ( strcasecmp( $name, 'rootElement' ) == 0 )
+ {
+ if ( isset( $attrs['name'] ) )
+ {
+ $this->mRootElement = $attrs['name'];
+ }
+ else
+ {
+ $error = 'Missing attribute "name" in <rootElement>';
+ TpDiagnostics::Append( DC_INVALID_REQUEST, $error, DIAG_ERROR );
+ }
+ }
// <indexingElement>
else if ( strcasecmp( $name, 'indexingElement' ) == 0 )
{
@@ -434,6 +448,12 @@
} // end of member function GetDocumentation
+ function GetRootElement( )
+ {
+ return $this->mRootElement;
+
+ } // end of member function GetRootElement
+
function GetIndexingElement( )
{
return $this->mIndexingElement;
@@ -594,8 +614,8 @@
*/
function __sleep()
{
- return array( 'mRevision', 'mLocation', 'mIndexingElement', 'mMapping',
- 'mAutomapping', 'mResponseStructure', 'mNamespaces' );
+ return array( 'mRevision', 'mLocation', 'mRootElement', 'mIndexingElement',
+ 'mMapping', 'mAutomapping', 'mResponseStructure', 'mNamespaces' );
} // end of member function __sleep
Modified: tapirlink/trunk/classes/TpSchemaInspector.php
===================================================================
--- tapirlink/trunk/classes/TpSchemaInspector.php 2009-03-21 20:25:04 UTC (rev 1984)
+++ tapirlink/trunk/classes/TpSchemaInspector.php 2009-03-21 20:26:36 UTC (rev 1985)
@@ -91,34 +91,85 @@
}
else
{
+ $found_root = false;
+
$lacks_concrete = true;
$ns = $this->mrResponseStructure->GetTargetNamespace();
+ $root_element = $this->mrOutputModel->GetRootElement();
+
foreach ( $global_elements as $el_name => $xs_element_decl )
{
- if ( ! $xs_element_decl->IsAbstract() )
+ if ( ! empty( $root_element ) )
{
- $lacks_concrete = false;
+ $ref_name = $el_name;
- // First "concrete" global element declaration
- $r_xs_element_decl =& $this->mrResponseStructure->GetElementDecl( $ns, $el_name );
- $r_xs_element_decl->Accept( $this, $path );
+ $prefix = $this->mrOutputModel->GetPrefix( $xs_element_decl->GetTargetNamespace() );
- break;
+ if ( ! empty( $prefix ) )
+ {
+ $ref_name = $prefix.':'.$ref_name;
+ }
+
+ if ( $root_element == $ref_name )
+ {
+ if ( $xs_element_decl->IsAbstract() )
+ {
+ $error = 'Root element is abstract';
+ TpDiagnostics::Append( DC_INVALID_REQUEST, $error, DIAG_ERROR );
+
+ $this->_ActivateAbort();
+
+ return;
+ }
+
+ $found_root = true;
+ $lacks_concrete = false;
+
+ $r_xs_element_decl =& $this->mrResponseStructure->GetElementDecl( $ns, $el_name );
+ $r_xs_element_decl->Accept( $this, $path );
+
+ break;
+ }
}
+ else {
+
+ if ( ! $xs_element_decl->IsAbstract() )
+ {
+ $lacks_concrete = false;
+
+ // First "concrete" global element declaration
+ $r_xs_element_decl =& $this->mrResponseStructure->GetElementDecl( $ns, $el_name );
+ $r_xs_element_decl->Accept( $this, $path );
+
+ break;
+ }
+ }
}
- if ( $lacks_concrete )
+ if ( ( ! empty( $root_element ) ) and ( ! $found_root ) )
{
- $error = 'No concrete (non abstract) global element defined in '.
- 'response structure';
+ $error = 'Could not find the root element';
TpDiagnostics::Append( DC_INVALID_REQUEST, $error, DIAG_ERROR );
$this->_ActivateAbort();
return;
}
+ else
+ {
+ if ( $lacks_concrete )
+ {
+ $error = 'No concrete (non abstract) global element defined in '.
+ 'response structure';
+ TpDiagnostics::Append( DC_INVALID_REQUEST, $error, DIAG_ERROR );
+
+ $this->_ActivateAbort();
+
+ return;
+ }
+ }
}
if ( ! $this->mFoundIndexingElement )
Modified: tapirlink/trunk/classes/TpXmlGenerator.php
===================================================================
--- tapirlink/trunk/classes/TpXmlGenerator.php 2009-03-21 20:25:04 UTC (rev 1984)
+++ tapirlink/trunk/classes/TpXmlGenerator.php 2009-03-21 20:26:36 UTC (rev 1985)
@@ -71,15 +71,43 @@
$this->mrResource =& $rResource;
+ $root_element = $this->mrOutputModel->GetRootElement();
+
$global_elements = $this->mResponseStructure->GetElementDecls();
$path = '';
+ $matched = false;
+
// Get the first non abstract global element declaration and render it
foreach ( $global_elements as $el_name => $xs_element_decl )
{
- if ( ! $xs_element_decl->IsAbstract() )
+ if ( ! empty( $root_element ) )
{
+ $ref_name = $el_name;
+
+ $prefix = $this->mrOutputModel->GetPrefix( $xs_element_decl->GetTargetNamespace() );
+
+ if ( ! empty( $prefix ) )
+ {
+ $ref_name = $prefix.':'.$ref_name;
+ }
+
+ if ( $root_element == $ref_name )
+ {
+ $matched = true;
+ }
+ }
+ else {
+
+ if ( ! $xs_element_decl->IsAbstract() )
+ {
+ $matched = true;
+ }
+ }
+
+ if ( $matched ) {
+
$content = $xs_element_decl->Accept( $this, $path );
if ( count( $this->mNoContentSummary ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-03-21 20:29:33
|
Revision: 1988
http://digir.svn.sourceforge.net/digir/?rev=1988&view=rev
Author: rdg
Date: 2009-03-21 20:29:29 +0000 (Sat, 21 Mar 2009)
Log Message:
-----------
Updated release info.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2009-03-21 20:28:01 UTC (rev 1987)
+++ tapirlink/trunk/ChangeLog.txt 2009-03-21 20:29:29 UTC (rev 1988)
@@ -1,6 +1,6 @@
-Release 0.7.0 (?)
+Release 0.7.0 (2009-03-21)
--------------------------
-(revision ?)
+(revision 1988)
* New admin program to check the database encoding configuration.
* Check each piece of content that comes from the database
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2009-03-21 20:28:01 UTC (rev 1987)
+++ tapirlink/trunk/www/tapir_globals.php 2009-03-21 20:29:29 UTC (rev 1988)
@@ -562,6 +562,7 @@
define( 'TP_MIN_PHP_VERSION', '4.2.3' );
define( 'TP_VERSION', '0.7.0' );
+
$revision = '$Revision$.';
$revision_regexp = '/^\$'.'Revision:\s(\d+)\s\$\.$/';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-08-26 21:45:48
|
Revision: 1995
http://digir.svn.sourceforge.net/digir/?rev=1995&view=rev
Author: rdg
Date: 2009-08-26 21:45:36 +0000 (Wed, 26 Aug 2009)
Log Message:
-----------
New diagnostic code DC_CONFIG_ISSUE.
Modified Paths:
--------------
tapirlink/trunk/misc/diag_codes.xml
tapirlink/trunk/www/diagnostic_codes.html
tapirlink/trunk/www/tapir_diagnostics.php
Modified: tapirlink/trunk/misc/diag_codes.xml
===================================================================
--- tapirlink/trunk/misc/diag_codes.xml 2009-08-26 20:49:04 UTC (rev 1994)
+++ tapirlink/trunk/misc/diag_codes.xml 2009-08-26 21:45:36 UTC (rev 1995)
@@ -102,6 +102,9 @@
The configuration information for the provider could not be found or loaded, and hence
the requested operation could not be completed.
</code>
+ <code const="DC_CONFIG_ISSUE" value="CONFIGURATION_ISSUE" level="warn">
+A potential issue was detected in the configuration.
+</code>
<code const="DC_LOG_ERROR" value="LOG_ERROR" level="error">
Problem occured when opening or writing to a log file.
</code>
@@ -109,7 +112,7 @@
A catch-all diagnostic for where no other appropriate category is available.
</code>
<code const="DC_MISSING_LIBRARY" value="MISSING_LIBRARY" level="warn">
-The specified library is not available.
+The specified library is unavailable.
</code>
<code const="DC_DURATION" value="DURATION" level="info">
A float value indicating the number of seconds to produce the response.
Modified: tapirlink/trunk/www/diagnostic_codes.html
===================================================================
--- tapirlink/trunk/www/diagnostic_codes.html 2009-08-26 20:49:04 UTC (rev 1994)
+++ tapirlink/trunk/www/diagnostic_codes.html 2009-08-26 21:45:36 UTC (rev 1995)
@@ -222,6 +222,13 @@
</td>
</tr>
<tr>
+<td>CONFIGURATION_ISSUE</td>
+<td>warn</td>
+<td>
+A potential issue was detected in the configuration.
+</td>
+</tr>
+ <tr>
<td>LOG_ERROR</td>
<td>error</td>
<td>
@@ -239,7 +246,7 @@
<td>MISSING_LIBRARY</td>
<td>warn</td>
<td>
-The specified library is not available.
+The specified library is unavailable.
</td>
</tr>
<tr>
Modified: tapirlink/trunk/www/tapir_diagnostics.php
===================================================================
--- tapirlink/trunk/www/tapir_diagnostics.php 2009-08-26 20:49:04 UTC (rev 1994)
+++ tapirlink/trunk/www/tapir_diagnostics.php 2009-08-26 21:45:36 UTC (rev 1995)
@@ -191,6 +191,12 @@
/****
+A potential issue was detected in the configuration.
+*/
+define('DC_CONFIG_ISSUE','CONFIGURATION_ISSUE');
+
+
+/****
Problem occured when opening or writing to a log file.
*/
define('DC_LOG_ERROR','LOG_ERROR');
@@ -203,7 +209,7 @@
/****
-The specified library is not available.
+The specified library is unavailable.
*/
define('DC_MISSING_LIBRARY','MISSING_LIBRARY');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-11-03 12:10:28
|
Revision: 1998
http://digir.svn.sourceforge.net/digir/?rev=1998&view=rev
Author: rdg
Date: 2009-11-03 12:10:11 +0000 (Tue, 03 Nov 2009)
Log Message:
-----------
Updated PHP memory_limit recommendation to at least 32M.
Modified Paths:
--------------
tapirlink/trunk/README.txt
tapirlink/trunk/admin/check.php
Modified: tapirlink/trunk/README.txt
===================================================================
--- tapirlink/trunk/README.txt 2009-09-07 22:45:02 UTC (rev 1997)
+++ tapirlink/trunk/README.txt 2009-11-03 12:10:11 UTC (rev 1998)
@@ -1,4 +1,4 @@
-ABOUT THIS SOFTWARE
+ABOUT THIS SOFTWARE
===================
TapirLink is a data provider software compatible with the
@@ -144,7 +144,7 @@
If you are getting unexpected blank pages in your browser when running
scripts, try increasing the memory limit of your PHP instance. Look
for the option "memory_limit" in your php.ini file. The default value
-is usually 8M. Try setting it to 16M or 32M. This may be needed if
+is usually 8M. Try setting it to at least 32M. This may be needed if
your TapirLink instance will be used with big and complicated response
structures or if you set the maximum number of element repetitions
to a high value.
Modified: tapirlink/trunk/admin/check.php
===================================================================
--- tapirlink/trunk/admin/check.php 2009-09-07 22:45:02 UTC (rev 1997)
+++ tapirlink/trunk/admin/check.php 2009-11-03 12:10:11 UTC (rev 1998)
@@ -255,13 +255,13 @@
echo "\nmemory_limit... ".$memory_limit;
-if ( $val >= 16777216 ) // 16M
+if ( $val >= 33554432 ) // 32M
{
echo ' (OK)<br />';
}
else
{
- echo '<br /><b>Warning:</b> TapirLink can easily consume more than 10M when processing requests. It is advisable to set the memory_limit of your PHP installation (inside php.ini) to at least 16M.<br />';
+ echo '<br /><b>Warning:</b> TapirLink can easily consume more than 10M when processing requests. It is advisable to set the memory_limit of your PHP installation (inside php.ini) to at least 32M.<br />';
}
$register_globals = ini_get('register_globals');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2010-08-28 22:51:42
|
Revision: 2018
http://digir.svn.sourceforge.net/digir/?rev=2018&view=rev
Author: rdg
Date: 2010-08-28 22:51:36 +0000 (Sat, 28 Aug 2010)
Log Message:
-----------
New timezone setting.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/admin/check.php
tapirlink/trunk/www/localconfig_dist.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2010-08-16 11:58:04 UTC (rev 2017)
+++ tapirlink/trunk/ChangeLog.txt 2010-08-28 22:51:36 UTC (rev 2018)
@@ -4,7 +4,8 @@
* Resources can now be configured to reject custom output models.
* Concepts are now automatically mapped by default.
- * New configuration to specify accepted domains for remote file retrieval.
+ * New configuration to specify accepted domains for remote file retrieval.
+ * New timezone setting.
Release 0.7.0 (2009-03-21)
--------------------------
Modified: tapirlink/trunk/admin/check.php
===================================================================
--- tapirlink/trunk/admin/check.php 2010-08-16 11:58:04 UTC (rev 2017)
+++ tapirlink/trunk/admin/check.php 2010-08-28 22:51:36 UTC (rev 2018)
@@ -233,6 +233,26 @@
}
/////////////////////////////////////////////////
+// Check timezone setting
+
+echo "\n<h3>Checking timezone configuration...</h3>\n";
+flush();
+
+$old_track = ini_set( 'track_errors', '1' );
+$old_php_errormsg = $php_errormsg;
+$tz = @date_default_timezone_get();
+
+if ( $php_errormsg == $old_php_errormsg )
+{
+ echo 'OK<br />';
+}
+else
+{
+ echo '<b>Warning:</b> Timezone not properly defined. You should either set the \'date.timezone\' option in your PHP configuration file (php.ini) file, or enable the line with a call to the \'date_default_timezone_set\' function in your localconfig.php file inside the \'www\' directory (create the file as a copy of localconfig_dist.php if you don\'t have one yet).<br />';
+}
+ini_set( 'track_errors', $old_track );
+
+/////////////////////////////////////////////////
// Check PHP configuration
echo "\n<h3>Checking PHP configuration...</h3>\n";
Modified: tapirlink/trunk/www/localconfig_dist.php
===================================================================
--- tapirlink/trunk/www/localconfig_dist.php 2010-08-16 11:58:04 UTC (rev 2017)
+++ tapirlink/trunk/www/localconfig_dist.php 2010-08-28 22:51:36 UTC (rev 2018)
@@ -16,6 +16,11 @@
*/
/**
+ * Default timezone setting. Check http://www.php.net/manual/en/timezones.php
+ * for the available options */
+//date_default_timezone_set('America/Sao_Paulo');
+
+/**
* Location of the provider configuration files. You can change this to a
* location anywhere on your system but remember that it must be readable
* and writable by the php application. It is ok, and actually preferable to
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2010-09-07 22:55:16
|
Revision: 2024
http://digir.svn.sourceforge.net/digir/?rev=2024&view=rev
Author: rdg
Date: 2010-09-07 22:55:10 +0000 (Tue, 07 Sep 2010)
Log Message:
-----------
New configuration option to allow more efficient counts in databases.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpSearchResponse.php
tapirlink/trunk/www/localconfig_dist.php
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2010-09-03 14:37:12 UTC (rev 2023)
+++ tapirlink/trunk/ChangeLog.txt 2010-09-07 22:55:10 UTC (rev 2024)
@@ -8,6 +8,7 @@
* New timezone setting.
* Minor adjustments to avoid warnings in PHP versions >= 5.3.
* Latest DarwinCore terms added as a possible conceptual schema.
+ * New configuration option to allow more efficient counts in databases.
Release 0.7.0 (2009-03-21)
--------------------------
Modified: tapirlink/trunk/classes/TpSearchResponse.php
===================================================================
--- tapirlink/trunk/classes/TpSearchResponse.php 2010-09-03 14:37:12 UTC (rev 2023)
+++ tapirlink/trunk/classes/TpSearchResponse.php 2010-09-07 22:55:10 UTC (rev 2024)
@@ -425,6 +425,11 @@
{
$sql = $sql_builder->GetSql();
+ if ( TP_SQL_USE_COUNT )
+ {
+ $sql = 'SELECT COUNT(*) FROM (' . $sql . ') AS src';
+ }
+
TpDiagnostics::Append( DC_DEBUG_MSG, 'SQL to count: '.$sql, DIAG_DEBUG );
// Try to get count from cache if this feature is enabled
@@ -467,7 +472,14 @@
}
else
{
- $matched = $result_set->RecordCount();
+ if ( TP_SQL_USE_COUNT )
+ {
+ $matched = $result_set->fields[0];
+ }
+ else
+ {
+ $matched = $result_set->RecordCount();
+ }
$result_set->Close();
}
Modified: tapirlink/trunk/www/localconfig_dist.php
===================================================================
--- tapirlink/trunk/www/localconfig_dist.php 2010-09-03 14:37:12 UTC (rev 2023)
+++ tapirlink/trunk/www/localconfig_dist.php 2010-09-07 22:55:10 UTC (rev 2024)
@@ -205,6 +205,18 @@
//define( 'TP_SQL_USE_COLUMN_REF', true );
/**
+* Set this to true to use SELECT COUNT(*) to count records. Default is the
+* opposite (to execute the entire query and let PHP ADOdb calculate the number of
+* records through the "RecordCount" method). However, this may be VERY memory
+* intensive depending on the database and on the number of records, that's
+* why this configuration option was created. Please note that for certain
+* databases, COUNT(*) may return an approximate number, and perhaps it may
+* not even support the alternative SQL construction being used:
+* SELECT COUNT(*) FROM (SELECT ...) AS src
+*/
+//define( 'TP_SQL_USE_COUNT', true );
+
+/**
* The following settings can be used as default values by the configurator
* during UDDI registration process.
*/
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2010-09-03 14:37:12 UTC (rev 2023)
+++ tapirlink/trunk/www/tapir_globals.php 2010-09-07 22:55:10 UTC (rev 2024)
@@ -524,6 +524,21 @@
define( 'TP_SQL_USE_COLUMN_REF', false );
}
+/**
+* Set this to true to use SELECT COUNT(*) to count records. Default is the
+* opposite (to execute the entire query and let PHP ADOdb calculate the number of
+* records through the "RecordCount" method). However, this may be VERY memory
+* intensive depending on the database and on the number of records, that's
+* why this configuration option was created. Please note that for certain
+* databases, COUNT(*) may return an approximate number, and perhaps it may
+* not even support the alternative SQL construction being used:
+* SELECT COUNT(*) FROM (SELECT ...) AS src
+*/
+if ( ! defined( 'TP_SQL_USE_COUNT' ) )
+{
+ define( 'TP_SQL_USE_COUNT', false );
+}
+
//////////////////////////////////////////////////////
// AUTOMATIC UPDATES
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2013-11-11 16:37:35
|
Revision: 2039
http://sourceforge.net/p/digir/svn/2039
Author: rdg
Date: 2013-11-11 16:37:32 +0000 (Mon, 11 Nov 2013)
Log Message:
-----------
Fixed bug with local filter, which was not properly enclosing the SQL condition when combining it with another filter
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpLocalFilter.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2013-03-19 10:57:10 UTC (rev 2038)
+++ tapirlink/trunk/ChangeLog.txt 2013-11-11 16:37:32 UTC (rev 2039)
@@ -5,6 +5,8 @@
* Upgraded PHP ADOdb version to 516a.
* Fixed bug in search operation (multiple orderby parameters were not handled
properly).
+ * Fixed bug with local filter, which was not properly enclosing the SQL
+ condition when combining it with another filter.
Release 0.7.1 (2010-09-14)
--------------------------
Modified: tapirlink/trunk/classes/TpLocalFilter.php
===================================================================
--- tapirlink/trunk/classes/TpLocalFilter.php 2013-03-19 10:57:10 UTC (rev 2038)
+++ tapirlink/trunk/classes/TpLocalFilter.php 2013-11-11 16:37:32 UTC (rev 2039)
@@ -141,7 +141,14 @@
function GetSql( &$rResource )
{
- return $this->mFilter->GetSql( $rResource );
+ $sql = $this->mFilter->GetSql( $rResource );
+
+ if ( $this->IsEmpty() )
+ {
+ return $sql;
+ }
+
+ return '(' . $sql . ')';
} // end of member function GetSql
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2015-02-10 03:56:55
|
Revision: 2046
http://sourceforge.net/p/digir/svn/2046
Author: rdg
Date: 2015-02-10 03:56:47 +0000 (Tue, 10 Feb 2015)
Log Message:
-----------
Avoid strict warnings
Modified Paths:
--------------
tapirlink/trunk/admin/check.php
tapirlink/trunk/classes/TpConceptMappingFactory.php
tapirlink/trunk/classes/TpConceptualSchemaHandlerFactory.php
tapirlink/trunk/classes/TpConfigUtils.php
tapirlink/trunk/classes/TpDataSource.php
tapirlink/trunk/classes/TpDiagnostics.php
tapirlink/trunk/classes/TpHtmlUtils.php
tapirlink/trunk/classes/TpResources.php
tapirlink/trunk/classes/TpUtils.php
tapirlink/trunk/lib/pear/Log.php
tapirlink/trunk/lib/pear/PEAR.php
tapirlink/trunk/lib/phpxsd/XsManager.php
tapirlink/trunk/lib/phpxsd/XsNamespaceManager.php
Modified: tapirlink/trunk/admin/check.php
===================================================================
--- tapirlink/trunk/admin/check.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/admin/check.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -462,7 +462,7 @@
//Try connecting to the database using ADOdb
echo "<p>Testing connection to database...<br />\n";
flush();
-$cn = &ADONewConnection($Config->connectionType);
+$cn = ADONewConnection($Config->connectionType);
if (!is_object($cn))
{
echo " ERROR: could not create database connection object of type: "
Modified: tapirlink/trunk/classes/TpConceptMappingFactory.php
===================================================================
--- tapirlink/trunk/classes/TpConceptMappingFactory.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/classes/TpConceptMappingFactory.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -31,7 +31,7 @@
} // end of member function TpConceptMappingFactory
- function GetInstance( $id )
+ public static function GetInstance( $id )
{
if ( $id == 'SingleColumnMapping')
{
@@ -50,7 +50,7 @@
} // end of member function GetInstance
- function GetOptions( )
+ public static function GetOptions( )
{
return array( 'unmapped' => '-- unmapped --',
'SingleColumnMapping'=>'single column',
Modified: tapirlink/trunk/classes/TpConceptualSchemaHandlerFactory.php
===================================================================
--- tapirlink/trunk/classes/TpConceptualSchemaHandlerFactory.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/classes/TpConceptualSchemaHandlerFactory.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -32,7 +32,7 @@
} // end of member function TpConceptualSchemaHandlerFactory
- function GetInstance( $id )
+ public static function GetInstance( $id )
{
if ( $id == 'DarwinSchemaHandler_v1')
{
Modified: tapirlink/trunk/classes/TpConfigUtils.php
===================================================================
--- tapirlink/trunk/classes/TpConfigUtils.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/classes/TpConfigUtils.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -35,7 +35,7 @@
* @param $file File name (including path)
* @return True fr success, false otherwise
*/
- function WriteToFile( $content, $file )
+ public static function WriteToFile( $content, $file )
{
$status = false;
@@ -103,7 +103,7 @@
* @param $file XML file name (including path)
* @return True on success, false otherwise
*/
- function WriteXmlPiece( $content, $currentXpath, $prevXpath, $file )
+ public static function WriteXmlPiece( $content, $currentXpath, $prevXpath, $file )
{
$xparser = new XPath();
$xparser->setVerbose( 0 );
@@ -173,7 +173,7 @@
} // end of WriteXmlPiece
- function ValidateLangSection( $sectionName, $langStrings, $raiseErrors, $mandatoryField=true, $defaultLang=null )
+ public static function ValidateLangSection( $sectionName, $langStrings, $raiseErrors, $mandatoryField=true, $defaultLang=null )
{
$errors = array();
@@ -233,7 +233,7 @@
} // end of ValidateLangSection
- function GetFieldType( $adodbField )
+ public static function GetFieldType( $adodbField )
{
require_once(TP_ADODB_LIBRARY);
require_once('TpConceptMapping.php');
@@ -275,7 +275,7 @@
* Note: the service id is used as a session name, so it may not contain
* characters such as dots.
*/
- function GetServiceId()
+ public static function GetServiceId()
{
$domain = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME']:'localhost';
$port = isset($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT']:'80';
@@ -295,7 +295,7 @@
* works for types that are already under the XSD namespace.
* Null is returned if the primitive type could not be determined.
*/
- function GetPrimitiveXsdType( $typeStr, $ns=null )
+ public static function GetPrimitiveXsdType( $typeStr, $ns=null )
{
$xsd_namespace = 'http://www.w3.org/2001/XMLSchema';
Modified: tapirlink/trunk/classes/TpDataSource.php
===================================================================
--- tapirlink/trunk/classes/TpDataSource.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/classes/TpDataSource.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -153,7 +153,7 @@
}
// Then try connecting to database
- $this->mConnection = &ADONewConnection( $this->mDriverName );
+ $this->mConnection = ADONewConnection( $this->mDriverName );
if ( ! is_object( $this->mConnection ) )
{
Modified: tapirlink/trunk/classes/TpDiagnostics.php
===================================================================
--- tapirlink/trunk/classes/TpDiagnostics.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/classes/TpDiagnostics.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -38,7 +38,7 @@
/**
* Returns the current diagnostics array
*/
- function &_GetStack( )
+ private static function &_GetStack( )
{
static $stack;
@@ -57,7 +57,7 @@
* @param msg = the message associated with the diagnostic
* @param severity = severity level for the diagnostic
*/
- function Append( $cd, $msg, $severity )
+ public static function Append( $cd, $msg, $severity )
{
if ( $severity == DIAG_WARN and TP_DIAG_LEVEL > 2 )
{
@@ -96,7 +96,7 @@
* Returns the number of diagnostics in the list
* @param severity = array of error levels.
*/
- function Count( $severity=array( DIAG_ERROR, DIAG_FATAL ) )
+ public static function Count( $severity=array( DIAG_ERROR, DIAG_FATAL ) )
{
$stack =& TpDiagnostics::_GetStack();
@@ -117,7 +117,7 @@
/**
* Prints out the errors
*/
- function Dump()
+ public static function Dump()
{
$stack =& TpDiagnostics::_GetStack();
@@ -137,7 +137,7 @@
/**
* Returns an XML representation of the current diagnostics.
*/
- function GetXml()
+ public static function GetXml()
{
$stack =& TpDiagnostics::_GetStack();
@@ -179,7 +179,7 @@
/**
* Returns an aray of error messages
*/
- function GetMessages()
+ public static function GetMessages()
{
$stack =& TpDiagnostics::_GetStack();
@@ -199,7 +199,7 @@
/**
* Returns the last error, or NULL if none.
*/
- function PopDiagnostic()
+ public static function PopDiagnostic()
{
$stack =& TpDiagnostics::_GetStack();
@@ -210,7 +210,7 @@
/**
* Resets the error stack.
*/
- function Reset()
+ public static function Reset()
{
$stack =& TpDiagnostics::_GetStack();
Modified: tapirlink/trunk/classes/TpHtmlUtils.php
===================================================================
--- tapirlink/trunk/classes/TpHtmlUtils.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/classes/TpHtmlUtils.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -22,7 +22,7 @@
class TpHtmlUtils // only class methods
{
- function GetCombo( $name, $value, $options, $multiple=false, $size=false, $onChange='' )
+ public static function GetCombo( $name, $value, $options, $multiple=false, $size=false, $onChange='' )
{
$str_size = (gettype( $size ) == 'integer') ? ' size="'.$size.'"' : '' ;
@@ -49,7 +49,7 @@
} // end of member function GetCombo
- function GetCheckboxes( $prefix, $values, $options )
+ public static function GetCheckboxes( $prefix, $values, $options )
{
$html = '';
@@ -70,7 +70,7 @@
} // end of member function GetCheckboxes
- function GetRadio( $name, $value, $options )
+ public static function GetRadio( $name, $value, $options )
{
$html = '';
Modified: tapirlink/trunk/classes/TpResources.php
===================================================================
--- tapirlink/trunk/classes/TpResources.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/classes/TpResources.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -33,7 +33,7 @@
// No constructor - this class uses the singleton pattern
// Use GetInstance instead
- function &GetInstance( )
+ public static function &GetInstance( )
{
static $instance;
Modified: tapirlink/trunk/classes/TpUtils.php
===================================================================
--- tapirlink/trunk/classes/TpUtils.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/classes/TpUtils.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -41,7 +41,7 @@
* Render as Plain text for as HTML, and an option to print it directly.
*
*/
- function DumpPrettyStack( $renderAsHtml=true, $printInline=false )
+ public static function DumpPrettyStack( $renderAsHtml=true, $printInline=false )
{
// debug_backtrace is only available since PHP 4.3.0
if ( version_compare( phpversion(), '4.3.0', '<' ) > 0 )
@@ -218,7 +218,7 @@
* just for detailed debugging called g_dlog.
*
*/
- function InitializeLogs( )
+ public static function InitializeLogs( )
{
// Main log
$log_file_name = TP_LOG_DIR.'/'.TP_LOG_NAME;
@@ -251,7 +251,7 @@
/** Instantiate a log object for detailed debugging called g_dlog.
*
*/
- function InitializeDebugLog( )
+ public static function InitializeDebugLog( )
{
$debug_file_name = TP_DEBUG_DIR.'/'.TP_DEBUG_LOGFILE;
@@ -287,7 +287,7 @@
*
* @return mixed Parameter value
*/
- function GetVar( $name, $defaultVal=false )
+ public static function GetVar( $name, $defaultVal=false )
{
// Note: If tapir_globals.php is included, then all $_REQUEST keys
// are changed to lower case!
@@ -304,7 +304,7 @@
*
* @return mixed Key value (if found) or default value
*/
- function GetInArray( $targetArray, $searchKey, $defaultVal=false )
+ public static function GetInArray( $targetArray, $searchKey, $defaultVal=false )
{
foreach ( $targetArray as $key => $value )
{
@@ -320,7 +320,7 @@
/**
* Returns the unqualified name from a 'namespace:name' string.
*/
- function GetUnqualifiedName( $fullName ) {
+ public static function GetUnqualifiedName( $fullName ) {
$last_colon = strrpos( $fullName, ':' );
@@ -340,7 +340,7 @@
*
* returns TRUE or FALSE
*/
- function IsUrl( $tst ) {
+ public static function IsUrl( $tst ) {
//simple check to see if a string is a URL.
//just looks at the first few characters to see if the scheme is http or ftp
@@ -371,7 +371,7 @@
*
* @param string or array reference
*/
- function StripMagicSlashes( &$rVar )
+ public static function StripMagicSlashes( &$rVar )
{
if ( is_string( $rVar ) )
{
@@ -393,7 +393,7 @@
* @param $s string String to be escaped (assumed to be in utf-8)
* @return string Escaped string
*/
- function EscapeXmlSpecialChars( $s )
+ public static function EscapeXmlSpecialChars( $s )
{
// Since "htmlspecialchars" does not work with utf-8 in versions
// prior than 4.3.0 (stable!), we need to use mb_ereg_replace as an alternative
@@ -428,7 +428,7 @@
*
* @return float number of seconds with microseconds since the Unix Epoch
*/
- function MicrotimeFloat()
+ public static function MicrotimeFloat()
{
list( $usec, $sec ) = explode( ' ', microtime() );
@@ -442,7 +442,7 @@
*
* @return string xsd:dateTime
*/
- function TimestampToXsdDateTime( $timestamp )
+ public static function TimestampToXsdDateTime( $timestamp )
{
$date = strftime( '%Y-%m-%d', $timestamp );
@@ -477,7 +477,7 @@
*
* @return hash
*/
- function GetHash( $elements )
+ public static function GetHash( $elements )
{
$ret_array = array();
@@ -499,7 +499,7 @@
* @param array $attrs Optional array with key value pairs to be added as attributes.
* @return string An opening tag for the specified element
*/
- function OpenTag( $nsPrefix, $elementName, $indent='', $attrs=array() )
+ public static function OpenTag( $nsPrefix, $elementName, $indent='', $attrs=array() )
{
$ns_sep = ( $nsPrefix ) ? ':' : '';
@@ -526,7 +526,7 @@
* @param string $indent Optional indentation characters.
* @return string A closing tag for the specified element
*/
- function CloseTag( $nsPrefix, $elementName, $indent='' )
+ public static function CloseTag( $nsPrefix, $elementName, $indent='' )
{
$ns_sep = ( $nsPrefix ) ? ':' : '';
@@ -544,7 +544,7 @@
* @param array $attrs Optional array with key value pairs to be added as attributes.
* @return string Value (with XML characters escaped) enclosed by the element
*/
- function MakeTag( $nsPrefix, $elementName, $value, $indent='', $attrs=array() )
+ public static function MakeTag( $nsPrefix, $elementName, $value, $indent='', $attrs=array() )
{
$ns_sep = ( $nsPrefix ) ? ':' : '';
@@ -578,7 +578,7 @@
* @return string Value (with XML characters escaped) enclosed by the specified
* element with a lang attribute
*/
- function MakeLangTag( $nsPrefix, $elementName, $value, $lang, $indent='' )
+ public static function MakeLangTag( $nsPrefix, $elementName, $value, $lang, $indent='' )
{
$ns_sep = ( $nsPrefix ) ? ':' : '';
@@ -603,7 +603,7 @@
*
* @return Default XML header
*/
- function GetXmlHeader( )
+ public static function GetXmlHeader( )
{
return '<?xml version="1.0" encoding="utf-8" ?>';
@@ -616,7 +616,7 @@
*
* @param $libName string Name of the library to load
*/
- function LoadLibrary( $libName )
+ public static function LoadLibrary( $libName )
{
$res = true;
@@ -647,7 +647,7 @@
/**
* Simple array dumper. For debugging stuff.
*/
- function DumpArray( $a )
+ public static function DumpArray( $a )
{
if ( ! is_array( $a ) )
{
@@ -669,7 +669,7 @@
/**
* Returns the alternative file name given a file location.
*/
- function GetAlternativeFileName( $location )
+ public static function GetAlternativeFileName( $location )
{
global $g_dlog;
@@ -704,7 +704,7 @@
* @param $location string File location
* @return file handle or null
*/
- function GetFileHandle( $location )
+ public static function GetFileHandle( $location )
{
global $g_dlog;
@@ -765,7 +765,7 @@
* @param $location string File location
* @return file handle or null
*/
- function OpenFile( $location )
+ public static function OpenFile( $location )
{
global $g_dlog;
@@ -850,7 +850,7 @@
* @param $location string URL
* @return boolean
*/
- function CheckUrl( $location )
+ public static function CheckUrl( $location )
{
if ( ! defined( 'TP_ACCEPTED_DOMAINS' ) )
{
@@ -890,7 +890,7 @@
*
* @return array with original column names pointing to column objects
*/
- function FixAdodbColumnsArray( $columns )
+ public static function FixAdodbColumnsArray( $columns )
{
$ret_array = array();
Modified: tapirlink/trunk/lib/pear/Log.php
===================================================================
--- tapirlink/trunk/lib/pear/Log.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/lib/pear/Log.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -126,7 +126,7 @@
* @access public
* @since Log 1.0
*/
- function &factory($handler, $name = '', $ident = '', $conf = array(),
+ public static function &factory($handler, $name = '', $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
$handler = strtolower($handler);
@@ -188,7 +188,7 @@
* @access public
* @since Log 1.0
*/
- function &singleton($handler, $name = '', $ident = '', $conf = array(),
+ public static function &singleton($handler, $name = '', $ident = '', $conf = array(),
$level = PEAR_LOG_DEBUG)
{
static $instances;
@@ -586,7 +586,7 @@
* @access public
* @since Log 1.7.0
*/
- function MASK($priority)
+ public static function MASK($priority)
{
return (1 << $priority);
}
@@ -605,7 +605,7 @@
*
* @deprecated deprecated since Log 1.9.4; use Log::MAX() instead
*/
- function UPTO($priority)
+ public static function UPTO($priority)
{
return Log::MAX($priority);
}
@@ -624,7 +624,7 @@
* @access public
* @since Log 1.9.4
*/
- function MIN($priority)
+ public static function MIN($priority)
{
return PEAR_LOG_ALL ^ ((1 << $priority) - 1);
}
@@ -643,7 +643,7 @@
* @access public
* @since Log 1.9.4
*/
- function MAX($priority)
+ public static function MAX($priority)
{
return ((1 << ($priority + 1)) - 1);
}
Modified: tapirlink/trunk/lib/pear/PEAR.php
===================================================================
--- tapirlink/trunk/lib/pear/PEAR.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/lib/pear/PEAR.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -227,7 +227,7 @@
* @return mixed A reference to the variable. If not set it will be
* auto initialised to NULL.
*/
- function &getStaticProperty($class, $var)
+ public static function &getStaticProperty($class, $var)
{
static $properties;
return $properties[$class][$var];
@@ -270,7 +270,7 @@
* @access public
* @return bool true if parameter is an error
*/
- function isError($data, $code = null)
+ public static function isError($data, $code = null)
{
if (is_a($data, 'PEAR_Error')) {
if (is_null($code)) {
Modified: tapirlink/trunk/lib/phpxsd/XsManager.php
===================================================================
--- tapirlink/trunk/lib/phpxsd/XsManager.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/lib/phpxsd/XsManager.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -29,7 +29,7 @@
// No constructor - this class uses the singleton pattern
// Use GetInstance instead
- function &GetInstance( )
+ public static function &GetInstance( )
{
static $instance;
Modified: tapirlink/trunk/lib/phpxsd/XsNamespaceManager.php
===================================================================
--- tapirlink/trunk/lib/phpxsd/XsNamespaceManager.php 2015-02-10 02:32:17 UTC (rev 2045)
+++ tapirlink/trunk/lib/phpxsd/XsNamespaceManager.php 2015-02-10 03:56:47 UTC (rev 2046)
@@ -30,7 +30,7 @@
// No constructor - this class uses the singleton pattern
// Use GetInstance instead
- function &GetInstance( )
+ public static function &GetInstance( )
{
static $instance;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2008-08-01 18:01:22
|
Revision: 746
http://digir.svn.sourceforge.net/digir/?rev=746&view=rev
Author: rdg
Date: 2008-08-01 18:01:18 +0000 (Fri, 01 Aug 2008)
Log Message:
-----------
Just updated message to user in data source config tab.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpDataSourceForm.php
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2008-08-01 16:58:44 UTC (rev 745)
+++ tapirlink/trunk/ChangeLog.txt 2008-08-01 18:01:18 UTC (rev 746)
@@ -1,6 +1,6 @@
Release 0.6.1 (2008-08-01)
--------------------------
-(revision 745)
+(revision 746)
* Added support for automatic updates.
* Bugfix: dateLastUpdated environment variable was not working if it
Modified: tapirlink/trunk/classes/TpDataSourceForm.php
===================================================================
--- tapirlink/trunk/classes/TpDataSourceForm.php 2008-08-01 16:58:44 UTC (rev 745)
+++ tapirlink/trunk/classes/TpDataSourceForm.php 2008-08-01 18:01:18 UTC (rev 746)
@@ -46,7 +46,7 @@
}
else
{
- $this->SetMessage( "The next steps depend on an open connection with your database.\nPlease, provide the necessary information here.\n\nNote: if you get a blank page after clicking on 'next',\nyou probably didn't install the corresponding PHP module to\nconnect to your database." );
+ $this->SetMessage( "The next steps depend on an open connection with your database.\nPlease, provide the necessary information here.\n\nNote: if you get a blank page after clicking on 'next step'\nor PHP errors from ADOdb, you probably didn't install the corresponding\nPHP module to connect to a database using the selected driver." );
$r_data_source->LoadDefaults();
}
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2008-08-01 16:58:44 UTC (rev 745)
+++ tapirlink/trunk/www/tapir_globals.php 2008-08-01 18:01:18 UTC (rev 746)
@@ -552,7 +552,6 @@
define( 'TP_VERSION', '0.6.1' );
-
$revision = '$Revision$.';
$revision_regexp = '/^\$'.'Revision:\s(\d+)\s\$\.$/';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-01-05 20:00:00
|
Revision: 1953
http://digir.svn.sourceforge.net/digir/?rev=1953&view=rev
Author: rdg
Date: 2009-01-05 19:59:53 +0000 (Mon, 05 Jan 2009)
Log Message:
-----------
Check each piece of content that comes from the database (in search or inventory responses)
to avoid wrong charset convertions that may produce invalid XML. Convertion problems could happen when the
database charset was incorrectly configured or if the database content somehow didn't follow the
expected (real) database encoding.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpInventoryResponse.php
tapirlink/trunk/classes/TpSearchResponse.php
tapirlink/trunk/classes/TpServiceUtils.php
tapirlink/trunk/www/tapir.php
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2008-12-26 11:32:54 UTC (rev 1952)
+++ tapirlink/trunk/ChangeLog.txt 2009-01-05 19:59:53 UTC (rev 1953)
@@ -1,3 +1,15 @@
+Release 0.7.0 (?)
+--------------------------
+(revision ?)
+
+ * Check each piece of content that comes from the database
+ (in search or inventory responses) to avoid wrong charset convertions that
+ may produce invalid XML. Convertion problems could happen when the database
+ charset was incorrectly configured or if the database content somehow
+ didn't follow the expected (real) database encoding.
+ * Added support for mixed content elements, allowing TapirLink to be exchange
+ simple TCS (Taxonomic Concept Schema) data.
+
Release 0.6.1 (2008-08-01)
--------------------------
(revision 746)
Modified: tapirlink/trunk/classes/TpInventoryResponse.php
===================================================================
--- tapirlink/trunk/classes/TpInventoryResponse.php 2008-12-26 11:32:54 UTC (rev 1952)
+++ tapirlink/trunk/classes/TpInventoryResponse.php 2009-01-05 19:59:53 UTC (rev 1953)
@@ -319,6 +319,8 @@
$tag_names = array_values( $concepts );
+ TpServiceUtils::AdjustDetectEncodingOrder( $db_encoding );
+
while ( ( ! $result_set->EOF ) and ( $num_recs < $limit ) )
{
$num_recs ++;
Modified: tapirlink/trunk/classes/TpSearchResponse.php
===================================================================
--- tapirlink/trunk/classes/TpSearchResponse.php 2008-12-26 11:32:54 UTC (rev 1952)
+++ tapirlink/trunk/classes/TpSearchResponse.php 2009-01-05 19:59:53 UTC (rev 1953)
@@ -509,6 +509,8 @@
// TODO: Get and execute the SQL from inside "Render" guided by class mappings
+ TpServiceUtils::AdjustDetectEncodingOrder( $db_encoding );
+
$xml_generator = new TpXmlGenerator( $r_output_model, $rejected_paths,
$sql_builder, $db_encoding,
$max_repetitions, $limit,
Modified: tapirlink/trunk/classes/TpServiceUtils.php
===================================================================
--- tapirlink/trunk/classes/TpServiceUtils.php 2008-12-26 11:32:54 UTC (rev 1952)
+++ tapirlink/trunk/classes/TpServiceUtils.php 2009-01-05 19:59:53 UTC (rev 1953)
@@ -65,6 +65,72 @@
} // end of GetLogString
/**
+ * Check if the specified db charset encoding can be detected by the
+ * mb_detect_encoding PHP function. In that case, set the global variable
+ * $g_encoding_can_be_detected to true and add the $encoding to the end
+ * of the default detect_order list.
+ *
+ * @param $encoding string Database charset encoding.
+ */
+ function AdjustDetectEncodingOrder( $encoding )
+ {
+ if ( ! function_exists( 'mb_detect_encoding' ) )
+ {
+ return;
+ }
+
+ $supported[] = 'UTF-8';
+ $supported[] = 'UTF-7';
+ $supported[] = 'ASCII';
+ $supported[] = 'EUC-JP';
+ $supported[] = 'SJIS';
+ $supported[] = 'eucJP-win';
+ $supported[] = 'SJIS-win';
+ $supported[] = 'JIS';
+ $supported[] = 'ISO-2022-JP';
+
+ $supported[] = 'ISO-8859-1';
+ $supported[] = 'ISO-8859-2';
+ $supported[] = 'ISO-8859-3';
+ $supported[] = 'ISO-8859-4';
+ $supported[] = 'ISO-8859-5';
+ $supported[] = 'ISO-8859-6';
+ $supported[] = 'ISO-8859-7';
+ $supported[] = 'ISO-8859-8';
+ $supported[] = 'ISO-8859-9';
+ $supported[] = 'ISO-8859-10';
+ $supported[] = 'ISO-8859-13';
+ $supported[] = 'ISO-8859-14';
+ $supported[] = 'ISO-8859-15';
+
+ //$unsupported[] = 'UTF-16';
+ //$unsupported[] = 'UTF-32';
+ //$unsupported[] = 'UCS2';
+ //$unsupported[] = 'UCS4';
+
+ if ( ! in_array( $encoding, $supported ) )
+ {
+ return;
+ }
+
+ global $g_encoding_can_be_detected;
+
+ $g_encoding_can_be_detected = true;
+
+ // Get default order
+ $order = mb_detect_order();
+
+ if ( ! in_array( $encoding, $order ) )
+ {
+ $order[] = $encoding;
+
+ // Set new order
+ mb_detect_order( $order );
+ }
+
+ } // end of AdjustDetectEncodingOrder
+
+ /**
* Converts a SQL statement to the current database charset encoding
* (if different from UTF-8).
*
@@ -86,6 +152,15 @@
} // end of EncodeSql
+ /**
+ * Encode a given string in the given encoding.
+ * Note: AdjustDetectEncodingOrder must always be called before calling
+ * this function.
+ *
+ * @param $data string String to be encoded.
+ * @param $encoding string Final charset encoding.
+ * @return string Encoded string
+ */
function EncodeData( $data, $encoding )
{
if ( $data == null )
@@ -98,7 +173,42 @@
if ( strcasecmp( $encoding, 'UTF-8' ) and
function_exists( 'mb_convert_encoding' ) )
{
- $data = mb_convert_encoding( $data, 'UTF-8', $encoding );
+ // But first check if $data is encoded as expected
+
+ // If encoding can be checked
+ if ( function_exists( 'mb_check_encoding' ) )
+ {
+ // If db encoding is corrrect
+ if ( mb_check_encoding( $data, $encoding ) )
+ {
+ $data = mb_convert_encoding( $data, 'UTF-8', $encoding );
+ }
+ // Db encoding seems to be wrong!
+ else
+ {
+ // Dynamically detect the string encoding before conversion
+ $data = mb_convert_encoding( $data, 'UTF-8', mb_detect_encoding( $data ) );
+ }
+ }
+ // Cannot check encoding
+ else
+ {
+ global $g_encoding_can_be_detected;
+
+ // If specified db encoding can be detected by PHP.
+ // Note: here we assume that it was already included in detect_order
+ if ( $g_encoding_can_be_detected )
+ {
+ // Use detection
+ $data = mb_convert_encoding( $data, 'UTF-8', mb_detect_encoding( $data ) );
+ }
+ // If specified db encoding cannot be detected by PHP
+ else
+ {
+ // Trust user
+ $data = mb_convert_encoding( $data, 'UTF-8', $encoding );
+ }
+ }
}
return TpUtils::EscapeXmlSpecialChars( $data );
Modified: tapirlink/trunk/www/tapir.php
===================================================================
--- tapirlink/trunk/www/tapir.php 2008-12-26 11:32:54 UTC (rev 1952)
+++ tapirlink/trunk/www/tapir.php 2009-01-05 19:59:53 UTC (rev 1953)
@@ -201,6 +201,10 @@
die();
}
+// By default, assume that the database encoding cannot be detected
+// by the mb_detect_encoding PHP function
+global $g_encoding_can_be_detected;
+
$operation = $request->GetOperation();
if ( $operation == 'ping' )
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2008-12-26 11:32:54 UTC (rev 1952)
+++ tapirlink/trunk/www/tapir_globals.php 2009-01-05 19:59:53 UTC (rev 1953)
@@ -550,7 +550,7 @@
define( 'TP_MIN_PHP_VERSION', '4.2.3' );
-define( 'TP_VERSION', '0.6.1' );
+define( 'TP_VERSION', '0.7.0' );
$revision = '$Revision$.';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-01-06 00:03:36
|
Revision: 1954
http://digir.svn.sourceforge.net/digir/?rev=1954&view=rev
Author: rdg
Date: 2009-01-06 00:03:33 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
New admin program to check the database encoding configuration.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/templates/TpDataSourceForm.tmpl.php
tapirlink/trunk/templates/TpResourceForm.tmpl.php
tapirlink/trunk/www/tapir_globals.php
Added Paths:
-----------
tapirlink/trunk/admin/check_encoding.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2009-01-05 19:59:53 UTC (rev 1953)
+++ tapirlink/trunk/ChangeLog.txt 2009-01-06 00:03:33 UTC (rev 1954)
@@ -2,6 +2,7 @@
--------------------------
(revision ?)
+ * New admin program to check the database encoding configuration.
* Check each piece of content that comes from the database
(in search or inventory responses) to avoid wrong charset convertions that
may produce invalid XML. Convertion problems could happen when the database
Added: tapirlink/trunk/admin/check_encoding.php
===================================================================
--- tapirlink/trunk/admin/check_encoding.php (rev 0)
+++ tapirlink/trunk/admin/check_encoding.php 2009-01-06 00:03:33 UTC (rev 1954)
@@ -0,0 +1,224 @@
+<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
+<html>
+<head>
+<title>TapirLink Content Encoding Checker</title>
+<style type="text/css">
+body {background-color: #ffffff; color: #000000;}
+body, td, th, h1, h2 {font-family: sans-serif;}
+pre {margin: 0px; font-family: monospace;}
+a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
+a:hover {text-decoration: underline;}
+table {border-collapse: collapse;}
+.center {text-align: center;}
+.center table { margin-left: auto; margin-right: auto; text-align: left;}
+.center th { text-align: center !important; }
+td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
+h1 {font-size: 150%;}
+h2 {font-size: 125%;}
+.p {text-align: left;}
+.e {background-color: #ccccff; font-weight: bold; color: #000000;}
+.h {background-color: #9999cc; font-weight: bold; color: #000000;}
+.v {background-color: #cccccc; color: #000000;}
+.vr {background-color: #cccccc; text-align: right; color: #000000;}
+img {float: right; border: 0px;}
+hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
+</style>
+</head>
+<body>
+<h3><i>TapirLink Content Encoding Checker</i></h3>
+<?php
+
+if ( ! function_exists( 'mb_check_encoding' ) )
+{
+ die('Function mb_check_encoding unavailable. Please make sure that you have the PHP mbstring module installed and that the PHP version is >= 4.4.3 (or PHP5 >= 5.1.3)');
+}
+
+if ( ! isset( $_REQUEST['res'] ) )
+{
+ die('Missing mandatory parameter "res" (resource code)');
+}
+
+// Encodings that can be detected
+$enc[] = 'ASCII';
+$enc[] = 'ISO-8859-1';
+$enc[] = 'ISO-8859-2';
+$enc[] = 'ISO-8859-3';
+$enc[] = 'ISO-8859-4';
+$enc[] = 'ISO-8859-5';
+$enc[] = 'ISO-8859-6';
+$enc[] = 'ISO-8859-7';
+$enc[] = 'ISO-8859-8';
+$enc[] = 'ISO-8859-9';
+$enc[] = 'ISO-8859-10';
+$enc[] = 'ISO-8859-13';
+$enc[] = 'ISO-8859-14';
+$enc[] = 'ISO-8859-15';
+$enc[] = 'JIS';
+$enc[] = 'UTF-8';
+$enc[] = 'UTF-7';
+$enc[] = 'EUC-JP';
+$enc[] = 'SJIS';
+$enc[] = 'eucJP-win';
+$enc[] = 'SJIS-win';
+$enc[] = 'ISO-2022-JP';
+
+// should be included first
+require_once('../www/tapir_globals.php');
+require_once('TpUtils.php');
+require_once('TpResources.php');
+require_once('TpDataSource.php');
+require_once('TpLocalMapping.php');
+require_once('TpConceptualSchema.php');
+require_once('TpConcept.php');
+require_once('TpConceptMapping.php');
+
+$r_resources =& TpResources::GetInstance();
+
+$r_resource =& $r_resources->GetResource( $_REQUEST['res'] );
+
+if ( ! $r_resource )
+{
+ die('Could not find resource with code '.$_REQUEST['res']);
+}
+
+if ( ! $r_resource->ConfiguredDatasource( ) )
+{
+ die('Resource "'.$_REQUEST['res'].'" does not contain complete data source configuration yet');
+
+}
+if ( ! $r_resource->ConfiguredMapping( ) )
+{
+ die('Resource "'.$_REQUEST['res'].'" does not contain complete mapping configuration yet');
+}
+
+$r_resource->LoadConfig();
+
+$r_ds =& $r_resource->GetDataSource();
+
+$encoding = $r_ds->getEncoding();
+
+echo "\n<b>Charset Specified in Configuration: </b>$encoding";
+flush();
+
+$r_mapping =& $r_resource->GetLocalMapping();
+
+$r_mapped_schemas =& $r_mapping->GetMappedSchemas();
+
+$num_fields = 0;
+
+$selected_fields = TpUtils::GetVar( 'fields', array() );
+
+$cn = $r_ds->GetConnection();
+
+foreach ( $r_mapped_schemas as $ns => $schema )
+{
+ $r_concepts =& $schema->GetConcepts();
+
+ foreach ( $r_concepts as $id => $concept )
+ {
+ if ( ! $concept->IsMapped() )
+ {
+ continue;
+ }
+
+ $c_mapping = $concept->GetMapping();
+
+ if ( $c_mapping->GetMappingType() <> 'SingleColumnMapping' )
+ {
+ continue;
+ }
+
+ ++$num_fields;
+
+ if ( $num_fields == 1 )
+ {
+ echo "\n<br/><br/>Select the fields to be tested. Please note that this test is not complete. It retrieves the first 100 distinct values from each selected field and checks if the content is compatible with the charset specified in the configuration. If not, it tries to detect the charset.<br/><br/>\n";
+ echo "<form method=\"POST\" action=\"check_encoding.php\">\n";
+ echo "<table border=\"0\" cellpadding=\"3\">\n";
+ flush();
+ }
+
+ $table = $c_mapping->GetTable();
+ $field = $c_mapping->GetField();
+
+ $tf = $table.'.'.$field;
+
+ $checked = '';
+
+ if ( ( ! isset( $_REQUEST['check'] ) ) or
+ in_array( $tf, TpUtils::GetVar( 'fields', array() ) ) )
+ {
+ $checked = ' checked="1"';
+ }
+
+ echo "\n<tr><td class=\"e\"><input type=\"checkbox\" class=\"checkbox\" name=\"fields[]\" value=\"".$tf."\"".$checked."</td><td class=\"e\">".$tf."</td>";
+
+ if ( isset( $_REQUEST['check'] ) )
+ {
+ $result = 'not tested';
+
+ if ( in_array( $tf, $selected_fields ) )
+ {
+ $sql = 'SELECT DISTINCT '.$tf.' FROM '.$table;
+
+ $rs =& $cn->SelectLimit( $sql, 100, 0 );
+
+ if ( is_object( $rs ) )
+ {
+ $result = 'passed';
+
+ while ( ( ! $rs->EOF ) )
+ {
+ $data = $rs->fields[0];
+
+ if ( ! mb_check_encoding( $data, $encoding ) )
+ {
+ $suggested = mb_detect_encoding( $data, $enc );
+
+ $result = 'Failed! Detected '.$suggested;
+
+ break;
+ }
+
+ $rs->MoveNext();
+ }
+
+ $rs->Close();
+
+ }
+ else
+ {
+ $err = $cn->ErrorMsg();
+
+ $result = 'Failed to select records: '.$err;
+
+ $r_data_source->ResetConnection();
+ }
+ }
+
+ echo "<td class=\"v\">".$result."</td></tr>";
+ }
+
+ flush();
+ }
+}
+
+$r_ds->ResetConnection();
+
+if ( $num_fields )
+{
+ echo "</table>\n";
+ echo "<br/><input type=\"hidden\" name=\"res\" value=\"".$_REQUEST['res']."\"/>\n";
+ echo "<input type=\"submit\" name=\"check\" value=\"Check\"/>\n";
+ echo "</form>\n";
+}
+else
+{
+ die('Resource "'.$_REQUEST['res'].'" does not contain any mapping to fields in the database');
+}
+
+echo "<br/><a href=\"configurator.php\">back to the configuration interface</a>\n";
+
+?>
+</body>
+</html>
Modified: tapirlink/trunk/templates/TpDataSourceForm.tmpl.php
===================================================================
--- tapirlink/trunk/templates/TpDataSourceForm.tmpl.php 2009-01-05 19:59:53 UTC (rev 1953)
+++ tapirlink/trunk/templates/TpDataSourceForm.tmpl.php 2009-01-06 00:03:33 UTC (rev 1954)
@@ -3,7 +3,7 @@
<br/>
<table align="center" width="92%" cellspacing="1" cellpadding="1" bgcolor="#999999">
<tr bgcolor="#ffffee"><td align="left" valign="middle" width="25%"><span class="label"><?php print(TP_MANDATORY_FIELD_FLAG); ?>Driver: </span></td><td align="left" valign="middle" width="75%"><?php print(TpHtmlUtils::GetCombo('dbtype',$r_data_source->GetDriverName(),$this->GetOptions('adodbDrivers'), false, false, "document.forms[1].refresh.value='showTemplate';document.forms[1].submit()")); ?><br/><span class="tip">see: </span><a href="http://phplens.com/lens/adodb/docs-adodb.htm#drivers" class="tip" target="_new">http://phplens.com/lens/adodb/docs-adodb.htm#drivers</a></td></tr>
- <tr bgcolor="#ffffee"><td align="left" valign="middle" width="25%"><span class="label"><?php print(TP_MANDATORY_FIELD_FLAG); ?>Database encoding: </span></td><td align="left" valign="middle" width="75%"><?php print(TpHtmlUtils::GetCombo('encoding',$r_data_source->GetEncoding(),$this->GetOptions('encodings'))); ?><br/><span class="tip">see: </span><a href="http://www.php.net/manual/en/ref.mbstring.php" class="tip" target="_new">http://www.php.net/manual/en/ref.mbstring.php</a></td></tr>
+ <tr bgcolor="#ffffee"><td align="left" valign="middle" width="25%"><span class="label"><?php print(TP_MANDATORY_FIELD_FLAG); ?>Database encoding: </span></td><td align="left" valign="middle" width="75%"><?php print(TpHtmlUtils::GetCombo('encoding',$r_data_source->GetEncoding(),$this->GetOptions('encodings'))); ?><br/><span class="tip">see: </span><a href="http://www.php.net/manual/en/ref.mbstring.php" class="tip" target="_new">http://www.php.net/manual/en/ref.mbstring.php</a><br/><span class="tip">note: If you are unsure about this setting, you can run an encoding test from the resource front page (after finishing the resource configuration).</span></td></tr>
<tr bgcolor="#ffffee"><td align="left" valign="middle" width="25%"><span class="label"><?php print(TP_MANDATORY_FIELD_FLAG); ?>Datasource string: </span></td><td align="left" valign="middle" width="75%"><input type="text" name="constr" value="<?php print(htmlspecialchars($r_data_source->GetConnectionString())); ?>" size="70"><?php if ($this->mTemplate): ?><br/><span class="tip">there is a template available <a href="help.php?name=<?php print($this->mTemplateTitle); ?>&doc=<?php print($this->mTemplate); ?>" <?php printf("onClick=\"window.open('help.php?name=%s&doc=%s','help','width=600,height=140,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,personalbar=no,locationbar=no,statusbar=no').focus(); return false;\" style=\"text-decoration:none;\"", $this->mTemplateTitle, $this->mTemplate); ?>">here</a></span><?php endif; ?></td></tr>
<tr bgcolor="#ffffee"><td align="left" valign="middle" width="25%"><span class="label"><?php print(TP_MANDATORY_FIELD_FLAG); ?>Username: </span></td><td align="left" valign="middle" width="75%"><input type="text" name="uid" value="<?php print($r_data_source->GetUsername()); ?>" size="20"></td></tr>
<tr bgcolor="#ffffee"><td align="left" valign="middle" width="25%"><span class="label">Password: </span></td><td align="left" valign="middle" width="75%"><input type="password" name="pwd" value="<?php print($r_data_source->GetPassword()); ?>" size="20"></td></tr>
Modified: tapirlink/trunk/templates/TpResourceForm.tmpl.php
===================================================================
--- tapirlink/trunk/templates/TpResourceForm.tmpl.php 2009-01-05 19:59:53 UTC (rev 1953)
+++ tapirlink/trunk/templates/TpResourceForm.tmpl.php 2009-01-06 00:03:33 UTC (rev 1954)
@@ -33,7 +33,17 @@
<?php if (TpDiagnostics::Count()): ?><span class="tip"><?php print(nl2br(TpDiagnostics::Dump())); ?></span><br/><br/><?php endif; ?>
</td>
</tr>
+<?php if ($resource->ConfiguredDatasource() and $resource->ConfiguredMapping()): ?>
<tr>
+ <td class="label" valign="top" align="left">Encoding:</td>
+ <td valign="top" align="left">
+ <pre>
+<span class="tip">Click <a href="check_encoding.php?res=<?php print($resource->GetCode()); ?>">here</a> to run a test</span>
+ </pre>
+ </td>
+ </tr>
+<?php endif; ?>
+ <tr>
<?php $metadata_rev = $resource->GetMetadataTemplateRevision(); ?>
<?php $capabilities_rev = $resource->GetCapabilitiesTemplateRevision(); ?>
<td class="label" valign="top" align="left">Templates:</td>
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2009-01-05 19:59:53 UTC (rev 1953)
+++ tapirlink/trunk/www/tapir_globals.php 2009-01-06 00:03:33 UTC (rev 1954)
@@ -551,7 +551,6 @@
define( 'TP_MIN_PHP_VERSION', '4.2.3' );
define( 'TP_VERSION', '0.7.0' );
-
$revision = '$Revision$.';
$revision_regexp = '/^\$'.'Revision:\s(\d+)\s\$\.$/';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-01-06 00:20:51
|
Revision: 1956
http://digir.svn.sourceforge.net/digir/?rev=1956&view=rev
Author: rdg
Date: 2009-01-06 00:20:47 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
Check encoding, even when it's utf-8. Always try to prepend latin1 to detect_order.
Modified Paths:
--------------
tapirlink/trunk/classes/TpServiceUtils.php
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/classes/TpServiceUtils.php
===================================================================
--- tapirlink/trunk/classes/TpServiceUtils.php 2009-01-06 00:07:30 UTC (rev 1955)
+++ tapirlink/trunk/classes/TpServiceUtils.php 2009-01-06 00:20:47 UTC (rev 1956)
@@ -128,6 +128,15 @@
mb_detect_order( $order );
}
+ // Trick: always try to prepend latin1, since it's very common
+ if ( ! in_array( 'ISO-8859-1', $order ) )
+ {
+ array_unshift( $order, $encoding );
+
+ // Set new order again
+ mb_detect_order( $order );
+ }
+
} // end of AdjustDetectEncodingOrder
/**
@@ -168,46 +177,62 @@
return null;
}
- // If data encoding is different from UTF-8 and conversion function exists,
- // convert values to UTF-8
- if ( strcasecmp( $encoding, 'UTF-8' ) and
- function_exists( 'mb_convert_encoding' ) )
+ // If conversion function exists
+ if ( function_exists( 'mb_convert_encoding' ) )
{
- // But first check if $data is encoded as expected
+ // If data encoding is different from UTF-8, convert values to UTF-8
+ if ( strcasecmp( $encoding, 'UTF-8' ) )
+ {
+ // But first check if $data is encoded as expected
- // If encoding can be checked
- if ( function_exists( 'mb_check_encoding' ) )
- {
- // If db encoding is corrrect
- if ( mb_check_encoding( $data, $encoding ) )
+ // If encoding can be checked
+ if ( function_exists( 'mb_check_encoding' ) )
{
- $data = mb_convert_encoding( $data, 'UTF-8', $encoding );
+ // If db encoding is corrrect
+ if ( mb_check_encoding( $data, $encoding ) )
+ {
+ $data = mb_convert_encoding( $data, 'UTF-8', $encoding );
+ }
+ // Db encoding seems to be wrong!
+ else
+ {
+ // Dynamically detect the string encoding before conversion
+ $data = mb_convert_encoding( $data, 'UTF-8', mb_detect_encoding( $data ) );
+ }
}
- // Db encoding seems to be wrong!
+ // Cannot check encoding
else
{
- // Dynamically detect the string encoding before conversion
- $data = mb_convert_encoding( $data, 'UTF-8', mb_detect_encoding( $data ) );
+ global $g_encoding_can_be_detected;
+
+ // If specified db encoding can be detected by PHP.
+ // Note: here we assume that it was already included in detect_order
+ if ( $g_encoding_can_be_detected )
+ {
+ // Use detection
+ $data = mb_convert_encoding( $data, 'UTF-8', mb_detect_encoding( $data ) );
+ }
+ // If specified db encoding cannot be detected by PHP
+ else
+ {
+ // Trust user
+ $data = mb_convert_encoding( $data, 'UTF-8', $encoding );
+ }
}
}
- // Cannot check encoding
+ // Encoding is UTF-8
else
{
- global $g_encoding_can_be_detected;
-
- // If specified db encoding can be detected by PHP.
- // Note: here we assume that it was already included in detect_order
- if ( $g_encoding_can_be_detected )
+ // Check if it's really UTF-8
+ if ( function_exists( 'mb_check_encoding' ) )
{
- // Use detection
- $data = mb_convert_encoding( $data, 'UTF-8', mb_detect_encoding( $data ) );
+ // If db encoding is incorrrect
+ if ( ! mb_check_encoding( $data, $encoding ) )
+ {
+ // Try to detect encoding and force conversion
+ $data = mb_convert_encoding( $data, 'UTF-8', mb_detect_encoding( $data ) );
+ }
}
- // If specified db encoding cannot be detected by PHP
- else
- {
- // Trust user
- $data = mb_convert_encoding( $data, 'UTF-8', $encoding );
- }
}
}
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2009-01-06 00:07:30 UTC (rev 1955)
+++ tapirlink/trunk/www/tapir_globals.php 2009-01-06 00:20:47 UTC (rev 1956)
@@ -551,6 +551,7 @@
define( 'TP_MIN_PHP_VERSION', '4.2.3' );
define( 'TP_VERSION', '0.7.0' );
+
$revision = '$Revision$.';
$revision_regexp = '/^\$'.'Revision:\s(\d+)\s\$\.$/';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-01-06 12:29:29
|
Revision: 1957
http://digir.svn.sourceforge.net/digir/?rev=1957&view=rev
Author: rdg
Date: 2009-01-06 12:29:26 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
Fixed bug in SQL count caching mechanism when it was disabled.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpInventoryResponse.php
tapirlink/trunk/classes/TpSearchResponse.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2009-01-06 00:20:47 UTC (rev 1956)
+++ tapirlink/trunk/ChangeLog.txt 2009-01-06 12:29:26 UTC (rev 1957)
@@ -9,7 +9,8 @@
charset was incorrectly configured or if the database content somehow
didn't follow the expected (real) database encoding.
* Added support for mixed content elements, allowing TapirLink to be exchange
- simple TCS (Taxonomic Concept Schema) data.
+ simple TCS (Taxonomic Concept Schema) data.
+ * Fixed bug in SQL count caching mechanism when it was disabled.
Release 0.6.1 (2008-08-01)
--------------------------
Modified: tapirlink/trunk/classes/TpInventoryResponse.php
===================================================================
--- tapirlink/trunk/classes/TpInventoryResponse.php 2009-01-06 00:20:47 UTC (rev 1956)
+++ tapirlink/trunk/classes/TpInventoryResponse.php 2009-01-06 12:29:26 UTC (rev 1957)
@@ -238,17 +238,18 @@
$cache = new Cache( 'file', $cache_options );
$cache_id = $cache->generateID( $sql );
- }
- if ( $cached_data = $cache->get( $cache_id, $subdir ) )
- {
- $g_dlog->debug( 'Getting count from cache' );
+ if ( $cached_data = $cache->get( $cache_id, $subdir ) )
+ {
+ $g_dlog->debug( 'Getting count from cache' );
- TpDiagnostics::Append( DC_SYS_MSG, 'Count retrieved from cache', DIAG_WARN );
+ TpDiagnostics::Append( DC_SYS_MSG, 'Count retrieved from cache', DIAG_WARN );
- $matched = (int)$cached_data;
+ $matched = (int)$cached_data;
+ }
}
- else
+
+ if ( is_null( $cached_data ) )
{
$encoded_sql = TpServiceUtils::EncodeSql( $sql, $db_encoding );
Modified: tapirlink/trunk/classes/TpSearchResponse.php
===================================================================
--- tapirlink/trunk/classes/TpSearchResponse.php 2009-01-06 00:20:47 UTC (rev 1956)
+++ tapirlink/trunk/classes/TpSearchResponse.php 2009-01-06 12:29:26 UTC (rev 1957)
@@ -440,17 +440,18 @@
$cache = new Cache( 'file', $cache_options );
$cache_id = $cache->generateID( $sql );
- }
- if ( $cached_data = $cache->get( $cache_id, $subdir ) )
- {
- $g_dlog->debug( 'Getting count from cache' );
+ if ( $cached_data = $cache->get( $cache_id, $subdir ) )
+ {
+ $g_dlog->debug( 'Getting count from cache' );
- TpDiagnostics::Append( DC_SYS_MSG, 'Count retrieved from cache', DIAG_WARN );
+ TpDiagnostics::Append( DC_SYS_MSG, 'Count retrieved from cache', DIAG_WARN );
- $matched = (int)$cached_data;
+ $matched = (int)$cached_data;
+ }
}
- else
+
+ if ( is_null( $cached_data ) )
{
$encoded_sql = TpServiceUtils::EncodeSql( $sql, $db_encoding );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-02-04 12:22:17
|
Revision: 1972
http://digir.svn.sourceforge.net/digir/?rev=1972&view=rev
Author: rdg
Date: 2009-02-04 12:11:56 +0000 (Wed, 04 Feb 2009)
Log Message:
-----------
New TP_DIAG_LEVEL option controls diagnostic messages display.
Modified Paths:
--------------
tapirlink/trunk/classes/TpDiagnostics.php
tapirlink/trunk/www/localconfig_dist.php
tapirlink/trunk/www/tapir_errors.php
tapirlink/trunk/www/tapir_globals.php
Modified: tapirlink/trunk/classes/TpDiagnostics.php
===================================================================
--- tapirlink/trunk/classes/TpDiagnostics.php 2009-02-04 12:10:35 UTC (rev 1971)
+++ tapirlink/trunk/classes/TpDiagnostics.php 2009-02-04 12:11:56 UTC (rev 1972)
@@ -22,6 +22,7 @@
*
*/
+require_once(dirname(__FILE__).'/../www/tapir_globals.php');
// tapir_diagnostics.php is generated by applying diag_codes_php.xslt
// against diag_codes.xml
require_once(dirname(__FILE__).'/../www/tapir_diagnostics.php');
@@ -58,6 +59,24 @@
*/
function Append( $cd, $msg, $severity )
{
+ if ( $severity == DIAG_WARN and TP_DIAG_LEVEL > 2 )
+ {
+ return;
+ }
+
+ if ( $severity == DIAG_INFO and TP_DIAG_LEVEL > 1 )
+ {
+ return;
+ }
+
+ if ( $severity == DIAG_DEBUG and TP_DIAG_LEVEL > 0 )
+ {
+ return;
+ }
+
+ global $g_dlog;
+ $g_dlog->debug("Appending ".$severity." when level is ".TP_DIAG_LEVEL);
+
$stack =& TpDiagnostics::_GetStack();
array_push( $stack, new TpDiagnostic( $cd, $msg, $severity ) );
Modified: tapirlink/trunk/www/localconfig_dist.php
===================================================================
--- tapirlink/trunk/www/localconfig_dist.php 2009-02-04 12:10:35 UTC (rev 1971)
+++ tapirlink/trunk/www/localconfig_dist.php 2009-02-04 12:11:56 UTC (rev 1972)
@@ -56,6 +56,14 @@
*/
//define('TP_LOG_LEVEL', PEAR_LOG_INFO);
+/*
+* Indicate the minimum level of diagnostic messages to appear in responses.
+* Options are: 0 (DEBUG), 1 (INFO), 2 (WARN), 3 (ERROR)
+* Setting 1 (INFO) will avoid debug diagnostics, setting 2 (WARN) will avoid
+* info and debug diagnostics, and so on. Deafult is 1 (INFO).
+*/
+//define( 'TP_DIAG_LEVEL', 3 );
+
/**
* Set this true to allow incoming debug requests
* (not recommended for stable installations).
Modified: tapirlink/trunk/www/tapir_errors.php
===================================================================
--- tapirlink/trunk/www/tapir_errors.php 2009-02-04 12:10:35 UTC (rev 1971)
+++ tapirlink/trunk/www/tapir_errors.php 2009-02-04 12:11:56 UTC (rev 1972)
@@ -57,16 +57,12 @@
case DIAG_ERROR:
- TpDiagnostics::Append( "Error [$errNo]",
- $errStr,
- DIAG_ERROR );
+ TpDiagnostics::Append( "Error [$errNo]", $errStr, DIAG_ERROR );
break;
case DIAG_WARN:
- TpDiagnostics::Append( "Warning [$errNo]",
- $errStr,
- DIAG_WARN );
+ TpDiagnostics::Append( "Warning [$errNo]", $errStr, DIAG_WARN );
break;
default:
Modified: tapirlink/trunk/www/tapir_globals.php
===================================================================
--- tapirlink/trunk/www/tapir_globals.php 2009-02-04 12:10:35 UTC (rev 1971)
+++ tapirlink/trunk/www/tapir_globals.php 2009-02-04 12:11:56 UTC (rev 1972)
@@ -437,6 +437,17 @@
}
/*
+* Indicate the minimum level of diagnostic messages to appear in responses.
+* Options are: 0 (DEBUG), 1 (INFO), 2 (WARN), 3 (ERROR)
+* Setting 1 (INFO) will avoid debug diagnostics, setting 2 (WARN) will avoid
+* info and debug diagnostics, and so on.
+*/
+if ( ! defined( 'TP_DIAG_LEVEL' ) )
+{
+ define( 'TP_DIAG_LEVEL', 1 );
+}
+
+/*
* Set to true if you want to track statistics
*/
if ( ! defined( 'TP_STATISTICS_TRACKING' ) )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <rd...@us...> - 2009-03-02 12:01:36
|
Revision: 1983
http://digir.svn.sourceforge.net/digir/?rev=1983&view=rev
Author: rdg
Date: 2009-03-02 10:58:44 +0000 (Mon, 02 Mar 2009)
Log Message:
-----------
Fixed bug when deserializing bibliographic citation.
Modified Paths:
--------------
tapirlink/trunk/ChangeLog.txt
tapirlink/trunk/classes/TpResourceMetadata.php
Modified: tapirlink/trunk/ChangeLog.txt
===================================================================
--- tapirlink/trunk/ChangeLog.txt 2009-02-25 20:40:59 UTC (rev 1982)
+++ tapirlink/trunk/ChangeLog.txt 2009-03-02 10:58:44 UTC (rev 1983)
@@ -26,6 +26,7 @@
* Replaced XML schema location used in responses with:
http://rs.tdwg.org/tapir/1.0/schema/tdwg_tapir.xsd
* Added new metadata fields: region code, country code and zip code.
+ * Fixed bug when deserializing bibliographic citation.
Release 0.6.1 (2008-08-01)
--------------------------
Modified: tapirlink/trunk/classes/TpResourceMetadata.php
===================================================================
--- tapirlink/trunk/classes/TpResourceMetadata.php 2009-02-25 20:40:59 UTC (rev 1982)
+++ tapirlink/trunk/classes/TpResourceMetadata.php 2009-03-02 10:58:44 UTC (rev 1983)
@@ -332,7 +332,7 @@
{
$this->AddSubjects( trim( $this->mCharData ), $lang );
}
- else if ( strcasecmp( $in_tag, TP_DC_PREFIX.':bibliographicCitation' ) == 0 )
+ else if ( strcasecmp( $in_tag, TP_DCT_PREFIX.':bibliographicCitation' ) == 0 )
{
$this->AddBibliographicCitation( trim( $this->mCharData ), $lang );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|