3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CakePHP3の初期設定でディレクトリを作成する

Posted at

logsやtmpのように、システムが書き込み可能なディレクトリを作っておきたい場合は、src/Console/Installer.phpの該当箇所に書いておけば、composerでインストールされた時に作ってくれる。

例:uploadsディレクトリの作成を追加する

src/Console/Installer.php
class Installer
{
・・・
    public static function createWritableDirectories($dir, $io)
    {
        $paths = [
            'logs',
            'tmp',
            'tmp/cache',
            'tmp/cache/models',
            'tmp/cache/persistent',
            'tmp/cache/views',
            'tmp/sessions',
            'tmp/tests',
            'uploads'
        ];
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?