Skip to content

Commit 0d82e13

Browse files
committed
Merge branch 'develop'
* develop: (21 commits) specify next release fix namespace use promoted properties fix documentation replace innmind/time-continuum and innmind/time-warp by innmind/time add missing test case fix warnings add NoDiscard attributes add extensive CI tag dependencies use innmind/io to require files remove warnings add Config::useFileWatch() add Config::useServerStatus() add Config::useServerControl() use the filesystem abstraction to check if a file/directory exists make Remote::sql() return an Attempt update dependencies add todo for Filesystem::contains() to integrate correctly with other abstractions require php 8.4 ...
2 parents 1c36d9a + 3ec2138 commit 0d82e13

36 files changed

Lines changed: 582 additions & 292 deletions

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/.gitattributes export-ignore
22
/.gitignore export-ignore
3-
/phpunit.xml.dist export-ignore
43
/tests export-ignore

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@ jobs:
1212
uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main
1313
cs:
1414
uses: innmind/github-workflows/.github/workflows/cs.yml@main
15-
with:
16-
php-version: '8.2'

.github/workflows/extensive.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Extensive CI
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
paths:
8+
- '.github/workflows/extensive.yml'
9+
10+
jobs:
11+
blackbox:
12+
uses: innmind/github-workflows/.github/workflows/extensive.yml@main

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## 7.0.0 - 2026-02-07
4+
5+
### Added
6+
7+
- `Innmind\OperatingSystem\Config::useServerControl()`
8+
- `Innmind\OperatingSystem\Config::useServerStatus()`
9+
- `Innmind\OperatingSystem\Config::useFileWatch()`
10+
11+
### Changed
12+
13+
- Requires PHP `8.4`
14+
- `Innmind\OperatingSystem\Remote::sql()` now returns an `Innmind\Immutable\Attempt`
15+
- `Innmind\OperatingSystem\Filesystem::mount()` now longer automatically create the directory
16+
- `Innmind\OperatingSystem\CurrentProcess\Signals::listen()` now returns an `Innmind\Immutable\Attempt`
17+
- `Innmind\OperatingSystem\CurrentProcess\Signals::remove()` now returns an `Innmind\Immutable\Attempt`
18+
- Requires `innmind/time:~1.0`
19+
320
## 6.2.0 - 2025-08-10
421

522
### Added

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $os = Factory::build();
3131

3232
### Want to access the system clock ?
3333

34-
`$os->clock()` will return an instance of [`Innmind\TimeContinuum\Clock`](https://github.com/innmind/timecontinuum#usage).
34+
`$os->clock()` will return an instance of [`Innmind\Time\Clock`](https://github.com/innmind/time#usage).
3535

3636
### Want to access the filesystem ?
3737

@@ -153,7 +153,7 @@ $os->process()->id()->unwrap();
153153
### Want to pause the current process ?
154154

155155
```php
156-
use Innmind\TimeContinuum\Period;
156+
use Innmind\Time\Period;
157157

158158
$os->process()->halt(Period::minute(1));
159159
```
@@ -165,5 +165,5 @@ use Innmind\Signals\Signal;
165165

166166
$os->process()->signals()->listen(Signal::terminate, function() {
167167
// handle the signal here
168-
});
168+
})->unwrap();
169169
```

blackbox.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
};
1111

1212
Application::new($argv)
13+
->when(
14+
\getenv('BLACKBOX_SET_SIZE') !== false,
15+
static fn(Application $app) => $app->scenariiPerProof((int) \getenv('BLACKBOX_SET_SIZE')),
16+
)
1317
->when(
1418
\getenv('ENABLE_COVERAGE') !== false,
1519
static fn(Application $app) => $app

composer.json

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,17 @@
1515
"issues": "http://github.com/Innmind/OperatingSystem/issues"
1616
},
1717
"require": {
18-
"php": "~8.2",
19-
"innmind/time-continuum": "^4.1.1",
20-
"innmind/server-status": "~5.0",
21-
"innmind/server-control": "~6.0",
22-
"innmind/filesystem": "~8.1",
23-
"innmind/http-transport": "~8.0",
24-
"innmind/time-warp": "~4.0",
25-
"innmind/signals": "~4.0",
26-
"innmind/file-watch": "~5.0",
27-
"formal/access-layer": "~4.0",
28-
"innmind/io": "~3.2",
29-
"innmind/immutable": "~5.15"
18+
"php": "~8.4",
19+
"innmind/time": "~1.0",
20+
"innmind/server-status": "~6.0",
21+
"innmind/server-control": "~7.0",
22+
"innmind/filesystem": "~9.0",
23+
"innmind/http-transport": "~9.0",
24+
"innmind/signals": "~5.0",
25+
"innmind/file-watch": "~6.0",
26+
"formal/access-layer": "~5.0",
27+
"innmind/io": "~4.0",
28+
"innmind/immutable": "~6.0"
3029
},
3130
"autoload": {
3231
"psr-4": {
@@ -39,9 +38,7 @@
3938
}
4039
},
4140
"require-dev": {
42-
"innmind/url": "~4.0",
43-
"innmind/ip": "~3.0",
44-
"innmind/static-analysis": "^1.2.1",
41+
"innmind/static-analysis": "~1.3",
4542
"innmind/black-box": "~6.2",
4643
"innmind/coding-standard": "~2.0"
4744
}

documentation/upgrade/v6-to-v7.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# V6 to V7
2+
3+
### Mounting a folder that doesn't exist
4+
5+
=== "Before"
6+
```php
7+
$adapter = $os
8+
->filesystem()
9+
->mount(Path::of('/some/folder/'))
10+
->unwrap();
11+
```
12+
13+
=== "After"
14+
```php hl_lines="1 6"
15+
use Innmind\Filesystem\Recover;
16+
17+
$adapter = $os
18+
->filesystem()
19+
->mount(Path::of('/some/folder/'))
20+
->recover(Recover::mount(...))
21+
->unwrap();
22+
```
23+
24+
### Accessing a SQL connection
25+
26+
=== "Before"
27+
```php
28+
$connection = $os
29+
->remote()
30+
->sql(Url::of('mysql://127.0.0.1:3306/database'));
31+
```
32+
33+
=== "After"
34+
```php hl_lines="4"
35+
$connection = $os
36+
->remote()
37+
->sql(Url::of('mysql://127.0.0.1:3306/database'))
38+
->unwrap();
39+
```
40+
41+
### Handling process signals
42+
43+
=== "Before"
44+
```php
45+
$os
46+
->process()
47+
->signals()
48+
->listen($signal, $listener);
49+
$os
50+
->process()
51+
->signals()
52+
->remove($listener);
53+
```
54+
55+
=== "After"
56+
```php hl_lines="5 10"
57+
$os
58+
->process()
59+
->signals()
60+
->listen($signal, $listener)
61+
->unwrap();
62+
$os
63+
->process()
64+
->signals()
65+
->remove($listener)
66+
->unwrap();
67+
```
68+
69+
### HTTP client config
70+
71+
=== "Before"
72+
```php
73+
use Innmind\HttpTransport\Curl;
74+
use Innmind\TimeContinuum\Period;
75+
76+
$os = $os->map(
77+
static fn($config) => $config->useHttpTransport(
78+
Curl::of($config->clock(), $config->io())
79+
->disableSSLVerification()
80+
->maxConcurrency(10)
81+
->heartbeat(
82+
Period::second(1),
83+
static fn() => 'heartbeat',
84+
),
85+
),
86+
);
87+
```
88+
89+
=== "After"
90+
```php
91+
use Innmind\HttpTransport\Config;
92+
93+
$os = $os->map(
94+
static fn($config) => $config->mapHttpTransport(
95+
static fn($transport) => $transport->map(
96+
static fn(Config $config) => $config
97+
->limitConcurrencyTo(10)
98+
->disableSSLVerification(),
99+
),
100+
),
101+
);
102+
```

documentation/use_cases/filesystem.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,25 @@ $os
119119

120120
See [processes](processes.md) section on how to execute commands on your operating system.
121121

122+
### Automatically create the mounted folder
123+
124+
By default when mounting a folder if it doesn't exist it will fail. But you can instruct to automatically create the folder in such case.
125+
126+
```php
127+
use Innmind\Filesystem\{
128+
Adapter,
129+
Recover,
130+
};
131+
use Innmind\Url\Path;
132+
133+
$adapter = $os
134+
->filesystem()
135+
->mount(Path::of('/some/folder/'))
136+
->recover(Recover::mount(...))
137+
->unwrap();
138+
$adapter instanceof Adapter; // true
139+
```
140+
122141
### Mounting the `tmp` folder
123142

124143
Sometimes you want to use the `tmp` folder to write down files such as cache that can be safely lost in case of a system reboot. You can easily mount this folder as any other folder like so:

documentation/use_cases/http.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ $response = $http(Request::of(
1919
ProtocolVersion::v20,
2020
))
2121
->map(static fn($success) => $success->response())
22-
->match(
23-
static fn($response) => $response,
24-
static fn($error) => throw new \RuntimeException($error::class),
25-
);
22+
->attempt(static fn($error) => throw new \RuntimeException($error::class))
23+
->unwrap();
2624
$response instanceof Response; // true
2725
```
2826

@@ -37,20 +35,20 @@ One of the first things taught when working with distributed systems is that the
3735

3836
```php
3937
use Innmind\OperatingSystem\Config\Resilient;
40-
use Innmind\HttpTransport\ExponentialBackoff;
38+
use Innmind\HttpTransport\Transport;
4139

4240
$os = $os->map(Resilient::new());
4341
$http = $os->remote()->http();
44-
$http instanceof ExponentialBackoff; // true
42+
$http instanceof Transport; // true
4543
```
4644

4745
Another strategy you can add on top of that is the [circuit breaker pattern](https://en.wikipedia.org/wiki/Circuit_breaker_design_pattern) that will stop sending request to a server known to have failed.
4846

4947
```php
50-
use Innmind\HttpTransport\CircuitBreaker;
51-
use Innmind\TimeContinuum\Period;
48+
use Innmind\HttpTransport\Transport;
49+
use Innmind\Time\Period;
5250

53-
$http = CircuitBreaker::of(
51+
$http = Transport::circuitBreaker(
5452
$http,
5553
$os->clock(),
5654
Period::minute(1),

0 commit comments

Comments
 (0)