本文整理汇总了PHP中PMA\libraries\Util::isForeignKeySupported方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::isForeignKeySupported方法的具体用法?PHP Util::isForeignKeySupported怎么用?PHP Util::isForeignKeySupported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA\libraries\Util
的用法示例。
在下文中一共展示了Util::isForeignKeySupported方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
use PMA\libraries\Table;
use PMA\libraries\Util;
require_once 'libraries/common.inc.php';
$container = libraries\di\Container::getDefaultContainer();
$container->factory('PMA\\libraries\\controllers\\table\\TableRelationController');
$container->alias('TableRelationController', 'PMA\\libraries\\controllers\\table\\TableRelationController');
$container->set('PMA\\libraries\\Response', Response::getInstance());
$container->alias('response', 'PMA\\libraries\\Response');
/* Define dependencies for the concerned controller */
$db = $container->get('db');
$table = $container->get('table');
$dbi = $container->get('dbi');
$options_array = array('CASCADE' => 'CASCADE', 'SET_NULL' => 'SET NULL', 'NO_ACTION' => 'NO ACTION', 'RESTRICT' => 'RESTRICT');
$cfgRelation = PMA_getRelationsParam();
$tbl_storage_engine = mb_strtoupper($dbi->getTable($db, $table)->getStatusInfo('Engine'));
$upd_query = new Table($table, $db, $dbi);
$dependency_definitions = array("options_array" => $options_array, "cfgRelation" => $cfgRelation, "tbl_storage_engine" => $tbl_storage_engine, "upd_query" => $upd_query);
if ($cfgRelation['relwork']) {
$dependency_definitions['existrel'] = PMA_getForeigners($db, $table, '', 'internal');
}
if (Util::isForeignKeySupported($tbl_storage_engine)) {
$dependency_definitions['existrel_foreign'] = PMA_getForeigners($db, $table, '', 'foreign');
}
if ($cfgRelation['displaywork']) {
$dependency_definitions['disp'] = PMA_getDisplayField($db, $table);
} else {
$dependency_definitions['disp'] = 'asas';
}
/** @var TableRelationController $controller */
$controller = $container->get('TableRelationController', $dependency_definitions);
$controller->indexAction();
示例2: indexAction
/**
* Index
*
* @return void
*/
public function indexAction()
{
// Send table of column names to populate corresponding dropdowns depending
// on the current selection
if (isset($_REQUEST['getDropdownValues']) && $_REQUEST['getDropdownValues'] === 'true') {
// if both db and table are selected
if (isset($_REQUEST['foreignTable'])) {
$this->getDropdownValueForTableAction();
} else {
// if only the db is selected
$this->getDropdownValueForDbAction();
}
return;
}
$this->response->getHeader()->getScripts()->addFiles(array('tbl_relation.js', 'indexes.js'));
// Gets tables information
include_once 'libraries/tbl_info.inc.php';
// updates for Internal relations
if (isset($_POST['destination_db']) && $this->cfgRelation['relwork']) {
$this->updateForInternalRelationAction();
}
// updates for foreign keys
if (isset($_POST['destination_foreign_db'])) {
$this->updateForForeignKeysAction();
}
// Updates for display field
if ($this->cfgRelation['displaywork'] && isset($_POST['display_field'])) {
$this->updateForDisplayField();
}
// If we did an update, refresh our data
if (isset($_POST['destination_db']) && $this->cfgRelation['relwork']) {
$this->existrel = PMA_getForeigners($this->db, $this->table, '', 'internal');
}
if (isset($_POST['destination_foreign_db']) && Util::isForeignKeySupported($this->tbl_storage_engine)) {
$this->existrel_foreign = PMA_getForeigners($this->db, $this->table, '', 'foreign');
}
if ($this->cfgRelation['displaywork']) {
$this->disp = PMA_getDisplayField($this->db, $this->table);
}
// display secondary level tabs if necessary
$engine = $this->dbi->getTable($this->db, $this->table)->getStatusInfo('ENGINE');
$this->response->addHTML(Template::get('table/secondary_tabs')->render(array('url_params' => array('db' => $GLOBALS['db'], 'table' => $GLOBALS['table']), 'engine' => $engine)));
$this->response->addHTML('<div id="structure_content">');
/**
* Dialog
*/
// Now find out the columns of our $table
// need to use DatabaseInterface::QUERY_STORE with $this->dbi->numRows()
// in mysqli
$columns = $this->dbi->getColumns($this->db, $this->table);
// common form
$this->response->addHTML(Template::get('table/relation/common_form')->render(array('db' => $this->db, 'table' => $this->table, 'columns' => $columns, 'cfgRelation' => $this->cfgRelation, 'tbl_storage_engine' => $this->tbl_storage_engine, 'existrel' => isset($this->existrel) ? $this->existrel : array(), 'existrel_foreign' => isset($this->existrel_foreign) ? $this->existrel_foreign['foreign_keys_data'] : array(), 'options_array' => $this->options_array)));
if (Util::isForeignKeySupported($this->tbl_storage_engine)) {
$this->response->addHTML(PMA_getHtmlForDisplayIndexes());
}
$this->response->addHTML('</div>');
}