All Projects → kenjis → codeigniter-tettei-apps

kenjis / codeigniter-tettei-apps

Licence: other
『CodeIgniter徹底入門』のサンプルアプリケーション(CodeIgniter v3.1版)

Programming Languages

PHP
23972 projects - #3 most used programming language
CSS
56736 projects
Twig
543 projects
HTML
75241 projects
shell
77523 projects
hack
652 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to codeigniter-tettei-apps

ForgeIgniter-CI-3.x
Friendly open source CMS forged on Codeigniter 3
Stars: ✭ 26 (+0%)
Mutual labels:  codeigniter, codeigniter3
Codeigniter Ss Twig
A Simple and Secure Twig integration for CodeIgniter 3.x and 4.x
Stars: ✭ 139 (+434.62%)
Mutual labels:  twig, codeigniter
CodeIgniter-phpstorm-plugin
PhpStorm plugin for CodeIgniter development
Stars: ✭ 18 (-30.77%)
Mutual labels:  codeigniter, codeigniter3
FusionCMS
A CMS for World of Warcraft private servers
Stars: ✭ 18 (-30.77%)
Mutual labels:  codeigniter, codeigniter3
tutorial-codeigniter
Tutorial Codeigniter untuk pemula
Stars: ✭ 108 (+315.38%)
Mutual labels:  codeigniter, codeigniter3
Steward
PHP libraries that makes Selenium WebDriver + PHPUnit functional testing easy and robust
Stars: ✭ 215 (+726.92%)
Mutual labels:  phpunit, selenium
Ci Phpunit Test
An easier way to use PHPUnit with CodeIgniter 3.x.
Stars: ✭ 535 (+1957.69%)
Mutual labels:  codeigniter, phpunit
perpus-ci3
Sistem Informasi Perpustakaan Berbasis Website
Stars: ✭ 18 (-30.77%)
Mutual labels:  codeigniter, codeigniter3
codeigniter3-filename-checker
CodeIgniter3 Filename Checker
Stars: ✭ 21 (-19.23%)
Mutual labels:  codeigniter, codeigniter3
CodeIgniter-HMVC
CodeIgniter 3.1.10 with Modular Extensions - HMVC and Whoops Error Handling Framework 2.5.0
Stars: ✭ 30 (+15.38%)
Mutual labels:  codeigniter, codeigniter3
GoInstaller
GoInstaller is installer for CodeIgniter with user interface (UI).
Stars: ✭ 31 (+19.23%)
Mutual labels:  codeigniter, codeigniter3
CodeIgniter3-online-shop
A full e-commerce project built with CI3 HMVC with Email confirmation,Paypal payement , Ion Auth , Live Chatroom and full admin dashboard
Stars: ✭ 114 (+338.46%)
Mutual labels:  codeigniter, codeigniter3
Codeception
Full-stack testing PHP framework
Stars: ✭ 4,401 (+16826.92%)
Mutual labels:  phpunit, codeception
Ecommerce-CodeIgniter
An ecommerce CMS, very simple to use. Best for online shopping sites
Stars: ✭ 18 (-30.77%)
Mutual labels:  codeigniter, codeigniter3
dusker
Stand alone Laravel Dusk test suit, which do not require Laravel framework itself
Stars: ✭ 28 (+7.69%)
Mutual labels:  phpunit, selenium
online-games-store
Simple e-commerce proejct built with Codeigniter 3
Stars: ✭ 49 (+88.46%)
Mutual labels:  codeigniter, codeigniter3
codeigniter-monolog-plus
codeigniter monolog plus
Stars: ✭ 13 (-50%)
Mutual labels:  codeigniter, codeigniter3
Codeigniter3-absen-digital
Sistem Absensi Online dengan framework codeigniter 3
Stars: ✭ 33 (+26.92%)
Mutual labels:  codeigniter, codeigniter3
FaucetCryptoBot
A bot for FaucetCrypto a cryptocurrency faucet. The bot can currently claim PTC ads, main reward and all the shortlinks except exe.io and fc.lc.
Stars: ✭ 69 (+165.38%)
Mutual labels:  selenium
phpci-installer
PHPCI Easy Installer for Laravel Homestead
Stars: ✭ 19 (-26.92%)
Mutual labels:  phpunit

『CodeIgniter徹底入門』のサンプルアプリケーションをCodeIgniter 3.xにアップデート

Scrutinizer Code Quality Coverage Status Build Status

現在、CodeIgniterの開発は4.xに移っています。CodeIgniter4にアップグレードした、https://github.com/kenjis/ci4-tettei-apps を参照してください。

ここは『CodeIgniter徹底入門』(翔泳社)に含まれている以下のサンプルアプリケーション(CodeIgniter 1.6.1用)をCodeIgniter 3.xで動作するように更新したものです。

  • コンタクトフォーム(7章)
  • モバイル対応簡易掲示板(8章)
  • 簡易ショッピングサイト(9章)

CodeIgniter 3.xで動作するように更新し、少しリファクタリングしました。

動作確認環境

アプリ

  • PHP 7.4.15
    • Composer 1.10.19 (Composer 2.0ではCli for CodeIgniterが動作しません)
  • MySQL 5.7

受入テスト

  • Selenium Server 3.141.59
  • geckodriver 0.29.0
  • OpenJDK 15.0.1

書籍のコードからの変更点

  • CodeIgniter 3.1.11に対応(CodeIgniter本体は CodeIgniter Composer Installer によりComposerでインストール)
  • フォルダ構成を変更し、Web公開領域をpublicフォルダ以下に限定
  • CodeIgniterでComposerを利用可能に設定
  • ISO-2022-JPのメールは作成できなくなったのでUTF-8に変更
  • CSRF対策を独自実装からCodeIgniterの自動保護に変更
  • Codeception/Seleniumによる受入テストの追加 tests/acceptance
  • PHPUnitによるアプリケーションテストの追加 application/tests
  • データベースマイグレーションの追加 application/database/migrations
  • 掲示板
    • コントローラでの文字エンコード変換ができなくなったのでフックのpre_systemに移動
  • ショッピング
    • categoryproductテーブルのSeederを追加 application/database/seeds
    • キーワード検索をGETメソッドを使うように変更
    • メール本文の作成をテンプレートパーサクラスを使うように変更
    • クラスの分割
    • MY_Controllerの追加
    • ビューにTwigを利用
    • XSS脆弱性の修正
  • リファクタリング
    • ビューのコーディングスタイルを統一し、HTMLエスケープを徹底

追加されたComposerのパッケージ

インストール方法

ダウンロード

https://github.com/kenjis/codeigniter-tettei-apps/archive/develop.zip をダウンロードし解凍します。

Apacheの設定

codeigniter-tettei-apps/publicフォルダが公開フォルダです。ここを http://localhost/CodeIgniter/ でアクセスできるように設定してください。

例えば、以下のようにApacheのhtdocs以下にシンボリックリンクを張ります。

$ cd /paht/to/Apache/htdocs/
$ ln -s /path/to/codeigniter-tettei-apps/public/ CodeIgniter

なお、.htaccessによるmod_rewriteの設定を有効にしてください。

ファイルのパーミッション設定

必要な場合は、以下のフォルダにApacheから書き込みできる権限を付与してください。

$ cd /path/to/codeigniter-tettei-apps/
$ chmod o+w application/logs/
$ chmod o+w application/cache/
$ chmod o+w public/captcha/

依存パッケージのインストール

Composerで依存パッケージをインストールします。

$ php composer.phar self-update
$ php composer.phar self-update --1
$ php composer.phar install --no-plugins

Note

パッケージをupdateする場合

$ php -d memory_limit=-1 composer.phar update --no-plugins

データベースとユーザの作成

MySQLにデータベースとユーザを作成します。

CREATE DATABASE `codeigniter` DEFAULT CHARACTER SET utf8mb4;
GRANT ALL PRIVILEGES ON codeigniter.* TO username@localhost IDENTIFIED BY 'password';

データベースマイグレーションとシーディングの実行

データベースにテーブルを作成し、テストデータを挿入します。

$ php cli migrate
$ php cli seed

テストの実行方法

PHPUnitによるアプリケーションテスト

$ composer test

テストカバー率のレポートはbuild/coverageフォルダに作成されます。なお、カバー率の集計にはXdebugが必要です。

Note

RuntimeException: Cannot modify header information - headers already sent by (output started at .../vendor/phpunit/phpunit/src/Util/Printer.php:113) on line 350 ... のようなエラーが出る場合

$ vendor/bin/phpunit -c application/tests/ --stderr

Codeception/Seleniumによる受入テスト

https://www.mozilla.org/ja/firefox/new/ よりFirefoxをダウンロードしインストールします。

Homebrewからselenium-server-standaloneとgeckodriverをインストールします。

$ brew install selenium-server-standalone
$ brew install geckodriver

Seleniumサーバを起動します。

$ selenium-server -port 4444

受入テストを実行します。

$ sh acceptance-test.sh

Note

geckodriverが開けない場合は、一度Finderからgeckodriverを右クリックして開いてください。

参考: mozilla/geckodriver#1629 (comment)

参考

書籍のコードほぼそのままでCodeIgniter 3.0.0に対応したものを見たい場合は、masterブランチをご覧ください。

また、具体的な変更点は以下をご覧ください。

ライセンス

サンプルアプリケーションのライセンスは「修正BSDライセンス」です。詳細は、docs/license-codeigniter-tettei-1.4.txt をご覧ください。

謝辞

サンプルアプリケーションのデザインは、神野みちるさん(株式会社ステップワイズ)にしていただきました。

『CodeIgniter徹底入門』について

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].