Skip to content

Instantly share code, notes, and snippets.

@co3k
Created October 24, 2011 11:35
Show Gist options
  • Save co3k/1308826 to your computer and use it in GitHub Desktop.
Save co3k/1308826 to your computer and use it in GitHub Desktop.
op3 performance
diff --git a/lib/model/doctrine/SnsConfig.class.php b/lib/model/doctrine/SnsConfig.class.php
index 49a8163..dfe5f64 100644
--- a/lib/model/doctrine/SnsConfig.class.php
+++ b/lib/model/doctrine/SnsConfig.class.php
@@ -10,20 +10,23 @@
class SnsConfig extends BaseSnsConfig
{
- protected $snsConfigSettings = array();
+ protected static $snsConfigSettings = array();
public function construct()
{
- $this->snsConfigSettings = sfConfig::get('openpne_sns_config');
+ if (!self::$snsConfigSettings) {
+ self::$snsConfigSettings = sfConfig::get('openpne_sns_config');
+ }
+
return parent::construct();
}
public function getConfig()
{
$name = $this->getName();
- if ($name && isset($this->snsConfigSettings[$name]))
+ if ($name && isset(self::$snsConfigSettings[$name]))
{
- return $this->snsConfigSettings[$name];
+ return self::$snsConfigSettings[$name];
}
return false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment