Mojaviの導入
Mojaviフレームワークの入手
公式サイトからバイナリをダウンロードする。
Mojaviフレームワークの導入
1.入手したバイナリファイルを解凍する。
2.解凍後のフォルダをブラウザでアクセスできるサーバのディレクトリに移動。
3.ブラウザからアクセスする。(例:http://localhost/mojavi/)
2.解凍後のフォルダをブラウザでアクセスできるサーバのディレクトリに移動。
3.ブラウザからアクセスする。(例:http://localhost/mojavi/)
この時点でメッセージまたはエラーが表示されればとりあえずOK
フロントコントローラ(index.php)、configファイルの修正
設置後、フロントコントローラであるindex.phpと、configファイルを自分の環境に合わせて修正する。
フロントコントローラ(index.php)
10行目付近のrequire_onceにconfigファイルのパスを指定。
例
/**
* INCLUDE config.php
*/
require_once('webapp/config.php');
続いてコメント解除。本来ならconfig.phpの設定を終えた後に行う。
130行目付近。
//die('Please configure your Mojavi installation and remove this line from index.php.');
configファイル
BASE_DIR,MOJAVI_FILE,OPT_DIR,SCRIPT_PATHの4つを書き換える。
BASE_DIRにはwebappディレクトリへの絶対パスを記述。
MOJAVI_FILEにはall-in-oneクラス(デフォルトの場合mojavi-all-classes.php)のファイル名を指定。
OPT_DIRにはoptディレクトリへのパス。
SCRIPT_PATHにはindex.phpがおいてあるディレクトリへのパス
を、それぞれ指定する。
例
/** * An absolute file-system path to the webapp directory. */ define('BASE_DIR', 'C:\\xampp\\htdocs\\mojavi\\webapp\\'); /** * An absolute file-system path to the all-in-one class file Mojavi * uses. */ define('MOJAVI_FILE', 'mojavi-all-classes.php'); /** * An absolute file-system path to the optional classes directory. */ define('OPT_DIR', 'C:\\xampp\\htdocs\\mojavi\\opt\\'); /** * An absolute web path to the index.php script. */ define('SCRIPT_PATH', 'index.php');
index.phpと、config.phpの修正が終わった時点でブラウザからアクセスし、
Please configure your Mojavi installation and remove this line from index.php.
と表示されればOK.エラーが発生した場合の対処は下記を参照。
導入時のエラーの回避
Mojavi導入時にエラーが発生した場合。
画面にNoticeメッセージが表示される
例
Notice: Only variable references should be returned by reference in C:\xampp\htdocs\mojavi_default\mojavi-all-classes.php on line 767 Notice: Only variable references should be returned by reference in C:\xampp\htdocs\mojavi_default\mojavi-all-classes.php on line 1006 Notice: Only variable references should be returned by reference in C:\xampp\htdocs\mojavi_default\mojavi-all-classes.php on line 346

