Файловый менеджер - Редактировать - /home/easybachat/hisabat365.com/4a7891/nesbot.zip
Ðазад
PK ��)[z�� � carbon/extension.neonnu �[��� services: - class: Carbon\PHPStan\MacroExtension tags: - phpstan.broker.methodsClassReflectionExtension PK ��)[ �~Ao o carbon/sponsors.phpnu �[��� <?php /** * This file is part of the Carbon package. * * (c) Brian Nesbitt <brian@nesbot.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Carbon\CarbonImmutable; require_once __DIR__.'/vendor/autoload.php'; function getMaxHistoryMonthsByAmount($amount): int { if ($amount >= 50) { return 6; } if ($amount >= 20) { return 4; } return 2; } function getHtmlAttribute($rawValue): string { return str_replace( ['', "\r"], '', trim(htmlspecialchars((string) $rawValue), " \n\r\t\v\0"), ); } function getOpenCollectiveSponsors(): string { $customSponsorImages = [ // For consistency and equity among sponsors, as of now, we kindly ask our sponsors // to provide an image having a width/height ratio between 1/1 and 2/1. // By default, we'll show the member picture from OpenCollective, and will resize it if bigger // int(OpenCollective.MemberId) => ImageURL ]; $members = json_decode(file_get_contents('https://opencollective.com/carbon/members/all.json'), true); $members[] = [ 'MemberId' => 1, 'createdAt' => '2019-01-01 02:00', 'type' => 'ORGANIZATION', 'role' => 'BACKER', 'tier' => 'backer+', 'isActive' => true, 'totalAmountDonated' => 1000, 'currency' => 'USD', 'lastTransactionAt' => CarbonImmutable::now()->format('Y-m-d').' 02:00', 'lastTransactionAmount' => 25, 'profile' => 'https://tidelift.com/', 'name' => 'Tidelift', 'description' => 'Get professional support for Carbon', 'image' => 'https://carbon.nesbot.com/tidelift-brand.png', 'website' => 'https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=docs', ]; $list = array_filter($members, static function ($member): bool { return ($member['lastTransactionAmount'] > 3 || $member['isActive']) && $member['role'] === 'BACKER' && $member['type'] !== 'USER' && ( $member['totalAmountDonated'] > 100 || $member['lastTransactionAt'] > CarbonImmutable::now() ->subMonthsNoOverflow(getMaxHistoryMonthsByAmount($member['lastTransactionAmount'])) ->format('Y-m-d h:i') || $member['isActive'] && $member['lastTransactionAmount'] >= 30 ); }); $list = array_map(static function (array $member): array { $createdAt = CarbonImmutable::parse($member['createdAt']); $lastTransactionAt = CarbonImmutable::parse($member['lastTransactionAt']); if ($createdAt->format('d H:i:s.u') > $lastTransactionAt->format('d H:i:s.u')) { $createdAt = $createdAt ->setDay($lastTransactionAt->day) ->modify($lastTransactionAt->format('H:i:s.u')); } $monthlyContribution = (float) ($member['totalAmountDonated'] / ceil($createdAt->floatDiffInMonths())); if ( $lastTransactionAt->isAfter('last month') && $member['lastTransactionAmount'] > $monthlyContribution ) { $monthlyContribution = (float) $member['lastTransactionAmount']; } if ($lastTransactionAt->isBefore('-75 days')) { $days = min(120, $lastTransactionAt->diffInDays('now') - 70); $monthlyContribution *= 1 - $days / 240; } $yearlyContribution = (float) ($member['totalAmountDonated'] / max(1, $createdAt->floatDiffInYears())); $status = null; $rank = 0; if ($monthlyContribution > 29 || $yearlyContribution > 700) { $status = 'sponsor'; $rank = 4; } elseif ($monthlyContribution > 14.5 || $yearlyContribution > 500) { $status = 'backerPlus'; $rank = 3; } elseif ($monthlyContribution > 4.5 || $yearlyContribution > 80) { $status = 'backer'; $rank = 2; } elseif ($member['totalAmountDonated'] > 0) { $status = 'helper'; $rank = 1; } return array_merge($member, [ 'star' => ($monthlyContribution > 98 || $yearlyContribution > 800), 'status' => $status, 'rank' => $rank, 'monthlyContribution' => $monthlyContribution, 'yearlyContribution' => $yearlyContribution, ]); }, $list); usort($list, static function (array $a, array $b): int { return ($b['star'] <=> $a['star']) ?: ($b['rank'] <=> $a['rank']) ?: ($b['monthlyContribution'] <=> $a['monthlyContribution']) ?: ($b['totalAmountDonated'] <=> $a['totalAmountDonated']); }); return implode('', array_map(static function (array $member) use ($customSponsorImages): string { $href = htmlspecialchars($member['website'] ?? $member['profile']); $src = $customSponsorImages[$member['MemberId'] ?? ''] ?? $member['image'] ?? (strtr($member['profile'], ['https://opencollective.com/' => 'https://images.opencollective.com/']).'/avatar/256.png'); [$x, $y] = @getimagesize($src) ?: [0, 0]; $validImage = ($x && $y); $src = $validImage ? htmlspecialchars($src) : 'https://opencollective.com/static/images/default-guest-logo.svg'; $height = match ($member['status']) { 'sponsor' => 64, 'backerPlus' => 42, 'backer' => 32, default => 24, }; $rel = match ($member['status']) { 'sponsor', 'backerPlus' => '', default => ' rel="sponsored"', }; $width = min($height * 2, $validImage ? round($x * $height / $y) : $height); $href .= (strpos($href, '?') === false ? '?' : '&').'utm_source=opencollective&utm_medium=github&utm_campaign=Carbon'; $title = getHtmlAttribute(($member['description'] ?? null) ?: $member['name']); $alt = getHtmlAttribute($member['name']); if ($member['star']) { $width *= 1.5; $height *= 1.5; } return "\n".'<a title="'.$title.'" href="'.$href.'" target="_blank"'.$rel.'>'. '<img alt="'.$alt.'" src="'.$src.'" width="'.$width.'" height="'.$height.'">'. '</a>'; }, $list))."\n"; } file_put_contents('readme.md', preg_replace_callback( '/(<!-- <open-collective-sponsors> -->)[\s\S]+(<!-- <\/open-collective-sponsors> -->)/', static function (array $match): string { return $match[1].getOpenCollectiveSponsors().$match[2]; }, file_get_contents('readme.md') )); PK ��)[�$�ɇ � carbon/bin/carbonnu ȯ�� #!/usr/bin/env php <?php use Carbon\Cli\Invoker; $dir = __DIR__.'/..'; if (!file_exists($dir.'/autoload.php')) { $dir = __DIR__.'/../vendor'; } if (!file_exists($dir.'/autoload.php')) { $dir = __DIR__.'/../../..'; } if (!file_exists($dir.'/autoload.php')) { echo 'Autoload not found.'; exit(1); } require $dir.'/autoload.php'; exit((new Invoker())(...$argv) ? 0 : 1); PK ��)[{mu0] ] carbon/bin/carbon.batnu �[��� @ECHO OFF setlocal DISABLEDELAYEDEXPANSION SET BIN_TARGET=%~dp0/carbon php "%BIN_TARGET%" %* PK ��)[��咣# �# $ carbon/src/Carbon/CarbonTimeZone.phpnu �[��� <?php declare(strict_types=1); /** * This file is part of the Carbon package. * * (c) Brian Nesbitt <brian@nesbot.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Carbon; use Carbon\Exceptions\InvalidCastException; use Carbon\Exceptions\InvalidTimeZoneException; use Carbon\Traits\LocalFactory; use DateTimeInterface; use DateTimeZone; use Exception; use Throwable; class CarbonTimeZone extends DateTimeZone { use LocalFactory; public const MAXIMUM_TIMEZONE_OFFSET = 99; public function __construct(string|int|float $timezone) { $this->initLocalFactory(); parent::__construct(static::getDateTimeZoneNameFromMixed($timezone)); } protected static function parseNumericTimezone(string|int|float $timezone): string { if (abs((float) $timezone) > static::MAXIMUM_TIMEZONE_OFFSET) { throw new InvalidTimeZoneException( 'Absolute timezone offset cannot be greater than '. static::MAXIMUM_TIMEZONE_OFFSET.'.', ); } return ($timezone >= 0 ? '+' : '').ltrim((string) $timezone, '+').':00'; } protected static function getDateTimeZoneNameFromMixed(string|int|float $timezone): string { if (\is_string($timezone)) { $timezone = preg_replace('/^\s*([+-]\d+)(\d{2})\s*$/', '$1:$2', $timezone); } if (is_numeric($timezone)) { return static::parseNumericTimezone($timezone); } return $timezone; } /** * Cast the current instance into the given class. * * @param class-string<DateTimeZone> $className The $className::instance() method will be called to cast the current object. * * @return DateTimeZone|mixed */ public function cast(string $className): mixed { if (!method_exists($className, 'instance')) { if (is_a($className, DateTimeZone::class, true)) { return new $className($this->getName()); } throw new InvalidCastException("$className has not the instance() method needed to cast the date."); } return $className::instance($this); } /** * Create a CarbonTimeZone from mixed input. * * @param DateTimeZone|string|int|false|null $object original value to get CarbonTimeZone from it. * @param DateTimeZone|string|int|false|null $objectDump dump of the object for error messages. * * @throws InvalidTimeZoneException * * @return static|null */ public static function instance( DateTimeZone|string|int|false|null $object, DateTimeZone|string|int|false|null $objectDump = null, ): ?self { $timezone = $object; if ($timezone instanceof static) { return $timezone; } if ($timezone === null || $timezone === false) { return null; } try { if (!($timezone instanceof DateTimeZone)) { $name = static::getDateTimeZoneNameFromMixed($object); $timezone = new static($name); } return $timezone instanceof static ? $timezone : new static($timezone->getName()); } catch (Exception $exception) { throw new InvalidTimeZoneException( 'Unknown or bad timezone ('.($objectDump ?: $object).')', previous: $exception, ); } } /** * Returns abbreviated name of the current timezone according to DST setting. * * @param bool $dst * * @return string */ public function getAbbreviatedName(bool $dst = false): string { $name = $this->getName(); foreach ($this->listAbbreviations() as $abbreviation => $zones) { foreach ($zones as $zone) { if ($zone['timezone_id'] === $name && $zone['dst'] == $dst) { return $abbreviation; } } } return 'unknown'; } /** * @alias getAbbreviatedName * * Returns abbreviated name of the current timezone according to DST setting. * * @param bool $dst * * @return string */ public function getAbbr(bool $dst = false): string { return $this->getAbbreviatedName($dst); } /** * Get the offset as string "sHH:MM" (such as "+00:00" or "-12:30"). */ public function toOffsetName(?DateTimeInterface $date = null): string { return static::getOffsetNameFromMinuteOffset( $this->getOffset($this->resolveCarbon($date)) / 60, ); } /** * Returns a new CarbonTimeZone object using the offset string instead of region string. */ public function toOffsetTimeZone(?DateTimeInterface $date = null): static { return new static($this->toOffsetName($date)); } /** * Returns the first region string (such as "America/Toronto") that matches the current timezone or * false if no match is found. * * @see timezone_name_from_abbr native PHP function. */ public function toRegionName(?DateTimeInterface $date = null, int $isDST = 1): ?string { $name = $this->getName(); $firstChar = substr($name, 0, 1); if ($firstChar !== '+' && $firstChar !== '-') { return $name; } $date = $this->resolveCarbon($date); // Integer construction no longer supported since PHP 8 // @codeCoverageIgnoreStart try { $offset = @$this->getOffset($date) ?: 0; } catch (Throwable) { $offset = 0; } // @codeCoverageIgnoreEnd $name = @timezone_name_from_abbr('', $offset, $isDST); if ($name) { return $name; } foreach (timezone_identifiers_list() as $timezone) { if (Carbon::instance($date)->setTimezone($timezone)->getOffset() === $offset) { return $timezone; } } return null; } /** * Returns a new CarbonTimeZone object using the region string instead of offset string. */ public function toRegionTimeZone(?DateTimeInterface $date = null): ?self { $timezone = $this->toRegionName($date); if ($timezone !== null) { return new static($timezone); } if (Carbon::isStrictModeEnabled()) { throw new InvalidTimeZoneException('Unknown timezone for offset '.$this->getOffset($this->resolveCarbon($date)).' seconds.'); } return null; } /** * Cast to string (get timezone name). * * @return string */ public function __toString() { return $this->getName(); } /** * Return the type number: * * Type 1; A UTC offset, such as -0300 * Type 2; A timezone abbreviation, such as GMT * Type 3: A timezone identifier, such as Europe/London */ public function getType(): int { return preg_match('/"timezone_type";i:(\d)/', serialize($this), $match) ? (int) $match[1] : 3; } /** * Create a CarbonTimeZone from mixed input. * * @param DateTimeZone|string|int|null $object * * @return false|static */ public static function create($object = null) { return static::instance($object); } /** * Create a CarbonTimeZone from int/float hour offset. * * @param float $hourOffset number of hour of the timezone shift (can be decimal). * * @return false|static */ public static function createFromHourOffset(float $hourOffset) { return static::createFromMinuteOffset($hourOffset * Carbon::MINUTES_PER_HOUR); } /** * Create a CarbonTimeZone from int/float minute offset. * * @param float $minuteOffset number of total minutes of the timezone shift. * * @return false|static */ public static function createFromMinuteOffset(float $minuteOffset) { return static::instance(static::getOffsetNameFromMinuteOffset($minuteOffset)); } /** * Convert a total minutes offset into a standardized timezone offset string. * * @param float $minutes number of total minutes of the timezone shift. * * @return string */ public static function getOffsetNameFromMinuteOffset(float $minutes): string { $minutes = round($minutes); $unsignedMinutes = abs($minutes); return ($minutes < 0 ? '-' : '+'). str_pad((string) floor($unsignedMinutes / 60), 2, '0', STR_PAD_LEFT). ':'. str_pad((string) ($unsignedMinutes % 60), 2, '0', STR_PAD_LEFT); } private function resolveCarbon(?DateTimeInterface $date): DateTimeInterface { if ($date) { return $date; } if (isset($this->clock)) { return $this->clock->now()->setTimezone($this); } return Carbon::now($this); } } PK ��)[S��C�K �K "