marcoconsiglio/ephemeris
Composer 安装命令:
composer require marcoconsiglio/ephemeris
包简介
A Laravel package that query the Swiss Ephemeris executable, in order to get planets position for astronomy/astrology purposes.
README 文档
README
Laravel Swiss Ephemeris
This laravel package perform queries to the Swiss Ephemeris executable and therefore relies on it using the same AGPL license. Using this package in your Laravel project means you'll need to use the same license. For commercial use, you'll need to purchase the corresponding license.
The aim of this project is to query ephemeris data to produce planetar positions in order to be used for purposes such as astronomy/astrology, planetary calendar, biodynamic calendar, etc.
In this software, only a fraction of the swiss ephemeris are used: you can query planets, Moon, and known asteroids from 1800 CE (AD) to 2399 CE (AD).
Development Roadmap
Check the next features in the development roadmap.
Installation
composer require marcoconsiglio/ephemeris
After installation run this command to publish the Swiss Ephemeris database and config file in your Laravel project.
php artisan vendor:publish --provider="MarcoConsiglio\Ephemeris\SwissEphemerisServiceProvider"
Remember to grant execution privileges to the swetest file, otherwise this software won't work. To do this, run the command
chmod u+x ./resources/swiss_ephemeris/swetest
To extend the ephemeris data, download the ephemeris files you wish and put them in the resources/swiss_ephemeris directory. If you don't know which files to download to extend the time range of the ephemeris, please refer to the description of the ephemerides.
Usage
First of all, to query ephemeris data you need to instantiate the 'LaravelSwissEphemeris' class. You need to pass a PointOfView class, if none is used, it defaults to Geocentric point of view.
use use Illuminate\Support\Facades\Config; /** @var \MarcoConsiglio\Ephemeris\LaraverlSwissEphemeris $ephemeris */ /** @var \MarcoConsiglio\Ephemeris\Observer\Topocentric $pov */ $pov = new Topocentric( Config::get("ephemeris.latitude"), Config::get("ephemeris.longitude"), Config::get("ephemeris.altitude") ); $ephemeris = new LaravelSwissEphemeris( $pov, Config::get("ephemeris.timezone") );
or instead, another PointOfView class:
use MarcoConsiglio\Ephemeris\Observer\Heliocentric; /** @var \MarcoConsiglio\Ephemeris\LaraverlSwissEphemeris $ephemeris */ $ephemeris = new LaravelSwissEphemeris(new Heliocentric);
Check all available points of view for more info.
If something went wrong (e.g. like uncorrect permission for the files placed in the folder (This need to be tested and proved).resources/swiss_ephemeris, outbound quering date, ect.) it will throw a MarcoConsiglio\Ephemeris\Exceptions\SwissEphemerisException exception.
Premise
When using the word collection, it is meant that the class extends the Illuminate\Support\Collection, so you can treat it like any other collection.
API Documentation
For more information, see the API documentation at ./docs/html.
Index
Point of View
Datetime
Moon Ephemeris
marcoconsiglio/ephemeris 适用场景与选型建议
marcoconsiglio/ephemeris 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 481 次下载、GitHub Stars 达 8, 最近一次更新时间为 2021 年 11 月 30 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 marcoconsiglio/ephemeris 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 marcoconsiglio/ephemeris 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 481
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0-or-later
- 更新时间: 2021-11-30