Source of file UploadDirRulesTestTask.php
Size: 1,235 Bytes - Last Modified: 2021-12-23T10:52:06+00:00
/var/www/docs.ssmods.com/process/src/code/dev/UploadDirRulesTestTask.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 | <?php /** * Test task for helping upload dir rules development and debugging. * * @author Anselm Christophersen <ac@title.dk> * @copyright Copyright (c) 2015, Title Web Solutions */ class UploadDirRulesTestTask extends CliController { public function process() { $this->doEcho(); $this->subsitesTests(); $this->doEcho(); } public function subsitesTests() { $this->doEcho('Subsites', true); $subsites = Subsite::get() ->sort('ID ASC'); foreach ($subsites as $s) { $this->doEcho("{$s->Title} (#{$s->ID}):"); //Setting subsite via $_GET //this is not bes practice, but this seems to be the only way that works //when running this over the command line $_GET['SubsiteID'] = $s->ID; $this->doEcho(SubsiteUploadDirRules::get_directory_for_subsite()); $this->doEcho(); } } private function doEcho($str = null, $heading = false) { if ($heading) { echo "###################################\n"; } echo "$str\n"; if ($heading) { echo "###################################\n\n"; } } } |