Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/src/InMemory export-ignore
/src/PhpseclibV2 export-ignore
/src/PhpseclibV3 export-ignore
/src/PhpseclibV4 export-ignore
/src/AdapterTestUtilities export-ignore
/src/AzureBlobStorage export-ignore
/src/ZipArchive export-ignore
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"microsoft/azure-storage-blob": "^1.1",
"phpunit/phpunit": "^9.5.11|^10.0",
"phpstan/phpstan": "^1.10",
"phpseclib/phpseclib": "^3.0.36",
"phpseclib/phpseclib": "^4.0",
"aws/aws-sdk-php": "^3.295.10",
"composer/semver": "^3.0",
"friendsofphp/php-cs-fixer": "^3.5",
Expand Down
5 changes: 5 additions & 0 deletions config.subsplit-publish.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"directory": "src/PhpseclibV3",
"target": "git@github.com:thephpleague/flysystem-sftp-v3.git"
},
{
"name": "sftp-v4",
"directory": "src/PhpseclibV4",
"target": "git@github.com:thephpleague/flysystem-sftp-v4.git"
},
{
"name": "memory",
"directory": "src/InMemory",
Expand Down
8 changes: 8 additions & 0 deletions src/PhpseclibV4/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
* text=auto

.github export-ignore
.gitattributes export-ignore
.gitignore export-ignore
**/*Test.php export-ignore
**/*Stub.php export-ignore
README.md export-ignore
30 changes: 30 additions & 0 deletions src/PhpseclibV4/.github/workflows/close-subsplit-prs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Close sub-split PRs

on:
push:
branches:
- 2.x
- 3.x
pull_request:
branches:
- 2.x
- 3.x
schedule:
- cron: '30 7 * * *'

jobs:
close_subsplit_prs:
runs-on: ubuntu-latest
name: Close sub-split PRs
steps:
- uses: frankdejonge/action-close-subsplit-pr@0.1.0
with:
close_pr: 'yes'
target_branch_match: '^(?!master).+$'
message: |
Hi :wave:,

Thank you for contributing to Flysystem. Unfortunately, you've sent a PR to a read-only sub-split repository.

All pull requests should be directed towards: https://github.com/thephpleague/flysystem
15 changes: 15 additions & 0 deletions src/PhpseclibV4/ConnectionProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

namespace League\Flysystem\PhpseclibV4;

use phpseclib4\Net\SFTP;

/**
* @method void disconnect()
*/
interface ConnectionProvider
{
public function provideConnection(): SFTP;
}
12 changes: 12 additions & 0 deletions src/PhpseclibV4/ConnectivityChecker.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace League\Flysystem\PhpseclibV4;

use phpseclib4\Net\SFTP;

interface ConnectivityChecker
{
public function isConnected(SFTP $connection): bool;
}
36 changes: 36 additions & 0 deletions src/PhpseclibV4/FixatedConnectivityChecker.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace League\Flysystem\PhpseclibV4;

use phpseclib4\Net\SFTP;

class FixatedConnectivityChecker implements ConnectivityChecker
{
/**
* @var int
*/
private $succeedAfter;

/**
* @var int
*/
private $numberOfTimesChecked = 0;

public function __construct(int $succeedAfter = 0)
{
$this->succeedAfter = $succeedAfter;
}

public function isConnected(SFTP $connection): bool
{
if ($this->numberOfTimesChecked >= $this->succeedAfter) {
return true;
}

$this->numberOfTimesChecked++;

return false;
}
}
19 changes: 19 additions & 0 deletions src/PhpseclibV4/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2013-2026 Frank de Jonge

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
9 changes: 9 additions & 0 deletions src/PhpseclibV4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Sub-split of Flysystem for SFTP using phpseclib v4.

> ⚠️ this is a sub-split, for pull requests and issues, visit: https://github.com/thephpleague/flysystem

```bash
composer require league/flysystem-sftp-v4
```

View the [documentation](https://flysystem.thephpleague.com/docs/adapter/sftp-v4/).
Loading
Loading