Author: ahart
Date: Mon Jul 30 22:28:14 2012
New Revision: 1367341
URL: http://svn.apache.org/viewvc?rev=1367341&view=rev
Log:
resolve OODT-478: patch applied to trunk
Modified:
oodt/trunk/CHANGES.txt
oodt/trunk/balance/etc/skel/hooks.php
oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php
Modified: oodt/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/oodt/trunk/CHANGES.txt?rev=1367341&r1=1367340&r2=1367341&view=diff
==============================================================================
--- oodt/trunk/CHANGES.txt (original)
+++ oodt/trunk/CHANGES.txt Mon Jul 30 22:28:14 2012
@@ -4,6 +4,8 @@ Apache OODT Change Log
Release 0.5
--------------------------------------------
+* OODT-478: Balance: New hook for hooks.php (nhidalgo via ahart)
+
* OODT-476: RemoteSiteFile doesn't always set RemoteSite (bfoster)
* OODT-477: CommonsNetFtpProtocol throws exception on successful download (bfoster)
Modified: oodt/trunk/balance/etc/skel/hooks.php
URL: http://svn.apache.org/viewvc/oodt/trunk/balance/etc/skel/hooks.php?rev=1367341&r1=1367340&r2=1367341&view=diff
==============================================================================
--- oodt/trunk/balance/etc/skel/hooks.php (original)
+++ oodt/trunk/balance/etc/skel/hooks.php Mon Jul 30 22:28:14 2012
@@ -45,6 +45,14 @@
*/
/**
+ * hook_before_all
+ *
+ * This hook is executed before any other hooks. It can be used for any
+ * pre-processing logic.
+ */
+function hook_before_all() {}
+
+/**
* hook_before_header
*
* This hook is executed before the contents of the header file are processed.
Modified: oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php
URL: http://svn.apache.org/viewvc/oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php?rev=1367341&r1=1367340&r2=1367341&view=diff
==============================================================================
--- oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php (original)
+++ oodt/trunk/balance/lib/pear/Core/ApplicationResponse.class.php Mon Jul 30 22:28:14 2012
@@ -86,17 +86,22 @@ class Org_Apache_Oodt_Balance_Core_Appli
);
$options += $defaults;
+ if (!$options['skipHooks']) {
+ // Include the appropriate hooks.php file
+ include ((App::Get()->request->isModule
+ ? App::Get()->request->modulePath
+ : HOME ) . '/hooks.php');
+
+ // Run 'before_all' hook for all requests
+ if (function_exists('hook_before_all')) {
+ hook_before_all();
+ }
+ }
+
// Preprocessing for a view
if (!$this->request->isScript) {
ob_start(); // Start buffering the output
- // Include the appropriate hooks.php file
- if (!$options['skipHooks']) {
- include ((App::Get()->request->isModule
- ? App::Get()->request->modulePath
- : HOME ) . '/hooks.php');
- }
-
// Check that the requested view exists
if (file_exists($this->request->viewPath)) {
|