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
7e8310ce
Commit
7e8310ce
authored
Jan 15, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored oracle import driver
parent
6f7da981
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
65 deletions
+6
-65
Oracle.php
lib/Doctrine/Import/Oracle.php
+6
-65
No files found.
lib/Doctrine/Import/Oracle.php
View file @
7e8310ce
...
...
@@ -53,11 +53,6 @@ class Doctrine_Import_Oracle extends Doctrine_Import
$result2
=
$this
->
conn
->
standaloneQuery
(
$query
,
array
(
'text'
),
false
);
$result
=
$result2
->
fetchCol
();
if
(
$this
->
conn
->
options
[
'portability'
]
&
Doctrine
::
PORTABILITY_FIX_CASE
&&
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
)
{
$result
=
array_map
((
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
?
'strtolower'
:
'strtoupper'
),
$result
);
}
$result2
->
free
();
return
$result
;
}
...
...
@@ -69,14 +64,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import
public
function
listFunctions
()
{
$query
=
"SELECT name FROM sys.user_source WHERE line = 1 AND type = 'FUNCTION'"
;
$result
=
$this
->
conn
->
fetchColumn
(
$query
);
if
(
$this
->
conn
->
options
[
'portability'
]
&
Doctrine
::
PORTABILITY_FIX_CASE
&&
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
)
{
$result
=
array_map
((
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
?
'strtolower'
:
'strtoupper'
),
$result
);
}
return
$result
;
return
$this
->
conn
->
fetchColumn
(
$query
);
}
/**
* lists all database triggers
...
...
@@ -99,14 +87,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import
$query
=
"SELECT sequence_name FROM sys.user_sequences"
;
$tableNames
=
$this
->
conn
->
fetchColumn
(
$query
);
$result
=
array
();
foreach
(
$tableNames
as
$tableName
)
{
$result
[]
=
$this
->
_fixSequenceName
(
$tableName
);
}
if
(
$this
->
conn
->
options
[
'portability'
]
&
Doctrine
::
PORTABILITY_FIX_CASE
)
{
$result
=
array_map
((
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
?
'strtolower'
:
'strtoupper'
),
$result
);
}
return
$result
;
return
array_map
(
array
(
$this
->
conn
,
'fixSequenceName'
),
$result
);
}
/**
* lists table constraints
...
...
@@ -122,20 +103,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import
$query
.=
' WHERE table_name='
.
$table
.
' OR table_name='
.
strtoupper
(
$table
);
$constraints
=
$this
->
conn
->
fetchColumn
(
$query
);
$result
=
array
();
foreach
(
$constraints
as
$constraint
)
{
$constraint
=
$this
->
_fixIndexName
(
$constraint
);
if
(
!
empty
(
$constraint
))
{
$result
[
$constraint
]
=
true
;
}
}
if
(
$this
->
conn
->
options
[
'portability'
]
&
Doctrine
::
PORTABILITY_FIX_CASE
&&
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
)
{
$result
=
array_change_key_case
(
$result
,
$this
->
conn
->
options
[
'field_case'
]);
}
return
array_keys
(
$result
);
return
array_map
(
array
(
$this
->
conn
,
'fixIndexName'
),
$constraints
);
}
/**
* lists table constraints
...
...
@@ -174,20 +142,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import
$query
.=
' AND generated='
.
$this
->
conn
->
quote
(
'N'
,
'text'
);
$indexes
=
$this
->
conn
->
fetchColumn
(
$query
);
$result
=
array
();
foreach
(
$indexes
as
$index
)
{
$index
=
$this
->
_fixIndexName
(
$index
);
if
(
!
empty
(
$index
))
{
$result
[
$index
]
=
true
;
}
}
if
(
$this
->
conn
->
options
[
'portability'
]
&
Doctrine
::
PORTABILITY_FIX_CASE
&&
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
)
{
$result
=
array_change_key_case
(
$result
,
$this
->
conn
->
options
[
'field_case'
]);
}
return
array_keys
(
$result
);
return
array_map
(
array
(
$this
->
conn
,
'fixIndexName'
),
$indexes
);
}
/**
* lists tables
...
...
@@ -198,14 +153,7 @@ class Doctrine_Import_Oracle extends Doctrine_Import
public
function
listTables
(
$database
=
null
)
{
$query
=
'SELECT table_name FROM sys.user_tables'
;
$result
=
$this
->
conn
->
fetchColumn
(
$query
);
if
(
$this
->
conn
->
options
[
'portability'
]
&
Doctrine
::
PORTABILITY_FIX_CASE
&&
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
)
{
$result
=
array_map
((
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
?
'strtolower'
:
'strtoupper'
),
$result
);
}
return
$result
;
return
$this
->
conn
->
fetchColumn
(
$query
);
}
/**
* lists table triggers
...
...
@@ -253,13 +201,6 @@ class Doctrine_Import_Oracle extends Doctrine_Import
public
function
listViews
(
$database
=
null
)
{
$query
=
'SELECT view_name FROM sys.user_views'
;
$result
=
$this
->
conn
->
fetchColumn
(
$query
);
if
(
$this
->
conn
->
options
[
'portability'
]
&
Doctrine
::
PORTABILITY_FIX_CASE
&&
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
)
{
$result
=
array_map
((
$this
->
conn
->
options
[
'field_case'
]
==
CASE_LOWER
?
'strtolower'
:
'strtoupper'
),
$result
);
}
return
$result
;
return
$this
->
conn
->
fetchColumn
(
$query
);
}
}
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