[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [websites/paste-kde-org/dev-1.0] app/models: Fix the package build
From: Sayak Banerjee <sayakb () kde ! org>
Date: 2013-09-02 8:36:14
Message-ID: E1VGPcM-0004ga-Mf () scm ! kde ! org
[Download RAW message or body]
Git commit 48982d13f81ca2e2c39a64b05eff03cf95d42b47 by Sayak Banerjee.
Committed on 02/09/2013 at 08:36.
Pushed by sayakb into branch 'dev-1.0'.
Fix the package build
M +9 -7 app/models/Site.php
http://commits.kde.org/websites/paste-kde-org/48982d13f81ca2e2c39a64b05eff03cf95d42b47
diff --git a/app/models/Site.php b/app/models/Site.php
index 8fb56af..70ac3ab 100755
--- a/app/models/Site.php
+++ b/app/models/Site.php
@@ -89,17 +89,19 @@ class Site extends Eloquent {
// We try to access the site config table here, but it may
// fail due to many reasons, one of them being a bad connection
- // or script execution from CLI. If it fails, we just return
- // the default values
+ // If it fails, we just return the default values
try
{
- $siteConfig = static::where('group', $group)->get();
-
- if ( ! is_null($siteConfig))
+ if (php_sapi_name() != 'cli')
{
- foreach ($siteConfig as $item)
+ $siteConfig = static::where('group', $group)->get();
+
+ if ( ! is_null($siteConfig))
{
- $config[$group]->$item['key'] = $item['value'];
+ foreach ($siteConfig as $item)
+ {
+ $config[$group]->$item['key'] = $item['value'];
+ }
}
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic