projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #5449 from pratikshad/fixedWebtest4.6
[civicrm-core.git]
/
CRM
/
Core
/
InnoDBIndexer.php
diff --git
a/CRM/Core/InnoDBIndexer.php
b/CRM/Core/InnoDBIndexer.php
index fa6d928a00251d3c911e301e9b2d3611dc62532c..c677414a6d91492dbfb67601170105f9b781b0c3 100644
(file)
--- a/
CRM/Core/InnoDBIndexer.php
+++ b/
CRM/Core/InnoDBIndexer.php
@@
-23,7
+23,7
@@
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+
*/
/**
* The InnoDB indexer is responsible for creating and destroying
/**
* The InnoDB indexer is responsible for creating and destroying
@@
-108,15
+108,25
@@
class CRM_Core_InnoDBIndexer {
*/
protected $isActive;
*/
protected $isActive;
+ /**
+ * Class constructor.
+ *
+ * @param $isActive
+ * @param $indices
+ */
public function __construct($isActive, $indices) {
$this->isActive = $isActive;
$this->indices = $this->normalizeIndices($indices);
}
public function __construct($isActive, $indices) {
$this->isActive = $isActive;
$this->indices = $this->normalizeIndices($indices);
}
+ /**
+ * Fix schema differences.
+ *
+ * Limitation: This won't pick up stale indices on tables which are not
+ * declared in $this->indices. That's not much of an issue for now b/c
+ * we have a static list of tables.
+ */
public function fixSchemaDifferences() {
public function fixSchemaDifferences() {
- // Limitation: This won't pick up stale indices on tables which are not
- // declared in $this->indices. That's not much of an issue for now b/c
- // we have a static list of tables.
foreach ($this->indices as $tableName => $ign) {
$todoSqls = $this->reconcileIndexSqls($tableName);
foreach ($todoSqls as $todoSql) {
foreach ($this->indices as $tableName => $ign) {
$todoSqls = $this->reconcileIndexSqls($tableName);
foreach ($todoSqls as $todoSql) {
@@
-126,7
+136,7
@@
class CRM_Core_InnoDBIndexer {
}
/**
}
/**
- * Determine if an index is expected to exist
+ * Determine if an index is expected to exist
.
*
* @param string $table
* @param array $fields
*
* @param string $table
* @param array $fields
@@
-187,6
+197,7
@@
class CRM_Core_InnoDBIndexer {
* FTS index.
*
* @param $table
* FTS index.
*
* @param $table
+ *
* @return array
* (string $indexName => string $sql)
*/
* @return array
* (string $indexName => string $sql)
*/
@@
-202,9
+213,10
@@
class CRM_Core_InnoDBIndexer {
}
/**
}
/**
- * Generate a "DROP INDEX" statement for each existing FTS index
+ * Generate a "DROP INDEX" statement for each existing FTS index
.
*
* @param string $table
*
* @param string $table
+ *
* @return array
* (string $idxName => string $sql)
*/
* @return array
* (string $idxName => string $sql)
*/
@@
-221,7
+233,8
@@
class CRM_Core_InnoDBIndexer {
* Construct a set of SQL statements which will create (or preserve)
* required indices and destroy unneeded indices.
*
* Construct a set of SQL statements which will create (or preserve)
* required indices and destroy unneeded indices.
*
- * @param $table
+ * @param string $table
+ *
* @return array
*/
public function reconcileIndexSqls($table) {
* @return array
*/
public function reconcileIndexSqls($table) {
@@
-249,7
+262,7
@@
class CRM_Core_InnoDBIndexer {
}
/**
}
/**
- * Put the indices into a normalized format
+ * Put the indices into a normalized format
.
*
* @param $indices
* @return array
*
* @param $indices
* @return array
@@
-266,6
+279,8
@@
class CRM_Core_InnoDBIndexer {
}
/**
}
/**
+ * Setter for isActive.
+ *
* @param bool $isActive
*/
public function setActive($isActive) {
* @param bool $isActive
*/
public function setActive($isActive) {
@@
-273,9
+288,12
@@
class CRM_Core_InnoDBIndexer {
}
/**
}
/**
- * @return boolean
+ * Getter for isActive.
+ *
+ * @return bool
*/
public function getActive() {
return $this->isActive;
}
*/
public function getActive() {
return $this->isActive;
}
+
}
}