public function test__grep__Case_syllabic_inuktitut_query_with_wild_char() { $query_roman = '\\S*valliasimaliratta'; $query_syll = Syllabics::latinAlphabetToUnicode($query_roman, '0'); $grepper = new Grepper($query_roman, $query_syll, 'iu', 'syll'); $this->object->set_grepper($grepper); $grepped = $this->object->_grep(); $expected = 'qimirruvalliasimaliratta:2:25673075:59233783'; $this->assertEquals($expected, $grepped, "The grepping returned a wrong value"); }
public function execute() { try { // checking and establish a live db connector if (empty($this->dbh)) { self::$db = $this->connect(); } $stmt = self::$db->prepare(Stash::getQuery($this->sql_file, $this->sql_type), array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL)); if ($stmt->execute()) { //return $stmt->fetchAll(PDO::FETCH_CLASS); $data = array(); foreach (new LastIterator(new DbRowIterator($stmt)) as $row) { $data[] = $row; } return $data; } } catch (PDOException $exception) { echo self::PDOException($exception, self::DISPLAY_TEXT); } }
break; default: $output = self::default_action(); } /* $user_name = filter_var($_POST['log'], FILTER_SANITIZE_STRING); $user_password = filter_var($_POST['pwd'], FILTER_SANITIZE_STRING); $output = json_encode(array('user_name'=>$user_name, 'user_password'=>$user_password)); echo $output; */ } echo $output; } private static function default_action() { $return = array('type' => 'error', 'msg' => 'ajax-modal-portal directive not supported'); return $return; } private static function login() { $return = json_encode(array('type' => 'sucess', 'msg' => 'the login function was called', 'user_login' => $_POST['log'], 'user_password' => $_POST['pwd'])); $creds = array('user_login' => $_POST['log'], 'user_password' => $_POST['pwd'], 'remember' => true); //return $return; $results = wp_signon($creds); $ret_obj = json_encode($results); return $ret_obj; } } $processor = new ProcessQuery(); $processor->route_request();