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


PHP Output::verbose方法代码示例

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


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

示例1: load

 public function load($db)
 {
     foreach ($this->buildQueries() as $query) {
         Output::verbose($query);
         if (!$db->query($query)) {
             Output::verbose("Fail\n{$query}\n{$db->error}");
         }
     }
 }
开发者ID:sdgdsffdsfff,项目名称:MMP,代码行数:9,代码来源:AbstractSchema.class.php

示例2: runStrategy

 public function runStrategy()
 {
     $db = Helper::getDbObject();
     $tmpdb = Helper::getTmpDbObject();
     Helper::loadTmpDb($tmpdb);
     $diff = new dbDiff($db, $tmpdb);
     $difference = $diff->getDifference();
     if (!count($difference['up']) && !count($difference['down'])) {
         echo 'Your database has no changes from last revision' . PHP_EOL;
         return false;
     }
     $version = Helper::getCurrentVersion();
     $filename = Helper::get('savedir') . "/migration{$version}.php";
     $content = Helper::createMigrationContent($version, $difference);
     file_put_contents($filename, $content);
     Output::verbose("file: {$filename} written!");
     $vTab = Helper::get('versiontable');
     $db->query("INSERT INTO `{$vTab}` SET rev={$version}");
     return true;
 }
开发者ID:sdgdsffdsfff,项目名称:MMP,代码行数:20,代码来源:createController.class.php

示例3: getConstraintForColumn

 protected function getConstraintForColumn(mysqli $connection, $table, $col_name)
 {
     $q = "select database() as dbname";
     $res = $connection->query($q);
     $row = $res->fetch_array(MYSQLI_ASSOC);
     $dbname = $row['dbname'];
     Output::verbose("DATABASE: {$row['dbname']}");
     $sql = "SELECT k.CONSTRAINT_SCHEMA,k.CONSTRAINT_NAME,k.TABLE_NAME,k.COLUMN_NAME,k.REFERENCED_TABLE_NAME,k.REFERENCED_COLUMN_NAME, r.UPDATE_RULE, r.DELETE_RULE FROM information_schema.key_column_usage k LEFT JOIN information_schema.referential_constraints r ON r.CONSTRAINT_SCHEMA = k.CONSTRAINT_SCHEMA AND k.REFERENCED_TABLE_NAME=r.REFERENCED_TABLE_NAME LEFT JOIN information_schema.table_constraints t ON t.CONSTRAINT_SCHEMA = r.CONSTRAINT_SCHEMA WHERE k.constraint_schema='{$dbname}' AND t.CONSTRAINT_TYPE='FOREIGN KEY' AND k.TABLE_NAME='{$table}' AND r.TABLE_NAME='{$table}' AND t.TABLE_NAME='{$table}' AND k.COLUMN_NAME='{$col_name}'";
     Output::verbose($sql);
     $res = $connection->query($sql);
     $row = $res->fetch_array(MYSQLI_ASSOC);
     if (!count($row)) {
         return false;
     }
     $constraint = array('table' => $table, 'name' => $row['CONSTRAINT_NAME'], 'column' => $row['COLUMN_NAME'], 'reference' => array('table' => $row['REFERENCED_TABLE_NAME'], 'column' => $row['REFERENCED_COLUMN_NAME'], 'update' => $row['UPDATE_RULE'], 'delete' => $row['DELETE_RULE']));
     //echo "=================\n\n\n\=========";
     //var_dump($constraint);
     return $constraint;
 }
开发者ID:sdgdsffdsfff,项目名称:MMP,代码行数:19,代码来源:dbDiff.class.php

示例4: runDown

 /**
  * Revert this migration
  */
 public function runDown()
 {
     foreach ($this->buildPredown() as $query) {
         Output::verbose('PREDOWN: ' . $query);
         if ($this->db->query($query)) {
             Output::verbose("Ok");
         } else {
             Output::verbose($this->db->error);
         }
     }
     foreach ($this->buildDown() as $query) {
         Output::verbose('DOWN:' . $query);
         $this->db->query($query);
     }
     foreach ($this->buildPostdown() as $query) {
         Output::verbose('POSTDOWN: ' . $query);
         if ($this->db->query($query)) {
             Output::verbose("Ok");
         } else {
             Output::verbose($this->db->error);
         }
     }
     $verT = Helper::get('versiontable');
     $rev = $this->getRev();
     $query = "DELETE FROM `{$verT}` WHERE `rev`={$rev}";
     Output::verbose($query);
     $this->db->query($query);
 }
开发者ID:sdgdsffdsfff,项目名称:MMP,代码行数:31,代码来源:AbstractMigration.class.php

示例5: getTmpDbObject

 static function getTmpDbObject()
 {
     $config = self::getConfig();
     $tmpname = $config['db'] . '_' . self::getCurrentVersion();
     $config['db'] = $tmpname;
     $db = self::getDbObject();
     $db->query("create database `{$config['db']}`");
     $tmpdb = self::getDbObject($config);
     $tmpdb->query("SET FOREIGN_KEY_CHECKS = 0");
     register_shutdown_function(function () use($config, $tmpdb) {
         Output::verbose("database {$config['db']} has been dropped");
         $tmpdb->query("DROP DATABASE `{$config['db']}`");
     });
     return $tmpdb;
 }
开发者ID:skyeryg,项目名称:MMP,代码行数:15,代码来源:Helper.class.php


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