Merge branch 'master' of git://github.com/shadowhand/kohana
This commit is contained in:
commit
3210b4b838
|
@ -380,6 +380,17 @@ final class Kohana {
|
||||||
return include $file;
|
return include $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new configuration object for the requested group.
|
||||||
|
*
|
||||||
|
* @param string group name
|
||||||
|
* @param boolean enable caching
|
||||||
|
*/
|
||||||
|
public function config($group, $cache = TRUE)
|
||||||
|
{
|
||||||
|
return new Kohana_Config($group, $cache);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides simple file-based caching for strings and arrays:
|
* Provides simple file-based caching for strings and arrays:
|
||||||
*
|
*
|
||||||
|
|
|
@ -28,8 +28,8 @@ class Kohana_Config_Core extends ArrayObject {
|
||||||
|
|
||||||
foreach ($files as $file)
|
foreach ($files as $file)
|
||||||
{
|
{
|
||||||
// Append each file to the configuration array
|
// Merge each file to the configuration array
|
||||||
$config += require $file;
|
$config = array_merge($config, require $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
class remote_Core {
|
class remote_Core {
|
||||||
|
|
||||||
// Default curl options
|
// Default curl options
|
||||||
public $default_options = array
|
public static $default_options = array
|
||||||
(
|
(
|
||||||
CURLOPT_USERAGENT => 'Mozilla/5.0 (compatible; Kohana v'.KOHANA_VERSION.' +http://kohanaphp.com/)',
|
CURLOPT_USERAGENT => 'Mozilla/5.0 (compatible; Kohana v3.0 +http://kohanaphp.com/)',
|
||||||
CURLOPT_CONNECTTIMEOUT => 5,
|
CURLOPT_CONNECTTIMEOUT => 5,
|
||||||
CURLOPT_TIMEOUT => 5,
|
CURLOPT_TIMEOUT => 5,
|
||||||
);
|
);
|
||||||
|
@ -31,10 +31,10 @@ class remote_Core {
|
||||||
* @param array curl options
|
* @param array curl options
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function get($url, $options = NULL)
|
public static function get($url, array $options = NULL)
|
||||||
{
|
{
|
||||||
// Add default options
|
// Add default options
|
||||||
$options = array_merge(remote::$default_options, (array) $options);
|
$options = array_merge((array) $options, remote::$default_options);
|
||||||
|
|
||||||
// The transfer must always be returned
|
// The transfer must always be returned
|
||||||
$options[CURLOPT_RETURNTRANSFER] = TRUE;
|
$options[CURLOPT_RETURNTRANSFER] = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue