rendered paste body<?php
class init {
var $uploaddir;
var $filesdir;
var $path;
function initialize($filename) {
$filehandler = fopen(basename($filename), 'r')
or die("Can't open file ".$filename);
$data = file(basename($filename));
$rows = explode(':',$data[0]);
$this -> uploaddir = $rows[0];
$this -> aim = $rows[1];
$this -> path = $filename;
fclose($filehandler);
}
// funkcja do poprawy wykrzacza mkdir()
function create() {
$this -> uploaddir = "/home/infsgrp/redbull/public_html/test/upload/";
if (! (file_exists($this->uploaddir) && is_dir($this->uploaddir)) ) {
echo "kat 1";
mkdir ($this->uploaddir, 0755);
}
$this -> filesdir = "/home/infsgrp/redbull/public_html/test/files/";
if (! (file_exists($this->filesdir) && is_dir($this->filesdir)) ) {
echo "kat 2";
mkdir ($this->filesdir , 0755);
}
$this -> path = '/home/infsgrp/redbull/public_html/test/dir.ini';
$filehandler = fopen($this -> path, "w+")
or die("Can't create file");
if (!fwrite($filehandler, $this -> uploaddir.":".$this -> filesdir))
echo "Error occured during saving dir variables !\n".$this -> uploaddir."\n".$this -> filesdir;
fclose($filehandler);
}
}
?>