本文整理汇总了PHP中Environment::getBasePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Environment::getBasePath方法的具体用法?PHP Environment::getBasePath怎么用?PHP Environment::getBasePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment::getBasePath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
global $db, $cache;
$this->tax_table_file = dirname(__FILE__) . '/CAPayrollDeductionTest2009.csv';
require_once Environment::getBasePath() . '/classes/payroll_deduction/PayrollDeduction.class.php';
TTDate::setTimeZone('PST');
}
示例2: __construct
public function __construct()
{
global $db, $cache;
require_once Environment::getBasePath() . '/classes/payroll_deduction/PayrollDeduction.class.php';
$this->company_id = PRIMARY_COMPANY_ID;
TTDate::setTimeZone('PST');
}
示例3: __construct
function __construct()
{
$this->src_pdf_t4 = Environment::getBasePath() . 'interface' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'ca' . DIRECTORY_SEPARATOR . 'tax' . DIRECTORY_SEPARATOR . 't4flat-06b.pdf';
$this->src_pdf_t4summary = Environment::getBasePath() . 'interface' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'ca' . DIRECTORY_SEPARATOR . 'tax' . DIRECTORY_SEPARATOR . 't4-sum-08b.pdf';
$this->src_pdf_t4a = Environment::getBasePath() . 'interface' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'ca' . DIRECTORY_SEPARATOR . 'tax' . DIRECTORY_SEPARATOR . 't4a-flat-08b.pdf';
$this->src_pdf_t4asummary = Environment::getBasePath() . 'interface' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'ca' . DIRECTORY_SEPARATOR . 'tax' . DIRECTORY_SEPARATOR . 't4a-sum-08b.pdf';
return TRUE;
}
示例4: getPayrollDeductionObject
function getPayrollDeductionObject()
{
if (!isset($this->payroll_deduction_obj)) {
require_once Environment::getBasePath() . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . 'payroll_deduction' . DIRECTORY_SEPARATOR . 'PayrollDeduction.class.php';
$this->payroll_deduction_obj = new PayrollDeduction('CA', NULL);
$this->payroll_deduction_obj->setDate(TTDate::getTimeStamp($this->year, 12, 31));
}
return $this->payroll_deduction_obj;
}
示例5: __construct
function __construct()
{
require_once Environment::getBasePath() . 'classes/pdflib/phppdflib.class.php';
//2.835 pdf units = 1mm ---- (0,0) = 0,792.0990 (MAX,0) = 611.5095,0
$this->pdf = new pdffile();
$this->pdf->debug = 10;
$this->pdf->set_default('margin', $this->margin);
//$this->page = $this->pdf->new_page("letter");
$this->page = $this->pdf->new_page("611.5095x792.0990");
return TRUE;
}
示例6: __construct
public function __construct()
{
global $db, $cache, $profiler;
require_once '../includes/global.inc.php';
require_once Environment::getBasePath() . '/classes/modules/core/DependencyTree.class.php';
$profiler = new Profiler(true);
Debug::setBufferOutput(FALSE);
Debug::setEnable(TRUE);
if (PRODUCTION != FALSE) {
echo "DO NOT RUN ON A PRODUCTION SERVER<br>\n";
exit;
}
}
示例7: __construct
public function __construct()
{
global $db, $cache;
require_once '../includes/global.inc.php';
require_once Environment::getBasePath() . '/classes/payroll_deduction/PayrollDeduction.class.php';
$profiler = new Profiler(true);
Debug::setBufferOutput(FALSE);
Debug::setEnable(TRUE);
TTDate::setTimeZone('PST');
if (PRODUCTION != FALSE) {
echo "DO NOT RUN ON A PRODUCTION SERVER<br>\n";
exit;
}
}
示例8: __construct
function __construct($country, $province, $district = NULL)
{
$this->setCountry($country);
$this->setProvince($province);
$this->setDistrict($district);
$base_file_name = Environment::getBasePath() . '/classes/payroll_deduction/PayrollDeduction_Base.class.php';
$province_file_name = Environment::getBasePath() . '/classes/payroll_deduction/' . $this->getCountry() . '/' . $this->getProvince() . '.class.php';
$district_file_name = Environment::getBasePath() . '/classes/payroll_deduction/' . $this->getCountry() . '/' . $this->getProvince() . '_' . $this->getDistrict() . '.class.php';
$country_file_name = Environment::getBasePath() . '/classes/payroll_deduction/' . $this->getCountry() . '.class.php';
$data_file_name = Environment::getBasePath() . '/classes/payroll_deduction/' . $this->getCountry() . '/Data.class.php';
if ($this->getDistrict() != '' and $this->getDistrict() != '00') {
$class_name = 'PayrollDeduction_' . $this->getCountry() . '_' . $this->getProvince() . '_' . $this->getDistrict();
} elseif ($this->getProvince() != '') {
$class_name = 'PayrollDeduction_' . $this->getCountry() . '_' . $this->getProvince();
} else {
$class_name = 'PayrollDeduction_' . $this->getCountry();
}
//Debug::text('Country: '. $country_file_name .' Province: '. $province_file_name .' District: '. $district_file_name .' Class: '. $class_name, __FILE__, __LINE__, __METHOD__, 10);
if ((file_exists($country_file_name) or $this->getProvince() != '' and file_exists($province_file_name) or $this->getDistrict() != '' and file_exists($district_file_name)) and file_exists($data_file_name)) {
//Debug::text('Country File Exists: '. $country_file_name .' Province File Name: '. $province_file_name .' Data File: '. $data_file_name, __FILE__, __LINE__, __METHOD__, 10);
include_once $base_file_name;
include_once $data_file_name;
if (file_exists($country_file_name)) {
include_once $country_file_name;
}
if ($this->getProvince() != '' and file_exists($province_file_name)) {
include_once $province_file_name;
}
if ($this->getDistrict() != '' and file_exists($district_file_name)) {
include_once $district_file_name;
}
if (class_exists($class_name)) {
$this->obj = new $class_name();
$this->obj->setCountry($this->getCountry());
$this->obj->setProvince($this->getProvince());
$this->obj->setDistrict($this->getDistrict());
return TRUE;
} else {
return FALSE;
}
} else {
Debug::text('File DOES NOT Exists Country File Name: ' . $country_file_name . ' Province File: ' . $province_file_name, __FILE__, __LINE__, __METHOD__, 10);
}
return FALSE;
}
示例9: postInstall
function postInstall()
{
Debug::text('postInstall: ' . $this->getVersion(), __FILE__, __LINE__, __METHOD__, 9);
//Add Calendar Based Accruals to Cron.
$maint_base_path = Environment::getBasePath() . DIRECTORY_SEPARATOR . 'maint' . DIRECTORY_SEPARATOR;
if (PHP_OS == 'WINNT') {
$cron_job_base_command = 'php-win.exe ' . $maint_base_path;
} else {
$cron_job_base_command = 'php ' . $maint_base_path;
}
Debug::text('Cron Job Base Command: ' . $cron_job_base_command, __FILE__, __LINE__, __METHOD__, 9);
$cjf = new CronJobFactory();
$cjf->setName('AddAccrualPolicyTime');
$cjf->setMinute(30);
$cjf->setHour(1);
$cjf->setDayOfMonth('*');
$cjf->setMonth('*');
$cjf->setDayOfWeek('*');
$cjf->setCommand($cron_job_base_command . 'AddAccrualPolicyTime.php');
$cjf->Save();
return TRUE;
}
示例10: draw
/**
* Draws a image barcode
*
* @param string $text A text that should be in the image barcode
* @param string $type The barcode type. Supported types:
* Code39 - Code 3 of 9
* int25 - 2 Interleaved 5
* ean13 - EAN 13
* upca - UPC-A
* @param string $imgtype The image type that will be generated
*
* @return image The corresponding image barcode
*
* @access public
*
* @author Marcelo Subtil Marcal <msmarcal@php.net>
* @since Image_Barcode 0.3
*/
function draw($text, $type = 'int25', $imgtype = 'png', $send_headers = TRUE, $print_text = TRUE, $height = NULL)
{
// Check if include file exists
//echo "PEAR_INSTALL_DIR: ". PEAR_INSTALL_DIR ."<br>\n";
//$barcodepath = PEAR_INSTALL_DIR . DIRECTORY_SEPARATOR . "Image" . DIRECTORY_SEPARATOR . "Barcode";
$supportedtypes = array('Code39.php', 'code128.php');
/*
if ( $incdir = opendir($barcodepath) ) {
while ( false != ( $avaiabletype = readdir($incdir) ) ) {
if ( strstr($avaiabletype, ".php") ) {
$supportedtypes[] = $avaiabletype;
}
}
closedir($incdir);
}
*/
if (in_array($type . ".php", $supportedtypes)) {
include_once Environment::getBasePath() . "/classes/Image_Barcode/Barcode/{$type}.php";
} else {
return PEAR::raiseError("{$type} barcode is not supported");
}
$classname = "Image_Barcode_{$type}";
if (!class_exists($classname)) {
return PEAR::raiseError("Unable to include the Image/Barcode/{$type}.php file");
}
if (!in_array('draw', get_class_methods($classname))) {
return PEAR::raiseError("Unable to find create method in '{$classname}' class");
}
@($obj =& new $classname());
$obj->send_headers = $send_headers;
$obj->_print_text = $print_text;
if ($height != NULL and $height > 0) {
$obj->_barcodeheight = $height;
}
$obj->draw($text, $imgtype);
}
示例11: getTTProductEdition
function getTTProductEdition()
{
if (file_exists(Environment::getBasePath() . 'classes' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'job' . DIRECTORY_SEPARATOR . 'JobFactory.class.php')) {
return TT_PRODUCT_PROFESSIONAL;
} elseif (file_exists(Environment::getBasePath() . 'classes' . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'time_clock' . DIRECTORY_SEPARATOR . 'TimeClock.class.php')) {
return TT_PRODUCT_BUSINESS;
}
return TT_PRODUCT_STANDARD;
}
示例12: setLang
function setLang($locale)
{
// Beware: this is changing the locale process-wide.
// But *only* for LC_MESSAGES, not other LC_*.
// This is not thread-safe. For threaded web servers,
// the slower Translation2 classes should be used.
//Setting the locale again here overrides what i18Nv2 just set
//breaking Windows. However not setting it breaks some Linux distro's.
//Because apparently LC_ALL doesn't matter on some Unix, it still doesn't set LC_MESSAGES.
//So if we didn't explicity set LC_MESSAGES above, do it here.
if (OPERATING_SYSTEM == 'LINUX') {
$rc = setlocale(LC_MESSAGES, $locale);
if ($rc == 0) {
Debug::text('setLocale failed!: ' . (int) $rc . ' Locale: ' . $locale, __FILE__, __LINE__, __METHOD__, 10);
}
}
// Normally, setting env var(s) would not be necessary, but I18Nv2
// is explicitly setting LANG* env variables, which seem to be
// overriding setlocale(). Setting the env var here, fixes it.
// Yes, I know it seems backwards. YMMV.
@putEnv('LANGUAGE=' . $locale);
$domain = 'messages';
//This fixes the mysterious issue of the "sticky locale". Where PHP
//wouldn't change locales half way through a script.
textdomain($domain);
// Tell gettext where to find the locale translation files.
bindtextdomain("{$domain}", Environment::getBasePath() . DIRECTORY_SEPARATOR . 'interface' . DIRECTORY_SEPARATOR . 'locale');
// Tell gettext which codeset to use for output.
bind_textdomain_codeset($domain, 'UTF-8');
return TRUE;
}
示例13: unset
//var_dump($user_ps_entries);
}
unset($pay_period_ids, $ps_entries);
}
//Calc Part 1, Line 3 here.
if (isset($lines_arr)) {
$lines_arr['total'] = Misc::ArrayAssocSum($lines_arr, NULL, 6);
Debug::Arr($lines_arr, 'Lines Array: ', __FILE__, __LINE__, __METHOD__, 10);
//Line 8
$p1_line8 = $lines_arr['total']['p1_6'] - 0;
}
$border = 0;
$pdf = new fpdi();
//Import original Gov't supplied PDF.
if ($show_background == TRUE) {
$pagecount = $pdf->setSourceFile(Environment::getBasePath() . 'interface' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'us' . DIRECTORY_SEPARATOR . 'tax' . DIRECTORY_SEPARATOR . 'f940ez.pdf');
$tplidx = $pdf->ImportPage(1);
}
$pdf->setMargins(0, 0, 0, 0);
$pdf->SetAutoPageBreak(FALSE);
$pdf->SetFont('freeserif', '', 10);
$pdf->AddPage();
if (isset($tplidx)) {
$pdf->useTemplate($tplidx, 0, 0);
}
$pdf->setXY(40, 39);
$pdf->Cell(75, 6, $current_company->getName(), $border, 0, 'L');
$pdf->setXY(157, 39);
$pdf->Cell(10, 6, $filter_data['year'], $border, 0, 'R');
$pdf->setXY(122, 47);
$pdf->Cell(45, 6, $current_company->getBusinessNumber(), $border, 0, 'R');
示例14: UserListFactory
* In accordance with Section 7(b) of the GNU Affero General Public License
* version 3, these Appropriate Legal Notices must retain the display of the
* "Powered by TimeTrex" logo. If the display of the logo is not reasonably
* feasible for technical reasons, the Appropriate Legal Notices must display
* the words "Powered by TimeTrex".
********************************************************************************/
/*
* $Revision: 3021 $
* $Id: Upload.php 3021 2009-11-11 23:33:03Z ipso $
* $Date: 2009-11-11 15:33:03 -0800 (Wed, 11 Nov 2009) $
*/
require_once '../../includes/global.inc.php';
//Debug::setVerbosity(11);
$skip_message_check = TRUE;
require_once Environment::getBasePath() . 'includes/Interface.inc.php';
require_once Environment::getBasePath() . 'classes/upload/fileupload.class.php';
/*
if ( !$permission->Check('user','enabled')
OR !( $permission->Check('user','view') ) ) {
$permission->Redirect( FALSE ); //Redirect
}
*/
$smarty->assign('title', TTi18n::gettext($title = 'File Upload'));
// See index.php
/*
* Get FORM variables
*/
extract(FormVariables::GetVariables(array('action', 'object_type', 'object_id', 'data', 'userfile')));
$ulf = new UserListFactory();
示例15: postInstall
//.........这里部分代码省略.........
$ud_obj = $udlf->getCurrent();
$ud_obj->setCurrency($base_currency_id);
$ud_obj->setLanguage('en');
if ($ud_obj->isValid()) {
$ud_obj->Save();
}
}
unset($udlf, $ud_obj);
if (is_numeric($base_currency_id)) {
$ulf = TTnew('UserListFactory');
$ulf->getByCompanyId($c_obj->getId());
if ($ulf->getRecordCount() > 0) {
foreach ($ulf as $u_obj) {
$user_id = $u_obj->getID();
Debug::text('Setting Base Currency For User: ' . $u_obj->getUserName() . ' ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
$u_obj->setCurrency($base_currency_id);
if ($u_obj->isValid()) {
if ($u_obj->Save() == TRUE) {
//Set User Default Language
$uplf = TTnew('UserPreferenceListFactory');
$uplf->getByUserIDAndCompanyID($user_id, $c_obj->getId());
if ($uplf->getRecordCount() > 0) {
$up_obj = $uplf->getCurrent();
$up_obj->setLanguage('en');
//Englist
if ($up_obj->isValid()) {
$up_obj->Save();
}
}
unset($uplf, $up_obj);
Debug::text(' Setting Base Currency for Pay Stubs, User ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
//Change all pay stubs for this user to the base currency.
//Do this in a single query for speed purposes.
$ph = array('currency_id' => $base_currency_id, 'currency_rate' => '1.000000000', 'user_id' => $user_id);
$query = 'update pay_stub set currency_id = ?, currency_rate = ? where user_id = ?';
$u_obj->db->Execute($query, $ph);
/*
$pslf = TTnew( 'PayStubListFactory' );
$pslf->getByUserIdAndCompanyId( $user_id, $c_obj->getId() );
if ( $pslf->getRecordCount() > 0 ) {
foreach( $pslf as $ps_obj ) {
//Debug::text(' Setting Base Currency for Pay Stub ID: '. $ps_obj->getId(), __FILE__, __LINE__, __METHOD__,10);
$ps_obj->setCurrency( $base_currency_id );
if ( $ps_obj->isValid() ) {
$ps_obj->setEnableLinkedAccruals( FALSE );
$ps_obj->setEnableCalcYTD( FALSE );
$ps_obj->setEnableProcessEntries( FALSE );
$ps_obj->Save();
}
unset($ps_obj);
}
}
unset($pslf);
*/
} else {
Debug::text('Failed saving user ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
}
} else {
Debug::text('Failed saving user ID: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
}
unset($u_obj, $user_id);
}
}
unset($ulf);
}
}
unset($cf);
}
} else {
Debug::text('Company is not active! ' . $c_obj->getId(), __FILE__, __LINE__, __METHOD__, 10);
}
unset($c_obj, $base_currency, $base_currency_id, $crlf);
}
}
//$clf->FailTransaction();
$clf->CommitTransaction();
}
//Add currency updating to cron.
$maint_base_path = Environment::getBasePath() . DIRECTORY_SEPARATOR . 'maint' . DIRECTORY_SEPARATOR;
if (PHP_OS == 'WINNT') {
$cron_job_base_command = 'php-win.exe ' . $maint_base_path;
} else {
$cron_job_base_command = 'php ' . $maint_base_path;
}
Debug::text('Cron Job Base Command: ' . $cron_job_base_command, __FILE__, __LINE__, __METHOD__, 9);
$cjf = TTnew('CronJobFactory');
$cjf->setName('UpdateCurrencyRates');
$cjf->setMinute(45);
$cjf->setHour(1);
$cjf->setDayOfMonth('*');
$cjf->setMonth('*');
$cjf->setDayOfWeek('*');
$cjf->setCommand($cron_job_base_command . 'UpdateCurrencyRates.php');
$cjf->Save();
return TRUE;
}