本文整理匯總了PHP中It::baseUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP It::baseUrl方法的具體用法?PHP It::baseUrl怎麽用?PHP It::baseUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類It
的用法示例。
在下文中一共展示了It::baseUrl方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionIndex
function actionIndex()
{
ini_set('memory_limit', '-1');
print 'Checking `listener_log` table upgrade....<br/>';
$sql = "SHOW COLUMNS FROM `" . ListenerLog::model()->tableName() . "` LIKE 'is_last'";
$res = Yii::app()->db->createCommand($sql)->queryAll();
if (!$res) {
print '<br/><br/>Checked - requires update.<br/><br/>Attention! Script going to make small update to your database.... Please, be patient, don\'t use system before script is completed.';
$sql = "ALTER TABLE `" . ListenerLog::model()->tableName() . "` ADD `is_last` tinyint(1) NOT NULL DEFAULT '0' AFTER `is_processed`";
Yii::app()->db->createCommand($sql)->query();
$sql = "SELECT * FROM `" . Station::model()->tableName() . "`";
$stations = Yii::app()->db->createCommand($sql)->queryAll();
if ($stations) {
foreach ($stations as $key => $value) {
ListenerLog::updateIsLastForStation($value['station_id']);
}
}
print '<br><br>.....<br><br>Done!. <br/><br/>You can continue work with <a href="' . It::baseUrl() . '">Delairco</a>';
} else {
print '<br/>Checked - doesn\'t require update. <br/><br/>You can continue work with <a href="' . It::baseUrl() . '">Delairco</a>';
}
}
示例2:
<?php
Yii::app()->clientScript->registerCssFile(It::baseUrl() . '/css/datePicker.css');
Yii::app()->clientScript->registerScriptFile(It::baseUrl() . '/js/date.js');
Yii::app()->clientScript->registerScriptFile(It::baseUrl() . '/js/jquery.datePicker.js');
?>
<div class="middlewide">
<div class="middlenarrow">
<div class="spacer"></div>
<?php
$current_url = $this->createUrl('admin/awsfiltered');
?>
<div id="filterparams">
<h1><?php
echo It::t('menu_label', 'admin_aws_filtered_data');
?>
</h1>
<form action="<?php
echo $current_url;
?>
" method="post">
<table width="100%" class="formtable">
<tr>
<th>Select Station:</th>
<th> </th>
<th class="date">Start Date</th>
<th class="time">UTC Time:</th>
<th class="empty"> </th>
<th class="date">End Date</th>
<th class="time">UTC Time:</th>
<th> </th>
示例3:
<?php
Yii::app()->clientScript->registerScriptFile(It::baseUrl() . '/js/jquery.form.js');
Yii::app()->clientScript->registerScriptFile(It::baseUrl() . '/js/schedule_work.js');
?>
<div class="data_box speci-report">
<div class="header"><?php
echo It::t('home_aws', 'single__block_speci_report');
?>
</div>
<div class="content">
<?php
if (!is_null($report)) {
?>
<table>
<tr>
<td>
<?php
echo CHtml::beginForm('#', 'post');
?>
<input type="hidden" name="schedule_processed_id" value="<?php
echo $report->schedule_processed_id;
?>
" />
<textarea style="width: 300px; height: 60px; font-size: 11px;" id="speciText" name="ScheduleReportProcessed[report_string_initial]" cols="50" rows="50"><?php
echo $report->report_string_initial;
?>
</textarea>
<div class="action_msg"></div>
示例4: array
<?php
$this->widget('TwoDatesFilter', array('block_path' => '#filterparams', 'date_from_name' => 'RgGraphForm[date_from]', 'date_to_name' => 'RgGraphForm[date_to]'));
?>
<!-- BEGIN: load jqplot -->
<?php
Yii::app()->clientScript->registerCssFile(It::baseUrl() . '/css/jquery.jqplot.css');
Yii::app()->clientScript->registerScriptFile(It::baseUrl() . '/js/jqplot/jquery.jqplot.js');
Yii::app()->clientScript->registerScriptFile(It::baseUrl() . '/js/jqplot/plugins/jqplot.dateAxisRenderer.js');
Yii::app()->clientScript->registerScriptFile(It::baseUrl() . '/js/jqplot/plugins/jqplot.highlighter.js');
Yii::app()->clientScript->registerScriptFile(It::baseUrl() . '/js/jqplot/plugins/jqplot.cursor.js');
?>
<?php
$stations = $form->getStationsList();
?>
<!-- END: load jqplot -->
<div class="middlewide">
<div class="middlenarrow">
<?php
if ($stations) {
?>
<div class="right_align"><a class="refresh" href=""><?php
echo It::t('site_label', 'do_refresh');
?>
</a></div>
<?php
}
?>
示例5: array
?>
<font color="red">Not scheduled yet</font><?php
}
?>
)
</td>
</tr>
<?php
if ($conf_form->available_step > 4) {
?>
<tr>
<td colspan="3">
<h1>Installation was completed! </h1>
<input type="button" value="Enjoy service" onclick="document.location.href='<?php
echo It::baseUrl();
?>
'" />
</td>
</tr>
<?php
} else {
?>
<tr>
<td colspan="3"><?php
echo CHtml::submitButton('Add to Schedule', array('name' => 'schedule'));
?>
</td>
</tr>
<?php
}
示例6: m_0_4_1
//.........這裏部分代碼省略.........
$sql = "CREATE TABLE `schedule_report_processed` (\n `schedule_processed_id` int(11) NOT NULL AUTO_INCREMENT,\n `schedule_id` int(11) NOT NULL,\n `listener_log_id` int(11) NOT NULL,\n `is_processed` tinyint(1) NOT NULL DEFAULT '0',\n `report_string_initial` text NOT NULL,\n `report_string_changed` text NOT NULL,\n `serialized_report_problems` text NOT NULL,\n `serialized_report_errors` text NOT NULL,\n `serialized_report_explanations` text NOT NULL,\n `is_last` tinyint(1) NOT NULL DEFAULT '0',\n `created` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n `updated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',\n PRIMARY KEY (`schedule_processed_id`),\n KEY `schedule_id` (`schedule_id`),\n KEY `listener_log_id` (`listener_log_id`),\n CONSTRAINT `schedule_report_processed_fk` FOREIGN KEY (`schedule_id`) REFERENCES `schedule_report` (`schedule_id`) ON DELETE CASCADE ON UPDATE NO ACTION,\n CONSTRAINT `schedule_report_processed_ibfk_1` FOREIGN KEY (`listener_log_id`) REFERENCES `listener_log` (`log_id`) ON DELETE CASCADE ON UPDATE NO ACTION\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
Yii::app()->db->createCommand($sql)->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
} else {
$this->flushNotification(' ... already exists');
}
// metrics
$this->flushNotification('<br/><br/>New Metrics:');
$this->flushNotification('<br/>...Going to add new metric "kJ/sq.m" ...');
Yii::app()->db->createCommand("INSERT INTO `refbook_metric` (`metric_id`, `html_code`, `short_name`, `full_name`, `code`) VALUES ('21', 'kJ/sq.m', 'kJ/sq.m', 'Kilo Joule per square meter', 'kjoule_per_sq_meter')")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new metric "feet"...');
Yii::app()->db->createCommand("INSERT INTO `refbook_metric` (`metric_id`, `html_code`, `short_name`, `full_name`, `code`) VALUES ('22', 'ft', 'ft', 'Feet', 'feet')")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new metric "km"...');
Yii::app()->db->createCommand("INSERT INTO `refbook_metric` (`metric_id`,`html_code`,`short_name`,`full_name`,`code`) VALUES (23 , 'km', 'km', 'Kilometer', 'kilometer')")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new relation between "solar radiation" and "kj/sq.m"...');
RefbookMeasurementTypeMetric::model()->deleteByPk(23);
Yii::app()->db->createCommand("INSERT INTO `refbook_measurement_type_metric` (`measurement_type_metric_id`, `measurement_type_id`, `metric_id`, `is_main`) VALUES ('23', '9', '21', '0')")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new measuring type "Cloud Vertical Visibility"...');
Yii::app()->db->createCommand("INSERT INTO `refbook_measurement_type` (`measurement_type_id`, `display_name`, `code`, `ord`) VALUES (16 ,'Cloud Vertical Visibility', 'cloud_vertical_visibility', '14')")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new measuring type "Cloud Height" ...');
Yii::app()->db->createCommand("INSERT INTO `refbook_measurement_type` (`measurement_type_id`, `display_name`, `code`, `ord`) VALUES (17, 'Cloud Height', 'cloud_height', 15)")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new measuring type "Sea Level" ...');
Yii::app()->db->createCommand("INSERT INTO `refbook_measurement_type` (`measurement_type_id`, `display_name`, `code`, `ord`) VALUES (18 , 'Sea Level (Mean, Sigma, Wave Hight)', 'sea_level', '16')")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add relation between "Cloud Vertical Visibility" and "ft" ...');
Yii::app()->db->createCommand("INSERT INTO `refbook_measurement_type_metric` (`measurement_type_metric_id`, `measurement_type_id`, `metric_id`, `is_main`) VALUES (24,16,22,1)")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new relation between "Cloud Vertical Visibility" and "meter"...');
Yii::app()->db->createCommand("INSERT INTO `refbook_measurement_type_metric` (`measurement_type_metric_id`, `measurement_type_id`, `metric_id`, `is_main`) VALUES (25,16,11,0)")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new relation between "Cloud Height" and "ft"...');
Yii::app()->db->createCommand("INSERT INTO `refbook_measurement_type_metric` (`measurement_type_metric_id`, `measurement_type_id`, `metric_id`, `is_main`) VALUES (26,17,22,1)")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new relation between "Cloud Height" and "meter"...');
Yii::app()->db->createCommand("INSERT INTO `refbook_measurement_type_metric` (`measurement_type_metric_id`, `measurement_type_id`, `metric_id`, `is_main`) VALUES (27,17,11,0)")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new relation between "Visibility" and "meter"...');
Yii::app()->db->createCommand("INSERT INTO `refbook_measurement_type_metric` (`measurement_type_metric_id`, `measurement_type_id`, `metric_id`, `is_main`) VALUES (28, 11, 11, 1)")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to add new relation between "Sea Level" and "meter"...');
Yii::app()->db->createCommand("INSERT INTO `refbook_measurement_type_metric` (`measurement_type_metric_id`, `measurement_type_id`, `metric_id`, `is_main`) VALUES (29, 18, 11, 1)")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
// sensor handler
$this->flushNotification('<br/>...Going to add new column "awos_station_uses" to `sensor_handler` table...');
$res = Yii::app()->db->createCommand("SHOW COLUMNS FROM `sensor_handler` LIKE 'awos_station_uses'")->queryAll();
if (!$res) {
$res = Yii::app()->db->createCommand("ALTER TABLE `sensor_handler` ADD `awos_station_uses` TINYINT( 1 ) NOT NULL DEFAULT '0'")->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
} else {
$this->flushNotification(' ... already exists');
}
$this->flushNotification('<br/>...Going to update `sensor_handler` table...');
$sql = "UPDATE `sensor_handler` SET \n `handler_id_code` = 'SeaLevelAWS',\n `display_name` = 'Sea Level and Tide Data',\n `description` = 'Handler \"Sea Level and Tide Data\" : Processes string like \"SL1XXXXYYYYZZZZ\", where <br/>SL1 - device Id; <br/>XXXX - Mean value;<br/>YYYY - Sigma value; <br/>ZZZZ - Wave Height <br/>Example: SL1179017900140 = SL1 sensor sent data: Mean value = 1.79, Sigma value = 1.79, Wave height = 140m.',\n `default_prefix` = 'SL',\n `aws_station_uses` = 1,\n `rain_station_uses` = 0,\n `awos_station_uses` = 0,\n `aws_single_group` = 'sea_level'\n WHERE `handler_id` = 13";
Yii::app()->db->createCommand($sql)->query();
Yii::app()->db->createCommand("COMMIT")->query();
$sql = "UPDATE `sensor_handler` SET \n `handler_id_code` = 'VisibilityAWS',\n `display_name` = 'Visibility',\n `description` = 'Handler \"Visibility\"',\n `default_prefix` = 'VI',\n `aws_station_uses` = 1,\n `rain_station_uses` = 0,\n `awos_station_uses` = 0,\n `aws_single_group` = 'visibility'\n WHERE `handler_id` = 14";
Yii::app()->db->createCommand($sql)->query();
Yii::app()->db->createCommand("COMMIT")->query();
$sql = "UPDATE `sensor_handler` SET `handler_id_code` = 'CloudHeightAWS',\n `display_name` = 'Cloud Height',\n `description` = 'Handler \"Cloud Height\"',\n `default_prefix` = 'CH',\n `aws_station_uses` = 1,\n `rain_station_uses` = 0,\n `awos_station_uses` = 0,\n `aws_single_group` = 'clouds'\n WHERE `handler_id` = 15";
Yii::app()->db->createCommand($sql)->query();
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$this->flushNotification('<br/>...Going to update calculation_handler table...');
$res = Yii::app()->db->createCommand("UPDATE `calculation_handler` SET `display_name` = 'Pressure Adjusted to MSL' WHERE `handler_id` = 2");
Yii::app()->db->createCommand("COMMIT")->query();
$this->flushNotification(' ... done');
$bat_path = dirname(Yii::app()->request->scriptFile) . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . 'at' . DIRECTORY_SEPARATOR . 'schedule.bat';
$schedule_bat_content = getConfigValue('php_exe_path') . " -f " . dirname(Yii::app()->request->scriptFile) . DIRECTORY_SEPARATOR . "console.php schedule";
file_put_contents($bat_path, $schedule_bat_content);
exec('schtasks /create /sc minute /mo 1 /F /ru "SYSTEM" /tn delaircoScheduleScript /tr ' . $bat_path, $output);
$values = getConfigValue('schedule');
$values['each_minute_process_id'] = 'delaircoScheduleScript';
InstallConfig::setConfigSection('schedule', $values);
$values = getConfigValue('path');
$values['site_url_for_console'] = It::baseUrl();
InstallConfig::setConfigSection('path', $values);
It::memStatus('update__success');
$this->flushNotification('<script type="text/javascript"> setTimeout(function(){document.location.href="' . Yii::app()->controller->createUrl('update/index') . '"}, 10000)</script>');
}
示例7: init
public function init()
{
$this->config_params_path = Yii::app()->basePath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'params' . DIRECTORY_SEPARATOR;
$this->createDefaultFilesMain();
$applicationsPaths = $this->getConfigFile('application_params');
if (empty($applicationsPaths['php_exe_path']) || empty($applicationsPaths['mysqldump_exe_path']) || empty($applicationsPaths['mysql_exe_path']) || empty($applicationsPaths['site_url_for_console'])) {
$res = explode(DIRECTORY_SEPARATOR, dirname(php_ini_loaded_file()));
$basePath = $res[0] . DIRECTORY_SEPARATOR . $res[1];
if (empty($applicationsPaths['php_exe_path'])) {
$value = false;
if (It::isWindows()) {
$value = $this->findFile('php.exe', $basePath);
} else {
if (It::isLinux()) {
$value = $this->findFile('php', '/usr/bin/');
}
}
$applicationsPaths['php_exe_path'] = $value === false ? null : $value;
}
if (empty($applicationsPaths['mysqldump_exe_path'])) {
$value = false;
if (It::isWindows()) {
$value = $this->findFile('mysqldump.exe', $basePath);
} else {
if (It::isLinux()) {
$value = $this->findFile('mysqldump', '/usr/bin/');
}
}
$applicationsPaths['mysqldump_exe_path'] = $applicationsPaths['mysqldump_exe_path'] = $value === false ? null : $value;
}
if (empty($applicationsPaths['mysql_exe_path'])) {
$value = false;
if (It::isWindows()) {
$value = $this->findFile('mysql.exe', $basePath);
} else {
if (It::isLinux()) {
$value = $this->findFile('mysql', '/usr/bin/');
}
}
$applicationsPaths['mysql_exe_path'] = $applicationsPaths['mysql_exe_path'] = $value === false ? null : $value;
}
if (empty($applicationsPaths['site_url_for_console'])) {
$applicationsPaths['site_url_for_console'] = It::baseUrl();
}
}
$this->php_exe_path = $applicationsPaths['php_exe_path'];
$this->mysqldump_exe_path = $applicationsPaths['mysqldump_exe_path'];
$this->mysql_exe_path = $applicationsPaths['mysql_exe_path'];
$this->site_url_for_console = $applicationsPaths['site_url_for_console'];
$this->writeApplicationsPaths();
$this->db_backup_id = 'delaircoDbBackup';
$this->each_minute_process_id = 'delaircoScheduleScript';
$this->get_xml_process_id = 'delaircoGetXml';
$this->check_processes_process_id = 'delaircoCheckProcessesScript';
$this->each_minute_prepare_process_id = 'delaircoPrepareScript';
$this->backup_process_id = 'delaircoBackupOldDataScript';
$values = $this->getConfigFile('install');
if (isset($values['install_status'])) {
$this->install_completed = $values['install_status'];
} else {
$this->install_completed = 0;
}
//$this->apache_mod_rewrite = (apache_get_modules('mod_rewrite')) ? 1 : 0;
$this->apache_mod_rewrite = 1;
$this->htaccess = file_exists(dirname(Yii::app()->request->scriptFile) . DIRECTORY_SEPARATOR . '.htaccess') ? 1 : 0;
$this->getAvailableStep();
return parent::init();
}