No,strings will not be changed. nor DQL strings, class names will be
obfuscated but the encoded version still can find the class name but since
'Clients' and table names are string it still can find the table and run
the query. since filename and class name are the same ioncube has a treack
when autoload is run. so it will find it still.
why don't you advice me just for PHP option since my question was simple?
On Sunday, February 2, 2014 1:25:36 AM UTC+3:30, Parsifal wrote:
>
> First of all I must say due to ioncube I can only use PHP driver and NOT
> XML/YML/Annotaion
>
> I changed the beginning of auto-generated src/clients.php to this:
>
> <?php
> namespace src;
> use Doctrine\ORM\Mapping\ClassMetadata;
> use Doctrine\ORM\Mapping\ClassMetadataInfo;
> class clients
> {
> public static function loadMetadata(ClassMetadata $metadata)
> {
> $metadata->setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_NONE);
> $metadata->setPrimaryTable(array(
> 'name' => 'clients',
> 'uniqueConstraints' =>
> array(
> 'username' =>
> array(
> 'columns' =>
> array(
> 0 => 'username',
> 1 => 'email',
> ),
> ),
> ),
> 'indexes' =>
> array(
> 'status' =>
> array(
> 'columns' =>
> array(
> 0 => 'status',
> ),
> ),
> ),
> ));
>
> $metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT);
> $metadata->mapField(array(
> 'fieldName' => 'clientId',
> 'columnName' => 'client_id',
> 'type' => 'integer',
> 'nullable' => false,
> 'unsigned' => false,
> 'comment' => '',
> 'id' => true,
> ));
> }
> }
>
> then in bootstrap I have this:
> $driver = new Doctrine\ORM\Mapping\Driver\StaticPHPDriver('src');
> $em->getConfiguration()->setMetadataDriverImpl($driver);
>
> then in file I need to run query from clients table I have this (the file
> is in upper level folder than /src where clients.php is located):
> $class = $em->getClassMetadata('clients');
>
> but I get the error:
>
> Fatal error: Uncaught exception
> 'Doctrine\Common\Persistence\Mapping\MappingException' with message 'Class
> 'clients' does not exist' in
> /home2/[edited]/composer/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php:96
> for sure, I also did requie_once clients.php but I still get the error,
> please advice.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.