aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-10-24Add parameter and return types for all PHP methodsThomas Lange10-29/+29
2021-10-24Declare some BigPipe PHP library methods as voidThomas Lange2-14/+14
Class BigPipe\BigPipe: * addPhaseDoneJS Class BigPipe\Pagelet: * addHTML * addResource * addJSCode * addDependency * setTagName * setPlaceholderHTML
2021-10-24Split up BigPipe "enabled" method into two methodsThomas Lange4-12/+15
Split up the "enabled" method of the BigPipe class into two methods, one to check if the pipelining mode is currently enabled ("isEnabled") and another one to enable/disable the pipelining mode ("setEnabled"). This change prevents that a single method has two different jobs, which can be confusing for programmers who didn't wrote the code but only use them. Now there are two clearly named methods for exactly one job.
2021-10-24Reformat PHP code in "getStructure" methodThomas Lange1-1/+5
2021-10-24Rename "tagname" property and "setTagname" methodThomas Lange1-6/+6
Rename the "tagname" property and the "setTagname" method of the Pagelet class to the lowerCamelCase variant "tagName" because it are two words.
2021-10-24Rename misleading parameter "callback" to "code"Thomas Lange1-2/+2
Rename the second parameter for the "addPhaseDoneJS" method of the Item class from the misleading name "callback" to "code" because that method doesn't expect a real JS (or PHP) callback but rather simple JS code.
2021-10-24Fix constructor parameters for Resource classesThomas Lange5-5/+5
The first parameter for the constructor of the Resource classes should not be optional if the next parameters obviously are non-optional. The optional parameters (if any) must come after the required parameters.
2021-10-24Remove closing tags and ensure LF at end of filesThomas Lange20-20/+8
Remove the unnecessary PHP closing tags and ensure that *all* non-binary files ending with an LF character.
2021-03-13Chance URL to the new locationThomas Lange1-1/+1
2018-02-03Rename payload object "dataJSON" to just "data"Thomas Lange1-11/+11
2018-02-03Remove obsolete commentThomas Lange1-3/+0
The method "Pagelet::addDependency()" does not allow anything other than an actual instance of Pagelet as argument (see commit 6550b64a5a6463bd371e13af82db86999b9363cc). The existence of this comment was forgotten and now finally removed.
2018-02-03Make use of the new Application class to create class instancesThomas Lange1-22/+15
2018-02-03Add class "Application"Thomas Lange1-0/+38
This commit adds a new class called "Application". This class will be responsible for creating Pagelet, Stylesheet and Javascript instances, either from the additional Debugging or original BigPipe namespace, based on whether the debugging flag of the application is set to true or false.
2018-02-03Move autoloader for classes into pagelets.phpThomas Lange3-22/+8
This commit moves the "spl_autoload_register" function directly into the pagelets.php to reduce duplicate code within index.php and async.php.
2018-02-03Move check if BigPipe should be disabled into the pagelets.phpThomas Lange3-17/+13
This commit moves the if condition, which checks if the pipelining mode of BigPipe should be disabled, directly into the pagelets.php to reduce duplicate code within index.php and async.php.
2018-02-03Remove the function "removeLineBreaksAndTabs" completelyThomas Lange3-13/+1
2018-02-03Remove sending the "Cache-Control" header on the demo page(s)Thomas Lange2-10/+0
2018-01-28Replace function call "removeLineBreaksAndTabs" with "str_replace"Thomas Lange1-1/+1
This commit replaces the function call of "removeLineBreaksAndTabs" from "Pagelet::flush()" with the direct call of the "str_replace" function. Therefore, you don't need to include the external function "removeLineBreaksAndTabs" (which was located outside the BigPipe namespace) into your project anymore.
2018-01-28Remove superflous function calls from two methodsThomas Lange2-2/+2
This commit removes the superflous function calls "removeLineBreaksAndTabs" from the "Pagelet::getStructure()" and "Item::addPhaseDoneJS()" method. If it bothers you when some properties of the JSON-encoded pagelet object contain line breaks and tabs (visible as "\r", "\n" and "\t"), then you'll need to remove them before you pass the string of javascript code to the corresponding methods: * $Pagelet->addJSCode(removeLineBreaksAndTabs($javascript_code)); * $Pagelet->addPhaseDoneJS(0, removeLineBreaksAndTabs($javascript_code));
2018-01-28Remove superfluous item from pattern arrayThomas Lange1-1/+1
The string "\r\n" within the search array is superfluous because it is already covered by the single "\r" and "\n".
2018-01-26Remove static $count property and use spl_object_hash() insteadThomas Lange2-4/+2
2018-01-26Use custom IDs for stylesheet and javascript resourcesThomas Lange1-6/+6
2018-01-21Move BigPipe::singleResponse() to Pagelet::flush()Thomas Lange2-17/+19
2018-01-21Rename BigPipe::render() to BigPipe::completeResponse()Thomas Lange3-3/+3
2018-01-21Restructure the BigPipe::render() methodThomas Lange1-10/+14
2018-01-21Change the mechanism how BigPipe detects the last pageletThomas Lange2-15/+24
This commit is a preparation for a few further commits and changes the mechanism how the BigPipe javascript library detects the last flushed pagelet from server. Previously, there was a "IS_LAST:true" property in the JSON encoded pagelet object. However, this meant that when the pagelet was sent to the client, the server already needed to know at this point that this is the last pagelet. This can no longer be reliably determined in the future due to smaller restructuring. Instead of sending "IS_LAST:true" within the JSON encoded pagelet object of the last pagelet, the BigPipe::render() method on the server will display a <script> element which calls "BigPipe.onLastPageletArrived()" after all pagelets have been flushed. This call informs the javascript library that the last pagelet has been flushed and arrived at the client. This is required because the BigPipe javascript library otherwise doesn't know that the last pagelet has been arrived (the javascript library waits for all pagelets to be flushed and displayed until it begins to execute the external javascript resources of every pagelet).
2018-01-20Fix inconsistent line separators across filesThomas Lange9-638/+638
The development of this project began several years ago on a Windows system until I switched to GNU\Linux. Therefore, some files contained CRLF as line separators, now replaced with LF.
2018-01-16Use seperate classes for debuggingThomas Lange2-64/+21
The debug mechanism has been changed. Instead of keeping the debug mechanism hardcoded within the core classes, it's now possible and recommended to use the seperate debugging classes which you can modify like you want. Those classes inherit their associated core classes and can add some debugging stuff. This has the advantage of having a clean core code without any debugging stuff. If the debug classes are not used then they shall not be included and their code will not be initialized.
2018-01-16Add debugging classes for Pagelet, Stylesheet and JavascriptThomas Lange3-0/+42
2017-11-23The file permissions have been normalized.Thomas Lange12-0/+0
2017-10-21Code optimization: The method "getStructure" has been added to the abstract ↵Thomas Lange4-21/+37
Item class.
2017-10-07The shorthand methods "addCSS" and "addJS" have been removed. If you need ↵Thomas Lange2-22/+6
shorthand syntax, you can abstract the Pagelet class and use your own extended class which is more flexible and will keep the BigPipe main classes as small as possible.
2017-10-05The method "addDependency" no longer accepts a pagelet ID as a string. You ↵Thomas Lange1-6/+2
must now pass an existing Pagelet instance to the method!
2017-10-04The method "addPagelet" from the BigPipe main class was replaced by the new ↵Thomas Lange2-12/+25
implemented methods "enqueue" and "dequeue" for the new queueing mechanism. The "dequeue" method is currently unused but will be used in the future. The changes in this commit are partially preparations for further commits.
2017-10-04A new method called "getPriority" has been implemented, which returns the ↵Thomas Lange1-0/+9
priority of the corresponding Pagelet instance.
2017-08-27The javascript library is now running in strict mode.Thomas Lange1-0/+1
2017-08-27Optimization: The javascript library has been restructured and is now using ↵Thomas Lange1-198/+202
the "class" keyword which was introduced in ECMAScript 6 (2015) to build the prototypes. In addition, some variables and functions were renamed and declared with the shorthand syntax.
2017-08-26Optimization: Some anonymous callback functions has been simplified with ↵Thomas Lange1-9/+9
arrow functions which were introduced in ECMAScript 6 (2015).
2017-08-25Optimization: Some comments has been optimized and all occurrences of "var" ↵Thomas Lange1-17/+17
has been replaced by the new introduced keyword "let" from ECMAScript 6 (2015), which scopes the variable to the nearest enclosing block instead of the nearest function block.
2017-08-25A missing semicolon has been added and an unused property from the Resource ↵Thomas Lange1-5/+4
prototype was removed.
2017-08-25Optimization: The outsourced function "globalExecution" is no longer ↵Thomas Lange3-12/+2
necessary and has been replaced by a simpler variant inside the BigPipe library.
2017-08-25Bugfix: Javascript code for stopping the current request moved into a ↵Thomas Lange1-1/+5
try/catch block to prevent troubles with some creepy Microsoft browsers.
2017-08-16A new method called "setPlaceholderHTML" was implemented and can be used to ↵Thomas Lange1-1/+9
display custom HTML content immediately while the pagelet is still processing.
2017-08-06The "CSS" and "JS" resource representation classes has been renamed to ↵Thomas Lange1-4/+4
"Stylesheet" and "Javascript" to make it more consistent with the other class names (instead of using the abbreviations).
2017-08-06The "CSS" and "JS" resource representation classes has been renamed to ↵Thomas Lange2-4/+4
"Stylesheet" and "Javascript" to make it more consistent with the other class names (instead of using the abbreviations).
2017-05-26It was forgotten to rename the method call "::enablePipeline()" to ↵Thomas Lange1-1/+1
"::enabled()".
2017-03-08CSS class "hidden" was replaced by the semantic HTML5 attribute "hidden".Thomas Lange2-2/+1
2017-02-25Markdown formatting removed.Thomas Lange1-3/+3
2017-02-25Typo in filename removed.Thomas Lange1-1/+1
2016-10-22The Pagelet representation class in PHP now has a separate method to add ↵Thomas Lange3-6/+21
dependencies (either with the instance of the dependency Pagelet or the unique ID as string as argument).