Source for file ExifAssetIterator.class.php

Documentation is available at ExifAssetIterator.class.php

  1. <?php
  2. /**
  3. * @since 7/20/05
  4. * @package polyphony.repository_importer
  5. *
  6. * @copyright Copyright &copy; 2005, Middlebury College
  7. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  8. *
  9. * @version $Id: ExifAssetIterator.class.php,v 1.8 2007/09/19 14:04:48 adamfranco Exp $
  10. */
  11.  
  12. /**
  13. * <##>
  14. *
  15. * @since 7/20/05
  16. * @package polyphony.repository_importer
  17. *
  18. * @copyright Copyright &copy; 2005, Middlebury College
  19. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  20. *
  21. * @version $Id: ExifAssetIterator.class.php,v 1.8 2007/09/19 14:04:48 adamfranco Exp $
  22. */
  23.  
  24. class ExifAssetIterator
  25. extends HarmoniIterator
  26. {
  27.  
  28. /**
  29. * Constructor
  30. *
  31. * @return object
  32. * @access public
  33. * @since 7/20/05
  34. */
  35. function ExifAssetIterator ($srcDir) {
  36. $this->_addFiles($srcDir);
  37. $this->_current = 0;
  38. }
  39. /**
  40. * checks for existence of next element
  41. *
  42. * @return boolean
  43. * @access public
  44. * @since 7/20/05
  45. */
  46. function hasNext () {
  47. if ($this->_current < count($this->_assetList))
  48. return true;
  49. else
  50. return false;
  51. }
  52. /**
  53. * returns the next element
  54. *
  55. * @return object DOMIT_Node
  56. * @access public
  57. * @since 7/20/05
  58. */
  59. function next() {
  60. $temp =$this->_assetList[$this->_current];
  61. $this->_current++;
  62. return $temp;
  63. }
  64. /**
  65. * Add files to our list.
  66. *
  67. * @param string $dirName
  68. * @return void
  69. * @access public
  70. * @since 7/20/06
  71. */
  72. function _addFiles ($dirName) {
  73. $dirName = preg_replace('/\/$/', '', $dirName).'/';
  74. $toIgnore = array(
  75. "schema.xml",
  76. "__MACOSX",
  77. ".DS_Store"
  78. );
  79. $dir = opendir($dirName);
  80. while($file = readdir($dir)) {
  81. if (ereg('^[^\.]', $file) && !in_array($file, $toIgnore)) {
  82. $path = $dirName.$file;
  83. if (!is_dir($path))
  84. $this->_assetList[] = $path;
  85. else
  86. $this->_addFiles($path);
  87. }
  88. }
  89. closedir($dir);
  90. }
  91. }
  92.  
  93. ?>

Documentation generated on Wed, 19 Sep 2007 10:23:04 -0400 by phpDocumentor 1.3.0RC3