Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Yeray Santana Hualde
syncEnrollments
Commits
68b4e553
Commit
68b4e553
authored
Mar 17, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up code.
Signed-off-by:
Taylor Otwell
<
taylorotwell@gmail.com
>
parent
8c209a7a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
mysql.php
laravel/database/connectors/mysql.php
+3
-0
sqlite.php
laravel/database/connectors/sqlite.php
+18
-7
No files found.
laravel/database/connectors/mysql.php
View file @
68b4e553
...
@@ -22,6 +22,9 @@ class MySQL extends Connector {
...
@@ -22,6 +22,9 @@ class MySQL extends Connector {
$dsn
.=
";port=
{
$config
[
'port'
]
}
"
;
$dsn
.=
";port=
{
$config
[
'port'
]
}
"
;
}
}
// The UNIX socket option allows the developer to indicate that the MySQL
// instance must be connected to via a given socket. We'll just append
// it to the DSN connection string if it is present.
if
(
isset
(
$config
[
'unix_socket'
]))
if
(
isset
(
$config
[
'unix_socket'
]))
{
{
$dsn
.=
";unix_socket=
{
$config
[
'unix_socket'
]
}
"
;
$dsn
.=
";unix_socket=
{
$config
[
'unix_socket'
]
}
"
;
...
...
laravel/database/connectors/sqlite.php
View file @
68b4e553
...
@@ -12,18 +12,29 @@ class SQLite extends Connector {
...
@@ -12,18 +12,29 @@ class SQLite extends Connector {
{
{
$options
=
$this
->
options
(
$config
);
$options
=
$this
->
options
(
$config
);
// SQLite provides supported for "in-memory" databases, which exist only for
the
// SQLite provides supported for "in-memory" databases, which exist only for
// lifetime of the request. Any given in-memory database may only have one
PDO
// lifetime of the request. Any given in-memory database may only have one
//
connection open to it at a time. These are usually for testing
.
//
PDO connection open to it at a time. These are mainly for tests
.
if
(
$config
[
'database'
]
==
':memory:'
)
if
(
$config
[
'database'
]
==
':memory:'
)
{
{
return
new
PDO
(
'sqlite::memory:'
,
null
,
null
,
$options
);
return
new
PDO
(
'sqlite::memory:'
,
null
,
null
,
$options
);
}
}
// SQLite databases will be created automatically if they do not exist, so we
// We'll allow the "database" configuration option to be a fully qualified
// will not check for the existence of the database file before establishing
// path to the database so we'll check if that is the case first. If it
// the PDO connection to the database.
// isn't a fully qualified path we will use the storage directory.
if
(
file_exists
(
$config
[
'database'
]))
{
$path
=
$config
[
'database'
];
}
// The database option does not appear to be a fully qualified path so we
// will just assume it is a relative path from the storage directory
// which is typically used to store all SQLite databases.
else
{
$path
=
path
(
'storage'
)
.
'database'
.
DS
.
$config
[
'database'
]
.
'.sqlite'
;
$path
=
path
(
'storage'
)
.
'database'
.
DS
.
$config
[
'database'
]
.
'.sqlite'
;
}
return
new
PDO
(
'sqlite:'
.
$path
,
null
,
null
,
$options
);
return
new
PDO
(
'sqlite:'
.
$path
,
null
,
null
,
$options
);
}
}
...
...
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