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
fb1acc31
Commit
fb1acc31
authored
Aug 20, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more additions.
parent
9d2a76b2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
13 deletions
+39
-13
connection.php
laravel/db/connection.php
+4
-4
query.php
laravel/db/query.php
+8
-5
loader.php
laravel/loader.php
+27
-4
No files found.
laravel/db/connection.php
View file @
fb1acc31
...
@@ -35,7 +35,7 @@ class Connection {
...
@@ -35,7 +35,7 @@ class Connection {
*
*
* @var Connector
* @var Connector
*/
*/
pr
otected
$connector
;
pr
ivate
$connector
;
/**
/**
* Create a new Connection instance.
* Create a new Connection instance.
...
@@ -57,7 +57,7 @@ class Connection {
...
@@ -57,7 +57,7 @@ class Connection {
*
*
* @return void
* @return void
*/
*/
p
rotected
function
connect
()
p
ublic
function
connect
()
{
{
$this
->
pdo
=
$this
->
connector
->
connect
(
$this
->
config
);
$this
->
pdo
=
$this
->
connector
->
connect
(
$this
->
config
);
}
}
...
@@ -67,7 +67,7 @@ class Connection {
...
@@ -67,7 +67,7 @@ class Connection {
*
*
* @return bool
* @return bool
*/
*/
p
rotected
function
connected
()
p
ublic
function
connected
()
{
{
return
!
is_null
(
$this
->
pdo
);
return
!
is_null
(
$this
->
pdo
);
}
}
...
@@ -128,7 +128,7 @@ class Connection {
...
@@ -128,7 +128,7 @@ class Connection {
* @param array $results
* @param array $results
* @return mixed
* @return mixed
*/
*/
pr
otected
function
execute
(
\PDOStatement
$statement
,
$bindings
)
pr
ivate
function
execute
(
\PDOStatement
$statement
,
$bindings
)
{
{
$result
=
$statement
->
execute
(
$bindings
);
$result
=
$statement
->
execute
(
$bindings
);
...
...
laravel/db/query.php
View file @
fb1acc31
...
@@ -471,7 +471,13 @@ class Query {
...
@@ -471,7 +471,13 @@ class Query {
{
{
$this
->
select
=
'SELECT '
.
$aggregator
.
'('
.
$this
->
wrap
(
$column
)
.
') AS '
.
$this
->
wrap
(
'aggregate'
);
$this
->
select
=
'SELECT '
.
$aggregator
.
'('
.
$this
->
wrap
(
$column
)
.
') AS '
.
$this
->
wrap
(
'aggregate'
);
return
$this
->
first
()
->
aggregate
;
$result
=
$this
->
connection
->
scalar
(
$this
->
compile_select
(),
$this
->
bindings
);
// Reset the SELECT clause so more queries can be performed using the same instance.
// This is helpful for getting aggregates and then getting actual results.
$this
->
select
=
null
;
return
$result
;
}
}
/**
/**
...
@@ -656,10 +662,7 @@ class Query {
...
@@ -656,10 +662,7 @@ class Query {
*
*
* @return string
* @return string
*/
*/
protected
function
wrapper
()
protected
function
wrapper
()
{
return
'"'
;
}
{
return
'"'
;
}
/**
/**
* Create query parameters from an array of values.
* Create query parameters from an array of values.
...
...
laravel/loader.php
View file @
fb1acc31
...
@@ -33,7 +33,7 @@ class Loader {
...
@@ -33,7 +33,7 @@ class Loader {
{
{
static
::
$aliases
=
Config
::
get
(
'aliases'
);
static
::
$aliases
=
Config
::
get
(
'aliases'
);
foreach
(
$paths
as
$path
)
{
static
::
register
(
$path
);
}
foreach
(
$paths
as
$path
)
{
static
::
register
_path
(
$path
);
}
}
}
/**
/**
...
@@ -113,15 +113,38 @@ class Loader {
...
@@ -113,15 +113,38 @@ class Loader {
}
}
/**
/**
* Register a path with the auto-loader. After registering the path, it will be
* Register a path with the auto-loader.
* checked similarly to the models and libraries directories.
*
* After registering the path, it will be checked similarly to the models and libraries directories.
*
*
* @param string $path
* @param string $path
* @return void
* @return void
*/
*/
public
static
function
register
(
$path
)
public
static
function
register
_path
(
$path
)
{
{
static
::
$paths
[]
=
rtrim
(
$path
,
'/'
)
.
'/'
;
static
::
$paths
[]
=
rtrim
(
$path
,
'/'
)
.
'/'
;
}
}
/**
* Register an alias with the auto-loader.
*
* @param array $alias
* @return void
*/
public
static
function
register_alias
(
$alias
)
{
static
::
$aliases
=
array_merge
(
static
::
$aliases
,
$alias
);
}
/**
* Remove an alias from the auto-loader's list of aliases.
*
* @param string $alias
* @return void
*/
public
static
function
forget_alias
(
$alias
)
{
unset
(
static
::
$aliases
[
$alias
]);
}
}
}
\ No newline at end of file
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