You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by bh...@apache.org on 2010/11/02 10:41:15 UTC
svn commit: r1029982 - in /shindig/trunk/php/src/gadgets:
GadgetFeatureRegistry.php GadgetSpecParser.php oauth/OAuthFetcher.php
Author: bhofmann
Date: Tue Nov 2 09:41:14 2010
New Revision: 1029982
URL: http://svn.apache.org/viewvc?rev=1029982&view=rev
Log:
PHP: small changes to allow better enhancement for container specific implementations
Modified:
shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php
shindig/trunk/php/src/gadgets/GadgetSpecParser.php
shindig/trunk/php/src/gadgets/oauth/OAuthFetcher.php
Modified: shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php?rev=1029982&r1=1029981&r2=1029982&view=diff
==============================================================================
--- shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php (original)
+++ shindig/trunk/php/src/gadgets/GadgetFeatureRegistry.php Tue Nov 2 09:41:14 2010
@@ -62,7 +62,7 @@ class GadgetFeatureRegistry {
return '';
}
$ret = '';
- if (Config::get('compress_javascript')) {
+ if (Config::get('compress_javascript') && ! isset($_GET['debug'])) {
$featureCache = Cache::createCache(Config::get('feature_cache'), 'FeatureCache');
if (($featureContent = $featureCache->get(md5('features:'.$featureName.$isGadgetContext)))) {
return $featureContent;
@@ -87,7 +87,7 @@ class GadgetFeatureRegistry {
break;
}
}
- if (Config::get('compress_javascript')) {
+ if (Config::get('compress_javascript') && ! isset($_GET['debug'])) {
$ret = JsMin::minify($ret);
$featureCache->set(md5('features:'.$featureName.$isGadgetContext), $ret);
}
Modified: shindig/trunk/php/src/gadgets/GadgetSpecParser.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/gadgets/GadgetSpecParser.php?rev=1029982&r1=1029981&r2=1029982&view=diff
==============================================================================
--- shindig/trunk/php/src/gadgets/GadgetSpecParser.php (original)
+++ shindig/trunk/php/src/gadgets/GadgetSpecParser.php Tue Nov 2 09:41:14 2010
@@ -34,11 +34,13 @@ class GadgetSpecParser {
* @param string $xmlContent
*/
public function parse($xmlContent, GadgetContext $context) {
+ $this->context = $context;
libxml_use_internal_errors(true);
$doc = new DOMDocument();
if (! $doc->loadXML($xmlContent, LIBXML_NOCDATA)) {
throw new GadgetSpecException("Error parsing gadget xml:\n" . XmlError::getErrors($xmlContent));
}
+
//TODO: we could do a XSD schema validation here, but both the schema and most of the gadgets seem to have some form of schema
// violatons, so it's not really practical yet (and slow)
// $doc->schemaValidate('gadget.xsd');
@@ -190,6 +192,18 @@ class GadgetSpecParser {
$this->parsePreloads($modulePrefs, $gadget);
$this->parseLocales($modulePrefs, $gadget);
$this->parseOAuth($modulePrefs, $gadget);
+ $this->parseContainerSpecific($modulePrefs, $gadget);
+ }
+
+ /**
+ * Parses optional container specific moduleprefs
+ * override if needed
+ *
+ * @param DOMElement $modulePrefs
+ * @param Gadget $gadget
+ */
+ protected function parseContainerSpecific(DOMElement &$modulePrefs, GadgetSpec &$gadget) {
+
}
/**
Modified: shindig/trunk/php/src/gadgets/oauth/OAuthFetcher.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/gadgets/oauth/OAuthFetcher.php?rev=1029982&r1=1029981&r2=1029982&view=diff
==============================================================================
--- shindig/trunk/php/src/gadgets/oauth/OAuthFetcher.php (original)
+++ shindig/trunk/php/src/gadgets/oauth/OAuthFetcher.php Tue Nov 2 09:41:14 2010
@@ -19,7 +19,7 @@
*/
// For TokenInfo
-require 'src/gadgets/oauth/OAuthStore.php';
+require_once 'src/gadgets/oauth/OAuthStore.php';
/**
* Implements the OAuth dance (http://oauth.net/core/1.0/) for gadgets.