I'm trying to make a small script for retrieving configuration files containing mapping instructions for a product import, using php glob. But I fail miserably.
What I have right now:
echo "Shop type: " . $this->shopType . '<br />';
echo "Shop version: " . $this->shopVersion . '<br />';
echo "Glob search: config/mappings/" . $this->shopType . "_" . $this->shopVersion . ".php";
foreach (glob("config/mappings/" . $this->shopType . "_" . $this->shopVersion . ".php") as $filename) {
echo "$filename size " . filesize($filename) . "
";
}
exit;
$this->shopType
represents the name of the shop from which the export file should be imported. E.g. ccvshop.$this->shopVersion
represents the version of the shop, to be able to write different import mappings for different versions of the shop types.
The value of shopType = ccvshop
.
The value of shopVersion = 11.2
.
Which would make the search string in the glob function:
config/mappings/ccvshop_11.2.php
.
Unfortunately my result is empty, and I can't see what I'm doing wrong.
Any help would be appreciated.