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
61c793c2
Commit
61c793c2
authored
Nov 17, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored export drivers
parent
c1c66b6b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
82 deletions
+81
-82
Mysql.php
lib/Doctrine/Export/Mysql.php
+69
-65
Oracle.php
lib/Doctrine/Export/Oracle.php
+11
-16
Pgsql.php
lib/Doctrine/Export/Pgsql.php
+1
-1
No files found.
lib/Doctrine/Export/Mysql.php
View file @
61c793c2
This diff is collapsed.
Click to expand it.
lib/Doctrine/Export/Oracle.php
View file @
61c793c2
...
...
@@ -41,10 +41,9 @@ class Doctrine_Export_Oracle extends Doctrine_Export {
* @access public
*/
public
function
createDatabase
(
$name
)
{
if
(
!
$db
->
options
[
'emulate_database'
])
{
return
$db
->
raiseError
(
MDB2_ERROR_UNSUPPORTED
,
null
,
null
,
'database creation is only supported if the "emulate_database" option is enabled'
,
__FUNCTION__
);
}
if
(
!
$db
->
options
[
'emulate_database'
])
throw
new
Doctrine_Export_Oracle_Exception
(
'database creation is only supported if the "emulate_database" option is enabled'
);
$username
=
$db
->
options
[
'database_name_prefix'
]
.
$name
;
$password
=
$db
->
dsn
[
'password'
]
?
$db
->
dsn
[
'password'
]
:
$name
;
...
...
@@ -53,9 +52,7 @@ class Doctrine_Export_Oracle extends Doctrine_Export {
$query
=
'CREATE USER '
.
$username
.
' IDENTIFIED BY '
.
$password
.
$tablespace
;
$result
=
$db
->
standaloneQuery
(
$query
,
null
,
true
);
if
(
PEAR
::
isError
(
$result
))
{
return
$result
;
}
$query
=
'GRANT CREATE SESSION, CREATE TABLE, UNLIMITED TABLESPACE, CREATE SEQUENCE, CREATE TRIGGER TO '
.
$username
;
$result
=
$db
->
standaloneQuery
(
$query
,
null
,
true
);
if
(
PEAR
::
isError
(
$result
))
{
...
...
@@ -77,10 +74,10 @@ class Doctrine_Export_Oracle extends Doctrine_Export {
* @access public
*/
public
function
dropDatabase
(
$name
)
{
if
(
!
$db
->
options
[
'emulate_database'
])
{
return
$db
->
raiseError
(
MDB2_ERROR_UNSUPPORTED
,
null
,
null
,
'database dropping is only supported if the "emulate_database" option is enabled'
,
__FUNCTION__
);
}
if
(
!
$db
->
options
[
'emulate_database'
])
throw
new
Doctrine_Export_Oracle_Exception
(
'database dropping is only supported if the
"emulate_database" option is enabled'
);
$username
=
$db
->
options
[
'database_name_prefix'
]
.
$name
;
return
$db
->
standaloneQuery
(
'DROP USER '
.
$username
.
' CASCADE'
,
null
,
true
);
...
...
@@ -339,9 +336,7 @@ END;
* @param boolean $check indicates whether the function should just check if the DBMS driver
* can perform the requested table alterations if the value is true or
* actually perform them otherwise.
* @access public
*
* @return mixed MDB2_OK on success, a MDB2 error on failure
* @return void
*/
public
function
alterTable
(
$name
,
$changes
,
$check
)
{
...
...
@@ -423,7 +418,7 @@ END;
* @param object $db database object that is extended by this class
* @param string $seq_name name of the sequence to be created
* @param string $start start value of the sequence; default is 1
* @return
mixed MDB2_OK on success, a MDB2 error on failure
* @return
void
*/
public
function
createSequence
(
$seq_name
,
$start
=
1
)
{
$sequence_name
=
$db
->
quoteIdentifier
(
$db
->
getSequenceName
(
$seq_name
),
true
);
...
...
@@ -436,7 +431,7 @@ END;
*
* @param object $db database object that is extended by this class
* @param string $seq_name name of the sequence to be dropped
* @return
mixed MDB2_OK on success, a MDB2 error on failure
* @return
void
*/
public
function
dropSequence
(
$seq_name
)
{
$sequence_name
=
$db
->
quoteIdentifier
(
$db
->
getSequenceName
(
$seq_name
),
true
);
...
...
lib/Doctrine/Export/Pgsql.php
View file @
61c793c2
...
...
@@ -143,7 +143,7 @@ class Doctrine_Export_Pgsql extends Doctrine_Export {
* @throws PDOException
* @return boolean
*/
function
alterTable
(
$name
,
$changes
,
$check
)
{
public
function
alterTable
(
$name
,
$changes
,
$check
)
{
foreach
(
$changes
as
$change_name
=>
$change
)
{
switch
(
$change_name
)
{
case
'add'
:
...
...
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