!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/laravel-crm/packages/Webkul/Core/src/   drwxrwxrwx
Free 13.15 GB of 57.97 GB (22.68%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Core.php (5.46 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Webkul\Core;

use 
Carbon\Carbon;
use 
Webkul\Core\Repositories\CoreConfigRepository;
use 
Webkul\Core\Repositories\CountryRepository;
use 
Webkul\Core\Repositories\CountryStateRepository;

class 
Core
{
    
/**
     * The Krayin version.
     *
     * @var string
     */
    
const KRAYIN_VERSION '2.1.3';

    
/**
     * Create a new instance.
     *
     * @return void
     */
    
public function __construct(
        protected 
CountryRepository $countryRepository,
        protected 
CoreConfigRepository $coreConfigRepository,
        protected 
CountryStateRepository $countryStateRepository
    
) {}

    
/**
     * Get the version number of the Krayin.
     *
     * @return string
     */
    
public function version()
    {
        return static::
KRAYIN_VERSION;
    }

    
/**
     * Retrieve all timezones.
     */
    
public function timezones(): array
    {
        
$timezones = [];

        foreach (
timezone_identifiers_list() as $timezone) {
            
$timezones[$timezone] = $timezone;
        }

        return 
$timezones;
    }

    
/**
     * Retrieve all locales.
     */
    
public function locales(): array
    {
        
$options = [];

        foreach (
config('app.available_locales') as $key => $title) {
            
$options[] = [
                
'title' => $title,
                
'value' => $key,
            ];
        }

        return 
$options;
    }

    
/**
     * Retrieve all countries.
     *
     * @return \Illuminate\Support\Collection
     */
    
public function countries()
    {
        return 
$this->countryRepository->all();
    }

    
/**
     * Returns country name by code.
     */
    
public function country_name(string $code): string
    
{
        
$country $this->countryRepository->findOneByField('code'$code);

        return 
$country $country->name '';
    }

    
/**
     * Returns state name by code.
     */
    
public function state_name(string $code): string
    
{
        
$state $this->countryStateRepository->findOneByField('code'$code);

        return 
$state $state->name $code;
    }

    
/**
     * Retrieve all country states.
     *
     * @return \Illuminate\Support\Collection
     */
    
public function states(string $countryCode)
    {
        return 
$this->countryStateRepository->findByField('country_code'$countryCode);
    }

    
/**
     * Retrieve all grouped states by country code.
     *
     * @return \Illuminate\Support\Collection
     */
    
public function groupedStatesByCountries()
    {
        
$collection = [];

        foreach (
$this->countryStateRepository->all() as $state) {
            
$collection[$state->country_code][] = $state->toArray();
        }

        return 
$collection;
    }

    
/**
     * Retrieve all grouped states by country code.
     *
     * @return \Illuminate\Support\Collection
     */
    
public function findStateByCountryCode($countryCode null$stateCode null)
    {
        
$collection = [];

        
$collection $this->countryStateRepository->findByField([
            
'country_code' => $countryCode,
            
'code'         => $stateCode,
        ]);

        if (
count($collection)) {
            return 
$collection->first();
        } else {
            return 
false;
        }
    }

    
/**
     * Create singleton object through single facade.
     *
     * @param  string  $className
     * @return mixed
     */
    
public function getSingletonInstance($className)
    {
        static 
$instances = [];

        if (
array_key_exists($className$instances)) {
            return 
$instances[$className];
        }

        return 
$instances[$className] = app($className);
    }

    
/**
     * Format date
     *
     * @return string
     */
    
public function formatDate($date$format 'd M Y h:iA')
    {
        return 
Carbon::parse($date)->format($format);
    }

    
/**
     * Week range.
     *
     * @param  string  $date
     * @param  int  $day
     * @return string
     */
    
public function xWeekRange($date$day)
    {
        
$ts strtotime($date);

        if (! 
$day) {
            
$start = (date('D'$ts) == 'Sun') ? $ts strtotime('last sunday'$ts);

            return 
date('Y-m-d'$start);
        } else {
            
$end = (date('D'$ts) == 'Sat') ? $ts strtotime('next saturday'$ts);

            return 
date('Y-m-d'$end);
        }
    }

    
/**
     * Return currency symbol from currency code.
     *
     * @param  float  $price
     * @return string
     */
    
public function currencySymbol($code)
    {
        
$formatter = new \NumberFormatter(app()->getLocale().'@currency='.$code\NumberFormatter::CURRENCY);

        return 
$formatter->getSymbol(\NumberFormatter::CURRENCY_SYMBOL);
    }

    
/**
     * Format price with base currency symbol. This method also give ability to encode
     * the base currency symbol and its optional.
     *
     * @param  float  $price
     * @return string
     */
    
public function formatBasePrice($price)
    {
        if (
is_null($price)) {
            
$price 0;
        }

        
$formatter = new \NumberFormatter(app()->getLocale(), \NumberFormatter::CURRENCY);

        return 
$formatter->formatCurrency($priceconfig('app.currency'));
    }

    
/**
     * Get the config field.
     */
    
public function getConfigField(string $fieldName): ?array
    {
        return 
system_config()->getConfigField($fieldName);
    }

    
/**
     * Retrieve information for configuration.
     */
    
public function getConfigData(string $field): mixed
    
{
        return 
system_config()->getConfigData($field);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0166 ]--