Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
569ca395
Unverified
Commit
569ca395
authored
Jun 23, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework deprecated IBMDB2 exceptions
parent
2eab0857
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
3 deletions
+66
-3
DB2Statement.php
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
+6
-3
CannotCopyStreamToStream.php
...DBAL/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php
+20
-0
CannotCreateTemporaryFile.php
...BAL/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php
+20
-0
CannotWriteToTemporaryFile.php
...AL/Driver/IBMDB2/Exception/CannotWriteToTemporaryFile.php
+20
-0
No files found.
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php
View file @
569ca395
...
...
@@ -3,6 +3,9 @@
namespace
Doctrine\DBAL\Driver\IBMDB2
;
use
Doctrine\DBAL\Driver\FetchUtils
;
use
Doctrine\DBAL\Driver\IBMDB2\Exception\CannotCopyStreamToStream
;
use
Doctrine\DBAL\Driver\IBMDB2\Exception\CannotCreateTemporaryFile
;
use
Doctrine\DBAL\Driver\IBMDB2\Exception\CannotWriteToTemporaryFile
;
use
Doctrine\DBAL\Driver\IBMDB2\Exception\StatementError
;
use
Doctrine\DBAL\Driver\Result
;
use
Doctrine\DBAL\Driver\Statement
as
StatementInterface
;
...
...
@@ -522,7 +525,7 @@ class DB2Statement implements IteratorAggregate, StatementInterface, Result
$handle
=
@
tmpfile
();
if
(
$handle
===
false
)
{
throw
new
DB2Exception
(
'Could not create temporary file: '
.
error_get_last
()[
'message'
]);
throw
CannotCreateTemporaryFile
::
new
(
error_get_last
()[
'message'
]);
}
return
$handle
;
...
...
@@ -537,7 +540,7 @@ class DB2Statement implements IteratorAggregate, StatementInterface, Result
private
function
copyStreamToStream
(
$source
,
$target
)
:
void
{
if
(
@
stream_copy_to_stream
(
$source
,
$target
)
===
false
)
{
throw
new
DB2Exception
(
'Could not copy source stream to temporary file: '
.
error_get_last
()[
'message'
]);
throw
CannotCopyStreamToStream
::
new
(
error_get_last
()[
'message'
]);
}
}
...
...
@@ -549,7 +552,7 @@ class DB2Statement implements IteratorAggregate, StatementInterface, Result
private
function
writeStringToStream
(
string
$string
,
$target
)
:
void
{
if
(
@
fwrite
(
$target
,
$string
)
===
false
)
{
throw
new
DB2Exception
(
'Could not write string to temporary file: '
.
error_get_last
()[
'message'
]);
throw
CannotWriteToTemporaryFile
::
new
(
error_get_last
()[
'message'
]);
}
}
}
lib/Doctrine/DBAL/Driver/IBMDB2/Exception/CannotCopyStreamToStream.php
0 → 100644
View file @
569ca395
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Driver\IBMDB2\Exception
;
use
Doctrine\DBAL\Driver\IBMDB2\DB2Exception
;
/**
* @internal
*
* @psalm-immutable
*/
final
class
CannotCopyStreamToStream
extends
DB2Exception
{
public
static
function
new
(
string
$message
)
:
self
{
return
new
self
(
'Could not copy source stream to temporary file: '
.
$message
);
}
}
lib/Doctrine/DBAL/Driver/IBMDB2/Exception/CannotCreateTemporaryFile.php
0 → 100644
View file @
569ca395
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Driver\IBMDB2\Exception
;
use
Doctrine\DBAL\Driver\IBMDB2\DB2Exception
;
/**
* @internal
*
* @psalm-immutable
*/
final
class
CannotCreateTemporaryFile
extends
DB2Exception
{
public
static
function
new
(
string
$message
)
:
self
{
return
new
self
(
'Could not create temporary file: '
.
$message
);
}
}
lib/Doctrine/DBAL/Driver/IBMDB2/Exception/CannotWriteToTemporaryFile.php
0 → 100644
View file @
569ca395
<?php
declare
(
strict_types
=
1
);
namespace
Doctrine\DBAL\Driver\IBMDB2\Exception
;
use
Doctrine\DBAL\Driver\IBMDB2\DB2Exception
;
/**
* @internal
*
* @psalm-immutable
*/
final
class
CannotWriteToTemporaryFile
extends
DB2Exception
{
public
static
function
new
(
string
$message
)
:
self
{
return
new
self
(
'Could not write string to temporary file: '
.
$message
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment