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


PHP OpenVBX::version方法代码示例

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


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

示例1: get_updates

 private function get_updates()
 {
     if ($this->session->userdata('loggedin') != 1 || $this->session->userdata('is_admin') != 1) {
         $data['json'] = array('message' => 'Unable to fetch updates', 'error' => true);
         return $this->respond('', '', $data);
     }
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, 'http://openvbx.org/updates/latest.json');
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     $resp = curl_exec($ch);
     if (!$resp) {
         /* Its okay we can't connect to the update system but log it */
         error_log('Unable to connect to OpenVBX Update notification server');
     }
     $data['json'] = array('message' => 'Unable to fetch updates', 'error' => true);
     if ($obj = json_decode($resp)) {
         $data['json']['upgradeAvailable'] = false;
         list($current['major'], $current['minor']) = explode('.', OpenVBX::version());
         list($latest['major'], $latest['minor']) = explode('.', $obj->version);
         if ($latest['major'] > $current['major'] || $latest['major'] == $current['major'] && $latest['minor'] > $current['minor']) {
             $data['json'] = array('error' => false);
             $data['json']['upgradeAvailable'] = true;
         }
     }
     $this->respond('', '', $data);
 }
开发者ID:howethomas,项目名称:OpenVBX,代码行数:26,代码来源:client.php

示例2: openvbx_mail

/**
 * @param string $recipient
 * @param string $subject
 * @param string $template
 * @param array $maildata
 * @return bool
 */
function openvbx_mail($recipient, $subject, $template, $maildata = array())
{
    $ci =& get_instance();
    $from_email = $ci->settings->get('from_email', $ci->tenant->id);
    if (empty($from_email)) {
        $domain = $ci->config->item('server_name');
        $from_email = "{$from} <do-not-reply@{$domain}>";
    }
    $headers = 'From: ' . $from_email . "\r\n";
    $headers .= 'Reply-To: ' . $from_email . "\r\n";
    $headers .= 'Return-Path: ' . $from_email . "\r\n";
    $headers .= 'User-Agent: OpenVBX-' . OpenVBX::version();
    $message = $ci->load->view('emails/' . $template, $maildata, true);
    log_message('debug', 'MAILING -- to: ' . $recipient . ' -- body: ' . $message);
    return mail($recipient, '[OpenVBX] ' . $subject, $message, $headers);
}
开发者ID:rhyselsmore,项目名称:OpenVBX,代码行数:23,代码来源:mail_helper.php

示例3: getVbxUserAgentString

 public static function getVbxUserAgentString()
 {
     return 'openvbx/' . OpenVBX::version();
 }
开发者ID:AsaadQ,项目名称:OpenVBX,代码行数:4,代码来源:OpenVBX.php

示例4: set_response_type

 protected function set_response_type($type = null)
 {
     header('X-OpenVBX-Version: ' . OpenVBX::version());
     if (isset($_SERVER['HTTP_ACCEPT'])) {
         $accepts = explode(',', $_SERVER['HTTP_ACCEPT']);
         if (in_array('application/json', $accepts) && strtolower($this->router->class) != 'page') {
             header('Content-Type: application/json');
             $this->response_type = 'json';
         }
     }
     if ($type) {
         $this->response_type = $type;
     } else {
         if (!$this->response_type) {
             $this->response_type = 'html';
         }
     }
 }
开发者ID:hharrysidhu,项目名称:OpenVBX,代码行数:18,代码来源:MY_Controller.php

示例5: get_site

 private function get_site()
 {
     $this->template->add_js('assets/j/settings.js');
     $data = $this->init_view_data();
     $current_settings = $this->get_current_settings();
     // insert the server's default time zone in the event none is saved
     if (empty($current_settings['server_time_zone'])) {
         $current_settings['server_time_zone'] = array('id' => null, 'value' => date_default_timezone_get());
     }
     $current_settings['cache_enabled'] = $this->cache->enabled();
     $current_settings['api_cache_enabled'] = $this->api_cache->enabled();
     $data = array_merge($data, $current_settings);
     $data['tenant_mode'] = self::MODE_SINGLE;
     $data['openvbx_version'] = OpenVBX::version();
     // determine wether we can successfully use the GitHub api library
     // to check our current tag against available tags. See ::can_check_upgrade()
     // for a full explanation.
     // @todo - find a more graceful way around this
     // @todo - notify admin that checks can't be made?
     $data['check_upgrade'] = $this->can_check_upgrade();
     if ($this->tenant->name == 'default') {
         $data['tenant_mode'] = self::MODE_MULTI;
         $data['tenants'] = $this->settings->get_all_tenants();
         if ($data['check_upgrade']) {
             $data['latest_version'] = $this->get_latest_tag();
             if (version_compare($data['openvbx_version'], $data['latest_version'], '<')) {
                 $data['upgrade_notice'] = true;
             }
         }
     }
     // allow tenants to see the rewrite setting
     $data['rewrite_enabled'] = array('value' => intval($this->settings->get('rewrite_enabled', VBX_PARENT_TENANT)));
     if ($this->db->dbdriver == 'mysqli') {
         $mysql_version = $this->db->conn_id->server_info;
     } else {
         $mysql_version = mysql_get_server_info($this->db->conn_id);
     }
     $data['server_info'] = array('system_version' => php_uname(), 'php_version' => phpversion(), 'php_sapi' => php_sapi_name(), 'mysql_version' => $mysql_version, 'mysql_driver' => $this->db->dbdriver, 'apache_version' => $_SERVER['SERVER_SOFTWARE'], 'current_url' => site_url($this->uri->uri_string()) . ' (' . $_SERVER['SERVER_ADDR'] . ')');
     $data['available_themes'] = $this->get_available_themes();
     // get plugin data
     $plugins = Plugin::all();
     foreach ($plugins as $plugin) {
         $data['plugins'][] = $plugin->getInfo();
     }
     $data['error'] = $this->session->flashdata('error');
     $data['json']['settings'] = $current_settings;
     // build list of time zones
     $tzs = timezone_identifiers_list();
     $data['time_zones'] = array_combine($tzs, $tzs);
     // makes keys & values match
     // get list of available countries
     $this->load->model('vbx_incoming_numbers');
     $data['countries'] = array();
     try {
         if ($countrydata = $this->vbx_incoming_numbers->get_available_countries()) {
             foreach ($countrydata as $country) {
                 $data['countries'][$country->country_code] = $country->country;
             }
         }
     } catch (VBX_IncomingNumberException $e) {
         $data['error'] = 'Unable to fetch available countries: ';
         switch ($e->getCode()) {
             case 0:
                 $data['error'] .= 'Authentication failed.';
                 break;
             default:
                 $data['error'] .= $e->getMessage();
         }
     }
     // load language codes for text-to-speech
     $this->config->load('langcodes');
     $data['lang_codes'] = $this->config->item('lang_codes');
     // verify Client Application data
     $data['client_application_error'] = false;
     $account = OpenVBX::getAccount();
     $application = $account->applications->get($data['application_sid']['value']);
     if (!empty($data['application_sid']['value'])) {
         try {
             // only way to be sure on these is to pull them in to variables, ugh...
             $application_sid = $application->sid;
             $application_voice_url = $application->voice_url;
             $application_voice_fallback_url = $application->voice_fallback_url;
             if (strlen($application_sid) == 0) {
                 // application missing
                 $data['client_application_error'] = 2;
             } elseif (strlen($application_voice_url) == 0 || strlen($application_voice_fallback_url) == 0) {
                 // urls are missing
                 $data['client_application_error'] = 3;
             } elseif ($application_voice_url != site_url('/twiml/dial') || $application_voice_fallback_url != asset_url('fallback/voice.php')) {
                 // url mismatch
                 $data['client_application_error'] = 4;
             }
         } catch (Exception $e) {
             $data['client_application_error'] = 5;
             $data['error'] = 'Could not validate Client Application data: ' . $e->getMessage();
             $data['client_application_error_message'] = $e->getMessage();
             log_message($e->getMessage());
         }
     } else {
         $data['client_application_error'] = 1;
//.........这里部分代码省略.........
开发者ID:wiserweb,项目名称:OpenVBX,代码行数:101,代码来源:site.php

示例6:

</p>
						</div><!-- .vbx-content-main -->
					</div><!-- #vbx-main -->
				</div><!-- .yui-b -->
		</div>

		<div class="yui-b">
			<div class="vbx-sidebar">
			</div><!-- .vbx-sidebar -->
		</div><!-- .yui-b -->

		</div><!-- #bd .error-404 -->

		<div id="ft">
		<p class="copyright">OpenVBX &bull; <em>v</em><?php 
echo OpenVBX::version();
?>
 r<?php 
echo OpenVBX::schemaVersion();
?>
 &mdash; Powered by <a href="http://twilio.com/">Twilio Inc.</a> &bull; <a href="http://www.twilio.com/legal/tos">Terms</a> &bull; <a href="http://www.twilio.com/legal/privacy">Privacy</a></p>
		</div><!-- #ft -->



</div><!-- #wrapper -->

</div><!-- #doc -->

</body>
开发者ID:joshgomez,项目名称:OpenVBX,代码行数:30,代码来源:error_404.php

示例7: get_version

 private function get_version()
 {
     return OpenVBX::version();
 }
开发者ID:wiserweb,项目名称:OpenVBX,代码行数:4,代码来源:client.php

示例8: get_http_opts

 /**
  * Get a set of modified http options for TinyHttp so that we
  * can modify how the api client identifies itself as well as 
  * inject some debug options
  *
  * @return array
  */
 protected static function get_http_opts()
 {
     $ci =& get_instance();
     $_http_opts = array('host' => 'https://api.twilio.com', 'opts' => array('curlopts' => array(CURLOPT_USERAGENT => 'openvbx/' . OpenVBX::version())));
     // optionally load in the included cert for api communication
     if ($use_certificate = $ci->config->item('twilio_use_certificate')) {
         $_http_opts['opts']['curlopts'][CURLOPT_CAINFO] = APPPATH . 'libraries/Services/cacert.pem';
     }
     // internal api development override, you'll never need this
     if ($_http_settings = $ci->config->item('_http_settings')) {
         if (!empty($_http_settings['host'])) {
             $_http_opts['host'] = $_http_settings['host'];
         }
     }
     // set debug mode if applicable
     if ($api_debug = $ci->config->item('api_debug')) {
         if ($api_debug === true) {
             $_http_opts['opts']['debug'] = true;
         }
     }
     return $_http_opts;
 }
开发者ID:hharrysidhu,项目名称:OpenVBX,代码行数:29,代码来源:OpenVBX.php


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