<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # :-: 發布配置以及 migrations ### 命令發布 > 在command目錄下面建立 Publish.php 文件 > 在config建立 permissions.php 配置文件 > 在database目錄下建立相關表的 migration 文件 > 這里要提到一下,你可以首先下載 think-migration 包,然后建立所需要的表結構 這里為什么可以這么做? ``` 1. 得益于5.1對于 config 的統一層次管理,這很適合編寫包的配置文件, 因為之間沒有關聯。可能你會問?5.0難道不可以嗎?extra的配置也是可行的。沒錯!所以我講的是對開發更加友好了。 2. migration 的加入,適合我們編寫與包關聯的表操作,雖然 5.0 也可以,但是我更希望的是官方能加入支持。這樣會省去開發過程 ```` ### 編寫命令發布 這里會直接貼上發布代碼 ```php <?php namespace think\permissions\command; use think\console\Command; use think\console\Input; use think\console\input\Argument; use think\console\input\Option; use think\console\Output; class PermissionPublish extends Command { protected function configure() { $this->setName('permission-publish') ->setDescription('Publish Permission Files'); } protected function execute(Input $input, Output $output) { $output->write(sprintf('permissions config file publish %s' . PHP_EOL, $this->publishConfig() ? 'successfully' : 'failed')); $output->write(sprintf('permissions migrations publish %s',$this->publishMigrations() ? 'successfully' : 'failed')); } // 發布配置文件 protected function publishConfig() { $permissionsConfigPath = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'permissions.php'; return copy($permissionsConfigPath, app()->getConfigPath() . 'permissions.php'); } // 發布migration文件 protected function publishMigrations() { $migrationsPath = app()->getRootPath() . 'database' . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR; if (!is_dir($migrationsPath)) { mkdir($migrationsPath, 0777, true); } $databasePath = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'database' . DIRECTORY_SEPARATOR; $handle = opendir($databasePath); $status = true; while ( ($file= readdir($handle))!= false) { if ($file!= '.' && $file!= '..') { if (!copy($databasePath . basename($file), $migrationsPath . basename($file))) { $status = false; break; } } } return $status; } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看