PHP Classes
Icontem

File: setup.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Marius Zadara  >  ExifSort  >  setup.php  
File: setup.php
Role: Auxiliary script
Content type: text/plain
Description: Application setup file
Class: ExifSort
Read EXIF information from picture files
 

Contents

Class file image Download
<?php

/**
 * File used to set-up the source and destionation directories.
 * It also checks the status of the EXIF module into the PHP environment.
 * It is included in index.php
 * 
 * @author Marius Zadara <marius@zadara.org>
 * @copyright (C) Marius Zadara <marius@zadara.org>
 */

// VERIFY THE EXIF MODULE LOADING STATUS //////////////////////////////////////////////////////////
try
{
    
// instanciate the extensions class
    
$extensions = new Extensions();
    
    
// try to locate/load the EXIF module
    // if failed, the function will throw an ExifNotFound exception
    
$exifLoaded $extensions->isLoaded("EXIF");

    
// if reached this point, the EXIF module is enabled
    // clean up the memory used so far
    
unset($extensions$exifLoaded);
}
catch (ExifNotFound $exNotFound)
{
    
// display the exception
    
echo $exNotFound;    
    
    
// clean up the memory
    
unset($exNotFound);
}


// SOURCE DIRECTORY HANDLING //////////////////////////////////////////////////////////////////////
try
{
    
// set the source directory using the constans 
    
$srcDirectory = new MyDirectory(Constants::$SOURCE_DIRECTORY);
    
    
// validate the source directory
    
$validDirectory $srcDirectory->validate(false);
}
catch (DirectoryException $dirEx)
{
    
// display the exception
    
echo $dirEx;
}

// clear the memory used so far
unset($validDirectory);


// DESTINATION DIRECTORY HANDLING /////////////////////////////////////////////////////////////////
try
{
    
// set the destionation directory
    
$destDirectory = new MyDirectory(Constants::$DESTINATION_DIRECTORY);
    
    
// create the destionation directory
    
$validDirectory $destDirectory->create();
}
catch(DirectoryException $dirEx)
{
    
// display the exception
    
echo $dirEx;
}

// clear the memory used
unset($validDirectory);

?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products