<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ion-Auth  |  takeHo（たけほ）のへなちょこ台帳</title>
	<atom:link href="https://blog.takeho.com/tag/ion-auth/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.takeho.com</link>
	<description>いわゆる自由帳ってところです。</description>
	<lastBuildDate>Tue, 09 Dec 2025 01:18:20 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6</generator>

<image>
	<url>https://blog.takeho.com/wp-content/uploads/2024/08/icon-150x150.png</url>
	<title>Ion-Auth  |  takeHo（たけほ）のへなちょこ台帳</title>
	<link>https://blog.takeho.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ComposerでCodeigniter3とIon-Authライブラリを導入する方法</title>
		<link>https://blog.takeho.com/xxn7myyoarcxbmzhq3uzlkxour81aryh/</link>
					<comments>https://blog.takeho.com/xxn7myyoarcxbmzhq3uzlkxour81aryh/#respond</comments>
		
		<dc:creator><![CDATA[たけほ]]></dc:creator>
		<pubDate>Tue, 23 Jul 2024 08:30:37 +0000</pubDate>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Composer]]></category>
		<category><![CDATA[Ion-Auth]]></category>
		<guid isPermaLink="false">https://blog.takeho.com/?p=81</guid>

					<description><![CDATA[パッケージ管理ツールのComposerを使用してCodeigniter3のインストールした上で認証ライブラリであるIon-Authのセットアップ方法を説明しています。 目次 インストールCodeigniterのインストー [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>パッケージ管理ツールのComposerを使用してCodeigniter3のインストールした上で認証ライブラリであるIon-Authのセットアップ方法を説明しています。</p>




  <div id="toc" class="toc tnt-number toc-center tnt-number border-element"><input type="checkbox" class="toc-checkbox" id="toc-checkbox-2"><label class="toc-title" for="toc-checkbox-2">目次</label>
    <div class="toc-content">
    <ol class="toc-list open"><li><a href="#toc1" tabindex="0">インストール</a><ol><li><a href="#toc2" tabindex="0">Codeigniterのインストール</a></li><li><a href="#toc3" tabindex="0">Ion-Authのインストール</a></li></ol></li><li><a href="#toc4" tabindex="0">データベースの設定</a><ol><li><a href="#toc5" tabindex="0">コマンド実行ファイルの作成</a></li></ol></li></ol>
    </div>
  </div>

<h2 class="wp-block-heading"><span id="toc1">インストール</span></h2>



<h3 class="wp-block-heading"><span id="toc2">Codeigniterのインストール</span></h3>



<p>次のComposerコマンドでCodeigniter3をインストールします、</p>



<pre class="wp-block-code"><code># composer create-project kenjis/codeigniter-composer-installer ＜インストール先ディレクトリ名＞</code></pre>



<h3 class="wp-block-heading"><span id="toc3">Ion-Authのインストール</span></h3>



<p>次のComposerコマンドでIon-Authをインストールします。</p>



<pre class="wp-block-code"><code># cd ＜インストール先ディレクトリ名＞
# php bin/install.php ion-auth 2</code></pre>



<h2 class="wp-block-heading"><span id="toc4">データベースの設定</span></h2>



<p>データベースのスキーマを管理する機能を追加します。</p>



<h3 class="wp-block-heading"><span id="toc5">コマンド実行ファイルの作成</span></h3>



<p>以下のファイルを/application/controllers/内に設置します。</p>



<pre class="wp-block-code"><code>Migrate.php
&lt;?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Migrate extends CI_Controller {

    function __construct()
    {   
        parent::__construct();
        if(! $this->input->is_cli_request()) {
            show_404();
            exit;
        }   
        $this->load->library('migration');
    }   

    function current()
    {   
        if ($this->migration->current()) {
            log_message('error', 'Migration Success.');
        } else {
            log_message('error', $this->migration->error_string());
        }   
    }   

    function rollback($version)
    {   
        if ($this->migration->version($version)) {
            log_message('error', 'Migration Success.');
        } else {
            log_message('error', $this->migration->error_string());
        }   
    }   

    function latest()
    {   
        if ($this->migration->latest()) {
            log_message('error', 'Migration Success.');
        } else {
            log_message('error', $this->migration->error_string());
        }   
    }

}
マイグレーションの設定
application/config/migration.phpを次のように編集します。

&lt;?
// マイグレーションを有効化
$config&#91;'migration_enabled'] = TRUE;
// シーケンス番号で管理
$config&#91;'migration_type'] = 'sequential';</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.takeho.com/xxn7myyoarcxbmzhq3uzlkxour81aryh/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
