Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x authored Jan 4, 2024
2 parents 7fe6c76 + 5b188ce commit 3edfca3
Show file tree
Hide file tree
Showing 252 changed files with 2,739 additions and 3,089 deletions.
2 changes: 0 additions & 2 deletions .devcontainer/config/app/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,3 @@ AUTH_SALT='generateme'
SECURE_AUTH_SALT='generateme'
LOGGED_IN_SALT='generateme'
NONCE_SALT='generateme'

ACORN_ENABLE_EXPERIMENTAL_ROUTER='true'
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/.github export-ignore
/.gitattributes export-ignore
/scripts export-ignore
*.css linguist-detectable=false
/src/Illuminate/Foundation/** linguist-vendored
/tests/Assets/__fixtures__/** -linguist-detectable
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
php: ['8.0', '8.1', '8.2']
php: ['8.1', '8.2']

steps:
- name: Checkout the project
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Acorn is a framework for integrating Laravel within WordPress.
| illuminate/filesystem | 🟢 | |
| illuminate/http | 🟢 | |
| illuminate/log | 🟢 | |
| illuminate/routing | 🟡 | Requires `ACORN_ENABLE_EXPERIMENTAL_ROUTER` env var |
| illuminate/routing | 🟢 | |
| illuminate/support | 🟢 | |
| illuminate/view | 🟢 | |

Expand Down
19 changes: 11 additions & 8 deletions bin/acorn
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@
<?php

(static function () {
if (! is_file($autoload_path = dirname(__DIR__, 4) . '/vendor/autoload.php')) {
$autoload_path = dirname(__DIR__) . '/vendor/autoload.php';
if (! is_file($autoloadPath = dirname(__DIR__, 4) . '/vendor/autoload.php')) {
$autoloadPath = dirname(__DIR__) . '/vendor/autoload.php';
}

if (filter_input(INPUT_ENV, 'APPLICATION_PATH')) {
$autoload_path = filter_input(INPUT_ENV, 'APPLICATION_PATH') . '/vendor/autoload.php';
$autoloadPath = filter_input(INPUT_ENV, 'APPLICATION_PATH') . '/vendor/autoload.php';
}
require_once $autoload_path;

$composer_path = (new Roots\Acorn\Filesystem\Filesystem)->closest(dirname($autoload_path, 2), 'composer.json');
require_once $autoloadPath;

$composerPath = (new Roots\Acorn\Filesystem\Filesystem)->closest(dirname($autoloadPath, 2), 'composer.json');

$root_path = dirname($composer_path);
$rootPath = dirname($composerPath);

$composer = json_decode(file_get_contents($composer_path), true);
$composer = json_decode(file_get_contents($composerPath), true);

define('WP_USE_THEMES', false);
require_once "{$root_path}/{$composer['extra']['wordpress-install-dir']}/wp-blog-header.php";

require_once "{$rootPath}/{$composer['extra']['wordpress-install-dir']}/wp-blog-header.php";

Roots\Acorn\Bootloader::getInstance()->boot();
})();
53 changes: 27 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,39 +40,40 @@
}
},
"require": {
"php": "^8.0",
"php": ">=8.1",
"ext-json": "*",
"ext-mbstring": "*",
"illuminate/cache": "^9.52",
"illuminate/config": "^9.52",
"illuminate/console": "^9.52",
"illuminate/container": "^9.52",
"illuminate/contracts": "^9.52",
"illuminate/database": "^9.52",
"illuminate/events": "^9.52",
"illuminate/filesystem": "^9.52",
"illuminate/http": "^9.52",
"illuminate/log": "^9.52",
"illuminate/routing": "^9.52",
"illuminate/support": "^9.52",
"illuminate/view": "^9.52",
"league/flysystem": "^3.0",
"ramsey/uuid": "^4.2.2",
"illuminate/cache": "^10.33",
"illuminate/config": "^10.33",
"illuminate/console": "^10.33",
"illuminate/container": "^10.33",
"illuminate/contracts": "^10.33",
"illuminate/database": "^10.33",
"illuminate/events": "^10.33",
"illuminate/filesystem": "^10.33",
"illuminate/http": "^10.33",
"illuminate/log": "^10.33",
"illuminate/routing": "^10.33",
"illuminate/support": "^10.33",
"illuminate/view": "^10.33",
"laravel/prompts": "^0.1.7",
"laravel/serializable-closure": "^1.3",
"league/flysystem": "^3.8",
"ramsey/uuid": "^4.7",
"roots/support": "^1.0",
"symfony/error-handler": "^6.0",
"symfony/var-dumper": "^6.0",
"symfony/error-handler": "^6.2",
"symfony/var-dumper": "^6.2",
"vlucas/phpdotenv": "^5.4.1"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"pestphp/pest": "^1.0",
"pestphp/pest-plugin-mock": "^1.0",
"laravel/pint": "^1.13",
"mockery/mockery": "^1.6",
"pestphp/pest": "^2.25",
"phpcompatibility/php-compatibility": "^9.3",
"roave/security-advisories": "dev-master",
"spatie/laravel-ignition": "^1.6",
"spatie/pest-plugin-snapshots": "^1.0",
"spatie/laravel-ignition": "^2.1",
"spatie/pest-plugin-snapshots": "^2.1",
"spatie/temporary-directory": "^2.0",
"squizlabs/php_codesniffer": "^3.5",
"tmarsteel/mockery-callable-mock": "^2.1",
"wp-cli/wp-cli": "^2.5"
},
Expand All @@ -89,8 +90,8 @@
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"lint": "phpcs",
"lint:fix": "phpcbf",
"lint": "pint --test",
"lint:fix": "pint",
"test": "pest",
"coverage": "XDEBUG_MODE=coverage pest --coverage --coverage-html=coverage"
}
Expand Down
45 changes: 8 additions & 37 deletions config/app.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Support\Facades\Facade;
use Roots\Acorn\ServiceProvider;

use function Roots\env;

Expand Down Expand Up @@ -58,6 +59,8 @@

'url' => env('APP_URL', home_url()),

'asset_url' => env('ASSET_URL'),

/*
|--------------------------------------------------------------------------
| Application Timezone
Expand All @@ -69,7 +72,7 @@
|
*/

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

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -140,7 +143,7 @@

'maintenance' => [
'driver' => 'file',
// 'store' => 'redis',
// 'store' => 'redis',
],

/*
Expand All @@ -154,38 +157,7 @@
|
*/

'providers' => [

/*
* Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Database\MigrationServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Foundation\Providers\ComposerServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Routing\RoutingServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Roots\Acorn\Assets\AssetsServiceProvider::class,
Roots\Acorn\Filesystem\FilesystemServiceProvider::class,
Roots\Acorn\Providers\AcornServiceProvider::class,
Roots\Acorn\Providers\RouteServiceProvider::class,
Roots\Acorn\View\ViewServiceProvider::class,

'providers' => ServiceProvider::defaultProviders()->merge([
/*
* Package Service Providers...
*/
Expand All @@ -194,8 +166,7 @@
* Application Service Providers...
*/
// App\Providers\ThemeServiceProvider::class,

],
])->toArray(),

/*
|--------------------------------------------------------------------------
Expand All @@ -209,7 +180,7 @@
*/

'aliases' => Facade::defaultAliases()->merge([
// 'ExampleClass' => App\Example\ExampleClass::class,
// 'Example' => App\Facades\Example::class,
])->toArray(),

];
4 changes: 2 additions & 2 deletions config/assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
'url' => get_theme_file_uri('public'),
'assets' => get_theme_file_path('public/manifest.json'),
'bundles' => get_theme_file_path('public/entrypoints.json'),
]
]
],
],
];
8 changes: 6 additions & 2 deletions config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,20 @@
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
| The throttle setting is the number of seconds a user must wait before
| generating more password reset tokens. This prevents the user from
| quickly generating a very large amount of password reset tokens.
|
*/

'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'table' => 'password_reset_tokens',
'expire' => 60,
'throttle' => 60,
],
Expand Down
1 change: 1 addition & 0 deletions config/broadcasting.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
Expand Down
1 change: 1 addition & 0 deletions config/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
'lock_path' => storage_path('framework/cache/data'),
],

'memcached' => [
Expand Down
22 changes: 11 additions & 11 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@
],

'wordpress' => [
'driver' => 'mysql',
'host' => DB_HOST,
'database' => DB_NAME,
'username' => DB_USER,
'password' => DB_PASSWORD,
'unix_socket' => env('DB_SOCKET', ''),
'charset' => DB_CHARSET,
'collation' => $GLOBALS['wpdb']->collate,
'prefix' => $GLOBALS['wpdb']->prefix,
'driver' => 'mysql',
'host' => DB_HOST,
'database' => DB_NAME,
'username' => DB_USER,
'password' => DB_PASSWORD,
'unix_socket' => env('DB_SOCKET', ''),
'charset' => DB_CHARSET,
'collation' => $GLOBALS['wpdb']->collate,
'prefix' => $GLOBALS['wpdb']->prefix,
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
Expand Down
4 changes: 3 additions & 1 deletion config/hashing.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
*/

'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
'rounds' => env('BCRYPT_ROUNDS', 12),
'verify' => true,
],

/*
Expand All @@ -47,6 +48,7 @@
'memory' => 65536,
'threads' => 1,
'time' => 4,
'verify' => true,
],

];
9 changes: 9 additions & 0 deletions config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;

return [

Expand Down Expand Up @@ -61,13 +62,15 @@
'driver' => 'single',
'path' => storage_path('logs/application.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],

'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/application.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 14,
'replace_placeholders' => true,
],

'slack' => [
Expand All @@ -76,6 +79,7 @@
'username' => 'Application Log',
'emoji' => ':boom:',
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],

'papertrail' => [
Expand All @@ -87,6 +91,7 @@
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],

'stderr' => [
Expand All @@ -97,16 +102,20 @@
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],

'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => LOG_USER,
'replace_placeholders' => true,
],

'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],

'null' => [
Expand Down
Loading

0 comments on commit 3edfca3

Please sign in to comment.