本文整理汇总了PHP中PHPWS_DB::getDBType方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_DB::getDBType方法的具体用法?PHP PHPWS_DB::getDBType怎么用?PHP PHPWS_DB::getDBType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_DB
的用法示例。
在下文中一共展示了PHPWS_DB::getDBType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: homogenize
public static function homogenize(&$query)
{
$query_list = explode(',', $query);
$from[] = '/int\\(\\d+\\)/iU';
$to[] = 'int';
if (PHPWS_DB::getDBType() != 'mysql' && PHPWS_DB::getDBType() != 'mysqli') {
$from[] = '/mediumtext|longtext/i';
$to[] = 'text';
}
foreach ($query_list as $command) {
// Remove mysql specific call
$command = str_ireplace('unsigned', '', $command);
$command = preg_replace('/ default (\'\'|""|``)/i', '', $command);
if (preg_match('/\\s(smallint|int)\\s/i', $command)) {
if (!preg_match('/\\snull/i', $command)) {
$command = str_ireplace(' int ', ' INT NOT NULL ', $command);
$command = str_ireplace(' smallint ', ' SMALLINT NOT NULL ', $command);
}
if (!preg_match('/\\sdefault/i', $command)) {
$command = str_ireplace(' int ', ' INT DEFAULT 0 ', $command);
$command = str_ireplace(' smallint ', ' SMALLINT DEFAULT 0 ', $command);
}
$command = preg_replace('/ default \'(\\d+)\'/Ui', ' DEFAULT \\1', $command);
}
$command = preg_replace($from, $to, $command);
$newlist[] = $command;
}
$query = implode(',', $newlist);
$GLOBALS['PHPWS_DB']['lib']->readyImport($query);
}
示例2: pagesmith_update
//.........这里部分代码省略.........
$content[] = '1.2.1 changes
----------------
+ PageSmith now allows the sorting of templates
+ Page titles now added to search.
+ Wrong page ids don\'t 404. Send to message page.
+ Search indexing added to update and version raised.
+ Added search to pagesmith.
+ Changed to new url rewriting method.</pre>';
case version_compare($currentVersion, '1.2.2', '<'):
$content[] = '<pre>';
$files = array('templates/page_list.tpl');
pagesmithUpdateFiles($files, $content);
$content[] = '
1.2.2 changes
---------------
+ Updated pagers to addSortHeaders.
+ Fixed direct access to page allowing view.
+ Front page does not alter page title.
+ Fixed some notices and a caching bug.
+ Changed wording on edit text windows.</pre>';
case version_compare($currentVersion, '1.3.0', '<'):
$db = new PHPWS_DB('ps_block');
$db->dropTableColumn('btype');
$db = new PHPWS_DB('ps_page');
if (PHPWS_Error::logIfError($db->addTableColumn('parent_page', 'int NOT NULL default 0'))) {
$content[] = 'Could not create ps_page.parent_page column.';
return false;
}
if (PHPWS_Error::logIfError($db->addTableColumn('page_order', 'smallint NOT NULL default 0'))) {
$content[] = 'Could not create ps_page.page_order column.';
return false;
}
$db = new PHPWS_DB('ps_text');
if (PHPWS_DB::getDBType() == 'mysql' || PHPWS_DB::getDBType() == 'mysqli') {
if (PHPWS_Error::logIfError($db->alterColumnType('content', 'longtext NOT NULL'))) {
$content[] = 'Could not alter ps_text.content column.';
}
}
$content[] = '<pre>';
$files = array('javascript/passinfo/head.js', 'templates/page_form.tpl', 'javascript/delete_orphan/', 'javascript/confirm_delete/', 'javascript/update/head.js', 'templates/page_templates/threesec-tbl/', 'templates/orphans.tpl', 'templates/page_form.tpl', 'templates/page_frame.tpl', 'templates/page_list.tpl', 'templates/style.css', 'templates/sublist.tpl', 'templates/upload_template.tpl', 'img/add.png', 'img/delete.png', 'img/back.png', 'img/front.png');
pagesmithUpdateFiles($files, $content);
if (!PHPWS_Boost::inBranch()) {
$content[] = file_get_contents(PHPWS_SOURCE_DIR . 'mod/pagesmith/boost/changes/1_3_0.txt');
}
$content[] = '</pre>';
case version_compare($currentVersion, '1.3.1', '<'):
$content[] = '<pre>';
$files = array('templates/page_templates/threesec/page.tpl', 'templates/page_templates/threesec-tbl/page.tpl', 'templates/settings.tpl');
pagesmithUpdateFiles($files, $content);
$content[] = '1.3.1 changes
---------------
+ Page cache refreshed on page save.
+ Updated threesec templates to conform with norm box-title,
box-content layout
+ Added ability to lengthen or shorten pagesmith links.
+ Added fix so edit mode does not parse smarttags.</pre>';
case version_compare($currentVersion, '1.3.2', '<'):
$content[] = '<pre>';
Users_Permission::registerPermissions('pagesmith', $content);
pagesmithUpdateFiles(array('templates/page_templates/'), $content);
$content[] = '1.3.2 changes
----------------
+ Update was missing a permission update
+ Wrong permission getting called on settings
+ All page templates now have a class called pagesmith-page
+ Removed padding from page templates</pre>';