miklcct/journey_recorder
Composer 安装命令:
composer require miklcct/journey_recorder
包简介
Record your public transport journeys into a database
README 文档
README
This application helps you to record your public transport journeys while on the go.
System requirements
- PHP: ^8.1 (with mysqli extension)
- Composer
- Yarn
Installation
As a standalone application
- Run
composer create-project miklcct/journey_recorder - Load the schema provided in
resource/base.sqland all migrations inresource/migrations/upinto a MariaDB database. - Configure your web server to have
publicas the document root, or link a subfolder under the document root to thepublicfolder.
As a library used in a PHP application
- Run
composer require miklcct/journey_recorderin your PHP application. - Load the schema provided in
resource/base.sqland all migrations inresource/migrations/upinto a MariaDB database. - Provide your implementation of
JourneyResponseFactoryInterfacesuch that the UI fits into your website. TheJourneyViewclass andjourney_main.xhtml.phptemplate is a good starting point. If you are using them, linkscripts/journey.jsandstylesheets/journey.cssinto your public folder and pass the web path into theJourneyViewconstructor. - If you want the offline functionality, link
journey_service_worker.jsinto your public folder as well and register it in your script. The providedscripts/journey.jsdoes that, in this case it must be put in the root of the public folder. - Add a route in your website to have
JourneyApplication, which is PSR-15 compliant, as the controller.
Usage
This application is for recording journeys only. It doesn't provide any interfaces for later retrieval (except the latest one) or analysis tools.
It allows you to enter the information for a public transport journey, including the distance, fare and tickets. It supports multiple tickets and split tickets. If a distance is not provided, it will attempt to fill it from a previous identical journey.
The ticket list is populated from the previous submission. If no tickets are shown, use the "Get the last inserted journey" button to load them.
The "push into queue" and "pop from queue" buttons are provided to save the form and load it later when it's not ready for submission, or in situations when you are temporarily lacking internet access (such as in the Tube).
If the browser supports service workers and the default script is used, the script registers a service worker to cache resources needed for the application, such that it is usable while offline. Also, the submit buttons are disabled while offline.
Database migrations
The migration files are organised in the structure required by byjg/migration package.
However, the use of the library is not necessary. If you want to use it for your database(s),
install the CLI interface by running composer global require byjg/migration-cli.
Defects
Some database column names may be misleading. However, to prevent compatibility issues, they will only be fixed in the next major release:
-
The database should be unit agnostic on distance but some columns assume the use of km as the unit of distance:
tickets view.price per kmjourneys fare.fare per km
These should all mean per distance instead of per km to allow the use of alternative distance units.
-
tickets view.distance travelledmeans person-distance travelled, whiletickets view.segments travelledmeans segments travelled regardless of number of people using that ticket -
advancedoes not adequately cover all pre-purchase requirement:- Quota-controlled tickets are sold against a quota. They are not guaranteed to be available.
- A ticket is quota-controlled if it must be bought against a specific service and not valid on any others without changing it, even if the price never changes, as walk-up travel is not guaranteed.
- Advance purchase non-quota-controlled tickets are always available before a specified deadline, but not immediately before travel.
- Walk up tickets are guaranteed to be available at the time of travel.
- Quota-controlled tickets are sold against a quota. They are not guaranteed to be available.
-
boarding time stampandalighting time stamprepresent the time in UTC time zone. These are no longertimestampcolumns since version 1.6.0 because of time zone issues when trying to calculate local time in a stored column.
Demos
The following demos can be used for testing, but due to privacy concern (data will go through servers under author's control) they are not suggested being used in production.
miklcct/journey_recorder 适用场景与选型建议
miklcct/journey_recorder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 42 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 03 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 miklcct/journey_recorder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 miklcct/journey_recorder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 42
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0-or-later
- 更新时间: 2022-03-02