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


PHP kConf::getDB方法代码示例

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


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

示例1: init

 public function init($ignore, array $params)
 {
     $this->ignoreErrors = $ignore;
     $dbConf = kConf::getDB();
     $dsn = $dbConf['datasources']['propel']['connection']['dsn'];
     $dsn = explode(":", $dsn);
     $dsnArray = explode(";", $dsn[1]);
     // init with default port
     $this->dbParams = $dbConf['datasources']['propel']['connection'];
     $this->dbParams['port'] = '3306';
     foreach ($dsnArray as $param) {
         $items = explode("=", $param);
         if (count($items) == 2) {
             $this->dbParams[$items[0]] = $items[1];
         }
     }
     foreach ($params as $key => $value) {
         $this->dbParams[$key] = $value;
     }
     foreach ($this->dbParams as $key => $value) {
         echo $key . ' => ';
         if (is_array($value)) {
             var_dump($value);
         } else {
             echo "{$value}\n";
         }
     }
     $this->version = $this->getMaxVersion() + 1;
     $this->alreadyRun = $this->getDeployedScripts();
 }
开发者ID:DBezemer,项目名称:server,代码行数:30,代码来源:update.php

示例2: getConnection

 /**
  * @param string $name
  * @return PDO
  */
 public static function getConnection($name)
 {
     if (!Propel::isInit()) {
         DbManager::setConfig(kConf::getDB());
         DbManager::initialize();
     }
     return Propel::getConnection($name);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:12,代码来源:myDbHelper.class.php

示例3: __construct

 private function __construct($partnerId)
 {
     DbManager::setConfig(kConf::getDB());
     DbManager::initialize();
     $this->confPath = KALTURA_ROOT_PATH . '/configurations/wams/';
     $partner = PartnerPeer::retrieveByPK($partnerId);
     $wams_account_name = $partner->getWamsAccountName();
     $wams_access_key = $partner->getWamsAccountKey();
     self::testConnection($wams_account_name, $wams_access_key);
     $this->_mediaServiceProxy = ServicesBuilder::getInstance()->createMediaServicesService(new MediaServicesSettings($wams_account_name, $wams_access_key));
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:11,代码来源:kWAMS.php

示例4: __construct

 /**
  * @param string $srcWAMSAssetId
  * @param string $targetPath
  */
 public function __construct($srcWAMSAssetId, $targetPath)
 {
     KalturaLog::debug("Creation instance of KWAMSThumbnailMaker srcWAMSAssetId = [{$srcWAMSAssetId}] targetPath = [{$targetPath}]");
     $this->srcWAMSAssetId = $srcWAMSAssetId;
     $this->targetPath = $targetPath;
     DbManager::setConfig(kConf::getDB());
     DbManager::initialize();
     $fileSync = FileSyncPeer::retrieveByWamsAssetId($srcWAMSAssetId);
     if (!empty($fileSync)) {
         $this->partnerId = $fileSync->getPartnerId();
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:16,代码来源:KWAMSThumbnailMaker.php

示例5: initPdo

 protected function initPdo()
 {
     if (is_null($this->_pdo)) {
         $dbConfig = kConf::get("reports_db_config");
         $host = $dbConfig["host"];
         $port = $dbConfig["port"];
         $user = $dbConfig["user"];
         $password = $dbConfig["password"];
         $dbName = $dbConfig["db_name"];
         $db = kConf::getDB();
         $this->_pdo = new PDO("mysql:host={$host};dbname={$dbName};", $user, $password);
         $this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     }
 }
开发者ID:kubrickfr,项目名称:server,代码行数:14,代码来源:kReportManager.php

示例6: getConnection

 /**
  * @param string $name
  * @return PDO
  */
 public static function getConnection($name)
 {
     if (!Propel::isInit()) {
         DbManager::setConfig(kConf::getDB());
         DbManager::initialize();
     }
     $slaves = array(self::DB_HELPER_CONN_PROPEL2, self::DB_HELPER_CONN_PROPEL3);
     if (!in_array($name, $slaves)) {
         return Propel::getConnection($name);
     }
     list($connection, $connIndex) = DbManager::connectFallbackLogic(array('Propel', 'getConnection'), array(), $slaves);
     if (!$connection) {
         throw new PropelException('Could not connect to any database server');
     }
     return $connection;
 }
开发者ID:DBezemer,项目名称:server,代码行数:20,代码来源:myDbHelper.class.php

示例7: __construct

 /**
  * Creates instance of class and initializes properties
  * @param string $type
  * @param string $filePath
  * @param KSchedularTaskConfig $taskConfig
  */
 public function __construct($type, $filePath, KSchedularTaskConfig $taskConfig, KalturaBatchJob $job, $wamsAssetId)
 {
     $this->wamsAssetId = $wamsAssetId;
     $this->filePath = $filePath;
     $this->mediaInfoParser = parent::getParser($type, $filePath, $taskConfig, $job);
     $this->partnerId = $job->partnerId;
     DbManager::setConfig(kConf::getDB());
     DbManager::initialize();
     $fileSync = FileSyncPeer::retrieveByWamsAssetId($this->wamsAssetId);
     if ($fileSync) {
         $flavorAsset = kFileSyncUtils::retrieveObjectForFileSync($fileSync);
         if ($flavorAsset instanceof asset) {
             $this->originalMediaInfo = mediaInfoPeer::retrieveOriginalByEntryId($flavorAsset->getEntryId());
             $entry = $flavorAsset->getentry();
             if ($entry) {
                 $this->mediaType = $entry->getMediaType();
             }
         }
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:26,代码来源:KWAMSMediaInfoParser.php

示例8: __construct

 public function __construct($feedId)
 {
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL3;
     $microTimeStart = microtime(true);
     KalturaLog::info("syndicationFeedRenderer- initialize ");
     // initialize the database for all services
     DbManager::setConfig(kConf::getDB());
     DbManager::initialize();
     $syndicationFeedDB = syndicationFeedPeer::retrieveByPK($feedId);
     if (!$syndicationFeedDB) {
         throw new Exception("Feed Id not found");
     }
     $tmpSyndicationFeed = KalturaSyndicationFeedFactory::getInstanceByType($syndicationFeedDB->getType());
     $tmpSyndicationFeed->fromObject($syndicationFeedDB);
     $this->syndicationFeed = $tmpSyndicationFeed;
     // add partner to default criteria
     categoryPeer::addPartnerToCriteria($this->syndicationFeed->partnerId, true);
     flavorAssetPeer::addPartnerToCriteria($this->syndicationFeed->partnerId, true);
     $this->baseCriteria = KalturaCriteria::create(entryPeer::OM_CLASS);
     $startDateCriterion = $this->baseCriteria->getNewCriterion(entryPeer::START_DATE, time(), Criteria::LESS_EQUAL);
     $startDateCriterion->addOr($this->baseCriteria->getNewCriterion(entryPeer::START_DATE, null));
     $this->baseCriteria->addAnd($startDateCriterion);
     $endDateCriterion = $this->baseCriteria->getNewCriterion(entryPeer::END_DATE, time(), Criteria::GREATER_EQUAL);
     $endDateCriterion->addOr($this->baseCriteria->getNewCriterion(entryPeer::END_DATE, null));
     $this->baseCriteria->addAnd($endDateCriterion);
     $entryFilter = new entryFilter();
     $entryFilter->setPartnerSearchScope($this->syndicationFeed->partnerId);
     $entryFilter->setStatusEquel(entryStatus::READY);
     $entryFilter->setTypeIn(array(entryType::MEDIA_CLIP, entryType::MIX));
     $entryFilter->setModerationStatusNot(entry::ENTRY_MODERATION_STATUS_REJECTED);
     $entryFilter->setDurationGreaterThan(0);
     $entryFilter->attachToCriteria($this->baseCriteria);
     if ($this->syndicationFeed->playlistId) {
         $this->entryFilters = myPlaylistUtils::getPlaylistFiltersById($this->syndicationFeed->playlistId);
     } else {
         $this->entryFilters = array();
     }
     $microTimeEnd = microtime(true);
     KalturaLog::info("syndicationFeedRenderer- initialization done [" . ($microTimeEnd - $microTimeStart) . "]");
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:40,代码来源:KalturaSyndicationFeedRenderer.php

示例9: queryUsageReport

function queryUsageReport($queries_file)
{
    $post_parameters = array();
    try {
        $dbs = kConf::getDB();
        $dsn = $dbs['datasources']['dwh']['connection']['dsn'];
        $queries = parse_ini_file($queries_file, true);
        $dbh = new PDO($dsn);
        // perform all the queries
        for ($i = 0; $i < count($queries['query']); $i++) {
            $statement = $dbh->query($queries['query'][$i]);
            if ($statement === false) {
                echo "Failed to execute query: " . $queries['query'][$i] . PHP_EOL;
            } else {
                addPostParameters($post_parameters, $statement, $queries['array_name'][$i]);
            }
        }
        $dbh = null;
    } catch (PDOException $e) {
        echo "Error!: " . $e->getMessage();
    }
    return $post_parameters;
}
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:23,代码来源:reportUsageTrackingIfOptIn.php

示例10: prepare

 protected function prepare(KalturaBatchJob $job, KalturaWebcamPrepareJobData $data)
 {
     DbManager::setConfig(kConf::getDB());
     DbManager::initialize();
     $dbEntry = entryPeer::retrieveByPK($job->entryId);
     $webcamTokenId = $data->webcamTokenId;
     $dbEntry->setStatus(entryStatus::PRECONVERT);
     $dbEntry->save();
     // check that the webcam file exists
     $content = myContentStorage::getFSContentRootPath();
     $this->webcam_basePath = $content . "/content/webcam/" . $webcamTokenId;
     $this->entryFullPath = $this->webcam_basePath . '.flv';
     if (!file_exists($this->entryFullPath)) {
         $dbEntry->setStatus(entryStatus::ERROR_CONVERTING);
         $dbEntry->save();
         return $this->closeJob($job, KalturaBatchJobErrorTypes::RUNTIME, null, "Error: " . self::MSG_ERROR_FILE_NOT_EXISTS, KalturaBatchJobStatus::FAILED);
     }
     $duration = myFlvStaticHandler::getLastTimestamp($this->entryFullPath);
     $this->fixFlv();
     $kWAMSWebcam = new kWAMSWebcam($this->webcam_basePath);
     if ($kWAMSWebcam->prepare()) {
         $this->entryFullPath = $kWAMSWebcam->getOutputFilePath();
     } else {
         $dbEntry->setStatus(entryStatus::ERROR_CONVERTING);
         $dbEntry->save();
         return $this->closeJob($job, KalturaBatchJobErrorTypes::RUNTIME, null, "Error: " . self::MSG_ERROR_WAMS_FAIL, KalturaBatchJobStatus::FAILED);
     }
     $kshowId = $dbEntry->getKshowId();
     // setup the needed params for my insert entry helper
     $paramsArray = array("entry_media_source" => KalturaSourceType::WEBCAM, "entry_media_type" => $dbEntry->getMediaType(), "webcam_suffix" => $webcamTokenId, "entry_license" => $dbEntry->getLicenseType(), "entry_credit" => $dbEntry->getCredit(), "entry_source_link" => $dbEntry->getSourceLink(), "entry_tags" => $dbEntry->getTags(), "duration" => $duration);
     $token = $this->getClient()->getKs();
     $insert_entry_helper = new myInsertEntryHelper(null, $dbEntry->getKuserId(), $kshowId, $paramsArray);
     $insert_entry_helper->setPartnerId($job->partnerId, $job->partnerId * 100);
     $insert_entry_helper->insertEntry($token, $dbEntry->getType(), $dbEntry->getId(), $dbEntry->getName(), $dbEntry->getTags(), $dbEntry);
     myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry);
     return $this->closeJob($job, null, null, '', KalturaBatchJobStatus::FINISHED, $data);
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:37,代码来源:KAsyncWebcamPrepare.php

示例11: mysqlConnect

function mysqlConnect()
{
    $dbConfig = kConf::getDB();
    if (!isset($dbConfig['datasources']) || !isset($dbConfig['datasources']['propel']) || !isset($dbConfig['datasources']['propel']['connection'])) {
        echo "Propel datasource not found\n";
        exit(-1);
    }
    $masterConfig = $dbConfig['datasources']['propel']['connection'];
    if (!isset($masterConfig['database'])) {
        echo "Propel datasource database not found\n";
        exit(-1);
    }
    if (!isset($masterConfig['hostspec'])) {
        echo "Propel datasource hostspec not found\n";
        exit(-1);
    }
    if (!isset($masterConfig['user'])) {
        echo "Propel datasource user not found\n";
        exit(-1);
    }
    if (!isset($masterConfig['password'])) {
        echo "Propel datasource password not found\n";
        exit(-1);
    }
    $database = $masterConfig['database'];
    $host = $masterConfig['hostspec'];
    $username = $masterConfig['user'];
    $password = $masterConfig['password'];
    $link = mysqli_connect($host, $username, $password, $database);
    if (!$link) {
        echo "Error: Unable to connect to MySQL." . PHP_EOL;
        echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
        echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
        exit;
    }
    return $link;
}
开发者ID:DBezemer,项目名称:server,代码行数:37,代码来源:2015_09_21_migrateMediaServerTableToServerNodeTable.php

示例12: set_time_limit

if ($argc != 2) {
    echo "Arguments missing.\n\n";
    echo "Usage: php removePartnerEntries.php {partner id}\n";
    exit;
}
$partnerId = $argv[1];
set_time_limit(0);
ini_set("memory_limit", "1024M");
define('ROOT_DIR', realpath(dirname(__FILE__) . '/../../'));
require_once ROOT_DIR . '/infra/bootstrap_base.php';
require_once ROOT_DIR . '/infra/KAutoloader.php';
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "metadata", "*"));
KAutoloader::setClassMapFilePath('../cache/classMap.cache');
KAutoloader::register();
error_reporting(E_ALL);
KalturaLog::setLogger(new KalturaStdoutLogger());
$typesToDelete = array(entryType::DATA, entryType::DOCUMENT);
$dbConf = kConf::getDB();
DbManager::setConfig($dbConf);
DbManager::initialize();
$c = new Criteria();
$c->add(entryPeer::PARTNER_ID, $partnerId);
$c->add(entryPeer::TYPE, $typesToDelete, Criteria::IN);
$entries = entryPeer::doSelect($c);
foreach ($entries as $entry) {
    KalturaLog::debug("Deletes entry [" . $entry->getId() . "]");
    myEntryUtils::deleteEntry($entry, $partnerId);
}
KalturaLog::debug("Done");
开发者ID:richhl,项目名称:kalturaCE,代码行数:30,代码来源:removePartnerEntries.php

示例13: initDb

 protected static function initDb($should_perform_shutdown = false)
 {
     KalturaLog::debug("----------------- Initializing DB ------------------- ");
     if (self::$s_databaseManager == NULL) {
         $dbConf = kConf::getDB();
         DbManager::setConfig($dbConf);
         //self::$s_databaseManager = new sfDatabaseManager();
     }
     if ($should_perform_shutdown) {
         KalturaLog::debug("Attempting shutdown of DB due to errors");
         // All of this brutal shutdown & init is to release all DB connections and restart as clean as possible
         //
         //self::$s_databaseManager->shutdown();
         //propel::close();
         //propel::initialize();
         DbManager::shutdown();
         DbManager::initialize();
     }
     DbManager::initialize();
     //self::$s_databaseManager->initialize();
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:21,代码来源:myBatchBase.class.php

示例14: init

 public static function init($conf_file_path)
 {
     require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "infra" . DIRECTORY_SEPARATOR . "bootstrap_base.php";
     require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'kConf.php';
     define("KALTURA_API_PATH", KALTURA_ROOT_PATH . DIRECTORY_SEPARATOR . "api_v3");
     // Autoloader
     require_once KALTURA_INFRA_PATH . DIRECTORY_SEPARATOR . "KAutoloader.php";
     KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"));
     KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "lib", "*"));
     KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_API_PATH, "services", "*"));
     KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "alpha", "plugins", "*"));
     // needed for testmeDoc
     KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "*"));
     KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "generator"));
     // needed for testmeDoc
     KAutoloader::setClassMapFilePath(kConf::get("cache_root_path") . '/deploy/classMap.cache');
     //KAutoloader::dumpExtra();
     KAutoloader::register();
     $dbConf = kConf::getDB();
     DbManager::setConfig($dbConf);
     DbManager::initialize();
     $conf = parse_ini_file($conf_file_path, true);
     $confObj = new Zend_Config_Ini($conf_file_path);
     return $confObj;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:25,代码来源:deploy.php

示例15: __construct

 public function __construct()
 {
     DbManager::setConfig(kConf::getDB());
     DbManager::initialize();
     //TODO: initialize $this->serviceName here instead of in initService method
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:6,代码来源:KalturaBaseService.php


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