當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SqlFormatter::regex_reserved_toplevel方法代碼示例

本文整理匯總了PHP中SqlFormatter::regex_reserved_toplevel方法的典型用法代碼示例。如果您正苦於以下問題:PHP SqlFormatter::regex_reserved_toplevel方法的具體用法?PHP SqlFormatter::regex_reserved_toplevel怎麽用?PHP SqlFormatter::regex_reserved_toplevel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SqlFormatter的用法示例。


在下文中一共展示了SqlFormatter::regex_reserved_toplevel方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 /**
  * Stuff that only needs to be done once.  Builds regular expressions and sorts the reserved words.
  */
 protected static function init()
 {
     if (self::$init) {
         return;
     }
     // Sort reserved word list from longest word to shortest, 3x faster than usort
     $reservedMap = array_combine(self::$reserved, array_map('strlen', self::$reserved));
     arsort($reservedMap);
     self::$reserved = array_keys($reservedMap);
     // Set up regular expressions
     self::$regex_boundaries = '(' . implode('|', array_map(array(__CLASS__, 'quote_regex'), self::$boundaries)) . ')';
     self::$regex_reserved = '(' . implode('|', array_map(array(__CLASS__, 'quote_regex'), self::$reserved)) . ')';
     self::$regex_reserved_toplevel = str_replace(' ', '\\s+', '(' . implode('|', array_map(array(__CLASS__, 'quote_regex'), self::$reserved_toplevel)) . ')');
     self::$regex_reserved_newline = str_replace(' ', '\\s+', '(' . implode('|', array_map(array(__CLASS__, 'quote_regex'), self::$reserved_newline)) . ')');
     self::$regex_function = '(' . implode('|', array_map(array(__CLASS__, 'quote_regex'), self::$functions)) . ')';
     self::$init = true;
 }
開發者ID:BusinessCookies,項目名稱:CoffeeMachineProject,代碼行數:20,代碼來源:SqlFormatter.php

示例2: init

 /**
  * Stuff that only needs to be done once.  Builds regular expressions and sorts the reserved words.
  */
 protected static function init()
 {
     if (self::$init) {
         return;
     }
     // Sort reserved word list from longest word to shortest
     usort(self::$reserved, array('SqlFormatter', 'sortLength'));
     // Set up regular expressions
     self::$regex_boundaries = '(' . implode('|', array_map(array('SqlFormatter', 'quote_regex'), self::$boundaries)) . ')';
     self::$regex_reserved = '(' . implode('|', array_map(array('SqlFormatter', 'quote_regex'), self::$reserved)) . ')';
     self::$regex_reserved_toplevel = str_replace(' ', '\\s+', '(' . implode('|', array_map(array('SqlFormatter', 'quote_regex'), self::$reserved_toplevel)) . ')');
     self::$regex_reserved_newline = str_replace(' ', '\\s+', '(' . implode('|', array_map(array('SqlFormatter', 'quote_regex'), self::$reserved_newline)) . ')');
     self::$regex_function = '(' . implode('|', array_map(array('SqlFormatter', 'quote_regex'), self::$functions)) . ')';
     self::$init = true;
 }
開發者ID:milkae,項目名稱:Php,代碼行數:18,代碼來源:sql-formatter.php


注:本文中的SqlFormatter::regex_reserved_toplevel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。