{"id":20662874,"url":"https://github.com/q23isline/study_cakephp2","last_synced_at":"2026-04-13T04:45:48.165Z","repository":{"id":193016168,"uuid":"687901525","full_name":"q23isline/study_cakephp2","owner":"q23isline","description":"CakePHP 2 系と Vue.js 2系の勉強用リポジトリ","archived":false,"fork":false,"pushed_at":"2024-02-04T05:09:53.000Z","size":1540,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-03-10T05:58:39.340Z","etag":null,"topics":["cakephp","docker","eslint","github-actions","php","php-codesniffer","phpstan","typescript","vuejs"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/q23isline.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-09-06T08:38:07.000Z","updated_at":"2023-11-04T07:03:16.000Z","dependencies_parsed_at":"2023-09-29T12:04:57.452Z","dependency_job_id":"d8a69005-b88e-4926-a009-1e8554d6be1c","html_url":"https://github.com/q23isline/study_cakephp2","commit_stats":null,"previous_names":["q23isline/study_cakephp2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/q23isline/study_cakephp2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q23isline%2Fstudy_cakephp2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q23isline%2Fstudy_cakephp2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q23isline%2Fstudy_cakephp2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q23isline%2Fstudy_cakephp2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/q23isline","download_url":"https://codeload.github.com/q23isline/study_cakephp2/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/q23isline%2Fstudy_cakephp2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267065316,"owners_count":24030349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cakephp","docker","eslint","github-actions","php","php-codesniffer","phpstan","typescript","vuejs"],"created_at":"2024-11-16T19:15:44.413Z","updated_at":"2026-04-13T04:45:43.110Z","avatar_url":"https://github.com/q23isline.png","language":"PHP","readme":"# study_cakephp2\n\n[![LICENSE](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)\n[![GitHub Actions](https://github.com/q23isline/study_cakephp2/actions/workflows/ci.yml/badge.svg)](https://github.com/q23isline/study_cakephp2/actions/workflows/ci.yml)\n[![PHPStan](https://img.shields.io/badge/PHPStan-level%208-brightgreen.svg)](https://github.com/phpstan/phpstan)\n[![Open in Visual Studio Code](https://img.shields.io/static/v1?logo=visualstudiocode\u0026label=\u0026message=Open%20in%20Visual%20Studio%20Code\u0026labelColor=555555\u0026color=007acc\u0026logoColor=007acc)](https://open.vscode.dev/q23isline/study_cakephp2)\n\n[![PHP](https://img.shields.io/static/v1?logo=php\u0026label=PHP\u0026message=v7.1.33\u0026labelColor=555555\u0026color=777BB4\u0026logoColor=777BB4)](https://www.php.net)\n[![CakePHP](https://img.shields.io/static/v1?logo=cakephp\u0026label=CakePHP\u0026message=v2.10.24\u0026labelColor=555555\u0026color=D33C43\u0026logoColor=D33C43)](https://cakephp.org)\n[![MySQL](https://img.shields.io/static/v1?logo=mysql\u0026label=MySQL\u0026message=v8.0\u0026labelColor=555555\u0026color=4479A1\u0026logoColor=4479A1)](https://dev.mysql.com)\n[![NGINX](https://img.shields.io/static/v1?logo=nginx\u0026label=NGINX\u0026message=v1.21\u0026labelColor=555555\u0026color=009639\u0026logoColor=009639)](https://www.nginx.com)\n[![Node.js](https://img.shields.io/static/v1?logo=node.js\u0026label=Node.js\u0026message=v10.24.1\u0026labelColor=555555\u0026color=339933\u0026logoColor=339933)](https://nodejs.org)\n[![npm](https://img.shields.io/static/v1?logo=npm\u0026label=npm\u0026message=v6.14.12\u0026labelColor=555555\u0026color=CB3837\u0026logoColor=CB3837)](https://www.npmjs.com/)\n[![Vue.js](https://img.shields.io/static/v1?logo=vue.js\u0026label=Vue.js\u0026message=v2.7.14\u0026labelColor=555555\u0026color=4FC08D\u0026logoColor=4FC08D)](https://v2.ja.vuejs.org/)\n\n## はじめにやること\n\n1. ソースダウンロード\n\n    ```bash\n    git clone 'https://github.com/q23isline/study_cakephp2.git'\n    ```\n\n2. 以下の`.default`をコピーして貼り付け、`.default`の拡張子を外す\n\n    ```bash\n    cd study_cakephp2\n    cp Config/core.php.default Config/core.php\n    cp Config/database.php.default Config/database.php\n    cp Config/email.php.default Config/email.php\n    ```\n\n3. DB コンテナ起動時に Permission Denied で起動できない状態にならないように権限付与する\n\n    ```bash\n    sudo chmod -R ugo+rw logs\n    ```\n\n4. APP コンテナ起動時に Permission Denied で tmp フォルダが作れずにエラーとならないよう権限付与する\n\n    ```bash\n    sudo chmod -R ugo+w ../study_cakephp2\n    ```\n\n5. アプリ立ち上げ\n\n    ```bash\n    docker compose build --no-cache\n    docker compose down -v\n    sudo rm -rf Vendor\n    sudo rm -rf Plugin\n    docker create -it --name app study_cakephp2-app bash\n    sudo docker cp app:/var/www/html/Vendor $(pwd)\n    sudo docker cp app:/var/www/html/Plugin $(pwd)\n    docker rm -f app\n    sudo chmod -R 777 Vendor\n    sudo chmod -R 777 Plugin\n    sudo rm -rf frontend/node_modules\n    docker create -it --name front study_cakephp2-front bash\n    sudo docker cp front:/front/vue/node_modules $(pwd)/frontend\n    docker rm -f front\n    sudo chmod -R 777 frontend/node_modules\n    docker compose up -d\n    sudo rm -rf webroot/*\n    docker compose exec front npm run build\n    ```\n\n## 日常的にやること\n\n### システム起動\n\n```bash\ndocker compose up -d\n```\n\n### システム終了\n\n```bash\ndocker compose down\n```\n\n### フロントエンドのビルド\n\n```bash\nsudo rm -rf webroot/*\ndocker compose exec front npm run build\n```\n\n## 動作確認\n\n### URL\n\n- \u003chttp://localhost\u003e\n\n### ログイン情報\n\n| Username  | Password |\n| --------- | -------- |\n| admin     | admin00  |\n\n### Permission Denied対策\n\n- ログイン後、画面にPermission Deniedエラーが表示される場合、以下を実行\n  - 本番環境では適切に権限を付与すべきだがとりあえず動くようにフル権限を付与\n\n```bash\nsudo chmod -R 777 tmp\nsudo chmod -R ugo+rw logs\n```\n\n## フロントエンド開発\n\n```bash\ndocker compose exec front npm run serve\n```\n\n- 以下の URL にアクセスすることで Vue の内容を確認できる\n  - \u003chttp://localhost:8080\u003e\n- 終了するときはターミナルで Ctrl + c\n\n## コーディング標準チェック単体実行\n\n```bash\ndocker exec -it app ./Vendor/bin/phpcs --standard=CakePHP -p Console/Command/ Console/Templates/ Controller/ Model/ View/ ApplicationService/ Domain/ Infrastructure/\n```\n\n## 静的分析チェック単体実行\n\n```bash\ndocker exec -it app ./Vendor/bin/phpstan analyse\n```\n\n## フロントエンド静的解析単体実行\n\n```bash\ndocker compose exec front npm run lint\n```\n\n## ユニットテスト単体実行\n\n```bash\n# テスト実行\ndocker exec -it --env XDEBUG_MODE=coverage app ./Console/cake test app AllTests\n# カバレッジ生成\ndocker exec -it --env XDEBUG_MODE=coverage app ./Console/cake test app AllTests --coverage-html webroot/coverage\n```\n\n- カバレッジ確認URL\n  - \u003chttp://localhost/coverage/index.html\u003e\n\n## デバッグ実行\n\n### VS Codeの初期設定\n\n- [VS Code | Marketplace | PHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug)をインストールする\n- VS CodeにXDebug用の構成ファイル（launch.json）を追加する\n\n```JSONC\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Listen for Xdebug\",\n            \"type\": \"php\",\n            \"request\": \"launch\",\n            \"hostname\": \"0.0.0.0\",\n            \"pathMappings\": {\n                \"/var/www/html/\": \"${workspaceRoot}\"\n            },\n            \"environment\": {\n                // デバッグ時はログレベルを 7\n                \"XDEBUG_CONFIG\": \"log_level=7\"\n            }\n        }\n    ]\n}\n```\n\n## 本番環境設定でのアプリ立ち上げ\n\n```bash\ncd study_cakephp2\ncp docker/prod/php-fpm/core.php Config/core.php\ncp docker/prod/php-fpm/database.php Config/database.php\ncp docker/prod/php-fpm/email.php Config/email.php\ndocker compose -f docker-compose-prod.yml build --no-cache\ndocker compose -f docker-compose-prod.yml down -v\nsudo rm -rf Vendor\ndocker create -it --name app study_cakephp2-app bash\nsudo docker cp app:/var/www/html/Vendor $(pwd)\ndocker rm -f app\nsudo chmod -R 777 Vendor\nsudo rm -rf frontend/node_modules\nsudo rm -rf webroot/*\ndocker create -it --name front study_cakephp2-front bash\nsudo docker cp front:/front/webroot $(pwd)\ndocker rm -f front\nsudo chmod -R 777 webroot\ndocker compose -f docker-compose-prod.yml up -d\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fq23isline%2Fstudy_cakephp2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fq23isline%2Fstudy_cakephp2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fq23isline%2Fstudy_cakephp2/lists"}