-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marek Fojtl
committed
Oct 22, 2021
0 parents
commit 72f36fc
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "polyweb-cz/attachment-sdk", | ||
"description": "Attachment development kit", | ||
"version": "0.0.1", | ||
"require": { | ||
"php": ">=8.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"PolyWeb\\Attachment\\Sdk\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"classmap": ["src/"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
|
||
namespace PolyWeb\Attachment\Sdk; | ||
|
||
|
||
abstract class APackage implements IPackage | ||
{ | ||
public function getAttachmentPath(string $name): string | ||
{ | ||
$path = $this->getWorkDirectory() . '/' . $name; | ||
if (!file_exists($path)) { | ||
throw new \Exception('Attachment "' . $name . '" does not exist in "' . $this->getWorkDirectory() . '"'); | ||
} | ||
return $path; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
|
||
namespace PolyWeb\Attachment\Sdk; | ||
|
||
|
||
interface IPackage | ||
{ | ||
public function getWorkDirectory(): string; | ||
|
||
public function getAttachmentPrefix(): string; | ||
|
||
public function getAttachmentModule(): string; | ||
|
||
public function getAttachmentPath(string $name): string; | ||
} |