Author: chabotc
Date: Wed Jun 10 08:52:16 2009
New Revision: 783258

URL: http://svn.apache.org/viewvc?rev=783258&view=rev
Log:
The latest Wamp server choked on the config file regex's, so adjusting those. 
This patch also fixes a function naming error in XmlError.php

Modified:
    incubator/shindig/trunk/php/src/common/XmlError.php
    incubator/shindig/trunk/php/src/gadgets/ContainerConfig.php
    incubator/shindig/trunk/php/src/gadgets/oauth/BasicGadgetOAuthTokenStore.php
    incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php

Modified: incubator/shindig/trunk/php/src/common/XmlError.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/common/XmlError.php?rev=783258&r1=783257&r2=783258&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/common/XmlError.php (original)
+++ incubator/shindig/trunk/php/src/common/XmlError.php Wed Jun 10 08:52:16 2009
@@ -32,13 +32,13 @@
       $xml = explode("\n", $xml);
     }
     foreach ($errors as $error) {
-      $ret .= parseXmlError($error, $xml);
+      $ret .= self::parseXmlError($error, $xml);
     }
     libxml_clear_errors();
     return $ret;
   }
 
-  static public function display_xml_error($error, $xml) {
+  static public function parseXmlError($error, $xml) {
     if ($xml) {
       $ret = $xml[$error->line - 1] . "\n";
       $ret .= str_repeat('-', $error->column) . "^\n";

Modified: incubator/shindig/trunk/php/src/gadgets/ContainerConfig.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/ContainerConfig.php?rev=783258&r1=783257&r2=783258&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/ContainerConfig.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/ContainerConfig.php Wed Jun 10 
08:52:16 2009
@@ -65,7 +65,7 @@
   
   public static function removeComments($str) {
     // remove /* */ style comments
-    $str = preg_replace('@/\\*(?:.|[\\n\\r])*?\\*/@', '', $str);
+    $str = preg_replace('@/\\*.*?\\*/@s', '', $str);
     // remove // style comments, but keep 'http://' 'https://' and '"//'
     // for example: "gadgets.oauthGadgetCallbackTemplate" : 
"//%host%/gadgets/oauthcallback"
     $str = preg_replace('/[^http:\/\/|^https:\/\/|"\/\/]\/\/.*$/m', '', $str);

Modified: 
incubator/shindig/trunk/php/src/gadgets/oauth/BasicGadgetOAuthTokenStore.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/oauth/BasicGadgetOAuthTokenStore.php?rev=783258&r1=783257&r2=783258&view=diff
==============================================================================
--- 
incubator/shindig/trunk/php/src/gadgets/oauth/BasicGadgetOAuthTokenStore.php 
(original)
+++ 
incubator/shindig/trunk/php/src/gadgets/oauth/BasicGadgetOAuthTokenStore.php 
Wed Jun 10 08:52:16 2009
@@ -37,7 +37,7 @@
       $oauthConfigStr = file_get_contents($this->OAUTH_CONFIG);
       // remove all comments because this confuses the json parser
       // note: the json parser also crashes on trailing ,'s in records so 
please don't use them
-      $contents = preg_replace('@/\\*(?:.|[\\n\\r])*?\\*/@', '', 
$oauthConfigStr);
+      $contents = preg_replace('@/\\*.*?\\*/@s', '', $oauthConfigStr);
       $oauthConfig = json_decode($contents, true);
       if ($oauthConfig == $contents) {
         throw new GadgetException("OAuth configuration json failed to parse.");

Modified: 
incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php?rev=783258&r1=783257&r2=783258&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php 
(original)
+++ incubator/shindig/trunk/php/src/social/sample/JsonDbOpensocialService.php 
Wed Jun 10 08:52:16 2009
@@ -87,7 +87,7 @@
           throw new SocialSpiException("Could not read json db file: $jsonDb, 
check if the file exists & has proper permissions", 
ResponseError::$INTERNAL_ERROR);
         }
         $dbConfig = @file_get_contents($jsonDb);
-        $contents = preg_replace('/(?<!http:|https:)\/\/.*$/m', '', 
preg_replace('@/\\*(?:.|[\\n\\r])*?\\*/@', '', $dbConfig));
+        $contents = preg_replace('/(?<!http:|https:)\/\/.*$/m', '', 
preg_replace('@/\\*.*?\\*/@s', '', $dbConfig));
         $jsonDecoded = json_decode($contents, true);
         if ($jsonDecoded == $contents || $jsonDecoded == null) {
           throw new SocialSpiException("Failed to decode the json db", 
ResponseError::$INTERNAL_ERROR);


Reply via email to