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
2521ab3c
Commit
2521ab3c
authored
Sep 12, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring the database layer.
parent
3ada2cbd
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
19 additions
and
25 deletions
+19
-25
callback.php
laravel/database/connector/callback.php
+0
-2
connector.php
laravel/database/connector/connector.php
+1
-1
mysql.php
laravel/database/connector/mysql.php
+2
-2
postgres.php
laravel/database/connector/postgres.php
+2
-2
sqlite.php
laravel/database/connector/sqlite.php
+4
-4
compiler.php
laravel/database/query/compiler/compiler.php
+1
-1
factory.php
laravel/database/query/compiler/factory.php
+0
-1
mysql.php
laravel/database/query/compiler/mysql.php
+0
-2
postgres.php
laravel/database/query/compiler/postgres.php
+0
-2
factory.php
laravel/database/query/factory.php
+0
-1
postgres.php
laravel/database/query/postgres.php
+2
-2
query.php
laravel/database/query/query.php
+7
-5
No files found.
laravel/database/connector/callback.php
View file @
2521ab3c
<?php
namespace
Laravel\Database\Connector
;
use
Laravel\Database\Connector
;
class
Callback
extends
Connector
{
/**
...
...
laravel/database/connector.php
→
laravel/database/connector
/connector
.php
View file @
2521ab3c
<?php
namespace
Laravel\Database
;
<?php
namespace
Laravel\Database
\Connector
;
use
PDO
;
...
...
laravel/database/connector/mysql.php
View file @
2521ab3c
<?php
namespace
Laravel\Database\Connector
;
use
Laravel\Database\Connector
;
use
PDO
;
class
MySQL
extends
Connector
{
...
...
@@ -24,7 +24,7 @@ class MySQL extends Connector {
$dsn
.=
';unix_socket='
.
$config
[
'socket'
];
}
$connection
=
new
\
PDO
(
$dsn
,
$config
[
'username'
],
$config
[
'password'
],
$this
->
options
);
$connection
=
new
PDO
(
$dsn
,
$config
[
'username'
],
$config
[
'password'
],
$this
->
options
);
if
(
isset
(
$config
[
'charset'
]))
{
...
...
laravel/database/connector/postgres.php
View file @
2521ab3c
<?php
namespace
Laravel\Database\Connector
;
use
Laravel\Database\Connector
;
use
PDO
;
class
Postgres
extends
Connector
{
...
...
@@ -19,7 +19,7 @@ class Postgres extends Connector {
$dsn
.=
';port='
.
$config
[
'port'
];
}
$connection
=
new
\
PDO
(
$dsn
,
$config
[
'username'
],
$config
[
'password'
],
$this
->
options
);
$connection
=
new
PDO
(
$dsn
,
$config
[
'username'
],
$config
[
'password'
],
$this
->
options
);
if
(
isset
(
$config
[
'charset'
]))
{
...
...
laravel/database/connector/sqlite.php
View file @
2521ab3c
<?php
namespace
Laravel\Database\Connector
;
use
Laravel\Database\Connector
;
use
PDO
;
class
SQLite
extends
Connector
{
...
...
@@ -14,15 +14,15 @@ class SQLite extends Connector {
{
if
(
$config
[
'database'
]
==
':memory:'
)
{
return
new
\
PDO
(
'sqlite::memory:'
,
null
,
null
,
$this
->
options
);
return
new
PDO
(
'sqlite::memory:'
,
null
,
null
,
$this
->
options
);
}
elseif
(
file_exists
(
$path
=
DATABASE_PATH
.
$config
[
'database'
]
.
'.sqlite'
))
{
return
new
\
PDO
(
'sqlite:'
.
$path
,
null
,
null
,
$this
->
options
);
return
new
PDO
(
'sqlite:'
.
$path
,
null
,
null
,
$this
->
options
);
}
elseif
(
file_exists
(
$config
[
'database'
]))
{
return
new
\
PDO
(
'sqlite:'
.
$config
[
'database'
],
null
,
null
,
$this
->
options
);
return
new
PDO
(
'sqlite:'
.
$config
[
'database'
],
null
,
null
,
$this
->
options
);
}
throw
new
\Exception
(
"SQLite database ["
.
$config
[
'database'
]
.
"] could not be found."
);
...
...
laravel/database/query/compiler.php
→
laravel/database/query/compiler
/compiler
.php
View file @
2521ab3c
<?php
namespace
Laravel\Database\Query
;
<?php
namespace
Laravel\Database\Query
\Compiler
;
use
Laravel\Database\Query
;
...
...
laravel/database/query/compiler/factory.php
View file @
2521ab3c
<?php
namespace
Laravel\Database\Query\Compiler
;
use
Laravel\Database\Connection
;
use
Laravel\Database\Query\Compiler
;
class
Factory
{
...
...
laravel/database/query/compiler/mysql.php
View file @
2521ab3c
<?php
namespace
Laravel\Database\Query\Compiler
;
use
Laravel\Database\Query\Compiler
;
class
MySQL
extends
Compiler
{
/**
...
...
laravel/database/query/compiler/postgres.php
View file @
2521ab3c
<?php
namespace
Laravel\Database\Query\Compiler
;
use
Laravel\Database\Query\Compiler
;
class
Postgres
extends
Compiler
{
/**
...
...
laravel/database/query/factory.php
View file @
2521ab3c
<?php
namespace
Laravel\Database\Query
;
use
Laravel\Database\Query
;
use
Laravel\Database\Connection
;
class
Factory
{
...
...
laravel/database/query/postgres.php
View file @
2521ab3c
<?php
namespace
Laravel\Database\Query
;
use
Laravel\Database\Query
;
use
PDO
;
class
Postgres
extends
Query
{
...
...
@@ -16,7 +16,7 @@ class Postgres extends Query {
$query
->
execute
(
array_values
(
$values
));
return
(
int
)
$query
->
fetch
(
\
PDO
::
FETCH_CLASS
,
'stdClass'
)
->
id
;
return
(
int
)
$query
->
fetch
(
PDO
::
FETCH_CLASS
,
'stdClass'
)
->
id
;
}
}
\ No newline at end of file
laravel/database/query.php
→
laravel/database/query
/query
.php
View file @
2521ab3c
<?php
namespace
Laravel\Database
;
<?php
namespace
Laravel\Database\Query
;
use
Laravel\Database\Connection
;
class
Query
{
...
...
@@ -90,12 +92,12 @@ class Query {
/**
* Create a new query instance.
*
* @param Connection $connection
* @param Compiler $compiler
* @param string $table
* @param
Database\
Connection $connection
* @param Compiler
$compiler
* @param string
$table
* @return void
*/
public
function
__construct
(
Connection
$connection
,
Query
\Compiler
$compiler
,
$table
)
public
function
__construct
(
Connection
$connection
,
Compiler
\Compiler
$compiler
,
$table
)
{
$this
->
table
=
$table
;
$this
->
compiler
=
$compiler
;
...
...
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