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


PHP w2p_Database_Query::createDefinition方法代码示例

本文整理汇总了PHP中w2p_Database_Query::createDefinition方法的典型用法代码示例。如果您正苦于以下问题:PHP w2p_Database_Query::createDefinition方法的具体用法?PHP w2p_Database_Query::createDefinition怎么用?PHP w2p_Database_Query::createDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在w2p_Database_Query的用法示例。


在下文中一共展示了w2p_Database_Query::createDefinition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: install

    public function install(CAppUI $AppUI = null)
    {
        global $AppUI;
        $q = new w2p_Database_Query();
        $q->createTable('history');
        $sql = ' (
			history_id int(10) unsigned NOT NULL auto_increment,
			history_date datetime NOT NULL default \'0000-00-00 00:00:00\',		  
			history_user int(10) NOT NULL default \'0\',
			history_action varchar(20) NOT NULL default \'modify\',
			history_item int(10) NOT NULL,
			history_table varchar(20) NOT NULL default \'\',
			history_project int(10) NOT NULL default \'0\',
			history_name varchar(255),
			history_changes text,
			history_description text,
			PRIMARY KEY  (history_id),
			INDEX index_history_module (history_table, history_item),
		  	INDEX index_history_item (history_item) 
			) TYPE=MyISAM';
        $q->createDefinition($sql);
        $q->exec();
        $perms = $AppUI->acl();
        return $perms->registerModule('History', 'history');
    }
开发者ID:eureka2,项目名称:web2project,代码行数:25,代码来源:setup.php

示例2: install

    public function install()
    {
        global $AppUI;
        $q = new w2p_Database_Query();
        $q->createTable('planner');
        $sql = '(
			planner_id int(10) unsigned NOT NULL AUTO_INCREMENT,
			
			PRIMARY KEY  (planner_id))
			ENGINE = MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci';
        $q->createDefinition($sql);
        $q->exec();
        /*                $q->clear();
                        $q->addTable('planner','dw');
                        $q->addInsert('dokuwiki_URL_use','dokuwiki_base_URL');
                        $q->addInsert('dokuwiki_URL','http://localhost/dokuwiki/');
        		$q->exec();
        
                        $q->clear();
                        $q->addTable('dokuwiki','dw');
                        $q->addInsert('dokuwiki_URL','http://localhost/dwiki/doku.php?id=projects');
                        $q->addInsert('dokuwiki_URL_use','dokuwiki_projects_namespace');
        		$q->exec();
                        $q->clear();
                        $q->addTable('dokuwiki','dw');
                        $q->addInsert('dokuwiki_URL','');
                        $q->addInsert('dokuwiki_URL_use','dokuwiki_tasks_sub_namespace');
        		$q->exec();
                        $q->clear();
                        $q->addTable('dokuwiki','dw');
                        $q->addInsert('dokuwiki_URL','http://localhost/dwiki/doku.php?id=contacts');
                        $q->addInsert('dokuwiki_URL_use','dokuwiki_contacs_namespace');
        		$q->exec();
                        
                        $f['dokuwiki_URL']='';
        //                $f['dw.dokuwiki_id']=1;
                        $f['dokuwiki_URL_use']='dokuwiki_base_URL';
                        $q->clear();
                        $q->addTable('dokuwiki','dw');
        //                $f['dw.dokuwiki_id']=2;
                        $f['dw.dokuwiki_URL_use']='dokuwiki_projects_namespace';
                        $q->addInsert($f);
        		$q->exec();
                        $q->clear();
                        $q->addTable('dokuwiki','dw');
        //                $f['dw.dokuwiki_id']=3;
                        $f['dw.dokuwiki_URL_use']='dokuwiki_tasks_namespace';
                        $q->addInsert($f);
        		$q->exec();
                            
        
        */
        $perms = $AppUI->acl();
        return $perms->registerModule('Planner', 'planner');
    }
开发者ID:caseysoftware,项目名称:web2project-planner,代码行数:55,代码来源:setup.php

示例3: install

 public function install()
 {
     global $AppUI;
     $q = new w2p_Database_Query();
     $q->createTable('links');
     $q->createDefinition('(
         link_id int( 11 ) NOT NULL AUTO_INCREMENT ,
         link_url varchar( 255 ) NOT NULL default "",
         link_project int( 11 ) NOT NULL default "0",
         link_task int( 11 ) NOT NULL default "0",
         link_name varchar( 255 ) NOT NULL default "",
         link_parent int( 11 ) default "0",
         link_description text,
         link_owner int( 11 ) default "0",
         link_date datetime default NULL ,
         link_icon varchar( 20 ) default "obj/",
         link_category int( 11 ) NOT NULL default "0",
         PRIMARY KEY ( link_id ) ,
         KEY idx_link_task ( link_task ) ,
         KEY idx_link_project ( link_project ) ,
         KEY idx_link_parent ( link_parent )
         ) ENGINE = MYISAM DEFAULT CHARSET=utf8 ');
     $q->exec($sql);
     $i = 0;
     $linkTypes = array('Unknown', 'Document', 'Application');
     foreach ($linkTypes as $linkType) {
         $q->clear();
         $q->addTable('sysvals');
         $q->addInsert('sysval_key_id', 1);
         $q->addInsert('sysval_title', 'LinkType');
         $q->addInsert('sysval_value', $linkType);
         $q->addInsert('sysval_value_id', $i);
         $q->exec();
         $i++;
     }
     $perms = $AppUI->acl();
     return $perms->registerModule('Links', 'links');
 }
开发者ID:,项目名称:,代码行数:38,代码来源:

示例4: upgrade

 public function upgrade($old_version)
 {
     switch ($old_version) {
         case '0.1':
             // There is no way to change the name of database field with w2p_Database_Query().
             db_exec("ALTER TABLE holiday CHANGE holiday_white holiday_type int(10) NOT NULL DEFAULT '0'");
             if (db_error()) {
                 return false;
             }
             $q = new w2p_Database_Query();
             $q->alterTable('holiday');
             $q->createDefinition('index holiday_start_end_date (holiday_start_date, holiday_end_date)');
             $q->exec();
             $q->clear();
             $q->alterTable('holiday');
             $q->createDefinition('index holiday_start_end_date (holiday_start_date, holiday_end_date)');
             $q->exec();
             $q->clear();
             $q->alterTable('holiday');
             $q->createDefinition('index holiday_user (holiday_user)');
             $q->exec();
             $q->clear();
             $q->alterTable('holiday');
             $q->createDefinition('index holiday_type (holiday_type)');
             $q->exec();
             $q->clear();
         default:
     }
     return true;
 }
开发者ID:Raithlin,项目名称:web2project-holiday,代码行数:30,代码来源:setup.php


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