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


PHP CM_Db_Db::exec方法代码示例

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


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

示例1: tearDown

 public function tearDown()
 {
     CM_Db_Db::exec('DROP TABLE `test`');
     $paging = new CM_PagingSource_Sql('`num`', 'test');
     $paging->enableCache();
     $paging->clearCache();
 }
开发者ID:cargomedia,项目名称:cm,代码行数:7,代码来源:AbstractTest.php

示例2: setUpBeforeClass

    public static function setUpBeforeClass()
    {
        $switzerland = CM_Db_Db::insert('cm_model_location_country', array('abbreviation' => 'CH', 'name' => 'Switzerland'));
        $germany = CM_Db_Db::insert('cm_model_location_country', array('abbreviation' => 'DE', 'name' => 'Germany'));
        $baselStadt = CM_Db_Db::insert('cm_model_location_state', array('countryId' => $switzerland, 'name' => 'Basel-Stadt'));
        $zuerich = CM_Db_Db::insert('cm_model_location_state', array('countryId' => $switzerland, 'name' => 'Zürich'));
        $basel = CM_Db_Db::insert('cm_model_location_city', array('stateId' => $baselStadt, 'countryId' => $switzerland, 'name' => 'Basel', 'lat' => 47.569535, 'lon' => 7.574063));
        $winterthur = CM_Db_Db::insert('cm_model_location_city', array('stateId' => $zuerich, 'countryId' => $switzerland, 'name' => 'Winterthur', 'lat' => 47.502315, 'lon' => 8.724947));
        $baselZip = CM_Db_Db::insert('cm_model_location_zip', array('cityId' => $basel, 'name' => '4056', 'lat' => 47.569535, 'lon' => 7.574063));
        CM_Db_Db::insert('cm_model_location_zip', array('cityId' => $basel, 'name' => '4057', 'lat' => 47.574155, 'lon' => 7.592993));
        $location = CM_Db_Db::exec('SELECT `1`.`id` `1.id`, `1`.`name` `1.name`,
				`2`.`id` `2.id`, `2`.`name` `2.name`,
				`3`.`id` `3.id`, `3`.`name` `3.name`, `3`.`lat` `3.lat`, `3`.`lon` `3.lon`,
				`4`.`id` `4.id`, `4`.`name` `4.name`, `4`.`lat` `4.lat`, `4`.`lon` `4.lon`
			FROM `cm_model_location_zip` AS `4`
			JOIN `cm_model_location_city` AS `3` ON(`4`.`cityId`=`3`.`id`)
			JOIN `cm_model_location_state` AS `2` ON(`3`.`stateId`=`2`.`id`)
			JOIN `cm_model_location_country` AS `1` ON(`3`.`countryId`=`1`.`id`)
			LIMIT 1')->fetch();
        self::$_fields[CM_Model_Location::LEVEL_COUNTRY] = array('id' => (int) $location['1.id'], 'name' => $location['1.name']);
        self::$_fields[CM_Model_Location::LEVEL_STATE] = array('id' => (int) $location['2.id'], 'name' => $location['2.name']);
        self::$_fields[CM_Model_Location::LEVEL_CITY] = array('id' => (int) $location['3.id'], 'name' => $location['3.name']);
        self::$_fields[CM_Model_Location::LEVEL_ZIP] = array('id' => (int) $location['4.id'], 'name' => $location['4.name']);
        self::$_switzerlandId = $switzerland;
        self::$_baselStadtId = $baselStadt;
        self::$_baselId = $basel;
        self::$_baselZipId = $baselZip;
    }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:28,代码来源:LocationTest.php

示例3: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     CM_Db_Db::exec("DROP TABLE `indexTest_1`");
     CM_Db_Db::exec("DROP TABLE `indexTest_2`");
     CM_Db_Db::exec("DROP TABLE `indexTest_3`");
     parent::tearDownAfterClass();
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:7,代码来源:ElasticsearchTest.php

示例4: _dbToFileSql

 /**
  * @param string $namespace
  */
 private function _dbToFileSql($namespace)
 {
     $namespace = (string) $namespace;
     $tables = CM_Db_Db::exec("SHOW TABLES LIKE ?", array(strtolower($namespace) . '_%'))->fetchAllColumn();
     sort($tables);
     $dump = CM_Db_Db::getDump($tables, true);
     CM_File::create(CM_Util::getModulePath($namespace) . '/resources/db/structure.sql', $dump);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:11,代码来源:Cli.php

示例5: _deleteOlderThan

 /**
  * @param int $age
  */
 protected function _deleteOlderThan($age)
 {
     $age = (int) $age;
     $type = $this->getType();
     $deleteOlderThan = time() - $age;
     CM_Db_Db::exec('DELETE FROM `cm_log` WHERE `timestamp` <= ? AND `type` = ?', array($deleteOlderThan, $type));
     $this->_change();
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:11,代码来源:Abstract.php

示例6: reload

 public function reload(CM_OutputStream_Interface $output)
 {
     $tableNames = CM_Db_Db::exec('SHOW TABLES')->fetchAllColumn();
     CM_Db_Db::exec('SET foreign_key_checks = 0;');
     foreach ($tableNames as $table) {
         CM_Db_Db::delete($table);
     }
     CM_Db_Db::exec('SET foreign_key_checks = 1;');
     $this->_setInitialVersion();
 }
开发者ID:cargomedia,项目名称:cm,代码行数:10,代码来源:SetupScript.php

示例7: setUp

 public function setUp()
 {
     CM_Db_Db::exec('ALTER TABLE cm_model_location_ip AUTO_INCREMENT = 1');
     CM_Db_Db::exec('ALTER TABLE cm_model_location_zip AUTO_INCREMENT = 1');
     CM_Db_Db::exec('ALTER TABLE cm_model_location_city AUTO_INCREMENT = 1');
     CM_Db_Db::exec('ALTER TABLE cm_model_location_state AUTO_INCREMENT = 1');
     CM_Db_Db::exec('ALTER TABLE cm_model_location_country AUTO_INCREMENT = 1');
     $this->_errorStream = new CM_OutputStream_Null();
     $file = new CM_File('/CM_OutputStream_File-' . uniqid(), CM_Service_Manager::getInstance()->getFilesystems()->getTmp());
     $file->truncate();
     $this->_outputStream = new CM_OutputStream_File($file);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:12,代码来源:MaxMindTest.php

示例8: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     parent::tearDownAfterClass();
     CM_Db_Db::exec('DROP TABLE `test`');
 }
开发者ID:NicolasSchmutz,项目名称:cm,代码行数:5,代码来源:StatementTest.php

示例9: VARCHAR

<?php

if (!CM_Db_Db::existsColumn('cm_streamChannelArchive_media', 'key')) {
    CM_Db_Db::exec("ALTER TABLE cm_streamChannelArchive_media ADD `key` VARCHAR(64) DEFAULT NULL, ADD INDEX (`key`)");
}
开发者ID:cargomedia,项目名称:cm,代码行数:5,代码来源:59.php

示例10: tearDown

 public function tearDown()
 {
     CM_Db_Db::exec('DROP TABLE `test`');
 }
开发者ID:cargomedia,项目名称:cm,代码行数:4,代码来源:ResultTest.php

示例11: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     parent::tearDownAfterClass();
     CM_Db_Db::exec("DROP TABLE `cm_modelmock`");
     CM_Db_Db::exec("DROP TABLE `modelThasIsAnAssetMock`");
 }
开发者ID:aladin1394,项目名称:CM,代码行数:6,代码来源:AbstractTest.php

示例12: decimal

<?php

if ('1.00' === CM_Db_Db::describeColumn('cm_splittestVariation_fixture', 'conversionWeight')->getDefaultValue()) {
    CM_Db_Db::exec('ALTER TABLE cm_splittestVariation_fixture
      MODIFY COLUMN conversionWeight decimal(10,2) NOT NULL DEFAULT 0');
    CM_Db_Db::update('cm_splittestVariation_fixture', array('conversionWeight' => 0), array('conversionStamp' => null));
}
开发者ID:cargomedia,项目名称:cm,代码行数:7,代码来源:39.php

示例13: while

<?php

return;
$rows = CM_Db_Db::execRead('SELECT `id`, `thumbnailCount` FROM cm_streamChannel_media WHERE thumbnailCount > 0');
while ($row = $rows->fetch()) {
    CM_Db_Db::exec('UPDATE cm_streamChannel_media SET `data`=? WHERE `id`=? ', [CM_Params::encode(['thumbnailCount' => (int) $row['thumbnailCount']], true), $row['id']]);
}
$rows = CM_Db_Db::execRead('SELECT `id`, `thumbnailCount` FROM cm_streamChannelArchive_media WHERE thumbnailCount > 0');
while ($row = $rows->fetch()) {
    CM_Db_Db::exec('UPDATE cm_streamChannelArchive_media SET `data`=? WHERE `id`=? ', [CM_Params::encode(['thumbnailCount' => (int) $row['thumbnailCount']], true), $row['id']]);
}
开发者ID:cargomedia,项目名称:cm,代码行数:11,代码来源:56.php

示例14: int

<?php

if (CM_Db_Db::describeColumn('cm_stream_publish', 'allowedUntil')->getAllowNull()) {
    CM_Db_Db::exec('ALTER TABLE `cm_stream_publish` CHANGE `allowedUntil` `allowedUntil` int(10) unsigned NOT NULL');
}
if (CM_Db_Db::describeColumn('cm_stream_subscribe', 'allowedUntil')->getAllowNull()) {
    CM_Db_Db::exec('ALTER TABLE `cm_stream_subscribe` CHANGE `allowedUntil` `allowedUntil` int(10) unsigned NOT NULL');
}
开发者ID:cargomedia,项目名称:cm,代码行数:8,代码来源:17.php

示例15: INT

<?php

if (!CM_Db_Db::describeColumn('cm_stream_subscribe', 'allowedUntil')->getAllowNull()) {
    CM_Db_Db::exec("ALTER TABLE cm_stream_subscribe CHANGE allowedUntil allowedUntil INT(10) UNSIGNED DEFAULT NULL");
}
if (!CM_Db_Db::describeColumn('cm_stream_publish', 'allowedUntil')->getAllowNull()) {
    CM_Db_Db::exec("ALTER TABLE cm_stream_publish CHANGE allowedUntil allowedUntil INT(10) UNSIGNED DEFAULT NULL");
}
开发者ID:cargomedia,项目名称:cm,代码行数:8,代码来源:64.php


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