Actions

Difference between revisions of "Mahara日本語ドキュメント/カスタマイズ/データベース"

From Mahara Wiki

< Mahara日本語ドキュメント‎ | カスタマイズ
Line 11: Line 11:
 
コアデータベーステーブルが設定された後、local_preinst()関数が実行されます。そして、プラグインテーブルが設定される前、すべてのコアデータベーステーブルが設定された後、adminユーザが作成された後、そしてadminユーザがログインする直前にインストール処理の最後としてlocal_postinst()関数が実行されます。私たちは必要に応じて、後でこのファイルにフック (hook 独自処理) を追加することができます。
 
コアデータベーステーブルが設定された後、local_preinst()関数が実行されます。そして、プラグインテーブルが設定される前、すべてのコアデータベーステーブルが設定された後、adminユーザが作成された後、そしてadminユーザがログインする直前にインストール処理の最後としてlocal_postinst()関数が実行されます。私たちは必要に応じて、後でこのファイルにフック (hook 独自処理) を追加することができます。
  
version.php and upgrade.php work the same way as in the Mahara core. When the admin/upgrade.php page is hit, the local code version number (in local/version.php) is compared against the 'localversion' in the database's config table.  If the code is newer than the database, then the xmldb_local_upgrade function (in local/upgrade.php) is run, and passed the database 'localversion'.  Code placed in here should test the database version against the code version. Look in /htdocs/lib/db/upgrade.php for examples of how it looks for the core.
+
Maharaコア内にて、version.phpおよびupgrade.phpは同じように動作します。admin/upgrade.phpページにアクセスされた場合、ローカルコードのバージョンナンバー (local/version.php内) がデータベースのconfigテーブル内の「localversion」と比較されます。If the code is newer than the database, then the xmldb_local_upgrade function (in local/upgrade.php) is run, and passed the database 'localversion'.  Code placed in here should test the database version against the code version. Look in /htdocs/lib/db/upgrade.php for examples of how it looks for the core.
 
[[Category:カスタマイズ]]
 
[[Category:カスタマイズ]]

Revision as of 03:34, 11 August 2011

作成中です - mits

Maharaのカスタマイズに関して、サイトのインストール中にデータベースを変更して、あなたのデータベースカスタマイズ部分を更新する必要が生じる場合もあります。

Mahara 1.2以降、サイト特有のデータベース更新は「/local」ディレクトリにカスタムインストールおよび更新コードを入れることにより、Moodleと同じくコアのインストールおよびアップグレードコードからは分離されました。このことにより、ローカルのカスタマイズはMaharaコアで使用されるデータベースに関して、独立した一連のバージョンナンバーのデータベースを使用することができます。

データベースを変更するカスタムPHPコードは「htdocs/local/install.php」および「htdocs/local/upgrade.php」に入ります。

install.php において:

コアデータベーステーブルが設定された後、local_preinst()関数が実行されます。そして、プラグインテーブルが設定される前、すべてのコアデータベーステーブルが設定された後、adminユーザが作成された後、そしてadminユーザがログインする直前にインストール処理の最後としてlocal_postinst()関数が実行されます。私たちは必要に応じて、後でこのファイルにフック (hook 独自処理) を追加することができます。

Maharaコア内にて、version.phpおよびupgrade.phpは同じように動作します。admin/upgrade.phpページにアクセスされた場合、ローカルコードのバージョンナンバー (local/version.php内) がデータベースのconfigテーブル内の「localversion」と比較されます。If the code is newer than the database, then the xmldb_local_upgrade function (in local/upgrade.php) is run, and passed the database 'localversion'. Code placed in here should test the database version against the code version. Look in /htdocs/lib/db/upgrade.php for examples of how it looks for the core.