Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create HaloModule #14

Merged
merged 50 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
cb16aec
Create fake app
koriym Jan 7, 2023
9f4e879
Create HaloModule
koriym Jan 7, 2023
8fd60b8
Save serve runConfigurations
koriym Jan 8, 2023
d083cd8
Require bear/qiq-module in dev
koriym Jan 8, 2023
6f7457f
Create hal enable switch
koriym Jan 8, 2023
973b265
Refactor
koriym Jan 8, 2023
1b25c4b
Support Qiq template edit
koriym Jan 8, 2023
c1941dc
Soothe SA
koriym Jan 9, 2023
9fe2da0
Find twig template
koriym Jan 9, 2023
5e27fa0
Save serve command
koriym Jan 10, 2023
b300819
Add Halo module to README
koriym Jan 10, 2023
97ac5cf
Run all tests with no error
koriym Jan 10, 2023
8a58388
fixup! Save serve command
koriym Jan 10, 2023
464e568
Drop php 7.x CI test
koriym Jan 10, 2023
56bb1a2
fixup! Run all tests with no error
koriym Jan 10, 2023
c4a0a2f
Remove else
koriym Jan 10, 2023
ee919e3
Soothe require-checker
koriym Jan 10, 2023
da0f6ec
fixup! Drop php 7.x CI test
koriym Jan 10, 2023
454f210
fixup! fixup! Drop php 7.x CI test
koriym Jan 10, 2023
0139703
Add xhprof
koriym Jan 13, 2023
157439f
Composer update
koriym Jan 13, 2023
56adc75
Move ext-xhprof
koriym Jan 13, 2023
8b0d07c
Install xhprof on CI
koriym Jan 13, 2023
af45ee4
Soothe phpstan
koriym Jan 13, 2023
bba9ce5
Soothe psalm
koriym Jan 13, 2023
698c374
Increase code coverage
koriym Jan 13, 2023
f910f17
Update continuous-integration.yml
koriym Jan 13, 2023
11e1ac4
fixup! Increase code coverage
koriym Jan 13, 2023
6c644b4
Update codecov
koriym Jan 13, 2023
5c9b1c5
Soothe sa
koriym Jul 26, 2023
6676a21
Add composer halo command
koriym Jul 26, 2023
64ef32e
composer update
koriym Jul 26, 2023
1eaf50e
fixup! Soothe sa
koriym Jul 26, 2023
2aad994
fixup! Find twig template
koriym Jul 26, 2023
8f43546
fixup! Move ext-xhprof
koriym Jul 26, 2023
d62c50a
Replace http server with koriym/php-server
koriym Jul 26, 2023
8a6ece9
Remove deleted longxinh/xhprof
koriym Aug 24, 2023
76749fd
Merge branch 'master' into halo
koriym Apr 19, 2024
e10074a
Update PHP versions in GitHub workflows
koriym Apr 19, 2024
05629bf
Update composer dependencies and versions
koriym Apr 19, 2024
ef2d480
Ignore PHPStan check on XHProf line
koriym Apr 19, 2024
6bb37f8
fixup! Update PHP versions in GitHub workflows
koriym Apr 19, 2024
a2daf37
fixup! fixup! Update PHP versions in GitHub workflows
koriym Apr 19, 2024
c918c31
Add composer-require-checker.json file
koriym Apr 19, 2024
3860c39
fixup! Add composer-require-checker.json file
koriym Apr 20, 2024
6234c2c
Refactor code and update coding standard
koriym Apr 20, 2024
2d01e8b
Update composer.json: Add "xhprof/xhprof" dependency
koriym Apr 20, 2024
c0a69c4
fixup! Update composer.json: Add "xhprof/xhprof" dependency
koriym Apr 20, 2024
d44c7aa
Update halo rendering logic and conditions
koriym Apr 20, 2024
9e81d1d
Add Halo handling to HaloRenderer and tests
koriym Apr 20, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
cs:
uses: ray-di/.github/.github/workflows/coding-standards.yml@v1
with:
php_version: 8.1
php_version: 8.3
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
ci:
uses: ray-di/.github/.github/workflows/continuous-integration.yml@v1
with:
old_stable: '["7.4", "8.0", "8.1", "8.2"]'
old_stable: '["8.1", "8.2"]'
current_stable: 8.3
1 change: 1 addition & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ jobs:
uses: ray-di/.github/.github/workflows/static-analysis.yml@v1
with:
php_version: 8.3
has_crc_config: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
tests/Http/log/HttpResourceClientTest.log
coverage.xml
tests/Http/log/app.log
.idea
!.idea/
.idea/*
!.idea/runConfigurations/
6 changes: 6 additions & 0 deletions .idea/runConfigurations/phpunit_xml_dist.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/runConfigurations/serve_qiq.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/runConfigurations/serve_twig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

194 changes: 0 additions & 194 deletions .php_cs.dist

This file was deleted.

19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# BEAR.DevTools

## Halo module

A frame, called a halo, appears around the HTML representation of the resource.
The halo identifies the resource being rendered and provides tools about the resource.

The tools in the halo provide information about the resource, such as its status (Status), its representation (View), the interceptor applied to it, and so on. It also provides links to editors to resource classes and resource templates.

```php
class DevModule extends AbstractModule
{
protected function configure(): void
{
$this->install(new HaloModule($this));
}
}
```

## HttpResource client

`HttpResource` starts a local server and becomes an HTTP client.

```php
Expand Down
10 changes: 10 additions & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"symbol-whitelist": [
"null", "true", "false",
"static", "self", "parent",
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object",
"json_decode", "json_encode", "JSON_PRETTY_PRINT", "JSON_THROW_ON_ERROR", "JSON_UNESCAPED_SLASHES", "JSON_UNESCAPED_UNICODE",
"xhprof_disable", "xhprof_enable", "XHPROF_FLAGS_CPU", "XHPROF_FLAGS_MEMORY", "XHPROF_FLAGS_NO_BUILTINS",
"Madapaja\\TwigModule\\Annotation\\TwigPaths"
]
}
32 changes: 29 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@
}
],
"require": {
"php": "^7.3 || ^8.0",
"ext-json": "*",
"php": "^8.0",
"ext-filter": "*",
"aura/sql": "^3 || ^4 || ^5",
"bear/app-meta": "^1.8",
"bear/resource": "^1.17",
"koriym/php-server": "^1.0",
"xhprof/xhprof": "^2.3",
"psr/log": "^1 || ^2 || ^3",
"ray/aop": "^2.14",
"ray/di": "^2.14",
"symfony/process": "^v5.4 || ^v6.4 || ^v7.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4",
"bear/package": "^1.10",
"madapaja/twig-module": "^2.5",
"phpunit/phpunit": "^9.6",
"ray/aura-sql-module": "^1.10"
},
Expand All @@ -32,7 +36,10 @@
"autoload-dev": {
"psr-4": {
"BEAR\\Dev\\": [
"tests/"
"tests/Fake"
],
"MyVendor\\MyProject\\": [
"tests/Fake/app/src"
]
}
},
Expand All @@ -56,5 +63,24 @@
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"repositories": [
{
"type": "package",
"package": {
"name": "xhprof/xhprof",
"version": "2.3.9",
"dist": {
"url": "https://github.com/longxinH/xhprof/archive/refs/tags/v2.3.9.zip",
"type": "zip"
},
"autoload": {
"classmap": ["/xhprof_lib/utils/"]
}
}
}
],
"suggest": {
"ext-xhprof": "XHprof hierarchical profiler"
}
}
3 changes: 1 addition & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor-bin/tools/vendor/squizlabs/php_codesniffer/phpcs.xsd"
>
<description>BEAR.Skeleton Coding Standard</description>
<description>BEAR.DevTools Coding Standard</description>
<arg name="basepath" value="."/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="80"/>
Expand Down Expand Up @@ -35,7 +35,6 @@
<exclude name="SlevomatCodingStandard.Classes.SuperfluousTraitNaming.SuperfluousSuffix"/>
<exclude name="Squiz.Strings.DoubleQuoteUsage.ContainsVar"/>
<!-- Exclude files -->
<exclude-pattern>*/tests/Fake/*</exclude-pattern>
<exclude-pattern>*/tmp/*</exclude-pattern>
</rule>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@

use RuntimeException;
use Symfony\Component\Process\Process;

use function error_log;
use function is_int;
use function register_shutdown_function;
use function sleep;
use function sprintf;
use function strpos;
use function version_compare;

use const PHP_BINARY;
use const PHP_VERSION;

/** @deprecated User koriym/php-server PhpServer instead */
final class BuiltinServer
{
/**
Expand Down Expand Up @@ -67,13 +66,12 @@ public function start(): void
});
}

/** @codeCoverageIgnore */
public function stop(): void
{
// @codeCoverageIgnoreStart
$exitCode = $this->process->stop();
if ($exitCode !== 143) {
throw new RuntimeException(sprintf('code:%s msg:%s', (string) $exitCode, $this->process->getErrorOutput()));
}
// @codeCoverageIgnoreEnd
}
}
Loading
Loading