propel/propel-service-provider
Composer 安装命令:
composer require propel/propel-service-provider
包简介
Propel integrationfor Silex.
README 文档
README
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
propelwhile for Git installation it isvendor/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.propertiesandschema.xmlfiles into the main directory project, usually where fileindex.phpis located. -
In
build.propertiesfile, define onlypropel.database,propel.projectandpropel.namespace.autopackageproperties.
Usage
You'll have to build the model by yourself. According to Propel documentation, you'll need three files:
-
schema.xmlwhich contains your database schema; -
build.propertiesmore information below; -
runtime-conf.xmlwhich 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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 propel/propel-service-provider 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Object-oriented CRUD for Doctrine DBAL
Command bus implementation: Commands and domain events
Pomm service provider for the Silex µframwork.
Payum offers everything you need to work with payments. From simplest use cases to very advanced ones.
Silex service provider for including FlexAuth library.
Free as in freedom php component that generates configuration based hard coded locator
统计信息
- 总下载量: 25.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 27
- 点击次数: 11
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-02-17