includes/search.php
changeset 606 daf8c556ada7
parent 593 4f9bec0d65c1
child 685 17ebe24cdf85
equal deleted inserted replaced
605:d2d4e40ecd29 606:daf8c556ada7
    10  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    10  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    11  *
    11  *
    12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
    13  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    13  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    14  */
    14  */
    15 
       
    16 /**
       
    17  * Implementation of array_merge() that preserves key names. $arr2 takes precedence over $arr1.
       
    18  * @param array $arr1
       
    19  * @param array $arr2
       
    20  * @return array
       
    21  */
       
    22 
       
    23 function enano_safe_array_merge($arr1, $arr2)
       
    24 {
       
    25   $arr3 = $arr1;
       
    26   foreach($arr2 as $k => $v)
       
    27   {
       
    28     $arr3[$k] = $v;
       
    29   }
       
    30   return $arr3;
       
    31 }
       
    32 
    15 
    33 /**
    16 /**
    34  * In Enano versions prior to 1.0.2, this class provided a search function that was keyword-based and allowed boolean searches. It was
    17  * In Enano versions prior to 1.0.2, this class provided a search function that was keyword-based and allowed boolean searches. It was
    35  * cut from Coblynau and replaced with perform_search(), later in this file, because of speed issues. Now mostly deprecated. The only
    18  * cut from Coblynau and replaced with perform_search(), later in this file, because of speed issues. Now mostly deprecated. The only
    36  * thing remaining is the buildIndex function, which is still used by the path manager and the new search framework.
    19  * thing remaining is the buildIndex function, which is still used by the path manager and the new search framework.