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
21dccae7
Commit
21dccae7
authored
Oct 21, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor sqlite connector to accept path in constructor.
parent
23c79a03
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
container.php
laravel/config/container.php
+1
-1
sqlite.php
laravel/database/connectors/sqlite.php
+19
-1
No files found.
laravel/config/container.php
View file @
21dccae7
...
@@ -53,7 +53,7 @@ return array(
...
@@ -53,7 +53,7 @@ return array(
'laravel.database.connectors.sqlite'
=>
array
(
'resolver'
=>
function
(
$c
)
'laravel.database.connectors.sqlite'
=>
array
(
'resolver'
=>
function
(
$c
)
{
{
return
new
Database\Connectors\SQLite
;
return
new
Database\Connectors\SQLite
(
DATABASE_PATH
)
;
}),
}),
'laravel.database.connectors.mysql'
=>
array
(
'resolver'
=>
function
(
$c
)
'laravel.database.connectors.mysql'
=>
array
(
'resolver'
=>
function
(
$c
)
...
...
laravel/database/connectors/sqlite.php
View file @
21dccae7
...
@@ -2,6 +2,24 @@
...
@@ -2,6 +2,24 @@
class
SQLite
extends
Connector
{
class
SQLite
extends
Connector
{
/**
* The path to the SQLite databases for the application.
*
* @var string
*/
protected
$path
;
/**
* Create a new SQLite database connector instance.
*
* @param string $path
* @return void
*/
public
function
__construct
(
$path
)
{
$this
->
path
=
$path
;
}
/**
/**
* Establish a PDO database connection for a given database configuration.
* Establish a PDO database connection for a given database configuration.
*
*
...
@@ -21,7 +39,7 @@ class SQLite extends Connector {
...
@@ -21,7 +39,7 @@ class SQLite extends Connector {
// application. If we don't find the database there, we will assume the database
// application. If we don't find the database there, we will assume the database
// name is actually a full qualified path to the database on disk and attempt
// name is actually a full qualified path to the database on disk and attempt
// to load it. If we still can't find it, we'll bail out.
// to load it. If we still can't find it, we'll bail out.
elseif
(
file_exists
(
$path
=
DATABASE_PATH
.
$config
[
'database'
]
.
'.sqlite'
))
elseif
(
file_exists
(
$path
=
$this
->
path
.
$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