pei-zhi.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <!DOCTYPE HTML>
  2. <html lang="" >
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  6. <title>配置 · GitBook</title>
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  8. <meta name="description" content="">
  9. <meta name="generator" content="GitBook 3.2.3">
  10. <link rel="stylesheet" href="../gitbook/style.css">
  11. <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
  12. <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
  13. <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
  14. <meta name="HandheldFriendly" content="true"/>
  15. <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  16. <meta name="apple-mobile-web-app-capable" content="yes">
  17. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  18. <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
  19. <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
  20. <link rel="next" href="lu-you.html" />
  21. <link rel="prev" href="../chapter1.html" />
  22. </head>
  23. <body>
  24. <div class="book">
  25. <div class="book-summary">
  26. <div id="book-search-input" role="search">
  27. <input type="text" placeholder="Type to search" />
  28. </div>
  29. <nav role="navigation">
  30. <ul class="summary">
  31. <li class="chapter " data-level="1.1" data-path="../">
  32. <a href="../">
  33. 简介
  34. </a>
  35. </li>
  36. <li class="chapter " data-level="1.2" data-path="../chapter1.html">
  37. <a href="../chapter1.html">
  38. 基础用法
  39. </a>
  40. <ul class="articles">
  41. <li class="chapter active" data-level="1.2.1" data-path="pei-zhi.html">
  42. <a href="pei-zhi.html">
  43. 配置
  44. </a>
  45. </li>
  46. <li class="chapter " data-level="1.2.2" data-path="lu-you.html">
  47. <a href="lu-you.html">
  48. 路由
  49. </a>
  50. </li>
  51. <li class="chapter " data-level="1.2.3" data-path="kong-zhi-qi.html">
  52. <a href="kong-zhi-qi.html">
  53. 控制器
  54. </a>
  55. </li>
  56. <li class="chapter " data-level="1.2.4" data-path="mo-xing.html">
  57. <a href="mo-xing.html">
  58. 模型
  59. </a>
  60. </li>
  61. <li class="chapter " data-level="1.2.5" data-path="shi-tu.html">
  62. <a href="shi-tu.html">
  63. 视图
  64. </a>
  65. </li>
  66. </ul>
  67. </li>
  68. <li class="chapter " data-level="1.3" data-path="../qi-ta-bu-chong.html">
  69. <a href="../qi-ta-bu-chong.html">
  70. 其他补充
  71. </a>
  72. <ul class="articles">
  73. <li class="chapter " data-level="1.3.1" data-path="../qi-ta-bu-chong/param.html">
  74. <a href="../qi-ta-bu-chong/param.html">
  75. Param
  76. </a>
  77. </li>
  78. <li class="chapter " data-level="1.3.2" data-path="../qi-ta-bu-chong/tablehelper.html">
  79. <a href="../qi-ta-bu-chong/tablehelper.html">
  80. TableHelper
  81. </a>
  82. </li>
  83. <li class="chapter " data-level="1.3.3" data-path="../qi-ta-bu-chong/ke-zhi-xing-jiao-ben.html">
  84. <a href="../qi-ta-bu-chong/ke-zhi-xing-jiao-ben.html">
  85. 可执行脚本
  86. </a>
  87. </li>
  88. </ul>
  89. </li>
  90. <li class="divider"></li>
  91. <li>
  92. <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
  93. Published with GitBook
  94. </a>
  95. </li>
  96. </ul>
  97. </nav>
  98. </div>
  99. <div class="book-body">
  100. <div class="body-inner">
  101. <div class="book-header" role="navigation">
  102. <!-- Title -->
  103. <h1>
  104. <i class="fa fa-circle-o-notch fa-spin"></i>
  105. <a href=".." >配置</a>
  106. </h1>
  107. </div>
  108. <div class="page-wrapper" tabindex="-1" role="main">
  109. <div class="page-inner">
  110. <div id="book-search-results">
  111. <div class="search-noresults">
  112. <section class="normal markdown-section">
  113. <h3 id="&#x914D;&#x7F6E;">&#x914D;&#x7F6E;</h3>
  114. <h6 id="commonphp">common.php</h6>
  115. <p>&#x516C;&#x5171;&#x914D;&#x7F6E;&#x5B9A;&#x4E49;&#x5728; <code>common.php</code>&#xFF0C;&#x901A;&#x7528;&#x914D;&#x7F6E;&#xFF08;&#x5982;&#x6570;&#x636E;&#x5E93;&#x3001;redis&#x3001;&#x5E38;&#x91CF;&#x7B49;&#x914D;&#x7F6E;&#xFF09;&#x88AB;&#x62BD;&#x79BB;&#x5230;<code>&#x540D;&#x5B57;&#x670D;&#x52A1;</code>&#x7EDF;&#x4E00;&#x7BA1;&#x7406;&#xFF0C;&#x6BCF;&#x53F0;&#x670D;&#x52A1;&#x5668;&#x5171;&#x4EAB;&#x4E00;&#x4EFD;&#x3002;</p>
  116. <h6 id="configincphp">config.inc.php</h6>
  117. <p>&#x5B9A;&#x4E49;&#x9879;&#x76EE;&#x901A;&#x7528;&#x914D;&#x7F6E;&#xFF0C;&#x5305;&#x62EC;&#x4E00;&#x4E9B;&#x5E38;&#x91CF;&#xFF0C;&#x7F13;&#x5B58;&#x65B9;&#x5F0F;&#xFF0C;&#x8DEF;&#x7531;&#x7B49;</p>
  118. <pre><code class="lang-php">define(<span class="hljs-string">&apos;PROJECT_NAME&apos;</span>, <span class="hljs-string">&quot;demo&quot;</span>); <span class="hljs-comment">// &#x9879;&#x76EE;&#x540D;&#x79F0;</span>
  119. <span class="hljs-comment">// &#x8981;&#x52A0;&#x8F7D;&#x7684;&#x540D;&#x5B57;&#x670D;&#x52A1;&#x914D;&#x7F6E;&#x6A21;&#x5757;</span>
  120. $GLOBALS[<span class="hljs-string">&apos;nameServ_php&apos;</span>] = [
  121. <span class="hljs-string">&apos;globals&apos;</span>, <span class="hljs-comment">// &#x5168;&#x5C40;&#xFF0C;&#x5305;&#x542B;&#x6570;&#x636E;&#x5E93;&#xFF0C;redis&#xFF0C;&#x5E38;&#x91CF;&#x7B49;</span>
  122. <span class="hljs-string">&apos;code&apos;</span>, <span class="hljs-comment">// &#x9519;&#x8BEF;&#x7801;&#x5B9A;&#x4E49;</span>
  123. <span class="hljs-string">&apos;r2m&apos;</span>, <span class="hljs-comment">// &#x7F13;&#x5B58;&#x914D;&#x7F6E;</span>
  124. ];
  125. <span class="hljs-comment">// &#x7F13;&#x5B58;&#x65B9;&#x5F0F;</span>
  126. $GLOBALS[<span class="hljs-string">&apos;r2mMode&apos;</span>] = <span class="hljs-string">&apos;lib&apos;</span>;
  127. <span class="hljs-comment">// &#x8DEF;&#x7531;&#x914D;&#x7F6E;</span>
  128. $GLOBALS[<span class="hljs-string">&apos;rewrite&apos;</span>] = <span class="hljs-keyword">array</span>(
  129. <span class="hljs-string">&apos;dl&apos;</span> =&gt; <span class="hljs-string">&apos;static/download&apos;</span>,
  130. <span class="hljs-string">&apos;robots.txt&apos;</span> =&gt; <span class="hljs-string">&apos;default/robots&apos;</span>,
  131. <span class="hljs-string">&apos;url/&lt;url_id&gt;&apos;</span> =&gt; <span class="hljs-string">&apos;static/shortUrl&apos;</span>,
  132. );
  133. <span class="hljs-comment">// &#x53EA;&#x7ED9;url()&#x51FD;&#x6570;&#x4F7F;&#x7528;</span>
  134. $GLOBALS[<span class="hljs-string">&apos;rewrite2&apos;</span>] = <span class="hljs-keyword">array</span>(
  135. );
  136. <span class="hljs-comment">// &#x7BA1;&#x7406;&#x7AEF;&#x6743;&#x9650;&#x6821;&#x9A8C;&#x8282;&#x70B9;</span>
  137. define(<span class="hljs-string">&apos;ADMIN_NODE_ID&apos;</span>, <span class="hljs-number">7710</span>);
  138. <span class="hljs-comment">// &#x9ED8;&#x8BA4;&#x914D;&#x7F6E;key</span>
  139. $GLOBALS[<span class="hljs-string">&apos;defaultKey&apos;</span>] = <span class="hljs-string">&apos;dw_27l&apos;</span>;
  140. </code></pre>
  141. <h6 id="configdevnewformincphp">config.{dev|new|form}.inc.php</h6>
  142. <p>&#x8FD9;&#x4E09;&#x4E2A;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5206;&#x522B;&#x5BF9;&#x5E94;<code>dev(&#x6D4B;&#x8BD5;)</code>&#x3001;<code>new(&#x9884;&#x53D1;&#x5E03;)</code>&#x3001;<code>form(&#x6B63;&#x5F0F;)</code>&#x73AF;&#x5883;&#xFF0C;&#x5728;<code>common.php</code>&#x6839;&#x636E;&#x9879;&#x76EE;&#x8DEF;&#x5F84;&#x5224;&#x65AD;&#x52A0;&#x8F7D;&#xFF0C;&#x7528;&#x4E8E;&#x5B9A;&#x4E49;&#x6709;&#x8FD0;&#x884C;&#x73AF;&#x5883;&#x5DEE;&#x5F02;&#x7684;&#x914D;&#x7F6E;&#x3002;</p>
  143. <pre><code class="lang-php"><span class="hljs-comment">// &#x73AF;&#x5883;&#xFF0C;debug&#x4FE1;&#x606F;</span>
  144. define(<span class="hljs-string">&apos;DEBUG&apos;</span>, <span class="hljs-keyword">false</span>);
  145. define(<span class="hljs-string">&apos;ENV&apos;</span>, ENV_FORMAL);
  146. <span class="hljs-comment">// log&#x5165;&#x5E93;key</span>
  147. define(<span class="hljs-string">&quot;CALL_LOG_KEY&quot;</span>, <span class="hljs-string">&quot;logstash:dw#1&quot;</span>);
  148. <span class="hljs-comment">// CDN&#x8DEF;&#x5F84;</span>
  149. define(<span class="hljs-string">&quot;URL_CDN&quot;</span>, <span class="hljs-string">&apos;/&apos;</span>);
  150. </code></pre>
  151. </section>
  152. </div>
  153. <div class="search-results">
  154. <div class="has-results">
  155. <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
  156. <ul class="search-results-list"></ul>
  157. </div>
  158. <div class="no-results">
  159. <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <a href="../chapter1.html" class="navigation navigation-prev " aria-label="Previous page: 基础用法">
  167. <i class="fa fa-angle-left"></i>
  168. </a>
  169. <a href="lu-you.html" class="navigation navigation-next " aria-label="Next page: 路由">
  170. <i class="fa fa-angle-right"></i>
  171. </a>
  172. </div>
  173. <script>
  174. var gitbook = gitbook || [];
  175. gitbook.push(function() {
  176. gitbook.page.hasChanged({"page":{"title":"配置","level":"1.2.1","depth":2,"next":{"title":"路由","level":"1.2.2","depth":2,"path":"chapter1/lu-you.md","ref":"chapter1/lu-you.md","articles":[]},"previous":{"title":"基础用法","level":"1.2","depth":1,"path":"chapter1.md","ref":"chapter1.md","articles":[{"title":"配置","level":"1.2.1","depth":2,"path":"chapter1/pei-zhi.md","ref":"chapter1/pei-zhi.md","articles":[]},{"title":"路由","level":"1.2.2","depth":2,"path":"chapter1/lu-you.md","ref":"chapter1/lu-you.md","articles":[]},{"title":"控制器","level":"1.2.3","depth":2,"path":"chapter1/kong-zhi-qi.md","ref":"chapter1/kong-zhi-qi.md","articles":[]},{"title":"模型","level":"1.2.4","depth":2,"path":"chapter1/mo-xing.md","ref":"chapter1/mo-xing.md","articles":[]},{"title":"视图","level":"1.2.5","depth":2,"path":"chapter1/shi-tu.md","ref":"chapter1/shi-tu.md","articles":[]}]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"chapter1/pei-zhi.md","mtime":"2018-09-13T02:50:48.678Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-13T03:13:15.790Z"},"basePath":"..","book":{"language":""}});
  177. });
  178. </script>
  179. </div>
  180. <script src="../gitbook/gitbook.js"></script>
  181. <script src="../gitbook/theme.js"></script>
  182. <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
  183. <script src="../gitbook/gitbook-plugin-search/search.js"></script>
  184. <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
  185. <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
  186. <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
  187. <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
  188. </body>
  189. </html>