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

Silverstripe/FD1 #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions gadgetchains/Silverstripe/FD/1/chain.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace GadgetChain\Silverstripe;

class FD1 extends \PHPGGC\GadgetChain\FileDelete
{
public static $version = '3.5.5 <= 5.3.0+';
public static $vector = '__destruct';
public static $author = 'mcdruid';
public static $information = 'https://github.com/silverstripe/silverstripe-assets/pull/664';

// In some versions of Silverstripe you could also achieve File Deletion via
// \Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage::destroy
// called from the same destructor by $this->image->destroy();
// However Symfony hardcodes a .mocksess suffix on the path which makes this
// not particularly useful.

public function generate(array $parameters)
{
return new \SilverStripe\Assets\InterventionBackend($parameters['remote_path']);
}
}
13 changes: 13 additions & 0 deletions gadgetchains/Silverstripe/FD/1/gadgets.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace SilverStripe\Assets {
class InterventionBackend
{
private $tempPath;

public function __construct($tempPath)
{
$this->tempPath = $tempPath;
}
}
}