定制 jfbiswajit/php-bigquery 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

jfbiswajit/php-bigquery

Composer 安装命令:

composer require jfbiswajit/php-bigquery

包简介

PHP BigQuery for Laravel is a seamless integration package that allows you to harness the power of Google BigQuery in your Laravel applications effortlessly. With a zero-configuration setup, plug and play this library to perform high-speed querying and advanced analytics on large datasets.

README 文档

README

PHP BigQuery

Description

PHP BigQuery is a Laravel package that provides seamless integration with Google BigQuery using the google/cloud-bigquery library. This package allows you to interact with BigQuery effortlessly and perform various operations on datasets and tables.

Installation

To get started with PHP BigQuery in your Laravel project, follow these steps:

  1. Install the package via Composer:
composer require jfbiswajit/php-bigquery
  1. Generate a service account key for your Google Cloud project. Follow the steps below to create and download the key in JSON format:

Generate Service Key

  1. Go to the Google Cloud Console by visiting https://console.cloud.google.com/ and sign in with your Google account.

  2. Select the project where your BigQuery data is located from the project selector at the top of the page.

  3. In the left-hand menu, click on "IAM & Admin," and then select "Service Accounts" from the sub-menu.

  4. Click on the "CREATE SERVICE ACCOUNT" button to create a new service account.

  5. Enter a name and description for the service account. Leave the "Service account ID" field as it is, as it will be automatically generated.

  6. In the "Role" dropdown, select the appropriate role that grants the service account the necessary permissions to access your BigQuery data. For example, you can choose the "BigQuery User" role for read access to datasets and tables.

  7. Click on the "CREATE" button to create the service account.

  8. Locate the newly created service account on the "Service Accounts" page. Click on the three dots (vertical ellipsis) to the right of the service account's entry, and then click on "Create key."

  9. Choose the "JSON" key type and click on the "CREATE" button. This will download a JSON file containing the service account key to your computer.

  10. Move the downloaded JSON key file to a secure location in your Laravel project. A common practice is to store it in the "storage" directory with the name "bigquery-credentials.json," but you can choose any suitable location. Just ensure that the file is not publicly accessible on your web server to keep your credentials secure.

Finding Project ID

To find your Google Cloud Project ID, follow these steps:

  1. Go to the Google Cloud Console by visiting https://console.cloud.google.com/ and sign in with your Google account.

  2. If you are not already in the project, use the project selector at the top of the page to select the project where your BigQuery data is located.

  3. After selecting the correct project, you will see the project name displayed in the top-left corner of the Cloud Console.

  4. Click on the project name (or the project ID, if it's shown next to the name) in the top-left corner. This will open the project details page.

  5. On the project details page, you will find the "Project info" section. The "Project ID" will be listed there.

The Project ID is a unique identifier for your Google Cloud project and is used for various purposes, including accessing APIs, managing resources, and setting up credentials like we discussed for BigQuery.

Configuration

Once you have obtained the service account key and the Project ID, you can set the following environment variables in your Laravel project's .env file:

GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/bigquery-credentials.json
GOOGLE_CLOUD_PROJECT_ID=your-project-id

Usage

With PHP BigQuery integrated into your Laravel project, you can use the package to interact with Google BigQuery and perform various data operations. The package provides an easy-to-use facade to access the functionalities.

// Example code to retrieve data from BigQuery
use JfBiswajit\PHPBigQuery\Facades\BigQuery;

$results = BigQuery::query('SELECT * FROM your_dataset.your_table');

For detailed usage and available methods, please refer to the package documentation.

Contribution

Your contributions to this project are highly appreciated. If you encounter any bugs, have feature requests, or want to contribute to the codebase, feel free to submit a pull request or open an issue on GitHub.

License

This package is open-source software licensed under the MIT license.

Author

Thank you for choosing PHP BigQuery for Laravel! We hope this package simplifies your BigQuery integration and data management tasks. If you have any questions or need assistance, please don't hesitate to reach out to the author or the community for support. Happy coding!

jfbiswajit/php-bigquery 适用场景与选型建议

jfbiswajit/php-bigquery 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.73k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 08 月 02 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 jfbiswajit/php-bigquery 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 jfbiswajit/php-bigquery 我们能提供哪些服务?
定制开发 / 二次开发

基于 jfbiswajit/php-bigquery 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-02