Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Alto
/
rkn
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit a4a3044d
authored
2021-06-16 16:53:03 +0300
by
san58
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
выключил лог
1 parent
1cceb9f9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
commands/ScanController.php
commands/ScanController.php
View file @
a4a3044
...
@@ -60,12 +60,12 @@ class ScanController extends Controller
...
@@ -60,12 +60,12 @@ class ScanController extends Controller
$filters
=
[
'1'
=>
Collection
::
get_filter
(
Filter
::
TYPE_1
),
'2'
=>
Collection
::
get_filter
(
Filter
::
TYPE_2
),
'3'
=>
Collection
::
get_filter
(
Filter
::
TYPE_3
)];
$filters
=
[
'1'
=>
Collection
::
get_filter
(
Filter
::
TYPE_1
),
'2'
=>
Collection
::
get_filter
(
Filter
::
TYPE_2
),
'3'
=>
Collection
::
get_filter
(
Filter
::
TYPE_3
)];
$csv_datatime
=
''
;
$csv_datatime
=
''
;
$progress
=
0
;
$progress
=
0
;
$time_start
=
0
;
//
$time_start = 0;
while
((
$csv_data
=
fgetcsv
(
$csv_handle
,
1024
,
';'
))
!==
false
&&
$csv_row
<
2920
)
while
((
$csv_data
=
fgetcsv
(
$csv_handle
,
1024
,
';'
))
!==
false
/*&& $csv_row<2920*/
)
{
{
if
(
$csv_row
===
2900
){
$time_cuttent
=
microtime
(
true
);
echo
"
\n
"
.
't1 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2900){ $time_cuttent = microtime(true); echo "\n".'t1 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
$file_pos
=
ftell
(
$csv_handle
);
$file_pos
=
ftell
(
$csv_handle
);
if
(
$csv_row
===
2900
){
$time_cuttent
=
microtime
(
true
);
echo
't2 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2900){ $time_cuttent = microtime(true); echo 't2 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
if
(
$file_pos
!==
false
&&
$file_size
>
0
)
if
(
$file_pos
!==
false
&&
$file_size
>
0
)
{
{
$progress_current
=
(
int
)
round
(
10
*
$file_pos
/
$file_size
);
$progress_current
=
(
int
)
round
(
10
*
$file_pos
/
$file_size
);
...
@@ -77,7 +77,7 @@ class ScanController extends Controller
...
@@ -77,7 +77,7 @@ class ScanController extends Controller
unset
(
$progress_current
);
unset
(
$progress_current
);
}
}
if
(
$csv_row
===
2900
){
$time_cuttent
=
microtime
(
true
);
echo
't3 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2900){ $time_cuttent = microtime(true); echo 't3 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
$csv_row
++
;
$csv_row
++
;
if
(
$csv_row
===
1
)
if
(
$csv_row
===
1
)
$csv_datatime
=
date
(
$csv_datatime
=
date
(
...
@@ -88,24 +88,24 @@ class ScanController extends Controller
...
@@ -88,24 +88,24 @@ class ScanController extends Controller
);
);
elseif
(
isset
(
$csv_data
[
1
])
===
true
)
elseif
(
isset
(
$csv_data
[
1
])
===
true
)
{
{
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't4 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't4 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
$host
=
Collection
::
domain_filter
(
$csv_data
[
1
]);
$host
=
Collection
::
domain_filter
(
$csv_data
[
1
]);
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't5 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't5 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
if
(
$host
===
false
)
if
(
$host
===
false
)
{
{
$csv_skip_row
++
;
$csv_skip_row
++
;
}
}
else
else
{
{
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't6 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't6 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
$status
=
[
$status
=
[
'1'
=>
(
Collection
::
apply_filter
(
$host
,
$filters
[
'1'
])
===
false
?
Host
::
STATUS_OFF
:
Host
::
STATUS_ON
),
'1'
=>
(
Collection
::
apply_filter
(
$host
,
$filters
[
'1'
])
===
false
?
Host
::
STATUS_OFF
:
Host
::
STATUS_ON
),
'2'
=>
(
Collection
::
apply_filter
(
$host
,
$filters
[
'2'
])
===
false
?
Host
::
STATUS_OFF
:
Host
::
STATUS_ON
),
'2'
=>
(
Collection
::
apply_filter
(
$host
,
$filters
[
'2'
])
===
false
?
Host
::
STATUS_OFF
:
Host
::
STATUS_ON
),
'3'
=>
(
Collection
::
apply_filter
(
$host
,
$filters
[
'3'
])
===
false
?
Host
::
STATUS_OFF
:
Host
::
STATUS_ON
)
'3'
=>
(
Collection
::
apply_filter
(
$host
,
$filters
[
'3'
])
===
false
?
Host
::
STATUS_OFF
:
Host
::
STATUS_ON
)
];
];
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't7 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't7 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
$db_request
=
Yii
::
$app
->
db
->
createCommand
();
$db_request
=
Yii
::
$app
->
db
->
createCommand
();
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't8 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't8 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
if
(
$db_request
)
if
(
$db_request
)
{
{
$host_bd
=
(
new
Query
())
$host_bd
=
(
new
Query
())
...
@@ -114,7 +114,7 @@ class ScanController extends Controller
...
@@ -114,7 +114,7 @@ class ScanController extends Controller
->
where
(
'domain=:host'
,
array
(
':host'
=>
$host
))
->
where
(
'domain=:host'
,
array
(
':host'
=>
$host
))
->
limit
(
1
)
->
limit
(
1
)
->
one
();
->
one
();
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't9 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't9 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
if
(
$host_bd
===
false
)
if
(
$host_bd
===
false
)
{
{
$db_request
->
insert
(
$db_request
->
insert
(
...
@@ -130,11 +130,11 @@ class ScanController extends Controller
...
@@ -130,11 +130,11 @@ class ScanController extends Controller
]
]
)
->
execute
();
)
->
execute
();
$rec
[
'insert'
]
++
;
$rec
[
'insert'
]
++
;
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't10 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't10 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
}
}
elseif
(
isset
(
$host_bd
[
'csv_date'
])
&&
$host_bd
[
'csv_date'
]
!==
$csv_datatime
)
elseif
(
isset
(
$host_bd
[
'csv_date'
])
&&
$host_bd
[
'csv_date'
]
!==
$csv_datatime
)
{
{
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't11 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't11 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
$db_request
->
update
(
$db_request
->
update
(
'{{%host}}'
,
'{{%host}}'
,
[
[
...
@@ -148,24 +148,24 @@ class ScanController extends Controller
...
@@ -148,24 +148,24 @@ class ScanController extends Controller
]
]
)
->
execute
();
)
->
execute
();
$rec
[
'update'
]
++
;
$rec
[
'update'
]
++
;
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't12 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't12 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
}
}
unset
(
$host_bd
);
unset
(
$host_bd
);
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't13 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't13 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
}
}
else
else
echo
PHP_EOL
.
$this
->
ansiFormat
(
'! Error create DB request'
);
echo
PHP_EOL
.
$this
->
ansiFormat
(
'! Error create DB request'
);
unset
(
$db_request
);
unset
(
$db_request
);
unset
(
$status
);
unset
(
$status
);
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't14 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't14 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
}
}
unset
(
$host
);
unset
(
$host
);
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't15 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't15 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
}
}
else
else
$csv_skip_row
++
;
$csv_skip_row
++
;
unset
(
$file_pos
);
unset
(
$file_pos
);
if
(
$csv_row
===
2901
){
$time_cuttent
=
microtime
(
true
);
echo
't16 '
.
(
$time_cuttent
-
$time_start
)
.
"
\n
"
;
$time_start
=
$time_cuttent
;}
//
if ($csv_row === 2901){ $time_cuttent = microtime(true); echo 't16 '.($time_cuttent - $time_start)."\n";$time_start = $time_cuttent;}
}
}
unset
(
$progress
);
unset
(
$progress
);
unset
(
$csv_data
);
unset
(
$csv_data
);
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment