当前位置: 首页>>代码示例>>PHP>>正文


PHP Settings::getDebug方法代码示例

本文整理汇总了PHP中Settings::getDebug方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::getDebug方法的具体用法?PHP Settings::getDebug怎么用?PHP Settings::getDebug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Settings的用法示例。


在下文中一共展示了Settings::getDebug方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action

function action($pAction, $pArgs = null)
{
    global $lDreamBoxObj, $gDebugObj, $gSetupObj, $gUpdateObj;
    $pAction = trim($pAction);
    if ($pAction == "") {
        return false;
    }
    if (!is_array($pArgs)) {
        $pArgs = explode(",", $pArgs);
    }
    $lReturnValue = new xajaxResponse();
    switch ($pAction) {
        case 'initRestream':
            if ($gSetupObj->configOutDated()) {
                $lReturnValue->script("loadChannelList()");
                $lReturnValue->script("jQuery('#ProgramProgress').progressbar({value: 0})");
                $lReturnValue->script("jQuery('#message').html('<p>' + jQuery('#ReStreamPlayer p').html() + '</p>')");
            } else {
                // Clear the session cache
                if (Settings::getDebug()) {
                    @unlink('dreambox.cache');
                    unset($_SESSION["ReStream2.0"]["Dreambox"]);
                }
                if (($lMessage = $lDreamBoxObj->sanityCheck()) !== true) {
                    $lReturnValue->script("DreamboxObj.dialog('Loading dreambox<br /><span class=\"error\">Your PHP settings are not correct to work... Change the following setting(s):<br />" . $lMessage . "</span>')");
                } else {
                    if ($lDreamBoxObj->isOnline()) {
                        $lReturnValue->script("DreamboxObj.dialog('Loading dreambox<br />Loading bouquets....')");
                        $lReturnValue->script('DreamboxObj.loadBouquets()');
                    } else {
                        $lReturnValue->script("DreamboxObj.dialog('Loading dreambox<br /><span class=\"error\">The Dreambox is currently offline!</span>')");
                        $lReturnValue->script('DreamboxObj.showBouquets()');
                        $lReturnValue->script("setTimeout(function() { DreamboxObj.loadMovies() } , 2000)");
                    }
                }
            }
            break;
        case 'loadBouqetData':
            $lDreamBoxObj->loadBouquets();
            foreach ($lDreamBoxObj->getBouquets() as $lBouquet) {
                $lReturnValue->script("DreamboxObj.addBouquet('" . Utils::JSSave($lBouquet->getID()) . "','" . Utils::JSSave($lBouquet->getName()) . "')");
            }
            $lReturnValue->script('DreamboxObj.showBouquets()');
            $lReturnValue->script("jQuery('h3[id=\"_about\"] ~ div ul').append(jQuery('<li>').attr({'class':'about'}).html('" . Utils::JSSave("<img src='images/dreamboxrestream_icon.png' alt='Dreambox ReStream Logo' width='114' height='114'/><br /><br />" . Settings::getDreamboxName() . "<br />Dreambox ReStream (" . Settings::getVersionNumber() . ")<br />Released at " . date('j F Y', RELEASEDATE) . "<br /><a href=\"javascript:void(0);\" onclick=\"showChangeLog();\" title=\"Read changelog\">CHANGELOG</a><br /><a href=\"?setup=1\" title=\"Click to enter the setup page\" >Setup</a>, <a href=\"?cachepurge=1\" title=\"Purge the cache and reload the data\">Purge</a><br /><br />Desktop interface<br /><br />Copyright 2006-" . date("Y") . " - <a href='http://theyosh.nl' class='external' target='_blank' title='The YOSH'>TheYOSH</a><br /><br />Like the software?<br />Consider a donation<br /><form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_blank\">\n<input type=\"hidden\" name=\"cmd\" value=\"_donations\">\n<input type=\"hidden\" name=\"business\" value=\"paypal@theyosh.nl\">\n<input type=\"hidden\" name=\"lc\" value=\"US\">\n<input type=\"hidden\" name=\"item_name\" value=\"Dreambox ReStream\">\n<input type=\"hidden\" name=\"no_note\" value=\"0\">\n<input type=\"hidden\" name=\"currency_code\" value=\"EUR\">\n<input type=\"hidden\" name=\"bn\" value=\"PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest\">\n<input type=\"image\" src=\"https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">\n<img alt=\"\" border=\"0\" src=\"https://www.paypalobjects.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">\n</form>") . "'))");
            $lReturnValue->script("DreamboxObj.dialog('Loading dreambox<br />Loading bouquets.... done!<br />Loading channels....')");
            $lReturnValue->script('DreamboxObj.loadChannels()');
            $lReturnValue->script('DreamboxObj.loadRecordings()');
            break;
        case 'loadChannelData':
            if (substr($pArgs[0], 0, 1) != '_') {
                $lDreamBoxObj->loadChannel($pArgs[0]);
                $lBouquetObj = $lDreamBoxObj->getBouquet($pArgs[0]);
                if ($lBouquetObj !== false) {
                    foreach ($lBouquetObj->getChannels() as $lChannelObj) {
                        $lReturnValue->script("DreamboxObj.addChannel('" . Utils::JSSave($lChannelObj->getID()) . "','" . Utils::JSSave($lBouquetObj->getID()) . "','" . Utils::JSSave($lChannelObj->getName()) . "','" . ($lChannelObj->isMarker() ? 'marker' : 'channel') . "'," . ($lChannelObj->isHD() ? 'true' : 'false') . ")");
                    }
                    if ($lBouquetObj->getChannelCount() == 0) {
                        $lReturnValue->script("DreamboxObj.removeBouquet('" . Utils::JSSave($lBouquetObj->getID()) . "')");
                    } else {
                        $lReturnValue->script("DreamboxObj.showChannels('" . Utils::JSSave($lBouquetObj->getID()) . "')");
                    }
                }
            }
            $lReturnValue->script('DreamboxObj.loadChannels()');
            break;
        case 'loadRecordingData':
            $lDreamBoxObj->loadRecordings();
            foreach ($lDreamBoxObj->getRecordings() as $lRecording) {
                $lReturnValue->script("DreamboxObj.addRecording('" . Utils::JSSave($lRecording->getID()) . "','" . Utils::JSSave($lRecording->getName()) . "'," . Utils::JSSave($lRecording->getStartTime()) . ",'" . Utils::JSSave($lRecording->getServiceName()) . "'," . Utils::JSSave($lRecording->getDuration()) . ",'" . Utils::JSSave($lRecording->getDescription()) . "','" . Utils::JSSave($lRecording->getLongDescription()) . "'," . Utils::JSSave($lRecording->getFileSize()) . ")");
            }
            $lReturnValue->script('DreamboxObj.showRecordings()');
            $lReturnValue->script("DreamboxObj.dialog('Loading dreambox<br />Loading bouquets.... done!<br />Loading channels.... done!<br />Loading recordings.... done!<br />Loading movies....')");
            $lReturnValue->script('DreamboxObj.loadMovies()');
            break;
        case 'loadMovieData':
            $lDreamBoxObj->loadMovies();
            foreach ($lDreamBoxObj->getMovies() as $lMovie) {
                $lReturnValue->script("DreamboxObj.addMovie('" . Utils::JSSave($lMovie->getID()) . "','" . Utils::JSSave($lMovie->getName()) . "'," . $lMovie->getDuration() . "," . $lMovie->getFileSize() . "," . $lMovie->getBitrate() . ",'" . $lMovie->getResolution() . "',new Array('" . implode($lMovie->getAvailableSubtitleLanguages(), "','") . "')," . ($lMovie->isHD() ? 'true' : 'false') . ")");
            }
            $lReturnValue->script('DreamboxObj.showMovies()');
            $lReturnValue->script("DreamboxObj.dialog('Loading dreambox<br />Loading bouquets.... done!<br />Loading channels.... done!<br />Loading recordings.... done!<br />Loading movies.... done!')");
            $lReturnValue->script('DreamboxObj.start()');
            break;
        case 'loadWebCamsData':
            $lDreamBoxObj->loadWebCams();
            foreach ($lDreamBoxObj->getWebCams() as $lWebCam) {
                $lReturnValue->script("DreamboxObj.addWebCam('" . Utils::JSSave($lMovie->getID()) . "','" . Utils::JSSave($lMovie->getName()) . "')");
            }
            $lReturnValue->script('DreamboxObj.showWebCams()');
            $lReturnValue->script("DreamboxObj.dialog('Loading dreambox<br />Loading bouquets.... done!<br />Loading channels.... done!<br />Loading recordings.... done!<br />Loading movies.... done!<br />Loading webcams.... done!')");
            $lReturnValue->script('DreamboxObj.start()');
            break;
        case 'loadNowAndNextEPGData':
            $lBouquetID = $pArgs[0];
            foreach ($lDreamBoxObj->getBouquets() as $lBouquet) {
                if ($lBouquetID == $lBouquet->getID() && $lBouquet->getChannels() > 0) {
                    $lDreamBoxObj->loadCurrentAndNextEPG($lBouquetID);
                    foreach ($lBouquet->getChannels() as $lChannel) {
                        $lGuide = $lDreamBoxObj->getProgramGuide($lChannel->getID());
                        if ($lGuide !== false) {
//.........这里部分代码省略.........
开发者ID:theyosh,项目名称:DreamboxReStream,代码行数:101,代码来源:Ajax.class.php

示例2: setIphoneStream

 public function setIphoneStream($pChannelObj)
 {
     global $gDebugObj;
     if ($pChannelObj->isHD()) {
         // Only allow one bitrate when the source is HD
         $this->lActiveProfiles = array(Settings::getHDOnlyProfile());
     }
     if (Settings::getDebug()) {
         $gDebugObj->setDebugMessage('setIphoneStream', "Start checking for iOS playlists... Amount of profiles: " . count($this->lActiveProfiles));
     }
     for ($i = 0; $i < 30; $i++) {
         $lMultiBitrate = "#EXTM3U\n";
         $lProfilesCounter = 0;
         if (Settings::getDebug()) {
             $gDebugObj->setDebugMessage('setIphoneStream', "Checking profile: " . $lProfilesCounter);
         }
         foreach ($this->lProfiles as $lProfileName => $lProfile) {
             if (!in_array($lProfileName, $this->lActiveProfiles)) {
                 continue;
             }
             if (file_exists($this->liPhoneDir . "/iphone/stream/" . $this->vlcStreamUrlFormat($pChannelObj->getName()) . "_" . $lProfileName . ".m3u8")) {
                 $lMultiBitrate .= "#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=" . round(($lProfile["videobitrate"] + $lProfile["audiobitrate"]) * 1024) . ",RESOLUTION=" . $lProfile["width"] . "x" . $lProfile["height"] . "\n";
                 $lMultiBitrate .= $this->vlcStreamUrlFormat($pChannelObj->getName()) . "_" . $lProfileName . ".m3u8\n";
                 $lProfilesCounter++;
             }
         }
         if (Settings::getDebug()) {
             $gDebugObj->setDebugMessage('setIphoneStream', "After {$i} seconds, amount of profiles done: " . $lProfilesCounter);
         }
         if ($lProfilesCounter == count($this->lActiveProfiles)) {
             file_put_contents($this->liPhoneDir . "/iphone/stream/" . $this->vlcStreamUrlFormat($pChannelObj->getName()) . ".m3u8", $lMultiBitrate);
             // Assumption is that we have now all the playlists with at least one chunk. That is in theory enough to start.
             // In pactical, it needs more time for sure. Wait for at least another chunk is created
             sleep($this->lSegmentLength);
             break;
         } else {
             sleep(1);
         }
     }
 }
开发者ID:theyosh,项目名称:DreamboxReStream,代码行数:40,代码来源:VLCServer.class.php

示例3: getStreamURL

 public function getStreamURL($pChannelID)
 {
     global $gDebugObj;
     if (Settings::getMoviesPath() != "" && substr($pChannelID, 0, strlen(Settings::getMoviesPath())) == Settings::getMoviesPath()) {
         $lStreamUrl = $pChannelID;
     } else {
         switch ($this->lType) {
             case "enigma1":
                 if (substr($pChannelID, -2) == "ts") {
                     # Recording
                     $lRecording = explode(":", $pChannelID);
                     $lStreamUrl = "http://" . $this->getAuthentication() . $this->lIPNumber . ":" . $this->lPortNumber . $this->dreamboxStreamUrlFormat($lRecording[10]);
                 } else {
                     //Zap first
                     $lZapUrl = "http://" . $this->getAuthentication() . $this->lIPNumber . ":" . $this->lPortNumber . "/cgi-bin/zapTo?path=" . $pChannelID . "&curBouquet=0&curChannel=0";
                     if (Settings::getDebug()) {
                         $gDebugObj->setDebugMessage('getStreamURL', "VLC ZAP Enigma1 Url: '" . $lZapUrl . "'");
                     }
                     @file_get_contents($lZapUrl);
                     sleep(1);
                     // Wait for the dreambox to change channel
                     $lStreamUrl = "http://" . $this->getAuthentication() . $this->lIPNumber . ":" . $this->lPortNumber . "/video.m3u";
                     if (Settings::getDebug()) {
                         $gDebugObj->setDebugMessage('getStreamURL', "VLC Final Enigma1 Url: '" . $lStreamUrl . "'");
                     }
                 }
                 break;
             case "enigma2":
                 if (!Settings::isDualTuner()) {
                     $lZapUrl = "http://" . $this->getAuthentication() . $this->lIPNumber . ":" . $this->lPortNumber . "/web/zap?sRef=" . $pChannelID;
                     if (Settings::getDebug()) {
                         $gDebugObj->setDebugMessage('getStreamURL', "VLC ZAP Enigma2 Url: '" . $lZapUrl . "'");
                     }
                     @file_get_contents($lZapUrl);
                 }
                 if (substr($pChannelID, -3) == ".ts") {
                     $pChannelID = substr($pChannelID, stripos($pChannelID, "/"));
                     // This code will fix the authentication issue with downloads. Due to a redirect, the authentication is lost.
                     // So parse the content, and rebuild the url with authentication on it.
                     $recording_playlist = file_get_contents("http://" . $this->getAuthentication() . $this->lIPNumber . ":" . $this->lPortNumber . "/web/ts.m3u?file=" . $this->dreamboxStreamUrlFormat($pChannelID));
                     $recording_url = $this->m3u_parser($recording_playlist);
                     if ($recording_url !== false) {
                         $recording_url = parse_url($recording_url);
                         $recording_url = (!empty($recording_url['scheme']) ? $recording_url['scheme'] : 'http') . '://' . $this->getAuthentication() . $recording_url['host'] . ':' . $recording_url['port'] . $recording_url['path'] . '?' . $recording_url['query'];
                     } else {
                         // Failback backup.... should not be needed...
                         $recording_url = "http://" . $this->getAuthentication() . $this->lIPNumber . ":" . $this->lPortNumber . "/file?file=" . $this->dreamboxStreamUrlFormat($pChannelID);
                     }
                     $lStreamUrl = $recording_url;
                 } else {
                     $lStreamUrl = "http://" . $this->getAuthentication() . $this->lIPNumber . ":" . $this->lPortNumber . "/web/stream.m3u?ref=" . $pChannelID . '&name=zap';
                 }
                 if (Settings::getDebug()) {
                     $gDebugObj->setDebugMessage('getStreamURL', "VLC Final Enigma2 Url: '" . $lStreamUrl . "'");
                 }
                 break;
         }
     }
     return $lStreamUrl;
 }
开发者ID:theyosh,项目名称:DreamboxReStream,代码行数:60,代码来源:Dreambox.class.php

示例4: Dreambox

    // Dreambox part
    require_once "Dreambox.class.php";
    require_once "Bouquet.class.php";
    require_once "Channel.class.php";
    require_once "ProgramGuide.class.php";
    require_once "Program.class.php";
    require_once "Recording.class.php";
    require_once "MediaInfo.class.php";
    require_once "Movie.class.php";
    // Server part
    require_once "VLCServer.class.php";
    $lDreamBoxObj = new Dreambox();
}
require "xajax/xajax_core/xajax.inc.php";
$xajax = new xajax();
if (!$gSetupObj->configOutDated() && Settings::getDebug()) {
    $xajax->configure('debug', true);
}
$xajax->configure('javascript URI', 'xajax');
$xajax->register(XAJAX_FUNCTION, 'action');
$xajax->processRequest();
if (!$gSetupObj->configOutDated()) {
    $lDreamBoxObj->isOnline();
    if (Utils::isMobileDevice() || isset($_GET["mobile"]) && $_GET["mobile"] == 1) {
        require_once "index-mobile.php";
        exit;
    }
}
?>
<!DOCTYPE html>
<html>
开发者ID:theyosh,项目名称:DreamboxReStream,代码行数:31,代码来源:index.php


注:本文中的Settings::getDebug方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。