コード例 #1
0
ファイル: files.php プロジェクト: diversen/simple-php-classes
/**
 * function for removing all files in htdocs/files/*, htdocs/logo/*
 * when doing an install
 *
 * @return int  value from exec command
 */
function cos_create_files()
{
    $files_path = conf::pathBase() . '/logs/coscms.log';
    if (!file_exists($files_path)) {
        $command = "touch {$files_path}";
        common::execCommand($command);
    }
    $files_path = conf::pathBase() . '/logs/cron.log';
    if (!file_exists($files_path)) {
        $command = "touch {$files_path}";
        common::execCommand($command);
    }
    $files_path = conf::pathFiles();
    if (!file_exists($files_path)) {
        $command = "mkdir -p {$files_path}";
        common::execCommand($command);
    }
}