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


PHP Billrun_Factory::config方法代码示例

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


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

示例1: receive

 /**
  * General function to receive
  *
  * @return array list of files received
  */
 public function receive()
 {
     foreach (Billrun_Factory::config()->getConfigValue('ilds.providers', array()) as $type) {
         if (!file_exists($this->workspace . DIRECTORY_SEPARATOR . $type)) {
             Billrun_Factory::log()->log("NOTICE : SKIPPING {$type} !!! directory " . $this->workspace . DIRECTORY_SEPARATOR . $type . " not found!!", Zend_Log::NOTICE);
             continue;
         }
         $files = scandir($this->workspace . DIRECTORY_SEPARATOR . $type);
         $ret = array();
         static::$type = $type;
         foreach ($files as $file) {
             $path = $this->workspace . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . $file;
             if (is_dir($path) || $this->lockFileForReceive($file, $type) || !$this->isFileValid($file, $path)) {
                 continue;
             }
             $fileData = $this->getFileLogData($file, $type);
             $fileData['path'] = $path;
             if (!empty($this->backupPaths)) {
                 $backedTo = $this->backup($fileData['path'], $file, $this->backupPaths, FALSE, FALSE);
                 Billrun_Factory::dispatcher()->trigger('beforeReceiverBackup', array($this, &$fileData['path']));
                 $fileData['backed_to'] = $backedTo;
                 Billrun_Factory::dispatcher()->trigger('afterReceiverBackup', array($this, &$fileData['path']));
             }
             $this->logDB($fileData);
             $ret[] = $fileData['path'];
         }
         $this->processType($type);
     }
     return $ret;
 }
开发者ID:ngchie,项目名称:system,代码行数:35,代码来源:Files.php

示例2: isOn

 protected function isOn()
 {
     if (Billrun_Factory::config()->getConfigValue($this->getRequest()->action)) {
         return true;
     }
     return false;
 }
开发者ID:ngchie,项目名称:system,代码行数:7,代码来源:Base.php

示例3: indexAction

 public function indexAction()
 {
     $this->redirect('admin');
     $this->getView()->title = "BillRun | The best open source billing system";
     $this->getView()->content = "Open Source Last Forever!";
     $this->getView()->favicon = Billrun_Factory::config()->getConfigValue('favicon');
 }
开发者ID:ngchie,项目名称:system,代码行数:7,代码来源:Index.php

示例4: __construct

 public function __construct($options = array())
 {
     parent::__construct($options);
     if (isset($options['filename_regex'])) {
         $this->filenameRegex = $options['filename_regex'];
     }
     if (isset($options['receiver']['limit']) && $options['receiver']['limit']) {
         $this->setLimit($options['receiver']['limit']);
     }
     if (isset($options['receiver']['preserve_timestamps'])) {
         $this->preserve_timestamps = $options['receiver']['preserve_timestamps'];
     }
     if (isset($options['backup_path'])) {
         $this->backupPaths = $options['backup_path'];
     } else {
         $this->backupPaths = Billrun_Factory::config()->getConfigValue($this->getType() . '.backup_path', array('./backups/' . $this->getType()));
     }
     if (isset($options['receiver']['backup_granularity']) && $options['receiver']['backup_granularity']) {
         $this->setGranularity((int) $options['receiver']['backup_granularity']);
     }
     if (Billrun_Util::getFieldVal($options['receiver']['backup_date_fromat'], false)) {
         $this->setBackupDateDirFromat($options['receiver']['backup_date_fromat']);
     }
     if (isset($options['receiver']['orphan_time']) && (int) $options['receiver']['orphan_time'] > 900) {
         $this->file_fetch_orphan_time = $options['receiver']['orphan_time'];
     }
 }
开发者ID:ngchie,项目名称:system,代码行数:27,代码来源:Receiver.php

示例5: getData

 /**
  * Get the data resource
  * 
  * @return Mongo Cursor
  */
 public function getData($filter_query = array())
 {
     $cursor = $this->collection->query($filter_query)->cursor()->setReadPreference(Billrun_Factory::config()->getConfigValue('read_only_db_pref'));
     $this->_count = $cursor->count();
     $resource = $cursor->sort($this->sort)->skip($this->offset())->limit($this->size);
     return $resource;
 }
开发者ID:ngchie,项目名称:system,代码行数:12,代码来源:Tabledate.php

示例6: handlerMarkDown

 /**
  * 
  * @param type $items
  * @param type $pluginName
  * @return array
  */
 public function handlerMarkDown(&$items, $pluginName)
 {
     if ($pluginName != $this->getName() || !$items) {
         return;
     }
     $archive = Billrun_Factory::db(Billrun_Factory::config()->getConfigValue('archive.db'))->linesCollection();
     Billrun_Factory::log()->log("Marking down archive lines For archive plugin", Zend_Log::INFO);
     $options = array();
     $this->data = array();
     foreach ($items as $item) {
         $current = $item->getRawData();
         $options['w'] = 1;
         try {
             $insertResult = $archive->insert($current, $options);
             if ($insertResult['ok'] == 1) {
                 Billrun_Factory::log()->log("line with the stamp: " . $current['stamp'] . " inserted to the archive", Zend_Log::DEBUG);
                 $this->data[] = $current;
             } else {
                 Billrun_Factory::log()->log("Failed insert line with the stamp: " . $current['stamp'] . " to the archive", Zend_Log::WARN);
             }
         } catch (Exception $e) {
             Billrun_Factory::log()->log("Failed insert line with the stamp: " . $current['stamp'] . " to the archive got Exception : " . $e->getCode() . " : " . $e->getMessage(), Zend_Log::ERR);
             if ($e->getCode() == "11000") {
                 // duplicate => already exists
                 $this->data[] = $current;
             }
         }
     }
     return TRUE;
 }
开发者ID:ngchie,项目名称:system,代码行数:36,代码来源:archive.php

示例7: execute

 /**
  * method that outputs account, subscribers and usage of requested accounts and requested date usage
  * it's called automatically by the api main controller
  */
 public function execute()
 {
     Billrun_Factory::log()->log("Execute data triggers", Zend_Log::INFO);
     $request = $this->getRequest()->getRequest();
     // supports GET / POST requests
     $params = array('plan', 'data_usage', 'from_account_id', 'to_account_id', 'billrun');
     foreach ($params as $param) {
         if (!isset($request[$param])) {
             $msg = 'Missing required parameter: ' . $param;
             Billrun_Factory::log()->log($msg, Zend_Log::ERR);
             $this->getController()->setOutput(array(array('status' => 0, 'desc' => 'failed', 'output' => $msg)));
             return;
         }
     }
     Billrun_Factory::log()->log("Request params Received: plan-" . $request['plan'] . ", data_usage-" . $request['data_usage'] . ", from_account_id-" . $request['from_account_id'] . ", to_account_id-" . $request['to_account_id'] . ", billrun-" . $request['billrun'], Zend_Log::INFO);
     $balances = new BalancesModel(array('size' => Billrun_Factory::config()->getConfigValue('balances.accounts.limit', 50000)));
     $results = $balances->getBalancesVolume($request['plan'], $request['data_usage'], $request['from_account_id'], $request['to_account_id'], $request['billrun']);
     if (empty($results)) {
         Billrun_Factory::log()->log('Some error happen, no result, received parameters: ' . print_r($request, true), Zend_Log::ERR);
         return;
     }
     $counter = 0;
     $accounts = array();
     foreach ($results as $result) {
         $accounts['aid'][$result['aid']]['subs'][$result['sid']] = Billrun_Util::byteFormat($result['balance']['totals']['data']['usagev'], 'MB', 2, false, '.', '');
         $counter++;
     }
     $this->getController()->setOutput(array(array('status' => 1, 'desc' => 'success', 'subscribers_count' => $counter, 'output' => $accounts)));
     return true;
 }
开发者ID:ngchie,项目名称:system,代码行数:34,代码来源:Datausage.php

示例8: __construct

 public function __construct()
 {
     $this->record_types = Billrun_Factory::config()->getConfigValue('016_one_way.identifications.record_types', array('30'));
     $this->filename = date('Ymd', time()) . '.TXT';
     $this->output_path = Billrun_Factory::config()->getConfigValue('016_one_way.export.path', '/var/www/billrun/workspace/016_one_way/Treated/') . DIRECTORY_SEPARATOR . $this->filename;
     $this->access_price = round(Billrun_Factory::config()->getConfigValue('016_one_way.access_price', 1.0), 2);
     $this->lines_coll = Billrun_Factory::db()->linesCollection();
 }
开发者ID:ngchie,项目名称:system,代码行数:8,代码来源:ildsOneWay.php

示例9: initThings

 protected function initThings()
 {
     $config_path = Billrun_Factory::config()->getConfigValue('compare.config_path', '/var/www/billrun/conf/compare/config.ini');
     $config = (new Yaf_Config_Ini($config_path))->toArray();
     $this->included_accounts = array_unique(isset($config['include_accounts']) ? $config['include_accounts'] : array());
     $this->excluded_accounts = array_unique(isset($config['exclude_accounts']) ? $config['exclude_accounts'] : array());
     $this->excluded_ndcsns = array_unique(isset($config['exclude_ndcsns']) ? $config['exclude_ndcsns'] : array());
 }
开发者ID:ngchie,项目名称:system,代码行数:8,代码来源:Compare.php

示例10: addAlertData

 /**
  * Add data that is needed to use the event object/DB document later
  * @param Array|Object $event the event to add fields to.
  * @return Array|Object the event object with added fields
  */
 protected function addAlertData(&$newEvent)
 {
     $newEvent['units'] = 'MIN';
     $newEvent['value'] = $newEvent['total'];
     $newEvent['threshold'] = Billrun_Factory::config()->getConfigValue('ilds.threshold', 100);
     $newEvent['event_type'] = 'ILDS';
     $newEvent['msisdn'] = $newEvent['caller_phone_no'];
     return $newEvent;
 }
开发者ID:ngchie,项目名称:system,代码行数:14,代码来源:ilds.php

示例11: __construct

 /**
  * 
  * @param \MongoDb $db
  * @param \Mongodloid_Connection $connection
  */
 public function __construct(\MongoDb $db, \Mongodloid_Connection $connection)
 {
     parent::__construct($db, $connection);
     $this->collections = Billrun_Factory::config()->getConfigValue('db.collections', array());
     $timeout = Billrun_Factory::config()->getConfigValue('db.timeout', 3600000);
     // default 60 minutes
     Billrun_Factory::log()->log('Set database cursor timeout to: ' . $timeout, Zend_Log::INFO);
     MongoCursor::$timeout = $timeout;
 }
开发者ID:kalburgimanjunath,项目名称:system,代码行数:14,代码来源:Db.php

示例12: __construct

 public function __construct($options)
 {
     parent::__construct($options);
     $this->reportType = isset($options['report_type']) ? $options['report_type'] : $this->reportType;
     $this->reportBasePath = Billrun_Factory::config()->getConfigValue($this->reportType . '.reports.path', './');
     $this->types = Billrun_Factory::config()->getConfigValue($this->reportType . '.reports.types', array('I' => 'International', 'M' => 'Mobile', 'N' => 'National', '4' => 'National', 'P' => 'National', 'Un' => 'Other'));
     $this->startDate = isset($options['start_date']) ? strtotime($options['start_date']) : (strlen($this->stamp) > 8 ? strtotime($this->stamp) : Billrun_Util::getLastChargeTime(true));
     $this->endDate = isset($options['end_date']) ? strtotime($options['end_date']) : strtotime(date('Ymt', $this->startDate));
 }
开发者ID:ngchie,项目名称:system,代码行数:9,代码来源:WholesaleReport.php

示例13: __construct

 public function __construct($options)
 {
     parent::__construct($options);
     if (isset($options['export-path']) && true !== $options['export-path']) {
         $this->exportDir = $options['export-path'];
     } else {
         $this->exportDir = Billrun_Factory::config()->getConfigValue('response.export.path', './');
         $this->exportFromConfig = true;
     }
 }
开发者ID:kalburgimanjunath,项目名称:system,代码行数:10,代码来源:LocalDir.php

示例14: _initLayout

 public function _initLayout(Yaf_Dispatcher $dispatcher)
 {
     // Enable template layout only on admin
     // TODO: make this more accurate
     if (strpos($dispatcher->getRequest()->getRequestUri(), "admin") !== FALSE && strpos($dispatcher->getRequest()->getRequestUri(), "edit") === FALSE && strpos($dispatcher->getRequest()->getRequestUri(), "confirm") === FALSE && strpos($dispatcher->getRequest()->getRequestUri(), "logDetails") === FALSE) {
         $path = Billrun_Factory::config()->getConfigValue('application.directory');
         $view = new Yaf_View_Simple($path . '/views/layout');
         $dispatcher->setView($view);
     }
 }
开发者ID:kalburgimanjunath,项目名称:system,代码行数:10,代码来源:Bootstrap.php

示例15: __construct

 public function __construct(array $params = array())
 {
     if (isset($params['collection'])) {
         unset($params['collection']);
     }
     parent::__construct($params);
     $this->collection = Billrun_Factory::db(Billrun_Factory::config()->getConfigValue('fraud.db'))->eventsCollection();
     $this->collection_name = 'events';
     $this->search_key = "stamp";
 }
开发者ID:ngchie,项目名称:system,代码行数:10,代码来源:Events.php


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