Development

#2193 (Bug with EZComponents bridge)

You must first sign up to be able to contribute.

Ticket #2193 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Bug with EZComponents bridge

Reported by: jalol Assigned to: gregoire
Priority: major Milestone: 1.0.8
Component: other Version: 1.0.7
Keywords: EZ Components, bridge, sfEzComponentsBridge Cc:
Qualification: Ready for core team

Description

The EZ Components bridge doesn't work any more with the last version of EZC (2007.1.1). It worked in Symfony 1.0.6. The problem is in the symfony/addon/bridge/sfEzComponentsBridge.class.php file, line 11. The require instruction points on a src folder to load the base file of EZC (base.php), but this file is not in an src folder (which does not exist). I made this work by setting the right path.

Tested in Windows XP environment, PHP 5.2.1, PEAR 1.5.4

Forum topic : http://www.symfony-project.com/forum/index.php/m/35040/#msg_35040

Attachments

fix_2193-1.patch (1.1 kB) - added by gregoire on 09/27/07 01:13:20.

Change History

09/10/07 17:22:23 changed by gregoire

  • qualification set to Unreviewed.
  • milestone deleted.

Have you updated Ez lately ?

09/10/07 17:37:29 changed by gregoire

  • owner changed from fabien to gregoire.
  • milestone set to 1.0.8.

09/22/07 10:33:56 changed by TobiasO

I had the same problem, I just replaced the require_once with the following

$include = ((sfConfig::get('sf_ez_lib_dir') ? sfConfig::get('sf_ez_lib_dir').'/' : '').'Base/src/base.php');
if(!file_exists($include)){
    $include = ((sfConfig::get('sf_ez_lib_dir') ? sfConfig::get('sf_ez_lib_dir').'/' : '').'Base/base.php');
}
require_once($include);

works just fine

09/27/07 01:13:20 changed by gregoire

  • attachment fix_2193-1.patch added.

09/27/07 01:15:30 changed by gregoire

  • qualification changed from Unreviewed to Ready for core team.

Patch proposed for testing.

09/27/07 10:50:45 changed by jalol

I think there's a problem with this patch, it doesn't work. On line 18, you make this control :

if ($include = file_exists(($base.'Base/src/base.php')))

But the file_exists function returns a boolean ! So you can't make an include with it like you do on line 20 !

I think the best way would be :

$base = sfConfig::get('sf_ez_lib_dir') ? sfConfig::get('sf_ez_lib_dir').'/' : ''; 
$includeSvn = $base.'Base/src/base.php';
$includePear = $base.'Base/base.php';

if (file_exists($includeSvn))
{
  require_once($includeSvn);
}
elseif (file_exists($includePear))
{
  require_once($includePear);
}
else
{
  throw new sfAutoloadException('Invalid eZ component library path.');
}

10/01/07 06:53:18 changed by dwhittle

I have a working solution in the dwhittle branch, changeset #5326.

10/02/07 18:46:29 changed by noel

  • status changed from new to closed.
  • resolution set to fixed.

(in [5348] an [5349]) Fixed EZC include (patch from dwhittle branche)