[Beeframework-svn] SF.net SVN: beeframework:[151] trunk/framework
Brought to you by:
b_hartmann,
m_plomer
|
From: <m_p...@us...> - 2014-06-18 12:23:35
|
Revision: 151
http://sourceforge.net/p/beeframework/code/151
Author: m_plomer
Date: 2014-06-18 12:23:30 +0000 (Wed, 18 Jun 2014)
Log Message:
-----------
- moved construction of current Request object from dispatch to init phase
Modified Paths:
--------------
trunk/framework/Bee/Context/Xml/IConstants.php
trunk/framework/Bee/Context/Xml/ParserDelegate.php
trunk/framework/Bee/Context/Xml.php
trunk/framework/bee-beans-1.2.xsd
Modified: trunk/framework/Bee/Context/Xml/IConstants.php
===================================================================
--- trunk/framework/Bee/Context/Xml/IConstants.php 2014-04-11 13:07:06 UTC (rev 150)
+++ trunk/framework/Bee/Context/Xml/IConstants.php 2014-06-18 12:23:30 UTC (rev 151)
@@ -45,4 +45,5 @@
const KEY_ATTRIBUTE = 'key';
+ const NUMERIC_KEYS_ATTRIBUTE = 'numeric-keys';
}
Modified: trunk/framework/Bee/Context/Xml/ParserDelegate.php
===================================================================
--- trunk/framework/Bee/Context/Xml/ParserDelegate.php 2014-04-11 13:07:06 UTC (rev 150)
+++ trunk/framework/Bee/Context/Xml/ParserDelegate.php 2014-06-18 12:23:30 UTC (rev 151)
@@ -625,6 +625,8 @@
public function parseArrayElement(DOMElement $collectionEle, Bee_Context_Config_IBeanDefinition $bd) {
$defaultType = $collectionEle->getAttribute(self::VALUE_TYPE_ATTRIBUTE);
+ $numericKeys = $collectionEle->hasAttribute(self::NUMERIC_KEYS_ATTRIBUTE) ? filter_var($collectionEle->getAttribute(self::NUMERIC_KEYS_ATTRIBUTE), FILTER_VALIDATE_BOOLEAN) : false;
+
$assoc = false;
$numeric = false;
@@ -635,7 +637,7 @@
if (Bee_Utils_Dom::nodeNameEquals($ele, self::ASSOC_ITEM_ELEMENT)) {
$assoc = true;
list($key, $value) = $this->parseAssocItemElement($ele, $bd, $defaultType);
- $list[$key] = $value;
+ $list[$numericKeys ? intval($key) : $key] = $value;
} else {
$numeric = true;
array_push($list, $this->parsePropertySubElement($ele, $bd, $defaultType));
Modified: trunk/framework/Bee/Context/Xml.php
===================================================================
--- trunk/framework/Bee/Context/Xml.php 2014-04-11 13:07:06 UTC (rev 150)
+++ trunk/framework/Bee/Context/Xml.php 2014-06-18 12:23:30 UTC (rev 151)
@@ -32,7 +32,8 @@
* Enter description here...
*
* @param String $locations
- * @return void
+ * @param bool $callInitMethod
+ * @return \Bee_Context_Xml
*/
public function __construct($locations='', $callInitMethod=true) {
parent::__construct($locations, false);
@@ -111,5 +112,4 @@
return $registry;
}
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
Modified: trunk/framework/bee-beans-1.2.xsd
===================================================================
--- trunk/framework/bee-beans-1.2.xsd 2014-04-11 13:07:06 UTC (rev 150)
+++ trunk/framework/bee-beans-1.2.xsd 2014-06-18 12:23:30 UTC (rev 151)
@@ -318,6 +318,11 @@
<xsd:documentation><![CDATA[Default type for value elements]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
+ <xsd:attribute name="numeric-keys" type="xsd:boolean">
+ <xsd:annotation>
+ <xsd:documentation><![CDATA[Whether keys of assoc items should be interpreted as numeric]]></xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
</xsd:attributeGroup>
<xsd:element name="bean">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|