Yii Framework Forum: [RESUELTO] FirePHP - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[RESUELTO] FirePHP Alguien lo logró hacer andar? Rate Topic: -----

#1 User is offline   DG Esteban A. Pérez 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 35
  • Joined: 16-September 10
  • Location:Bs. As., Argentina

Posted 06 October 2010 - 12:20 PM

Seguí los pasos de "Integrating FirePHP" (http://www.yiiframew...oc/cookbook/84/).

Obtuve como resultado este error:
Fatal error: Uncaught exception 'CException' with message  'Alias "pmmii.components.FirePHPCore.fb" is invalid. Make sure it points to  an existing directory or file.' in  D:\www\docs\ps\yii\framework\YiiBase.php on line 282


Intenté con:
application.components.FirePHPCore.fb
application.protected.components.FirePHPCore.fb

Intenté también "forzarlo" con el "shiki", pero finalmente me dice q la función "fb" no existe...
¿Cómo hacer para que funcione el FirePhp?:unsure:

Gracias desde ya

/--------------------------------------------------/

Finalmente se logra hacer andar de este modo:

$app = Yii::createWebApplication($config);
if (YII_DEBUG){
 //   echo "[".Yii::getPathOfAlias("application")."]";
 //   die();
	Yii::import("application.components.FirePHPCore.fb", true);
}
$app->setLanguage(strstr(Yii::app()->request->preferredLanguage,'_',true));
$app->run();


Hasta donde comprendo, recién luego de createWebApplication puede utilizarse Yii::import y que funcione adecuadamente getPathOfAlias()

E.

E.
0

#2 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,462
  • Joined: 04-October 10

Posted 20 October 2010 - 04:10 PM

Es normal que eso te ocurriera puesto que primero has de crear la aplicacion. Al crearse el __construct de la clase CApplication es invokado y es el que inicia todos los alias de direccion.

Chequea la clase CApplication.

Un saludo!!
0

#3 User is offline   quantico 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 49
  • Joined: 05-May 11
  • Location:Guatemala

Posted 10 May 2011 - 05:06 PM

a mi tampoco me funcionó cookbook 84 :-(
este error me da


PHP Error
include(FirePHP.php): failed to open stream: No such file or directory

/var/www/yii/framework/YiiBase.php(396)

384 * @return boolean whether the class has been loaded successfully
385 */
386 public static function autoload($className)
387 {
388 // use include so that the error PHP file may appear
389 if(isset(self::$_coreClasses[$className]))
390 include(YII_PATH.self::$_coreClasses[$className]);
391 else if(isset(self::$classMap[$className]))
392 include(self::$classMap[$className]);
393 else
394 {
395 if(strpos($className,'\\')===false)
396 include($className.'.php');
397 else // class name with namespace in PHP 5.3
398 {
399 $namespace=str_replace('\\','.',ltrim($className,'\\'));
400 if(($path=self::getPathOfAlias($namespace))!==false)
401 include($path.'.php');
402 else
403 return false;
404 }
405 return class_exists($className,false) || interface_exists($className,false);
406 }
407 return true;
408 }

Stack Trace
#0 + – /var/www/yii/framework/YiiBase.php(396): YiiBase::autoload() 391 else if(isset(self::$classMap[$className]))
392 include(self::$classMap[$className]);
393 else
394 {
395 if(strpos($className,'\\')===false)
396 include($className.'.php');
397 else // class name with namespace in PHP 5.3
398 {
399 $namespace=str_replace('\\','.',ltrim($className,'\\'));
400 if(($path=self::getPathOfAlias($namespace))!==false)
401 include($path.'.php');
#1 unknown(0): YiiBase::autoload("FirePHP") #2 unknown(0): spl_autoload_call("FirePHP") #3 + – /var/www/acreditacion/protected/components/FirePHPCore/fb.php(45): class_exists("FirePHP") 40 * @author Christoph Dorn <christoph@christophdorn.com>
41 * @license http://www.opensourc...bsd-license.php
42 * @package FirePHPCore
43 */
44
45 if(!class_exists('FirePHP')) {
46 require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'FirePHP.class.php';
47 }
48
49 /**
50 * Sends the given data to the FirePHP Firefox Extension.
#4 + – /var/www/yii/framework/YiiBase.php(309): require("/var/www/acreditacion/protected/components/FirePHPCore/fb.php") 304 if($isClass)
305 {
306 if($forceInclude)
307 {
308 if(is_file($path.'.php'))
309 require($path.'.php');
310 else
311 throw new CException(Yii::t('yii','Alias "{alias}" is invalid. Make sure it points to an existing PHP file.',array('{alias}'=>$alias)));
312 self::$_imports[$alias]=$className;
313 }
314 else
#5 + – /var/www/acreditacion/index.php(16): YiiBase::import("application.components.FirePHPCore.fb", true) 11
12 require_once($yii);
13 //inicio FirePHP
14 $app = Yii::createWebApplication($config);
15 if (YII_DEBUG){
16 Yii::import("application.components.FirePHPCore.fb", true);
17 }
18 $app->setLanguage(strstr(Yii::app()->request->preferredLanguage,'_',true));
19 $app->run();
20 //fin Firephp
21 //Yii::createWebApplication($config)->run();
2011-05-10 17:03:41 Apache/2.2.14 (Ubuntu) Yii Framework/1.1.7
probé así
// change the following paths if necessary
$yii=dirname(__FILE__).'/../yii/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);
//inicio FirePHP
$app = Yii::createWebApplication($config);
if (YII_DEBUG){
Yii::import("application.components.FirePHPCore.fb", true);
}
$app->setLanguage(strstr(Yii::app()->request->preferredLanguage,'_',true));
$app->run();
//fin Firephp

y así
// change the following paths if necessary
$yii=dirname(__FILE__).'/../yii/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);
//inicio FirePHP
$app = Yii::createWebApplication($config);
if (YII_DEBUG){
Yii::import("application.components.FirePHPCore.fb", true);
}
$app->run();
//fin Firephp

y nada

en mi /var/ww/acreditacion/protected/components/FirePHPCore están los siguientes archivos
fb.php
fb.php4
FirePHP.class.php
FirePHP.class.php4
LICENSE

pero nada.
0

#4 User is offline   Leandro Tec Can 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 22-April 10

Posted 24 May 2013 - 01:20 PM

In Controller.php located in Components folder put this following code


public function init(){
parent::init();
if(YII_DEBUG){
spl_autoload_unregister(array('YiiBase','autoload'));
require_once (dirname(__FILE__).'/../components/FirePHPCore/fb.php');
spl_autoload_register(array('YiiBase', 'autoload'));
}
}
0

#5 User is offline   Toki Aquino 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 27-April 13
  • Location:Asuncion - Paraguay

Posted 11 June 2013 - 03:12 PM

Yo realice de esta manera.

En el index.php hice el include del FirePHP

require_once($yii);
require_once '../FirePHPCore/FirePHP.class.php';
ob_start();
Yii::createWebApplication($config)->run();


Luego en donde quiero utilizar
$miFire = FirePHP::getInstance(true);
$miFire->log($someObject, 'Mensaje');


Y me funciona sin problemas
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users