本文整理汇总了PHP中CRM_Core_Error::generateLogFileHash方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Error::generateLogFileHash方法的具体用法?PHP CRM_Core_Error::generateLogFileHash怎么用?PHP CRM_Core_Error::generateLogFileHash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Error
的用法示例。
在下文中一共展示了CRM_Core_Error::generateLogFileHash方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDebugLoggerFormat
/**
* Check that a debugger is created and there is no error when passing in a prefix.
*
* Do some basic content checks.
*/
public function testDebugLoggerFormat()
{
$log = CRM_Core_Error::createDebugLogger('my-test');
$log->log('Mary had a little lamb');
$log->log('Little lamb');
$config = CRM_Core_Config::singleton();
$fileContents = file_get_contents($log->_filename);
$this->assertEquals($config->configAndLogDir . 'CiviCRM.' . 'my-test.' . CRM_Core_Error::generateLogFileHash($config) . '.log', $log->_filename);
// The 5 here is a bit arbitrary - on my local the date part is 15 chars (Mar 29 05:29:16) - but we are just checking that
// there are chars for the date at the start.
$this->assertTrue(strpos($fileContents, '[info] Mary had a little lamb') > 10);
$this->assertContains('[info] Little lamb', $fileContents);
}