Merge branch '2.1.x' into devel

This commit is contained in:
Martin Konecny 2012-08-08 00:09:13 -04:00
commit f33485f8ea
5 changed files with 99 additions and 10 deletions

View file

@ -5,11 +5,12 @@ class Logging {
private static $_logger;
private static $_path;
public static function getLogger(){
public static function getLogger()
{
if (!isset(self::$_logger)) {
$writer = new Zend_Log_Writer_Stream(self::$_path);
if (Zend_Version::compareVersion("1.11") > 0){
if (Zend_Version::compareVersion("1.11") > 0) {
//Running Zend version 1.10 or lower. Need to instantiate our
//own Zend Log class with backported code from 1.11.
require_once __DIR__."/AirtimeLog.php";
@ -22,33 +23,50 @@ class Logging {
return self::$_logger;
}
public static function setLogPath($path){
public static function setLogPath($path)
{
self::$_path = $path;
}
public static function toString($p_msg){
if (is_array($p_msg) || is_object($p_msg)){
public static function toString($p_msg)
{
if (is_array($p_msg) || is_object($p_msg)) {
return print_r($p_msg, true);
} else {
return $p_msg;
}
}
public static function log($p_msg){
public static function log($p_msg)
{
$bt = debug_backtrace();
$caller = array_shift($bt);
$file = basename($caller['file']);
$line = $caller['line'];
$caller = array_shift($bt);
$function = $caller['function'];
$logger = self::getLogger();
$logger->info(self::toString($p_msg)." - file:".$caller['file'].":".$caller['line']);
$logger->info("[$file : $function() : line $line] - ".self::toString($p_msg));
}
public static function debug($p_msg){
public static function debug($p_msg)
{
$bt = debug_backtrace();
$caller = array_shift($bt);
$file = basename($caller['file']);
$line = $caller['line'];
if (defined('APPLICATION_ENV') && APPLICATION_ENV == "development"){
$caller = array_shift($bt);
$function = $caller['function'];
if (defined('APPLICATION_ENV') && APPLICATION_ENV == "development") {
$logger = self::getLogger();
$logger->debug(self::toString($p_msg)." - file:".$caller['file'].":".$caller['line']);
$logger->debug("[$file : $function() : line $line] - ".self::toString($p_msg));
}
}
}

View file

@ -1646,6 +1646,15 @@ class Application_Model_Show
} elseif ($p_editable && $nowEpoch < $endsEpoch) {
$options["editable"] = true;
}
$showInstance = new Application_Model_ShowInstance($show["instance_id"]);
$showContent = $showInstance->getShowListContent();
if (empty($showContent)) {
$options["show_empty"] = 1;
} else {
$options["show_empty"] = 0;
}
$events[] = &self::makeFullCalendarEvent($show, $options, $startsDT, $endsDT, $startsEpochStr, $endsEpochStr);
}