Skip to content

Commit

Permalink
merge BRANCH_1_1_1 into HEAD -
Browse files Browse the repository at this point in the history
  reorganise test directories into a single tree


git-svn-id: http://svn.php.net/repository/pecl/sdo/trunk@229262 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Caroline Maynard committed Feb 7, 2007
1 parent 505abd3 commit 8970ec9
Show file tree
Hide file tree
Showing 292 changed files with 5,112 additions and 2,723 deletions.
2 changes: 1 addition & 1 deletion DAS/Relational.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
+----------------------------------------------------------------------+
| Copyright IBM Corporation 2005, 2006. |
| Copyright IBM Corporation 2005, 2007. |
| All Rights Reserved. |
+----------------------------------------------------------------------+
| |
Expand Down
2 changes: 1 addition & 1 deletion DAS/Relational/DatabaseModel.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
+----------------------------------------------------------------------+
| (c) Copyright IBM Corporation 2005. |
| (c) Copyright IBM Corporation 2005, 2007. |
| All Rights Reserved. |
+----------------------------------------------------------------------+
| |
Expand Down
52 changes: 39 additions & 13 deletions MakePackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,14 @@
// . " - new function in SDO_DAS_Relational to support multiple root data objects\n"
// . " - new function in SDO_DAS_XML to support CDATA sections (not yet complete)\n"
// . " - fixes for bugs #9287, #9289, #9339\n",
'notes' => " Fix for bug #9498 - invalid WSDL generation\n"
. "Fix for bug 9426 - printing open types\n"
. "Update to Apache Tuscany C++ SDO revision level 483149 - includes various fixes for sequenced and open data types.\n",
// 'notes' => " Fix for bug #9498 - invalid WSDL generation\n"
// . "Fix for bug 9426 - printing open types\n"
// . "Update to Apache Tuscany C++ SDO revision level 483149 - includes various fixes for sequenced and open data types.\n",
'notes' => "Fix for bug #9845 - Relational DAS is failing when one parent and two children\n"
. "Changed from namespaceURI.type to namespaceURI#type (conform to spec)\n"
. "Update to Apache Tuscany C++ SDO revision level 495327 (namespace fixes, performance improvements)\n",
'simpleoutput' => true,
'version' => '1.1.1',
'version' => '1.1.2',
'baseinstalldir' => 'SDO',
'state' => 'stable',
'license' => 'Apache 2.0',
Expand Down Expand Up @@ -152,6 +155,8 @@
'missing',
'mkinstalldirs',
'run-tests.php',
'SCA.txt',
'wsdl-all.xsd',
// packaging
'MakePackage.php',
'package.xml',
Expand All @@ -165,12 +170,11 @@
'*tgz'
),
'dir_roles' => array(
'/' => 'src',
'scenarios' => 'test',
'tests' => 'test',
'DAS' => 'php',
'SCA/tests' => 'test',
'SCA' => 'php')
'/' => 'src',
'examples' => 'test',
'tests' => 'test',
'DAS' => 'php',
'SCA' => 'php')
)

);
Expand Down Expand Up @@ -245,6 +249,11 @@
// all the lines from package.xml
$in_lines = file('package.xml');

// sometimes we have to ignore a block of lines from the
// package.xml file listing because it contains an SCA
// directory we don't want to move
$ignore_block = false;

// when set true lines are recorded in $sca_buffer. When
// set false lines are recorded in $sdo_buffer
$sca_buffering = false;
Expand All @@ -255,9 +264,19 @@

// separate SCA lines from SDO lines
foreach ($in_lines as $line) {
// find the start tag of the SCA section and
// start buffering SCA lines
if ( strstr($line, "<dir name=\"SCA\">") ) {
// We have to check that we are not in the examples
// or tests sections as both of these sections have
// SCA directories that we want to leave alone
if ( strstr($line, "<dir name=\"examples\">") ||
strstr($line, "<dir name=\"tests\">") ) {
$ignore_block = true;
}

// find the start tag of an SCA section and
// assuming we aren't ignoring the block
// it appears in start buffering SCA lines
if ( strstr($line, "<dir name=\"SCA\">") &&
$ignore_block == false ) {
$sca_buffering = true;
}

Expand All @@ -272,6 +291,13 @@
if ( strstr($line, "</dir> <!-- /SCA -->") ) {
$sca_buffering = false;
}

// Stop ignoring any SCA directories we see when we
// get to the end of the tests and examples sections
if ( strstr($line, "</dir> <!-- /examples -->") ||
strstr($line, "</dir> <!-- /tests -->") ) {
$ignore_block = false;
}
}

// empty the temporary output file
Expand Down
77 changes: 44 additions & 33 deletions SCA/SCA_AnnotationReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ public function reflectReferences()
$reader = new SCA_CommentReader($ref_prop->getDocComment());
if ($reader->isReference()) {
$ref = $reader->getReference();
if ($ref == "") {
throw new SCA_RuntimeException("Instance variable " . $ref_prop->getName() . " has a binding annotation with no following value");
}
$references[$ref_prop->getName()] = $ref;
} else {
if ($reader->hasBinding()) {
throw new SCA_RuntimeException("Instance variable " . $ref_prop->getName() . " appears to have a @binding but no @reference");
}
}
}
} catch( SCA_RuntimeException $se ) {
Expand Down Expand Up @@ -103,26 +110,30 @@ public function reflectService()
* Check that this object is defining a web service that will require a
* WSDL file to be generated.
*/
if (!$reader->isService()) {
throw new SCA_RuntimeException("Class $sca_name does not contain an @service annotation.");
}

if ($reader->isWebService()) {

$service = array();
$service['binding'] = 'ws';
$service['xsd_types'] = $this->reflectXsdTypes();

/* Filter reflected method array to show 'public' functions only */
$public_methods =
SCA_Helper::filterMethods(get_class_methods($this->instance_of_the_component),
$reflection->getMethods());
$public_methods =
SCA_Helper::filterMethods(get_class_methods($this->instance_of_the_component),
$reflection->getMethods());

$operations = array();
$comment = null ;

/* Check the comment of each method to find any annotations so that
* a wsdl can be generated from the .php file.
*/
/* Check the comment of each method to find any annotations so that
* a wsdl can be generated from the .php file.
*/
foreach ( $public_methods as $public_method ) {
$methodAnnotations =
SCA_AnnotationRules::createEmptyAnnotationArray();
$methodAnnotations =
SCA_AnnotationRules::createEmptyAnnotationArray();
$comment = $public_method->getDocComment();

/* When the method has a doc comment .... */
Expand All @@ -132,45 +143,45 @@ public function reflectService()
/* ... and the method a web service method .... */
if ($method_reader->isWebMethod()) {
/* ... decode any method annotations. */
$methodAnnotations =
$method_reader->getMethodAnnotations();
$methodAnnotations =
$method_reader->getMethodAnnotations();

if ( $methodAnnotations != null ) {
$thisElement = 0 ;

/* Each set of method annotations contain a set of 1
* or more parameter annotations, and 1 return
* annotation.
*/
/* Each set of method annotations contain a set of 1
* or more parameter annotations, and 1 return
* annotation.
*/
foreach ( $methodAnnotations as $annotationSet ) {
// check that $annotationSet is not null to

// check that $annotationSet is not null to
// take account of the situation where no
// @return or @param annotation is specified

if ( $annotationSet ) {
/* Clean off the dollar sign from the variable name, and do */
/* a namespace check as appropriate. */
foreach ( $annotationSet as $annotation ) {
if ( strcmp($annotation['annotationType' ], SCA_AnnotationRules::PARAM) === 0 ) {
if ( strpos($annotation[ 'name' ], SCA_AnnotationRules::DOLLAR) === false ) {
throw new SCA_RuntimeException("Invalid syntax '{$annotation[ 'name' ]}' is not a php variable name");
} else {
$methodAnnotations[ 'parameters' ][ $thisElement ][ 'name' ] = trim($annotation[ 'name' ], SCA_AnnotationRules::DOLLAR);
/* Clean off the dollar sign from the variable name, and do */
/* a namespace check as appropriate. */
foreach ( $annotationSet as $annotation ) {
if ( strcmp($annotation['annotationType' ], SCA_AnnotationRules::PARAM) === 0 ) {
if ( strpos($annotation[ 'name' ], SCA_AnnotationRules::DOLLAR) === false ) {
throw new SCA_RuntimeException("Invalid syntax '{$annotation[ 'name' ]}' is not a php variable name");
} else {
$methodAnnotations[ 'parameters' ][ $thisElement ][ 'name' ] = trim($annotation[ 'name' ], SCA_AnnotationRules::DOLLAR);

}/* End variable name check */
}/* End variable name check */

}/* End parameter annotation test */
}/* End parameter annotation test */

/* When the array is formatted for SDO objects */
if ( array_key_exists('namespace', $annotation) ) {
/* .... check that the xsd is defined for the namespace */
if ( ! $this->_matchXsds($service[ 'xsd_types' ], $annotation[ 'namespace' ]) ) {
throw new SCA_RuntimeException("Namespace defined in {$annotation[ 'annotationType' ]} not found in @type annotation: '{$annotation[ 'namespace' ]}'");
/* When the array is formatted for SDO objects */
if ( array_key_exists('namespace', $annotation) ) {
/* .... check that the xsd is defined for the namespace */
if ( ! $this->_matchXsds($service[ 'xsd_types' ], $annotation[ 'namespace' ]) ) {
throw new SCA_RuntimeException("Namespace defined in {$annotation[ 'annotationType' ]} not found in @type annotation: '{$annotation[ 'namespace' ]}'");

}/* End xsd - namespace exists */
}/* End xsd - namespace exists */

}/* End only for object descriptions */
}/* End only for object descriptions */

$thisElement++ ; // next annotation
}/* End all of the sub-sets */
Expand Down
5 changes: 5 additions & 0 deletions SCA/SCA_AnnotationRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ public static function enoughPieces( $inThisArray )
$entries = count($inThisArray);

/* Enough entries for something */
// TODO looks like we missed something here
// This is only ever going to return true, I think :-)
// I think the person who wrote this meant ||
// but it's only a crude check of the parameter and return
// lines anyway and not right
return ( ( $entries < 2 && $entries > 4 ) ? false : true ) ;

}/* End enough pieces function */
Expand Down
Loading

0 comments on commit 8970ec9

Please sign in to comment.