本文整理汇总了PHP中DaoFactory::SystemInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP DaoFactory::SystemInfo方法的具体用法?PHP DaoFactory::SystemInfo怎么用?PHP DaoFactory::SystemInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DaoFactory
的用法示例。
在下文中一共展示了DaoFactory::SystemInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform
/**
* PL/SQLのbatch_zaiko_allを実行する
* @see Ethna_ActionClass::perform()
*/
function perform()
{
try {
$this->alterDao = DaoFactory::AlterSql();
$this->alterDao->BeginTransaction();
$app_name = $this->config->get('app_name');
// 更新所有项目
$this->AlterDB_21275();
$this->ModifyData_21275();
if ($app_name == 'AsOrder') {
//AsOrderのみ
} elseif ($app_name == 'AsCount') {
//AsCountのみ
} elseif ($app_name == 'AsZai') {
//AsZaiのみ
}
$params = array('CURRENT_VERSION' => $this->config->get('code_version'), 'UID' => 'script', 'PGM' => 'batch');
DaoFactory::SystemInfo()->Update($params);
$this->alterDao->CommitTransaction();
} catch (Exception $e) {
$this->alterDao->AbortTransaction();
$this->logger->log(LOG_ERR, $e->getMessage());
die($e->getMessage());
}
}
示例2: preforward
function preforward()
{
$company_id = $this->config->get('company_id');
$this->af->setApp('company_id', $company_id);
$this->af->setApp('code_version', $this->config->get('code_version'));
$this->af->setApp('db_version', DaoFactory::SystemInfo()->getSystemInfo());
$this->af->setApp('get_company_id', $_GET['company_id']);
}
示例3: perform
/**
* PL/SQLのbatch_zaiko_allを実行する
* @see Ethna_ActionClass::perform()
*/
function perform()
{
try {
//1.先连接数据库,获得版本表中的数据库版本信息
try {
$db_version = DaoFactory::SystemInfo()->Column('CURRENT_VERSION', false, array());
} catch (Exception $e) {
$db_version = '2.27.0';
}
$db_version_array = explode('.', $db_version);
foreach ($db_version_array as &$temp) {
if (strlen($temp) < 2) {
$temp = '0' . $temp;
}
}
$db_version = implode($db_version_array);
//test
// echo $db_version . "\n";
// echo "*****************\n";
//test
$arr_filenames = scandir(dirname(__FILE__));
foreach ($arr_filenames as $key => $filename) {
if ($filename == '.' || $filename == '..' || $filename == 'Update.php') {
unset($arr_filenames[$key]);
}
}
//test
// foreach ( $arr_filenames as $temp){
// echo $temp . "\n";
// }
// echo "*****************\n";
//test
//2.读取当前目录下的以u开头和d开头的文件名字,分别存入数组后排序
$update_array = array();
$downback_array = array();
foreach ($arr_filenames as $temp) {
if (strtolower($temp[0]) == "u") {
$update_array[substr($temp, 1, -4)] = $temp;
}
// if ( strtolower( $temp[0] ) == "d" ){
// $downback_array[substr( $temp, 1, -4 )] = $temp;
// }
}
ksort($update_array);
// ksort( $downback_array );
//test
// foreach ( $update_array as $temp){
// echo $temp . "\n";
// echo "*****************\n";
// }
//test
//3.用当前代码版本与数据库版本比较,决定要执行的文件,存入数组
//test
echo $this->config->get('code_version');
//test
$running_array = array();
$code_version = $this->config->get('code_version');
//add 0
$code_version_array = explode('.', $code_version);
foreach ($code_version_array as &$temp) {
if (strlen($temp) < 2) {
$temp = '0' . $temp;
}
}
$code_version = implode($code_version_array);
if ($db_version < $code_version) {
foreach ($update_array as $key => $temp) {
if ($key <= $db_version) {
continue;
} else {
if ($key > $code_version) {
break;
} else {
$running_array[] = $temp;
}
}
}
}
//test
// file_put_contents( '/tmp/running',var_export( $running_array, true ) );
//test
//4.运行需要升级的文件
foreach ($running_array as $temp) {
$this->backend->getController()->trigger('batch_system_' . strtolower(substr($temp, 0, -4)), '', true);
}
} catch (Exception $e) {
$this->logger->log(LOG_ERR, $e->getMessage());
die($e->getMessage());
}
}