Location: PHPKode > projects > WB News > install/functions.php
<?php

/*========================================================*\
||########################################################||
||#                                                      #||
||#     WB News v1.0.0                                   #||
||# ---------------------------------------------------- #||
||#     Copyright (c) 2004-2005                          #||
||#     Created: 26th September 2005                     #||
||#     Filename: functions.php                          #||
||#                                                      #||
||########################################################||
/*========================================================*/

/**
 *  @author $Author: pmcilwaine $
 *	@version $Id: functions.php,v 1.2 2006/04/14 14:23:36 pmcilwaine Exp $
 */

function checkUploadedFiles($path)
{
    
    static $files = array();
    
    if (is_dir($path))
	{
		if (substr($path, -1) == "/")
			$path = substr($path, 0, -1); //get rid of /
		$dh = opendir($path);
		while (($file = readdir($dh)) !== false)
		{
			if ($file != '.' && $file != '..')
			{
				if (is_dir($path."/".$file))
					checkUploadedFiles($path."/".$file);
				else
					$files[$path . "/". $file] = array("is_writable" => (is_writable($path . "/". $file) == true ? 1  : 0));
			}
		}
		return $files;
	}
	else
		return false; //no point in continuing its not a directory bad call somewhere
    
}

/**
    Checks that permissions are correct and all files are uploaded
    @return boolean / array
*/
function checkAllFiles()
{
    if (!file_exists("../config.php"))
        return array("config.php does not exist, please create it and give it write permissions.");
    else if (!is_writable("../config.php"))
        return array("config.php is not writable, you must enable write permissions for the file.");
    else
        return true;
}

?>
Return current item: WB News