2
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 を composer でインストール

Last updated at Posted at 2017-12-17

いやーハマった。
のでメモ。

以下のようにドメインごとにフォルダを分けている。

/html
    /hoge.com
    /love.com
    /twiseo.net

今回は、twiseo.net に新しくcakephp3を追加したい。

・まずはtwiseo.netフォルダが 無い 事を確認。
(フォルダ、ファイルがあるとうまくインストールできない)

html の位置で

php /var/www/html/composer.phar create-project --prefer-dist cakephp/app twiseo.net

これで twiseo.net の中に cakephp3 の必要ファイルがインストールされる。
上記の中に composer.json ができるので、
それに追加したいライブラリを付け加えていく。

このautoload の Shmail と Okws は自作ライブラリ。


{
    "name": "cakephp/app",
    "description": "CakePHP skeleton app",
    "homepage": "https://cakephp.org",
    "type": "project",
    "license": "MIT",

"require": {
        "abraham/twitteroauth": "*",
        "cakemanager/cakephp-utils": "dev-master",
        "cakephp/migrations": "~1.0",
        "cakephp/plugin-installer": "~1.0",
        "cebe/markdown": "*",
        "friendsofcake/bootstrap-ui": "dev-master",
        "friendsofcake/search": "*",
        "google/apiclient": "*",
        "google/cloud-storage": "^1.3",
        "granam/emojione-micro": "^2.2",
        "guzzlehttp/guzzle": "^6.3",
        "imagine/imagine": "*",
        "josegonzalez/cakephp-upload": "^3.7",
        "mobiledetect/mobiledetectlib": "2.*",
        "mpyw/cowitter": "^1.0",
        "payjp/payjp-php": "^1.0",
        "pear/http_request2": "*",
        "rackspace/php-opencloud": "dev-master"
    },


"require-dev": {
        "cakephp/bake": "^1.1",
        "cakephp/cakephp-codesniffer": "^3.0",
        "cakephp/debug_kit": "^3.2",
        "psy/psysh": "@stable"
    },
    "suggest": {
        "markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
        "dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan compatibility.",
        "phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
        "cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
    },

"autoload": {
        "psr-4": {
            "App\\": "src",
"ShMail\\": "./plugins/ShMail/src",
"Okws\\": "./plugins/Okws/src"
        }
    },

    "autoload-dev": {
        "psr-4": {
            "App\\Test\\": "tests/",
            "Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
        }
    },
    "scripts": {
        "post-install-cmd": "App\\Console\\Installer::postInstall",
        "post-create-project-cmd": "App\\Console\\Installer::postInstall",
        "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump",
        "check": [
            "@test",
            "@cs-check"
        ],
        "cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests",
        "cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests",
        "test": "phpunit --colors=always"
    },
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    }
}


つづいて twiseo.net の位置で アップデート。

php /var/www/html/composer.phar update

以上でOK
・先にtwiseo.netフォルダがあるとうまく入らない
・ちゃんとcakephp3はcakephp3で最初にインストールしておく。

最後にパーミッション。
これをしないとアップロードできない。
myname は 自分の名前にしてね


chown -hR myname:myname twiseo.net
chmod -R a=rX,u+w twiseo.net
chmod -R 777 twiseo.net



2
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
2
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?