本文整理汇总了PHP中POD::bind方法的典型用法代码示例。如果您正苦于以下问题:PHP POD::bind方法的具体用法?PHP POD::bind怎么用?PHP POD::bind使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类POD
的用法示例。
在下文中一共展示了POD::bind方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkStep
function checkStep($step, $check = true)
{
global $root, $path;
$error = 0;
if ($step == 1) {
if ($check) {
return true;
}
} else {
if ($step == 2) {
if ($check) {
if (!empty($_POST['mode'])) {
switch ($_POST['mode']) {
case 'install':
case 'setup':
case 'uninstall':
return true;
}
}
}
?>
<input type="hidden" name="step" value="2" />
<input id="setupMode" type="hidden" name="mode" value="" />
<div id="inner">
<h2><span class="step"><?php
echo _f('%1단계', 2);
?>
</span> : <?php
echo _t('작업 유형을 선택해 주십시오.');
?>
</h2>
<div style="text-align:center">
<div style="width:100%; padding:40px 0px 40px 0px">
<div style="margin:20px;"><input type="button" value="<?php
echo _t('새로운 텍스트큐브를 설정합니다');
?>
" style="width:100%; height:40px; font-size:14px" onclick="next('install');return false;" /></div>
<div style="margin:20px;"><input type="button" value="<?php
echo _t('텍스트큐브를 다시 설정합니다');
?>
" style="width:100%; height:40px; font-size:14px" onclick="next('setup');return false;" /></div>
<div style="margin:20px;"><input type="button" value="<?php
echo _t('텍스트큐브 테이블을 삭제합니다');
?>
" style="width:100%; height:40px; font-size:14px" onclick="next('uninstall');return false;" /></div>
</div>
</div>
</div>
<?php
} else {
if ($step == 3) {
if ($check) {
switch ($_POST['mode']) {
case 'install':
case 'setup':
if (!empty($_POST['dbServer']) && !empty($_POST['dbName']) && !empty($_POST['dbUser']) && isset($_POST['dbPassword']) && isset($_POST['dbPrefix'])) {
$dbTemp = array('server' => $_POST['dbServer'], 'username' => $_POST['dbUser'], 'password' => $_POST['dbPassword'], 'port' => $_POST['dbPort']);
if (!empty($_POST['dbName'])) {
$dbTemp['database'] = $_POST['dbName'];
}
global $dbms;
$dbms = $_POST['dbms'];
if (!POD::bind($dbTemp)) {
$error = 1;
} else {
if (!empty($_POST['dbPrefix']) && !preg_match('/^[a-zA-Z0-9_]+$/', $_POST['dbPrefix'])) {
$error = 3;
} else {
return true;
}
}
}
break;
case 'uninstall':
if (!empty($_POST['dbServer']) && !empty($_POST['dbName']) && !empty($_POST['dbUser']) && isset($_POST['dbPassword']) && !empty($_POST['dbPort'])) {
$dbTemp = array('server' => $_POST['dbServer'], 'username' => $_POST['dbUser'], 'password' => $_POST['dbPassword'], 'port' => $_POST['dbPort']);
if (!empty($_POST['dbName'])) {
$dbTemp['database'] = $_POST['dbName'];
}
global $dbms;
$dbms = $_POST['dbms'];
if (!POD::bind($dbTemp)) {
$error = 1;
} else {
return true;
}
}
break;
}
}
?>
<input type="hidden" name="step" value="3" />
<input type="hidden" name="mode" value="<?php
echo $_POST['mode'];
?>
" />
<script type="text/javascript">
//<![CDATA[
function suggestDefaultPort(db) {
switch(db) {
//.........这里部分代码省略.........
示例2: header
if ($context->getProperty('service.useSSL', false) == true) {
header("strict-transport-security: max-age=" . $context->getProperty("service.timeout", 3600));
}
/** INITIALIZE : Database I/O
* -------------------------
* Performs database connection.
*/
if (!is_null($context->getProperty('database.database'))) {
$context->useNamespace('database');
$db['database'] = $context->getProperty('database');
$db['server'] = $context->getProperty('server');
$db['port'] = $context->getProperty('port');
$db['username'] = $context->getProperty('username');
$db['password'] = $context->getProperty('password');
$context->useNamespace();
if (POD::bind($db) === false) {
Respond::MessagePage('Problem with connecting database.<br /><br />Please re-visit later.');
exit;
}
POD::cacheLoad();
register_shutdown_function(array('POD', 'cacheSave'));
$context->setProperty('database.connected', true);
//register_shutdown_function( array('POD','unbind') );
}
$database['utf8'] = POD::charset() == 'utf8' ? true : false;
/// Memcache module bind (if possible)
global $memcache;
$memcache = null;
if ($context->getProperty('service.memcached') == true) {
$memcache = new Memcache();
$memcache->connect(!is_null($context->getProperty('memcached.server')) ? $context->getProperty('memcached.server') : 'localhost');