PHP Fatal error: require(): Failed opening required with an entity class

37 views
Skip to first unread message

Rico Leuthold

unread,
Apr 9, 2011, 4:59:29 AM4/9/11
to flextrine
Hi,

Sorry - me again.

I run into problems with a single entity when flushing. The entity in
PHP looks as follows:

<?php
namespace ch\tofuse\micemeta\entities;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @Entity
* @Table(name="rfid",indexes={@Index(name="muouse_idx",
columns={"dir","res","i","last"})},
uniqueConstraints={@UniqueConstraint(name="rfid_unq",
columns={"rfid"})})
*/
class MouseEntity { ... }

In AS3:

[RemoteClass(alias="ch.tofuse.micemeta.entities.MouseEntity")]
[Entity]
public class MouseEntity extends MouseEntityEntityBase { ... }

So, nothing special here. But when i flush() I'm getting the require
error (no problems with loading the entities):

PHP Fatal error: require(): Failed opening required '/Library/
WebServer/micemeta/flextrine/php/app/micemeta/entities/
ch_tofuse_micemeta_entities::MouseEntity.php'

I already recreated (no errors) and renamed the entity. But still get
the same error.

Can you point me to the right direction to fix this?
- rico






Rico Leuthold

unread,
Apr 12, 2011, 7:44:21 AM4/12/11
to flextrine
... a little follow up.

I get the error with other entities as well.

Logging the information available in the ClassLoader->loadClass()
method I can figure out how it should look like:

[Tue Apr 12 13:37:46 2011] [error] [client 127.0.0.1] load class => ch\
\tofuse\\micemeta\\entities\\ILocationCheck namespace => separator =>
\\
[Tue Apr 12 13:37:46 2011] [error] [client 127.0.0.1] load class =>
ch_tofuse_micemeta_entities::LitterEntity namespace => separator => \
\
[Tue Apr 12 13:37:46 2011] [error] [client 127.0.0.1] PHP Fatal
error: require(): Failed opening required '/Library/WebServer/
micemeta/flextrine/php/app/micemeta/entities/
ch_tofuse_micemeta_entities::LitterEntity.php'

So, where does this transformation come from?

- rico

ccapndave

unread,
Apr 12, 2011, 7:56:31 AM4/12/11
to flextrine
The class loader goes through a few options when trying to autoload a
class - first the PHP5.3 style namespace (ch\tofuse\micemeta\entities
\Class.php), then the Zend style namespace
(ch_tofuse_micemeta_entities_Class.php). However, the entities should
get caught by the first attempted load, so I'm not quite sure what is
going on in your case.

Can I ask you to update to the latest master of Flextrine, regenerate
your PHP app and AS3 entities and confirm that the problem is still
there.

If so please open an issue at https://github.com/ccapndave/flextrine/issues
with all relevant details including platform and PHP version.

Cheers!

Dave

Rico Leuthold

unread,
Apr 13, 2011, 9:37:13 AM4/13/11
to flextrine
Hi Dave,

Seems to work fine with the latest version.

Thank you.

- rico



On Apr 12, 1:56 pm, ccapndave <d...@ruffness.com> wrote:
> The class loader goes through a few options when trying to autoload a
> class - first the PHP5.3 style namespace (ch\tofuse\micemeta\entities
> \Class.php), then the Zend style namespace
> (ch_tofuse_micemeta_entities_Class.php).  However, the entities should
> get caught by the first attempted load, so I'm not quite sure what is
> going on in your case.
>
> Can I ask you to update to the latest master of Flextrine, regenerate
> your PHP app and AS3 entities and confirm that the problem is still
> there.
>
> If so please open an issue athttps://github.com/ccapndave/flextrine/issues
Reply all
Reply to author
Forward
0 new messages