承接 jacob-roth/php-helpers 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jacob-roth/php-helpers

Composer 安装命令:

composer require jacob-roth/php-helpers

包简介

An assortment of PHP scripts and classes that aid in the development of PHP projects

README 文档

README

A library of PHP scripts and classes that aid in the development of PHP projects

All scripts are written for PHP 7.4 | 8.*

List of Helpers

  • UpdateSqlClasses.php

    • These scripts are used to create php classes representing your database tables

    • Choose a script from UpdateSqlClasses/ based on which sql implementation you're using

      • Supported Implementations

        • MySQL: /UpdateSqlClasses/mysql/UpdateSqlClasses.php

        • SQLite: /UpdateSqlClasses/sqlite/UpdateSqlClasses.php

    • See the top section of the script to configure the script's parameters

    • Tun from the root directory of project

      php UpdateSqlClasses.php
  • PdoWrapper.php

    • I wrote this class because I hated copying and pasting the same PDO query & execution code and only needing to change the sql query

    • Initialize the object with your PDO instance, then use this class instead of your PDO

    • SqlExecution is the method you'll use the most (usage examples here)

      $PdoWrapperInstance->SqlExecution($sql, $vars, [PDO::FETCH_CLASS, User::class], "fetch");
      
      $PdoWrapperInstance->SqlExecution($sql, [], [PDO::FETCH_COLUMN, 0], "fetchAll");
    • Each SqlExecution() tries to begin a transaction if one hasn't already been opened. Because of this, you'll need to run SaveChanges() to commit that transaction when you insert into of update your tables

      $PdoWrapperInstance->SaveChanges();
  • Logger.php

    • This class helps create a custom log file.

    • Use like

      $logger = new Logger("path/to/file.log");
      $logger->log("hello world!");
      $logger->log("hello world!", LogLevel::Warn);

      outputs

      [ 2021-09-25 07:18:52 ] [ INFO ] hello world!
      [ 2021-09-25 07:18:40 ] [ WARN ] hello world!
      
  • Util.php

    • DebugPrint()

      • A wrapper around print_r() that will output data to the browser in a readable format
      • Optional string title and stringifies a given value of any type
      • Use like
      \PhpHelpers\Util::DebugPrint($dataToOutput, "A Label To Describe Data");

统计信息

  • 总下载量: 44
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固