Example #1
0
<?php

/**
 * sphinxql测试产品搜索
 */
namespace Xz;

define("LIB", "/data/cap/gitwork/php/library");
define("COMPOSER", LIB . "/composer");
include_once "/data/cap/gitwork/php/library/SphinxQL/SphinxQL.php";
require_once LIB . "/composer/autoload_real.php";
\ComposerAutoloaderInit9d9ec52c7ca517098968508cff22c107::getLoader();
$sphinxConfig = array("host" => "172.17.17.105", "port" => 9020);
$cateid = 8408;
$keyword = "机床";
testAction($keyword, $cateid);
/* sphinxql测试 */
function testAction($cateid)
{
    $sphinxConfig = array("host" => "172.17.17.105", "port" => 9020);
    $conn = new \Foolz\SphinxQL\Connection();
    $conn->setParams(array('host' => $sphinxConfig["host"], 'port' => $sphinxConfig["port"]));
    $query = \Foolz\SphinxQL\SphinxQL::create($conn);
    $query->select(array("id", "cate3"))->from("product_distri_29");
    $query->where("cate3", "=", intval($cateid));
    $query->limit(0, 1000);
    $query->option("max_matches", 4000);
    try {
        echo $query->compileSelect()->getCompiled();
        echo "\n";
        exit;
Example #2
0
 function processLine($buffer)
 {
     $uri = trim($buffer);
     // TODO: call extendRequestKss
     $service = '';
     if (preg_match('/service=([\\w_]+)/', $uri, $matches)) {
         $service = $matches[1];
     }
     $action = '';
     if (preg_match('/action=([\\w_]+)/', $uri, $matches)) {
         $action = $matches[1];
     }
     $fullActionName = "{$service}.{$action}";
     if ($fullActionName == '.') {
         $fullActionName = $uri;
     }
     testAction(null, $fullActionName, array(), $uri);
 }
Example #3
0
<?php

/**
 * @author neeke@php.net
 * Date: 16/1/11 上午10:15
 */
function testAction()
{
    $path = "/usr/local/nginx/html/logs";
    \SeasLog::setBasePath($path);
    \SeasLog::setBasePath($path);
    \SeasLog::notice("a");
    return;
}
testAction();