Hi!
I've hit a problem:
php Code:
public function uploadImage($szInputName)
{
$this->form_inputName = $szInputName;
// If the neccessary stuff has been set
if(isset(parent::$path) && isset($this->user))
{
//I'm doing some stuff here..
}
else throw new Exception('Everything is not set yet.');
}
php Code:
include('Gallery.php');
include('Upload.php');
$allowed =
array( 'jpeg',
'gif',
'png' );
try
{ $gallery =
new Gallery
(NULL,
'images/');
$gallery->
setAllowedTypes($allowed);
$gallery->
setLimitFileType('no');
$gallery->
setThumbSize(400,
600);
$gallery->
setMaxFileSize(100000);
$upload =
new Upload
(2);
$upload->
uploadImage('filename');
} catch
(Exception
$error) { echo $error->
getMessage();
}
Gives me:
Code:
Everything is not set yet.
Which means that either path is not set, or the user id is not set.
And you can see that I've set both userid:
PHP Code:
$upload = new Upload(2);
and the path:
PHP Code:
$gallery = new Gallery(NULL, 'images/');
So I'm thinking that perhaps this is wrong:
Is that an incorrect way of doing it?
Haven't worked much with parents and stuff..
The path variable in the gallery class(which the upload class extends) is set to protected.
Any ideas why this error is thrown?