|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* TechDivision\Import\Subjects\FileResolver\MoveFilesFileResolver |
|
5
|
|
|
* |
|
6
|
|
|
* NOTICE OF LICENSE |
|
7
|
|
|
* |
|
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
|
9
|
|
|
* that is available through the world-wide-web at this URL: |
|
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
|
11
|
|
|
* |
|
12
|
|
|
* PHP version 5 |
|
13
|
|
|
* |
|
14
|
|
|
* @author Tim Wagner <[email protected]> |
|
15
|
|
|
* @copyright 2016 TechDivision GmbH <[email protected]> |
|
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
|
17
|
|
|
* @link https://github.com/techdivision/import |
|
18
|
|
|
* @link http://www.techdivision.com |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
|
|
namespace TechDivision\Import\Subjects\FileResolver; |
|
22
|
|
|
|
|
23
|
|
|
use TechDivision\Import\Configuration\ConfigurationInterface; |
|
24
|
|
|
use TechDivision\Import\Services\RegistryProcessorInterface; |
|
25
|
|
|
use TechDivision\Import\Configuration\Subject\FileResolverConfigurationInterface; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* A custom file resolver implementation for the move files subject |
|
29
|
|
|
* that try's to load the prefix from the configuration. |
|
30
|
|
|
* |
|
31
|
|
|
* @author Tim Wagner <[email protected]> |
|
32
|
|
|
* @copyright 2016 TechDivision GmbH <[email protected]> |
|
33
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
|
34
|
|
|
* @link https://github.com/techdivision/import |
|
35
|
|
|
* @link http://www.techdivision.com |
|
36
|
|
|
*/ |
|
37
|
|
|
class MoveFilesFileResolver extends OkFileAwareFileResolver |
|
38
|
|
|
{ |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* The configuration instance. |
|
42
|
|
|
* |
|
43
|
|
|
* @var \TechDivision\Import\Configuration\ConfigurationInterface |
|
44
|
|
|
*/ |
|
45
|
|
|
private $configuration; |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* Initializes the file resolver with the application and the registry instance. |
|
49
|
|
|
* |
|
50
|
|
|
* @param \TechDivision\Import\Configuration\ConfigurationInterface $configuration The configuration instance |
|
51
|
|
|
* @param \TechDivision\Import\Services\RegistryProcessorInterface $registryProcessor The registry instance |
|
52
|
|
|
*/ |
|
53
|
|
|
public function __construct( |
|
54
|
|
|
ConfigurationInterface $configuration, |
|
55
|
|
|
RegistryProcessorInterface $registryProcessor |
|
56
|
|
|
) { |
|
57
|
|
|
|
|
58
|
|
|
// pass the application + registry processor to the parent class |
|
59
|
|
|
parent::__construct($registryProcessor); |
|
60
|
|
|
|
|
61
|
|
|
// set the configuration instance |
|
62
|
|
|
$this->configuration = $configuration; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* Return's the configuration instance. |
|
67
|
|
|
* |
|
68
|
|
|
* @return \TechDivision\Import\Configuration\ConfigurationInterface The configuration instance |
|
69
|
|
|
*/ |
|
70
|
|
|
protected function getConfiguration() : ConfigurationInterface |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->configuration; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
/** |
|
76
|
|
|
* Returns the file resolver configuration instance. |
|
77
|
|
|
* |
|
78
|
|
|
* @return \TechDivision\Import\Configuration\Subject\FileResolverConfigurationInterface The configuration instance |
|
79
|
|
|
*/ |
|
80
|
|
|
protected function getFileResolverConfiguration() : FileResolverConfigurationInterface |
|
81
|
|
|
{ |
|
82
|
|
|
|
|
83
|
|
|
// load the file resolver configuration from the parent instance |
|
84
|
|
|
$fileResolverConfiguration = parent::getFileResolverConfiguration(); |
|
85
|
|
|
|
|
86
|
|
|
// use the move files prefix from the configuration |
|
87
|
|
|
if ($moveFilesPrefix = $this->getConfiguration()->getMoveFilesPrefix()) { |
|
|
|
|
|
|
88
|
|
|
$fileResolverConfiguration->setPrefix($moveFilesPrefix); |
|
|
|
|
|
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
// return the customized file resolver configuration |
|
92
|
|
|
return $fileResolverConfiguration; |
|
93
|
|
|
} |
|
94
|
|
|
} |
|
95
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.