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


PHP ConnectionFactory::getDataConnection方法代码示例

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


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

示例1: dispatch

 public function dispatch()
 {
     $connection = ConnectionFactory::getDataConnection();
     $bookmarks = $connection->getBookmarks();
     $template = new BookmarksTemplate($bookmarks, "Bookmarks");
     $template->showTemplate();
 }
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:7,代码来源:ViewBookmarksPageAction.php

示例2: parseFavouriteSites

 /**
  * Retrieve favourite sites and fill data in template.
  */
 private function parseFavouriteSites($template)
 {
     try {
         $connection = ConnectionFactory::getDataConnection();
         $favourites = $connection->getWebsiteFavourites();
         foreach ($favourites as $id => $favourite) {
             $name = $favourite->getName();
             $link = SERVER_HOST_AND_PATH . "php/scraper" . $favourite->getLink();
             switch ($favourite->getType()) {
                 case "movie":
                     $template->setFavouriteMovieWebsite(array($name, $link));
                     break;
                 case "serie":
                     $template->setFavouriteSerieWebsite(array($name, $link));
                     break;
                 case "documentary":
                     $template->setFavouriteDocumentaryWebsite(array($name, $link));
                     break;
                 case "anime":
                     $template->setFavouriteAnimeWebsite(array($name, $link));
                     break;
             }
         }
     } catch (Exception $e) {
         //Ignored exception
     }
 }
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:30,代码来源:ViewHomePageAction.php

示例3: dispatch

 public function dispatch()
 {
     $connection = ConnectionFactory::getDataConnection();
     $scrapers = $connection->getScrapers();
     if ($scrapers) {
         $template = new WebsitesTemplate($scrapers, "..:: Xtreamer Video on Demand ::....:: xVoD ::..");
         //Check for type filter
         if (isset($_GET["type"])) {
             $template->setShowType($_GET["type"]);
         }
         $template->showTemplate();
     } else {
     }
 }
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:14,代码来源:ViewWebsitesPageAction.php

示例4: dispatch

 public function dispatch()
 {
     if (isset($_GET["data"])) {
         //Save
         $bookmarkId = $_GET["data"];
         $connection = ConnectionFactory::getDataConnection();
         if ($connection->deleteBookmark($bookmarkId)) {
             echo "OK";
         } else {
             echo "ERROR";
         }
     } else {
         echo "ERROR";
     }
 }
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:15,代码来源:DeleteBookmarkAction.php

示例5: dispatch

 public function dispatch()
 {
     $subaction = $_GET["subaction"];
     switch ($subaction) {
         case ViewFavouritePageAction::SUBACTION_FAVOURITE_DELETE:
             //--------------------------------
             if (isset($_GET["id"])) {
                 $connection = ConnectionFactory::getDataConnection();
                 $connection->deleteBookmark($_GET["id"]);
             }
             break;
     }
     //Show default template
     $template = new FavouriteWebTemplate();
     $connection = ConnectionFactory::getDataConnection();
     $bookmarks = $connection->getBookmarks();
     $template->setFavourites($bookmarks);
     $template->show();
 }
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:19,代码来源:ViewFavouritePageAction.php

示例6: dispatch

 public function dispatch()
 {
     if (isset($_GET["id"])) {
         //Save
         $websiteId = $_GET["id"];
         $connection = ConnectionFactory::getDataConnection();
         $website = $connection->getScraperById($websiteId);
         if ($website) {
             $type = $website->getType();
             if ($website->getType() == "mixed") {
                 $type = "movie";
             }
             var_dump($website);
             $connection->addWebsiteFavourite($website->getId(), $type, $website->getName(), $website->getLink());
             echo "OK";
         } else {
             echo "ERROR";
         }
     } else {
         echo "ERROR";
     }
 }
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:22,代码来源:SaveFavouriteWebsiteAction.php

示例7: dispatch

 public function dispatch()
 {
     if (isset($_GET["data"])) {
         //Save
         $data = explode("-", $_GET["data"]);
         $title = base64_decode($data[0]);
         $link = base64_decode($data[1]);
         $link = substr($link, strpos($link, "xVoD") + 5);
         $image = base64_decode($data[2]);
         if ($title && $link) {
             $connection = ConnectionFactory::getDataConnection();
             if ($connection->getBookmarkByLink($link) == null) {
                 $connection->addBookmark($title, $description, $link, $image);
             }
             echo "OK";
         } else {
             echo "ERROR";
         }
     } else {
         echo "ERROR";
     }
 }
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:22,代码来源:SaveBookmarkAction.php

示例8: rename

<?php

$oldDB = "data/db/xvod.sqlite3.db";
$newDB = "data/db/xvod.sqlite3.new.db";
$configFile = "config/config.php";
if (file_exists($oldDB) && file_exists($newDB)) {
    //Get connection
    $connection = ConnectionFactory::getDataConnection();
    //Get user bookmarks
    $bookmarks = $connection->getBookmarks();
    //Delete old db and change new one
    rename($oldDB, "data/db/xvod.sqlite3.old.db");
    rename($newDB, $oldDB);
    //Connection to new database
    $connection = ConnectionFactory::getDataConnection();
    foreach ($bookmarks as $id => $bookmark) {
        $connection->addBookmark($bookmark->getName(), $bookmark->getDescription(), $bookmark->getLink(), $bookmark->getImage());
    }
    //Set updated
    $lines = file($configFile);
    $out = "";
    foreach ($lines as $line) {
        if (strpos($line, "UPDATE_DB")) {
            $change = strstr($line, "true") ? true : false;
            $line = str_replace($change ? "true" : "false", !$change ? "true" : "false", $line);
        }
        $out .= $line;
    }
    $f = fopen($configFile, "w");
    fwrite($f, $out);
    fclose($f);
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:31,代码来源:update.php

示例9: showHeader


//.........这里部分代码省略.........
                    if ( focusidx == getItemInfo(-1,"itemid") ){
                        "255:192:192";
                    }else{
                        "32:32:32";
                    }
                </script>
            </backgroundColor>
        </text>
        <text redraw="yes" offsetXPC="1" offsetYPC="1" widthPC="1" heightPC="6" backgroundColor="0:0:0">
        </text>
        <text redraw="yes" offsetXPC="98" offsetYPC="1" widthPC="1" heightPC="6" backgroundColor="0:0:0">
        </text>
        <text redraw="yes" offsetXPC="1" offsetYPC="93" widthPC="1" heightPC="6" backgroundColor="0:0:0">
        </text>
        <text redraw="yes" offsetXPC="98" offsetYPC="93" widthPC="1" heightPC="6" backgroundColor="0:0:0">
        </text>
        <text redraw="yes" offsetXPC="36" offsetYPC="0" widthPC="60" heightPC="100" fontSize="12" lines="1"
              backgroundColor="-1:-1:-1" foregroundColor="255:255:255">
            <script>
                getItemInfo(-1,"title");
            </script>
            <foregroundColor>
                <script>
                    if ( focusidx == getItemInfo(-1,"itemid") ){
                        "0:0:0";
                    }else{
                        "255:255:255";
                    }
                </script>
            </foregroundColor>
        </text>
        <!-- ITEM FAVOURITE ICON -->
                <?php 
        $connection = ConnectionFactory::getDataConnection();
        $websites = $connection->getWebsiteFavourites();
        foreach ($websites as $id => $favourite) {
            switch ($favourite->getType()) {
                case "movie":
                    $movie = $id;
                    break;
                case "serie":
                    $serie = $id;
                    break;
                case "documentary":
                    $documentary = $id;
                    break;
                case "anime":
                    $anime = $id;
                    break;
            }
        }
        $condition = '( getItemInfo(-1,"scraperid") == "' . $movie . '" ) || ' . '( getItemInfo(-1,"scraperid") == "' . $serie . '" ) || ' . '( getItemInfo(-1,"scraperid") == "' . $documentary . '" ) || ' . '( getItemInfo(-1,"scraperid") == "' . $anime . '" )';
        ?>
        <image redraw="no" offsetXPC="2" offsetYPC="4" widthPC="8" heightPC="92">
            <script>
                if( <?php 
        echo $condition;
        ?>
 )
                "<?php 
        echo XTREAMER_IMAGE_PATH;
        ?>
img/star.png";
                else
                    "";
            </script>
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:67,代码来源:WebsitesTemplate.php

示例10: getFavouriteScrapers

 /**
  * Get scrapers marked as favourites to show it on first xVoD screen.
  * @return array Scrapers mark as favourites.
  */
 private function getFavouriteScrapers($forceLoad)
 {
     if (!$forceLoad && isset($_SESSION["webScrapersFavourites"])) {
         $favourites = unserialize($_SESSION["webScrapersFavourites"]);
     } else {
         $connection = ConnectionFactory::getDataConnection();
         $favourites = $connection->getWebsiteFavourites();
         $_SESSION["webScrapersFavourites"] = serialize($favourites);
     }
     return $favourites;
 }
开发者ID:johnymarek,项目名称:eboda-hd-for-all-500,代码行数:15,代码来源:ViewScraperPageAction.php


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