定制 propel/propel-service-provider 二次开发

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

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

propel/propel-service-provider

Composer 安装命令:

composer require propel/propel-service-provider

包简介

Propel integrationfor Silex.

关键字:

README 文档

README

Build Status

The PropelServiceProvider provides integration with Propel.

Parameters

  • propel.path (optional): The path in which Propel.php will be found. Usually, for PEAR installation, it is propel while for Git installation it is vendor/propel/runtime/lib. Default is /full/project/path/vendor/propel/propel1/runtime/lib.

  • propel.config_file (optional): The name of Propel configuration file with full path. Default is /full/project/path/build/conf/projectname-conf.php

  • propel.model_path (optional): Path to where model classes are located. Default is /full/project/path/build/classes

It's strongly recommanded to use absolute paths for previous options.

Services

No service is provided.

Propel configures and manages itself by using static methods, so no service is registered into Application. Actually, the PropelServiceProvider class initializes Propel in a more "Silex-ian" way.

Registering

Make sure you place a copy of Propel in vendor/propel or install it through PEAR, or Composer.

For more informations consult the Propel documentation:

<?php

$app['propel.config_file'] = __DIR__.'/path/to/myproject-conf.php';
$app['propel.model_path'] = __DIR__.'/path/to/model/classes';
$app->register(new Propel\Silex\PropelServiceProvider());

Alternatively, if you 've installed Propel by Git in vendor/propel and you built your model with default Propel generator options:

<?php

$app->register(new Propel\Silex\PropelServiceProvider());

We can consider "default" Propel generator options:

  • Put build.properties and schema.xml files into the main directory project, usually where file index.php is located.

  • In build.properties file, define only propel.database, propel.project and propel.namespace.autopackage properties.

Usage

You'll have to build the model by yourself. According to Propel documentation, you'll need three files:

  • schema.xml which contains your database schema;

  • build.properties more information below;

  • runtime-conf.xml which contains the database configuration.

Use the propel-gen script to create all files (SQL, configuration, Model classes).

By default, the PropelServiceProvider relies on the Silex autoloader you have to configure to load model classes. Of course, the Silex autoloader needs the model to be built with namespaces, so be sure to set this property into the build.properties file:

propel.namespace.autopackage = true

The recommended configuration for your `build.properties` file is:

propel.project      = <project_name>

propel.namespace.autoPackage = true
propel.packageObjectModel    = true

# Enable full use of the DateTime class.
# Setting this to true means that getter methods for date/time/timestamp
# columns will return a DateTime object when the default format is empty.
propel.useDateTimeClass = true

# Specify a custom DateTime subclass that you wish to have Propel use
# for temporal values.
propel.dateTimeClass = DateTime

# These are the default formats that will be used when fetching values from
# temporal columns in Propel. You can always specify these when calling the
# methods directly, but for methods like getByName() it is nice to change
# the defaults.
# To have these methods return DateTime objects instead, you should set these
# to empty values
propel.defaultTimeStampFormat =
propel.defaultTimeFormat =
propel.defaultDateFormat =

If you plan to build your model without using namespaces, you need to force Propel to use its internal autoloader. Do this by setting the option propel.internal_autoload to true.

For more information, consult the Propel documentation.

propel/propel-service-provider 适用场景与选型建议

propel/propel-service-provider 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 25.47k 次下载、GitHub Stars 达 26, 最近一次更新时间为 2012 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「silex」 「propel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 propel/propel-service-provider 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 25.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 27
  • 点击次数: 11
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 26
  • Watchers: 8
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-02-17