Download the PHP package pudongping/smart-assist without Composer

On this page you can find all versions of the php package pudongping/smart-assist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smart-assist

smart-assist

收录一些高频 php 助手函数,提高工作效率。

ArrHelper

调用方式 功能
ArrHelper::same(array $arr1, array $arr2, bool $assoc = false): bool 检查两个数组元素是否相同。
ArrHelper::sortByField(array $array, string $key, int $sort = SORT_DESC, int $sortRule = SORT_NUMERIC): array 对数组根据指定字段进行排序。
ArrHelper::groupByField(array $array, string $key): array 对数组中指定字段的值进行分组。
ArrHelper::addDataToNestedArray(array $data, array $extraData): array 对二维数组增加同一项数据。
ArrHelper::minIntElement(array $data, string $key, bool $firstAs = true): array 找到二维数组中指定索引名值最小的元素。
ArrHelper::maxIntElement(array $data, string $key, bool $firstAs = true): array 找到二维数组中指定索引名值最大的元素。
ArrHelper::toTree(array $arr, string $id = 'id', string $pid = 'pid', string $children = 'children'): array 将二维数组转化成树型结构

CipherHelper

调用方式 功能
CipherHelper::AESCBCEncrypt($plaintext, string $key, string $iv = ''): string aes cbc 加密。
CipherHelper::AESCBCDecrypt(string $encrypted, string $key, string $iv = ''): array aes cbc 解密。

DBHelper

调用方式 功能
DBHelper::batchUpdateCaseWhen(string $tableName, array $where, array $needUpdateFields): array 生成批量更新的 sql 语句。
DBHelper::upsert(string $tableName, array $data, array $columns): array 生成批量更新或写入的 sql 语句。

FileHelper

调用方式 功能
FileHelper::humanFileSize(int $bytes, int $decimals = 2): string 返回可读性更好的文件大小。
FileHelper::compressToZip(string $source, string $zipFile): bool 压缩文件或目录为zip格式
FileHelper::extractZipToDir(string $zipFile, string $toDir): bool 解压zip文件,包含多级目录和任意文件
FileHelper::copyDir(string $source, string $destination): bool 复制目录

IDCardHelper

调用方式 功能
IDCardHelper::isChinaIDCardDate(string $year, string $month, string $day): bool 验证出生日期是否合法。
IDCardHelper::getValidateCode(string $id): string 根据身份证号前17位,算出识别码。
IDCardHelper::isChinaIDCard(string $id, bool $ban15 = true): bool 验证身份证号。检查给定的身份证号是否合法。
IDCardHelper::getChinaIDCardSex(string $id): int 根据身份证号,自动返回对应的性别。
IDCardHelper::getConstellationByChinaIDCard(string $id): string 根据身份证号码,返回对应的星座。
IDCardHelper::getChineseZodiacByChinaIDCard(string $id): string 根据身份证号码,返回对应的生肖。

StrHelper

调用方式 功能
StrHelper::genRandomStr(int $len = 16, int $type = 0): string 生成随机字符串。
StrHelper::genRandomChineseWords(int $num = 16): string 生成常用随机中文
StrHelper::genUniqueNum(bool $isBigint = false): string 基于日期和随机数生成具有唯一性的数字字符串
StrHelper::base64UrlEncode(string $input): string Base64编码,使用URL和文件名安全字符集。
StrHelper::base64UrlDecode(string $input) Base64解码,使用URL和文件名安全字符集。
StrHelper::hide(string $string, int $start = 0, int $length = 0, string $re = '*'): string 脱敏函数。将一个字符串部分字符用指定的替代符隐藏,返回处理后的字符串。
StrHelper::FullOrHalfWidthTrans(string $str, bool $isFullToHalf = false) 字符串全角和半角之间的转换。

TimeHelper

Method Description
TimeHelper::Milliseconds(): int 获取当前时间的毫秒数。
TimeHelper::Microseconds(): int 获取当前时间的微秒数。
TimeHelper::Nanoseconds(): int 获取当前时间的纳秒数。
TimeHelper::humanTime(int $seconds): string 返回可读性更好的时间表示。

All versions of smart-assist with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-mbstring Version *
ext-json Version *
ext-openssl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pudongping/smart-assist contains the following files

Loading the files please wait ....