From 0ed82a2c6ffd8e981d9dd388306379941ecb5720 Mon Sep 17 00:00:00 2001 From: Fbenas Date: Sun, 20 Aug 2017 04:18:13 +0100 Subject: WIP rejigging stuff --- src/Filesystem/Create.php | 20 ++++++++++++++++++++ src/Filesystem/CreateDirectory.php | 25 +++++++++++++++++++++++++ src/Filesystem/CreateFile.php | 25 +++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 src/Filesystem/Create.php create mode 100644 src/Filesystem/CreateDirectory.php create mode 100644 src/Filesystem/CreateFile.php (limited to 'src/Filesystem') diff --git a/src/Filesystem/Create.php b/src/Filesystem/Create.php new file mode 100644 index 0000000..a1891db --- /dev/null +++ b/src/Filesystem/Create.php @@ -0,0 +1,20 @@ +filename = $filename; + + if (!is_writable(dirname($filename))) { + throw new \Exception('Cannot create ' . $this->thing . ' at: ' . $filename); + } + } + + abstract public function excecute(); +} diff --git a/src/Filesystem/CreateDirectory.php b/src/Filesystem/CreateDirectory.php new file mode 100644 index 0000000..0c45c6c --- /dev/null +++ b/src/Filesystem/CreateDirectory.php @@ -0,0 +1,25 @@ +