{"id":18657232,"url":"https://github.com/arrisframework/sphinxql.pdo.wrapper","last_synced_at":"2026-01-05T09:38:28.025Z","repository":{"id":256312436,"uuid":"854867482","full_name":"ArrisFramework/SphinxQL.PDO.Wrapper","owner":"ArrisFramework","description":"Arris µFramework SphinxQL PDO Wrapper","archived":false,"fork":false,"pushed_at":"2024-09-10T01:28:39.000Z","size":5,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T17:06:47.165Z","etag":null,"topics":["arris","manticoresearch","pdo-wrapper","searchd"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/karelwintersky/arris.toolkit.sphinxql-pdo-wrapper","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArrisFramework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-09T22:51:50.000Z","updated_at":"2024-09-10T01:30:23.000Z","dependencies_parsed_at":"2024-09-10T05:03:29.551Z","dependency_job_id":"33632d78-a96f-4c34-a23d-9fbe72c97736","html_url":"https://github.com/ArrisFramework/SphinxQL.PDO.Wrapper","commit_stats":null,"previous_names":["arrisframework/sphinxql.pdo.wrapper"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrisFramework%2FSphinxQL.PDO.Wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrisFramework%2FSphinxQL.PDO.Wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrisFramework%2FSphinxQL.PDO.Wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArrisFramework%2FSphinxQL.PDO.Wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArrisFramework","download_url":"https://codeload.github.com/ArrisFramework/SphinxQL.PDO.Wrapper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248458477,"owners_count":21107086,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arris","manticoresearch","pdo-wrapper","searchd"],"created_at":"2024-11-07T07:27:13.324Z","updated_at":"2026-01-05T09:38:28.020Z","avatar_url":"https://github.com/ArrisFramework.png","language":"PHP","readme":"# Arris µFramework SphinxQL PDO Wrapper\n\n```php\nuse \\Arris\\Toolkit\\SphinxQL\\PDOWrapper;\n\n$mysql_connection = new \\Arris\\Database\\DBWrapper([\n    'driver'    =\u003e  'mysql',\n    'hostname'  =\u003e  getenv('DB.HOST'),\n    'username'  =\u003e  getenv('DB.USERNAME'),\n    'password'  =\u003e  getenv('DB.PASSWORD'),\n    'database'  =\u003e  getenv('DB.NAME'),\n    'charset'   =\u003e  'utf8',\n    'charset_collate'   =\u003e  'utf8_general_ci',\n    'slow_query_threshold'  =\u003e 1\n]);\n\n$sphinx_connection = new \\Arris\\Database\\DBWrapper([\n    'driver'            =\u003e  'mysql',\n    'hostname'          =\u003e  getenv('SEARCH.HOST'),\n    'database'          =\u003e  NULL,\n    'username'          =\u003e  getenv('SEARCH.USER'),\n    'password'          =\u003e  getenv('SEARCH.PASSWORD'),\n    'port'              =\u003e  getenv('SEARCH.PORT'),\n    'charset'           =\u003e  NULL,\n    'charset_collate'   =\u003e  NULL\n]);\n\n// или через Arris\\Database\\Connector()\n\n$toolkit = new PDOWrapper($mysql_connection, $sphinx_connection);\n$toolkit-\u003esetRebuildIndexOptions([\n    'log_rows_inside_chunk' =\u003e  false,\n    'log_after_chunk'       =\u003e  false,\n    'sleep_after_chunk'     =\u003e  $options['is_sleep'],\n    'sleep_time'            =\u003e  $options['sleeptime'],\n    'chunk_length'          =\u003e  $options['sql_limit']\n]);\n$toolkit-\u003esetConsoleMessenger([ \\Arris\\Toolkit\\CLIConsole::class, \"say\" ]);\n\n$rt_index = getenv('SEARCH.RT_INDEX.ARTICLES');\nif ($rt_index) {\n    // статьи\n    $count_rebuilt['articles'] =\n        $toolkit-\u003erebuildAbstractIndex(\n            'articles', \n            $rt_index, \n            static function ($item) {\n                return \\FSNews\\SearchEngine::prepare_RTArticle($item, true);\n            }, \n            \" s_draft = 0 \", \n            true, \n            ['rubrics', 'districts']\n        );\n} else {\n    CLIConsole::say(\"[SEARCH.RT_INDEX.ARTICLES] \u003cfont color='red'\u003edisabled\u003c/font\u003e\");\n}\n\n```\n\n# ToDo\n\nДобавить\n```php\n    /**\n     * @param $connection\n     * @param $index\n     * @return false|\\PDOStatement\n     */\n    public static function RTIndexOptimize($connection, $index)\n    {\n        $query = \"OPTIMIZE INDEX {$index}\";\n        return $connection-\u003equery($query);\n    }\n\n    /**\n     * @param $connection\n     * @param $index\n     * @param bool $reconfigure\n     * @return bool\n     */\n    public static function RTIndexTruncate($connection, $index, bool $reconfigure = true): bool\n    {\n        $with = $reconfigure ? 'WITH RECONFIGURE' : '';\n        return (bool)$connection-\u003equery(\"TRUNCATE RTINDEX {$index} {$with}\");\n    }\n    \n        /**\n     * @param $connection\n     * @param $index\n     * @return bool\n     */\n    public static function RTIndexCheckExist($connection, $index)\n    {\n        $index_definition = $connection-\u003equery(\"SHOW TABLES LIKE '{$index}' \")-\u003efetchAll();\n    \n        return \\count($index_definition) \u003e 0;\n    }\n    \n    // +show meta\n    // +show version\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrisframework%2Fsphinxql.pdo.wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farrisframework%2Fsphinxql.pdo.wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrisframework%2Fsphinxql.pdo.wrapper/lists"}