2015/12/21 久米
class クラス名 extends 継承するクラス名
{ public function メソッド名1(){ } public function メソッド名2(){ } } |
バージョン3.0から標準的インストールはComposerを使用するインストールになった。(※最下段参照)
が本授業では、昔ながらのインストール方法で行う。
CakePHPフォルダ構成 太字はアプリケーション開発で主に使用する所
フォルダ | |
bin | |
config | app.php |
logs | |
plugins | |
src | Console |
Controller | |
Model | |
Shell | |
Template | |
View | |
tests | |
tmp | |
vendor | |
webroot | cssやjs |
※CakePHPのソースはvendor>cakephp>cakephp>srcにあるぞ
CakePHP解凍して名前つけたフォルダ名(Cakeディレクトリ)をアプリケーションと呼ぶことにする。 注)正式には何と呼ぶか不明。
4〜6を必要な分、行えばアプリケーション完成
コラム:Composerによるインストール例Microsoft Windows [Version 10.0.10240] (c) 2015 Microsoft Corporation. All rights reserved. C:\Users\kume>cd C:\xampp\htdocs C:\xampp\htdocs>composer create-project --prefer-dist cakephp/app web3/caketest Installing cakephp/app (3.1.2) - Installing cakephp/app (3.1.2) Loading from cache Created project in web3/caketest Loading composer repositories with package information Installing dependencies (including require-dev) - Installing aura/installer-default (1.0.0) Loading from cache - Installing cakephp/plugin-installer (0.0.12) Loading from cache - Installing psr/log (1.0.0) Loading from cache - Installing nesbot/carbon (1.13.0) Loading from cache - Installing mobiledetect/mobiledetectlib (2.8.17) Loading from cache - Installing aura/intl (1.1.1) Loading from cache - Installing ircmaxell/password-compat (v1.0.4) Loading from cache - Installing cakephp/cakephp (3.1.5) Loading from cache - Installing symfony/yaml (v2.8.0) Loading from cache - Installing symfony/filesystem (v3.0.0) Loading from cache - Installing symfony/config (v2.8.0) Loading from cache - Installing symfony/polyfill-mbstring (v1.0.0) Loading from cache - Installing symfony/console (v2.8.0) Loading from cache - Installing robmorgan/phinx (v0.5.0) Loading from cache - Installing cakephp/migrations (1.5.1) Loading from cache - Installing jakub-onderka/php-console-color (0.1) Loading from cache - Installing jakub-onderka/php-console-highlighter (v0.3.2) Loading from cache - Installing dnoegel/php-xdg-base-dir (0.1) Loading from cache - Installing nikic/php-parser (v2.0.0) Loading from cache - Installing symfony/var-dumper (v3.0.0) Loading from cache - Installing psy/psysh (v0.6.1) Loading from cache - Installing jdorn/sql-formatter (v1.2.17) Loading from cache - Installing cakephp/debug_kit (3.2.2) Loading from cache - Installing cakephp/bake (1.1.2) Loading from cache symfony/console suggests installing symfony/event-dispatcher () symfony/console suggests installing symfony/process () symfony/var-dumper suggests installing ext-symfony_debug () psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :)) psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.) psy/psysh suggests installing ext-readline (Enables support for arrow-key history navigation, and showing and manipulating command history.) psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.) cakephp/debug_kit suggests installing ext-sqlite (DebugKit needs to store panel data in a database. SQLite is simple and easy to use.) Writing lock file Generating autoload files > Cake\Composer\Installer\PluginInstaller::postAutoloadDump > App\Console\Installer::postInstall Created `config/app.php` file Set Folder Permissions ? (Default to Y) [Y,n]? Updated Security.salt value in config/app.php C:\xampp\htdocs> |