<?php my_mkdir("path/to/your/dir"); function my_mkdir($dir, $dirmode = 700) { if (!empty($dir)) { if (!file_exists($dir)) { preg_match_all('/([^\\/]*)\\/?/i', $dir, $atmp); $base = ""; foreach ($atmp[0] as $key => $val) { $base = $base . $val; if (!file_exists($base)) { if (!mkdir($base, $dirmode)) { echo "Error: Cannot create " . $base; return -1; } } } } else { if (!is_dir($dir)) { echo "Error: " . $dir . " exists and is not a directory"; return -2; } } } return 0; }
<?php use mageekguy\atoum; date_default_timezone_set('Europe/Paris'); //avoid weird warning $path = __DIR__ . DIRECTORY_SEPARATOR . 'build' . DIRECTORY_SEPARATOR . 'atoum'; function my_mkdir($path) { if (!is_dir($path)) { mkdir($path, 0777, true); } } my_mkdir($path); my_mkdir($path . DIRECTORY_SEPARATOR . 'cover'); my_mkdir($path . DIRECTORY_SEPARATOR . 'treemap'); $report = $script->addDefaultReport(); $runner->setBootstrapFile(__DIR__ . DIRECTORY_SEPARATOR . '.bootstrap.atoum.php'); $runner->addTestsFromDirectory(__DIR__ . DIRECTORY_SEPARATOR . 'website' . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'units' . DIRECTORY_SEPARATOR); //$script->addDefaultReport(); $xunitWriter = new atoum\writers\file('build/atoum.xunit.xml'); $xunitReport = new atoum\reports\asynchronous\xunit(); $xunitReport->addWriter($xunitWriter); $runner->addReport($xunitReport); /* Please replace in next line /path/to/destination/directory by your destination directory path for html files. */ $coverageHtmlField = new atoum\report\fields\runner\coverage\html('markattaks', 'build/atoum/cover'); /* Please replace in next line http://url/of/web/site by the root url of your code coverage web site. */ $coverageHtmlField->setRootUrl('http://m2gl.deptinfo-st.univ-fcomte.fr:9080/jenkins/job/MarkAttacks%20(w-o%20Squash%20TA)/PHP_Coverage');
function ImportFile($filename, $ou) { $content_dir = dirname(__FILE__) . "/ressources/conf/upload"; my_mkdir($content_dir); $this->filename = $filename; $this->ou = $ou; $this->datas = file_get_contents($this->filename); $this->array_content = explode("\n", $this->datas); $this->countLine = count($this->array_content); if ($this->countLine < 5) { $this->logs("{error_miss_datas} : array(" . count($this->array_content) . "<br>{$datas}<br>"); $this->process_result = false; return false; } $this->process_array(); }