imonroe/ana
Composer 安装命令:
composer require imonroe/ana
包简介
Ana is my personal library of PHP 7 compatible helper functions
README 文档
README
Install
Via Composer
$ composer require imonroe/ana
Usage
use imonroe\ana\Ana; $formatted_date = Ana::standard_date_format(strtotime('yesterday')); if (Ana::even_or_odd(2) == 'even'){ // do something } if (Ana::is_valid_link('https://www.google.com')){ // link is valid and curl-able } // grab a file from the web and save it to a text file. Ana::create_file('sample.txt', Ana::quick_curl('https://www.sample.com/index.html'), true);
Available Methods:
All methods are static.
- standard_date_format($timestamp = '')
- sql_datetime($timestamp = '')
- google_datetime($timestamp = '')
- is_today($date_string)
- sooner_than($date_string)
- later_than($date_string)
- print_relative_date($date)
- fatal_handler()
- dd($var)
- array_unique_multi($arr)
- array_sort_by_column(&$arr, $col, $dir = SORT_ASC)
- object_to_array($object)
- build_tree($flat, $pidKey, $idKey = null)
- csv_to_array($filename='', $delimiter=',')
- plural($quantity)
- word_limit($haystack, $ubound)
- convert_to_utf($input)
- plain_text($input)
- trim_string_to_length($str, $len)
- use_a_or_an($text)
- even_or_odd($number)
- random_number($lowbound = 1, $highbound = 100)
- random_hex($bytes = 8)
- generateStrongPassword($length = 9, $add_dashes = false, $available_sets = 'luds')
- create_nonce()
- current_page_url()
- get_url_segment($number)
- is_valid_link($link)
- quick_curl($link)
- get_ip()
- submit_post_request($url, $data)
- loading_spinner()
- code_safe_name($string)
- cast($destination, $sourceObject)
- ask_user($prompt)
- say($msg)
- error_out($msg)
- create_directory($directory_path, $perms = 0777)
- remove_directory($path)
- create_file($file_path_and_name, $file_content, $overwrite = false)
- append_file($file_path_and_name, $file_content, $overwrite = false)
- get_url_and_save($fully_qualified_url, $filename)
- read_file_to_string($filename)
- get_directory_list($directory_path)
- execute($cmd)
- get_arguments()
- replace_line_in_file(String $filename='', String $line_to_change='', String $change_to='')
- replace_and_save($oldFile, $search, $replace, $newFile = null)
- us_states()
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email ian@ianmonroe.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
imonroe/ana 适用场景与选型建议
imonroe/ana 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 192 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 08 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「imonroe」 「ana」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 imonroe/ana 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 imonroe/ana 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 imonroe/ana 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
统计信息
- 总下载量: 192
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-17