From ae92c9973aa72bac07a95a45830fec6da26ed574 Mon Sep 17 00:00:00 2001 From: Topher L Date: Fri, 7 Feb 2020 18:13:57 +0100 Subject: [PATCH 01/13] update composer --- composer.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 2536136..9f85217 100644 --- a/composer.json +++ b/composer.json @@ -1,24 +1,24 @@ { - "name": "solitweb/laravel-directadmin", - "description": "Laravel 5 DirectAdmin API wrapper", + "name": "syntaxevolution/laravel-directadmin", + "description": "Laravel 6 DirectAdmin API wrapper", "keywords": [ - "solitweb", + "syntaxevolution", "laravel", "directadmin" ], - "homepage": "https://github.com/solitweb/laravel-directadmin", + "homepage": "https://github.com/syntaxevolution/laravel-directadmin", "license": "MIT", "authors": [ { - "name": "Stijn Vanouplines", - "email": "stijn@solitweb.be", - "homepage": "https://solitweb.be", + "name": "Topher L.", + "email": "topher@syntaxevolution.com", + "homepage": "https://www.syntaxevolution.com", "role": "Developer" } ], "require": { - "php": "~5.6|~7.0|~7.1|~7.2", - "illuminate/support": "~5.1.0|~5.2.0|~5.3.0|~5.4.0|~5.5.0|~5.6.0|~5.8.0|~6.4.0|~6.6.0", + "php": "~7.1|~7.2|~7.3|~7.4", + "illuminate/support": "^6.0|^7.0", "solitweb/directadmin": "^3.0.1" }, "require-dev": { @@ -27,21 +27,21 @@ }, "autoload": { "psr-4": { - "Solitweb\\LaravelDirectAdmin\\": "src/" + "SyntaxEvolution\\LaravelDirectAdmin\\": "src/" } }, "autoload-dev": { "psr-4": { - "Solitweb\\LaravelDirectAdmin\\Test\\": "tests" + "SyntaxEvolution\\LaravelDirectAdmin\\Test\\": "tests" } }, "extra": { "laravel": { "providers": [ - "Solitweb\\LaravelDirectAdmin\\LaravelDirectAdminServiceProvider" + "SyntaxEvolution\\LaravelDirectAdmin\\LaravelDirectAdminServiceProvider" ], "aliases": { - "DirectAdmin": "Solitweb\\LaravelDirectAdmin\\LaravelDirectAdminFacade" + "DirectAdmin": "SyntaxEvolution\\LaravelDirectAdmin\\LaravelDirectAdminFacade" } } } From 80aa5da079c6b635a229b5579b94e2f89825c559 Mon Sep 17 00:00:00 2001 From: syntaxevolution <49597801+syntaxevolution@users.noreply.github.com> Date: Fri, 7 Feb 2020 18:22:31 +0100 Subject: [PATCH 02/13] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6aae83f..751a090 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Laravel 5 DirectAdmin API wrapper +# Laravel 6 DirectAdmin API wrapper [![Latest Version](https://img.shields.io/github/release/solitweb/laravel-directadmin.svg?style=flat-square)](https://github.com/laravel-solitweb/directadmin/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) [![Build Status](https://img.shields.io/travis/solitweb/laravel-directadmin/master.svg?style=flat-square)](https://travis-ci.org/solitweb/laravel-directadmin) @@ -9,12 +9,12 @@ You can install this package via Composer using: ```bash -composer require solitweb/laravel-directadmin +composer require syntaxevolution/laravel-directadmin ``` -Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider. +Laravel 6 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider. -## Laravel 5.5+: +## Laravel 6+: If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php @@ -32,14 +32,14 @@ Optionally, register the facade: // config/app.php 'aliases' => [ ... - 'DirectAdmin' => Solitweb\LaravelDirectAdmin\LaravelDirectAdminFacade::class, + 'DirectAdmin' => SyntaxEvolution\LaravelDirectAdmin\LaravelDirectAdminFacade::class, ]; ``` To publish the config file to app/config/laravel-directadmin.php run: ```bash -php artisan vendor:publish --provider="Solitweb\LaravelDirectAdmin\LaravelDirectAdminServiceProvider" +php artisan vendor:publish --provider="SyntaxEvolution\LaravelDirectAdmin\LaravelDirectAdminServiceProvider" ``` ## Usage From 08cb96b73cdf243f1d04fbe55f1f4d9cb0d95e38 Mon Sep 17 00:00:00 2001 From: Topher L Date: Fri, 7 Feb 2020 18:34:52 +0100 Subject: [PATCH 03/13] fix namespace (oops) --- src/LaravelDirectAdmin.php | 4 ++-- src/LaravelDirectAdminFacade.php | 2 +- src/LaravelDirectAdminServiceProvider.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/LaravelDirectAdmin.php b/src/LaravelDirectAdmin.php index c43bf36..80008db 100644 --- a/src/LaravelDirectAdmin.php +++ b/src/LaravelDirectAdmin.php @@ -1,8 +1,8 @@ Date: Fri, 7 Feb 2020 18:36:21 +0100 Subject: [PATCH 04/13] update travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3d59880..c64608b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: php php: - - 5.6 - - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 before_script: - composer self-update From a7b2301b1f29da963fd255bb7c218e7308f32340 Mon Sep 17 00:00:00 2001 From: syntaxevolution <49597801+syntaxevolution@users.noreply.github.com> Date: Fri, 7 Feb 2020 18:42:42 +0100 Subject: [PATCH 05/13] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 751a090..b109a61 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ If you don't use auto-discovery, add the ServiceProvider to the providers array // config/app.php 'providers' => [ ... - Solitweb\LaravelDirectAdmin\LaravelDirectAdminServiceProvider::class, + SyntaxEvolution\LaravelDirectAdmin\LaravelDirectAdminServiceProvider::class, ]; ``` From ed55089e50a15a324beb28469dac2bc77a46f96f Mon Sep 17 00:00:00 2001 From: syntaxevolution <49597801+syntaxevolution@users.noreply.github.com> Date: Fri, 7 Feb 2020 18:45:16 +0100 Subject: [PATCH 06/13] Update LICENSE.md --- LICENSE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 15e287c..a243cc7 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # MIT License -Copyright (c) 2016 solitweb.be +Copyright (c) 2016 syntaxevolution.com >Permission is hereby granted, free of charge, to any person obtaining a copy >of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ Copyright (c) 2016 solitweb.be >AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER >LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, >OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ->SOFTWARE. \ No newline at end of file +>SOFTWARE. From 430b52c653d3d4255a09f42a1280942bdd269f5d Mon Sep 17 00:00:00 2001 From: Topher L Date: Fri, 7 Feb 2020 19:16:25 +0100 Subject: [PATCH 07/13] fix bad use case (not converting the DirectAdmin class) --- src/LaravelDirectAdmin.php | 2 +- src/LaravelDirectAdminServiceProvider.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LaravelDirectAdmin.php b/src/LaravelDirectAdmin.php index 80008db..da61f9c 100644 --- a/src/LaravelDirectAdmin.php +++ b/src/LaravelDirectAdmin.php @@ -2,7 +2,7 @@ namespace SyntaxEvolution\LaravelDirectAdmin; -use SyntaxEvolution\DirectAdmin\DirectAdmin; +use Solitweb\DirectAdmin\DirectAdmin; class LaravelDirectAdmin { diff --git a/src/LaravelDirectAdminServiceProvider.php b/src/LaravelDirectAdminServiceProvider.php index 857d7fa..a2edca9 100644 --- a/src/LaravelDirectAdminServiceProvider.php +++ b/src/LaravelDirectAdminServiceProvider.php @@ -2,7 +2,7 @@ namespace SyntaxEvolution\LaravelDirectAdmin; -use SyntaxEvolution\DirectAdmin\DirectAdmin as DAConnection; +use Solitweb\DirectAdmin\DirectAdmin as DAConnection; use Illuminate\Support\ServiceProvider; class LaravelDirectAdminServiceProvider extends ServiceProvider From a128b39106625374e31547b563c653f1f2d6fdf3 Mon Sep 17 00:00:00 2001 From: Topher L Date: Fri, 7 Feb 2020 21:26:23 +0100 Subject: [PATCH 08/13] ignore camelcase if $string is SSL --- src/LaravelDirectAdmin.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/LaravelDirectAdmin.php b/src/LaravelDirectAdmin.php index da61f9c..057353d 100644 --- a/src/LaravelDirectAdmin.php +++ b/src/LaravelDirectAdmin.php @@ -111,12 +111,17 @@ private function extractCommand($method, $command, $arguments) */ private function camelToSnake($string) { - preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $string, $matches); - $ret = $matches[0]; - foreach ($ret as &$match) { - $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match); + if($string == "SSL"){ + return "SSL"; + }else { + preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $string, $matches); + $ret = $matches[0]; + foreach ($ret as &$match) { + $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match); + } + + return strtoupper(implode('_', $ret)); } - return strtoupper(implode('_', $ret)); } } \ No newline at end of file From 781dc5f53c511b031395772c4d36b07613ead51a Mon Sep 17 00:00:00 2001 From: Topher L Date: Fri, 7 Feb 2020 21:36:51 +0100 Subject: [PATCH 09/13] debug --- src/LaravelDirectAdmin.php | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/LaravelDirectAdmin.php b/src/LaravelDirectAdmin.php index 057353d..fe36e8e 100644 --- a/src/LaravelDirectAdmin.php +++ b/src/LaravelDirectAdmin.php @@ -97,10 +97,18 @@ private function extractCommand($method, $command, $arguments) { $this->connection->set_method(strtoupper($method)); - return $this->request( - $this->camelToSnake($command), - $arguments - ); + dd($command); + if($command == "SSL"){ + return $this->request( + "SSL", + $arguments + ); + }else { + return $this->request( + $this->camelToSnake($command), + $arguments + ); + } } /** @@ -111,17 +119,12 @@ private function extractCommand($method, $command, $arguments) */ private function camelToSnake($string) { - if($string == "SSL"){ - return "SSL"; - }else { - preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $string, $matches); - $ret = $matches[0]; - foreach ($ret as &$match) { - $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match); - } - - return strtoupper(implode('_', $ret)); + preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $string, $matches); + $ret = $matches[0]; + foreach ($ret as &$match) { + $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match); } + return strtoupper(implode('_', $ret)); } } \ No newline at end of file From 214ad23f114ff96cd61fb5bd0c34adc49cd98208 Mon Sep 17 00:00:00 2001 From: Topher L Date: Fri, 7 Feb 2020 21:46:26 +0100 Subject: [PATCH 10/13] fix problem with SSL API call --- src/LaravelDirectAdmin.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/LaravelDirectAdmin.php b/src/LaravelDirectAdmin.php index fe36e8e..1708833 100644 --- a/src/LaravelDirectAdmin.php +++ b/src/LaravelDirectAdmin.php @@ -96,8 +96,7 @@ private function extractMethod($methodName, $arguments) private function extractCommand($method, $command, $arguments) { $this->connection->set_method(strtoupper($method)); - - dd($command); + if($command == "SSL"){ return $this->request( "SSL", From 707950e67b610802faffee2f85f67bc1f453f85e Mon Sep 17 00:00:00 2001 From: Topher L Date: Fri, 7 Feb 2020 21:46:52 +0100 Subject: [PATCH 11/13] fix problem with SSL API call --- src/LaravelDirectAdmin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LaravelDirectAdmin.php b/src/LaravelDirectAdmin.php index 1708833..6e2a59f 100644 --- a/src/LaravelDirectAdmin.php +++ b/src/LaravelDirectAdmin.php @@ -96,13 +96,13 @@ private function extractMethod($methodName, $arguments) private function extractCommand($method, $command, $arguments) { $this->connection->set_method(strtoupper($method)); - + if($command == "SSL"){ return $this->request( "SSL", $arguments ); - }else { + }else{ return $this->request( $this->camelToSnake($command), $arguments From 41f98bf60f5e370c7afd437049dfaac81e966fbd Mon Sep 17 00:00:00 2001 From: syntaxevolution <49597801+syntaxevolution@users.noreply.github.com> Date: Wed, 12 Feb 2020 21:59:20 +0100 Subject: [PATCH 12/13] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b109a61..766ac31 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Laravel 6 DirectAdmin API wrapper -[![Latest Version](https://img.shields.io/github/release/solitweb/laravel-directadmin.svg?style=flat-square)](https://github.com/laravel-solitweb/directadmin/releases) +[![Latest Version](https://img.shields.io/github/release/syntaxevolution/laravel-directadmin.svg?style=flat-square)](https://github.com/syntaxevolution/directadmin/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) -[![Build Status](https://img.shields.io/travis/solitweb/laravel-directadmin/master.svg?style=flat-square)](https://travis-ci.org/solitweb/laravel-directadmin) -[![Total Downloads](https://img.shields.io/packagist/dt/solitweb/laravel-directadmin.svg?style=flat-square)](https://packagist.org/packages/solitweb/laravel-directadmin) +[![Build Status](https://img.shields.io/travis/syntaxevolution/laravel-directadmin/master.svg?style=flat-square)](https://travis-ci.org/solitweb/laravel-directadmin) +[![Total Downloads](https://img.shields.io/packagist/dt/syntaxevolution/laravel-directadmin.svg?style=flat-square)](https://packagist.org/packages/syntaxevolution/laravel-directadmin) ## Installation From ba267d49b45173a70f9699e8dbde9fa6deadb02d Mon Sep 17 00:00:00 2001 From: syntaxevolution <49597801+syntaxevolution@users.noreply.github.com> Date: Sun, 20 Dec 2020 22:16:38 +0100 Subject: [PATCH 13/13] Update composer.json --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 9f85217..fb874bf 100644 --- a/composer.json +++ b/composer.json @@ -17,13 +17,13 @@ } ], "require": { - "php": "~7.1|~7.2|~7.3|~7.4", - "illuminate/support": "^6.0|^7.0", - "solitweb/directadmin": "^3.0.1" + "php": ">=7.4", + "illuminate/support": ">=7.0", + "solitweb/directadmin": ">=3.0.1" }, "require-dev": { - "phpunit/phpunit": "^4.8", - "mockery/mockery": "^0.9.4" + "phpunit/phpunit": ">=4.8", + "mockery/mockery": ">=0.9.4" }, "autoload": { "psr-4": {