mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge branch '2.0' into 2.1
This commit is contained in:
commit
ace9fefb02
6 changed files with 25 additions and 7 deletions
|
@ -379,6 +379,7 @@ class EmailComponent extends Component {
|
|||
$this->htmlMessage = null;
|
||||
$this->textMessage = null;
|
||||
$this->messageId = true;
|
||||
$this->delivery = 'mail';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -119,7 +119,7 @@ class Sqlite extends DboSource {
|
|||
}
|
||||
|
||||
/**
|
||||
* Check whether the MySQL extension is installed/loaded
|
||||
* Check whether the SQLite extension is installed/loaded
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
|
|
|
@ -174,7 +174,7 @@ class Sqlserver extends DboSource {
|
|||
if ($cache !== null) {
|
||||
return $cache;
|
||||
}
|
||||
$result = $this->_execute("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'");
|
||||
$result = $this->_execute("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES");
|
||||
|
||||
if (!$result) {
|
||||
$result->closeCursor();
|
||||
|
|
|
@ -94,9 +94,9 @@ class HttpSocket extends CakeSocket {
|
|||
'timeout' => 30,
|
||||
'request' => array(
|
||||
'uri' => array(
|
||||
'scheme' => 'http',
|
||||
'scheme' => array('http', 'https'),
|
||||
'host' => 'localhost',
|
||||
'port' => 80
|
||||
'port' => array(80, 443)
|
||||
),
|
||||
'redirect' => false,
|
||||
'cookies' => array()
|
||||
|
@ -509,7 +509,7 @@ class HttpSocket extends CakeSocket {
|
|||
* urls.
|
||||
*
|
||||
* {{{
|
||||
* $http->configUri('http://www.cakephp.org');
|
||||
* $http = new HttpSocket('http://www.cakephp.org');
|
||||
* $url = $http->url('/search?q=bar');
|
||||
* }}}
|
||||
*
|
||||
|
@ -530,11 +530,19 @@ class HttpSocket extends CakeSocket {
|
|||
$url = '/';
|
||||
}
|
||||
if (is_string($url)) {
|
||||
$scheme = $this->config['request']['uri']['scheme'];
|
||||
if (is_array($scheme)) {
|
||||
$scheme = $scheme[0];
|
||||
}
|
||||
$port = $this->config['request']['uri']['port'];
|
||||
if (is_array($port)) {
|
||||
$port = $port[0];
|
||||
}
|
||||
if ($url{0} == '/') {
|
||||
$url = $this->config['request']['uri']['host'] . ':' . $this->config['request']['uri']['port'] . $url;
|
||||
$url = $this->config['request']['uri']['host'] . ':' . $port . $url;
|
||||
}
|
||||
if (!preg_match('/^.+:\/\/|\*|^\//', $url)) {
|
||||
$url = $this->config['request']['uri']['scheme'] . '://' . $url;
|
||||
$url = $scheme . '://' . $url;
|
||||
}
|
||||
} elseif (!is_array($url) && !empty($url)) {
|
||||
return false;
|
||||
|
|
|
@ -824,6 +824,7 @@ HTMLBLOC;
|
|||
$this->assertSame($this->Controller->EmailTest->attachments, array());
|
||||
$this->assertNull($this->Controller->EmailTest->textMessage);
|
||||
$this->assertTrue($this->Controller->EmailTest->messageId);
|
||||
$this->assertEquals('mail', $this->Controller->EmailTest->delivery);
|
||||
}
|
||||
|
||||
public function testPluginCustomViewClass() {
|
||||
|
|
|
@ -230,6 +230,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
$this->Socket->__construct('http://www.cakephp.org:23/');
|
||||
$baseConfig['host'] = $baseConfig['request']['uri']['host'] = 'www.cakephp.org';
|
||||
$baseConfig['port'] = $baseConfig['request']['uri']['port'] = 23;
|
||||
$baseConfig['request']['uri']['scheme'] = 'http';
|
||||
$baseConfig['protocol'] = getprotobyname($baseConfig['protocol']);
|
||||
$this->assertEquals($this->Socket->config, $baseConfig);
|
||||
|
||||
|
@ -289,9 +290,11 @@ class HttpSocketTest extends CakeTestCase {
|
|||
);
|
||||
$this->assertEquals($this->Socket->config, $expected);
|
||||
$this->assertTrue($r);
|
||||
|
||||
$r = $this->Socket->configUri('/this-is-broken');
|
||||
$this->assertEquals($this->Socket->config, $expected);
|
||||
$this->assertFalse($r);
|
||||
|
||||
$r = $this->Socket->configUri(false);
|
||||
$this->assertEquals($this->Socket->config, $expected);
|
||||
$this->assertFalse($r);
|
||||
|
@ -967,11 +970,16 @@ class HttpSocketTest extends CakeTestCase {
|
|||
->method('request')
|
||||
->with(array('method' => 'GET', 'uri' => 'http://www.google.com/', 'version' => '1.0'));
|
||||
|
||||
$this->RequestSocket->expects($this->at(5))
|
||||
->method('request')
|
||||
->with(array('method' => 'GET', 'uri' => 'https://secure.example.com/test.php?one=two'));
|
||||
|
||||
$this->RequestSocket->get('http://www.google.com/');
|
||||
$this->RequestSocket->get('http://www.google.com/', array('foo' => 'bar'));
|
||||
$this->RequestSocket->get('http://www.google.com/', 'foo=bar');
|
||||
$this->RequestSocket->get('http://www.google.com/?foo=bar', array('foobar' => '42', 'foo' => '23'));
|
||||
$this->RequestSocket->get('http://www.google.com/', null, array('version' => '1.0'));
|
||||
$this->RequestSocket->get('https://secure.example.com/test.php', array('one' => 'two'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue