本文整理汇总了PHP中WT_DB::updateSchema方法的典型用法代码示例。如果您正苦于以下问题:PHP WT_DB::updateSchema方法的具体用法?PHP WT_DB::updateSchema怎么用?PHP WT_DB::updateSchema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WT_DB
的用法示例。
在下文中一共展示了WT_DB::updateSchema方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
// Create GM tables, if not already present
try {
WT_DB::updateSchema(WT_ROOT . WT_MODULES_DIR . '/googlemap/db_schema/', 'GM_SCHEMA_VERSION', 5);
} catch (PDOException $ex) {
// The schema update scripts should never fail. If they do, there is no clean recovery.
die($ex);
}
// Set default values
try {
// TODO: do this once only, in a db_schema upgrade script?
$this->setSetting('GM_MAP_TYPE', $this->getSetting('GM_MAP_TYPE', 'G_NORMAL_MAP'));
// G_PHYSICAL_MAP, G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP
$this->setSetting('GM_MAX_ZOOM', $this->getSetting('GM_MAX_ZOOM', '20'));
// max zoom level
$this->setSetting('GM_MIN_ZOOM', $this->getSetting('GM_MIN_ZOOM', '2'));
// min zoom level
$this->setSetting('GM_PRECISION_0', $this->getSetting('GM_PRECISION_0', '0'));
// Country level
$this->setSetting('GM_PRECISION_1', $this->getSetting('GM_PRECISION_1', '1'));
// State level
$this->setSetting('GM_PRECISION_2', $this->getSetting('GM_PRECISION_2', '2'));
// City level
$this->setSetting('GM_PRECISION_3', $this->getSetting('GM_PRECISION_3', '3'));
// Neighborhood level
$this->setSetting('GM_PRECISION_4', $this->getSetting('GM_PRECISION_4', '4'));
// House level
$this->setSetting('GM_PRECISION_5', $this->getSetting('GM_PRECISION_5', '5'));
// Max prcision level
$this->setSetting('GM_XSIZE', $this->getSetting('GM_XSIZE', '600'));
// X-size of Google map
$this->setSetting('GM_YSIZE', $this->getSetting('GM_YSIZE', '400'));
// Y-size of Google map
$this->setSetting('GM_PH_XSIZE', $this->getSetting('GM_PH_XSIZE', '500'));
// X-size of Place Hierarchy Google map
$this->setSetting('GM_PH_YSIZE', $this->getSetting('GM_PH_YSIZE', '350'));
// Y-size of Place Hierarchy Google map
$this->setSetting('GM_PH_MARKER', $this->getSetting('GM_PH_MARKER', 'G_FLAG'));
// Possible values: G_FLAG = Flag, G_DEFAULT_ICON = Standard icon
$this->setSetting('GM_DISP_SHORT_PLACE', $this->getSetting('GM_DISP_SHORT_PLACE', '0'));
// Display full place name or only the actual level name
} catch (Exception $ex) {
// Perhaps the module hasn't been installed yet (no entry in wt_modules)
}
}
示例2: header
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
if (!defined('WT_WEBTREES')) {
header('HTTP/1.0 403 Forbidden');
exit;
}
// Create tables, if not already present
try {
WT_DB::updateSchema(WT_MODULES_DIR, 'user_blog/db_schema/', 'NB_SCHEMA_VERSION', 3);
} catch (PDOException $ex) {
// The schema update scripts should never fail. If they do, there is no clean recovery.
die($ex);
}
class user_blog_WT_Module extends WT_Module implements WT_Module_Block
{
// Extend class WT_Module
public function getTitle()
{
return WT_I18N::translate('Journal');
}
// Extend class WT_Module
public function getDescription()
{
return WT_I18N::translate('A private area to record notes or keep a journal.');
示例3: header
} else {
// No config file. Set one up.
header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'setup.php');
exit;
}
$WT_REQUEST = new Zend_Controller_Request_Http();
require WT_ROOT . 'includes/authentication.php';
// Connect to the database
try {
WT_DB::createInstance($dbconfig['dbhost'], $dbconfig['dbport'], $dbconfig['dbname'], $dbconfig['dbuser'], $dbconfig['dbpass']);
define('WT_TBLPREFIX', $dbconfig['tblpfx']);
unset($dbconfig);
// Some of the FAMILY JOIN HUSBAND JOIN WIFE queries can excede the MAX_JOIN_SIZE setting
WT_DB::exec("SET NAMES 'utf8' COLLATE 'utf8_unicode_ci', SQL_BIG_SELECTS=1");
try {
WT_DB::updateSchema(WT_ROOT . 'includes/db_schema/', 'WT_SCHEMA_VERSION', WT_SCHEMA_VERSION);
} catch (PDOException $ex) {
// The schema update scripts should never fail. If they do, there is no clean recovery.
die($ex);
}
} catch (PDOException $ex) {
header('Location: ' . WT_SERVER_NAME . WT_SCRIPT_PATH . 'site-unavailable.php');
exit;
}
// The config.ini.php file must always be in a fixed location.
// Other user files can be stored elsewhere...
define('WT_DATA_DIR', realpath(WT_Site::preference('INDEX_DIRECTORY') ? WT_Site::preference('INDEX_DIRECTORY') : 'data') . DIRECTORY_SEPARATOR);
// If we have a preferred URL (e.g. www.example.com instead of www.isp.com/~example), then redirect to it.
$SERVER_URL = WT_Site::preference('SERVER_URL');
if ($SERVER_URL && $SERVER_URL != WT_SERVER_NAME . WT_SCRIPT_PATH) {
header('Location: ' . $SERVER_URL . WT_SCRIPT_NAME . (isset($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : ''), true, 301);
示例4: updateSchema
protected static function updateSchema()
{
// Create tables, if not already present
try {
WT_DB::updateSchema(WT_ROOT . WT_MODULES_DIR . 'gedcom_favorites/db_schema/', 'FV_SCHEMA_VERSION', 4);
} catch (PDOException $ex) {
// The schema update scripts should never fail. If they do, there is no clean recovery.
die($ex);
}
}