當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Version::addTest方法代碼示例

本文整理匯總了PHP中Version::addTest方法的典型用法代碼示例。如果您正苦於以下問題:PHP Version::addTest方法的具體用法?PHP Version::addTest怎麽用?PHP Version::addTest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Version的用法示例。


在下文中一共展示了Version::addTest方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

$version->collectPassword('db_password', 'Password', '');
$version->collectText('db_server', 'Server Address', 'localhost');
$version->collectText('db_database', 'Database Name', 'care2x');
$version->addSeparator('System Administrator User');
$version->collectText('admin_user', 'User Name', 'admin');
$version->collectPassword('admin_password', 'Password', '');
$version->collectPassword('admin_confirm', 'Password Confirm', '');
$version->addSeparator('Network Protocol and Domain');
$version->collectOption('transfer_protocol', 'Transfer Protocol', array('http', 'https'), array('http', 'https'), 'http');
$version->collectText('care2x_address', 'Care2x Host', 'localhost');
$version->addSeparator('Encryption Keys');
$version->collectText('1st_key', '1st Key', (rand(1, $rmax) . rand(1, $rmax)) * rand(1, $rmax));
$version->collectText('2nd_key', '2nd Key', (rand(1, $rmax) . rand(1, $rmax)) * rand(1, $rmax));
$version->collectText('3rd_key', '3rd Key', (rand(1, $rmax) . rand(1, $rmax)) * rand(1, $rmax));
$version->addSeparator('');
$version->addTest('PHPVersionOver', array('4.3.0'));
$version->addTest('PHPVersionUnder', array('5.0.0'));
//$version->addTest('PHPMemory', array('8M'));
//$version->addTest('PHPMagicQuotes', array('Off'));
//$version->addTest('PHPRegisterGlobals', array('Off'));
$version->addTest('PHPDBExtension', array('type_field' => 'db_type'));
$version->addTest('PHPExtension', array('calendar', 'gd'));
$version->addTest('DBVersionOver', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'type_field' => 'db_type', 'version' => array('mysql' => '3.23.0', 'postgres7' => '7.4.0')));
$version->addTest('AdminPasswordConfirmed', array('password_field' => 'admin_password', 'confirm_field' => 'admin_confirm'));
$version->addTest('WritableLocation', array(APP_PATH . '/cache'));
$version->addTest('WritableLocation', array(APP_PATH . '/cache/barcodes'));
$version->addTest('WritableLocation', array(APP_PATH . '/counter'));
$version->addTest('WritableLocation', array(APP_PATH . '/counter/hitcount.txt'));
$version->addTest('WritableLocation', array(APP_PATH . '/fotos'));
$version->addTest('WritableLocation', array(APP_PATH . '/fotos/encounter'));
$version->addTest('WritableLocation', array(APP_PATH . '/fotos/registration'));
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:31,代碼來源:versions.php

示例2: realpath

 */
/*
 * Created on Aug 16, 2005
 *
 * SureInvoice version file for application installer
 */
$base_path = realpath(dirname(__FILE__) . '/../');
$versions = new VersionSet();
$versions->collectData('db_user', 'Database Username', 'text', 'root');
$versions->collectData('db_password', 'Database Password', 'text', '');
$versions->collectData('db_server', 'Database Server', 'text', 'localhost');
$versions->collectData('db_port', 'Database Port', 'text', '3306');
$versions->collectData('db_database', 'Database Name', 'text', '');
// 0.0 Release (All Required Tests and Actions)
$version_0_0 = new Version('0.0');
$version_0_0->addTest('PHPVersionOver', array('4.3.0'));
$version_0_0->addTest('PHPExtension', array('mysql', 'curl'));
$version_0_0->addTest('WritableLocation', array($base_path . '/includes/global_config.php', $base_path . '/installer/tmp'));
$version_0_0->addTest('MysqlVersionOver', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'version' => '4.1.0'));
$version_0_0->addAction('AcceptText', array($base_path . '/LICENSE'));
$version_0_0->addAction('ReplaceString', array('message' => "Saved database configuration information!", 'files' => array($base_path . '/includes/global_config.php.dist' => $base_path . '/includes/global_config.php'), 'fields' => array('INSTALL_DB_DATABASE' => 'db_database', 'INSTALL_DB_SERVER' => 'db_server', 'INSTALL_DB_USERNAME' => 'db_user', 'INSTALL_DB_PASSWORD' => 'db_password')));
$versions->add($version_0_0);
// 0.2 Release
$version_0_2 = new Version('0.2');
$version_0_2->addAction('SQLFile', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'db_field' => 'db_database', 'files' => array($base_path . '/setup/sureinvoice.sql')));
$versions->add($version_0_2);
// 0.3 Release
$version_0_3 = new Version('0.3');
$version_0_3->addAction('SQLFile', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'db_field' => 'db_database', 'files' => array($base_path . '/setup/update-0.2-0.3.sql')));
$versions->add($version_0_3);
// 0.4 Release
開發者ID:nanoprime,項目名稱:sureinvoice,代碼行數:31,代碼來源:versions.php

示例3: VersionSet

<?php

/*
 * Created on Aug 16, 2005
 *
 * Example version file for application installer
 */
$versions = new VersionSet();
$version_0_2 = new Version('0.2');
$version_0_2->collectData('db_user', 'Database Username', 'text', 'root');
$version_0_2->collectData('db_password', 'Database Password', 'text', '');
$version_0_2->collectData('db_server', 'Database Server', 'text', 'localhost');
$version_0_2->collectData('db_port', 'Database Port', 'text', '3306');
$version_0_2->collectData('db_database', 'Database Name', 'text', '');
$version_0_2->addTest('PHPVersionOver', array('4.2.0'));
$version_0_2->addTest('PHPExtension', array('mysql', 'gd'));
$version_0_2->addTest('WritableLocation', array(dirname(__FILE__) . '/test_replacement.txt', realpath(dirname(__FILE__) . '/tmp')));
$version_0_2->addTest('MysqlVersionOver', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'version' => '4.0.1'));
$version_0_2->addAction('AcceptText', array(dirname(__FILE__) . '/LICENSE'));
$version_0_2->addAction('SQLFile', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'db_field' => 'db_database', 'files' => array(realpath(dirname(__FILE__) . '/sql') . '/sureinvoice.sql')));
$version_0_2->addAction('ReplaceString', array('message' => "Saved database configuration information!", 'files' => array(dirname(__FILE__) . '/test_replacement.txt'), 'fields' => array('INSTALL_DB_USERNAME' => 'db_user', 'INSTALL_DB_PASSWORD' => 'db_password'), 'strings' => array('TEST_STRING' => 'This is my test string text!')));
$versions->add($version_0_2);
$version_0_3 = new Version('0.3');
$version_0_3->addAction('SQLFile', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'db_field' => 'db_database', 'files' => array(realpath(dirname(__FILE__) . '/sql') . '/update-0.2-0.3.sql')));
$versions->add($version_0_3);
$version_0_4 = new Version('0.4');
$version_0_4->addAction('SQLFile', array('username_field' => 'db_user', 'password_field' => 'db_password', 'server_field' => 'db_server', 'port_field' => 'db_port', 'db_field' => 'db_database', 'files' => array(realpath(dirname(__FILE__) . '/sql') . '/update-0.3-0.4.sql')));
$versions->add($version_0_4);
?>

開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:29,代碼來源:example_versions.php


注:本文中的Version::addTest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。