[ERLEDIGT] - SQL-Ausgabe
#1
Posted 03 October 2009 - 08:54 AM
Kennt jemand eine Methode?
#2
Posted 03 October 2009 - 12:06 PM
#4
Posted 03 October 2009 - 06:40 PM
'components'=> array( 'log' => array( 'class' => 'CLogRouter', 'routes' => array( array( 'class' => 'CFileLogRoute', 'levels'=> 'error, warning', ), array( 'class' => 'CWebLogRoute' ), ), ), 'user'=>array( // enable cookie-based authentication 'allowAutoLogin'=>true, ), 'db' => array( 'connectionString' => 'xxx', 'charset' => 'utf8', 'username' => 'xxx', 'password' => 'xxx', 'enableProfiling' => true, ), 'urlManager'=> array( ), ),
#5
Posted 04 October 2009 - 04:14 AM
Eigentlich gehts noch einfacher. enableProfiling brauchst du nur,wenn du die verbratene Zeit für die Statements mit messen willst. Damit die Ergebnisse angezeigt werden, braucht man dann aber auch eine CProfileLogroute.
@yii:
Hast du log in der Konfiguration unter preload mit aufgeführt?
Die Minimalkonfiguration sieht so aus:
'preload' => array('log'),
'components'=>array(
'db'=>array(
'connectionString' => '*****',
'username' => '*****',
'password' => '*****',
//'enableParamLogging' => true, // Logt die verwendeten Parameter
),
'log' => array(
'class' => 'CLogRouter',
'routes' => array(
array(
'class'=>'CWebLogRoute'
),
),
),
),
Will man die verwendeten Parameter mit loggen, kann man noch enableParamLogging aktivieren.
#6
Posted 04 October 2009 - 09:18 AM
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'basePath' => dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name' =>'xxx |',
// preloading 'log' component
'preload' => array('log'),
// autoloading model and component classes
'import' => array(
'application.models.*',
'application.components.*',
),
// application components
'components'=> array(
'log' => array(
'class' => 'CLogRouter',
'routes' => array(
array(
'class' => 'CFileLogRoute',
'levels'=> 'error, warning',
),
array(
'class' => 'CWebLogRoute'
),
),
),
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
'db' => array(
'connectionString' => 'xxx',
'charset' => 'utf8',
'username' => 'xxx',
'password' => 'xxx',
'enableProfiling' => true,
),
'urlManager'=> array(
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=> 'xxx',
'homepage' => 'xxx',
'url' => 'xxx',
),
);
#7
Posted 04 October 2009 - 09:23 AM
defined('YII_DEBUG') or define('YII_DEBUG',true);
#8
Posted 04 October 2009 - 09:32 AM
defined('YII_DEBUG') or define('YII_DEBUG',true);Diese Zeile habe ich jeweils in folgenden Dateien getestet
- layouts/main.php
- site/index.php
- config/main.php
- yiic.php
Application Log Timestamp Level Category Message 16:43:08.865984 trace system.web.CModule Loading "log" application component 16:43:08.870970 trace system.web.CModule Loading "request" application component 16:43:08.875394 trace system.web.CModule Loading "urlManager" application component 16:43:08.910824 trace system.web.CModule Loading "clientScript" application component
Die Ausgabe erfolgt jedoch nur auf der Startseite, mmh?
#9
Posted 04 October 2009 - 10:04 AM
#10
Posted 04 October 2009 - 05:32 PM
<?php
// change the following paths if necessary
$yii=dirname(__FILE__).'/../yii/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';
// remove the following line when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
require_once($yii);
Yii::createWebApplication($config)->run();
Dennoch erscheint das "Anwendungsprotokoll" nur bei
http://localhost/blog2/index.php?r=site/index
#12
Posted 06 October 2009 - 08:32 AM
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'basePath' => dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name' =>'xxx |',
// preloading 'log' component
'preload' => array('log'),
// autoloading model and component classes
'import' => array(
'application.models.*',
'application.components.*',
),
// application components
'components'=> array(
'log' => array(
'class' => 'CLogRouter',
'routes' => array(
array(
'class' => 'CProfileLogRoute',
'levels'=> 'error, warning',
),
array(
'class' => 'CWebLogRoute'
),
),
),
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
'db' => array(
'connectionString' => 'xxx',
'charset' => 'utf8',
'username' => 'xxx',
'password' => 'xxx',
'enableProfiling' => true,
),
'urlManager'=> array(
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=> 'xxx',
'homepage' => 'xxx',
'url' => 'xxx',
),
);kein Unterschied
Das Anwendungsprotokoll erscheint nur bei (site - Controller)
http://localhost/blog2/index.php?r=site/index
http://localhost/blog2/index.php?r=site/login
http://localhost/blog2/index.php?r=site/contact
Wenn ich zum Beispiel einen anderen Controller ausführe dann erscheint das Anwendungsprotokoll nicht mehr.
http://localhost/blog2/index.php?r=search/car
#14
Posted 06 October 2009 - 10:05 AM
#15
Posted 06 October 2009 - 10:29 AM
Du beendest nicht zufällig jede action mit die() oder irgendwie sowas, oder?!
#16
Posted 06 October 2009 - 04:26 PM
Nur in diesem nicht, weil ich ein exit() ausführe.
Habe ich kein Ergebnis gefunden rufe ich einen anderen view auf. Führe ich kein exit() aus, so führt yii beide render() aus!
if ( $results === null )
{
$this->setPageTitle("xxxx");
$this->render('notFound',
array(
)
);
exit();
}
$this->setPageTitle("yyy");
$this->render('search',
array(
'aSimilar' => $aSimilar,
)
);
#17
Posted 07 October 2009 - 07:15 AM
#19
Posted 07 October 2009 - 09:13 AM
Dave, on 07 October 2009 - 07:15 AM, said:
Danke, hat wunderbar funktioniert!!!!
Mike, on 07 October 2009 - 07:54 AM, said:
danke für die Info!

Help














