palepurple/propel1
Fork of legacy Propel 1.x ORM with patches to keep it usable on modern PHP: PHP 7.2–7.4 test fixes, SQL injection fix for limit/offset, count() fix, PropelArrayFormatter fix, and extensive phpdoc updates to support Psalm on generated code.
Legacy ORM for PHP 5.3+: Propel1 is a v1.7.x fork of Propel ORM, designed for PHP 5.3–7.4 compatibility. It is not a modern Laravel-compatible ORM (e.g., Eloquent, Doctrine). Key misalignments:
register()/boot() methods).schema.xml) and reverse-engineering tools (not Laravel’s migrations).Criteria API differs significantly from Laravel’s Query Builder/Eloquent.Model::getTableMap()) and global configuration, conflicting with Laravel’s container.ModelObserver).Use Case Fit:
composer require palepurple/propel1), but no Laravel-specific hooks.BaseModel classes (e.g., UserPeer), which clash with Laravel’s Eloquent.schema.xml; Laravel uses snake_case conventions.Criteria API (e.g., $criteria->add(UserPeer::NAME, 'John')) is incompatible with Laravel’s fluent query builder.hasMany(), hasOne(), etc., but no dynamic accessors ($user->posts).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Breaking Laravel Conventions | High | Requires wrapper classes to adapt Propel to Laravel’s patterns. |
| No Active Maintenance | Medium | Fork is abandoned (last commit: 2019). Risk of PHP 8.x incompatibility. |
| Performance Overhead | Low | Propel1 is legacy; modern Laravel ORMs (Eloquent) are optimized. |
| Dependency Conflicts | Medium | Propel’s PDO usage may conflict with Laravel’s connection resolvers. |
| Testing Complexity | High | Propel’s static model access complicates Laravel’s mocking/unit tests. |
PropelUser::find($id) → new EloquentUserWrapper(UserPeer::retrieveByPk($id)).Propel::getConnection()).UserPeer ≠ Laravel’s User model.schema.xml ≠ Laravel’s php artisan migrate.composer require palepurple/propel1
schema.xml (manual or reverse-engineered).build.properties for DB connection.class PropelUser extends Model
{
public static function find($id) {
return new EloquentUserWrapper(UserPeer::retrieveByPk($id));
}
}
UserPeer::doSelect()) must be dynamicized.function propelCriteriaToQuery($criteria) {
$query = User::query();
foreach ($criteria->getWhereClauses() as $clause) {
$query->where($clause->getColumn(), $clause->getValue());
}
return $query;
}
schema.xml for existing tables.php artisan make:model User -m
// Propel1:
$users = UserPeer::doSelect(new Criteria());
// Eloquent:
$users = User::all();
SluggableBehavior → Laravel Observers or Accessors.TimestampableBehavior → Eloquent’s created_at/updated_at.// In a service class:
class LegacyReportGenerator
{
public function generate() {
return PropelReportPeer::generate(); // Isolated Propel call
}
}
| Component | Propel1 Compatibility | Laravel Workaround |
|---|---|---|
| Models | ❌ (Static Peer classes) |
Wrapper classes or full replacement. |
| Migrations | ❌ (XML-based) | Manual sync or abandon Propel migrations. |
| Query Builder | ❌ (Criteria API) | Translator layer or rewrite queries. |
| Relationships | ⚠️ (Manual hasMany) |
Eloquent relationships or custom logic. |
| Events | ❌ (None) | Observers or manual hooks. |
| PDO Connections | ⚠️ (Global) | Configure Propel to use Laravel’s DB config. |
How can I help you explore Laravel packages today?