Merge pull request 'Small fixes to improve memory performance, temporary code deletion and small typo in img file location.' (#7) from development into main
All checks were successful
Website Sync / website-sync (push) Successful in 4s
All checks were successful
Website Sync / website-sync (push) Successful in 4s
Reviewed-on: #7
This commit was merged in pull request #7.
This commit is contained in:
@@ -19,6 +19,8 @@ function getFile(array $source){
|
||||
|
||||
curl_close($curl);
|
||||
}
|
||||
|
||||
unset($selected_source,$curl);
|
||||
return $file;
|
||||
}
|
||||
|
||||
@@ -29,6 +31,7 @@ function extractString(string $string,string $start_pattern, string $end_pattern
|
||||
|
||||
$extracted_string = substr($string, $start_pos, $end_pos - $start_pos);
|
||||
|
||||
unset($start_pos,$end_pos);
|
||||
return $extracted_string;
|
||||
}
|
||||
|
||||
@@ -36,5 +39,7 @@ function extractString(string $string,string $start_pattern, string $end_pattern
|
||||
function scrapeWebsiteSites(array $source,string $start_pattern, string $end_pattern) {
|
||||
$script = getFile($source);
|
||||
$websites = extractString($script,$start_pattern,$end_pattern);
|
||||
|
||||
unset($script);
|
||||
return $websites;
|
||||
}
|
||||
@@ -51,6 +51,8 @@ function primarySplit(string $array) {
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
unset($array,$start_pos,$end_pos,$item_len,$array);
|
||||
return $return_array;
|
||||
}
|
||||
|
||||
@@ -87,6 +89,8 @@ function secondarySplit(string $sub_array) {
|
||||
|
||||
$sub_array = substr($sub_array,$sub_sub_array_len);
|
||||
}
|
||||
|
||||
unset($sub_array, $value, $value_len, $value_start_pos, $value_end_pos, $key, $key_len, $key_start_pos, $key_end_pos, $keyhasQuotes, $sub_sub_array_len);
|
||||
return $return_sub_array;
|
||||
}
|
||||
|
||||
@@ -96,6 +100,7 @@ for ($i = 0; $i < sizeof($transfemring_sites); $i++) {
|
||||
$depured_transfemring_sites[$i] = secondarySplit($transfemring_sites[$i]);
|
||||
}
|
||||
$transfemring_sites = $depured_transfemring_sites;
|
||||
unset($depured_transfemring_sites);
|
||||
|
||||
for ($i = 1; $i < count($transfemring_sites); $i++){
|
||||
if ($transfemring_sites[$i]['id'] == $TRANSFEMRING_ID) {
|
||||
|
||||
@@ -52,8 +52,6 @@ function transingSplit(string $array) {
|
||||
$array = substr($array,0,-1);
|
||||
}
|
||||
|
||||
$temp = strpos($array,'/',1);
|
||||
|
||||
if (strpos($array,'/',1) > 1 or strpos($array,'/',1) == FALSE) {
|
||||
$commented=FALSE;
|
||||
} else {
|
||||
@@ -88,6 +86,7 @@ function transingSplit(string $array) {
|
||||
$i++;
|
||||
}
|
||||
|
||||
unset($array, $commented, $start_pos, $end_pos, $item_len);
|
||||
return $return_array;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user