The full BioPHP library file: BiO.php

From Biophp_net

Jump to: navigation, search

#!/usr/bin/php

  1. -------------------------------------------------------------------------------
  2. Title     : BiO.php
  3. Usage     : use it as a source library for BioPHP project.
  4. Function  : This is the Biophp library.
  5. Example   :
  6. Keywords  : BioPHP
  7. Options   :
  8. Author    : Jong Bhak, j@bio.cc

# Category  : library

  1. Reference :
  2. Returns   :
  3. Version   : 20071225
  4. ------------------------------------------------------------------------------

#-------------------------------------------------------------------------------

  1. Title     : copy_folder
  2. Usage     :
  3. Function  :
  4. Example   :
  5. Keywords  :
  6. Options   :
  7. Author    : swizec at swizec dot com
  8. Category  :
  9. Reference :
  10. Returns   :
  11. Version   : 20071225
  12. ------------------------------------------------------------------------------

function copy_folder( $source, $target ){
        if ( is_dir( $source ) ){
            @mkdir( $target );
            $d = dir( $source );
            while ( FALSE !== ( $entry = $d->read() ) ) {
                if ( $entry == '.' || $entry == '..' ){
                    continue;
                }

                $Entry = $source . '/' . $entry;
                if ( is_dir( $Entry ) ){
                    full_copy( $Entry, $target . '/' . $entry );
                    continue;
                }
                copy( $Entry, $target . '/' . $entry );
            }

            $d->close();
        }else {
            copy( $source, $target );
        }
}