Yii フレームワークをサポートするエディタ用のプラグインを作成しています。このプラグインを機能させるにindex.php
は、フレームワークと構成パスの 2 つのパスを見つける必要があります。
通常index.php
(Yii のエントリ ポイント) は次のようになります。
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../../../../../usr/share/php-libs/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
require_once($yii);
Yii::createWebApplication($config)->run();
基本的に、必要なファイルと引数のリストを取得する必要がありますYii::createWebApplication()
。
ただし、ここのコードは何でもかまいません。文字通り何でも。このファイルを何らかの方法で実行しYii::createWebApplication()
て、アプリケーション ディレクトリがどこにあり、フレームワークがどこにあるかを調べることはできますか?