Skip to content

Commit

Permalink
Release 5.0 (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
hisorange committed Sep 22, 2023
2 parents 640b01f + 15768ae commit e74a6fe
Show file tree
Hide file tree
Showing 32 changed files with 2,226 additions and 2,195 deletions.
27 changes: 8 additions & 19 deletions .github/workflows/latest.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
name: Latest
name: "Test on Latest Laravel"

# Triggers the workflow on push or pull request events
on: [push, pull_request]

jobs:
matrix-build:
test:
name: PHPUnit Tests
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php-version: [8.1]
laravel-version: [9.39.0]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-version }}
php-version: 8.2

- name: Composer update
- name: Composer self update
run: composer self-update >/dev/null 2>&1

- name: Get composer cache directory
Expand All @@ -37,8 +32,8 @@ jobs:

- name: Lock laravel/framework version
env:
LARAVEL_VERSION: ${{ matrix.laravel-version }}
run: composer require laravel/framework:${{ matrix.laravel-version }} --no-update
LARAVEL_VERSION: 10.5.0
run: composer require laravel/framework:10.5.0 --no-update

- name: Vendor update
if: steps.composer-cache.outputs.cache-hit != 'true'
Expand All @@ -47,12 +42,6 @@ jobs:
- name: Run test suites
run: composer run-script test

- name: Analyze
run: vendor/bin/phpstan analyse -c phpstan.neon ./src/

# - name: phpcs
# run: php vendor/bin/phpcs --standard=PSR12 ./src/

- name: Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
79 changes: 0 additions & 79 deletions .github/workflows/test-php7.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
name: PHP8.1
name: PHP8.2

# Manual run
on: workflow_dispatch

jobs:
matrix-build:
name: PHPUnit Tests Matrix
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: [8.1]
php-version: [8.2]
# these versions supports php8 in their composer.json
laravel-version:
[
9.0,
9.1,
9.2,
9.3,
9.4,
9.5,
9.6,
9.7,
9.8,
9.52,
10.0,
10.1,
10.2,
10.3,
10.4,
]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@master
Expand All @@ -47,8 +45,8 @@ jobs:
- name: Run test suites
run: composer run-script test

- name: Analyze
run: vendor/bin/phpstan analyse -c phpstan.neon ./src/
# - name: Analyze
# run: vendor/bin/phpstan analyse -c phpstan.neon ./src/

# - name: phpcs
# run: php vendor/bin/phpcs --standard=PSR12 ./src/
65 changes: 0 additions & 65 deletions .github/workflows/test-php8.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ vendor
.vscode
demo/cache
.phpunit.result.cache
.DS_store
.DS_store
.phpunit.cache
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### Changes in 5.0.0

---

- Support for Laravel 10.x
- Upgrade to MobileDetect 3.x
- Remove the outdated "mobileGrade" feature
- Test on PHP 8.2 too

### Changes in 4.5.2

---
Expand Down
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

47 changes: 19 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Browser Detection Logo](https://user-images.githubusercontent.com/3441017/126362397-d9767164-4f44-4d41-a3cd-b669e10e95dc.png)

## Browser Detection v4.5 by _[hisorange](https://hisorange.me)_
## Browser Detection v5.0 by _[hisorange](https://hisorange.me)_

[![Latest Stable Version](https://poser.pugx.org/hisorange/browser-detect/v/stable)](https://packagist.org/packages/hisorange/browser-detect)
[![Build](https://github.com/hisorange/browser-detect/actions/workflows/latest.yml/badge.svg?branch=stable)](https://github.com/hisorange/browser-detect/actions/workflows/latest.yml)
Expand All @@ -10,7 +10,9 @@

Easy to use package to identify the visitor's browser details and device type.
Magic is **not** involved the results are generated by multiple well tested and developed packages.
Supporting **every laravel** version between **4.0 » 9.0**, also tested on **every PHP** version between **5.6 » 8.1**.

Supports **every Laravel** version between **4.0 » 10.x**;
Also tested on **every PHP** version between **5.6 » 8.2**.

### How to install

Expand All @@ -32,10 +34,14 @@ In Your code just call the **Browser** facade:
use Browser;

// Determine the user's device type is simple as this:
Browser::isMobile();
$isMobile = Browser::isMobile();
Browser::isTablet();
Browser::isDesktop();

if (Browser::isMobile()) {
// Redirect to the mobile version of the site.
}

// Every wondered if it is a bot who loading Your page?
if (Browser::isBot()) {
echo 'No need to wonder anymore!';
Expand Down Expand Up @@ -85,15 +91,16 @@ Easy peasy, ain't it?

The following matrix is has been continuously tested by the great and awesome **GitHub Actions**!

| ----- | Browser Detect 1.x | Browser Detect 2.x | Browser Detect 3.x | Browser Detect 4.x |
| :---------: | :----------------: | :----------------: | :----------------: | :----------------: |
| Laravel 4.x | ✓ | ✓ | - | - |
| Laravel 5.x | - | ✓ | ✓ | - |
| Laravel 6.x | - | - | - | ✓ |
| Laravel 7.x | - | - | - | ✓ |
| Laravel 8.x | - | - | - | 4.4+ |
| Laravel 9.x | - | - | - | 4.4+ |
| Standalone | - | - | - | 4.2+ |
| ----- | Browser Detect 1.x | Browser Detect 2.x | Browser Detect 3.x | Browser Detect 4.x | Browser Detect 5.x |
| :----------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
| Laravel 4.x | ✓ | ✓ | - | - | - |
| Laravel 5.x | - | ✓ | ✓ | - | - |
| Laravel 6.x | - | - | - | ✓ | - |
| Laravel 7.x | - | - | - | ✓ | - |
| Laravel 8.x | - | - | - | 4.4+ | - |
| Laravel 9.x | - | - | - | 4.4+ | ✓ |
| Laravel 10.x | - | - | - | - | ✓ |
| Standalone | - | - | - | 4.2+ | ✓ |

Since 2013 the package runs tests on every possible PHP / Laravel version matrix.

Expand Down Expand Up @@ -149,7 +156,6 @@ Every call on the **Browser** facade is proxied to a result object, so the follo
| **Device related functions** | | |
| Browser::deviceFamily() | Device's vendor like Samsung, Apple, Huawei. | _(string)_ |
| Browser::deviceModel() | Device's brand name like iPad, iPhone, Nexus. | _(string)_ |
| Browser::mobileGrade() | Device's mobile grade in scale of A,B,C for performance. | _(string)_ |
| **Browser vendor related functions** | | |
| Browser::isChrome() | Is this a chrome browser. | _(boolean)_ |
| Browser::isFirefox() | Is this a firefox browser. | _(boolean)_ |
Expand Down Expand Up @@ -211,21 +217,6 @@ And it will use the application's cache to persist the result for a week or so,
this should provide You with a sufficient caching mechanism so the detection will
cost less than **0.02 millisecond**, this was tested with an 80,000 fake visit.

### Community

---

At the time of this writing, the library is getting closer to be 7 years old. I have implemented
every user request which was feasible, and running out of ideas for the future. By this statement
I am declaring this as the last feature release at version 4.2, from now on I will maintain compatibility
with new Laravel and PHP versions, but not planning to do any new features.

Thank You for your support over the years, and worry not, the library is stable, and has all the features You ever need.

~ Update on this :D

No major features are added in the past months, but with the help of [Raymund Ács](https://github.com/PoOwAa) we are patching and continuing the support for micro features and version ports.

### Changelog

---
Expand Down
Loading

0 comments on commit e74a6fe

Please sign in to comment.