Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ajgarlag/zf1
...
head fork: ajgarlag/zf1
  • 3 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
14 documentation/manual/en/module_specs/Zend_Search_Lucene-Searching.xml
@@ -72,6 +72,20 @@ $index->find($query);
]]></programlisting>
<para>
+ You can also search multiple indexes simultaneously using MultiSearcher, which operates
+ using the same <acronym>API</acronym> as searching on a single index:
+ </para>
+
+ <programlisting language="php"><![CDATA[
+$multi = new Zend_Search_Lucene_MultiSearcher();
+$multi->addIndex(Zend_Search_Lucene::open('/data/my_index_one');
+$multi->addIndex(Zend_Search_Lucene::open('/data/my_index_two');
+
+$multi->find($query);
+]]></programlisting>
+
+
+ <para>
The <methodname>Zend_Search_Lucene::find()</methodname> method determines the input type
automatically and uses the query parser to construct an appropriate
<classname>Zend_Search_Lucene_Search_Query</classname> object from an input of type
View
4 library/Zend/Dom/Query.php
@@ -124,6 +124,10 @@ public function setDocument($document, $encoding = null)
}
// breaking XML declaration to make syntax highlighting work
if ('<' . '?xml' == substr(trim($document), 0, 5)) {
+ if (preg_match('/\?'.'>\s+<html[^>]*xmlns="([^"]+)"[^>]*>/i', $document, $matches)) {
+ $this->_xpathNamespaces[] = $matches[1];
+ return $this->setDocumentXhtml($document, $encoding);
+ }
return $this->setDocumentXml($document, $encoding);
}
if (strstr($document, 'DTD XHTML')) {
View
34 library/Zend/Gdata/YouTube.php
@@ -256,7 +256,7 @@ public function getVideoFeed($location = null)
if ($location == null) {
$uri = self::VIDEO_URI;
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -286,7 +286,7 @@ public function getVideoEntry($videoId = null, $location = null,
$uri = self::VIDEO_URI . "/" . $videoId;
}
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -324,7 +324,7 @@ public function getRelatedVideoFeed($videoId = null, $location = null)
$uri = self::VIDEO_URI . "/" . $videoId . "/" .
self::RELATED_URI_SUFFIX;
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -346,7 +346,7 @@ public function getVideoResponseFeed($videoId = null, $location = null)
$uri = self::VIDEO_URI . "/" . $videoId . "/" .
self::RESPONSES_URI_SUFFIX;
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -367,7 +367,7 @@ public function getVideoCommentFeed($videoId = null, $location = null)
if ($videoId !== null) {
$uri = self::VIDEO_URI . "/" . $videoId . "/comments";
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -398,7 +398,7 @@ public function getTopRatedVideoFeed($location = null)
$location->setFeedType('top rated');
}
}
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -430,7 +430,7 @@ public function getMostViewedVideoFeed($location = null)
$location->setFeedType('most viewed');
}
}
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -461,7 +461,7 @@ public function getRecentlyFeaturedVideoFeed($location = null)
$location->setFeedType('recently featured');
}
}
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -493,7 +493,7 @@ public function getWatchOnMobileVideoFeed($location = null)
$location->setFeedType('watch on mobile');
}
}
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -513,7 +513,7 @@ public function getPlaylistListFeed($user = null, $location = null)
if ($user !== null) {
$uri = self::USER_URI . '/' . $user . '/playlists';
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -531,7 +531,7 @@ public function getPlaylistListFeed($user = null, $location = null)
public function getPlaylistVideoFeed($location)
{
if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -551,7 +551,7 @@ public function getSubscriptionFeed($user = null, $location = null)
if ($user !== null) {
$uri = self::USER_URI . '/' . $user . '/subscriptions';
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -571,7 +571,7 @@ public function getContactFeed($user = null, $location = null)
if ($user !== null) {
$uri = self::USER_URI . '/' . $user . '/contacts';
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -592,7 +592,7 @@ public function getUserUploads($user = null, $location = null)
$uri = self::USER_URI . '/' . $user . '/' .
self::UPLOADS_URI_SUFFIX;
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -613,7 +613,7 @@ public function getUserFavorites($user = null, $location = null)
$uri = self::USER_URI . '/' . $user . '/' .
self::FAVORITES_URI_SUFFIX;
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -633,7 +633,7 @@ public function getUserProfile($user = null, $location = null)
if ($user !== null) {
$uri = self::USER_URI . '/' . $user;
} else if ($location instanceof Zend_Gdata_Query) {
- $uri = $location->getQueryUrl();
+ $uri = $location->getQueryUrl($this->getMajorProtocolVersion());
} else {
$uri = $location;
}
@@ -729,7 +729,7 @@ public function getActivityForUser($username)
$uri = null;
if ($username instanceof Zend_Gdata_Query) {
- $uri = $username->getQueryUrl();
+ $uri = $username->getQueryUrl($this->getMajorProtocolVersion());
} else {
if (count(explode(',', $username)) >
self::ACTIVITY_FEED_MAX_USERS) {
View
16 tests/Zend/Dom/QueryTest.php
@@ -309,6 +309,22 @@ public function testSpecifyingEncodingSetsEncodingOnDomDocument()
$this->assertType('DOMDocument', $doc);
$this->assertEquals('utf-8', $doc->encoding);
}
+
+ /**
+ * @group ZF-11376
+ */
+ public function testXhtmlDocumentWithXmlDeclaration()
+ {
+ $xhtmlWithXmlDecl = <<<EOB
+<?xml version="1.0" encoding="UTF-8" ?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head><title /></head>
+ <body><p>Test paragraph.</p></body>
+</html>
+EOB;
+ $this->query->setDocument($xhtmlWithXmlDecl, 'utf-8');
+ $this->assertEquals(1, $this->query->query('//p')->count());
+ }
}
// Call Zend_Dom_QueryTest::main() if this source file is executed directly.
View
17 tests/Zend/Gdata/YouTubeOnlineTest.php
@@ -263,6 +263,23 @@ public function testRetrieveMostViewedVideos()
}
}
}
+ /**
+ * @group ZF-9479
+ */
+ public function testPerformV2Query()
+ {
+ $this->gdata->setMajorProtocolVersion(2);
+ $query = $this->gdata->newVideoQuery();
+ $query->videoQuery = 'zend framework';
+ $query->startIndex = 0;
+ $query->maxResults = 10;
+ $query->orderBy = 'viewCount';
+ $query->safeSearch = 'strict';
+ $videoFeed = $this->gdata->getVideoFeed($query);
+ $this->assertTrue(count($videoFeed->entry) > 0,
+ 'Could not retrieve a single entry for location search:' .
+ $query->getQueryUrl(2));
+ }
public function testPerformV2Query_Location()
{

No commit comments for this range

Something went wrong with that request. Please try again.