本文整理汇总了PHP中Debug::Text方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::Text方法的具体用法?PHP Debug::Text怎么用?PHP Debug::Text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Debug
的用法示例。
在下文中一共展示了Debug::Text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($orientation = 'P', $unit = 'mm', $format = 'A4', $encoding = 'UTF-8', $diskcache = FALSE)
{
if (TTi18n::getPDFDefaultFont() != 'freeserif' and $encoding == 'ISO-8859-1') {
parent::__construct($orientation, $unit, $format, FALSE, 'ISO-8859-1', $diskcache);
//Make sure TCPDF constructor is called with all the arguments
} else {
parent::__construct($orientation, $unit, $format, TRUE, $encoding, $diskcache);
//Make sure TCPDF constructor is called with all the arguments
}
Debug::Text('PDF Encoding: ' . $encoding, __FILE__, __LINE__, __METHOD__, 10);
/*
if ( TTi18n::getPDFDefaultFont() == 'freeserif' ) {
Debug::Text('Using unicode PDF: Font: freeserif Unicode: '. (int)$unicode .' Encoding: '. $encoding, __FILE__, __LINE__, __METHOD__,10);
} else {
//If we're only using English, default to faster non-unicode settings.
//unicode=FALSE and encoding='ISO-8859-1' is about 20-30% faster.
Debug::Text('Using non-unicode PDF: Font: helvetica Unicode: '. (int)$unicode .' Encoding: '. $encoding, __FILE__, __LINE__, __METHOD__,10);
parent::__construct($orientation, $unit, $format, FALSE, 'ISO-8859-1', $diskcache); //Make sure TCPDF constructor is called with all the arguments
}
*/
//Using freeserif font enabling font subsetting is slow and produces PDFs at least 1mb. Helvetica is fine though.
$this->setFontSubsetting(TRUE);
//When enabled, makes PDFs smaller, but severly slows down TCPDF if enabled. (+6 seconds per PDF)
$this->SetCreator(APPLICATION_NAME . ' ' . getTTProductEditionName() . ' v' . APPLICATION_VERSION);
return TRUE;
}
示例2: postInstall
function postInstall()
{
Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
//Modify all hierarchies with the request object type included, to add new request object types.
$hclf = TTnew('HierarchyControlListFactory');
$hclf->getAll();
if ($hclf->getRecordCount() > 0) {
foreach ($hclf as $hc_obj) {
$src_object_types = $hc_obj->getObjectType();
$request_key = array_search(50, $src_object_types);
if ($request_key !== FALSE) {
Debug::Text('Found request object type, ID: ' . $hc_obj->getId() . ' Company ID: ' . $hc_obj->getCompany(), __FILE__, __LINE__, __METHOD__, 10);
unset($src_object_types[$request_key]);
$src_object_types[] = 1010;
$src_object_types[] = 1020;
$src_object_types[] = 1030;
$src_object_types[] = 1040;
$src_object_types[] = 1100;
$src_object_types = array_unique($src_object_types);
$hc_obj->setObjectType($src_object_types);
if ($hc_obj->isValid()) {
$hc_obj->Save();
}
} else {
Debug::Text('Request object type not found for ID: ' . $hc_obj->getId() . ' Company ID: ' . $hc_obj->getCompany(), __FILE__, __LINE__, __METHOD__, 10);
}
}
}
return TRUE;
}
示例3: __construct
function __construct($e, $code = 'DBError')
{
global $db, $skip_db_error;
if (isset($skip_db_error_exception) and $skip_db_error_exception === TRUE) {
//Used by system_check script.
return TRUE;
}
$db->FailTrans();
//print_r($e);
//adodb_pr($e);
Debug::Text('Begin Exception...', __FILE__, __LINE__, __METHOD__, 10);
Debug::Arr(Debug::backTrace(), ' BackTrace: ', __FILE__, __LINE__, __METHOD__, 10);
//Log database error
if (isset($e->message)) {
if (stristr($e->message, 'statement timeout') !== FALSE) {
$code = 'DBTimeout';
}
Debug::Text($e->message, __FILE__, __LINE__, __METHOD__, 10);
}
if (isset($e->trace)) {
$e = strip_tags(adodb_backtrace($e->trace));
Debug::Arr($e, 'Exception...', __FILE__, __LINE__, __METHOD__, 10);
}
Debug::Text('End Exception...', __FILE__, __LINE__, __METHOD__, 10);
//Dump debug buffer.
Debug::Display();
Debug::writeToLog();
Debug::emailLog();
Redirect::Page(URLBuilder::getURL(array('exception' => $code), Environment::getBaseURL() . 'DownForMaintenance.php'));
ob_flush();
ob_clean();
exit;
}
示例4: convert
static function convert($src_unit, $dst_unit, $measurement, $exponent = 1)
{
$src_unit = strtolower($src_unit);
$dst_unit = strtolower($dst_unit);
if (!isset(self::$units[$src_unit])) {
return FALSE;
}
if (!isset(self::$units[$dst_unit])) {
return FALSE;
}
if ($src_unit == $dst_unit) {
return $measurement;
}
//Make sure we can convert from one unit to another.
$valid_conversion = FALSE;
foreach (self::$valid_unit_groups as $base_unit => $valid_units) {
if (in_array($src_unit, $valid_units) and in_array($dst_unit, $valid_units)) {
//Valid conversion
$valid_conversion = TRUE;
}
}
if ($valid_conversion == FALSE) {
return FALSE;
}
$base_measurement = pow(self::$units[$src_unit], $exponent) * $measurement;
Debug::Text(' Base Measurement: ' . $base_measurement, __FILE__, __LINE__, __METHOD__, 10);
if ($base_measurement != 0) {
$retval = 1 / pow(self::$units[$dst_unit], $exponent) * $base_measurement;
return $retval;
}
return FALSE;
}
示例5: setCompanyDeduction
function setCompanyDeduction($id)
{
$id = trim($id);
Debug::Text('ID: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
$cdlf = new CompanyDeductionListFactory();
if ($this->Validator->isResultSetWithRows('company_deduction', $cdlf->getByID($id), TTi18n::gettext('Deduction is invalid'))) {
$this->data['company_deduction_id'] = $id;
return TRUE;
}
return FALSE;
}
示例6: setHierarchyControl
function setHierarchyControl($id)
{
$id = trim($id);
$hclf = TTnew('HierarchyControlListFactory');
Debug::Text('Hierarchy Control ID: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
if ($id != 0 or $this->Validator->isResultSetWithRows('hierarchy_control_id', $hclf->getByID($id), TTi18n::gettext('Invalid Hierarchy Control'))) {
$this->data['hierarchy_control_id'] = $id;
return TRUE;
}
return FALSE;
}
示例7: filterCompanyAddress
function filterCompanyAddress($value)
{
Debug::Text('Filtering company address: ' . $value, __FILE__, __LINE__, __METHOD__, 10);
//Combine company address for multicell display.
$retarr[] = $this->company_address1;
if ($this->company_address2 != '') {
$retarr[] = $this->company_address2;
}
$retarr[] = $this->company_city . ', ' . $this->company_state . ' ' . $this->company_zip_code;
return implode("\n", $retarr);
}
示例8: setType
function setType($type)
{
$type = trim($type);
$key = Option::getByValue($type, $this->getOptions('type'));
if ($key !== FALSE) {
$type = $key;
}
Debug::Text('bType: ' . $type, __FILE__, __LINE__, __METHOD__, 10);
if ($this->Validator->inArrayKey('type', $type, TTi18n::gettext('Incorrect Type'), $this->getOptions('type'))) {
$this->data['type_id'] = $type;
return FALSE;
}
return FALSE;
}
示例9: page
static function page($url = NULL)
{
if (empty($url) and !empty($_SERVER['HTTP_REFERER'])) {
$url = $_SERVER['HTTP_REFERER'];
}
Debug::Text('Redirect URL: ' . $url, __FILE__, __LINE__, __METHOD__, 11);
if (Debug::getVerbosity() != 11) {
header("Location: {$url}\n\n");
//Prevent the rest of the script from running after redirect?
Debug::writeToLog();
ob_clean();
exit;
}
return TRUE;
}
示例10: __construct
public function __construct()
{
parent::__construct();
//Make sure parent constructor is always called.
//When APIImport()->getImportObjects() is called directly, there won't be a main class to call.
if (isset($this->main_class) and $this->main_class != '') {
$this->import_obj = new $this->main_class();
$this->import_obj->company_id = $this->getCurrentCompanyObject()->getID();
$this->import_obj->user_id = $this->getCurrentUserObject()->getID();
Debug::Text('Setting main class: ' . $this->main_class . ' Company ID: ' . $this->import_obj->company_id, __FILE__, __LINE__, __METHOD__, 10);
} else {
Debug::Text('NOT Setting main class... Company ID: ' . $this->getCurrentCompanyObject()->getID(), __FILE__, __LINE__, __METHOD__, 10);
}
return TRUE;
}
示例11: smarty_function_EmbeddedAuthorizationList
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
function smarty_function_EmbeddedAuthorizationList($params, &$smarty)
{
global $current_company, $current_user;
$object_type_id = $params['object_type_id'];
$object_id = $params['object_id'];
$ulf = new UserListFactory();
$hlf = new HierarchyListFactory();
$hotlf = new HierarchyObjectTypeListFactory();
$alf = new AuthorizationListFactory();
$alf->setObjectType($object_type_id);
//$authorizing_obj = $alf->getObjectHandler()->getById( $object_id )->getCurrent();
$tmp_authorizing_obj = $alf->getObjectHandler()->getById($object_id);
if (is_object($tmp_authorizing_obj)) {
$authorizing_obj = $tmp_authorizing_obj->getCurrent();
} else {
return FALSE;
}
//var_dump($authorizing_obj);
unset($alf);
$user_id = $authorizing_obj->getUserObject()->getId();
$alf = new AuthorizationListFactory();
$alf->getByObjectTypeAndObjectId($object_type_id, $object_id);
foreach ($alf as $authorization_obj) {
$authorization_data[] = array('id' => $authorization_obj->getId(), 'created_by_full_name' => $ulf->getById($authorization_obj->getCreatedBy())->getCurrent()->getFullName(), 'authorized' => $authorization_obj->getAuthorized(), 'created_date' => $authorization_obj->getCreatedDate(), 'created_by' => $authorization_obj->getCreatedBy(), 'updated_date' => $authorization_obj->getUpdatedDate(), 'updated_by' => $authorization_obj->getUpdatedBy(), 'deleted_date' => $authorization_obj->getDeletedDate(), 'deleted_by' => $authorization_obj->getDeletedBy());
$user_id = $authorization_obj->getCreatedBy();
}
if ($authorizing_obj->getStatus() == 30) {
//If the object is still pending authorization, display who its waiting on...
$hierarchy_id = $hotlf->getByCompanyIdAndObjectTypeId($current_company->getId(), $object_type_id)->getCurrent()->getHierarchyControl();
Debug::Text('Hierarchy ID: ' . $hierarchy_id, __FILE__, __LINE__, __METHOD__, 10);
//Get Parents
$parent_level_user_ids = $hlf->getParentLevelIdArrayByHierarchyControlIdAndUserId($hierarchy_id, $user_id);
Debug::Arr($parent_level_user_ids, 'Parent Level Ids', __FILE__, __LINE__, __METHOD__, 10);
if ($parent_level_user_ids !== FALSE and count($parent_level_user_ids) > 0) {
Debug::Text('Adding Pending Line: ', __FILE__, __LINE__, __METHOD__, 10);
foreach ($parent_level_user_ids as $parent_user_id) {
$created_by_full_name[] = $ulf->getById($parent_user_id)->getCurrent()->getFullName();
}
$authorization_data[] = array('id' => NULL, 'created_by_full_name' => implode('<br>', $created_by_full_name), 'authorized' => NULL, 'created_date' => NULL, 'created_by' => NULL);
}
}
$smarty->assign_by_ref('authorization_data', $authorization_data);
$smarty->display('authorization/EmbeddedAuthorizationList.tpl');
}
示例12: getAccrualBalance
/**
* Get accrual balance data for one or more accrual balancees.
* @param array $data filter data
* @return array
*/
function getAccrualBalance($data = NULL, $disable_paging = FALSE)
{
if (!$this->getPermissionObject()->Check('accrual', 'enabled') or !($this->getPermissionObject()->Check('accrual', 'view') or $this->getPermissionObject()->Check('accrual', 'view_own') or $this->getPermissionObject()->Check('accrual', 'view_child'))) {
return $this->getPermissionObject()->PermissionDenied();
}
$data = $this->initializeFilterAndPager($data, $disable_paging);
$data['filter_data']['permission_children_ids'] = $this->getPermissionObject()->getPermissionChildren('accrual', 'view');
$blf = TTnew('AccrualBalanceListFactory');
$blf->getAPISearchByCompanyIdAndArrayCriteria($this->getCurrentCompanyObject()->getId(), $data['filter_data'], $data['filter_items_per_page'], $data['filter_page'], NULL, $data['filter_sort']);
Debug::Text('Record Count: ' . $blf->getRecordCount(), __FILE__, __LINE__, __METHOD__, 10);
if ($blf->getRecordCount() > 0) {
$this->getProgressBarObject()->start($this->getAMFMessageID(), $blf->getRecordCount());
$this->setPagerObject($blf);
foreach ($blf as $b_obj) {
$retarr[] = $b_obj->getObjectAsArray($data['filter_columns'], $data['filter_data']['permission_children_ids']);
$this->getProgressBarObject()->set($this->getAMFMessageID(), $blf->getCurrentRow());
}
$this->getProgressBarObject()->stop($this->getAMFMessageID());
return $this->returnHandler($retarr);
}
return $this->returnHandler(TRUE);
//No records returned.
}
示例13: __construct
function __construct($e)
{
global $db;
$db->FailTrans();
//print_r($e);
//adodb_pr($e);
//Log database error
if (isset($e->message)) {
Debug::Text($e->message, __FILE__, __LINE__, __METHOD__, 10);
}
if (isset($e->trace)) {
$e = strip_tags(adodb_backtrace($e->trace));
Debug::Arr($e, 'Exception...', __FILE__, __LINE__, __METHOD__, 10);
}
Debug::Arr(Debug::backTrace(), ' BackTrace: ', __FILE__, __LINE__, __METHOD__, 10);
//Dump debug buffer.
Debug::Display();
Debug::writeToLog();
Debug::emailLog();
Redirect::Page(URLBuilder::getURL(array('exception' => 'DBError'), Environment::getBaseURL() . 'DownForMaintenance.php'));
ob_flush();
ob_clean();
exit;
}
示例14: unset
unset($generic_data['name']);
default:
BreadCrumb::setCrumb($title);
if ($action == 'load') {
Debug::Text('Loading Report!', __FILE__, __LINE__, __METHOD__, 10);
extract(UserGenericDataFactory::getReportFormData($generic_data['id']));
} elseif ($action == '') {
//Check for default saved report first.
$ugdlf->getByUserIdAndScriptAndDefault($current_user->getId(), $_SERVER['SCRIPT_NAME']);
if ($ugdlf->getRecordCount() > 0) {
Debug::Text('Found Default Report!', __FILE__, __LINE__, __METHOD__, 10);
$ugd_obj = $ugdlf->getCurrent();
$filter_data = $ugd_obj->getData();
$generic_data['id'] = $ugd_obj->getId();
} else {
Debug::Text('Default Settings!', __FILE__, __LINE__, __METHOD__, 10);
//Default selections
$filter_data['user_status_ids'] = array(10);
$filter_data['branch_ids'] = array(-1);
$filter_data['department_ids'] = array(-1);
$filter_data['user_title_ids'] = array(-1);
$filter_data['pay_period_ids'] = array('-0000-' . array_shift(array_keys($pay_period_options)));
$filter_data['start_date'] = $default_start_date;
$filter_data['end_date'] = $default_end_date;
$filter_data['group_ids'] = array(-1);
//$filter_data['user_ids'] = array_keys( UserListFactory::getByCompanyIdArray( $current_company->getId(), FALSE, FALSE ) );
if (!isset($filter_data['column_ids'])) {
$filter_data['column_ids'] = array();
}
$filter_data['column_ids'] = array_merge($filter_data['column_ids'], array('-1000-full_name', '-1065-pay_period', '-1090-worked_time', '-1130-paid_time', '-1140-regular_time'));
$filter_data['primary_sort'] = '-1000-full_name';
示例15: postSave
function postSave()
{
//Handle dirty work here.
Debug::Text('ID we just saved: ' . $this->getId(), __FILE__, __LINE__, __METHOD__, 10);
if ($this->getEnableReCalculate() == TRUE) {
//Set User Termination date to Last Day.
$ulf = TTnew('UserListFactory');
$ulf->getById($this->getUser());
if ($ulf->getRecordCount() > 0) {
Debug::Text('Setting User Termination Date', __FILE__, __LINE__, __METHOD__, 10);
$user_obj = $ulf->getCurrent();
$user_obj->setStatus(20);
//Set status to terminated, now that pay stubs will always generate anyways.
$user_obj->setTerminationDate($this->getLastDate());
if ($user_obj->isValid()) {
$user_obj->Save();
UserGenericStatusFactory::queueGenericStatus($this->getUserObject()->getFullName(TRUE) . ' - ' . TTi18n::gettext('Employee Record'), 30, TTi18n::gettext('Setting employee termination date to:') . ' ' . TTDate::getDate('DATE', $this->getLastDate()), NULL);
}
}
$this->ReCalculate();
}
return TRUE;
}