承接 lin3s/knowledge-base 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lin3s/knowledge-base

Composer 安装命令:

composer require lin3s/knowledge-base

包简介

PHP Component to build a knowledge base

README 文档

README

#Knowledge Base component

PHP Component to build a knowledge base from your Markup files easily.

SensioLabsInsight Build Status Scrutinizer Code Quality Total Downloads      Latest Stable Version Latest Unstable Version

##Installation Make sure you have composer installed in your computer.

Install the component launching the following composer command

$ composer require lin3s/knowledge-base

Install a theme for your knowledge base. We use the following at LIN3S:

$ composer require lin3s/knowledge-base-GFMTemplate

Add the docs in markdown format to a folder that you will later add to the config.

##Integrating it in your codebase A front controller should look like this:

<?php

require_once __DIR__ . '/../vendor/autoload.php';

use LIN3S\KnowledgeBase\Configuration;
use LIN3S\KnowledgeBase\Controller\PageController;
use LIN3S\KnowledgeBaseGFMTemplate\Template;
use Symfony\Component\HttpFoundation\Request;

$buildPath = realpath(dirname(__FILE__)) . '/build'; // Folder where all the cached files will be stored
$docsPath = realpath(dirname(__FILE__)) . '/docs';   // Folder where all the docs are located

$configuration = new Configuration($docsPath, $buildPath, new Template());
$controller = new PageController($configuration);

$request = Request::createFromGlobals();

if (preg_match('/\.(?:png|jpg|jpeg|gif|css|js)$/', $request->server->get('REQUEST_URI'))) {
    $response = $controller->assetAction($request);
} else {
    $response = $controller->documentAction($request);
}
$response->send();

You can edit as you want to match your needs

##Generating the docs LIN3S Knowledge Base, caches all the markdown files already generated in html to improve performance.

Just create a docs.php file that includes the following to generate menu and html from your markdown files:

#!/usr/bin/env php
<?php

require_once __DIR__ . '/../vendor/autoload.php';

use LIN3S\KnowledgeBase\Configuration;
use LIN3S\KnowledgeBaseGFMTemplate\Template;
use LIN3S\KnowledgeBase\Registry\GeneratorRegistry;
use LIN3S\KnowledgeBase\Generator\HTMLGenerator;
use LIN3S\KnowledgeBase\Generator\MenuGenerator;
use LIN3S\KnowledgeBase\Builder\DocumentationBuilder;
use LIN3S\KnowledgeBase\Iterator\DocumentIterator;

$docsPath = realpath(dirname(__FILE__)) . '/../docs';
$buildPath = realpath(dirname(__FILE__)) . '/../build';

$configuration = new Configuration($docsPath, $buildPath, new Template());

$generatorRegistry = new GeneratorRegistry();
$generatorRegistry
    ->add('html', new HTMLGenerator($this->configuration))
    ->add('route', new MenuGenerator($this->configuration));

$builder = new DocumentationBuilder(
    new DocumentIterator($this->configuration),
    $generatorRegistry
);

$builder->build();

Now just launch the following commands:

$ php docs.php

You need to create a symbolic link to match the assets url with the template you are using.

##Theming To create your own theme just create a class that implements LIN3S\KnowledgeBase\Templating\TemplateInterface and pass it as third parameter to the Configuration class used by the command and the controller.

Template rendering works together with the Loader classes. This class is responsible of fetching all required data to generate a page. The DefaultLoader generates an array with the menu tree, the document converted to html and the configuration class.

###Document building Entry point for document building is located in DocumentationBuilder class that receives a DocumentIterator and an instance of GeneratorRegistry. The first one contains the reference to all documents that need to be parsed, the second one contains all the generators required in the building process.

If you want to add a custom Generator implement GeneratorInterface and add it to the GeneratorRegistry before passing it to the DocumentationBuilder.

"Generation docs" section above, describes the whole process with code.

##Licensing Options License

lin3s/knowledge-base 适用场景与选型建议

lin3s/knowledge-base 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 132 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 09 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 lin3s/knowledge-base 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 lin3s/knowledge-base 我们能提供哪些服务?
定制开发 / 二次开发

基于 lin3s/knowledge-base 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 132
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 16
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-15