Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
X Lib
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
XLibs
X Lib
Commits
4fb87a3e
Commit
4fb87a3e
authored
Sep 16, 2016
by
Alex Ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Багфикс
parent
d531f032
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
20 deletions
+26
-20
TableItem.php
DB/TableItem.php
+2
-2
PDO.php
Database/Driver/PDO.php
+1
-3
ECollection.php
ETrace/ECollection.php
+5
-3
EItem.php
ETrace/EItem.php
+14
-6
Import.php
ETrace/Import.php
+1
-1
Trace.php
ETrace/Trace.php
+3
-5
No files found.
DB/TableItem.php
View file @
4fb87a3e
...
@@ -128,7 +128,7 @@ class TableItem {
...
@@ -128,7 +128,7 @@ class TableItem {
$this
->
sql_type
=
"first"
;
$this
->
sql_type
=
"first"
;
$columns
=
func_get_args
();
$columns
=
func_get_args
();
if
(
$this
->
driver
instanceof
\X\Database\Driver\PDO
)
{
if
(
$this
->
driver
instanceof
\X\Database\Driver\PDO
)
{
$this
->
data_columns
=
$columns
;
$this
->
data_columns
=
(
isset
(
$columns
[
0
]))
?
$columns
[
0
]
:
"*"
;
return
$this
;
return
$this
;
}
}
...
@@ -152,7 +152,7 @@ class TableItem {
...
@@ -152,7 +152,7 @@ class TableItem {
$columns
=
func_get_args
();
$columns
=
func_get_args
();
if
(
$this
->
driver
instanceof
\X\Database\Driver\PDO
)
{
if
(
$this
->
driver
instanceof
\X\Database\Driver\PDO
)
{
$this
->
data_columns
=
$columns
;
$this
->
data_columns
=
(
isset
(
$columns
[
0
]))
?
$columns
[
0
]
:
"*"
;
return
$this
;
return
$this
;
}
}
...
...
Database/Driver/PDO.php
View file @
4fb87a3e
...
@@ -293,9 +293,7 @@ class PDO {
...
@@ -293,9 +293,7 @@ class PDO {
* @param $columns
* @param $columns
*/
*/
private
function
build_columns
(
&
$columns
)
{
private
function
build_columns
(
&
$columns
)
{
if
(
count
(
$columns
)
==
1
&&
is_array
(
$columns
[
0
]))
{
if
(
is_array
(
$columns
)
&&
count
(
$columns
)
>
0
)
{
$columns
=
"`"
.
implode
(
"`,`"
,
$columns
[
0
])
.
"`"
;
}
else
if
(
count
(
$columns
)
>
1
)
{
$columns
=
"`"
.
implode
(
"`,`"
,
$columns
)
.
"`"
;
$columns
=
"`"
.
implode
(
"`,`"
,
$columns
)
.
"`"
;
}
else
{
}
else
{
$columns
=
"*"
;
$columns
=
"*"
;
...
...
ETrace/ECollection.php
View file @
4fb87a3e
...
@@ -124,9 +124,11 @@ class ECollection implements \IteratorAggregate, \ArrayAccess, \Countable {
...
@@ -124,9 +124,11 @@ class ECollection implements \IteratorAggregate, \ArrayAccess, \Countable {
*/
*/
public
function
offsetSet
(
$offset
,
$object
)
{
public
function
offsetSet
(
$offset
,
$object
)
{
$this
->
__check_type
(
$object
);
$this
->
__check_type
(
$object
);
$offset
=
$object
->
getHash
();
$offset
=
$object
->
getHash
();
$this
->
context_collection
[
$offset
][]
=
$object
->
getContext
();
if
(
count
(
$object
->
getContext
())
>
0
)
{
$object
->
clean_context
();
$this
->
context_collection
[
$offset
][]
=
$object
->
getContext
();
$object
->
clean_context
();
}
if
(
isset
(
$this
->
__collection
[
$offset
]))
{
if
(
isset
(
$this
->
__collection
[
$offset
]))
{
$this
->
__collection
[
$offset
]
->
increment
();
$this
->
__collection
[
$offset
]
->
increment
();
}
else
{
}
else
{
...
...
ETrace/EItem.php
View file @
4fb87a3e
...
@@ -9,7 +9,7 @@ class EItem extends \Exception {
...
@@ -9,7 +9,7 @@ class EItem extends \Exception {
/**
/**
* @var mixed
* @var mixed
*/
*/
protected
$
run_
context
;
protected
$context
;
/**
/**
* @var int
* @var int
*/
*/
...
@@ -47,7 +47,7 @@ class EItem extends \Exception {
...
@@ -47,7 +47,7 @@ class EItem extends \Exception {
* @return mixed
* @return mixed
*/
*/
public
function
__construct
(
$type
,
$message
,
$code
=
0
,
$file
=
false
,
$line
=
false
,
$context
=
[])
{
public
function
__construct
(
$type
,
$message
,
$code
=
0
,
$file
=
false
,
$line
=
false
,
$context
=
[])
{
parent
::
__construct
(
$message
,
$code
);
parent
::
__construct
(
$message
,
intval
(
$code
)
);
if
(
!
(
$file
===
false
))
{
if
(
!
(
$file
===
false
))
{
$this
->
file
=
$file
;
$this
->
file
=
$file
;
}
}
...
@@ -55,8 +55,9 @@ class EItem extends \Exception {
...
@@ -55,8 +55,9 @@ class EItem extends \Exception {
if
(
!
(
$line
===
false
))
{
if
(
!
(
$line
===
false
))
{
$this
->
line
=
$line
;
$this
->
line
=
$line
;
}
}
$this
->
type
=
$type
;
$this
->
type
=
$type
;
$this
->
run_context
=
$context
;
$this
->
context
=
$context
;
$this
->
hash
=
$this
->
calcHash
();
$this
->
hash
=
$this
->
calcHash
();
$this
->
host
=
isset
(
$_SERVER
[
"HTTP_HOST"
])
?
$_SERVER
[
"HTTP_HOST"
]
:
"no.host"
;
$this
->
host
=
isset
(
$_SERVER
[
"HTTP_HOST"
])
?
$_SERVER
[
"HTTP_HOST"
]
:
"no.host"
;
$this
->
session_id
=
md5
(
microtime
());
$this
->
session_id
=
md5
(
microtime
());
...
@@ -81,7 +82,14 @@ class EItem extends \Exception {
...
@@ -81,7 +82,14 @@ class EItem extends \Exception {
* @return mixed
* @return mixed
*/
*/
public
function
getContext
()
{
public
function
getContext
()
{
return
$this
->
run_context
;
return
$this
->
context
;
}
/**
* @param $context
*/
public
function
setContext
(
$context
)
{
$this
->
context
=
$context
;
}
}
/**
/**
...
@@ -103,8 +111,8 @@ class EItem extends \Exception {
...
@@ -103,8 +111,8 @@ class EItem extends \Exception {
"count"
=>
$this
->
count
,
"count"
=>
$this
->
count
,
"trace"
=>
$this
->
Trace
(),
"trace"
=>
$this
->
Trace
(),
"message"
=>
$this
->
message
,
"message"
=>
$this
->
message
,
"context"
=>
$this
->
context
,
"object_name"
=>
$this
->
object_name
,
"object_name"
=>
$this
->
object_name
,
"context"
=>
$this
->
run_context
,
];
];
}
}
...
@@ -120,7 +128,7 @@ class EItem extends \Exception {
...
@@ -120,7 +128,7 @@ class EItem extends \Exception {
}
}
public
function
clean_context
()
{
public
function
clean_context
()
{
$this
->
run_
context
=
[];
$this
->
context
=
[];
}
}
/**
/**
...
...
ETrace/Import.php
View file @
4fb87a3e
...
@@ -26,7 +26,7 @@ class Import extends EItem {
...
@@ -26,7 +26,7 @@ class Import extends EItem {
}
}
/**
/**
* @return
array
* @return
mixed
*/
*/
public
function
Trace
()
{
public
function
Trace
()
{
return
$this
->
trace
;
return
$this
->
trace
;
...
...
ETrace/Trace.php
View file @
4fb87a3e
<?php
<?php
namespace
X\ETrace
;
namespace
X\ETrace
;
class
Trace
extends
EItem
class
Trace
extends
EItem
{
{
/**
/**
* Упрощенный интерфейс для отладки кода, проверки стека и переменных окружения.
* Упрощенный интерфейс для отладки кода, проверки стека и переменных окружения.
*
*
* @param $message
* @param $message
* @param array $context
* @param array $context
*/
*/
public
function
__construct
(
$message
,
$context
=
[])
public
function
__construct
(
$context
=
[])
{
{
parent
::
__construct
(
"trace"
,
"System Trace"
,
0
,
false
,
false
,
$context
);
parent
::
__construct
(
"trace"
,
$message
,
0
,
false
,
false
,
$context
);
}
}
}
}
...
...
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