これは非常にばかげた質問ですが、私には頼れるPHP仲間がいません。悲しいです;-)
だから私はこのセットアップを持っています、私はちょうどfirephpをインストールしました:
/lib/firephp.php // firephp standard library
/lib/data.php // a php class file of my own
|
|-> Class Data {} // this is the class
function something() { $firephp->log('whatever'); }
pre.php // here i initialize firephp
show_data.php // i show data from the database here
---
pre.php
---
require_once($_SERVER['DOCUMENT_ROOT'] . '/intranet/lib/firephp.php');
ob_start();
$firephp = FirePHP::getInstance(true);
---
show_data.php
---
include('pre.php')
include('lib/data.php')
$c = new Data
$c->something()
そして、私はこれを取得します:注意: 未定義の変数: show_data.php の firephp
TL;DRインクルードファイルでfirephpを初期化し、クラスファイルをインクルードします。クラス内から呼び出そうとすると、$firephp変数を読み取ることができません...
ヒント、叱責、または私を助けることができるものは何でも大歓迎です。