当前位置: 首页>>代码示例>>PHP>>正文


PHP Debug::text方法代码示例

本文整理汇总了PHP中Debug::text方法的典型用法代码示例。如果您正苦于以下问题:PHP Debug::text方法的具体用法?PHP Debug::text怎么用?PHP Debug::text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Debug的用法示例。


在下文中一共展示了Debug::text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postInstall

 function postInstall()
 {
     Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
     //Loop through all permission control rows and set the levels as best we can.
     $pclf = TTnew('PermissionControlListFactory');
     $pclf->getAll();
     if ($pclf->getRecordCount() > 0) {
         $pf = TTnew('PermissionFactory');
         $preset_options = $pf->getOptions('preset');
         $preset_level_options = $pf->getOptions('preset_level');
         foreach ($pclf as $pc_obj) {
             $name = $pc_obj->getName();
             $closest_preset_id = Misc::findClosestMatch($name, $preset_options, 75);
             if (isset($preset_level_options[$closest_preset_id])) {
                 $preset_level = $preset_level_options[$closest_preset_id];
             } else {
                 $preset_level = 1;
                 //Use the lowest level if we can't find one, so by default they can't add a new administrator/supervisor.
                 //Try to count the number of permissions and match them to the number of permissions in each preset and use the closest level?
                 $permission_user_data = $pc_obj->getPermission();
                 if (is_array($permission_user_data)) {
                     foreach ($preset_options as $preset => $preset_name) {
                         $tmp_preset_permissions = $pf->getPresetPermissions($preset, array());
                         $preset_permission_diff_arr = Misc::arrayDiffAssocRecursive($permission_user_data, $tmp_preset_permissions);
                         $preset_permission_diff_count = count($preset_permission_diff_arr, COUNT_RECURSIVE);
                         Debug::text('Preset Permission Diff Count...: ' . $preset_permission_diff_count . ' Preset ID: ' . $preset, __FILE__, __LINE__, __METHOD__, 10);
                         $preset_match[$preset] = $preset_permission_diff_count;
                     }
                     unset($tmp_preset_permissions);
                     krsort($preset_match);
                     //Flip the array so if there are more then one preset with the same match_count, we use the smallest preset value.
                     $preset_match = array_flip($preset_match);
                     //Flip the array back so the key is the match_preset again.
                     $preset_match = array_flip($preset_match);
                     foreach ($preset_match as $best_match_preset => $match_value) {
                         break;
                     }
                     Debug::Arr($preset_match, 'Preset Match: Best Match: ' . $best_match_preset . ' Value: ' . $match_value . ' Current Name: ' . $pc_obj->getName(), __FILE__, __LINE__, __METHOD__, 10);
                     if (isset($preset_options[$best_match_preset])) {
                         $preset_level = $preset_level_options[$best_match_preset];
                         //Use the preset level minus one, so they don't match exactly.
                         if ($preset_level > 1) {
                             $preset_level--;
                         }
                         Debug::Text('Closest PreSet Match Level: ' . $preset_level . ' Tmp: ' . $preset_options[$best_match_preset], __FILE__, __LINE__, __METHOD__, 10);
                     }
                 }
             }
             Debug::Text('Closest Match For: ' . $name . ' ID: ' . (int) $closest_preset_id . ' Level: ' . $preset_level, __FILE__, __LINE__, __METHOD__, 10);
             //Update level for permission group.
             $pc_obj->setLevel($preset_level);
             if ($pc_obj->isValid()) {
                 $pc_obj->Save();
             }
             unset($pc_obj);
         }
     }
     unset($pclf);
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:60,代码来源:InstallSchema_1040A.class.php

示例2: postInstall

 function postInstall()
 {
     Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
     //Go through each permission group, and enable payroll export report for anyone who can see pay stub summary report.
     $clf = TTnew('CompanyListFactory');
     $clf->getAll();
     if ($clf->getRecordCount() > 0) {
         foreach ($clf as $c_obj) {
             Debug::text('Company: ' . $c_obj->getName(), __FILE__, __LINE__, __METHOD__, 9);
             if ($c_obj->getStatus() != 30) {
                 $pclf = TTnew('PermissionControlListFactory');
                 $pclf->getByCompanyId($c_obj->getId(), NULL, NULL, NULL, array('name' => 'asc'));
                 //Force order to avoid referencing column that was added in a later version (level)
                 if ($pclf->getRecordCount() > 0) {
                     foreach ($pclf as $pc_obj) {
                         Debug::text('Permission Group: ' . $pc_obj->getName(), __FILE__, __LINE__, __METHOD__, 9);
                         $plf = TTnew('PermissionListFactory');
                         $plf->getByCompanyIdAndPermissionControlIdAndSectionAndName($c_obj->getId(), $pc_obj->getId(), 'report', 'view_pay_stub_summary');
                         if ($plf->getRecordCount() > 0) {
                             Debug::text('Found permission group with pay stub report enabled: ' . $plf->getCurrent()->getValue(), __FILE__, __LINE__, __METHOD__, 9);
                             $pc_obj->setPermission(array('report' => array('view_payroll_export' => TRUE)));
                         } else {
                             Debug::text('Permission group does NOT have pay stub report enabled...', __FILE__, __LINE__, __METHOD__, 9);
                         }
                     }
                 }
             }
         }
     }
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:31,代码来源:InstallSchema_1024A.class.php

示例3: getFormObject

 function getFormObject($form, $country = NULL, $province = NULL, $district = NULL)
 {
     $class_name = 'GovernmentForms';
     $class_directory = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'country';
     if ($country != '') {
         $class_name .= '_' . strtoupper($country);
         $class_directory .= DIRECTORY_SEPARATOR . strtolower($country);
     }
     if ($province != '') {
         $class_name .= '_' . strtoupper($province);
         $class_directory .= DIRECTORY_SEPARATOR . strtolower($province);
     }
     if ($district != '') {
         $class_name .= '_' . strtoupper($district);
         $class_directory .= DIRECTORY_SEPARATOR . strtolower($district);
     }
     $class_name .= '_' . $form;
     $class_file_name = $class_directory . DIRECTORY_SEPARATOR . strtolower($form) . '.class.php';
     Debug::text('Class Directory: ' . $class_directory, __FILE__, __LINE__, __METHOD__, 10);
     Debug::text('Class File Name: ' . $class_file_name, __FILE__, __LINE__, __METHOD__, 10);
     Debug::text('Class Name: ' . $class_name, __FILE__, __LINE__, __METHOD__, 10);
     if (file_exists($class_file_name)) {
         include_once $class_file_name;
         $obj = new $class_name();
         $obj->setClassDirectory($class_directory);
         return $obj;
     } else {
         Debug::text('Class File does not exist!', __FILE__, __LINE__, __METHOD__, 10);
     }
     return FALSE;
 }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:31,代码来源:GovernmentForms.class.php

示例4: getStateTaxPayable

 function getStateTaxPayable()
 {
     //Arizona is a percent of federal tax rate.
     //However after 01-Jul-10 it changed to a straight percent of gross.
     $annual_income = $this->getAnnualTaxableIncome();
     $rate = $this->getUserValue1();
     Debug::text('Raw Rate: ' . $rate, __FILE__, __LINE__, __METHOD__, 10);
     //Because of the change from a percent of federal rate to a gross rate,
     //add some checks so if an employee's amount isn't changed we default to the closest rate.
     if ($rate >= 39.5) {
         $rate = 5.1;
     } elseif ($rate >= 33.1) {
         $rate = 4.2;
     } elseif ($rate >= 26.7) {
         $rate = 3.6;
     } elseif ($rate >= 24.5) {
         $rate = 2.7;
     } elseif ($rate >= 20.3) {
         $rate = 1.8;
     } elseif ($rate >= 10.7) {
         $rate = 1.3;
     }
     Debug::text(' Adjusted Rate: ' . $rate, __FILE__, __LINE__, __METHOD__, 10);
     $retval = bcmul($annual_income, bcdiv($rate, 100));
     if ($retval < 0) {
         $retval = 0;
     }
     Debug::text('State Annual Tax Payable: ' . $retval, __FILE__, __LINE__, __METHOD__, 10);
     return $retval;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:30,代码来源:AZ.class.php

示例5: postInstall

 function postInstall()
 {
     global $cache;
     Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
     Debug::text('l: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:7,代码来源:InstallSchema_1017A.class.php

示例6: text

 static function text($val)
 {
     if (is_object($val)) {
         if (method_exists($val, 'hasMethod')) {
             $hasDebugMethod = $val->hasMethod('debug');
         } else {
             $hasDebugMethod = method_exists($val, 'debug');
         }
         if ($hasDebugMethod) {
             return $val->debug();
         }
     }
     if (is_array($val)) {
         $result = "<ul>\n";
         foreach ($val as $k => $v) {
             $result .= "<li>{$k} = " . Debug::text($v) . "</li>\n";
         }
         $val = $result . "</ul>\n";
     } else {
         if (is_object($val)) {
             $val = var_export($val, true);
         } else {
             if (true || !Director::is_ajax()) {
                 $val = "<pre style=\"font-family: Courier new\">" . htmlentities($val) . "</pre>\n";
             }
         }
     }
     return $val;
 }
开发者ID:ramziammar,项目名称:websites,代码行数:29,代码来源:Debug.php

示例7: 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;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:30,代码来源:InstallSchema_1041A.class.php

示例8: postInstall

 function postInstall()
 {
     Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
     //Make sure Medicare Employer uses the same include/exclude accounts as Medicare Employee.
     $clf = TTnew('CompanyListFactory');
     $clf->getAll();
     if ($clf->getRecordCount() > 0) {
         foreach ($clf as $c_obj) {
             Debug::text('Company: ' . $c_obj->getName(), __FILE__, __LINE__, __METHOD__, 9);
             if ($c_obj->getStatus() != 30) {
                 $ppslf = TTNew('PayPeriodScheduleListFactory');
                 $ppslf->getByCompanyID($c_obj->getId());
                 if ($ppslf->getRecordCount() > 0) {
                     $minimum_time_between_shifts = $ppslf->getCurrent()->getNewDayTriggerTime();
                 }
                 if (isset($minimum_time_between_shifts)) {
                     $pplf = TTNew('PremiumPolicyListFactory');
                     $pplf->getAPISearchByCompanyIdAndArrayCriteria($c_obj->getID(), array('type_id' => 50));
                     if ($pplf->getRecordCount() > 0) {
                         foreach ($pplf as $pp_obj) {
                             $pp_obj->setMinimumTimeBetweenShift($minimum_time_between_shifts);
                             if ($pp_obj->isValid()) {
                                 $pp_obj->Save();
                             }
                         }
                     }
                 }
             }
         }
     }
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:32,代码来源:InstallSchema_1056A.class.php

示例9: delete

 function delete()
 {
     if (file_exists($this->getFileName())) {
         return unlink($this->getFileName());
     }
     Debug::text(' Failed deleting lock file: ' . $this->file_name, __FILE__, __LINE__, __METHOD__, 10);
     return FALSE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:8,代码来源:LockFile.class.php

示例10: debug

	public function debug() {
		$val = "<h2>" . $this->class . "</h2><ul>";
		foreach($this->toNestedArray() as $item) {
			$val .= "<li style=\"list-style-type: disc; margin-left: 20px\">" . Debug::text($item) . "</li>";
		}
		$val .= "</ul>";
		return $val;
	}
开发者ID:redema,项目名称:sapphire,代码行数:8,代码来源:ArrayList.php

示例11: postInstall

 function postInstall()
 {
     Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
     //Assume any company that already exists is already setup.
     $cf = new CompanyFactory();
     $query = 'update ' . $cf->getTable() . ' set is_setup_complete = 1';
     $this->db->Execute($query);
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:9,代码来源:InstallSchema_1051A.class.php

示例12: getStateTaxPayable

 function getStateTaxPayable()
 {
     //Arizona is a percent of federal tax rate.
     $federal_tax = $this->getFederalTaxPayable();
     $rate = bcdiv($this->getUserValue1(), 100);
     $retval = bcmul($federal_tax, $rate);
     if ($retval < 0) {
         $retval = 0;
     }
     Debug::text('State Annual Tax Payable: ' . $retval, __FILE__, __LINE__, __METHOD__, 10);
     return $retval;
 }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:12,代码来源:AZ.class.php

示例13: getDistrictTaxPayable

 function getDistrictTaxPayable()
 {
     $annual_income = $this->getDistrictAnnualTaxableIncome();
     $retval = 0;
     if ($annual_income > 0) {
         $rate = bcdiv($this->getUserValue3(), 100);
         $retval = bcmul($annual_income, $rate);
     }
     if ($retval < 0) {
         $retval = 0;
     }
     Debug::text('District Annual Tax Payable: ' . $retval, __FILE__, __LINE__, __METHOD__, 10);
     return $retval;
 }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:14,代码来源:IN_ALL.class.php

示例14: setCrumb

    static function setCrumb($name, $url = NULL)
    {
        global $db, $current_user;
        //
        // If bread crumbs "seem" like they are getting overwritten, make sure the
        // setCrumb function is being called ONLY in the default section of the switch statement. NOT THE TOP.
        //
        if ($url == '') {
            $url = $_SERVER['REQUEST_URI'];
        }
        if (!is_object($current_user)) {
            return FALSE;
        }
        Debug::text('Dropping Bread Crumb: ' . $name . ' URL: ' . $url, __FILE__, __LINE__, __METHOD__, 10);
        $ph = array('user_id' => $current_user->getId(), 'name' => $name);
        //Determine if we should update or insert bread crumb.
        $query = 'select name
					FROM bread_crumb
					WHERE user_id = ?
						AND name = ?
					LIMIT 1';
        try {
            $rs = $db->Execute($query, $ph);
        } catch (Exception $e) {
            throw new DBError($e);
        }
        if ($rs->RecordCount() == 1) {
            $ph = array('url' => $url, 'created_date' => TTDate::getTime(), 'user_id' => $current_user->getId(), 'name' => $name);
            $query = 'UPDATE bread_crumb
						SET		url = ?,
								created_date = ?
						WHERE	user_id = ?
							AND name = ?';
        } else {
            $ph = array('user_id' => $current_user->getId(), 'name' => $name, 'url' => $url, 'created_date' => TTDate::getTime());
            $query = 'insert into bread_crumb (user_id,name,url,created_date)
							VALUES(
									?,
									?,
									?,
									?
								)';
        }
        try {
            $db->Execute($query, $ph);
        } catch (Exception $e) {
            throw new DBError($e);
        }
        return TRUE;
    }
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:50,代码来源:BreadCrumb.class.php

示例15: postInstall

    function postInstall()
    {
        Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
        //Go through each permission group, and enable affordable_care report for for anyone who can view W2's.
        $clf = TTnew('CompanyListFactory');
        $clf->getAll();
        if ($clf->getRecordCount() > 0) {
            foreach ($clf as $c_obj) {
                Debug::text('Company: ' . $c_obj->getName(), __FILE__, __LINE__, __METHOD__, 9);
                if ($c_obj->getStatus() != 30) {
                    $pclf = TTnew('PermissionControlListFactory');
                    $pclf->getByCompanyId($c_obj->getId(), NULL, NULL, NULL, array('name' => 'asc'));
                    //Force order to prevent references to columns that haven't been created yet.
                    if ($pclf->getRecordCount() > 0) {
                        foreach ($pclf as $pc_obj) {
                            Debug::text('Permission Group: ' . $pc_obj->getName(), __FILE__, __LINE__, __METHOD__, 9);
                            $plf = TTnew('PermissionListFactory');
                            $plf->getByCompanyIdAndPermissionControlIdAndSectionAndName($c_obj->getId(), $pc_obj->getId(), 'report', array('view_formW2'));
                            if ($plf->getRecordCount() > 0) {
                                Debug::text('Found permission group with view_formW2 enabled: ' . $plf->getCurrent()->getValue(), __FILE__, __LINE__, __METHOD__, 9);
                                $pc_obj->setPermission(array('report' => array('view_affordable_care' => TRUE)));
                            } else {
                                Debug::text('Permission group does NOT have view_formW2 enabled...', __FILE__, __LINE__, __METHOD__, 9);
                            }
                        }
                    }
                }
            }
        }
        //Go through all stations and disable ones that don't have any employees activated for them.
        //This greatly speeds up station checks, as most stations never have employees activated.
        $query = 'update station set status_id = 10
					where status_id = 20
					AND
					(
						( user_group_selection_type_id = 20 AND NOT EXISTS( select b.id from station_user_group as b WHERE id = b.station_id ) )
						AND
						( branch_selection_type_id = 20 AND NOT EXISTS( select c.id from station_branch as c WHERE id = c.station_id ) )
						AND
						( department_selection_type_id = 20 AND NOT EXISTS( select d.id from station_department as d WHERE id = d.station_id ) )
						AND
						NOT EXISTS( select f.id from station_exclude_user as f WHERE id = f.station_id )
						AND
						NOT EXISTS( select e.id from station_include_user as e WHERE id = e.station_id )
					)
					AND ( deleted = 0 )';
        $this->getDatabaseConnection()->Execute($query);
        return TRUE;
    }
开发者ID:alachaum,项目名称:timetrex,代码行数:49,代码来源:InstallSchema_1060A.class.php


注:本文中的Debug::text方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。