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


PHP OpenVBX::getLatestSchemaVersion方法代码示例

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


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

示例1: input_args

 private function input_args()
 {
     $tplvars = array();
     $tplvars['pass'] = true;
     $this->database['username'] = trim($this->input->post('database_user'));
     $this->database['password'] = $this->input->post('database_password');
     $this->database['hostname'] = trim($this->input->post('database_host') == "" ? 'localhost' : $this->input->post('database_host'));
     $this->database['database'] = trim($this->input->post('database_name') == "" ? 'OpenVBX' : $this->input->post('database_name'));
     $this->openvbx_settings = array();
     $this->openvbx = array();
     $this->openvbx_settings['twilio_sid'] = trim($this->input->post('twilio_sid'));
     $this->openvbx_settings['twilio_token'] = trim($this->input->post('twilio_token'));
     $this->openvbx['salt'] = md5(rand(10000, 99999));
     $this->openvbx_settings['from_email'] = trim($this->input->post('from_email') == "" ? '' : $this->input->post('from_email'));
     $this->openvbx_settings['theme'] = $this->input->post('theme');
     $this->openvbx_settings['iphone_theme'] = '';
     $this->openvbx_settings['trial_number'] = '(415) 599-2671';
     $this->openvbx_settings['schema-version'] = OpenVBX::getLatestSchemaVersion();
     $this->openvbx_settings['rewrite_enabled'] = !strlen($this->input->post('rewrite_enabled')) ? 0 : $this->input->post('rewrite_enabled');
     $this->user = array();
     $this->user['email'] = trim($this->input->post('admin_email'));
     $this->user['password'] = $this->input->post('admin_pw');
     $this->user['firstname'] = trim($this->input->post('admin_firstname'));
     $this->user['lastname'] = trim($this->input->post('admin_lastname'));
     $this->user['tenant_id'] = 1;
     $tplvars = array_merge($tplvars, $this->user, $this->database, $this->openvbx, $this->openvbx_settings);
     return $tplvars;
 }
开发者ID:joshgomez,项目名称:OpenVBX,代码行数:28,代码来源:install.php

示例2: setup

 public function setup()
 {
     $json['success'] = true;
     $json['message'] = '';
     try {
         $currentSchemaVersion = OpenVBX::schemaVersion();
         $upgradingToSchemaVersion = OpenVBX::getLatestSchemaVersion();
         $upgradeScriptPath = VBX_ROOT . '/updates/';
         $updates = scandir($upgradeScriptPath);
         $updatesToRun = array();
         // Collect all files named numerically in /updates and key sort the list of updates
         foreach ($updates as $i => $update) {
             if (preg_match('/^(\\d+).(sql|php)$/', $update, $matches)) {
                 $updateExtension = $matches[2];
                 $rev = $matches[1];
                 $updatesToRun[$rev] = array('type' => $updateExtension, 'filename' => $update, 'revision' => $rev);
             }
         }
         ksort($updatesToRun);
         // Cut the updates by the current schema version.
         $updatesToRun = array_slice($updatesToRun, $currentSchemaVersion);
         $tplvars = array('originalVersion' => $currentSchemaVersion, 'version' => $upgradingToSchemaVersion, 'updates' => $updatesToRun);
         foreach ($updatesToRun as $updateToRun) {
             $file = $updateToRun['filename'];
             $type = $updateToRun['type'];
             $revision = $updateToRun['revision'];
             switch ($type) {
                 case 'php':
                     require_once $upgradeScriptPath . $file;
                     $runUpdateMethod = "runUpdate_{$revision}";
                     if (!function_exists($runUpdateMethod)) {
                         throw new UpgradeException('runUpdate method missing from ' . $file . ': ' . $runUpdateMethod);
                     }
                     call_user_func($runUpdateMethod);
                     break;
                 case 'sql':
                     $sql = @file_get_contents($upgradeScriptPath . $file);
                     if (empty($sql)) {
                         throw new UpgradeException("Unable to read update: {$file}", 1);
                     }
                     foreach (explode(";", $sql) as $stmt) {
                         $stmt = trim($stmt);
                         if (!empty($stmt)) {
                             PluginData::sqlQuery($stmt);
                         }
                     }
                     break;
             }
         }
         flush_minify_caches();
     } catch (Exception $e) {
         $json['success'] = false;
         $json['message'] = $e->getMessage();
         $json['step'] = $e->getCode();
     }
     $json['tplvars'] = $tplvars;
     echo json_encode($json);
 }
开发者ID:hharrysidhu,项目名称:OpenVBX,代码行数:58,代码来源:upgrade.php

示例3: setup

 public function setup()
 {
     $json['success'] = true;
     $json['message'] = '';
     try {
         $currentSchemaVersion = OpenVBX::schemaVersion();
         $upgradingToSchemaVersion = OpenVBX::getLatestSchemaVersion();
         $sqlPath = VBX_ROOT . '/sql-updates/';
         $updates = scandir($sqlPath);
         $files = array();
         foreach ($updates as $i => $update) {
             if (preg_match('/^(\\d+).sql$/', $update)) {
                 $rev = intval(str_replace('.sql', '', $update));
                 $files[$rev] = $update;
             }
         }
         ksort($files);
         $files = array_slice($files, $currentSchemaVersion);
         $tplvars = array('originalVersion' => $currentSchemaVersion, 'version' => $upgradingToSchemaVersion, 'updates' => $files);
         foreach ($files as $file) {
             $sql = @file_get_contents($sqlPath . $file);
             if (empty($sql)) {
                 throw new UpgradeException("Unable to read update: {$file}", 1);
             }
             foreach (explode(";", $sql) as $stmt) {
                 $stmt = trim($stmt);
                 if (!empty($stmt)) {
                     PluginData::sqlQuery($stmt);
                 }
             }
         }
     } catch (Exception $e) {
         $json['success'] = false;
         $json['message'] = $e->getMessage();
         $json['step'] = $e->getCode();
     }
     $json['tplvars'] = $tplvars;
     echo json_encode($json);
 }
开发者ID:joshgomez,项目名称:OpenVBX,代码行数:39,代码来源:upgrade.php

示例4: upgrade_check

 private function upgrade_check()
 {
     $currentSchemaVersion = OpenVBX::schemaVersion(false);
     $upgradingToSchemaVersion = OpenVBX::getLatestSchemaVersion();
     if ($currentSchemaVersion != $upgradingToSchemaVersion) {
         redirect('upgrade');
     }
 }
开发者ID:hharrysidhu,项目名称:OpenVBX,代码行数:8,代码来源:User_Controller.php

示例5:

				</fieldset>
				<button class="submit-button"><span>Update</span></button>
			</form>
		</div><!-- .vbx-tab-view -->


		<div id="settings-about" class="vbx-tab-view">
			<h3>About</h3>
			<ul>
				<li>Current Version: <?php 
echo OpenVBX::version();
?>
</li>
				<li>Schema Version: <?php 
echo OpenVBX::schemaVersion();
?>
</li>
				<li>Latest Schema Available: <?php 
echo OpenVBX::getLatestSchemaVersion();
?>
</li>
			</ul>
			
			<p>Thanks to everyone involved, you made it better than envisioned!</p>
			<?php 
require_once 'license.php';
?>
		</div>
					
	</div><!-- .vbx-content-main -->
开发者ID:howethomas,项目名称:OpenVBX,代码行数:30,代码来源:site.php


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