waughj/copyright-year
Composer 安装命令:
composer require waughj/copyright-year
包简介
Simple class for handling auto-updating copyright year in website footers.
README 文档
README
Simple class for handling auto-updating copyright year in website footers.
Description
Adds copyright year or interval o' years where desired. By default, it just shows the current year, as specified by the server ( which is hopefully keeping accurate track o' time ). Optionally, you can include a start year. If the start year is different from the current year, then it will show an interval 'tween the start year & current year.
For instance, if you set the start year to 2015, in 2018 you will get the following:
2015 - 2018
You can also set a custom divider if you want the interval sign to look different. For instance, if you don't want the hyphen to have spaces round it, you could set the divider to "-", & you will get the following:
2015-2018
Installation
Copyright year can be directly added to PHP files by creating an instance o' the \WaughJ\CopyrightYear\CopyrightYear class & using it like a string or calling the "getText()". Optional arguments to its constructor are 1st the starting year o' your website & 2nd the divider you want 'tween the start year & current year if they are different. The defaults for these, respectively, are the current year & a hyphen with spaces round it.
If using WordPress, you can also add a copyright year to a WordPress document using a shortcode. Add [copyright-year] to add the current year & [copyright-year start="%year%" divider="%divider%"] with %year% replaced by the starting year & %divider% replaced by the divider that appears 'tween the start & current year if they are different.
Example
<?php
declare( strict_types = 1 );
namespace MyTheme\FooterTemplate;
use \WaughJ\CopyrightYear\CopyrightYear;
?>
<footer class="footer">
<p>Copyright Jaimeson Waugh © <?= new CopyrightYear( 2015, '-' ); ?>.</p>
</footer>
<?php
This will print the message, "Copyright Jaimeson Waugh © 2015-2018."
Changelog
2.0
- Make independent from WordPress.
1.0
- Initial stable version.
waughj/copyright-year 适用场景与选型建议
waughj/copyright-year 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 79 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 10 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「footer」 「Year」 「auto-update」 「copyright」 「new year」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 waughj/copyright-year 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 waughj/copyright-year 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 waughj/copyright-year 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Provides a Facade to help validate and verify email addresses
Allow html tags in footer copyright text
Date and time library
Provides per-namespace and per-page header and footer inclusion
A Filament plugin to add a customizable copyright footer to all panels
Package to find Dutch holiday dates
统计信息
- 总下载量: 79
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: AGPL-3.0-or-later
- 更新时间: 2018-10-22