PHP Classes

File: config.php

Recommend this page to a friend!
  Classes of Richard Carson   PHP MySQL Image Display   config.php   Download  
File: config.php
Role: Configuration script
Content type: text/plain
Description: Configuration script
Class: PHP MySQL Image Display
Serve images added to a MySQL database table
Author: By
Last change:
Date: 9 years ago
Size: 918 bytes
 

Contents

Class file image Download
<?php
   
/**
     * SQLimg configuration options
     *
     * @package Config
     * @author Richard Carson <rcarson@richardcarson.ca>
     * @copyright Richard Carson, 2014
     */
   
namespace Config;


   
/**
     * The hostname or ip of the mysql DB
     */
   
const DB_HOST = 'localhost';
   
   
/**
     * The username to use with the database
     */
   
const DB_USER = '';
   
   
/**
     * The password to use with the database
     */
   
const DB_PASS = '';
   
   
/**
     * The database name
     */
   
const DB_NAME = '';


   
/**
     * The table into which images are saved
     */
   
const SQLIMG_TABLE = 'sqlimg';

   
/**
     * The length of the generated unique image keys
     */
   
const SQLIMG_KEY_LENGTH = 8;

   
/**
     * The maximum size, in bytes, of an image
     */
   
const SQLIMG_MAX_SIZE = 10485760; # 10mb

    /**
     * The list of allowed image formats
     */
   
function SQLimg_allowed_types() {
        return array(
           
'image/png',
           
'image/jpeg',
           
'image/gif'
       
);
    }
?>