Changeset 17898
- Timestamp:
- 10/03/08 16:57:33 (2 months ago)
- Files:
-
- trunk/midcom/midcom.core/midcom/application.php (modified) (10 diffs)
- trunk/midcom/midcom.core/midcom/baseclasses/core/dbobject.php (modified) (2 diffs)
- trunk/midcom/midcom.core/midcom/helper/_styleloader.php (modified) (6 diffs)
- trunk/midcom/midcom.core/midcom/services/_sessioning.php (modified) (5 diffs)
- trunk/midcom/midcom.core/midcom/services/cache/backend/memcached.php (modified) (6 diffs)
- trunk/midcom/midcom.core/midcom/services/cache/module/content.php (modified) (18 diffs)
- trunk/midcom/midcom.core/midcom/services/dbclassloader.php (modified) (1 diff)
- trunk/midcom/midcom.helper.datamanager2/formmanager.php (modified) (2 diffs)
- trunk/midcom/net.nemein.tag/handler.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.core/midcom/application.php
r17843 r17898 493 493 public function content() 494 494 { 495 496 497 498 debug_push_class(__CLASS__, __FUNCTION__);499 500 495 // Enter Context 501 debug_add("Entering Context 0 (old Context: {$this->_currentcontext})", MIDCOM_LOG_DEBUG);502 496 $oldcontext = $this->_currentcontext; 497 if ($oldcontext != 0) 498 { 499 debug_push_class(__CLASS__, __FUNCTION__); 500 debug_add("Entering Context 0 (old Context: {$this->_currentcontext})", MIDCOM_LOG_DEBUG); 501 debug_pop(); 502 } 503 503 $this->_currentcontext = 0; 504 504 $this->style->enter_context(0); … … 507 507 508 508 // Leave Context 509 debug_add("Leaving Context 0 (new Context: {$oldcontext})", MIDCOM_LOG_DEBUG); 509 if ($oldcontext != 0) 510 { 511 debug_push_class(__CLASS__, __FUNCTION__); 512 debug_add("Leaving Context 0 (new Context: {$oldcontext})", MIDCOM_LOG_DEBUG); 513 debug_pop(); 514 } 515 510 516 $this->style->leave_context(); 511 517 $this->_currentcontext = $oldcontext; 512 513 debug_pop();514 518 } 515 519 … … 1226 1230 private function _output() 1227 1231 { 1228 debug_push_class(__CLASS__, __FUNCTION__);1229 1232 ob_start(); 1230 1233 1231 debug_add("We are operating in Context {$this->_currentcontext}.", MIDCOM_LOG_DEBUG);1234 //debug_add("We are operating in Context {$this->_currentcontext}.", MIDCOM_LOG_DEBUG); 1232 1235 1233 1236 if (!$this->skip_page_style) … … 1238 1241 if ($this->get_context_data(MIDCOM_CONTEXT_REQUESTTYPE) != MIDCOM_REQUEST_CONTENT) 1239 1242 { 1243 debug_push_class(__CLASS__, __FUNCTION__); 1240 1244 debug_add("Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE], MIDCOM_LOG_ERROR); 1245 debug_pop(); 1241 1246 $this->generate_error(MIDCOM_ERRCRIT, "Unkown Request Type encountered:" . $this->_context[$this->current_context][MIDCOM_CONTEXT_REQUESTTYPE]); 1242 1247 } … … 1264 1269 ob_end_clean(); 1265 1270 } 1266 1267 debug_pop();1268 1271 } 1269 1272 … … 1631 1634 || !array_key_exists($key, $this->_context[$contextid][MIDCOM_CONTEXT_CUSTOMDATA][$component])) 1632 1635 { 1633 debug_push("midcom_application::get_custom_context_data");1634 $midcom_errstr = "Requested Key ID $key or the component $componentis invalid.";1635 debug_add($midcom_errstr, MIDCOM_LOG_WARN);1636 debug_pop();1636 //debug_push("midcom_application::get_custom_context_data"); 1637 $midcom_errstr = "Requested Key ID {$key} for the component {$component} is invalid."; 1638 //debug_add($midcom_errstr, MIDCOM_LOG_WARN); 1639 //debug_pop(); 1637 1640 $result = false; 1638 1641 return $result; … … 1671 1674 function substyle_append ($newsub) 1672 1675 { 1673 if ($this->_status < MIDCOM_STATUS_HANDLE) { 1676 if ($this->_status < MIDCOM_STATUS_HANDLE) 1677 { 1674 1678 $this->generate_error(MIDCOM_ERRCRIT, "Cannot do a substyle_append before the HANDLE phase."); 1675 1679 } 1676 1680 1677 debug_push("midcom_application::substyle_append");1678 1679 1681 $current_style = $this->_context[$this->_currentcontext][MIDCOM_CONTEXT_SUBSTYLE]; 1680 1682 1681 1683 if (strlen($current_style) > 0) 1682 $newsub = $current_style . "/" . $newsub; 1683 1684 debug_add("Updating Component Context Substyle from $current_style to $newsub", MIDCOM_LOG_DEBUG); 1684 { 1685 $newsub = $current_style . '/' . $newsub; 1686 } 1687 1688 //debug_push_class(__CLASS__, __FUNCTION__); 1689 //debug_add("Updating Component Context Substyle from '{$current_style}' to '{$newsub}'", MIDCOM_LOG_DEBUG); 1690 //debug_pop(); 1685 1691 1686 1692 $this->_context[$this->_currentcontext][MIDCOM_CONTEXT_SUBSTYLE] = $newsub; 1687 debug_pop();1688 1693 } 1689 1694 … … 2271 2276 } 2272 2277 2273 debug_push("midcom_application::serve_attachment");2274 2275 2278 // Sanity check expires 2276 2279 if ( !is_int($expires) 2277 2280 || $expires < -1) 2278 2281 { 2279 $this->generate_error(MIDCOM_ERRCRIT, "\$expires has to be a positive integer or zero or -1 .");2282 $this->generate_error(MIDCOM_ERRCRIT, "\$expires has to be a positive integer or zero or -1, is now {$expires}."); 2280 2283 // This will exit() 2281 2284 } … … 2296 2299 { 2297 2300 2298 debug_add('_check_not_modified returned true, finishing up here then');2301 //debug_add('_check_not_modified returned true, finishing up here then'); 2299 2302 if (!headers_sent()) 2300 2303 { 2301 debug_add('For the weirdest reason headers have not been sent by _check_not_modified, send them again');2304 //debug_add('For the weirdest reason headers have not been sent by _check_not_modified, send them again'); 2302 2305 $this->cache->content->cache_control_headers(); 2303 2306 // Doublemakesure these are present … … 2306 2309 } 2307 2310 while(@ob_end_flush()); 2308 debug_add('headers sent, exit()ing so nothing has a chance the mess things up anymore');2309 debug_pop();2311 //debug_add('headers sent, exit()ing so nothing has a chance the mess things up anymore'); 2312 //debug_pop(); 2310 2313 exit(); 2311 2314 } trunk/midcom/midcom.core/midcom/baseclasses/core/dbobject.php
r17869 r17898 1561 1561 if (! $_MIDCOM->auth->can_do('midgard:read', $object)) 1562 1562 { 1563 debug_push_class($object, __FUNCTION__);1564 debug_add("Failed to load object, read privilege on the {$object->__table__} ID {$object->id} not granted for the current user.",1565 MIDCOM_LOG_ERROR);1563 //debug_push_class($object, __FUNCTION__); 1564 //debug_add("Failed to load object, read privilege on the {$object->__table__} ID {$object->id} not granted for the current user.", 1565 // MIDCOM_LOG_ERROR); 1566 1566 midcom_baseclasses_core_dbobject::_clear_object($object); 1567 debug_pop();1567 //debug_pop(); 1568 1568 return false; 1569 1569 } … … 1580 1580 else 1581 1581 { 1582 debug_push_class($object, __FUNCTION__);1583 debug_add("Failed to load the record identified by path {$path}, last Midgard error was: " . mgd_errstr(), MIDCOM_LOG_INFO);1584 debug_pop();1582 //debug_push_class($object, __FUNCTION__); 1583 //debug_add("Failed to load the record identified by path {$path}, last Midgard error was: " . mgd_errstr(), MIDCOM_LOG_INFO); 1584 //debug_pop(); 1585 1585 return false; 1586 1586 } trunk/midcom/midcom.core/midcom/helper/_styleloader.php
r17558 r17898 61 61 * @package midcom 62 62 */ 63 class midcom_helper__styleloader { 64 65 /** 66 * @ignore 67 */ 68 var $_debug_prefix; 69 63 class midcom_helper__styleloader 64 { 70 65 /** 71 66 * Current style scope … … 152 147 function __construct() 153 148 { 154 $this->_debug_prefix = "midcom_helper__styleloader::";155 156 149 $this->_context = array (); 157 150 $this->_scope = array (); … … 208 201 function get_style_id_from_path($path, $rootstyle = 0) 209 202 { 210 debug_push_class(__CLASS__, __FUNCTION__);211 212 203 $path = preg_replace("/^\/(.*)/", "$1", $path); // leading "/" 213 204 $path_array = explode('/', $path); … … 526 517 { 527 518 debug_push_class(__CLASS__, __FUNCTION__); 528 debug_add("Trying to show ' $path' but there is no context set", MIDCOM_LOG_INFO);519 debug_add("Trying to show '{$path}' but there is no context set", MIDCOM_LOG_INFO); 529 520 debug_pop(); 530 521 return false; … … 640 631 { 641 632 debug_push_class(__CLASS__, __FUNCTION__); 642 debug_add("The element {$path}could not be found.", MIDCOM_LOG_INFO);633 debug_add("The element '{$path}' could not be found.", MIDCOM_LOG_INFO); 643 634 debug_pop(); 644 635 return false; … … 789 780 function prepend_styledir ($dirname) 790 781 { 791 if (!file_exists(MIDCOM_ROOT . $dirname)) { 792 $_MIDCOM->generate_error(MIDCOM_ERRCRIT,"Styledirectory $dirname does not exist!"); 782 if (!file_exists(MIDCOM_ROOT . $dirname)) 783 { 784 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Style directory {$dirname} does not exist."); 793 785 } 794 786 $this->_styledirs_prepend[] = $dirname; trunk/midcom/midcom.core/midcom/services/_sessioning.php
r17686 r17898 65 65 if ($started) 66 66 { 67 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "MidCOM Sessioning has already been started, it must not be started twice. Aborting");67 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "MidCOM Sessioning has already been started, it must not be started twice. Aborting"); 68 68 } 69 69 70 70 $started = true; 71 72 71 } 73 72 … … 120 119 121 120 // Check for session data and load or initialize it, if necessary 122 if (! array_key_exists( "midcom_session_data", $_SESSION))123 { 124 $_SESSION[ "midcom_session_data"] = Array();125 $_SESSION[ "midcom_session_data"]["midcom.service.sessioning"]["startup"] = serialize(time());121 if (! array_key_exists('midcom_session_data', $_SESSION)) 122 { 123 $_SESSION['midcom_session_data'] = Array(); 124 $_SESSION['midcom_session_data']['midcom.service.sessioning']['startup'] = serialize(time()); 126 125 } 127 126 $initialized = true; … … 138 137 * @return boolean Indicating availability. 139 138 */ 140 function exists ($domain, $key)139 function exists($domain, $key) 141 140 { 142 141 if (!$this->_initialize()) … … 144 143 return false; 145 144 } 146 if (! array_key_exists($domain, $_SESSION["midcom_session_data"]))145 if (!isset($_SESSION['midcom_session_data'][$domain])) 147 146 { 148 147 debug_push_class(__CLASS__, __FUNCTION__); 149 debug_add("Request for the domain [{$domain}]failed, because the domain doesn't exist.");148 debug_add("Request for the domain '{$domain}' failed, because the domain doesn't exist."); 150 149 debug_pop(); 151 150 return false; 152 151 } 153 152 154 if (! array_key_exists($key, $_SESSION["midcom_session_data"][$domain])) 155 { 156 debug_push_class(__CLASS__, __FUNCTION__); 157 debug_add("Request for the key [{$key}] in the domain [{$domain}] failed, because the key doesn't exist."); 158 debug_pop(); 153 if (!isset($_SESSION['midcom_session_data'][$domain][$key])) 154 { 159 155 return false; 160 156 } … … 203 199 else 204 200 { 201 debug_push_class(__CLASS__, __FUNCTION__); 202 debug_add("Request for the key '{$key}' in the domain '{$domain}' failed, because the key doesn't exist."); 203 debug_pop(); 205 204 return null; 206 205 } trunk/midcom/midcom.core/midcom/services/cache/backend/memcached.php
r17556 r17898 57 57 * @var Memcache 58 58 */ 59 var $_cache = null;59 static $memcache = null; 60 60 61 61 /** … … 96 96 97 97 // Open the persistant connection. 98 $this->_cache = new Memcache(); 99 if (! @$this->_cache->pconnect($this->_host, $this->_port)) 100 { 101 // Memcache connection failed 102 if ($this->_abort_on_fail) 98 if (is_null(self::$memcache)) 99 { 100 self::$memcache = new Memcache(); 101 if (! @self::$memcache->pconnect($this->_host, $this->_port)) 103 102 { 104 // Abort the request 105 /** 106 * We don't have the superglobal initialized yet 107 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "memcache handler: Failed to connect to {$this->_host}:{$this->_port}."); 108 */ 109 header('HTTP/1.0 503 Service Unavailable'); 110 header('Retry-After: 60'); 111 header('Cache-Control: no-store, no-cache, must-revalidate'); 112 header('Cache-Control: post-check=0, pre-check=0', false); 113 header('Pragma: no-cache'); 114 die("memcache handler: Failed to connect to {$this->_host}:{$this->_port}."); 115 // This will exit. 103 // Memcache connection failed 104 if ($this->_abort_on_fail) 105 { 106 // Abort the request 107 /** 108 * We don't have the superglobal initialized yet 109 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "memcache handler: Failed to connect to {$this->_host}:{$this->_port}."); 110 */ 111 header('HTTP/1.0 503 Service Unavailable'); 112 header('Retry-After: 60'); 113 header('Cache-Control: no-store, no-cache, must-revalidate'); 114 header('Cache-Control: post-check=0, pre-check=0', false); 115 header('Pragma: no-cache'); 116 die("memcache handler: Failed to connect to {$this->_host}:{$this->_port}."); 117 // This will exit. 118 } 119 120 // Otherwise we just skip caching 121 debug_push_class(__CLASS__, __FUNCTION__); 122 debug_add("memcache handler: Failed to connect to {$this->_host}:{$this->_port}. Serving this request without cache.", MIDCOM_LOG_ERROR); 123 debug_pop(); 124 $this->_memcache_operational = false; 116 125 } 117 118 // Otherwise we just skip caching119 debug_push_class(__CLASS__, __FUNCTION__);120 debug_add("memcache handler: Failed to connect to {$this->_host}:{$this->_port}. Serving this request without cache.", MIDCOM_LOG_ERROR);121 debug_pop();122 $this->_memcache_operational = false;123 126 } 124 127 125 128 /* 126 129 debug_push_class(__CLASS__, __FUNCTION__); 127 debug_print_r('Current MemCache stats:', $this->_cache->getStats());130 debug_print_r('Current MemCache stats:', self::$memcache->getStats()); 128 131 debug_pop(); 129 132 */ … … 151 154 /* TODO: Remove when done 152 155 debug_push_class(__CLASS__, __FUNCTION__); 153 debug_add("Returning \ $this->_cache->get('{$key}')");154 debug_pop(); 155 */ 156 return (@ $this->_cache->get($key));156 debug_add("Returning \self::$memcache->get('{$key}')"); 157 debug_pop(); 158 */ 159 return (@self::$memcache->get($key)); 157 160 } 158 161 … … 169 172 /* TODO: Remove when done 170 173 debug_push_class(__CLASS__, __FUNCTION__); 171 debug_add("Returning \ $this->_cache->set('{$key}', \$data, 0, {$timeout})");174 debug_add("Returning \self::$memcache->set('{$key}', \$data, 0, {$timeout})"); 172 175 debug_pop(); 173 176 */ 174 @ $this->_cache->set($key, $data, 0, $timeout);175 return; 176 } 177 /* TODO: Remove when done 178 debug_push_class(__CLASS__, __FUNCTION__); 179 debug_add("Returning \ $this->_cache->set('{$key}', \$data)");180 debug_pop(); 181 */ 182 @ $this->_cache->set($key, $data);177 @self::$memcache->set($key, $data, 0, $timeout); 178 return; 179 } 180 /* TODO: Remove when done 181 debug_push_class(__CLASS__, __FUNCTION__); 182 debug_add("Returning \self::$memcache->set('{$key}', \$data)"); 183 debug_pop(); 184 */ 185 @self::$memcache->set($key, $data); 183 186 } 184 187 … … 193 196 /* TODO: Remove when done 194 197 debug_push_class(__CLASS__, __FUNCTION__); 195 debug_add("Returning \ $this->_cache->delete('{$key}')");196 debug_pop(); 197 */ 198 @ $this->_cache->delete($key);198 debug_add("Returning \self::$memcache->delete('{$key}')"); 199 debug_pop(); 200 */ 201 @self::$memcache->delete($key); 199 202 } 200 203 … … 207 210 208 211 debug_push_class(__CLASS__, __FUNCTION__); 209 debug_add("Calling \ $this->_cache->flush()");210 $stat = @ $this->_cache->flush();211 debug_add("\ $this->_cache->flush() returnder with " . (int)$stat);212 debug_add("Calling \self::$memcache->flush()"); 213 $stat = @self::$memcache->flush(); 214 debug_add("\self::$memcache->flush() returnder with " . (int)$stat); 212 215 debug_pop(); 213 216 } trunk/midcom/midcom.core/midcom/services/cache/module/content.php
r17888 r17898 399 399 break; 400 400 default: 401 debug_add("Cache headers strategy '{$this->_headers_strategy}' is not valid, try 'no-cache', 'revalidate', 'public' or 'private'", MIDCOM_LOG_ERROR); 401 $message = "Cache headers strategy '{$this->_headers_strategy}' is not valid, try 'no-cache', 'revalidate', 'public' or 'private'"; 402 debug_push_class(__CLASS__, __FUNCTION__); 403 debug_add($message, MIDCOM_LOG_ERROR); 404 debug_pop(); 402 405 $this->no_cache(); 403 406 /* Copied from midcom_application::generate_error, because we do not yet have midcom fully loaded */ 404 $message = "Cache headers strategy '{$this->_headers_strategy}' is not valid, try 'no-cache', 'revalidate', 'public' or 'private'";405 407 $title = "Server Error"; 406 408 $code = 500; … … 541 543 $this->_meta_cache->close(); 542 544 debug_push_class(__CLASS__, __FUNCTION__); 543 debug_add( "Current page is in cache, but has expired.", MIDCOM_LOG_INFO);545 debug_add('Current page is in cache, but has expired on ' . gmdate('c', $data['expires']), MIDCOM_LOG_INFO); 544 546 debug_pop(); 545 547 return; 546 548 } 547 549 } 550 548 551 $this->_meta_cache->close(); 549 552 header("X-MidCOM-meta-cache: HIT {$content_id}", false); … … 559 562 $this->_data_cache->close(); 560 563 debug_push_class(__CLASS__, __FUNCTION__); 561 debug_add("Current page is in not in the data cache, (possible ghost read).", MIDCOM_LOG_WARN);564 debug_add("Current page is in not in the data cache, possible ghost read.", MIDCOM_LOG_WARN); 562 565 debug_pop(); 563 566 return; 564 567 } 568 565 569 header("X-MidCOM-data-cache: HIT {$content_id}"); 566 570 $content = $this->_data_cache->get($content_id); … … 784 788 function invalidate($guid) 785 789 { 786 debug_push_class(__CLASS__, __FUNCTION__);787 790 $this->_meta_cache->open(); 788 791 789 792 if (!$this->_meta_cache->exists($guid)) 790 793 { 791 debug_add("no entry for {$guid} in meta cache"); 794 debug_push_class(__CLASS__, __FUNCTION__); 795 debug_add("No entry for {$guid} in meta cache, ignoring invalidation request."); 792 796 debug_pop(); 793 797 return; … … 800 804 if ($this->_meta_cache->exists($content_id)) 801 805 { 802 debug_add("Removing key {$content_id} from meta cache"); 806 //debug_push_class(__CLASS__, __FUNCTION__); 807 //debug_add("Removing key {$content_id} from meta cache"); 808 //debug_pop() 803 809 $this->_meta_cache->remove($content_id); 804 810 } … … 806 812 if ($this->_data_cache->exists($content_id)) 807 813 { 808 debug_add("Removing key {$content_id} from data cache"); 814 //debug_push_class(__CLASS__, __FUNCTION__); 815 //debug_add("Removing key {$content_id} from data cache"); 816 //debug_pop(); 809 817 $this->_data_cache->remove($content_id); 810 818 } 811 819 } 812 debug_pop();813 820 } 814 821 … … 1086 1093 function check_dl_hit(&$context, &$dl_config) 1087 1094 { 1088 debug_push_class(__CLASS__, __FUNCTION__);1095 //debug_push_class(__CLASS__, __FUNCTION__); 1089 1096 if ( $this->_no_cache 1090 1097 || $this->_live_mode) 1091 1098 { 1092 debug_add('no_cache/live mode, not checking any further');1093 debug_pop();1094 1099 return false; 1095 1100 } 1096 1101 $dl_request_id = 'DL' . $this->generate_request_identifier($context, $dl_config); 1097 debug_add("Checking if we have '{$dl_request_id}' in \$this->_meta_cache");1102 //debug_add("Checking if we have '{$dl_request_id}' in \$this->_meta_cache"); 1098 1103 $this->_meta_cache->open(); 1099 1104 if ($this->_meta_cache->exists($dl_request_id)) … … 1102 1107 $this->_meta_cache->close(); 1103 1108 $this->_data_cache->open(); 1104 debug_add("Checking if we have '{$dl_content_id}' in \$this->_data_cache");1109 //debug_add("Checking if we have '{$dl_content_id}' in \$this->_data_cache"); 1105 1110 if ($this->_data_cache->exists($dl_content_id)) 1106 1111 { 1107 debug_add('Cached content found, serving it');1112 //debug_add('Cached content found, serving it'); 1108 1113 echo $this->_data_cache->get($dl_content_id); 1109 1114 $this->_data_cache->close(); … … 1111 1116 return true; 1112 1117 } 1113 debug_add("We received content_id ({$dl_content_id}), but did not find corresponding data in cache", MIDCOM_LOG_INFO);1118 //debug_add("We received content_id ({$dl_content_id}), but did not find corresponding data in cache", MIDCOM_LOG_INFO); 1114 1119 $this->_data_cache->close(); 1115 1120 } … … 1118 1123 $this->_meta_cache->close(); 1119 1124 } 1120 debug_pop();1125 //debug_pop(); 1121 1126 return false; 1122 1127 } … … 1124 1129 function store_dl_content(&$context, &$dl_config, &$dl_cache_data) 1125 1130 { 1126 debug_push_class(__CLASS__, __FUNCTION__);1131 //debug_push_class(__CLASS__, __FUNCTION__); 1127 1132 if ( $this->_no_cache 1128 1133 || $this->_live_mode) 1129 1134 { 1130 debug_add('no_cache/live mode, not storing data');1131 debug_pop();1132 1135 return; 1133 1136 } 1134 1137 if ($this->_uncached) 1135 1138 { 1136 debug_add('Uncached mode, not storing data');1137 debug_pop();1138 1139 return; 1139 1140 } … … 1147 1148 $this->_data_cache->open(true); 1148 1149 $this->_meta_cache->put($dl_request_id, $dl_content_id); 1149 debug_add("Writing cache entry for '{$dl_content_id}' in request '{$dl_request_id}'");1150 //debug_add("Writing cache entry for '{$dl_content_id}' in request '{$dl_request_id}'"); 1150 1151 $this->_data_cache->put($dl_content_id, $dl_cache_data); 1151 1152 // Cache where the object have been … … 1155 1156 $this->_data_cache->close(); 1156 1157 unset($dl_cache_data, $dl_content_id, $dl_request_id); 1157 debug_pop();1158 //debug_pop(); 1158 1159 } 1159 1160 … … 1252 1253 1253 1254 debug_push_class(__CLASS__, __FUNCTION__); 1254 debug_add("Setting last modified to the timestamp {$time} which is: " . gmdate("D, d M Y H:i:s", $time) . ' GMT');1255 debug_add("Setting last modified to " . gmdate('c', $time)); 1255 1256 debug_pop(); 1256 1257 1257 $header = "Last-Modified: " . gmdate( "D, d M Y H:i:s", $time) . ' GMT';1258 $header = "Last-Modified: " . gmdate('D, d M Y H:i:s', $time) . ' GMT'; 1258 1259 header ($header); 1259 1260 $this->_sent_headers[] = $header; … … 1270 1271 function cache_control_headers() 1271 1272 { 1272 debug_push_class(__CLASS__, __FUNCTION__);1273 //debug_push_class(__CLASS__, __FUNCTION__); 1273 1274 // Add Expiration and Cache Control headers 1274 1275 $cache_control = false; … … 1331 1332 header ($header); 1332 1333 $this->_sent_headers[] = $header; 1333 debug_add("Added Header '{$header}'");1334 //debug_add("Added Header '{$header}'"); 1334 1335 } 1335 1336 if ($pragma !== false) … … 1338 1339 header ($header); 1339 1340 $this->_sent_headers[] = $header; 1340 debug_add("Added Header '{$header}'");1341 //debug_add("Added Header '{$header}'"); 1341 1342 } 1342 1343 if ($expires !== false) … … 1345 1346 header ($header); 1346 1347 $this->_sent_headers[] = $header; 1347 debug_add("Added Header '{$header}'");1348 } 1349 debug_pop();1348 //debug_add("Added Header '{$header}'"); 1349 } 1350 //debug_pop(); 1350 1351 } 1351 1352 } trunk/midcom/midcom.core/midcom/services/dbclassloader.php
r17869 r17898 1239 1239 1240 1240 if ( !empty($component) 1241 && isset($_MIDCOM->componentloader->manifests[$component])) 1242 { 1243 debug_push_class(__CLASS__, __FUNCTION__); 1244 debug_add("Loading component {$component} to get DBA class {$classname}.", MIDCOM_LOG_INFO); 1241 && isset($_MIDCOM->componentloader->manifests[$component]) 1242 && !$_MIDCOM->componentloader->is_loaded($component)) 1243 { 1244 //debug_push_class(__CLASS__, __FUNCTION__); 1245 //debug_add("Loading component {$component} to get DBA class {$classname}.", MIDCOM_LOG_INFO); 1245 1246 $_MIDCOM->componentloader->load_graceful($component); 1246 debug_pop();1247 //debug_pop(); 1247 1248 return true; 1248 1249 } trunk/midcom/midcom.helper.datamanager2/formmanager.php
r17858 r17898 175 175 function _load_type_qfrules($fieldname) 176 176 { 177 static $initialized = array(); 178 177 179 $config = $this->_schema->fields[$fieldname]; 178 180 $filename = MIDCOM_ROOT . "/midcom/helper/datamanager2/QuickForm_rules/{$config['type']}.php"; 179 181 $classname = "midcom_helper_datamanager2_qfrule_{$config['type']}_manager"; 180 if ( class_exists($classname))182 if (!isset($initialized[$classname])) 181 183 { 182 184 // We have already initialized rules for this type … … 188 190 return; 189 191 } 190 include _once($filename);192 include($filename); 191 193 $manager = new $classname(); 192 194 $manager->register_rules($this->form); 195 $initialized[$classname] = true; 193 196 } 194 197 trunk/midcom/net.nemein.tag/handler.php
r17813 r17898 266 266 $qb = net_nemein_tag_link_dba::new_query_builder(); 267 267 $qb->add_constraint('fromGuid', '=', $guid); 268 if (class_exists('midgard_query_builder')) 269 { 270 // 1.8 branch allows ordering by linked properties 271 // PONDER: Order by metadata->navorder or by tag alpha ?? 272 $qb->add_order('tag.tag', 'ASC'); 273 } 268 $qb->add_order('tag.tag', 'ASC'); 274 269 $links = $qb->execute(); 275 270 if (!is_array($links)) … … 286 281 $tags[$tagname] = $tag->url; 287 282 } 288 debug_push_class(__CLASS__, __FUNCTION__);289 debug_print_r("Tags for {$guid}: ", $tags);290 debug_pop();291 283 return $tags; 292 284 }
