Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
27efeb5
Kind of working
MouseEatsCat Jul 24, 2025
6f60f43
Functional errors
MouseEatsCat Jul 25, 2025
5a01b80
Basic functioning admin
MouseEatsCat Jul 30, 2025
ff1059c
Patch usage of getParams + getParam
MouseEatsCat Jul 30, 2025
3b60d6f
Support php 8.4
MouseEatsCat Jul 30, 2025
72b966f
fix deprecation warnings
MouseEatsCat Jul 31, 2025
203a6da
Fix csv translations with blank rows
MouseEatsCat Jul 31, 2025
cd4acec
Fix view services
MouseEatsCat Aug 5, 2025
1ff298a
Tests - Fix container usages
MouseEatsCat Aug 5, 2025
b6fb75c
Fix container usage within admin
MouseEatsCat Aug 5, 2025
0719156
Various admin fixes
MouseEatsCat Aug 5, 2025
87233e5
Fix elfinder + container references
MouseEatsCat Aug 7, 2025
13ceb04
Add System Info Template
MouseEatsCat Nov 27, 2025
361bb3c
DDEV update php version to 8.5
MouseEatsCat Nov 27, 2025
6dac489
Update Elfinder + ACL
MouseEatsCat Nov 27, 2025
56ec735
Replace Deprecated: PDO::MYSQL_ATTR_INIT_COMMAND
MouseEatsCat Nov 27, 2025
976a76e
System Info - Add charcoal version
MouseEatsCat Nov 27, 2025
5d46680
DatabaseServiceProvider - add fallback for php < 8.4
MouseEatsCat Nov 28, 2025
f0ff9b9
System Info - Clean up values + interface
MouseEatsCat Nov 28, 2025
58f1c15
System Info - add twig + mustache
MouseEatsCat Nov 28, 2025
1ca6d98
Translation - isRendered - replace dynamic property with method
MouseEatsCat Nov 28, 2025
c287c0f
Cleanup charcoal bin
MouseEatsCat Nov 28, 2025
5550e01
Github Actions - update php version
MouseEatsCat Nov 28, 2025
183d633
Update lock file
MouseEatsCat Nov 28, 2025
b18a11f
GitHub Actions - Use PHP 8.4
MouseEatsCat Nov 28, 2025
c0a940f
Update requirements + workflows
MouseEatsCat Nov 28, 2025
5accd3f
UI - fix tests container usage
MouseEatsCat Nov 28, 2025
0479722
Update symfony + phpunit
MouseEatsCat Nov 28, 2025
514c206
Monorepo Builder - replace packages-json with alternative
MouseEatsCat Nov 28, 2025
1515ab7
Remove deprecated ReflectionProperty::setAccessible()
MouseEatsCat Nov 28, 2025
df77890
Update phpunit.xml configurations to v11
MouseEatsCat Nov 30, 2025
e44122d
Ignore test logs
MouseEatsCat Nov 30, 2025
d423a45
Translator - repair tests
MouseEatsCat Nov 30, 2025
0832711
Translator - add backwards compatibility for older translation patterns
MouseEatsCat Nov 30, 2025
9387b38
UI - add coverage classes
MouseEatsCat Nov 30, 2025
be30b6a
Translator - fallback for missing message_selector
MouseEatsCat Nov 30, 2025
8d5f4a4
Core - fix tests
MouseEatsCat Nov 30, 2025
efda060
Core - Expression - Make sure name and active are serialized
MouseEatsCat Nov 30, 2025
008c984
Object - add coverage + fix tests
MouseEatsCat Nov 30, 2025
b4fbd1b
Property - add coverage
MouseEatsCat Nov 30, 2025
7cfe3b4
Property - fix tests
MouseEatsCat Nov 30, 2025
6bd9e03
Config - Add coverage
MouseEatsCat Nov 30, 2025
6e64b83
Config - fix tests
MouseEatsCat Nov 30, 2025
72e86f9
Factory - add coverage
MouseEatsCat Nov 30, 2025
01da20a
Cache - fix tests
MouseEatsCat Dec 1, 2025
f83e3d4
Admin - add coverage
MouseEatsCat Dec 1, 2025
c257f56
Admin - fix tests
MouseEatsCat Dec 1, 2025
bc9b443
Email - Fix tests
MouseEatsCat Dec 1, 2025
393b189
DatabaseServiceProvider - Don't set MYSQL_ATTR_INIT_COMMAND on non-mysql
MouseEatsCat Dec 1, 2025
f874dd8
User - add coverage
MouseEatsCat Dec 1, 2025
0745030
Remove empty tests
MouseEatsCat Dec 3, 2025
88f085d
CMS - fix tests
MouseEatsCat Dec 3, 2025
79ab63d
Image - add coverage + fix tests
MouseEatsCat Dec 3, 2025
8441f50
App - add coverage
MouseEatsCat Dec 3, 2025
ab71183
App - fix tests
MouseEatsCat Dec 3, 2025
5b7e831
Queue - remove empty tests
MouseEatsCat Dec 3, 2025
9d3fcc0
View - fix tests
MouseEatsCat Dec 3, 2025
83f06f7
Update composer using php 8.3
MouseEatsCat Dec 3, 2025
9b33ebd
PHPCS - fix all errors
MouseEatsCat Dec 3, 2025
308cd5b
PHPUnit - fix tests
MouseEatsCat Dec 3, 2025
c8cd8b8
Add base test for view Twig tests
MouseEatsCat Dec 3, 2025
a15d8ab
Mustache - TranslatorHelpers - fix return type
MouseEatsCat Dec 3, 2025
543287a
System info - table add light class
MouseEatsCat Dec 3, 2025
093bd11
Attempt - fix phpunit covers errors
MouseEatsCat Dec 3, 2025
37354f3
PHPUnit - replace docblock @covers with Attributes
MouseEatsCat Dec 3, 2025
8d32404
Mustache - TranslatorHelpers add string and Stringable as reutnr types
MouseEatsCat Dec 3, 2025
d807c5a
PHPUnit - update remaining docblock @covers
MouseEatsCat Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: charcoal
type: php
docroot: ""
php_version: "8.3"
webserver_type: apache-fpm
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
database:
type: mariadb
version: "10.11"
use_dns_when_possible: true
composer_version: "2"
web_environment: []
corepack_enable: false
6 changes: 3 additions & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.4
coverage: none

- name: Install Composer dependencies
uses: ramsey/composer-install@v2

- name: Output list of packages as JSON
id: output_data
run: echo "matrix=$(vendor/bin/monorepo-builder packages-json)" >> $GITHUB_OUTPUT
run: echo "matrix=$(find ./packages -maxdepth 1 -type d -not -name 'packages' | jq -Rsc '[. | split("\n") | .[] | select(length > 0) | ltrimstr("./packages/")]')" >> $GITHUB_OUTPUT

outputs:
matrix: ${{ steps.output_data.outputs.matrix }}
Expand All @@ -48,7 +48,7 @@ jobs:

strategy:
matrix:
php-versions: ['7.4', '8.0']
php-versions: ['8.3', '8.4', '8.5']
package: ${{fromJson(needs.provide_packages_json.outputs.matrix)}}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.4
coverage: none

# semantic release local configuration needs to call ./vendor/bin/monorepo-builder
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/split-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.4
coverage: none

- name: Install Dependencies
Expand All @@ -32,7 +32,7 @@ jobs:
# get package json list
- name: Output list packages as JSON
id: output_data
run: echo "matrix=$(vendor/bin/monorepo-builder packages-json)" >> $GITHUB_OUTPUT
run: echo "matrix=$(find ./packages -maxdepth 1 -type d -not -name 'packages' | jq -Rsc '[. | split("\n") | .[] | select(length > 0) | ltrimstr("./packages/")]')" >> $GITHUB_OUTPUT

# this step is needed, so the output gets to the next defined job
outputs:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.phpunit.result.cache
.phpunit.cache
tests/logs/*
charcoal_test
node_modules/
packages/**/composer.lock
Expand Down
69 changes: 41 additions & 28 deletions bin/charcoal
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ declare(strict_types=1);
use Charcoal\App\App;
use Charcoal\App\AppConfig;
use Charcoal\App\AppContainer;
use Slim\Http\Environment as SlimEnvironment;
use Nyholm\Psr7\Factory\Psr17Factory;
use Psr\Http\Message\ServerRequestInterface;
use Slim\Factory\ServerRequestCreatorFactory;

// Ensure this is being used via a CLI
if (PHP_SAPI !== 'cli') {
Expand Down Expand Up @@ -52,6 +54,10 @@ if (!isset($argv[1])) {

$path = '/' . ltrim($argv[1], '/');

// Set up fake HTTP environment for CLI
$_SERVER['REQUEST_URI'] = $path;
$_SERVER['PATH_INFO'] = $path;

// Default file path
$confFile = $baseDir . '/config/config.php';
if (!file_exists($confFile)) {
Expand All @@ -62,43 +68,50 @@ $config = new AppConfig([
'base_path' => $baseDir,
]);
$config->addFile($confFile);

$serverRequestCreator = ServerRequestCreatorFactory::create();
$request = $serverRequestCreator->createServerRequestFromGlobals();

// Create container and configure it (with charcoal-config)
$container = new AppContainer([
'config' => $config,
'request' => $request,
]);

// Set legacy 'environment' container item for compatibility
$container->set('environment', function () use ($path) {
return [
'PATH_INFO' => $path,
'REQUEST_URI' => $path,
];
});
Comment on lines +82 to +87
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this just assign the array itself?

Suggested change
$container->set('environment', function () use ($path) {
return [
'PATH_INFO' => $path,
'REQUEST_URI' => $path,
];
});
$container->set('environment', [
'PATH_INFO' => $path,
'REQUEST_URI' => $path,
]);


// Convert HTTP 404 Not Found to CLI-friendly error
$container['notFoundHandler'] = function ($container) {
return function ($request, $response) use ($container) {
return $container['response']
->withStatus(404)
->write(sprintf(
'Script "%s" not found' . "\n",
$container['request']->getUri()->getPath()
));
$container->set('notFoundHandler', function ($container) {
return function (ServerRequestInterface $request, Throwable $exception) {
$response = (new Psr17Factory())->createResponse(404, sprintf(
'Script "%s" not found' . "\n",
$exception->getMessage()
));
echo $response->getBody();
return $response;
};
};
});

// Convert HTTP 500 Server Error to CLI-friendly error
$container['errorHandler'] = function ($container) {
return function ($request, $response, $exception) use ($container) {
return $container['response']
->withStatus(500)
->write(sprintf(
'Something went wrong! [%s]' . "\n",
$exception->getMessage()
));
$container->set('errorHandler', function ($container) {
return function (ServerRequestInterface $request, Throwable $exception) {
$response = (new Psr17Factory())->createResponse(500, sprintf(
'Something went wrong! [%s]' . "\n",
$exception->getMessage()
));
echo $response->getBody();
return $response;
};
};

// Create a fake HTTP environment from the first CLI argument
$container['environment'] = function ($container) use ($path) {
return SlimEnvironment::mock([
'PATH_INFO' => $path,
'REQUEST_URI' => $path,
]);
};
});

// Charcoal / Slim is the main app
$app = App::instance($container);
$app->run();
$app->setConfig($config);
$app->setBasePath('');
$app->run($request);
2 changes: 1 addition & 1 deletion build/script/migrate-project
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cd $CHARCOAL_BASE

echo Fetching and parsing charcoal packages

PACKAGES="$(vendor/bin/monorepo-builder packages-json)"
PACKAGES="$(find ./packages -maxdepth 1 -type d -not -name 'packages' | jq -Rsc '[. | split("\n") | .[] | select(length > 0) | ltrimstr("./packages/")]')"

PACKAGES=$(sed -Ee 's/(\[|\]|")//g' <<< $PACKAGES)
PACKAGES=$(sed -Ee 's/,/|/g' <<< $PACKAGES)
Expand Down
31 changes: 18 additions & 13 deletions composer.json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in requirements will need to be propagated to composer.json files in packages.

Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,39 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"ext-fileinfo": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-pdo": "*",
"ext-simplexml": "*",
"ext-spl": "*",
"barryvdh/elfinder-flysystem-driver": "^0.3",
"erusev/parsedown": "^1.7",
"erusev/parsedown": "dev-master#6ae0128",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"kriswallsmith/assetic": "^1.4",
"laminas/laminas-permissions-acl": "^2.8",
"laminas/laminas-permissions-acl": "^2.18",
"league/climate": "^3.2",
"league/flysystem": "^1.0",
"mcaskill/php-html-build-attributes": "^1.0",
"monolog/monolog": "^1.17",
"nyholm/psr7": "^1.4",
"php-di/php-di": "^7.0",
"php81_bc/strftime": "^0.7.6",
"phpmailer/phpmailer": "~6.0",
"pimple/pimple": "^3.0",
"psr/cache": "^1.0",
"psr/cache": "^2.0",
"psr/container": "^1.0",
"psr/http-message": "^1.0",
"psr/log": "^1.0",
"seld/jsonlint": "^1.9",
"slim/slim": "^3.7",
"studio-42/elfinder": "2.1.64",
"symfony/translation": "^3.4",
"tedivm/stash": "~0.16",
"vlucas/phpdotenv": "^5.4"
"slim/slim": "^4.0",
"studio-42/elfinder": "2.1.66",
"symfony/asset": "^7.0",
"symfony/console": "^7.0",
"symfony/translation": "^7.0",
"tedivm/stash": "^1.2",
"vlucas/phpdotenv": "^5.4",
"zeuxisoo/slim-whoops": "^0.7.3"
},
"require-dev": {
"cache/void-adapter": "^1.0",
Expand All @@ -71,10 +76,10 @@
"mustache/mustache": "^2.11",
"php-coveralls/php-coveralls": "^2.2",
"phpstan/phpstan": "^1.6",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.5 || ^11.0",
"squizlabs/php_codesniffer": "^3.5",
"symfony/yaml": "^3.0",
"symplify/monorepo-builder": "^10.2",
"symfony/yaml": "^7.0",
"symplify/monorepo-builder": "^12.0.0",
"twig/twig": "^3.4"
},
"autoload": {
Expand Down
Loading