Medoo是一款轻量级的php数据库操作类,下面不会介绍Medoo的使用方法,想学习Medoo请前往官网自学:http://medoo.in/

  在接触Medoo之前,一直是用自己写的php数据库操作类,而发现Medoo立马就喜欢上了它,但是对它的调试方式不喜欢。

  Medoo提供两种调试,分别是:

  error()

  1. $database = new medoo("my_database");
  2.  
  3. $database->select("bccount", [
  4. "user_name",
  5. "email"
  6. ], [
  7. "user_id[<]" => 20
  8. ]);
  9.  
  10. var_dump($database->error());
  11.  
  12. // array(3) { [0]=> string(5) "42S02" [1]=> int(1146) [2]=> string(36) "Table 'my_database.bccount' doesn't exist" }

  last_query()

  1. $database = new medoo("my_database");
  2.  
  3. $database->select("account", [
  4. "user_name",
  5. "email"
  6. ], [
  7. "user_id[<]" => 20
  8. ]);
  9.  
  10. echo $database->last_query();
  11. // SELECT user_name, email FROM account WHERE user_id < 20

  对于last_query()的使用我个人挺不习惯的,首先使用太麻烦,我坚决认为调试输出报错信息或者sql语句的操作一定要简单便捷,不要为了输出一句sql语句还要写一行代码,这样很容易打断我的思路。

  所以我对Medoo的每一个query方法都增加了一个对应调试方法,就是在方法名前增加一个“_”,比如最常见的select方法:

  1. $database = new medoo("my_database");
  2.  
  3. $database->_select("account", [
  4. "user_name",
  5. "email"
  6. ], [
  7. "user_id[<]" => 20
  8. ]);
  9. // SELECT user_name, email FROM account WHERE user_id < 20

  同样其它的insert、update、delete、replace、get、has、count、max、min、avg、sum方法也都可以用这样方式快速输出sql语句。

  当然我新增的这种调试方式,也不会影响Medoo原有的两种调试方式。

  下面就是修改版源码了,基于Medoo 0.9.1.1修改

  1. <?php
  2. /*!
  3. * Medoo database framework
  4. * http://medoo.in
  5. * Version 0.9.1.1
  6. *
  7. * Copyright 2013, Angel Lai
  8. * Released under the MIT license
  9. *
  10. * @代码小睿 修改如下:
  11. * 增加PDO事务
  12. * query exec select insert update delete replace get has count max min avg sum 方法各增加直接输出 sql 语句的方法
  13. * 如 select 则对应 _select 方法
  14. */
  15. class medoo{
  16. protected $database_type = 'mysql';
  17.  
  18. // For MySQL, MSSQL, Sybase
  19. protected $server = 'localhost';
  20. protected $username = 'username';
  21. protected $password = 'password';
  22.  
  23. // For SQLite
  24. protected $database_file = '';
  25.  
  26. // Optional
  27. protected $port = 3306;
  28. protected $charset = 'utf8';
  29. protected $database_name = '';
  30. protected $option = array();
  31.  
  32. // Variable
  33. protected $queryString;
  34.  
  35. // Debug
  36. protected $debug = false;
  37.  
  38. public function __construct($options){
  39. try{
  40. $commands = array();
  41. if(is_string($options)){
  42. if(strtolower($this->database_type) == 'sqlite'){
  43. $this->database_file = $options;
  44. }else{
  45. $this->database_name = $options;
  46. }
  47. }else{
  48. foreach($options as $option => $value){
  49. $this->$option = $value;
  50. }
  51. }
  52. $type = strtolower($this->database_type);
  53. if(isset($this->port) && is_int($this->port * 1)){
  54. $port = $this->port;
  55. }
  56. $set_charset = "SET NAMES '" . $this->charset . "'";
  57. switch($type){
  58. case 'mariadb':
  59. $type = 'mysql';
  60. case 'mysql':
  61. // Make MySQL using standard quoted identifier
  62. $commands[] = 'SET SQL_MODE=ANSI_QUOTES';
  63. case 'pgsql':
  64. $dsn = $type . ':host=' . $this->server . (isset($port) ? ';port=' . $port : '') . ';dbname=' . $this->database_name;
  65. $commands[] = $set_charset;
  66. break;
  67. case 'sybase':
  68. $dsn = $type . ':host=' . $this->server . (isset($port) ? ',' . $port : '') . ';dbname=' . $this->database_name;
  69. $commands[] = $set_charset;
  70. break;
  71. case 'mssql':
  72. $dsn = strpos(PHP_OS, 'WIN') !== false ?
  73. 'sqlsrv:server=' . $this->server . (isset($port) ? ',' . $port : '') . ';database=' . $this->database_name :
  74. 'dblib:host=' . $this->server . (isset($port) ? ':' . $port : '') . ';dbname=' . $this->database_name;
  75. // Keep MSSQL QUOTED_IDENTIFIER is ON for standard quoting
  76. $commands[] = 'SET QUOTED_IDENTIFIER ON';
  77. $commands[] = $set_charset;
  78. break;
  79. case 'sqlite':
  80. $dsn = $type . ':' . $this->database_file;
  81. $this->username = null;
  82. $this->password = null;
  83. break;
  84. }
  85. $this->pdo = new PDO(
  86. $dsn,
  87. $this->username,
  88. $this->password,
  89. $this->option
  90. );
  91. foreach($commands as $value){
  92. $this->pdo->exec($value);
  93. }
  94. }catch(PDOException $e){
  95. throw new Exception($e->getMessage());
  96. }
  97. }
  98.  
  99. public function beginTransaction(){
  100. $this->pdo->beginTransaction();
  101. }
  102. public function commit(){
  103. $this->pdo->commit();
  104. }
  105. public function rollBack(){
  106. $this->pdo->rollBack();
  107. }
  108.  
  109. public function query($query){
  110. $this->queryString = $query;
  111. return $this->debug ? $query : $this->pdo->query($query);
  112. }
  113. public function _query($query){
  114. $this->debug = true;
  115. echo $this->query($query);
  116. }
  117.  
  118. public function exec($query){
  119. $this->queryString = $query;
  120. return $this->debug ? $query : $this->pdo->exec($query);
  121. }
  122. public function _exec($query){
  123. $this->debug = true;
  124. echo $this->exec($query);
  125. }
  126.  
  127. public function quote($string){
  128. return $this->pdo->quote($string);
  129. }
  130.  
  131. protected function column_quote($string){
  132. return '"' . str_replace('.', '"."', $string) . '"';
  133. }
  134.  
  135. protected function column_push($columns){
  136. if($columns == '*'){
  137. return $columns;
  138. }
  139. if(is_string($columns)){
  140. $columns = array($columns);
  141. }
  142. $stack = array();
  143. foreach($columns as $key => $value){
  144. preg_match('/([a-zA-Z0-9_\-\.]*)\s*\(([a-zA-Z0-9_\-]*)\)/i', $value, $match);
  145. if(isset($match[1]) && isset($match[2])){
  146. array_push($stack, $this->column_quote( $match[1] ) . ' AS ' . $this->column_quote( $match[2] ));
  147. }else{
  148. array_push($stack, $this->column_quote( $value ));
  149. }
  150. }
  151. return implode($stack, ',');
  152. }
  153.  
  154. protected function array_quote($array){
  155. $temp = array();
  156. foreach($array as $value){
  157. $temp[] = is_int($value) ? $value : $this->pdo->quote($value);
  158. }
  159. return implode($temp, ',');
  160. }
  161.  
  162. protected function inner_conjunct($data, $conjunctor, $outer_conjunctor){
  163. $haystack = array();
  164. foreach($data as $value){
  165. $haystack[] = '(' . $this->data_implode($value, $conjunctor) . ')';
  166. }
  167. return implode($outer_conjunctor . ' ', $haystack);
  168. }
  169.  
  170. protected function data_implode($data, $conjunctor, $outer_conjunctor = null){
  171. $wheres = array();
  172. foreach($data as $key => $value){
  173. if(($key == 'AND' || $key == 'OR') && is_array($value)){
  174. $wheres[] = 0 !== count(array_diff_key($value, array_keys(array_keys($value)))) ?
  175. '(' . $this->data_implode($value, ' ' . $key) . ')' :
  176. '(' . $this->inner_conjunct($value, ' ' . $key, $conjunctor) . ')';
  177. }else{
  178. preg_match('/([\w\.]+)(\[(\>|\>\=|\<|\<\=|\!|\<\>)\])?/i', $key, $match);
  179. if(isset($match[3])){
  180. if($match[3] == ''){
  181. $wheres[] = $this->column_quote($match[1]) . ' ' . $match[3] . '= ' . $this->quote($value);
  182. }else if($match[3] == '!'){
  183. $column = $this->column_quote($match[1]);
  184. switch(gettype($value)){
  185. case 'NULL':
  186. $wheres[] = $column . ' IS NOT NULL';
  187. break;
  188. case 'array':
  189. $wheres[] = $column . ' NOT IN (' . $this->array_quote($value) . ')';
  190. break;
  191. case 'integer':
  192. case 'double':
  193. $wheres[] = $column . ' != ' . $value;
  194. break;
  195. case 'string':
  196. $wheres[] = $column . ' != ' . $this->quote($value);
  197. break;
  198. }
  199. }else{
  200. if($match[3] == '<>'){
  201. if(is_array($value)){
  202. if(is_numeric($value[0]) && is_numeric($value[1])){
  203. $wheres[] = $this->column_quote($match[1]) . ' BETWEEN ' . $value[0] . ' AND ' . $value[1];
  204. }else{
  205. $wheres[] = $this->column_quote($match[1]) . ' BETWEEN ' . $this->quote($value[0]) . ' AND ' . $this->quote($value[1]);
  206. }
  207. }
  208. }else{
  209. if(is_numeric($value)){
  210. $wheres[] = $this->column_quote($match[1]) . ' ' . $match[3] . ' ' . $value;
  211. }else{
  212. $datetime = strtotime($value);
  213. if($datetime){
  214. $wheres[] = $this->column_quote($match[1]) . ' ' . $match[3] . ' ' . $this->quote(date('Y-m-d H:i:s', $datetime));
  215. }
  216. }
  217. }
  218. }
  219. }else{
  220. if(is_int($key)){
  221. $wheres[] = $this->quote($value);
  222. }else{
  223. $column = $this->column_quote($match[1]);
  224. switch(gettype($value)){
  225. case 'NULL':
  226. $wheres[] = $column . ' IS NULL';
  227. break;
  228. case 'array':
  229. $wheres[] = $column . ' IN (' . $this->array_quote($value) . ')';
  230. break;
  231. case 'integer':
  232. case 'double':
  233. $wheres[] = $column . ' = ' . $value;
  234. break;
  235. case 'string':
  236. $wheres[] = $column . ' = ' . $this->quote($value);
  237. break;
  238. }
  239. }
  240. }
  241. }
  242. }
  243. return implode($conjunctor . ' ', $wheres);
  244. }
  245.  
  246. public function where_clause($where){
  247. $where_clause = '';
  248. if(is_array($where)){
  249. $single_condition = array_diff_key($where, array_flip(
  250. explode(' ', 'AND OR GROUP ORDER HAVING LIMIT LIKE MATCH')
  251. ));
  252. if($single_condition != array()){
  253. $where_clause = ' WHERE ' . $this->data_implode($single_condition, '');
  254. }
  255. if(isset($where['AND'])){
  256. $where_clause = ' WHERE ' . $this->data_implode($where['AND'], ' AND');
  257. }
  258. if(isset($where['OR'])){
  259. $where_clause = ' WHERE ' . $this->data_implode($where['OR'], ' OR');
  260. }
  261. if(isset($where['LIKE'])){
  262. $like_query = $where['LIKE'];
  263. if(is_array($like_query)){
  264. $is_OR = isset($like_query['OR']);
  265. if($is_OR || isset($like_query['AND'])){
  266. $connector = $is_OR ? 'OR' : 'AND';
  267. $like_query = $is_OR ? $like_query['OR'] : $like_query['AND'];
  268. }else{
  269. $connector = 'AND';
  270. }
  271. $clause_wrap = array();
  272. foreach($like_query as $column => $keyword){
  273. if(is_array($keyword)){
  274. foreach($keyword as $key){
  275. $clause_wrap[] = $this->column_quote($column) . ' LIKE ' . $this->quote('%' . $key . '%');
  276. }
  277. }else{
  278. $clause_wrap[] = $this->column_quote($column) . ' LIKE ' . $this->quote('%' . $keyword . '%');
  279. }
  280. }
  281. $where_clause .= ($where_clause != '' ? ' AND ' : ' WHERE ') . '(' . implode($clause_wrap, ' ' . $connector . ' ') . ')';
  282. }
  283. }
  284. if(isset($where['MATCH'])){
  285. $match_query = $where['MATCH'];
  286. if(is_array($match_query) && isset($match_query['columns']) && isset($match_query['keyword'])){
  287. $where_clause .= ($where_clause != '' ? ' AND ' : ' WHERE ') . ' MATCH ("' . str_replace('.', '"."', implode($match_query['columns'], '", "')) . '") AGAINST (' . $this->quote($match_query['keyword']) . ')';
  288. }
  289. }
  290. if(isset($where['GROUP'])){
  291. $where_clause .= ' GROUP BY ' . $this->column_quote($where['GROUP']);
  292. }
  293. if(isset($where['ORDER'])){
  294. preg_match('/(^[a-zA-Z0-9_\-\.]*)(\s*(DESC|ASC))?/', $where['ORDER'], $order_match);
  295. $where_clause .= ' ORDER BY "' . str_replace('.', '"."', $order_match[1]) . '" ' . (isset($order_match[3]) ? $order_match[3] : '');
  296. if(isset($where['HAVING'])){
  297. $where_clause .= ' HAVING ' . $this->data_implode($where['HAVING'], '');
  298. }
  299. }
  300. if(isset($where['LIMIT'])){
  301. if(is_numeric($where['LIMIT'])){
  302. $where_clause .= ' LIMIT ' . $where['LIMIT'];
  303. }
  304. if(is_array($where['LIMIT']) && is_numeric($where['LIMIT'][0]) && is_numeric($where['LIMIT'][1])){
  305. $where_clause .= ' LIMIT ' . $where['LIMIT'][0] . ',' . $where['LIMIT'][1];
  306. }
  307. }
  308. }else{
  309. if($where != null){
  310. $where_clause .= ' ' . $where;
  311. }
  312. }
  313. return $where_clause;
  314. }
  315.  
  316. public function select($table, $join, $columns = null, $where = null){
  317. $table = '"' . $table . '"';
  318. $join_key = is_array($join) ? array_keys($join) : null;
  319. if(strpos($join_key[0], '[') !== false){
  320. $table_join = array();
  321. $join_array = array(
  322. '>' => 'LEFT',
  323. '<' => 'RIGHT',
  324. '<>' => 'FULL',
  325. '><' => 'INNER'
  326. );
  327. foreach($join as $sub_table => $relation){
  328. preg_match('/(\[(\<|\>|\>\<|\<\>)\])?([a-zA-Z0-9_\-]*)/', $sub_table, $match);
  329. if($match[2] != '' && $match[3] != ''){
  330. if(is_string($relation)){
  331. $relation = 'USING ("' . $relation . '")';
  332. }
  333. if(is_array($relation)){
  334. if(isset($relation[0])){ // For ['column1', 'column2']
  335. $relation = 'USING ("' . implode($relation, '", "') . '")';
  336. }else{ // For ['column1' => 'column2']
  337. $relation = 'ON ' . $table . '."' . key($relation) . '" = "' . $match[3] . '"."' . current($relation) . '"';
  338. }
  339. }
  340. $table_join[] = $join_array[ $match[2] ] . ' JOIN "' . $match[3] . '" ' . $relation;
  341. }
  342. }
  343. $table .= ' ' . implode($table_join, ' ');
  344. }else{
  345. $where = $columns;
  346. $columns = $join;
  347. }
  348. $query = $this->query('SELECT ' . $this->column_push($columns) . ' FROM ' . $table . $this->where_clause($where));
  349. return is_string($query) ? $query : ($query ? $query->fetchAll((is_string($columns) && $columns != '*') ? PDO::FETCH_COLUMN : PDO::FETCH_ASSOC) : false);
  350. }
  351. public function _select($table, $join, $columns = null, $where = null){
  352. $this->debug = true;
  353. echo $this->select($table, $join, $columns, $where);
  354. }
  355.  
  356. public function insert($table, $datas){
  357. $lastId = array();
  358. $query = array();
  359. // Check indexed or associative array
  360. if(!isset($datas[0])){
  361. $datas = array($datas);
  362. }
  363. foreach($datas as $data){
  364. $keys = implode('", "', array_keys($data));
  365. $values = array();
  366. foreach($data as $key => $value){
  367. switch(gettype($value)){
  368. case 'NULL':
  369. $values[] = 'NULL';
  370. break;
  371. case 'array':
  372. $values[] = $this->quote(serialize($value));
  373. break;
  374. case 'integer':
  375. case 'double':
  376. case 'string':
  377. $values[] = $this->quote($value);
  378. break;
  379. }
  380. }
  381. $exec = $this->exec('INSERT INTO "' . $table . '" ("' . $keys . '") VALUES (' . implode($values, ', ') . ')');
  382. is_string($exec) ? $query[] = $exec : $lastId[] = $this->pdo->lastInsertId();
  383. }
  384. return $query ? implode('; ', $query) : (count($lastId) > 1 ? $lastId : $lastId[0]);
  385. }
  386. public function _insert($table, $datas){
  387. $this->debug = true;
  388. echo $this->insert($table, $datas);
  389. }
  390.  
  391. public function update($table, $data, $where = null){
  392. $fields = array();
  393. foreach($data as $key => $value){
  394. if(is_array($value)){
  395. $fields[] = $this->column_quote($key) . '=' . $this->quote(serialize($value));
  396. }else{
  397. preg_match('/([\w]+)(\[(\+|\-|\*|\/)\])?/i', $key, $match);
  398. if(isset($match[3])){
  399. if(is_numeric($value)){
  400. $fields[] = $this->column_quote($match[1]) . ' = ' . $this->column_quote($match[1]) . ' ' . $match[3] . ' ' . $value;
  401. }
  402. }else{
  403. $column = $this->column_quote($key);
  404. switch(gettype($value)){
  405. case 'NULL':
  406. $fields[] = $column . ' = NULL';
  407. break;
  408. case 'array':
  409. $fields[] = $column . ' = ' . $this->quote(serialize($value));
  410. break;
  411. case 'integer':
  412. case 'double':
  413. case 'string':
  414. $fields[] = $column . ' = ' . $this->quote($value);
  415. break;
  416. }
  417. }
  418. }
  419. }
  420. return $this->exec('UPDATE "' . $table . '" SET ' . implode(', ', $fields) . $this->where_clause($where));
  421. }
  422. public function _update($table, $data, $where = null){
  423. $this->debug = true;
  424. echo $this->update($table, $data, $where);
  425. }
  426.  
  427. public function delete($table, $where){
  428. return $this->exec('DELETE FROM "' . $table . '"' . $this->where_clause($where));
  429. }
  430. public function _delete($table, $where){
  431. $this->debug = true;
  432. echo $this->delete($table, $where);
  433. }
  434.  
  435. public function replace($table, $columns, $search = null, $replace = null, $where = null){
  436. if(is_array($columns)){
  437. $replace_query = array();
  438. foreach($columns as $column => $replacements){
  439. foreach($replacements as $replace_search => $replace_replacement){
  440. $replace_query[] = $column . ' = REPLACE("' . $column . '", ' . $this->quote($replace_search) . ', ' . $this->quote($replace_replacement) . ')';
  441. }
  442. }
  443. $replace_query = implode(', ', $replace_query);
  444. $where = $search;
  445. }else{
  446. if(is_array($search)){
  447. $replace_query = array();
  448. foreach($search as $replace_search => $replace_replacement){
  449. $replace_query[] = $columns . ' = REPLACE("' . $columns . '", ' . $this->quote($replace_search) . ', ' . $this->quote($replace_replacement) . ')';
  450. }
  451. $replace_query = implode(', ', $replace_query);
  452. $where = $replace;
  453. }else{
  454. $replace_query = $columns . ' = REPLACE("' . $columns . '", ' . $this->quote($search) . ', ' . $this->quote($replace) . ')';
  455. }
  456. }
  457. return $this->exec('UPDATE "' . $table . '" SET ' . $replace_query . $this->where_clause($where));
  458. }
  459. public function _replace($table, $columns, $search = null, $replace = null, $where = null){
  460. $this->debug = true;
  461. echo $this->replace($table, $columns, $search, $replace, $where);
  462. }
  463.  
  464. public function get($table, $columns, $where = null){
  465. if(!isset($where)){
  466. $where = array();
  467. }
  468. $where['LIMIT'] = 1;
  469. $data = $this->select($table, $columns, $where);
  470. return is_string($data) ? $data : (isset($data[0]) ? $data[0] : false);
  471. }
  472. public function _get($table, $columns, $where = null){
  473. $this->debug = true;
  474. echo $this->get($table, $columns, $where);
  475. }
  476.  
  477. public function has($table, $where){
  478. $query = $this->query('SELECT EXISTS(SELECT 1 FROM "' . $table . '"' . $this->where_clause($where) . ')');
  479. return is_string($query) ? $query : $query->fetchColumn() === '1';
  480. }
  481. public function _has($table, $where){
  482. $this->debug = true;
  483. echo $this->has($table, $where);
  484. }
  485.  
  486. public function count($table, $where = null){
  487. $query = $this->query('SELECT COUNT(*) FROM "' . $table . '"' . $this->where_clause($where));
  488. return is_string($query) ? $query : 0 + ($query->fetchColumn());
  489. }
  490. public function _count($table, $where = null){
  491. $this->debug = true;
  492. echo $this->count($table, $where);
  493. }
  494.  
  495. public function max($table, $column, $where = null){
  496. $query = $this->query('SELECT MAX("' . $column . '") FROM "' . $table . '"' . $this->where_clause($where));
  497. return is_string($query) ? $query : 0 + ($query->fetchColumn());
  498. }
  499. public function _max($table, $column, $where = null){
  500. $this->debug = true;
  501. echo $this->max($table, $column, $where);
  502. }
  503.  
  504. public function min($table, $column, $where = null){
  505. $query = $this->query('SELECT MIN("' . $column . '") FROM "' . $table . '"' . $this->where_clause($where));
  506. return is_string($query) ? $query : 0 + ($query->fetchColumn());
  507. }
  508. public function _min($table, $column, $where = null){
  509. $this->debug = true;
  510. echo $this->min($table, $column, $where);
  511. }
  512.  
  513. public function avg($table, $column, $where = null){
  514. $query = $this->query('SELECT AVG("' . $column . '") FROM "' . $table . '"' . $this->where_clause($where));
  515. return is_string($query) ? $query : 0 + ($query->fetchColumn());
  516. }
  517. public function _avg($table, $column, $where = null){
  518. $this->debug = true;
  519. echo $this->avg($table, $column, $where);
  520. }
  521.  
  522. public function sum($table, $column, $where = null){
  523. $query = $this->query('SELECT SUM("' . $column . '") FROM "' . $table . '"' . $this->where_clause($where));
  524. return is_string($query) ? $query : 0 + ($query->fetchColumn());
  525. }
  526. public function _sum($table, $column, $where = null){
  527. $this->debug = true;
  528. echo $this->sum($table, $column, $where);
  529. }
  530.  
  531. public function error(){
  532. return $this->pdo->errorInfo();
  533. }
  534.  
  535. public function last_query(){
  536. return $this->queryString;
  537. }
  538.  
  539. public function info(){
  540. return array(
  541. 'server' => $this->pdo->getAttribute(PDO::ATTR_SERVER_INFO),
  542. 'client' => $this->pdo->getAttribute(PDO::ATTR_CLIENT_VERSION),
  543. 'driver' => $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME),
  544. 'version' => $this->pdo->getAttribute(PDO::ATTR_SERVER_VERSION),
  545. 'connection' => $this->pdo->getAttribute(PDO::ATTR_CONNECTION_STATUS)
  546. );
  547. }
  548. }
  549. ?>

  

Medoo个人修改版的更多相关文章

  1. Android 仿美团网,大众点评购买框悬浮效果之修改版

    转帖请注明本文出自xiaanming的博客(http://blog.csdn.net/xiaanming/article/details/17761431),请尊重他人的辛勤劳动成果,谢谢! 我之前写 ...

  2. 黄聪:WordPress图片插件:Auto Highslide修改版(转)

    一直以来很多人都很喜欢我博客使用的图片插件,因为我用的跟原版是有些不同的,效果比原版的要好,他有白色遮罩层,可以直观的知道上下翻图片和幻灯片放映模式.很多人使用原版之后发现我用的更加帅一些,于是很多人 ...

  3. sqm(sqlmapGUI) pcat修改版

    sqlmap是一款开源的注入工具,支持几乎所有的数据库,支持get/post/cookie注入,支持错误回显注入/盲注,还有其他多种注入方法. 支持代理,指纹识别技术判断数据库 .而sqm(sqlma ...

  4. 转载:Eclipse+Spket插件+ExtJs4修改版提供代码提示功能[图]

    转载:Eclipse+Spket插件+ExtJs4修改版提供代码提示功能[图] ExtJs是一种主要用于创建前端用户界面,是一个基本与后台技术无关的前端ajax框架.功能丰富,无人能出其右.无论是界面 ...

  5. 若快打码平台python开发文档修改版

    一.打码的作用 在进行爬虫过程中,部分网站的登录验证码是比较简单的,例如四个英文数字随机组合而成的验证码,有的是全数字随机组成的验证码,有的是全中文随机组成的验证码.为了爬虫进行自动化,需要解决自动登 ...

  6. 安装阿里云github提供的修改版minikube

    由于kubenetes域名背墙(gcr.io),如kubernetes-dashboard服务依赖不能正常使用. $ docker pull gcr.io/google_containers/paus ...

  7. Indy 10.5.8 for Delphi and Lazarus 修改版(2011)

    Indy 10.5.8 for Delphi and Lazarus 修改版(2011)    Internet Direct(Indy)是一组开放源代码的Internet组件,涵盖了几乎所有流行的I ...

  8. [C语言]声明解析器cdecl修改版

    一.写在前面 K&R曾经在书中承认,"C语言声明的语法有时会带来严重的问题.".由于历史原因(BCPL语言只有唯一一个类型——二进制字),C语言声明的语法在各种合理的组合下 ...

  9. Perl实用中文处理步骤(修改版)

    发信人: FenRagwort (泽), 信区: Perl标  题: Perl实用中文处理步骤(修改版)发信站: 水木社区 (Mon Feb 14 12:52:14 2011), 转信 (修改版 感谢 ...

随机推荐

  1. 【WP 8.1开发】同时更新多种磁贴

    一般应用程序都会包含多个尺寸的磁贴,如小磁贴(71×71).中磁贴(150×150)和宽磁贴(310×150).常规的磁贴更新做法是用XML文档来定义更新内容,然后再提交更新.如: <tile& ...

  2. 在IIS中部署ASP.NET 5应用程序遭遇的问题

    用VS2015中创建了一个非常简单的ASP.NET5程序: 在Startup.cs中只输入一行代码: using System; using Microsoft.AspNet.Builder; usi ...

  3. MongoDB的学习--聚合

    最近要去的新项目使用mysql,趁着还没忘记,总结记录以下MongoDB的聚合. 聚合是泛指各种可以处理批量记录并返回计算结果的操作.MongoDB提供了丰富的聚合操作,用于对数据集执行计算操作.在  ...

  4. Android自动连接指定的wifi,免密码或指定密码

    一.运行时的状态 遇到一个这样的要求:“不进行扫描操作,怎么对指定的免密码WIFI进行连接(之前没有连接过)”,于是动手写了一个Demo,如图所示未连接成功时的状态,第一个编辑框让用户输入SSID,第 ...

  5. Testing - 质量保证与质量控制

    QA QC QM 概念 Quality Assurance (质量保证) Quality Control (质量控制) Quality Manage (质量管理) 定义 为达到质量要求所采取的作业技术 ...

  6. android之数据存储之SQLite

    SQLite开源轻量级数据库,支持92-SQL标准,主要用于嵌入式系统,只占几百K系统资源此外,SQLite 不支持一些标准的 SQL 功能,特别是外键约束(FOREIGN KEY constrain ...

  7. Eclipse JAVA文件注释乱码

    将别人的项目或JAVA文件导入到自己的Eclipse中时,常常会出现JAVA文件的中文注释变成乱码的情况,主要原因就是别人的IDE编码格式和自己的Eclipse编码格式不同. 总结网上的建议和自己的体 ...

  8. nginx+uwsgi+django+celery+supervisord环境部署

    前言 很久没更博客了,最近新写了一个小项目,后边有时间把一些心得放上来,先把环境的部署方式整理出来. 部署过程 先将环境的python升级为2.7 保证有pip 安装了nginx并配置 vim /Da ...

  9. 转自coolshell--vim的基本操作

    开始前导语: 在正式转入python开发后,日常的工作中会和大量linux相关命令和工具接触,从另外一个层面,学习的东西相当的多,而VIM在整个的linux体系中所占据的角色就更不用说了,之前在处理g ...

  10. 关于WCF服务在高并发情况下报目标积极拒绝的异常处理

    最近弄了个wcf的监控服务,偶尔监控到目标服务会报一个目标积极拒绝的错误.一开始以为服务停止了,上服务器检查目标服务好好的活着.于是开始查原因. 一般来说目标积极拒绝(TCP 10061)的异常主要是 ...