当前位置: 首页>>代码示例>>PHP>>正文


PHP WT_DB::updateSchema方法代码示例

本文整理汇总了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)
     }
 }
开发者ID:jacoline,项目名称:webtrees,代码行数:47,代码来源:module.php

示例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.');
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:module.php

示例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);
开发者ID:brambravo,项目名称:webtrees,代码行数:31,代码来源:session.php

示例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);
     }
 }
开发者ID:brambravo,项目名称:webtrees,代码行数:10,代码来源:module.php


注:本文中的WT_DB::updateSchema方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。