Question

I have run the examples scripts from phirehose through terminal and seen the live/active ptint_r of my test tweets. I've loaded up the ghetto queue files and they execute their logging with resounding success. But I can't seem to find where the data went. What file is it actually writing to? The two example files ghetto-queue-collect.php and ghetto-queue-consume.php lead me to believe it is the /tmp directory relative to where the scripts are executing but I see nothing. Any suggestions?

Here are some of the lines from the logs

[03-Mar-2014 02:44:43 America/New_York] Phirehose: Opening new active status stream: /tmp/.phirehose-ghettoqueue.current
[03-Mar-2014 02:45:12 America/New_York] Phirehose: Successfully rotated active stream to queue file: /tmp/phirehose-ghettoqueue.20140303-024512.queue

----- and ------

[03-Mar-2014 03:41:58 America/New_York] Processing file: /tmp/phirehose-ghettoqueue.20140303-024102.queue
[03-Mar-2014 03:41:59 America/New_York] Successfully processed 1 tweets from /tmp/phirehose-ghettoqueue.20140303-024102.queue - deleting.  

-- The bits of code in question, I think --

/**
* Subclass specific constants
*/
const QUEUE_FILE_PREFIX = 'phirehose-ghettoqueue';
const QUEUE_FILE_ACTIVE = '.phirehose-ghettoqueue.current';

public function __construct($username, $password, $queueDir = '/tmp', $rotateInterval = 10)

// Set subclass parameters
$this->queueDir = $queueDir;

// Construct stream file name, log and open
$this->streamFile = $this->queueDir . '/' . self::QUEUE_FILE_ACTIVE;
$this->log('Opening new active status stream: ' . $this->streamFile);
$this->statusStream = fopen($this->streamFile, 'a'); // Append if present (crash recovery)
Was it helpful?

Solution

My post to the author's github revealed that the files are written to the actual /tmp directory relative to your hosting or webserver? I'm not sure exactly but, in addition, the files are hidden through Unix because of a precursory '.'

The data is literally being written to /tmp - if you're on a mac or linux machine, you can see these files by opening terminal and running:

ls -la /tmp/

Alternately, you can set $queueDir to whatever you want in the script.

I was able to find them by using putty.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top