Skip to content

Instantly share code, notes, and snippets.

@pjbeardsley
pjbeardsley / gist:4716592
Last active December 12, 2015 04:48
PHP: long running process with closed connection
<?php
set_time_limit(0);
ignore_user_abort(TRUE);
// return the headers and close the connection, but keep running.
ob_start();
fJSON::output(array('success' => 'T', 'message' => 'The full synchronization process has started.'));
$length = ob_get_length();
@pjbeardsley
pjbeardsley / fJSONP.php
Created July 11, 2012 14:21
fJSONP.php
<?php
/**
* Extension to Flourish fJSON class to provide methods for JSONP support.
*
* @package Flourish
*/
class fJSONP extends fJSON {
/**
* Overrides fJSON::sendHeader() to send a text/javascript response instead.
*
@pjbeardsley
pjbeardsley / fRecordSet.php.patch
Created July 11, 2012 14:13
fRecordSet.php.patch
Index: fRecordSet.php
===================================================================
--- fRecordSet.php (revision 71)
+++ fRecordSet.php (working copy)
@@ -1638,20 +1638,26 @@
if (isset($relationship['join_table'])) {
$table_to_join = $relationship['join_table'];
- $column_to_join = $relationship['join_table'] . '.' . $relationship['join_column'];
+ $column_to_join = $relationship['join_column'];
@pjbeardsley
pjbeardsley / fXML.php.patch
Created July 11, 2012 14:11
fXML.php.patch
Index: fXML.php
===================================================================
--- fXML.php (revision 71)
+++ fXML.php (working copy)
@@ -233,17 +233,17 @@
'__sleep' => TRUE,
'__toString' => TRUE,
'__wakeup' => TRUE,
- 'addCustomPrefix' => TRUE,
+ 'addCustomPrefix' => TRUE,
@pjbeardsley
pjbeardsley / fTemplating.php.patch
Created July 11, 2012 14:10
fTemplating.php.patch
Index: fTemplating.php
===================================================================
--- fTemplating.php (revision 71)
+++ fTemplating.php (working copy)
@@ -100,6 +100,20 @@
* @var integer
*/
private $buffered_id;
+
+ /**
@pjbeardsley
pjbeardsley / fRequest.php.patch
Created July 11, 2012 14:09
fRequest.php.patch
Index: fRequest.php
===================================================================
--- fRequest.php (revision 71)
+++ fRequest.php (working copy)
@@ -10,13 +10,15 @@
*
* @copyright Copyright (c) 2007-2011 Will Bond, others
* @author Will Bond [wb] <will@flourishlib.com>
+ * @author Will Bond, iMarc LLC [wb-imarc] <will@imarc.net>
* @author Alex Leeds [al] <alex@kingleeds.com>
@pjbeardsley
pjbeardsley / fPagination.php.patch
Created July 11, 2012 14:07
fPagination.php.patch
Index: fPagination.php
===================================================================
--- fPagination.php (revision 71)
+++ fPagination.php (working copy)
@@ -373,23 +373,44 @@
);
}
+ $size = self::$templates[$template]['size'];
if (self::$templates[$template]['type'] == 'without_first_last') {
@pjbeardsley
pjbeardsley / fEmail.php.patch
Created July 11, 2012 14:04
fEmail.php.patch
Index: fEmail.php
===================================================================
--- fEmail.php (revision 71)
+++ fEmail.php (working copy)
@@ -12,12 +12,15 @@
* @copyright Copyright (c) 2008-2011 Will Bond, others
* @author Will Bond [wb] <will@flourishlib.com>
* @author Bill Bushee, iMarc LLC [bb-imarc] <bill@imarc.net>
* @author netcarver [n] <fContrib@netcarving.com>
* @license http://flourishlib.com/license
@pjbeardsley
pjbeardsley / fDirectory.php.patch
Created July 11, 2012 14:02
fDirectory.php.patch
Index: fDirectory.php
===================================================================
--- fDirectory.php (revision 71)
+++ fDirectory.php (working copy)
@@ -237,7 +237,7 @@
rmdir($this->directory);
- fFilesystem::updateDeletedMap($this->directory, debug_backtrace());
+ fFilesystem::updateDeletedMap($this->directory, fCore::backtrace());
@pjbeardsley
pjbeardsley / fFile.php.patch
Created July 11, 2012 14:01
fFile.php.patch
===================================================================
--- fFile.php (revision 71)
+++ fFile.php (working copy)
@@ -740,7 +740,7 @@
unlink($this->file);
- fFilesystem::updateDeletedMap($this->file, debug_backtrace());
+ fFilesystem::updateDeletedMap($this->file, fCore::backtrace());