├── .gitignore ├── LICENSE ├── README.md ├── _config.yml ├── alconseek.sql ├── app ├── config │ ├── config.ini.default │ ├── config.php │ ├── index_rebuild_cron.default │ ├── loader.php │ ├── route_conf.php │ ├── routes.php │ └── services.php ├── controllers │ ├── ControllerBase.php │ ├── MController.php │ └── SController.php ├── models │ ├── Manager.php │ └── Spoor.php ├── views │ ├── index.volt │ ├── m │ │ ├── index.volt │ │ └── signin.volt │ └── s │ │ └── index.volt └── xsconfig │ └── article.ini ├── composer.json ├── deploy ├── index.html └── public ├── .htaccess └── index.php /.gitignore: -------------------------------------------------------------------------------- 1 | /app/cache/* 2 | /app/config/config.ini 3 | /app/config/index_rebuild_cron 4 | /vendor 5 | composer.lock 6 | 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 farwish 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # alconSeek 2 | 3 | 4 | 5 | ## Synopsis 6 | 7 | > 尔康搜索是一个让你极其方便地开发全文检索Api的应用骨架。 8 | 9 | > 提供:简洁的搜索接口,索引管理界面,索引定时更新脚本,多库多项目的快速二次开发. 10 | 11 | ## Install & Deploy 12 | 13 | > 一. 依赖: 14 | 15 | > 1). LNMP环境 16 | `搭建可参考:https://github.com/farwish/delicateShell/tree/master/lnmp` 17 | 18 | > 2). Composer工具 19 | ````shell 20 | curl -sS https://getcomposer.org/installer | php 21 | mv composer.phar /usr/local/bin/composer 22 | ```` 23 | 24 | > 3). Phalcon框架 25 | `文档:https://docs.phalconphp.com/en/latest/reference/install.html` 26 | `搭建可参考:https://github.com/farwish/delicateShell/blob/master/lnmp/installPhalcon.sh` 27 | 28 | > 4). Xunsearch服务 29 | `文档:http://www.xunsearch.com/doc/php/guide/start.installation` 30 | `搭建可参考:https://github.com/farwish/delicateShell/blob/master/support/installXunsearch.sh` 31 | 32 | > 二. 部署: 33 | ````shell 34 | sh deploy 35 | vi ./app/config/config.ini #数据库配置, 后面导入的数据库 36 | ```` 37 | 38 | > 三. nginx 配置部分: 39 | 40 | ````shell 41 | server { 42 | listen 80; 43 | server_name alconseek.farwish.com; 44 | 45 | root /home/www/alconSeek/public; 46 | 47 | location / { 48 | index index.html index.htm index.php; 49 | try_files $uri $uri/ /index.php?_url=$uri&$args; 50 | } 51 | 52 | location ~ \.php$ { 53 | fastcgi_pass 127.0.0.1:9000; 54 | fastcgi_index index.php; 55 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 56 | include fastcgi_params; 57 | } 58 | } 59 | ```` 60 | 61 | ``` 62 | 别忘了: 63 | /etc/hosts 中加入 127.0.0.1 alconseek.farwish.com 64 | ``` 65 | 66 | > 四. 数据库 67 | `你可以用phpmyadmin等软件导入我准备好的数据库进行测试, 文件是 alconseek.sql。` 68 | `索引管理界面初始登录账号密码: admin / admin` 69 | `vi ./app/config/config.ini #数据库配置` 70 | 71 | > 五. 访问(任何你配置的地址或域名)   72 | ``` 73 | http://127.0.0.1/m 74 | http://127.0.0.1/s?q= 75 | ``` 76 | 77 | ## API 78 | 79 | *检索访问* :`GET` /s   80 | 81 | *参数* : 82 | 83 | | param | 是否必须 | explain 84 | |--- |--- |--- 85 | | `q` | 可选 | 搜索词 86 | | `p` | 可选 | 页码 87 | | `typ` | 可选 | 指定检索方法,默认typ=demo为主检索 88 | 89 | *管理访问* :`GET` /m 90 | 91 | *参数* :无 92 | 93 | ## Index Rebuild Crontab 94 | 95 | > ./app/config/index_rebuild_cron 文件, 使用方式见注释. 96 | 97 | ## Index Management Interface 98 | 99 | ![indexManager](http://farwish.qiniudn.com/indexManager.png "indexManager") 100 | ![indexBuild](http://farwish.qiniudn.com/indexBuild.png "indexBuild") 101 | 102 | ## Overview 103 | 104 | > 项目特点(feature): 105 | `1. 搜索数据配置化, 即插即用, 马上拥有360搜索般的服务` 106 | `2. 架构松耦合, 只需专注特色功能的快速开发(TraitAction)` 107 | 108 | > 项目结构(structure): 109 | `由phalcon开发工具(phalcon-devtools)生成的Simple类型项目改进而来; 修改点:` 110 | `1.config.php加载ini配置;` 111 | `2.services.php注册xunsearch服务.` 112 | 113 | > 功能概述(functional): 114 | `1.索引管理: http://www.demo.com/m` 115 | `2.通用搜索API: http://www.demo.com/s?q=` 116 | 117 | > 搜索配置放置(search config): 118 | `./app/xsconfig/xxx.ini` 119 | 120 | > 搜索数据目录(data directory): 121 | `/usr/local/xunsearch/data/xxx` 122 | 123 | > 定时脚本模板 124 | `./app/config/index_rebuild_cron.default` 125 | 126 | ## How to develop your application? 127 | 128 | > 首先你得建一个表, 根据迅搜文档编辑自己的ini搜索配置文件 并 放在xsconfig目录中; 索引管理处生成数据, 然后就可以通过Api访问了. 129 | > 配置文件详解: http://www.xunsearch.com/doc/php/guide/ini.guide 130 | 131 | ## Discussion 132 | 133 | > Qq group: 377154148 134 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-leap-day -------------------------------------------------------------------------------- /alconseek.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.6.4 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- Host: localhost 6 | -- Generation Time: Nov 29, 2016 at 19:00 AM 7 | -- Server version: 5.7.15 8 | -- PHP Version: 5.6.25 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET time_zone = "+00:00"; 12 | 13 | 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 17 | /*!40101 SET NAMES utf8mb4 */; 18 | 19 | -- 20 | -- Database: `alconseek` 21 | -- 22 | 23 | -- -------------------------------------------------------- 24 | 25 | -- 26 | -- Table structure for table `article` 27 | -- 28 | 29 | CREATE TABLE `article` ( 30 | `id` int(11) NOT NULL, 31 | `title` varchar(255) NOT NULL DEFAULT '' COMMENT '标题', 32 | `content` varchar(3000) NOT NULL DEFAULT '' COMMENT '内容', 33 | `author` varchar(30) NOT NULL DEFAULT '' COMMENT '作者', 34 | `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 35 | `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP 36 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章表'; 37 | 38 | -- 39 | -- Dumping data for table `article` 40 | -- 41 | 42 | INSERT INTO `article` (`id`, `title`, `content`, `author`, `create_time`, `update_time`) VALUES 43 | (1, '小石潭记', '从小丘西行百二十步,隔篁竹,闻水声,如鸣佩环,\r\n心乐之。伐竹取道,下见小潭,水尤清冽。\r\n全石以为底,近岸,卷石底以出,为坻,\r\n为屿,为嵁,为岩。青树翠蔓,\r\n蒙络摇缀,参差披拂。(佩 通:珮)潭中鱼可百许头,\r\n皆若空游无所依。日光下澈,影布石上,佁然不动;\r\n俶尔远逝,往来翕忽。似与游者相乐。(下澈 一作:\r\n下彻)潭西南而望,斗折蛇行,明灭可见。其岸势犬牙差互,\r\n不可知其源。坐潭上,四面竹树环合,寂寥无人,\r\n凄神寒骨,悄怆幽邃。以其境过清,不可久居,\r\n乃记之而去。同游者:吴武陵,龚古,\r\n余弟宗玄。隶而从者,崔氏二小生:曰恕己,\r\n曰奉壹。', '柳宗元 (唐代)', '2016-11-29 16:00:00', '2016-11-29 16:00:00'), 44 | (2, '荷塘月色', '这几天心里颇不宁静。今晚在院子里坐着乘凉,忽然想起日日走过的荷塘,在这满月的光里,总该另有一番样子吧。月亮渐渐地升高了,墙外马路上孩子们的欢笑,已经听不见了;妻在屋里拍着闰儿,迷迷糊糊地哼着眠歌。我悄悄地披了大衫,带上门出去。\r\n  沿着荷塘,是一条曲折的小煤屑路。这是一条幽僻的路;白天也少人走,夜晚更加寂寞。荷塘四面,长着许多树,蓊蓊郁郁的。路的一旁,是些杨柳,和一些不知道名字的树。没有月光的晚上,这路上阴森森的,有些怕人。今晚却很好,虽然月光也还是淡淡的。', '朱自清', '2016-11-29 16:00:00', '2016-11-29 16:00:00'), 45 | (3, '荷塘月色(live)', '荷塘月色 - 凤凰传奇\r\n剪一段时光缓缓流淌\r\n流进了月色中微微荡漾\r\n弹一首小荷淡淡的香\r\n美丽的琴音就落在我身旁\r\n萤火虫点亮夜的星光\r\n谁为我添一件梦的衣裳\r\n推开那扇心窗远远地望\r\n谁采下那一朵昨日的忧伤\r\n我像只鱼儿在你的荷塘\r\n只为和你守候那皎白月光\r\n游过了四季荷花依然香\r\n等你宛在水中央\r\n萤火虫点亮夜的星光\r\n谁为我添一件梦的衣裳\r\n推开那扇心窗远远地望\r\n谁采下那一朵昨日的忧伤\r\n我像只鱼儿在你的荷塘\r\n只为和你守候那皎白月光\r\n游过了四季荷花依然香\r\n等你宛在水中央\r\n那时年轻的你 和你水中的模样\r\n依然不变的仰望\r\n满天迷人的星光\r\n谁能走进你的心房\r\n采下一朵莲\r\n是那夜的芬芳 还是你的发香\r\n荷塘呀荷塘 你慢慢慢慢唱哟\r\n月光呀月光 你慢慢慢慢听哟\r\n鱼儿呀鱼儿 你慢慢慢慢游哟\r\n淡淡的淡淡的 淡淡的月光\r\n我像只鱼儿在你的荷塘\r\n只为和你守候那皎白月光\r\n游过了四季荷花依然香\r\n等你宛在水中央\r\n我像只鱼儿在你的荷塘\r\n只为和你守候那皎白月光\r\n游过了四季荷花依然香\r\n等你宛在水中央\r\n等你宛在水中央', '凤凰传奇', '2016-11-29 16:00:00', '2016-11-29 16:00:00'); 46 | 47 | -- -------------------------------------------------------- 48 | 49 | -- 50 | -- Table structure for table `manager` 51 | -- 52 | 53 | CREATE TABLE `manager` ( 54 | `id` int(10) UNSIGNED NOT NULL, 55 | `uname` varchar(30) NOT NULL DEFAULT '', 56 | `passwd` char(32) NOT NULL DEFAULT '' 57 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='开发管理员用'; 58 | 59 | -- 60 | -- Dumping data for table `manager` 61 | -- 62 | 63 | INSERT INTO `manager` (`id`, `uname`, `passwd`) VALUES 64 | (1, 'admin', '21232f297a57a5a743894a0e4a801fc3'); 65 | 66 | -- -------------------------------------------------------- 67 | 68 | -- 69 | -- Table structure for table `spoor` 70 | -- 71 | 72 | CREATE TABLE `spoor` ( 73 | `id` int(10) UNSIGNED NOT NULL, 74 | `remote_addr` varchar(30) NOT NULL DEFAULT '' COMMENT 'ip', 75 | `user_agent` varchar(255) NOT NULL DEFAULT '' COMMENT 'agent' 76 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='访问记录表'; 77 | 78 | -- 79 | -- Indexes for dumped tables 80 | -- 81 | 82 | -- 83 | -- Indexes for table `article` 84 | -- 85 | ALTER TABLE `article` 86 | ADD PRIMARY KEY (`id`); 87 | 88 | -- 89 | -- Indexes for table `manager` 90 | -- 91 | ALTER TABLE `manager` 92 | ADD PRIMARY KEY (`id`); 93 | 94 | -- 95 | -- Indexes for table `spoor` 96 | -- 97 | ALTER TABLE `spoor` 98 | ADD PRIMARY KEY (`id`); 99 | 100 | -- 101 | -- AUTO_INCREMENT for dumped tables 102 | -- 103 | 104 | -- 105 | -- AUTO_INCREMENT for table `article` 106 | -- 107 | ALTER TABLE `article` 108 | MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; 109 | -- 110 | -- AUTO_INCREMENT for table `manager` 111 | -- 112 | ALTER TABLE `manager` 113 | MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; 114 | -- 115 | -- AUTO_INCREMENT for table `spoor` 116 | -- 117 | ALTER TABLE `spoor` 118 | MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; 119 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 120 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 121 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -------------------------------------------------------------------------------- /app/config/config.ini.default: -------------------------------------------------------------------------------- 1 | [env] 2 | debug = true 3 | 4 | [database] 5 | adapter = Mysql 6 | host = localhost 7 | username = root 8 | password = 123456 9 | dbname = alconseek 10 | charset = utf8 11 | 12 | [application] 13 | controllersDir = ../app/controllers/ 14 | modelsDir = ../app/models/ 15 | migrationsDir = ../app/migrations/ 16 | viewsDir = ../app/views/ 17 | pluginsDir = ../app/plugins/ 18 | libraryDir = ../app/library/ 19 | cacheDir = ../app/cache/ 20 | baseUri = /alconSeek/ 21 | xsconfigDir = app/xsconfig/ 22 | 23 | ; 开发:搜索配置统一放置 ./app/xsconfig/xxx.ini 24 | ; 注意:手动建数据目录与配置名相同 mkdir /usr/local/xunsearch/data/xxx 25 | -------------------------------------------------------------------------------- /app/config/config.php: -------------------------------------------------------------------------------- 1 | application->xsconfigDir ); 16 | foreach ($xsconfig as $v) { 17 | if ( ($v != '.') && ($v != '..') && substr($v, 0, 1) !== '.' ) { 18 | $Ini->xs[] = rtrim($v, '.ini'); 19 | } 20 | } 21 | unset($xsconfig); 22 | 23 | return $Ini; 24 | -------------------------------------------------------------------------------- /app/config/index_rebuild_cron.default: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 索引更新: 按需增加命令,在crontab中指向本文件. 4 | # ( 0 * * * * /.../alconSeek/app/config/index_rebuild_cron ) 5 | # 6 | # 如需自定义请修改本文件. 7 | # 8 | # @farwish.com 9 | 10 | phpbin=/usr/local/php7.0.14/bin/php 11 | curdir=`dirname $0` 12 | 13 | ${phpbin} ${curdir}/vendor/hightman/xunsearch/util/Indexer.php --rebuild --source=Mysql://root:123456@localhost:3306/alconseek --sql="SELECT * FROM article" --project=${curdir}/app/xsconfig/article.ini > /dev/null 2>&1 14 | -------------------------------------------------------------------------------- /app/config/loader.php: -------------------------------------------------------------------------------- 1 | registerDirs( 9 | array( 10 | $config->application->controllersDir, 11 | $config->application->modelsDir 12 | ) 13 | )->register(); 14 | -------------------------------------------------------------------------------- /app/config/route_conf.php: -------------------------------------------------------------------------------- 1 | getShared('router'); 10 | 11 | foreach ($routes as $val) { 12 | $router->add($val[0], $val[1])->via($val[2]); 13 | } 14 | 15 | $router->handle(); 16 | -------------------------------------------------------------------------------- /app/config/services.php: -------------------------------------------------------------------------------- 1 | setShared('url', function () use ($config) { 25 | $url = new UrlResolver(); 26 | $url->setBaseUri($config->application->baseUri); 27 | 28 | return $url; 29 | }); 30 | 31 | /** 32 | * Setting up the view component 33 | */ 34 | $di->setShared('view', function () use ($config) { 35 | 36 | $view = new View(); 37 | 38 | $view->setViewsDir($config->application->viewsDir); 39 | 40 | $view->registerEngines(array( 41 | '.volt' => function ($view, $di) use ($config) { 42 | 43 | $volt = new VoltEngine($view, $di); 44 | 45 | $volt->setOptions(array( 46 | 'compiledPath' => $config->application->cacheDir, 47 | 'compiledSeparator' => '_' 48 | )); 49 | 50 | return $volt; 51 | }, 52 | '.phtml' => 'Phalcon\Mvc\View\Engine\Php' 53 | )); 54 | 55 | return $view; 56 | }); 57 | 58 | /** 59 | * Database connection is created based in the parameters defined in the configuration file 60 | */ 61 | $di->setShared('db', function () use ($config) { 62 | $dbConfig = $config->database->toArray(); 63 | $adapter = $dbConfig['adapter']; 64 | unset($dbConfig['adapter']); 65 | 66 | $class = 'Phalcon\Db\Adapter\Pdo\\' . $adapter; 67 | 68 | return new $class($dbConfig); 69 | }); 70 | 71 | /** 72 | * If the configuration specify the use of metadata adapter use it or use memory otherwise 73 | */ 74 | $di->setShared('modelsMetadata', function () { 75 | return new MetaDataAdapter(); 76 | }); 77 | 78 | /** 79 | * Register the session flash service with the Twitter Bootstrap classes 80 | */ 81 | $di->set('flash', function () { 82 | return new Flash(array( 83 | 'error' => 'alert alert-danger', 84 | 'success' => 'alert alert-success', 85 | 'notice' => 'alert alert-info', 86 | 'warning' => 'alert alert-warning' 87 | )); 88 | }); 89 | 90 | /** 91 | * Start the session the first time some component request the session service 92 | */ 93 | $di->setShared('session', function () { 94 | $session = new SessionAdapter(); 95 | $session->start(); 96 | 97 | return $session; 98 | }); 99 | 100 | /** 101 | * Register xs service. 102 | */ 103 | $di->setShared('xs', function () use ($config) { 104 | $xs = []; 105 | $xsconfigDir = APP_PATH . '/' . $config->application->xsconfigDir; 106 | $xsconfig = $config->xs; 107 | foreach ($xsconfig as $v) { 108 | $xs[$v] = new XS($xsconfigDir . $v . '.ini'); 109 | } 110 | return $xs; 111 | }); 112 | 113 | /** 114 | * Register the search service. 115 | * 116 | * 117 | * $this->seek['article']; 118 | * 119 | */ 120 | $di->setShared('seek', function () use ($di, $config) { 121 | $seek = []; 122 | $xs = $di->getShared('xs'); 123 | $xsconfig = $config->xs; 124 | foreach ($xsconfig as $v) { 125 | $seek[$v] = $xs[$v]->search; 126 | } 127 | return $seek; 128 | }); 129 | 130 | /** 131 | * Register the index service. 132 | * 133 | * 134 | * $this->idx['article']; 135 | * 136 | */ 137 | $di->setShared('idx', function () use ($di, $config) { 138 | $idx = []; 139 | $xs = $di->getShared('xs'); 140 | $xsconfig = $config->xs; 141 | foreach ($xsconfig as $v) { 142 | $idx[$v] = $xs[$v]->search; 143 | } 144 | return $idx; 145 | }); 146 | -------------------------------------------------------------------------------- /app/controllers/ControllerBase.php: -------------------------------------------------------------------------------- 1 | config['env']['debug'] ? 300 : 60; 24 | if ( Manager::checkSignin($_POST['u'], $_POST['p']) ) { 25 | setCookie('alconSeek', $_POST['u'], time() + $expire, '/'); 26 | $this->response->redirect('/m/', true); 27 | } 28 | } 29 | } 30 | 31 | /** 32 | * Check. 33 | * 34 | * TODO security. 35 | * 36 | * @farwish 37 | */ 38 | protected function checkSignin() 39 | { 40 | if ( empty($_COOKIE['alconSeek']) ) { 41 | $this->response->redirect("/m/signin", true); 42 | return false; 43 | } 44 | return true; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/controllers/SController.php: -------------------------------------------------------------------------------- 1 | getShared('db'); 66 | 67 | $db->insert( 68 | "spoor", 69 | array_values($data), 70 | array_keys($data) 71 | ); 72 | 73 | return $db->lastInsertId(); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /app/views/index.volt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IndexManager 8 | 9 | 10 | 11 | 12 | 13 |
14 | {{ content() }} 15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /app/views/m/index.volt: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 | 7 |
8 |

项目名 :

9 |
10 |
11 | 16 |
17 | 18 |
19 |

  命令(默认) :

20 |
21 |
22 | 23 |
24 | 25 |

26 | 27 |

28 |

数据库 :

29 |
30 |
31 | 36 |
37 | 38 |
39 |

  数据表 :

40 |
41 |
42 | 43 |
44 | 45 |
46 | 47 |
48 |
49 | 50 |
51 |
52 | 53 |
54 | 55 |
56 |
57 | 58 |
59 |
60 | 61 |
62 | 63 |
64 |
65 | 66 |
67 |
68 | 69 |
70 | 71 |
72 |
73 | 74 |
75 |
76 | 77 |
78 | 79 | 126 | -------------------------------------------------------------------------------- /app/views/m/signin.volt: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 |
7 | 8 |
9 |
10 | 11 |
12 | 13 |
14 | -------------------------------------------------------------------------------- /app/views/s/index.volt: -------------------------------------------------------------------------------- 1 | 4 | 5 |

You're now flying with Phalcon. Great things are about to happen!

6 | 7 |

This page is located at views/index/index.volt

8 | -------------------------------------------------------------------------------- /app/xsconfig/article.ini: -------------------------------------------------------------------------------- 1 | project.name = article 2 | project.default_charset = utf-8 3 | server.index = 127.0.0.1:8383 4 | server.search = 127.0.0.1:8384 5 | 6 | [id] 7 | type = id 8 | 9 | [title] 10 | index = both 11 | type = string 12 | 13 | [content] 14 | index = both 15 | type = string 16 | tokenizer = full 17 | 18 | [author] 19 | index = both 20 | type = string 21 | 22 | [create_time] 23 | type = numeric 24 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "farwish/alconSeek", 3 | "description": "application skel for full-text search", 4 | "keywords": ["phalcon", "xunsearch", "full-text search", "application skel"], 5 | "type": "project", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "farwish", 10 | "email": "farwish@foxmail.com", 11 | "role": "lead" 12 | } 13 | ], 14 | "minimum-stability": "dev", 15 | "require": { 16 | "php": ">=7.0", 17 | "ext-phalcon": "3.*", 18 | "farwish/alcon": "dev-master", 19 | "hightman/xunsearch": "dev-master" 20 | }, 21 | "repositories": [ 22 | { 23 | "type": "vcs", 24 | "url": "https://github.com/farwish/alcon.git" 25 | }, 26 | { 27 | "type": "vcs", 28 | "url": "https://github.com/hightman/xs-sdk-php.git" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /deploy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 部署运行 `sh deploy` 3 | # @farwish.com MIT-License 4 | 5 | if test -f composer.lock; then 6 | composer update --prefer-dist --no-dev 7 | else 8 | composer install --prefer-dist --no-dev 9 | # 应用配置, 定时脚本模板, view cache. 10 | cp ./app/config/config.ini.default ./app/config/config.ini 11 | cp ./app/config/index_rebuild_cron.default ./app/config/index_rebuild_cron 12 | mkdir ./app/cache 13 | fi 14 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 |

Mod-Rewrite is not enabled

Please enable rewrite module on your web server to continue -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | AddDefaultCharset UTF-8 2 | 3 | 4 | RewriteEngine On 5 | RewriteCond %{REQUEST_FILENAME} !-d 6 | RewriteCond %{REQUEST_FILENAME} !-f 7 | RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L] 8 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | handle()->getContent(); 37 | 38 | } catch (\Exception $e) { 39 | echo $e->getMessage() . '
'; 40 | //echo '

' . $e->getTraceAsString() . '
'; 41 | } 42 | --------------------------------------------------------------------------------