Skip to content

Instantly share code, notes, and snippets.

@cgdangelo
Created August 22, 2012 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgdangelo/3426906 to your computer and use it in GitHub Desktop.
Save cgdangelo/3426906 to your computer and use it in GitHub Desktop.
wat?
<?php
class X_TigerEDI_Model_Observer_850 extends X_TigerEDI_Model_Observer
{
protected $_ediID = 850;
private $_ediFiles = array();
/**
* @TODO Add response EDIs for generator
*/
public function generateFull()
{
}
public function parse()
{
foreach ($this->_getFilesList() as $ediFile) {
$ediContents = file_get_contents($ediFile);
$ediContents = array_slice(preg_split("/\^/", $ediContents), 0, -1);
var_dump($ediFile);
}
}
protected function _getFilesList()
{
if ($this->_ediFiles === array()) {
$ediFiles = glob(self::TIGEREDI_INCOMING . '*.EDI');
$this->_ediFiles = $ediFiles;
}
return $this->_ediFiles;
}
}
string(54) "/home/x/edi/incoming/file1.EDI"
string(54) "/home/x/edi/incoming/file2.EDI"
NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment