addError(array('MODULE_INSTALL', '
'.$directory.' does not exist. Please create it.'));
} else if (!is_writable($directory) && @chmod($directory, 0666)) {
$msg->addError(array('MODULE_INSTALL', ''.$directory.' is not writeable. On Unix issue the command chmod a+rw.'));
}
/********
* check the directories that hold the images
*/
$chk_dirs[0] = AT_MODULE_PATH .'photo_album/images';
$chk_dirs[1] = AT_MODULE_PATH .'photo_album/images/temp';
$chk_dirs[2] = AT_MODULE_PATH .'photo_album/images/album_images';
// check if the directories are writeable
foreach ($chk_dirs as $thisdir) {
if (!is_dir($thisdir) && !@mkdir($thisdir)) {
$msg->addError(array('MODULE_INSTALL', ''.$thisdir.' does not exist. Please create it.'));
} else if (!is_writable($thisdir) && @chmod($thisdir, 0666)) {
$msg->addError(array('MODULE_INSTALL', ''.$thisdir.' is not writeable. On Unix issue the command chmod a+rw.'));
}
}
/******
* the following code checks if there are any errors (generated previously)
* then uses the SqlUtility to run any database queries it needs, ie. to create
* its own tables.
*/
if (!$msg->containsErrors() && file_exists(dirname(__FILE__) . '/module.sql')) {
// deal with the SQL file:
require(AT_INCLUDE_PATH . 'classes/sqlutility.class.php');
$sqlUtility =& new SqlUtility();
/*
* the SQL file could be stored anywhere, and named anything, "module.sql" is simply
* a convention we're using.
*/
$sqlUtility->queryFromFile(dirname(__FILE__) . '/module.sql', TABLE_PREFIX);
}
?>