本文整理汇总了PHP中core::get_baseurl方法的典型用法代码示例。如果您正苦于以下问题:PHP core::get_baseurl方法的具体用法?PHP core::get_baseurl怎么用?PHP core::get_baseurl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core
的用法示例。
在下文中一共展示了core::get_baseurl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare_result
public static function prepare_result($data)
{
if (is_string($data)) {
// Remover informações sobre o URL e o path local
// Isto permite validar melhor o servidor e o localhost
$replace_data = array(core::get_baseurl(false) => 'http://.../core/', core::get_path_fixed(CORE_INDEX) => './core');
$data = str_replace(array_keys($replace_data), array_values($replace_data), $data);
return array('string', $data);
} else {
if (is_bool($data)) {
return array('boolean', $data);
} else {
if (is_int($data)) {
return array('number', $data);
} else {
if (is_float($data)) {
return array('float', $data);
} else {
if (is_array($data) || is_a($data, 'stdClass')) {
$data_values = (array) $data;
$object_type = is_array($data) ? 'array' : 'stdClass';
foreach ($data_values as &$item) {
$item = self::prepare_result($item);
}
return array('object', $data_values, $object_type);
} else {
if (is_object($data)) {
$data_values = array();
if (method_exists($data, '__toString') && !$data instanceof exception) {
$data_values['__toString()'] = array('string', $data->__toString());
}
$object_data = (array) $data;
if ($data instanceof exception) {
$object_data["*file"] = core::get_path_fixed($object_data["*file"]);
unset($object_data['xdebug_message']);
unset($object_data["Exceptionstring"]);
unset($object_data["*line"]);
unset($object_data["Exceptiontrace"]);
unset($object_data["Exceptionprevious"]);
// PHP 5.3
if (substr($object_data["*code"], 0, 2) === 'Cx') {
$message_lang = lang('/core/errors/err' . substr($object_data["*code"], 2), array('en', 'pt-br'));
$object_data["*message"] = $message_lang->get_value('error_message', $object_data["core_exception_error"]->get_message_args());
}
unset($object_data["core_exception_error"]);
} else {
if ($data instanceof core_language) {
unset($object_data["core_language_lang_dir"]);
unset($object_data["core_language_lang_order"]);
} else {
if ($data instanceof core_error) {
unset($object_data["core_error_globals"]);
unset($object_data["core_error_backtrace"]);
} else {
if ($data instanceof mysqli) {
static $mysqli_keys = array('affected_rows', 'connect_errno', 'connect_error', 'errno', 'error', 'field_count', 'info', 'insert_id', 'sqlstate', 'warning_count');
$object_data = array();
foreach ($mysqli_keys as $key) {
$object_data[$key] = $data->{$key};
}
} else {
if ($data instanceof mysqli_result) {
static $mysqli_result_keys = array('current_field', 'field_count', 'lengths', 'num_rows', 'type');
$object_data = array();
foreach ($mysqli_result_keys as $key) {
$object_data[$key] = $data->{$key};
}
} else {
if ($data instanceof core_database) {
unset($object_data["core_database_connection_string"], $object_data["core_database_connection_array"]);
} else {
if ($data instanceof core_model) {
unset($object_data["core_model_keys"]);
} else {
if ($data instanceof core_model_row) {
unset($object_data["core_model_row_model"]);
unset($object_data["core_model_row_from"]);
unset($object_data["core_model_row_conn"]);
if (isset($object_data["core_model_row_loader_method"][0][0])) {
$object_data["core_model_row_loader_method"][0][0] = null;
}
} else {
if ($data instanceof core_model_results) {
unset($object_data["core_model_results_model"]);
unset($object_data["core_model_results_from"]);
}
}
}
}
}
}
}
}
}
foreach ($object_data as $key => $value) {
$key = explode("", $key);
$key = isset($key[2]) ? $key[2] : $key[0];
$data_values[$key] = $data === $value ? array('recursive', '$this') : self::prepare_result($value);
}
ksort($data_values);
//.........这里部分代码省略.........
示例2: baseurl
function baseurl($include_modular = true)
{
return core::get_baseurl($include_modular);
}
示例3: test_get_baseurl
public function test_get_baseurl()
{
$this->test(1, substr(core::get_baseurl(), -11), 'Path are clipped');
$this->test(2, substr(core::get_baseurl(false), -6), 'Path are clipped');
$this->test(3, substr(baseurl(), -6), 'Only for coverage');
}