Phalcon Framework 4.1.2

ArgumentCountError: Too few arguments to function Apps\Models\Partners\Partners::getSnippetLocalBusiness(), 0 passed in /home/tafront/current/apps/Frontend/Controllers/CatalogController.php on line 761 and exactly 1 expected

/home/tafront/current/apps/Models/Partners/Partners.php (1125)
#0Apps\Models\Partners\Partners->getSnippetLocalBusiness
/home/tafront/current/apps/Frontend/Controllers/CatalogController.php (761)
<?php
 
namespace Apps\Frontend\Controllers;
 
use Apps\Models\AdsBusinesses;
use Apps\Models\Catalog\Categories\CategoriesStats;
use Apps\Models\Catalog\Categories\CategoriesStatsByCities;
use Apps\Models\Catalog\Categories\CategoriesStatsByCountries;
use Apps\Models\Catalog\Categories\CategoriesStatsByStates;
use Apps\Models\CatalogCategories;
use Apps\Models\CatalogTopPages;
use Apps\Models\GeoCities;
use Apps\Models\GeoCountries;
use Apps\Models\GeoStates;
use Apps\Models\PartnerServices;
use Apps\Models\Partners\PartnerDetails;
use Apps\Models\Partners\Partners;
use Apps\Models\Partners\PartnerSentimentals;
use Apps\Models\Partners\PartnerSocialLinks;
use Apps\Models\Partners\PartnerSubscription;
use Apps\Models\Partners\PartnerTypes;
use Apps\Models\Reviews\Reviews;
use Apps\Models\UserPartnerChanges;
use Carbon\Carbon;
use Phalcon\Mvc\View;
 
class CatalogController extends BaseController
{
    public function initialize()
    {
        parent::initialize(); // TODO: Change the autogenerated stub
        $this->view->hideWidgets = true;
    }
 
    private function middleware($countryCode, $stateCode, $cityName, $categorySlug)
    {
        // check if request comes from catalog main page
        if ($countryCode === "business" && $stateCode === "search") {
            return $this->dispatcher->forward(
                [
                    'controller' => 'catalog',
                    'action' => 'business'
                ]
            );
        } else {
            if ($countryCode === "business" && $stateCode === "getStates") {
                return $this->dispatcher->forward(
                    [
                        'controller' => 'catalog',
                        'action' => 'getStates'
                    ]
                );
            } else {
                if ($countryCode === "business" && $stateCode === "getCities") {
                    return $this->dispatcher->forward(
                        [
                            'controller' => 'catalog',
                            'action' => 'getCities'
                        ]
                    );
                } else {
                    if ($countryCode === "business" && $stateCode === "autocomplete") {
                        return $this->dispatcher->forward(
                            [
                                'controller' => 'catalog',
                                'action' => 'autocomplete'
                            ]
                        );
                    } else {
                        if ($countryCode === "business" && $stateCode === "category") {
                            return $this->dispatcher->forward(
                                [
                                    'controller' => 'catalog',
                                    'action' => 'category'
                                ]
                            );
                        } // check if business keyword exists then forward to business controller
                        else {
                            if ($countryCode === "business") {
                                return $this->dispatcher->forward(
                                    [
                                        'controller' => 'business',
                                        'action' => 'slug',
                                        'params' => [$stateCode]
                                    ]
                                );
                            } else {
                                if ($countryCode === "online" && $stateCode === "reviews") {
                                    return $this->dispatcher->forward(
                                        [
                                            'controller' => 'business',
                                            'action' => 'online',
                                            'params' => [$cityName]
                                        ]
                                    );
                                } else {
                                    if ($countryCode == "request-review") {
                                        return $this->dispatcher->forward(
                                            [
                                                'controller' => 'request',
                                                'action' => 'hash',
                                                'params' => [$stateCode]
                                            ]
                                        );
                                    } else {
                                        if ($countryCode == "social") {
                                            return $this->dispatcher->forward(
                                                [
                                                    'controller' => 'social',
                                                    'action' => 'callback',
                                                    'params' => [$cityName]
                                                ]
                                            );
                                        } else {
                                            if ($countryCode === "reviews") {
                                                return $this->dispatcher->forward(
                                                    [
                                                        'controller' => 'business',
                                                        'action' => 'index',
                                                        'params' => [$stateCode]
                                                    ]
                                                );
                                            } else {
                                                if ($countryCode === "online") {
                                                    return $this->dispatcher->forward(
                                                        [
                                                            'controller' => 'catalog',
                                                            'action' => 'online',
                                                            'params' => [$stateCode]
                                                        ]
                                                    );
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        // set defaults
        $args = [$countryCode, $stateCode, $cityName, $categorySlug];
        foreach ($args as $arg) {
            if (preg_match('/[^A-Za-z0-9-\.]/', $arg) || gettype($arg) === "string" && strlen($arg) <= 0) {
                return $this->route404Action();
            }
        }
 
        // remove empty from args
        $args = array_filter($args, function ($value) {
            return $value !== false;
        });
 
        $countryCode = array_shift($args);
        $categorySlug = array_pop($args);
 
        if (empty($args)) {
            $stateCode = false;
            $cityName = false;
        } else {
            if (count($args) === 1) {
                $stateCode = $args[0];
                $cityName = false;
            } else {
                if (count($args) === 2) {
                    $stateCode = $args[0];
                    $cityName = $args[1];
                }
            }
        }
 
        if (!$categorySlug) {
            return $this->dispatcher->forward(
                [
                    'controller' => 'catalog',
                    'action' => 'statesView',
                    'params' => [$countryCode]
                ]
            );
        }
 
        if ($categorySlug == "establishment" || $categorySlug == "point_of_interest") {
            return $this->route404Action();
        }
 
 
 
        $isTest = $this->request->get('query', ['trim', 'string'], '');
 
        // 1
        $category = CatalogCategories::findFirst([
            'conditions' => 'type = 1 AND slug = :slug:',
            'bind' => ['slug' => $categorySlug]
        ]);
 
        if (!$category) {
            // 2
            $category = CatalogCategories::findFirst([
                'conditions' => 'type = 2 AND slug = :slug:',
                'bind' => ['slug' => $categorySlug]
            ]);
        }
 
        $subdomainCategories = [];
        if ($isTest == 'remstyle') {
            die(json_encode($category));
        }
        if(isset($category) && $category->category) {
            array_push($subdomainCategories, $category->category);
        }
 
        $currentHost = $_SERVER['HTTP_HOST']; // e.g., "trustanalytica.org" or "lip-fillers.trustanalytica.org"
 
        // Only redirect if the category exists in the array and the user is on "trustanalytica.org"
        if (in_array('lip_fillers', $subdomainCategories)) {
            if ($currentHost == "trustanalytica.org" || $currentHost !== "lip-fillers.trustanalytica.org") {
                $cleanHost = $this->getCleanDomain($currentHost);
                $currentUrl = "https://{$cleanHost}{$_SERVER['REQUEST_URI']}";
                $newUrl = str_replace("trustanalytica.org", "lip-fillers.trustanalytica.org", $currentUrl);
 
                header("Location: $newUrl", true, 301);
                exit;
            }
        }
 
        if (in_array('dermatologist', $subdomainCategories)) {
            if ($currentHost == "trustanalytica.org" || $currentHost !== "dermatologist.trustanalytica.org") {
                $cleanHost = $this->getCleanDomain($currentHost);
                $currentUrl = "https://{$cleanHost}{$_SERVER['REQUEST_URI']}";
                $newUrl = str_replace("trustanalytica.org", "dermatologist.trustanalytica.org", $currentUrl);
 
                header("Location: $newUrl", true, 301);
                exit;
            }
        }
 
        if (in_array('essay_writing', $subdomainCategories)) {
            if ($currentHost === "trustanalytica.org" || $currentHost !== "essay-writing.trustanalytica.org") {
                $cleanHost = $this->getCleanDomain($currentHost);
                $currentUrl = "https://{$cleanHost}{$_SERVER['REQUEST_URI']}";
                $newUrl = str_replace("trustanalytica.org", "essay-writing.trustanalytica.org", $currentUrl);
 
                header("Location: $newUrl", true, 301);
                exit;
            }
        }
 
        if (in_array('resume_service', $subdomainCategories)) {
            if ($currentHost === "trustanalytica.org" || $currentHost !== "resume-service.trustanalytica.org") {
                $cleanHost = $this->getCleanDomain($currentHost);
                $currentUrl = "https://{$cleanHost}{$_SERVER['REQUEST_URI']}";
                $newUrl = str_replace("trustanalytica.org", "resume-service.trustanalytica.org", $currentUrl);
 
                header("Location: $newUrl", true, 301);
                exit;
            }
        }
 
        if (in_array('jewelry_store', $subdomainCategories)) {
            if ($currentHost === "trustanalytica.org" || $currentHost !== "jewelry-store.trustanalytica.org") {
                $cleanHost = $this->getCleanDomain($currentHost);
                $currentUrl = "https://{$cleanHost}{$_SERVER['REQUEST_URI']}";
                $newUrl = str_replace("trustanalytica.org", "jewelry-store.trustanalytica.org", $currentUrl);
 
                header("Location: $newUrl", true, 301);
                exit;
            }
        }
 
        if (in_array('watch_store', $subdomainCategories)) {
            if ($currentHost === "trustanalytica.org" || $currentHost !== "watch-store.trustanalytica.org") {
                $cleanHost = $this->getCleanDomain($currentHost);
                $currentUrl = "https://{$cleanHost}{$_SERVER['REQUEST_URI']}";
                $newUrl = str_replace("trustanalytica.org", "watch-store.trustanalytica.org", $currentUrl);
 
                header("Location: $newUrl", true, 301);
                exit;
            }
        }
 
        if (in_array('pest_control_service', $subdomainCategories)) {
            if ($currentHost === "trustanalytica.org" || $currentHost !== "pest-control.trustanalytica.org") {
                $cleanHost = $this->getCleanDomain($currentHost);
                $currentUrl = "https://{$cleanHost}{$_SERVER['REQUEST_URI']}";
                $newUrl = str_replace("trustanalytica.org", "pest-control.trustanalytica.org", $currentUrl);
 
                header("Location: $newUrl", true, 301);
                exit;
            }
        }
 
        if (in_array('adjustable_bed', $subdomainCategories)) {
            if ($currentHost === "trustanalytica.org" || $currentHost !== "adjustable-bed.trustanalytica.org") {
                $cleanHost = $this->getCleanDomain($currentHost);
                $currentUrl = "https://{$cleanHost}{$_SERVER['REQUEST_URI']}";
                $newUrl = str_replace("trustanalytica.org", "adjustable-bed.trustanalytica.org", $currentUrl);
 
                header("Location: $newUrl", true, 301);
                exit;
            }
        }
 
        if (!$category) {
            if (!$stateCode && !$cityName) {
                return $this->dispatcher->forward(
                    [
                        'controller' => 'catalog',
                        'action' => 'citiesView',
                        'params' => [$countryCode, $categorySlug]
                    ]
                );
            } else {
                if ($stateCode && !$cityName) {
                    return $this->dispatcher->forward(
                        [
                            'controller' => 'catalog',
                            'action' => 'topListView',
                            'params' => [$countryCode, $stateCode, $categorySlug]
                        ]
                    );
                } else {
 
                    if (!$category) {
                        if ($cityName) {
                            return $this->response->redirect("/".$countryCode."/".$stateCode."/" . $cityName, false, 302);
                        }
 
                        if ($stateCode) {
                            return $this->response->redirect("/".$countryCode."/".$stateCode, false, 302);
                        }
 
                        if ($countryCode) {
                            return $this->response->redirect("/".$countryCode, false, 302);
                        }
                    }
 
                    return $this->route404Action();
                }
            }
        }
 
        if ($category->status == 0) {
            if ($cityName) {
                return $this->response->redirect("/".$countryCode."/".$stateCode."/" . $cityName, false, 302);
            }
 
            if ($stateCode) {
                return $this->response->redirect("/".$countryCode."/".$stateCode, false, 302);
            }
 
            if ($countryCode) {
                return $this->response->redirect("/".$countryCode, false, 302);
            }
            return $this->route404Action();
        }
 
        if ($cityName == 'sf') {
            return $this->response->redirect("/".$countryCode."/".$stateCode."/san-francisco/".$category->slug, false,
                301);
        }
 
        $title = $category->title;
        $description = $category->description;
        $metaTitle = $category->metaTitle;
        $metaDescription = $category->metaDescription;
        $faq = $category->faq;
        if ($category->type == 1) {
            // 3
            $topPage = CatalogTopPages::getPageByLocation($countryCode, $stateCode, $cityName, $category->category);
 
 
            if ($isTest == 'remstyle1') {
                die(json_encode($topPage->title));
            }
            if ($topPage && $topPage->status == 0) {
                if ($cityName) {
                    return $this->response->redirect("/".$countryCode."/".$stateCode."/" . $cityName, false, 302);
                }
 
                if ($stateCode) {
                    return $this->response->redirect("/".$countryCode."/".$stateCode, false, 302);
                }
 
                if ($countryCode) {
                    return $this->response->redirect("/".$countryCode, false, 302);
                }
                return $this->response->redirect($countryCode.'/'.$categorySlug, false, 302);
            }
 
            if ($topPage && strlen($topPage->title) > 0) {
                $title = $topPage->title;
            }
 
            if ($topPage && strlen($topPage->faq) > 0) {
                $faq = $topPage->faq;
            }
 
            if ($topPage && strlen($topPage->description) > 0) {
                $description = $topPage->description;
            }
 
            if ($topPage && strlen($topPage->metaTitle) > 0) {
                $metaTitle = $topPage->metaTitle;
            }
 
            if ($topPage && strlen($topPage->metaDescription) > 0) {
                $metaDescription = $topPage->metaDescription;
            }
        }
        return [
            'countryCode' => $countryCode,
            'stateCode' => $stateCode,
            'cityName' => $cityName,
            'categorySlug' => $categorySlug,
            'category' => $category,
            'topPage' => $topPage,
            'title' => $title,
            'description' => $description,
            'metaTitle' => $metaTitle,
            'faq' => $faq,
            'metaDescription' => $metaDescription
        ];
    }
 
    function sortArrayByConditions($items) {
        // Current timestamp
        $current_timestamp = time();
 
        // Arrays to hold sorted items
        $priority_items = [];
        $non_priority_items = [];
        $current_timestamp = time();
        // Iterate through the items and separate them based on the condition
        foreach ($items as $item) {
            if ($item['endDate'] != null && $item['planId'] != null && $item['planId'] !== 'price_1I4VKfLF3loXTllzSsabRzhi' && $item['endDate'] >= $current_timestamp && $item['subscriptionId'] != null) {
                $priority_items[] = $item;
            } else {
                $non_priority_items[] = $item;
            }
        }
    //    die(json_encode($priority_items));
        // Merge priority items at the top followed by non-priority items
        return array_merge($priority_items, $non_priority_items);
    }
 
    function getCleanDomain($host) {
        return preg_replace('/^(.+?)\.trustanalytica\.org$/', 'trustanalytica.org', $host);
    }
 
    public function indexAction($countryCode = false, $stateCode = false, $cityName = false, $categorySlug = false)
    {
 
        $isTestSub301 = $this->request->get('query', ['trim', 'string'], '');
        $middleware = $this->middleware($countryCode, $stateCode, $cityName, $categorySlug);
 
        if (!is_array($middleware)) {
            return $middleware;
        }
        $countryCode = $middleware['countryCode'];
        $stateCode = $middleware['stateCode'];
        $cityName = $middleware['cityName'];
        $categorySlug = $middleware['categorySlug'];
        $category = $middleware['category'];
        $topPage = $middleware['topPage'];
 
        $redirectCategories = [
            'adult_toy_store', 'gay_massage', 'asian_massage', 'cbd_store', 'cannabis_store'
        ];
 
        if (in_array($category->category, $redirectCategories)) {
            $linkTa = 'https://trustanalytica.com';
            header('Location: '.$linkTa, true, 301);
            exit;
        }
 
 
 
        if ($category && $category->type && $category->type != 1) {
            $linkTa = 'https://trustanalytica.org/'.'online/'.$categorySlug;
            header('Location: '.$linkTa, true, 301);
            exit;
        }
 
        if ($topPage && $topPage->redirect != "") {
            header('Location: '.$topPage->redirect, true, 301);
        }
 
 
        $columns = [
            'p.id as id',
            'p.isFollowWebsite as isFollowWebsite',
            'p.slug as slug',
            'p.googlePlaceId as googlePlaceId',
            'p.fullName as fullName',
            'p.countryCode as countryCode',
            'p.stateCode as stateCode',
            'p.cityName as cityName',
            'p.raitingAvg as raitingAvg',
            'p.reviewsCount as reviewsCount',
            'p.fullDescr as fullDescr',
            'p.aiContent as aiContent',
            'p.fullAddress as fullAddress',
            'p.facePhoto as facePhoto',
            'p.website as website',
            'p.phone as phone',
            'p.lat as lat',
            'p.lng as lng',
            'p.aiPhoto as aiPhoto',
            'p.websiteScreenshots as websiteScreenshots',
            'ps.*',
            'p.status as status',
        ];
 
        $title = $middleware['title'];
        $metaTitle = $middleware['metaTitle'];
        $description = $middleware['description'];
        $metaDescription = $middleware['metaDescription'];
        $faq = isset($middleware['faq']) ? $middleware['faq'] : '';
 
        $countryName = $countryCode;
        $stateName = $stateCode;
        $locationInfo = null;
        if ($topPage || $cityName != false) {
            $locationTag = ucwords(str_replace("-", " ", $cityName));
        } else {
            $locationTag = $countryCode;
            // 4
            if ($stateCode != false) {
                $locationInfo = GeoStates::findFirst([
                    'columns' => ['name'],
                    'conditions' => 'country_code = :countryCode: AND iso2 = :stateCode:',
                    'bind' => ['countryCode' => $countryCode, 'stateCode' => $stateCode]
                ]);
            } else {
                $locationInfo = GeoCountries::findFirst([
                    'columns' => ['name'],
                    'conditions' => 'iso2 = :countryCode:',
                    'bind' => ['countryCode' => $countryCode]
                ]);
            }
            if ($locationInfo) {
                $locationTag = $locationInfo->name;
            }
        }
 
        $currentYear = Carbon::now()->format('Y');
        $title = str_replace(['{location}', '{year}'], [$locationTag, $currentYear], $title);
 
        $description = str_replace(['{location}', '{year}'], [$locationTag, $currentYear], $description);
        $metaTitle = str_replace(['{location}', '{year}'], [$locationTag, $currentYear], $metaTitle);
        $metaDescription = str_replace(['{location}', '{year}'], [$locationTag, $currentYear], $metaDescription);
 
        if (!$countryCode || !$categorySlug) {
            return $this->route404Action();
        }
 
        $perPage = 30;
        $page = $this->request->get('page', 'int', 1);
        if ($page <= 0) {
            $page = 1;
        }
 
        // 5
        $catalog = Partners::getCatalogPartners('local', $category->category, $page, $perPage, $countryCode, $stateCode,
            $cityName);
 
        if ($isTestSub301 == 'remstylex1') {
            die(json_encode($catalog));
        }
        // $catalog = $this->sortArrayByConditions($catalog);
        if ($isTestSub301 == 'remstylex2') {
            die(json_encode($catalog));
        }
        if ($cityName != false) {
            $params = new \stdClass();
            $params->countryCode = $countryCode;
            $params->stateCode = $stateCode;
            $params->cityName = $cityName;
            $params->category = $category->category;
            $categoryStats = CategoriesStatsByCities::findStats($params);
        } else {
            if ($stateCode != false) {
                $params = new \stdClass();
                $params->countryCode = $countryCode;
                $params->stateCode = $stateCode;
                $params->category = $category->category;
                $categoryStats = CategoriesStatsByStates::findStats($params);
            } else {
                $params = new \stdClass();
                $params->countryCode = $countryCode;
                $params->category = $category->category;
                $categoryStats = CategoriesStatsByCountries::findStats($params);
            }
        }
//        die(json_encode(count($catalog)));
        $totalItems = $categoryStats->totalPartners;
        if ($categoryStats) {
            $stateLocationName = $categoryStats->stateName ?? null;
        }
        if ($isTestSub301 == 'remstylex3') {
            die(json_encode('here'));
        }
        $ads_partners_count = 0;
        $ads_partners_new = [];
        $profileMapLocations = [];
        $ldJsonProfiles = [];
        $isTestSub = $this->request->get('query', ['trim', 'string'], '');
        $uniqueAdProfiles = [];
        if (!$this->request->isAjax()) {
            $ads_partners = AdsBusinesses::getPartners($categorySlug, $countryCode, $stateCode, $cityName);
            $ads_partners_count = count($ads_partners);
            foreach ($ads_partners as $item) {
                if (!isset($uniqueArray[$item->id])) {
                    $uniqueAdProfiles[$item->id] = $item;
                }
                $mapLocation = [(string) $item->lat, (string) $item->lng, $item->fullName, (string) $item->fullAddress];
                if($item->lat != '' || $item->lat != null) {
                    $profileMapLocations[] = $mapLocation;
                }
                $facePhotox = $this->facePhotoToUse($item->id);
 
                $item->facePhotoToUse = $facePhotox;
                $profileMapLocations[] = $mapLocation;
 
                $partnerClone = new Partners();
 
                $partnerType = Partners::getActualType($item->id);
                $partnerTimings = Partners::getWorkForFront($item);
                $item->partnerTimings = $partnerTimings;
                $item->partnerCategory = $partnerType;
 
                $ldJsonProfile = $partnerClone->getSnippetLocalBusiness();
                if ($isTestSub301 == 'remstylex51ad') {
                    die(json_encode($ldJsonProfile));
                }
                array_push($ldJsonProfiles, $ldJsonProfile);
                array_push($ads_partners_new, $item);
            }
//            die(json_encode($ads_partners_new));
            $this->view->ads_partners = $uniqueAdProfiles;
        }
        if ($isTestSub301 == 'remstylex4') {
            die(json_encode('here'));
        }
        if ($totalItems == 0 && !$this->request->isAjax()) {
            if ($cityName) {
                return $this->response->redirect("/".$countryCode."/".$stateCode."/" . $cityName, false, 302);
            }
 
            if ($stateCode) {
                return $this->response->redirect("/".$countryCode."/".$stateCode, false, 302);
            }
 
            if ($countryCode) {
                return $this->response->redirect("/".$countryCode, false, 302);
            }
            return $this->route404Action();
        }
        if ($isTestSub301 == 'remstylex5') {
            die(json_encode('here'));
        }
        preg_match('/\bin|IN\b/', $title, $titleMatchedWord, PREG_OFFSET_CAPTURE);
        if (isset($titleMatchedWord[0][1])) {
            $simpleTitle = substr($title, 0, $titleMatchedWord[0][1]);
        } else {
            $simpleTitle = $title;
        }
        $currentYear = Carbon::now()->format('Y');
 
        $originalArray = $catalog;
        $uniqueArray = [];
 
        foreach ($originalArray as $object) {
            $id = $object['id'];
 
            $findServices = PartnerServices::find([
                'conditions' => 'partner_id = :partnerId:',
                'bind' => ['partnerId' => $id]
            ]);
 
            $servicesArray = [];
            $allSubs = []; // collect all sub-services across all services
 
            foreach ($findServices as $srv) {
                $parsedSubServices = [];
 
                if (!empty($srv->sub_services)) {
                    // Split services safely on '),'
                    $subList = preg_split('/\)\s*,\s*/', $srv->sub_services);
 
                    foreach ($subList as $sub) {
                        $sub = trim($sub);
                        if ($sub === '') continue;
 
                        // Ensure trailing ) if it was cut by split
                        if (substr($sub, -1) !== ')') {
                            $sub .= ')';
                        }
 
                        $name  = $sub;
                        $price = null;
 
                        if (preg_match('/^(.*?)\s*\(([^()]+)\)$/', $sub, $m)) {
                            $name  = trim($m[1]);
                            $price = trim($m[2]);
 
                            // Remove currency labels (USD, CAD, etc.)
                            $price = preg_replace('/\s*(USD|CAD|EUR|GBP)\b/i', '', $price);
 
                            // Remove commas from numbers (1,000 → 1000)
                            $price = preg_replace('/,/', '', $price);
 
                            // Normalize dash spacing
                            $price = preg_replace('/\s*-\s*/', ' - ', $price);
 
                            // Add $ sign before numbers
                            $price = preg_replace_callback('/\d+/', function ($n) {
                                return '$' . $n[0];
                            }, $price);
                        }
 
                        $parsedSubServices[] = [
                            'name'  => $name,
                            'price' => $price,
                        ];
                    }
                }
 
                $row = $srv->toArray();
                $row['sub_services_array'] = $parsedSubServices;
                $servicesArray[] = $row;
                $allSubs = array_merge($allSubs, $parsedSubServices);
            }
 
            // Flattened "first 4 + more"
            $firstSubs = array_slice($allSubs, 0, 3);
            $moreSubs  = array_slice($allSubs, 4);
 
            $object->services = (array) $servicesArray;
            $object->firstSubs = $firstSubs;
            $object->moreSubs  = $moreSubs;
 
            $mapLocation = [(string) $object->lat, (string) $object->lng, $object->fullName, (string) $object->fullAddress];
            if ($object->lat != '' || $object->lat != null) {
                $profileMapLocations[] = $mapLocation;
            }
 
            $facePhoto = $this->facePhotoToUse($object->id);
            $object->facePhotoToUse = $facePhoto;
 
            $partnerClone = new Partners();
            $partnerTimings = Partners::getWorkForFront($object);
            $object->partnerTimings = $partnerTimings;
 
            if (!isset($uniqueArray[$id])) {
                $uniqueArray[$id] = $object;
            }
 
            $ldJsonProfile = $partnerClone->getSnippetLocalBusiness();
            if ($isTestSub301 == 'remstylex51') {
                die(json_encode($ldJsonProfile));
            }
            array_push($ldJsonProfiles, $ldJsonProfile);
        }
        if ($isTestSub301 == 'remstylex6') {
            die(json_encode('here'));
        }
        $catalog = array_values($uniqueArray);
 
        $paginate = (object) [
            'items' => $catalog,
            'current' => $page * $perPage - $perPage,
        ];
//        $totalItems = count($catalog) <= 30 ? count($catalog) : $totalItems;
        $title = str_replace(["{total}", "{year}"], [$totalItems, $currentYear], $title);
        $simpleTitle = str_replace(["{total}", "{year}"], ["", $currentYear], $simpleTitle);
        $description = str_replace(["{total}", "{year}"], [$totalItems, $currentYear], $description);
        $metaTitle = str_replace(["{total}", "{year}"], [$totalItems, $currentYear], $metaTitle);
        $metaDescription = str_replace(["{total}", "{year}"], [$totalItems, $currentYear], $metaDescription);
        if ($isTestSub301 == 'remstylex7') {
            die(json_encode('here'));
        }
        if ($this->request->isAjax()) {
            if ($isTestSub301 == 'remstylex8') {
                die(json_encode('here'));
            }
            $this->response->setContentType('application/json');
            $this->view->disable();
            $html = $this->view->getPartial('partials/catalog/items', [
                'partners' => $paginate,
                'category' => $category,
                'isAjax' => true,
            ]);
            echo json_encode([
                'html' => $html,
                'showMore' => $totalItems > $page * $perPage,
            ]);
        } else {
            if ($isTestSub301 == 'remstylex9') {
                die(json_encode('here'));
            }
            $this->assets->collection('header')
                ->addCss('assets/page/top-business/style.css?v=375')
                ->addCss('https://cdnjs.cloudflare.com/ajax/libs/tooltipster/4.2.8/css/tooltipster.bundle.min.css')
                ->addCss('assets/page/top-business/keyword-previewer.css');
            $this->assets->collection('footer')
                ->addJs('src/vendor/jquery/dist/jquery.min.js')
                ->addJs('assets/packages/jquery.lazy/jquery.lazy.min.js')
                ->addJs('assets/page/top-business/keyword-previewer.js')
                ->addJs('assets/page/top-business/catalog.js?v=213')
                ->addJs('assets/js/catalog.js?v='.rand(10, 10000))
                ->addJs('assets/companent/devbridge-autocomplete/src/jquery.autocomplete.js')
                ->addJs('https://cdnjs.cloudflare.com/ajax/libs/tooltipster/4.2.8/js/tooltipster.bundle.min.js');
 
            $paginate->items = $catalog;
            $this->view->isAjax = false;
            $this->view->partners = $paginate;
            $this->view->category = $category;
            $this->view->total_items = $totalItems;
            $this->view->simpleTitle = html_entity_decode($simpleTitle, ENT_QUOTES);
 
            $this->title = html_entity_decode($title, ENT_QUOTES);
            $this->metaTitle = $metaTitle;
            $this->description = html_entity_decode($description, ENT_QUOTES);
            $this->seoTitle = html_entity_decode($metaTitle, ENT_QUOTES);
            $this->view->isTopTen = 1;
            $this->seoDescription = html_entity_decode($metaDescription, ENT_QUOTES);
            if ($isTestSub301 == 'remstylex10') {
                die(json_encode('here'));
            }
            // related categories logic
            $this->view->relatedCategories = CatalogTopPages::getRelatedCategoriesPages($this->config->baseUri,
                $category, $countryCode, $stateCode, $cityName);
            if ($isTestSub301 == 'remstylex11') {
                die(json_encode('here'));
            }
            $this->view->countryCode = $countryCode;
            $this->view->countryName = $countryName;
            $this->view->faq = html_entity_decode($faq, ENT_QUOTES);
            $this->view->stateCode = $stateCode;
            $this->view->stateName = $stateName;
            $this->view->currentLocationName = $cityName ? $cityName : $stateLocationName;
            $this->view->profileMapLocations = $profileMapLocations;
            $this->view->categorySlug = $categorySlug;
            $this->view->cityName = ucwords(str_replace('-', ' ', $cityName));
            $this->view->cityCode = $cityName;
            if ($isTestSub301 == 'remstylex12') {
                die(json_encode('here'));
            }
            $this->view->countries = GeoCountries::getList();
            $this->view->categories = CatalogCategories::getList($countryCode, $stateCode, $cityName);
            $this->view->buildJsNoNeed = true;
            $this->view->ldJsonProfiles = json_encode($ldJsonProfiles);
            if ($isTestSub301 == 'remstylex13') {
                die(json_encode('here'));
            }
            $ldJsonLocation = (object) [
                "@context" => "https://schema.org/",
                "@type" => "City",
                "name" => $cityName,
                "containedIn" => [
                    "@type" => "State",
                    "name" => $stateLocationName
                ]
            ];
            if ($isTestSub301 == 'remstylex14') {
                die(json_encode('here'));
            }
 
            $this->view->ldJsonLocation = json_encode($ldJsonLocation);
            if ($isTestSub301 == 'remstylex15') {
                die(json_encode('here'));
            }
            if ($category->type == 2) {
                $this->view->faq = '';
            }
        }
    }
 
    public function getStatesAction()
    {
        $this->response->setContentType('application/json');
        $this->view->disable();
        $countryId = $this->request->getPost('countryId', ['trim', 'string'], '');
        $countryCode = $this->request->getPost('countryCode', ['trim', 'string'], '');
        $categorySlug = $this->request->getPost('categorySlug', ['trim', 'string'], '');
        $states = GeoStates::getList($countryId, $countryCode, $categorySlug);
        return $this->response->setJsonContent(['status' => 'success', 'states' => $states]);
    }
 
    public function getCitiesAction()
    {
        $this->response->setContentType('application/json');
        $this->view->disable();
        $countryId = $this->request->getPost('countryId', ['trim', 'string'], '');
        $countryCode = $this->request->getPost('countryCode', ['trim', 'string'], '');
        $stateId = $this->request->getPost('stateId', ['trim', 'string'], '');
        $stateCode = $this->request->getPost('stateCode', ['trim', 'string'], '');
        $categorySlug = $this->request->getPost('categorySlug', ['trim', 'string'], '');
        $cities = GeoCities::getList($countryId, $stateId, $countryCode, $stateCode, $categorySlug);
        return $this->response->setJsonContent(['status' => 'success', 'cities' => $cities]);
    }
 
    public function onlineViewAction()
    {
        $categories = $this->modelsManager->createBuilder()
            ->columns([
                "category.category as category",
                "category.slug as slug",
            ])
            ->from(['category' => CatalogCategories::class])
            ->where("category.type = :type:")
            ->andWhere("category.status = :status:")
            ->setBindParams([
                "type" => 2,
                "status" => 1
            ])
            ->orderBy('category.id DESC')
            ->getQuery()
            ->execute()
            ->toArray();
 
        if (count($categories) <= 0) {
            return $this->route404Action();
        }
        $linkItems = [];
 
        foreach ($categories as $category) {
            $categoryText = ucwords($category['category']);
            $categoryText = str_replace('_', ' ', $categoryText);
            $linkItems[] = [
                "link" => $this->config->baseUri.'online'."/".$category['slug'],
                "text" => $categoryText
            ];
        }
 
        $title = $this->seoTitle = "Best Online Business Directory Listings Globally - TrustAnalytica";
        $description = "Below is the list of online business categories and listings that TrustAnalytica serves Globally.";
 
        $this->assets->collection('headerGoogle')
            ->addCss('assets/css/logic-block.css?v='.$this->ver);
        $this->assets->collection('footer')
            ->addJs('assets/js/logic-block.js');
        $companies = Partners::getLogicBlockPartners($this->config->baseUri);
        $reviews = Reviews::getLogicBlockReviews($this->config->baseUri);
        $categories = CatalogTopPages::getLogicBlockPages($this->config->baseUri);
 
        $logicBlock = [
            'companies' => $companies,
            'reviews' => $reviews,
            'categories' => $categories
        ];
        $this->view->logicBlock = $logicBlock;
 
        $this->title = html_entity_decode($title, ENT_QUOTES);
        $this->description = html_entity_decode($description, ENT_QUOTES);
        $this->view->linkItems = $linkItems;
    }
 
    public function statesViewAction($countryCode)
    {
        $states = $this->modelsManager->createBuilder()
            ->columns([
                "LOWER(cStats.countryName) as countryName",
                "LOWER(cStats.stateCode) as stateCode",
                "cStats.stateName as stateName",
            ])
            ->from(['cStats' => CategoriesStatsByStates::class])
            ->where("cStats.countryCode = :countryCode:")
            ->andWhere('cStats.totalPartners > 0')
            ->andWhere('cStats.category != "point_of_interest"')
            ->andWhere('cStats.category != "establishment"')
            ->setBindParams([
                "countryCode" => $countryCode
            ])
            ->orderBy('cStats.totalPartners DESC')
            ->groupBy('cStats.stateCode')
            ->getQuery()
            ->execute()
            ->toArray();
 
        // die(json_encode($states));
 
        if (count($states) <= 0) {
            return $this->route404Action();
        }
        $first = $states[0];
        $this->seoTitle = "Best Local Business Directory Listings in ".$first['countryName'];
        $title = "Best Local Businesses in ".$first['countryName'];
        $description = "Below is the list of states and provinces that TrustAnalytica serves in ".$first['countryName'].".";
        $linkItems = [];
        foreach ($states as $state) {
            $linkItems[] = [
                "link" => $this->config->baseUri.$countryCode."/".$state['stateCode'],
                "text" => $state['stateName'].' ('.strtoupper($state['stateCode']).')'
            ];
        }
 
        $this->assets->collection('headerGoogle')
            ->addCss('assets/css/logic-block.css?v='.$this->ver);
        $this->assets->collection('footer')
            ->addJs('assets/js/logic-block.js');
        $companies = Partners::getLogicBlockPartners($this->config->baseUri, $countryCode);
        $reviews = Reviews::getLogicBlockReviews($this->config->baseUri, $countryCode);
        $categories = CatalogTopPages::getLogicBlockPages($this->config->baseUri, $countryCode);
 
        $logicBlock = [
            'companies' => $companies,
            'reviews' => $reviews,
            'categories' => $categories
        ];
        $this->view->logicBlock = $logicBlock;
 
        $this->title = html_entity_decode($title, ENT_QUOTES);
        $this->description = html_entity_decode($description, ENT_QUOTES);
        $this->view->linkItems = $linkItems;
    }
 
    public function citiesViewAction($countryCode, $stateCode)
    {
        $cities = $this->modelsManager->createBuilder()
            ->columns([
                "cStats.stateName as stateName",
                "cStats.cityName as cityName",
            ])
            ->from(['cStats' => CategoriesStatsByCities::class])
            ->where("cStats.countryCode = :countryCode: AND cStats.stateCode = :stateCode:")
            ->andWhere('cStats.totalPartners > 0')
            ->andWhere('cStats.category != "point_of_interest"')
            ->andWhere('cStats.category != "establishment"')
            ->andWhere('cStats.totalPartners > 0')
            ->setBindParams([
                "countryCode" => $countryCode,
                "stateCode" => $stateCode,
            ])
            ->orderBy('cStats.totalPartners DESC')
            ->groupBy('cStats.cityName')
            ->getQuery()
            ->execute()
            ->toArray();
 
        if (count($cities) <= 0) {
            if ($countryCode) {
                header("Location: " . env('PROJECT_BASE_URL') . $countryCode, true, 302);
                exit();
            }
            return $this->route404Action();
        }
        $first = $cities[0];
 
        $this->seoTitle = "Best Local Business Directory Listings in ".$first['stateName'];
        $title = "Best Local Businesses in ".$first['stateName'];
        $description = "Below is the list of cities that TrustAnalytica serves in ".$first['stateName'].".";
        $linkItems = [];
        foreach ($cities as $city) {
            $linkItems[] = [
                "link" => $this->config->baseUri.$countryCode."/".$stateCode."/".$city['cityName'],
                "text" => ucwords(str_replace("-", " ", $city['cityName']))
            ];
        }
 
        $this->assets->collection('headerGoogle')
            ->addCss('assets/css/logic-block.css?v='.$this->ver);
        $this->assets->collection('footer')
            ->addJs('assets/js/logic-block.js');
 
        $companies = Partners::getLogicBlockPartners($this->config->baseUri, $countryCode, $stateCode);
        $reviews = Reviews::getLogicBlockReviews($this->config->baseUri, $countryCode, $stateCode);
        $categories = CatalogTopPages::getLogicBlockPages($this->config->baseUri, $countryCode, $stateCode);
 
//        die(json_encode($linkItems));
 
        $logicBlock = [
            'companies' => $companies,
            'reviews' => $reviews,
            'categories' => $categories
        ];
        $this->view->logicBlock = $logicBlock;
 
        $this->title = html_entity_decode($title, ENT_QUOTES);
        $this->description = html_entity_decode($description, ENT_QUOTES);
        $this->view->linkItems = $linkItems;
        $this->view->countryCode = $countryCode;
        $this->view->stateCode = $stateCode;
    }
 
    public function topListViewAction($countryCode, $stateCode, $cityName)
    {
        if ($cityName == 'sf') {
            return $this->response->redirect("/".$countryCode."/".$stateCode."/san-francisco", false, 301);
        }
        $topPages = $this->modelsManager->createBuilder()
            ->columns([
                "cStats.stateName as stateName",
                "cStats.category as category",
                "c.slug as slug",
                "IF(tp.title IS NULL, c.title, tp.title) as title",
                "cStats.totalPartners as totalPartners",
            ])
            ->from(['cStats' => CategoriesStatsByCities::class])
            ->innerJoin(CatalogCategories::class, 'cStats.category = c.category AND c.status = 1 AND c.type = 1', 'c')
            ->leftJoin(CatalogTopPages::class,
                'c.category = tp.category AND cStats.countryCode = tp.countryCode AND cStats.stateCode = tp.stateCode AND cStats.cityName = tp.cityName AND tp.status = 1',
                'tp')
            ->where("cStats.countryCode = :countryCode: AND cStats.stateCode = :stateCode: AND cStats.cityName = :cityName:")
            ->andWhere('cStats.totalPartners > 0')
            ->setBindParams([
                "countryCode" => $countryCode,
                "stateCode" => $stateCode,
                "cityName" => $cityName,
            ])
            ->orderBy('cStats.totalPartners DESC')
            ->getQuery()
            ->execute()
            ->toArray();
 
 
 
        if (count($topPages) <= 0) {
            if ($stateCode) {
                header("Location: " . env('PROJECT_BASE_URL') . $countryCode . "/" . $stateCode, true, 302);
                exit();
            }
 
            if ($countryCode) {
                header("Location: " . env('PROJECT_BASE_URL') . $countryCode, true, 302);
                exit();
            }
 
            return $this->route404Action();
        }
        $first = $topPages[0];
        $actualCityName = ucwords(str_replace('-', ' ', $cityName));
        $linkItems = [];
        foreach ($topPages as $page) {
            // die(json_encode($page));
            $title = str_replace(['{total}', '{location}', '{year}'],
                [$page['totalPartners'], $actualCityName, Carbon::now()->format('Y')], $page['title']);
            $linkItems[] = [
                "link" => strtolower($this->config->baseUri.$countryCode)."/". strtolower($stateCode)."/".$cityName."/".strtolower(str_replace('_',
                        '-', $page['slug'])),
                "text" => $title
            ];
        }
 
        $this->assets->collection('headerGoogle')
            ->addCss('assets/css/logic-block.css?v='.$this->ver);
        $this->assets->collection('footer')
            ->addJs('assets/js/logic-block.js');
        $companies = Partners::getLogicBlockPartners($this->config->baseUri, $countryCode, $stateCode, $cityName);
        $reviews = Reviews::getLogicBlockReviews($this->config->baseUri, $countryCode, $stateCode, $cityName);
        $categories = CatalogTopPages::getLogicBlockPages($this->config->baseUri, $countryCode, $stateCode, $cityName);
 
        $logicBlock = [
            'companies' => $companies,
            'reviews' => $reviews,
            'categories' => $categories
        ];
        $this->view->logicBlock = $logicBlock;
 
        $this->seoTitle = "Best Local Business Directory Listings in ".$actualCityName.", ".$first['stateName'];
        $this->title = "Best Local Businesses in ".$actualCityName.", ".$first['stateName'];
        $this->description = "Below is the list of categories that TrustAnalytica serves in ".$actualCityName;
        $this->view->linkItems = $linkItems;
        $this->view->countryCode = strtolower($countryCode);
        $this->view->stateCode = strtolower($stateCode);
        $this->view->cityName = ucwords(str_replace('-', ' ', $cityName));
    }
 
    public function categoryAction()
    {
        $this->response->setContentType('application/json');
        $this->view->disable();
        $categoryPage = $this->request->getPost('page', 'int', 1);
        $categoryType = $this->request->getPost('type', 'int', 1);
        $categories = CatalogCategories::getCategories($categoryType, $categoryPage);
        $html = $this->view->getPartial("partials/catalog/business-category-container",
            ['categories' => $categories['items']]);
        echo json_encode([
            'html' => $html,
            'showMore' => $categories['showMore'],
        ]);
    }
 
    /**
     * @return \Phalcon\Http\ResponseInterface
     */
    public function autocompleteAction()
    {
        $this->view->disable();
 
        $query = $this->request->get('query', ['trim', 'string'], '');
        $type = $this->request->get('type', ['trim', 'string'], '');
        $suggestions = [];
        if (!empty($query) && $this->request->isPost() && $this->request->isAjax()) {
            $suggestions = Partners::getAutocompleteList($query, $type);
            return $this->response->setJsonContent(compact('query', 'suggestions'));
        }
    }
 
    public function businessAction()
    {
        $search = $this->request->get('find_desc', ['trim', 'search'], '');
        $page = $this->request->get('page', 'int', 1);
 
        if (empty($search)) {
            return $this->route404Action();
        }
 
        $suggestions = Partners::getAutocompleteList($search, 'fullName', 0);
        $html = $this->view->getPartial('partials/catalog/items', [
            'partners' => (object) [
                'items' => $suggestions[0],
            ],
        ]);
 
        $this->assets->collection('header')
            ->addCss('assets/page/top-business/style.css?v=375')
            ->addCss('assets/css/auto-complete.css')
            ->addCss('assets/page/top-business/keyword-previewer.css');
        $this->assets->collection('footer')
            ->addJs('src/vendor/jquery/dist/jquery.min.js')
            ->addJs('assets/packages/jquery.lazy/jquery.lazy.min.js')
            ->addJs('assets/js/logic-block.js')
            ->addJs('assets/js/catalog.js?v='.rand(10, 10000))
            ->addJs('assets/page/top-business/keyword-previewer.js')
            ->addJs('assets/companent/devbridge-autocomplete/src/jquery.autocomplete.js');
 
        if (!empty($search)) {
            $totalSearchResult = count($suggestions);
            foreach ($suggestions as $profile) {
                $partnerTimings = Partners::getWorkForFront($profile);
                $profile->partnerTimings = $partnerTimings;
 
                $facePhotox = $this->facePhotoToUse($profile->id);
                $profile->facePhotoToUse = $facePhotox;
            }
 
            $this->view->partners = $suggestions;
            $this->view->searchResults = 1;
            $this->view->totalSearchResult = $totalSearchResult;
 
        }
 
        $this->view->search = $search;
        if (!empty($search) || !empty($find_loc)) {
            $this->seoTitle = 'robots';
            $this->seoDescription = 'noindex,nofollow';
            $this->title = "Search Results - TrustAnalytica";
        }
    }
 
    public function uniqueObjects($array, $key)
    {
        $tempArray = [];
        $resultArray = [];
 
        foreach ($array as $item) {
            if (!isset($tempArray[$item[$key]])) {
                $tempArray[$item[$key]] = true;
                $resultArray[] = $item;
            }
        }
 
        return $resultArray;
    }
 
    public function onlineAction($categorySlug)
    {
        $profileMapLocations = [];
        $category = CatalogCategories::findFirst([
            'conditions' => 'slug = :slug: AND type = 2',
            'bind' => ['slug' => $categorySlug]
        ]);
        if (!$category) {
            return $this->route404Action();
        }
 
        if ($category->status == 0) {
            return $this->route404Action();
        }
 
        $perPage = 30;
        $page = $this->request->get('page', 'int', 1);
        if ($page <= 0) {
            $page = 1;
        }
 
        $totalItems = (int) (CategoriesStats::findFirst([
            'columns' => 'totalPartners',
            'conditions' => 'category = :category:',
            'bind' => ['category' => $category->category],
        ]))->totalPartners;
 
        $ads_partners_count = 0;
        if (!$this->request->isAjax()) {
            // $ads_partners = AdsBusinesses::getPartners($categorySlug, $countryCode, $stateCode, $cityName);
            // $ads_partners_count = count($ads_partners);
            $this->view->ads_partners = [];
        }
 
        if (!$this->request->isAjax() && $totalItems == 0 && $ads_partners_count == 0) {
            return $this->route404Action();
        }
 
        $title = $category->title;
        $description = $category->description;
        $metaTitle = $category->metaTitle;
        $metaDescription = $category->metaDescription;
 
        preg_match('/\bin|IN\b/', $title, $titleMatchedWord, PREG_OFFSET_CAPTURE);
        if (isset($titleMatchedWord[0][1])) {
            $simpleTitle = substr($title, 0, $titleMatchedWord[0][1]);
        } else {
            $simpleTitle = $title;
        }
        $currentYear = Carbon::now()->format('Y');
        $simpleTitle = str_replace(['{total}', '{year}'], ["", $currentYear], $simpleTitle);
        $title = str_replace(['{total}', '{year}'], [$totalItems, $currentYear], $title);
        $description = str_replace(['{total}', '{year}'], [$totalItems, $currentYear], $description);
        $metaTitle = str_replace(['{total}', '{year}'], [$totalItems, $currentYear], $metaTitle);
        $metaDescription = str_replace(['{total}', '{year}'], [$totalItems, $currentYear], $metaDescription);
 
        $catalog = Partners::getCatalogPartners('online', $category->category, $page);
        $catalog = $this->sortArrayByConditions($catalog);
        $newCatalogArr = [];
        $uniqueCatalog = $this->uniqueObjects($catalog, 'id');
        foreach ($uniqueCatalog as $item) {
            $id = $item['id'];
            $checkSubscription = PartnerSubscription::checkSubscription($item->id);
 
            if ($checkSubscription) {
                $item->subscription = 1;
            } else {
                $item->subscription = 0;
            }
            array_push($newCatalogArr, $item);
 
            $facePhotox = $this->facePhotoToUse($item->id);
            $item->facePhotoToUse = $facePhotox;
 
            $mapLocation = [(string) $item->lat, (string) $item->lng, $item->fullName, (string) $item->fullAddress];
                if($item->lat != '' || $item->lat != null) {
                    $profileMapLocations[] = $mapLocation;
                }
                $profileMapLocations[] = $mapLocation;
 
            $partnerType = Partners::getActualType($item->id);
            $item->partnerCategory = $partnerType;
 
            $partnerTimings = Partners::getWorkForFront($item);
            $item->partnerTimings = $partnerTimings;
        }
 
        $paginate = (object) [
            'items' => $uniqueCatalog,
            'current' => $page * $perPage - $perPage,
        ];
 
        if ($this->request->isAjax()) {
            $this->response->setContentType('application/json');
            $this->view->disable();
            $html = $this->view->getPartial('partials/catalog/items', [
                'partners' => $paginate,
                'category' => $category,
                'isAjax' => true,
            ]);
            echo json_encode([
                'html' => $html,
                'showMore' => $totalItems > $page * $perPage,
            ]);
        } else {
            $this->view->pick('catalog/index');
 
            $this->assets->collection('header')
                ->addCss('assets/page/top-business/style.css?v=375')
                ->addCss('assets/page/top-business/keyword-previewer.css');
            $this->assets->collection('footer')
                ->addJs('src/vendor/jquery/dist/jquery.min.js')
                ->addJs('assets/packages/jquery.lazy/jquery.lazy.min.js')
                ->addJs('assets/page/top-business/keyword-previewer.js')
                ->addJs('assets/js/catalog.js?v='.rand(10, 10000))
                ->addJs('assets/companent/devbridge-autocomplete/src/jquery.autocomplete.js')
                ->addJs('assets/page/top-business/catalog.js?v=25');
 
            $this->view->isAjax = false;
            $this->view->partners = $paginate;
            $this->view->category = $category;
            $this->view->total_items = $totalItems;
            $this->view->profileMapLocations = $profileMapLocations;
            $this->view->simpleTitle = html_entity_decode($simpleTitle, ENT_QUOTES);
            $this->view->faq = html_entity_decode($category->faq, ENT_QUOTES);
            $this->view->categories = CatalogCategories::getCategories(2, 1, true);
            $this->view->categorySlug = $categorySlug;
 
            $this->view->isTopTen = 1;
            $this->title = html_entity_decode($title, ENT_QUOTES);
            $this->metaTitle = html_entity_decode($metaTitle, ENT_QUOTES);
            $this->description = html_entity_decode($description, ENT_QUOTES);
            $this->seoTitle = html_entity_decode($metaTitle, ENT_QUOTES);
            $this->seoDescription = html_entity_decode($metaDescription, ENT_QUOTES);
 
            // related categories logic
            $this->view->relatedCategories = CatalogTopPages::getRelatedCategoriesPages($this->config->baseUri,
                $category);
            $this->view->buildJsNoNeed = true;
            $this->view->setRenderLevel(
                View::LEVEL_MAIN_LAYOUT
            );
        }
 
    }
 
    public function facePhotoToUse($id) {
        $photos = PartnerDetails::findFirstByPartnerId($id);
 
        if($photos) {
            if($photos->apiPhotos == 1) {
                $partner = Partners::findFirstById($id);
 
                if($partner->facePhoto != null || $partner->facePhoto != '') {
                    return $partner->facePhoto;
                } else {
                    if($partner->mediaPhotos != null) {
                        $photos = json_decode($partner->mediaPhotos, true);
                        return $photos[0];
                    }
                }
            }
 
            if($photos->partnerDashPhotos == 1) {
                $partnerChanges = UserPartnerChanges::findFirstByfkPartnersId($id);
                if($partnerChanges->facePhoto != null || $partnerChanges->facePhoto != '') {
                    return $partnerChanges->facePhoto;
                } else {
                    if($partnerChanges->mediaPhotos != null) {
                        $photos = json_decode($partnerChanges->mediaPhotos, true);
                        return $photos[0];
                    }
                }
            }
 
            if($photos->websiteScreenshots == 1) {
                $partner = Partners::findFirstById($id);
 
                if($partner->websiteScreenshots != null) {
                    $photos = json_decode($partner->websiteScreenshots, true);
                    return $photos[0];
                }
 
            }
 
            if($photos->categoryPhotos == 1) {
                $partner = Partners::findFirstById($id);
 
                if($partner->categoryPhotos != null) {
                    $photos = json_decode($partner->categoryPhotos, true);
                    return $photos[1];
                }
 
            }
        } else {
            $partner = Partners::findFirstById($id);
            return $partner->facePhoto != null || $partner->facePhoto != '' ? $partner->facePhoto : $partner->mediaPhotos[0];
        }
    }
}
#1Apps\Frontend\Controllers\CatalogController->indexAction
#2Phalcon\Dispatcher\AbstractDispatcher->callActionMethod
#3Phalcon\Dispatcher\AbstractDispatcher->dispatch
#4Phalcon\Mvc\Application->handle
/home/tafront/current/public/index.php (92)
<?php
 
define('PHALCONSTART', microtime(true));
define('PROJECT_PATH', dirname(__FILE__, 2).'/');
require_once __DIR__ . '/../library/functions.php';
require_once __DIR__ . '/../vendor/autoload.php';
 
use Phalcon\Mvc\Application;
use Phalcon\Di\FactoryDefault;
use Phalcon\Cache\AdapterFactory;
use Phalcon\Mvc\Model\MetaData\Redis;
use Phalcon\Storage\SerializerFactory;
 
 
date_default_timezone_set('UTC');
 
// Define some absolute path constants to aid in locating resources
define('BASE_PATH', dirname(__DIR__));
define('APP_PATH', BASE_PATH.'/apps');
 
require_once APP_PATH.'/bootstrap.php';
 
try {
    $di = new FactoryDefault();
//    $di->set(
//        'modelsMetadata',
//        function () {
//            $serializerFactory = new SerializerFactory();
//            $adapterFactory = new AdapterFactory($serializerFactory);
//            $options = [
//                'host' => env('FRONTEND_REDIS', '127.0.0.1'),
//                'port' => 6379,
//                'index' => 1,
//                'lifetime' => 86400 * 30,
//                'prefix' => 'CacheM-',
//            ];
//
//            return new Redis($adapterFactory, $options);
//        }
//    );
 
    //debug
    if ($config->get('debug')) {
        error_reporting(E_ALL);
        $debug = new \Phalcon\Debug();
        $debug->listen();
    }
 
    /**
     * Init Phalcon Dependency Injection
     */
 
    $di->offsetSet('basePath', function () {
        return BASE_PATH;
    });
 
    /**
     * Register Service Providers
     */
    $providers = BASE_PATH.'/config/providers.php';
    if (!file_exists($providers) || !is_readable($providers)) {
        throw new Exception('File providers.php does not exist or is not readable.');
    }
 
    /** @var array $providers */
    $providers = include $providers;
    foreach ($providers as $provider) {
        $di->register(new $provider());
    }
 
 
    //include PROJECT_PATH . 'config/asl.php';
 
    $application = new Application($di);
 
    /**
     * Register application modules
     */
    $modules = [];
 
    foreach ($config->modules as $index => $modul) {
        $modules[$index] = [
            'className' => $modul->className,
            'path' => $modul->dir.'Module.php'
        ];
    }
 
    $application->registerModules($modules);
 
    // Handle the request
    $response = $application->handle(
        $_SERVER["REQUEST_URI"]
    );
 
    $response->send();
 
} catch (\Exception $e) {
 
    echo " PhalconException : happened in ".get_class($e)." class <br/> \n";
    echo " ExceptionMessage : <strong style='color:red'>".$e->getMessage()."</strong><br/>\n";
    echo " File=".$e->getFile();
    echo " Line=".$e->getLine()."<br/>\n<hr>";
    echo nl2br(htmlentities($e->getTraceAsString()));
}
KeyValue
KeyValue
USERtafront
HOME/home/tafront
SCRIPT_FILENAME/home/tafront/current/public/index.php
HTTP_X_FORWARDED_PROTOhttps
HTTP_CF_VISITOR{"scheme":"https"}
HTTP_CF_IPCOUNTRYUS
HTTP_CF_CONNECTING_IP216.73.216.188
HTTP_CDN_LOOPcloudflare; loops=1
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_ACCEPT_ENCODINGgzip, br
HTTP_ACCEPT*/*
HTTP_CF_RAY974bd3ffa885a1f9-YYZ
HTTP_X_FORWARDED_FOR216.73.216.188
HTTP_HOSTtrustanalytica.org
PATH_TRANSLATED/home/tafront/current/public/index.php
REDIRECT_STATUS200
SERVER_NAMEtrustanalytica.org
SERVER_PORT443
SERVER_ADDR137.184.235.105
REMOTE_PORT54662
REMOTE_ADDR108.162.242.50
SERVER_SOFTWAREnginx/1.18.0
GATEWAY_INTERFACECGI/1.1
HTTPSon
REQUEST_SCHEMEhttps
SERVER_PROTOCOLHTTP/2.0
DOCUMENT_ROOT/home/tafront/current/public
DOCUMENT_URI/index.php
REQUEST_URI/us/wi/best-auto-insurance-agencies
SCRIPT_NAME/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHODGET
QUERY_STRING
PATH_INFO
FCGI_ROLERESPONDER
PHP_SELF/index.php
REQUEST_TIME_FLOAT1756132654.2451
REQUEST_TIME1756132654
DATABASE_HOST137.184.236.187
DATABASE_READER_HOST137.184.236.187
DATABASE_USERadmin
DATABASE_PASSJRuvSePg90cC7yW12Pc8Y0BW?@
DATABASE_NAMEta
DATABASE_CHARSETutf8
DATABASE_HOST_COUNTRY143.110.226.181
DATABASE_USER_COUNTRYmain
DATABASE_PASS_COUNTRYJRuvSePg90cC7yW12Pc8Y0BW?@
DATABASE_NAME_COUNTRYgeonames
DATABASE_PORT_COUNTRY3306
DATABASE_CHARSET_COUNTRYutf8mb4
ELASTIC_HOST3.21.8.128:9200
ELASTIC_USERelastic
ELASTIC_PASSWORD7yNp7eHLObGGxjij3QlT
ELASTIC_INDEXcontent
AWS_S3_KYEAKIA5WJIU64LONO6EWCD
AWS_S3_SECRETL0UAJfrZuk71A6FSHwJ9gf0d7anqT0Oub8noPOVW
AWS_S3_REGIONus-east-2
AWS_S3_BUCKETcdntrust
AWS_S3_URLhttps://cdnhouse.s3.us-east-2.amazonaws.com/
APP_PDW0
APP_PDW_IP0
PROJECT_DEBUG1
PROJECT_CLOSE_IP0
PROJECT_ENVprod
PROJECT_CSS_COMPRESS0
PROJECT_JS_COMPRESS0
PROJECT_BASE_URLhttps://trustanalytica.org/
PROJECT_HOST_NAMEtrustanalytica.org
PROJECT_NAMETrustAnalytica
PROJECT_ADMINhttps://app.trustanalytica.com/
PROJECT_ADMIN_SIGN_IN_PAGEhttps://app.trustanalytica.com/authreg/login
PROJECT_ADMIN_SIGN_UP_PAGEhttps://app.trustanalytica.com/authreg/signup
PROJECT_ADMIN_PASS_RECOVER_PAGEhttps://app.trustanalytica.com/authreg/forgotPassword
MODULE_BACKEND_HOST_NAMEadmin.trustanalytica.com
HYBRIDAUTH_DEBUG_MODE0
SENDGRID_ON1
SENDGRID_API_KEYSG.0of6xf_uTuuYm4cx_rYX2Q.V5MT8gQ3Xs2gO3oy8Dv4pH8t86NOrW0lgs2By7Vrgz8
SENDGRID_VAKEYSG.cKh5Dr7aSBehl8IFCo28Kg.5cSn3tTPdrCBUzNdE2-k0dUOU1Zvo1qA8CT4PiMoE6Y
SENDGRID_CHECK_EMAIL0
SENDGRID_SANDBOX1
PREFIX_SESSIONta
RECAPTCHA_SECRET6LcfycMUAAAAAEE3RKFBR3cmzsQ2-t-1j-9k_xZO
RECAPTCHA_SITE6LcfycMUAAAAAEcueT3oF7um_zTSW-cLh96G1tcZ
GOOGLE_AUTH_CLIENT_ID327807442376-cfcg40c6o466acl3a3hov5i8kv0p3hu5.apps.googleusercontent.com
GOOGLE_AUTH_CLIENT_SECRETZLUDhE_sakSKNX6FRltGw0lV
GOOGLE_AUTH_REDIRECT_URIhttps://app.trustanalytica.com/admin/settings/googleRedirect
GOOGLE_API_KEYAIzaSyDWaBAsdXYxQ-o34pWvKPCxnfr0vqf6h-M
GOOGLE_MAP_KEYAIzaSyCOr2opApkeuBj-8KrpM6CPfCh-qTDDlUY
GOOGLE_SEARCH_API_KEYAIzaSyBK4cc6JeTNbOlOrFil5wVZiAUh4brzStQ
GOOGLE_SEARCH0
GOOGLE_APP_ID55518288045-1vplpg8jt8anplutngh93i2svse3qq9b.apps.googleusercontent.com
GOOGLE_APP_SECRETQBGqJ3Escr3yi4TsLo52HzRu
GOOGLE_APP_REDIRECT_URIhttps://staging.trustanalytica.com/social/callback/google
FACEBOOK_APP_ID1247001565497765
FACEBOOK_APP_SECRET786a33974513535167649e5f21601f0d
FACEBOOK_AUTH_REDIRECT_URIhttps://app.trustanalytica.com/admin/settings/facebookRedirect
TWITTER_CLIENT_IDcStMhuM4wYblHhykA8h3nVhHv
TWITTER_CLIENT_SECRETKRMKZkVb4Scibq9uRZSYu4tDzROenAaT2OeDMPgkymexUYaGv7
TWITTER_AUTH_REDIRECT_URIhttps://staging.trustanalytica.com/social/callback/twitter
LINKEDIN_CLIENT_ID77i054hh0kxdqg
LINKEDIN_CLIENT_SECRETHWYUCWInQl4dG1xs
LINKEDIN_AUTH_REDIRECT_URIhttps://your-local-domain/admin/settings/linkedinRedirect
SOCIAL_LINKEDIN_OFFICIAL_PAGEhttps://www.linkedin.com/company/trustanalytica/
SOCIAL_FACEBOOK_OFFICIAL_PAGEhttps://www.facebook.com/trustanalytica/
SOCIAL_TWITTER_OFFICIAL_PAGEhttps://x.com/trustanalytica
SOCIAL_YOUTUBE_OFFICIAL_PAGEhttps://www.youtube.com/channel/UCTY4BMLI5Aym9IN49b-KcRA
GOOGLE_PLAYMARKET_LINKhttps://play.google.com/store/apps/details?id=com.trustanalytica
BRIGHTLOCAL_API_KEY03132c343c836577a2c9e2796289fb82267e9491
BRIGHTLOCAL_SECRET_KEY5e20884e7e34b
APIFLASH_ACCESS_KEY66bc7f76456247ddac642f17f3d34a65
PATCH_GEO_CITY/usr/share/GeoIP/GeoLite2-City.mmdb
TEST_UUID_PARTNER1e8f02e0-c3d5-4f2a-8208-016806913986
TEST_URL_APPhttps://app.trustanalytica.com
MAIL_EMAIL[email protected]
MAIL_DRIVERmail
MAIL_HOSTsmtp.mailtrap.io
MAIL_PORT2525
MAIL_FROM_ADDRESS[email protected]
MAIL_FROM_NAMETrustAnalytica
MAIL_ENCRYPTIONtls
MAIL_USERNAME
MAIL_PASSWORD
Xtoken901d@6^s5osOEtsJvNyH
TA_FRONTENDhttps://trustanalytica.org
TA_BACKENDhttps://app.trustanalytica.com
#Path
0/home/tafront/current/public/index.php
1/home/tafront/current/library/functions.php
2/home/tafront/current/vendor/autoload.php
3/home/tafront/current/vendor/composer/autoload_real.php
4/home/tafront/current/vendor/composer/platform_check.php
5/home/tafront/current/vendor/composer/ClassLoader.php
6/home/tafront/current/vendor/composer/autoload_static.php
7/home/tafront/current/vendor/symfony/polyfill-mbstring/bootstrap.php
8/home/tafront/current/vendor/symfony/polyfill-php80/bootstrap.php
9/home/tafront/current/vendor/symfony/deprecation-contracts/function.php
10/home/tafront/current/vendor/ralouphie/getallheaders/src/getallheaders.php
11/home/tafront/current/vendor/symfony/polyfill-ctype/bootstrap.php
12/home/tafront/current/vendor/guzzlehttp/promises/src/functions_include.php
13/home/tafront/current/vendor/guzzlehttp/promises/src/functions.php
14/home/tafront/current/vendor/guzzlehttp/psr7/src/functions_include.php
15/home/tafront/current/vendor/guzzlehttp/psr7/src/functions.php
16/home/tafront/current/vendor/symfony/polyfill-intl-grapheme/bootstrap.php
17/home/tafront/current/vendor/symfony/polyfill-intl-normalizer/bootstrap.php
18/home/tafront/current/vendor/react/promise/src/functions_include.php
19/home/tafront/current/vendor/react/promise/src/functions.php
20/home/tafront/current/vendor/symfony/polyfill-php73/bootstrap.php
21/home/tafront/current/vendor/symfony/string/Resources/functions.php
22/home/tafront/current/vendor/guzzlehttp/guzzle/src/functions_include.php
23/home/tafront/current/vendor/guzzlehttp/guzzle/src/functions.php
24/home/tafront/current/vendor/mtdowling/jmespath.php/src/JmesPath.php
25/home/tafront/current/vendor/starkbank/ecdsa/src/ellipticcurve.php
26/home/tafront/current/vendor/starkbank/ecdsa/src/utils/file.php
27/home/tafront/current/vendor/starkbank/ecdsa/src/signature.php
28/home/tafront/current/vendor/starkbank/ecdsa/src/publickey.php
29/home/tafront/current/vendor/starkbank/ecdsa/src/privatekey.php
30/home/tafront/current/vendor/starkbank/ecdsa/src/ecdsa.php
31/home/tafront/current/vendor/symfony/translation/Resources/functions.php
32/home/tafront/current/vendor/aws/aws-sdk-php/src/functions.php
33/home/tafront/current/vendor/elasticsearch/elasticsearch/src/autoload.php
34/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Nodes/HotThreads.php
35/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/AbstractEndpoint.php
36/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Nodes/Info.php
37/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Nodes/ReloadSecureSettings.php
38/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Nodes/Stats.php
39/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Nodes/Usage.php
40/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/GetSettings.php
41/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Cluster/PutSettings.php
42/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/DeleteAlias.php
43/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/ExistsAlias.php
44/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/GetAlias.php
45/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/PutAlias.php
46/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/UpdateAliases.php
47/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/ClearCache.php
48/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/GetMapping.php
49/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/GetFieldMapping.php
50/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/PutMapping.php
51/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/GetSettings.php
52/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/PutSettings.php
53/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/GetTemplate.php
54/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/PutTemplate.php
55/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/ExistsTemplate.php
56/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/DeleteTemplate.php
57/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/ExistsType.php
58/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/GetUpgrade.php
59/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/Upgrade.php
60/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Indices/ValidateQuery.php
61/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Ingest/DeletePipeline.php
62/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Ingest/GetPipeline.php
63/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Ingest/PutPipeline.php
64/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Ingest/ProcessorGrok.php
65/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/GetScript.php
66/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/PutScript.php
67/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/DeleteScript.php
68/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Snapshot/CreateRepository.php
69/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Snapshot/DeleteRepository.php
70/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Snapshot/GetRepository.php
71/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Snapshot/VerifyRepository.php
72/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/GetSource.php
73/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/ExistsSource.php
74/home/tafront/current/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Tasks/ListTasks.php
75/home/tafront/current/vendor/phalcon/zephir/Library/functions.php
76/home/tafront/current/apps/bootstrap.php
77/home/tafront/current/config/function.php
78/home/tafront/current/config/config.php
79/home/tafront/current/vendor/vlucas/phpdotenv/src/Dotenv.php
80/home/tafront/current/vendor/vlucas/phpdotenv/src/Loader.php
81/home/tafront/current/vendor/vlucas/phpdotenv/src/Parser.php
82/home/tafront/current/library/Str.php
83/home/tafront/current/config/providers.php
84/home/tafront/current/apps/Providers/DspatcherProvider.php
85/home/tafront/current/apps/Providers/ConfigProvider.php
86/home/tafront/current/apps/Providers/AssetsProvider.php
87/home/tafront/current/apps/Providers/SessionProvider.php
88/home/tafront/current/apps/Providers/FlashProvider.php
89/home/tafront/current/apps/Providers/FlashSessionProvider.php
90/home/tafront/current/apps/Providers/UrlProvider.php
91/home/tafront/current/apps/Providers/DbProvider.php
92/home/tafront/current/apps/Providers/DbCountryProvider.php
93/home/tafront/current/apps/Providers/SecurityProvider.php
94/home/tafront/current/apps/Providers/RouterProvider.php
95/home/tafront/current/apps/Providers/AuthProvider.php
96/home/tafront/current/apps/Providers/TransProvider.php
97/home/tafront/current/apps/Providers/EventsManagerProvider.php
98/home/tafront/current/apps/Providers/CryptProvider.php
99/home/tafront/current/apps/Providers/StrProvider.php
100/home/tafront/current/apps/Providers/HelpersProvider.php
101/home/tafront/current/apps/Providers/ModelsManagerProvider.php
102/home/tafront/current/apps/Providers/CookiesProvider.php
103/home/tafront/current/apps/Providers/GeoIpProvider.php
104/home/tafront/current/apps/Providers/ElasticProvider.php
105/home/tafront/current/apps/Providers/LoggerProvider.php
106/home/tafront/current/apps/Providers/RandomProvider.php
107/home/tafront/current/apps/Providers/AwsProvider.php
108/home/tafront/current/apps/Providers/HybridauthProvider.php
109/home/tafront/current/apps/Providers/ModelsCacheProvider.php
110/home/tafront/current/config/cache.php
111/home/tafront/current/apps/Frontend/routes.php
112/home/tafront/current/apps/Backend/routes.php
113/home/tafront/current/apps/Api/routes.php
114/home/tafront/current/apps/Frontend/Module.php
115/home/tafront/current/apps/AbstractModule.php
116/home/tafront/current/apps/Frontend/Controllers/CatalogController.php
117/home/tafront/current/apps/Frontend/Controllers/BaseController.php
118/home/tafront/current/apps/Models/CatalogCategories.php
119/home/tafront/current/apps/Models/BaseModel.php
120/home/tafront/current/library/Aws.php
121/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/S3Client.php
122/home/tafront/current/vendor/aws/aws-sdk-php/src/AwsClient.php
123/home/tafront/current/vendor/aws/aws-sdk-php/src/AwsClientInterface.php
124/home/tafront/current/vendor/aws/aws-sdk-php/src/AwsClientTrait.php
125/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/S3ClientInterface.php
126/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/S3ClientTrait.php
127/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Parser/PayloadParserTrait.php
128/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/RegionalEndpoint/ConfigurationProvider.php
129/home/tafront/current/vendor/aws/aws-sdk-php/src/AbstractConfigurationProvider.php
130/home/tafront/current/vendor/aws/aws-sdk-php/src/ConfigurationProviderInterface.php
131/home/tafront/current/vendor/aws/aws-sdk-php/src/data/manifest.json.php
132/home/tafront/current/vendor/aws/aws-sdk-php/src/HandlerList.php
133/home/tafront/current/vendor/aws/aws-sdk-php/src/ClientResolver.php
134/home/tafront/current/vendor/aws/aws-sdk-php/src/Signature/SignatureProvider.php
135/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/ApiProvider.php
136/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Service.php
137/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/AbstractModel.php
138/home/tafront/current/vendor/aws/aws-sdk-php/src/data/s3/2006-03-01/api-2.json.php
139/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/ShapeMap.php
140/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Parser/RestXmlParser.php
141/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Parser/AbstractRestParser.php
142/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Parser/AbstractParser.php
143/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Parser/XmlParser.php
144/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/ErrorParser/XmlErrorParser.php
145/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/ErrorParser/AbstractErrorParser.php
146/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Parser/MetadataParserTrait.php
147/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/GetBucketLocationParser.php
148/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/ValidateResponseChecksumParser.php
149/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/CalculatesChecksumTrait.php
150/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/AmbiguousSuccessParser.php
151/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/RetryableMalformedResponseParser.php
152/home/tafront/current/vendor/aws/aws-sdk-php/src/DefaultsMode/ConfigurationProvider.php
153/home/tafront/current/vendor/guzzlehttp/promises/src/RejectedPromise.php
154/home/tafront/current/vendor/guzzlehttp/promises/src/PromiseInterface.php
155/home/tafront/current/vendor/aws/aws-sdk-php/src/DefaultsMode/Exception/ConfigurationException.php
156/home/tafront/current/vendor/aws/aws-sdk-php/src/MonitoringEventsInterface.php
157/home/tafront/current/vendor/aws/aws-sdk-php/src/HasMonitoringEventsTrait.php
158/home/tafront/current/vendor/guzzlehttp/promises/src/Utils.php
159/home/tafront/current/vendor/guzzlehttp/promises/src/TaskQueue.php
160/home/tafront/current/vendor/guzzlehttp/promises/src/TaskQueueInterface.php
161/home/tafront/current/vendor/guzzlehttp/promises/src/Promise.php
162/home/tafront/current/vendor/guzzlehttp/promises/src/Is.php
163/home/tafront/current/vendor/guzzlehttp/promises/src/Create.php
164/home/tafront/current/vendor/aws/aws-sdk-php/src/DefaultsMode/Configuration.php
165/home/tafront/current/vendor/aws/aws-sdk-php/src/DefaultsMode/ConfigurationInterface.php
166/home/tafront/current/vendor/guzzlehttp/promises/src/FulfilledPromise.php
167/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/UseFipsEndpoint/ConfigurationProvider.php
168/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/UseFipsEndpoint/Exception/ConfigurationException.php
169/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/UseFipsEndpoint/Configuration.php
170/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/UseFipsEndpoint/ConfigurationInterface.php
171/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/UseDualstackEndpoint/ConfigurationProvider.php
172/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/UseDualstackEndpoint/Exception/ConfigurationException.php
173/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/UseDualstackEndpoint/Configuration.php
174/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/UseDualstackEndpoint/ConfigurationInterface.php
175/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/PartitionEndpointProvider.php
176/home/tafront/current/vendor/aws/aws-sdk-php/src/data/endpoints.json.php
177/home/tafront/current/vendor/aws/aws-sdk-php/src/data/endpoints_prefix_history.json.php
178/home/tafront/current/vendor/mtdowling/jmespath.php/src/Env.php
179/home/tafront/current/vendor/mtdowling/jmespath.php/src/AstRuntime.php
180/home/tafront/current/vendor/mtdowling/jmespath.php/src/FnDispatcher.php
181/home/tafront/current/vendor/mtdowling/jmespath.php/src/TreeInterpreter.php
182/home/tafront/current/vendor/mtdowling/jmespath.php/src/Parser.php
183/home/tafront/current/vendor/mtdowling/jmespath.php/src/Lexer.php
184/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/Partition.php
185/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/PartitionInterface.php
186/home/tafront/current/vendor/aws/aws-sdk-php/src/HasDataTrait.php
187/home/tafront/current/vendor/aws/aws-sdk-php/src/Endpoint/EndpointProvider.php
188/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Serializer/RestXmlSerializer.php
189/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Serializer/RestSerializer.php
190/home/tafront/current/vendor/guzzlehttp/psr7/src/Utils.php
191/home/tafront/current/vendor/guzzlehttp/psr7/src/Uri.php
192/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Serializer/XmlBody.php
193/home/tafront/current/vendor/aws/aws-sdk-php/src/Middleware.php
194/home/tafront/current/vendor/aws/aws-sdk-php/src/Credentials/CredentialProvider.php
195/home/tafront/current/vendor/aws/aws-sdk-php/src/Credentials/Credentials.php
196/home/tafront/current/vendor/aws/aws-sdk-php/src/Credentials/CredentialsInterface.php
197/home/tafront/current/vendor/aws/aws-sdk-php/src/EndpointDiscovery/ConfigurationProvider.php
198/home/tafront/current/vendor/aws/aws-sdk-php/src/Retry/ConfigurationProvider.php
199/home/tafront/current/vendor/aws/aws-sdk-php/src/Retry/Exception/ConfigurationException.php
200/home/tafront/current/vendor/aws/aws-sdk-php/src/Retry/Configuration.php
201/home/tafront/current/vendor/aws/aws-sdk-php/src/Retry/ConfigurationInterface.php
202/home/tafront/current/vendor/aws/aws-sdk-php/src/RetryMiddleware.php
203/home/tafront/current/vendor/aws/aws-sdk-php/src/Retry/RetryHelperTrait.php
204/home/tafront/current/vendor/aws/aws-sdk-php/src/Api/Validator.php
205/home/tafront/current/vendor/aws/aws-sdk-php/src/ClientSideMonitoring/ConfigurationProvider.php
206/home/tafront/current/vendor/aws/aws-sdk-php/src/ClientSideMonitoring/ApiCallMonitoringMiddleware.php
207/home/tafront/current/vendor/aws/aws-sdk-php/src/ClientSideMonitoring/AbstractMonitoringMiddleware.php
208/home/tafront/current/vendor/aws/aws-sdk-php/src/ClientSideMonitoring/MonitoringMiddlewareInterface.php
209/home/tafront/current/vendor/aws/aws-sdk-php/src/ClientSideMonitoring/ApiCallAttemptMonitoringMiddleware.php
210/home/tafront/current/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php
211/home/tafront/current/vendor/guzzlehttp/guzzle/src/ClientInterface.php
212/home/tafront/current/vendor/aws/aws-sdk-php/src/Handler/GuzzleV6/GuzzleHandler.php
213/home/tafront/current/vendor/guzzlehttp/guzzle/src/Client.php
214/home/tafront/current/vendor/guzzlehttp/guzzle/src/HandlerStack.php
215/home/tafront/current/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php
216/home/tafront/current/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
217/home/tafront/current/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
218/home/tafront/current/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php
219/home/tafront/current/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php
220/home/tafront/current/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php
221/home/tafront/current/vendor/guzzlehttp/guzzle/src/Middleware.php
222/home/tafront/current/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php
223/home/tafront/current/vendor/aws/aws-sdk-php/src/Sdk.php
224/home/tafront/current/vendor/aws/aws-sdk-php/src/IdempotencyTokenMiddleware.php
225/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/UseArnRegion/ConfigurationProvider.php
226/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/UseArnRegion/Exception/ConfigurationException.php
227/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/UseArnRegion/Configuration.php
228/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/UseArnRegion/ConfigurationInterface.php
229/home/tafront/current/vendor/aws/aws-sdk-php/src/EndpointParameterMiddleware.php
230/home/tafront/current/vendor/aws/aws-sdk-php/src/EndpointDiscovery/EndpointDiscoveryMiddleware.php
231/home/tafront/current/vendor/aws/aws-sdk-php/src/data/aliases.json.php
232/home/tafront/current/vendor/aws/aws-sdk-php/src/StreamRequestPayloadMiddleware.php
233/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/SSECMiddleware.php
234/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/ApplyChecksumMiddleware.php
235/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/S3EndpointMiddleware.php
236/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/BucketEndpointArnMiddleware.php
237/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/EndpointRegionHelperTrait.php
238/home/tafront/current/vendor/aws/aws-sdk-php/src/InputValidationMiddleware.php
239/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/PutObjectUrlMiddleware.php
240/home/tafront/current/vendor/aws/aws-sdk-php/src/S3/PermanentRedirectMiddleware.php
241/home/tafront/current/apps/Models/CatalogTopPages.php
242/home/tafront/current/apps/Models/GeoStates.php
243/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Carbon.php
244/home/tafront/current/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php
245/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Date.php
246/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php
247/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php
248/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php
249/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php
250/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php
251/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php
252/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php
253/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Macro.php
254/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php
255/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php
256/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php
257/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php
258/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php
259/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Options.php
260/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php
261/home/tafront/current/vendor/symfony/translation-contracts/TranslatorInterface.php
262/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php
263/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php
264/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php
265/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Test.php
266/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php
267/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Units.php
268/home/tafront/current/vendor/nesbot/carbon/src/Carbon/Traits/Week.php
269/home/tafront/current/vendor/symfony/polyfill-php80/Php80.php
270/home/tafront/current/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php
271/home/tafront/current/apps/Models/Partners/Partners.php
272/home/tafront/current/apps/Models/Partners/PartnerTypes.php
273/home/tafront/current/apps/Models/Partners/PartnerSocialLinks.php
274/home/tafront/current/apps/Models/Partners/PartnerDetails.php
275/home/tafront/current/apps/Models/Partners/PartnerSentimentals.php
276/home/tafront/current/apps/Models/Partners/PartnerSubscription.php
277/home/tafront/current/apps/Models/Catalog/Categories/CategoriesStatsByStates.php
278/home/tafront/current/apps/Models/Catalog/Categories/CategoriesStatsBaseModel.php
279/home/tafront/current/apps/Models/AdsBusinesses.php
280/home/tafront/current/apps/Models/AdsCategories.php
281/home/tafront/current/apps/Models/AdsCountries.php
282/home/tafront/current/apps/Models/AdsStates.php
283/home/tafront/current/apps/Models/AdsCities.php
284/home/tafront/current/apps/Models/PartnerServices.php
Memory
Usage2097152