Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["env"]
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
!.git*
!*.yml
_ide_helper.php
composer.lock
old
46 changes: 10 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,17 @@ language: php
matrix:
fast_finish: true
include:
- php: '7'
env:
- PHP_VERSION=7
- env:
- DB_CONNECTION=mysql
- DB_HOST=mariadb
- DB_USERNAME=root
- php: '7'
env:
- PHP_VERSION=7
- env:
- DB_CONNECTION=pgsql
- DB_HOST=postgres
- DB_USERNAME=postgres
- php: '5.6'
env:
- PHP_VERSION=5
- DB_CONNECTION=mysql
- DB_HOST=mariadb
- DB_USERNAME=root
- php: '5.6'
env:
- PHP_VERSION=5
- DB_CONNECTION=pgsql
- DB_HOST=postgres
- DB_USERNAME=postgres

cache:
directories:
- ./node_modules
- ./vendor

before_install:
- curl -L https://github.com/docker/compose/releases/download/1.8.1/docker-compose-`uname -s`-`uname -m` > docker-compose; chmod +x docker-compose; true
- curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > docker-compose; chmod +x docker-compose; true
- sudo mv docker-compose /usr/local/bin/
- pwd && docker -v && docker info && docker-compose -v

Expand All @@ -56,19 +35,14 @@ install:
# - echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH"

- if [[ $TRAVIS_TAG == 'docker-build' ]]; then docker build -qf storage/build/scripts/nginx/Dockerfile -t audithsoftworks/basis:nginx .; else docker pull audithsoftworks/basis:nginx; fi;
- if [[ $TRAVIS_TAG == 'docker-build' && $PHP_VERSION == '5' ]]; then docker build -qf storage/build/scripts/php_5.6/Dockerfile -t audithsoftworks/basis:php_5.6 .; fi;
if [[ $TRAVIS_TAG == 'docker-build' && $PHP_VERSION == '7' ]]; then docker build -qf storage/build/scripts/php_7/Dockerfile -t audithsoftworks/basis:php_7 .; fi;
- if [[ $TRAVIS_TAG == 'docker-build' && $PHP_VERSION == '5' ]]; then docker build -qf storage/build/scripts/php_5.6-fpm/Dockerfile -t audithsoftworks/basis:php_5.6-fpm .; fi;
if [[ $TRAVIS_TAG == 'docker-build' && $PHP_VERSION == '7' ]]; then docker build -qf storage/build/scripts/php_7-fpm/Dockerfile -t audithsoftworks/basis:php_7-fpm .; fi;
- if [[ $TRAVIS_TAG != 'docker-build' && $PHP_VERSION == '5' ]]; then docker pull audithsoftworks/basis:php_5.6; fi;
if [[ $TRAVIS_TAG != 'docker-build' && $PHP_VERSION == '7' ]]; then docker pull audithsoftworks/basis:php_7; fi;
- if [[ $TRAVIS_TAG != 'docker-build' && $PHP_VERSION == '5' ]]; then docker pull audithsoftworks/basis:php_5.6-fpm; fi;
if [[ $TRAVIS_TAG != 'docker-build' && $PHP_VERSION == '7' ]]; then docker pull audithsoftworks/basis:php_7-fpm; fi;
- docker-compose up -d php${PHP_VERSION}-cli;
- if [[ $TRAVIS_TAG == 'docker-build' ]]; then docker build -qf storage/build/scripts/php/Dockerfile -t audithsoftworks/basis:php .; fi;
- if [[ $TRAVIS_TAG == 'docker-build' ]]; then docker build -qf storage/build/scripts/php-fpm/Dockerfile -t audithsoftworks/basis:php-fpm .; fi;
- if [[ $TRAVIS_TAG != 'docker-build' ]]; then docker pull audithsoftworks/basis:php; fi;
- if [[ $TRAVIS_TAG != 'docker-build' ]]; then docker pull audithsoftworks/basis:php-fpm; fi;
- docker-compose up -d;
- docker images;
- docker-compose ps;
- echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' basis_nginxForPhp${PHP_VERSION}_1) basis.audith.org | sudo tee -a /etc/hosts;
- docker exec basis_php${PHP_VERSION}-cli_1 /bin/bash -c "echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' basis_nginxForPhp${PHP_VERSION}_1) basis.audith.org | sudo tee -a /etc/hosts";
- echo $(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx) basis.audith.org | sudo tee -a /etc/hosts;

before_script:
- chmod +x ./storage/build/scripts/ci/build.sh;
Expand All @@ -77,7 +51,7 @@ script:
- ./storage/build/scripts/ci/build.sh;

after_script:
- docker exec basis_php${PHP_VERSION}-cli_1 /bin/bash -c "pkill sc";
- docker exec dev-env /bin/bash -c "pkill sc";
- if [[ $PHP_VERSION == 7 && $DB_CONNECTION == 'mysql' ]]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover ./storage/coverage/coverage-clover-merged.xml; fi

notifications:
Expand Down
7 changes: 5 additions & 2 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public function showLoginForm()
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
* @throws \App\Exceptions\Common\ValidationException
* @throws ValidationException
* @throws \Illuminate\Validation\ValidationException
*/
public function loginViaWeb(Request $request)
{
Expand Down Expand Up @@ -193,7 +194,9 @@ protected function registerViaOAuth(SocialiteUser $oauthUserData, $provider)
$ownerAccount->save();
}

($doLinkOAuthAccount = $this->linkOAuthAccount($oauthUserData, $provider, $ownerAccount)) && app('auth.driver')->login($ownerAccount, true);
if ($doLinkOAuthAccount = $this->linkOAuthAccount($oauthUserData, $provider, $ownerAccount)) {
app('auth.driver')->login($ownerAccount, true);
}

event(new LoggedIn($ownerAccount, $provider));

Expand Down
3 changes: 2 additions & 1 deletion app/Services/Routing/LocalizedRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ public function resource($name, $controller, array $options = [])
* @param string $locale
*
* @return string
* @throws \Illuminate\Container\EntryNotFoundException
*/
private function localizeUris($uri, $locale)
{
$uriExploded = explode('/', trim($uri, '/'));
$localizedUriTranslationBitParts = [];
while (list($level, $bitName) = each($uriExploded)) {
foreach ($uriExploded as $level => $bitName) {
if ($level == 0) {
$localizedUriTranslationBitParts[$level] = 'routes.' . $bitName . '.';
} else {
Expand Down
34 changes: 23 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
}
],
"require": {
"php": ">=5.6.14",
"php": ">=7.0.0",
"ext-curl": "*",
"ext-mbstring": "*",
"ext-mcrypt": "*",
"ext-openssl": "*",
"barryvdh/laravel-ide-helper": "^2.2",
"laravel/dusk": "^1.0.5",
"laravel/framework": "5.4.*",
"laravel/passport": "^2.0",
"barryvdh/laravel-ide-helper": "^2.4",
"fideloper/proxy": "~3.3",
"laravel/dusk": "^2.0.0",
"laravel/framework": "5.5.*",
"laravel/passport": "~4.0",
"laravel/socialite": "^3.0",
"laravel/tinker": "~1.0",
"predis/predis": "~1",
Expand All @@ -37,18 +38,19 @@
"require-dev": {
"ext-dom": "*",
"doctrine/dbal": "~2.5",
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.5",
"mockery/mockery": "0.9.*",
"phpspec/phpspec": "~3.0",
"phpunit/phpcov": "^3.1",
"phpunit/phpunit": "~5.7",
"mockery/mockery": "~1.0",
"phpunit/phpcov": "^4.0",
"phpunit/phpunit": "~6.0",
"sauce/sausage": ">=0.17",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*"
},
"autoload": {
"classmap": [
"database"
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
Expand All @@ -59,6 +61,11 @@
"App\\Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
Expand All @@ -73,11 +80,16 @@
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "stable",
"prefer-stable": true
Expand Down
Loading