Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
cbfa7e61
Commit
cbfa7e61
authored
Nov 12, 2013
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"yii\sphinx\Command" and "yii\sphinx\QueryBuilder" extracted.
parent
7cc182fc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
1 deletion
+28
-1
Command.php
extensions/sphinx/Command.php
+0
-0
Connection.php
extensions/sphinx/Connection.php
+27
-0
QueryBuilder.php
extensions/sphinx/QueryBuilder.php
+0
-0
CommandTest.php
tests/unit/extensions/sphinx/CommandTest.php
+1
-1
No files found.
extensions/sphinx/Command.php
View file @
cbfa7e61
This diff is collapsed.
Click to expand it.
extensions/sphinx/Connection.php
View file @
cbfa7e61
...
...
@@ -10,6 +10,8 @@ namespace yii\sphinx;
/**
* Class Connection
*
* @method Schema getSchema() The schema information for this Sphinx connection
*
* @author Paul Klimov <klimov.paul@gmail.com>
* @since 2.0
*/
...
...
@@ -22,4 +24,28 @@ class Connection extends \yii\db\Connection
'mysqli'
=>
'yii\sphinx\Schema'
,
// MySQL
'mysql'
=>
'yii\sphinx\Schema'
,
// MySQL
];
/**
* Obtains the schema information for the named index.
* @param string $name index name.
* @param boolean $refresh whether to reload the table schema even if it is found in the cache.
* @return IndexSchema index schema information. Null if the named index does not exist.
*/
public
function
getIndexSchema
(
$name
,
$refresh
=
false
)
{
return
$this
->
getSchema
()
->
getIndexSchema
(
$name
,
$refresh
);
}
/**
* Quotes a index name for use in a query.
* If the index name contains schema prefix, the prefix will also be properly quoted.
* If the index name is already quoted or contains special characters including '(', '[[' and '{{',
* then this method will do nothing.
* @param string $name index name
* @return string the properly quoted index name
*/
public
function
quoteIndexName
(
$name
)
{
return
$this
->
getSchema
()
->
quoteIndexName
(
$name
);
}
}
\ No newline at end of file
extensions/sphinx/QueryBuilder.php
View file @
cbfa7e61
This diff is collapsed.
Click to expand it.
tests/unit/extensions/sphinx/CommandTest.php
View file @
cbfa7e61
...
...
@@ -103,7 +103,7 @@ class CommandTest extends SphinxTestCase
'title'
=>
'Test title'
,
'content'
=>
'Test content'
,
'type_id'
=>
2
,
'category'
=>
[
41
,
42
],
//
'category' => [41, 42],
'id'
=>
1
,
]);
$this
->
assertEquals
(
1
,
$command
->
execute
(),
'Unable to execute insert!'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment