Skip to content

Commit

Permalink
Acorn 2.x (Laravel 8.x) (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
QWp6t committed Feb 3, 2021
2 parents a82596c + 8079f84 commit 1667d78
Show file tree
Hide file tree
Showing 131 changed files with 5,728 additions and 3,177 deletions.
46 changes: 0 additions & 46 deletions .circleci/config.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitattributes
@@ -1,2 +1,2 @@
/.circleci export-ignore
/.github export-ignore
/.gitattributes export-ignore
49 changes: 49 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,49 @@
name: Main

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
php:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
php: ["7.3", "7.4", "8.0"]

steps:
- name: Checkout the project
uses: actions/checkout@v2

- name: Setup the PHP ${{ matrix.php }} environment on ${{ runner.os }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Restore the Composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest

- name: Execute the Composer lint script
run: composer run-script lint

- name: Execute the Composer test script
run: composer run-script lint
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -4,4 +4,3 @@ phpunit.xml
/composer.lock
/coverage
/vendor
/.idea
12 changes: 6 additions & 6 deletions README.md
@@ -1,7 +1,7 @@
# [Acorn](https://roots.io/acorn/)

[![Packagist](https://img.shields.io/packagist/vpre/roots/acorn.svg?style=flat-square)](https://packagist.org/packages/roots/acorn)
[![Build Status](https://img.shields.io/circleci/build/gh/roots/acorn?style=flat-square)](https://circleci.com/gh/roots/acorn)
![Build Status](https://img.shields.io/github/workflow/status/roots/acorn/Main)
[![Follow Roots](https://img.shields.io/twitter/follow/rootswp.svg?style=flat-square&color=1da1f2)](https://twitter.com/rootswp)

Acorn is a lazy-loaded framework for building WordPress plugins.
Expand All @@ -14,8 +14,8 @@ Contributions are welcome from everyone. We have [contributing guidelines](https

Keep track of development and community news.

* Participate on the [Roots Discourse](https://discourse.roots.io/)
* Follow [@rootswp on Twitter](https://twitter.com/rootswp)
* Read and subscribe to the [Roots Blog](https://roots.io/blog/)
* Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)
* Listen to the [Roots Radio podcast](https://roots.io/podcast/)
- Participate on the [Roots Discourse](https://discourse.roots.io/)
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
- Read and subscribe to the [Roots Blog](https://roots.io/blog/)
- Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)
- Listen to the [Roots Radio podcast](https://roots.io/podcast/)
2 changes: 1 addition & 1 deletion acorn.php
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Acorn
* Plugin URI: https://roots.io/acorn
* Description: Lazy-loaded framework for WordPress themes and plugins
* Version: 1.0.0
* Version: 2.0.0
* Author: Roots
* Author URI: https://roots.io
* License: MIT
Expand Down
2 changes: 2 additions & 0 deletions bootstrap/cache/.gitignore
@@ -0,0 +1,2 @@
*
!.gitignore
62 changes: 30 additions & 32 deletions composer.json
@@ -1,7 +1,7 @@
{
"name": "roots/acorn",
"license": "MIT",
"description": "Lazy-loaded framework for Roots WordPress projects.",
"description": "Framework for Roots WordPress projects built with Laravel components.",
"homepage": "https://roots.io/acorn/",
"authors": [
{
Expand All @@ -23,7 +23,8 @@
},
"autoload": {
"psr-4": {
"Roots\\": "src/"
"Roots\\": "src/Roots/",
"Illuminate\\": "src/Illuminate/"
},
"files": [
"src/helpers.php"
Expand All @@ -35,51 +36,48 @@
}
},
"require": {
"php": "^7.2.5",
"php": "^7.3|^8.0",
"ext-json": "*",
"illuminate/cache": "^7.0",
"illuminate/config": "^7.0",
"illuminate/console": "^7.0",
"illuminate/container": "^7.0",
"illuminate/contracts": "^7.0",
"illuminate/events": "^7.0",
"illuminate/filesystem": "^7.0",
"illuminate/http": "^7.12",
"illuminate/log": "^7.0",
"illuminate/support": "^7.0",
"illuminate/view": "^7.0",
"ext-mbstring": "*",
"illuminate/cache": "^8.0",
"illuminate/config": "^8.0",
"illuminate/console": "^8.0",
"illuminate/container": "^8.0",
"illuminate/contracts": "^8.0",
"illuminate/events": "^8.0",
"illuminate/filesystem": "^8.0",
"illuminate/http": "^8.0",
"illuminate/log": "^8.0",
"illuminate/support": "^8.0",
"illuminate/view": "^8.0",
"league/flysystem": "^1.0",
"ramsey/uuid": "^3.7|^4.0",
"roots/support": "dev-master",
"symfony/error-handler": "^5.0",
"symfony/var-dumper": "^5.0"
"ramsey/uuid": "^4.1",
"roots/support": "^1.0",
"symfony/error-handler": "^5.2",
"symfony/var-dumper": "^5.2",
"vlucas/phpdotenv": "^5.2"
},
"require-dev": {
"filp/whoops": "^2.7",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"filp/whoops": "^2.9",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "^8.5",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^8.5.8|^9.3.3",
"roave/security-advisories": "dev-master",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
"filp/whoops": "Required for friendly error pages in development (^2.0)."
"filp/whoops": "Required for friendly error pages in development (^2.9)."
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"lint": [
"phpcs --ignore=vendor,tests --extensions=php --standard=PSR12 ."
],
"test": [
"phpunit"
],
"coverage": [
"phpunit --coverage-html coverage"
]
"lint": "phpcs",
"lint:fix": "phpcbf",
"test": "phpunit",
"coverage": "phpunit --coverage-html coverage"
}
}
43 changes: 23 additions & 20 deletions config/app.php
Expand Up @@ -15,7 +15,7 @@
|
*/

'name' => env('APP_NAME', get_bloginfo('name')),
'name' => env('APP_NAME', 'Acorn'),

/*
|--------------------------------------------------------------------------
Expand All @@ -24,7 +24,7 @@
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services your application utilizes. Set this in your ".env" file.
| services the application utilizes. Set this in your ".env" file.
|
*/

Expand Down Expand Up @@ -56,19 +56,6 @@

'timezone' => get_option('timezone_string', 'UTC'),

/*
|--------------------------------------------------------------------------
| Preflight Checks
|--------------------------------------------------------------------------
|
| This value allows service providers to execute preflight tasks after
| booting. These tasks include creating directories, databases, and files,
| or doing any other checks to ensure the service is functional.
|
*/

'preflight' => env('WP_ENV', 'production') !== 'production',

/*
|--------------------------------------------------------------------------
| Global Helpers
Expand Down Expand Up @@ -108,6 +95,21 @@

'fallback_locale' => 'en',

/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/

'key' => env('APP_KEY'),

'cipher' => 'AES-256-CBC',

/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
Expand All @@ -120,15 +122,15 @@
*/

'providers' => [
/**
* Package Service Providers
/*
* Package Service Providers...
*/
// ExamplePackage\Providers\ExamplePackageServiceProvider::class,

/**
* Application Service Providers
/*
* Application Service Providers...
*/
// App\Providers\AppServiceProvider::class,
// App\Providers\ThemeServiceProvider::class,
],

/*
Expand Down Expand Up @@ -180,4 +182,5 @@
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],

];
6 changes: 3 additions & 3 deletions config/assets.php
Expand Up @@ -34,9 +34,9 @@
'manifests' => [
'theme' => [
'strategy' => 'relative',
'path' => get_theme_file_path('/dist'),
'uri' => get_theme_file_uri('/dist'),
'manifest' => get_theme_file_path('/dist/mix-manifest.json'),
'path' => get_theme_file_path('/public'),
'uri' => get_theme_file_uri('/public'),
'manifest' => get_theme_file_path('/public/mix-manifest.json'),
]
]
];
11 changes: 7 additions & 4 deletions config/cache.php
Expand Up @@ -16,9 +16,6 @@
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb"
|
*/

'default' => env('CACHE_DRIVER', 'file'),
Expand All @@ -32,6 +29,9 @@
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
| Supported drivers: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "null"
|
*/

'stores' => [
Expand All @@ -49,6 +49,7 @@
'driver' => 'database',
'table' => 'cache',
'connection' => null,
'lock_connection' => null,
],

'file' => [
Expand Down Expand Up @@ -78,6 +79,7 @@
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
'lock_connection' => 'default',
],

'dynamodb' => [
Expand All @@ -88,6 +90,7 @@
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],

],

/*
Expand All @@ -101,6 +104,6 @@
|
*/

'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', wp_get_theme()->get('Name')), '_') . '_cache'),
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'acorn'), '_').'_cache'),

];
2 changes: 1 addition & 1 deletion config/database.php
Expand Up @@ -123,7 +123,7 @@

'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'app'), '_') . '_database_'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'acorn'), '_') . '_database_'),
],

'default' => [
Expand Down

0 comments on commit 1667d78

Please sign in to comment.