Compare commits
	
		
			6 Commits
		
	
	
		
			v1.0.2
			...
			936ce0549d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					936ce0549d | ||
| 
						 | 
					c42ec1d6ff | ||
| 
						 | 
					d2a2a839e4 | ||
| 
						 | 
					fe0cb883e7 | ||
| 
						 | 
					136ce2cb75 | ||
| 
						 | 
					c398d5ec07 | 
							
								
								
									
										23
									
								
								.github/dependabot.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								.github/dependabot.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
				
			|||||||
 | 
					version: 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					updates:
 | 
				
			||||||
 | 
					  - package-ecosystem: "composer"
 | 
				
			||||||
 | 
					    directory: "/"
 | 
				
			||||||
 | 
					    allow:
 | 
				
			||||||
 | 
					      - dependency-type: "development"
 | 
				
			||||||
 | 
					    schedule:
 | 
				
			||||||
 | 
					      interval: "daily"
 | 
				
			||||||
 | 
					      time: "05:00"
 | 
				
			||||||
 | 
					      timezone: "Europe/Vienna"
 | 
				
			||||||
 | 
					    labels:
 | 
				
			||||||
 | 
					      - "composer dependencies"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - package-ecosystem: "github-actions"
 | 
				
			||||||
 | 
					    directory: "/"
 | 
				
			||||||
 | 
					    schedule:
 | 
				
			||||||
 | 
					      interval: "weekly"
 | 
				
			||||||
 | 
					      day: "monday"
 | 
				
			||||||
 | 
					      time: "05:00"
 | 
				
			||||||
 | 
					      timezone: "Europe/Vienna"
 | 
				
			||||||
 | 
					    labels:
 | 
				
			||||||
 | 
					      - "github actions"
 | 
				
			||||||
							
								
								
									
										13
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							@@ -4,7 +4,7 @@ on:
 | 
				
			|||||||
  push:
 | 
					  push:
 | 
				
			||||||
    branches:
 | 
					    branches:
 | 
				
			||||||
      - master
 | 
					      - master
 | 
				
			||||||
  pull_request:
 | 
					  pull_request_target:
 | 
				
			||||||
    types: [opened, synchronize, reopened]
 | 
					    types: [opened, synchronize, reopened]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
@@ -15,10 +15,13 @@ jobs:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        php-version: ['7.4', '8.0', '8.1']
 | 
					        php-version: ['7.4', '8.0', '8.1', '8.2']
 | 
				
			||||||
 | 
					        include:
 | 
				
			||||||
 | 
					          - php-version: '8.2'
 | 
				
			||||||
 | 
					            run-sonarqube-analysis: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - uses: actions/checkout@v2
 | 
					      - uses: actions/checkout@v3
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          fetch-depth: 0
 | 
					          fetch-depth: 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -41,7 +44,7 @@ jobs:
 | 
				
			|||||||
          echo "::set-output name=dir::$(composer config cache-files-dir)"
 | 
					          echo "::set-output name=dir::$(composer config cache-files-dir)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Cache Composer dependencies
 | 
					      - name: Cache Composer dependencies
 | 
				
			||||||
        uses: actions/cache@v2
 | 
					        uses: actions/cache@v3
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          path: ${{ steps.composer-cache.outputs.dir }}
 | 
					          path: ${{ steps.composer-cache.outputs.dir }}
 | 
				
			||||||
          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
 | 
					          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
 | 
				
			||||||
@@ -55,7 +58,7 @@ jobs:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      - name: Run SonarQube analysis
 | 
					      - name: Run SonarQube analysis
 | 
				
			||||||
        uses: sonarsource/sonarcloud-github-action@master
 | 
					        uses: sonarsource/sonarcloud-github-action@master
 | 
				
			||||||
        if: matrix.php-version == '8.1'
 | 
					        if: matrix.run-sonarqube-analysis
 | 
				
			||||||
        env:
 | 
					        env:
 | 
				
			||||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
					          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
				
			||||||
          SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
 | 
					          SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,52 +1,52 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "php-mqtt/laravel-client",
 | 
					    "name": "php-mqtt/laravel-client",
 | 
				
			||||||
  "description": "A wrapper for the php-mqtt/client library for Laravel.",
 | 
					    "description": "A wrapper for the php-mqtt/client library for Laravel.",
 | 
				
			||||||
  "type": "library",
 | 
					    "type": "library",
 | 
				
			||||||
  "keywords": [
 | 
					    "keywords": [
 | 
				
			||||||
    "mqtt",
 | 
					        "mqtt",
 | 
				
			||||||
    "client",
 | 
					        "client",
 | 
				
			||||||
    "publish",
 | 
					        "publish",
 | 
				
			||||||
    "subscribe",
 | 
					        "subscribe",
 | 
				
			||||||
    "laravel"
 | 
					        "laravel"
 | 
				
			||||||
  ],
 | 
					 | 
				
			||||||
  "homepage": "https://github.com/php-mqtt/laravel-client",
 | 
					 | 
				
			||||||
  "license": "MIT",
 | 
					 | 
				
			||||||
  "authors": [
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
      "name": "Marvin Mall",
 | 
					 | 
				
			||||||
      "email": "marvin-mall@msn.com",
 | 
					 | 
				
			||||||
      "role": "developer"
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  ],
 | 
					 | 
				
			||||||
  "require": {
 | 
					 | 
				
			||||||
    "php": "^7.4|^8.0",
 | 
					 | 
				
			||||||
    "illuminate/config": "~7.0|~8.0|~9.0",
 | 
					 | 
				
			||||||
    "illuminate/support": "~7.0|~8.0|~9.0",
 | 
					 | 
				
			||||||
    "php-mqtt/client": "^1.0"
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  "require-dev": {
 | 
					 | 
				
			||||||
    "squizlabs/php_codesniffer": "^3.5"
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  "autoload": {
 | 
					 | 
				
			||||||
    "psr-4": {
 | 
					 | 
				
			||||||
      "PhpMqtt\\Client\\": "src"
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  "extra": {
 | 
					 | 
				
			||||||
    "laravel": {
 | 
					 | 
				
			||||||
      "providers": [
 | 
					 | 
				
			||||||
        "PhpMqtt\\Client\\MqttClientServiceProvider"
 | 
					 | 
				
			||||||
      ],
 | 
					 | 
				
			||||||
      "aliases": {
 | 
					 | 
				
			||||||
        "MQTT": "PhpMqtt\\Client\\Facades\\MQTT"
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
  "scripts": {
 | 
					 | 
				
			||||||
    "fix:cs": "vendor/bin/phpcbf",
 | 
					 | 
				
			||||||
    "test": [
 | 
					 | 
				
			||||||
      "@test:cs"
 | 
					 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
    "test:cs": "vendor/bin/phpcs"
 | 
					    "homepage": "https://github.com/php-mqtt/laravel-client",
 | 
				
			||||||
  }
 | 
					    "license": "MIT",
 | 
				
			||||||
 | 
					    "authors": [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "name": "Marvin Mall",
 | 
				
			||||||
 | 
					            "email": "marvin-mall@msn.com",
 | 
				
			||||||
 | 
					            "role": "developer"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    "require": {
 | 
				
			||||||
 | 
					        "php": "^7.4|^8.0",
 | 
				
			||||||
 | 
					        "illuminate/config": "^7.0|^8.0|^9.0|^10.0",
 | 
				
			||||||
 | 
					        "illuminate/support": "^7.0|^8.0|^9.0|^10.0",
 | 
				
			||||||
 | 
					        "php-mqtt/client": "^1.0"
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    "require-dev": {
 | 
				
			||||||
 | 
					        "squizlabs/php_codesniffer": "^3.5"
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    "autoload": {
 | 
				
			||||||
 | 
					        "psr-4": {
 | 
				
			||||||
 | 
					            "PhpMqtt\\Client\\": "src"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    "extra": {
 | 
				
			||||||
 | 
					        "laravel": {
 | 
				
			||||||
 | 
					            "providers": [
 | 
				
			||||||
 | 
					                "PhpMqtt\\Client\\MqttClientServiceProvider"
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
 | 
					            "aliases": {
 | 
				
			||||||
 | 
					                "MQTT": "PhpMqtt\\Client\\Facades\\MQTT"
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    "scripts": {
 | 
				
			||||||
 | 
					        "fix:cs": "vendor/bin/phpcbf",
 | 
				
			||||||
 | 
					        "test": [
 | 
				
			||||||
 | 
					            "@test:cs"
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
 | 
					        "test:cs": "vendor/bin/phpcs"
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -101,6 +101,14 @@ return [
 | 
				
			|||||||
                // The interval (in seconds) in which the client will send a ping to the broker,
 | 
					                // The interval (in seconds) in which the client will send a ping to the broker,
 | 
				
			||||||
                // if no other message has been sent.
 | 
					                // if no other message has been sent.
 | 
				
			||||||
                'keep_alive_interval' => env('MQTT_KEEP_ALIVE_INTERVAL', 10),
 | 
					                'keep_alive_interval' => env('MQTT_KEEP_ALIVE_INTERVAL', 10),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                // Additional settings for the optional auto-reconnect. The delay between reconnect attempts is in seconds.
 | 
				
			||||||
 | 
					                'auto_reconnect' => [
 | 
				
			||||||
 | 
					                    'enabled' => env('MQTT_AUTO_RECONNECT_ENABLED', false),
 | 
				
			||||||
 | 
					                    'max_reconnect_attempts' => env('MQTT_AUTO_RECONNECT_MAX_RECONNECT_ATTEMPTS', 3),
 | 
				
			||||||
 | 
					                    'delay_between_reconnect_attempts' => env('MQTT_AUTO_RECONNECT_DELAY_BETWEEN_RECONNECT_ATTEMPTS', 0),
 | 
				
			||||||
 | 
					                ],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -177,6 +177,9 @@ class ConnectionManager
 | 
				
			|||||||
            ->setLastWillTopic(Arr::get($config, 'last_will.topic'))
 | 
					            ->setLastWillTopic(Arr::get($config, 'last_will.topic'))
 | 
				
			||||||
            ->setLastWillMessage(Arr::get($config, 'last_will.message'))
 | 
					            ->setLastWillMessage(Arr::get($config, 'last_will.message'))
 | 
				
			||||||
            ->setLastWillQualityOfService((int) Arr::get($config, 'last_will.quality_of_service', MqttClient::QOS_AT_MOST_ONCE))
 | 
					            ->setLastWillQualityOfService((int) Arr::get($config, 'last_will.quality_of_service', MqttClient::QOS_AT_MOST_ONCE))
 | 
				
			||||||
            ->setRetainLastWill((bool) Arr::get($config, 'last_will.retain', false));
 | 
					            ->setRetainLastWill((bool) Arr::get($config, 'last_will.retain', false))
 | 
				
			||||||
 | 
					            ->setReconnectAutomatically((bool) Arr::get($config, 'auto_reconnect.enabled', false))
 | 
				
			||||||
 | 
					            ->setMaxReconnectAttempts((int) Arr::get($config, 'auto_reconnect.max_reconnect_attempts', 3))
 | 
				
			||||||
 | 
					            ->setDelayBetweenReconnectAttempts((int) Arr::get($config, 'auto_reconnect.delay_between_reconnect_attempts', 0));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user