aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2016-06-25 15:34:34 +0200
committerThomas Lange <code@nerdmind.de>2016-06-25 15:34:34 +0200
commit21824df56bd13d81f10ac0b86c5cad31def51f3e (patch)
tree5d5e8c29a87c82163d55d139680db359bc5cf839 /index.php
parentc5637489e603c588fca41e2b7bd4345b67914f33 (diff)
downloadbigpipe-21824df56bd13d81f10ac0b86c5cad31def51f3e.tar.gz
bigpipe-21824df56bd13d81f10ac0b86c5cad31def51f3e.tar.xz
bigpipe-21824df56bd13d81f10ac0b86c5cad31def51f3e.zip
Update with new features and code improvements.
+ New classes have been added: "BigPipe\Resource", "BigPipe\Resource\CSS", "BigPipe\Resource\JS". If you wan't to add a resource to a Pagelet, you can now built a new resource object with the "CSS" or "JS" class (the "Resource" class is abstract and the parent class of "CSS" and "JS") and can add PhaseDoneJS callbacks for this resources with "Resource::addPhaseDoneJS()" similar to "Pagelet::addPhaseDoneJS()". To add the resource to your pagelet: "$Pagelet->addResource($Resource)". Of course, you can still use the two SHORT methods "Pagelet::addCSS()" and "Pagelet::addJS()" which needs only one parameter with the resource URL. + Each resource has now PhaseDoneJS callbacks for 3 phases (Object initializied [INIT], Loading started [LOAD], Loading complete [DONE]). + Check your usage of the PhaseDoneJS callback constants of the Pagelet class: These constants have been renamed. + Debugging mode: Just set BigPipe::debugging(TRUE) and each pagelet and resource will be pass through a function which adds PhaseDoneJS callbacks with debug informations (Look now at the Javascript console and enjoy the beautiful colors which makes the debug informations better readable for your eyes. \(o_o)/). + Several code improvements on almost all files.
Diffstat (limited to 'index.php')
-rwxr-xr-xindex.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/index.php b/index.php
index 5f12fd6..2a1b1fd 100755
--- a/index.php
+++ b/index.php
@@ -7,9 +7,13 @@ header('Cache-Control: no-cache, no-store, must-revalidate');
#===============================================================================
# Include classes and functions
#===============================================================================
-require_once 'include/classes/BigPipe/BigPipe.php';
-require_once 'include/classes/BigPipe/Pagelet.php';
-require_once 'include/classes/BigPipe/DemoPagelet.php';
+spl_autoload_register(function($classname) {
+ $classpath = 'include/classes/%s.php';
+ $classname = str_replace('\\', '/', $classname);
+
+ require_once sprintf($classpath, $classname);
+});
+
require_once 'include/functions.php';
#===============================================================================
@@ -44,8 +48,8 @@ require_once 'include/pagelets.php';
</head>
<body>
<h1>BigPipe Demo</h1>
-<p>You see on this page 3 pagelets are getting rendered. Each pagelet has his own CSS and JS resources. The CSS resources change the background color of the pagelet (so you can see the effect when the CSS is loaded). The next step is to load the JS resources and they change the border-radius of the pagelet. After the loading of CSS and JS resources the static JS callback get executed. Additionally, the PhaseDoneJS callbacks performed for each pagelet phase. See the javascript console for more debug informations.</p>
-<p>PhaseDoneJS is a new feature of BigPipe which can execute JS callbacks for each pagelet phase. Each pagelet can have multiple PhaseDoneJS callbacks for each phase. The difference between a PhaseDoneJS callback and a static JS callback ("JS_CODE") is the following: The static JS callback always get executed (regardless of whether the pipeline is enabled or disabled) and can be a main part of the JS from the pagelet. But the PhaseDoneJS callbacks are only executed if the pipeline is enabled. They are suitable for application-specific stuff.</p>
+<p>You see on this page 3 pagelets are getting rendered. Each pagelet has his own CSS and JS resources. The CSS resources change the background color of the pagelet (so you can see the effect when the CSS is loaded). The next step is to replace the content on the placeholder HTML with the Pagelet HTML load the JS resources and they change the border-radius of the pagelet. After the loading of CSS and JS resources the static JS callback get executed. Additionally, the PhaseDoneJS callbacks performed for each pagelet phase. See the javascript console for more debug informations.</p>
+<p>PhaseDoneJS is a new feature of BigPipe which can execute JS callbacks for each pagelet phase. Each pagelet can have multiple PhaseDoneJS callbacks for each phase. The difference between a PhaseDoneJS callback and a static JS callback ("CODE") is the following: The static JS callback always get executed (regardless of whether the pipeline is enabled or disabled) and can be a main part of the JS from the pagelet. But the PhaseDoneJS callbacks are only executed if the pipeline is enabled. They are suitable for application-specific stuff.</p>
<p><strong>Notice:</strong> BigPipe may support the features of the new <em>PHP 7</em> in the future and you may also benefit from the performance boost with <em>PHP 7</em>.</p>