projects
/
Pman.Base
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
90e57e3
)
performance with counts
author
Alan Knowles
<alan@roojs.com>
Thu, 26 Nov 2020 02:16:44 +0000
(10:16 +0800)
committer
Alan Knowles
<alan@roojs.com>
Thu, 26 Nov 2020 02:16:44 +0000
(10:16 +0800)
Pman.php
patch
|
blob
|
history
Pman/Roo.php
patch
|
blob
|
history
diff --git
a/Pman.php
b/Pman.php
index
06b707e
..
abef5f9
100644
(file)
--- a/
Pman.php
+++ b/
Pman.php
@@
-755,9
+755,11
@@
class Pman extends HTML_FlexyFramework_Page
$mods = $this->modulesList();
$mods = $this->modulesList();
-
+ $is_bootstrap = in_array('BAdmin', $mods);
+
$this->callModules('applyCSSIncludes', $this);
foreach($this->css_includes as $module => $ar) {
$this->callModules('applyCSSIncludes', $this);
foreach($this->css_includes as $module => $ar) {
+
if ($ar) {
$this->assetArrayToHtml( $ar , 'css');
}
if ($ar) {
$this->assetArrayToHtml( $ar , 'css');
}
@@
-768,6
+770,10
@@
class Pman extends HTML_FlexyFramework_Page
foreach($mods as $mod) {
// add the css file..
foreach($mods as $mod) {
// add the css file..
+ if ($is_bootstrap && !file_exists($this->rootDir."/Pman/$mod/is_bootstrap")) {
+ echo '<!-- missing '. $this->rootDir."/Pman/$mod/is_bootstrap - skipping -->";
+ continue;
+ }
$this->outputCSSDir("Pman/$mod","*.css");
}
$this->outputCSSDir("Pman/$mod","*.css");
}
diff --git
a/Pman/Roo.php
b/Pman/Roo.php
index
3cccb1a
..
a173d24
100644
(file)
--- a/
Pman/Roo.php
+++ b/
Pman/Roo.php
@@
-243,12
+243,11
@@
class Pman_Roo extends Pman
// sets map and countWhat
$this->loadMap($x, array(
// sets map and countWhat
$this->loadMap($x, array(
- 'columns' => $_columns,
- 'distinct' => empty($_REQUEST['_distinct']) ? false: $_REQUEST['_distinct'],
- 'exclude' => empty($_REQUEST['_exclude_columns']) ? false: explode(',', $_REQUEST['_exclude_columns'])
- ));
-
-
+ 'columns' => $_columns,
+ 'distinct' => empty($_REQUEST['_distinct']) ? false: $_REQUEST['_distinct'],
+ 'exclude' => empty($_REQUEST['_exclude_columns']) ? false: explode(',', $_REQUEST['_exclude_columns'])
+ ));
+
$this->setFilters($x,$_REQUEST);
if (!$this->checkPerm($x,'S', $_REQUEST)) {
$this->setFilters($x,$_REQUEST);
if (!$this->checkPerm($x,'S', $_REQUEST)) {
@@
-258,8
+257,13
@@
class Pman_Roo extends Pman
//print_r($x);
// build join if req.
//DB_DataObject::debugLevel(1);
//print_r($x);
// build join if req.
//DB_DataObject::debugLevel(1);
- // var_dump($this->countWhat);
- $total = $x->count($this->countWhat);
+ // count with multiple joins and no conditions can be quite slow - so if there are no conditions - just remove the joins from the count.
+ $xx = clone($x);
+ if (empty($xx->_query['condition']) && !empty($xx->_join)) {
+ $xx->_join = '';
+ }
+
+ $total = $xx->count($this->countWhat);
// sorting..
//
//var_dump($total);exit;
// sorting..
//
//var_dump($total);exit;