[symfony-users] Re: Using adoDB with symfony

2011-01-22 Thread Manuel Alejandro Gómez Nicasio
I have never heard about oci8. It's seems it could be helpful.

How do you configure doctrine to work with oci8?

is oci8 a good replacement for pdo_oci?

someone has used oci8 with propel?

thanks a lot, vikos.


On Saturday, January 22, 2011 7:36:08 AM UTC-6, Vikos wrote:
>
> with oracle better to use oci8 -> much stable than PDO_OCI 
>
> Doctrine work's well with oci8! I don't have any experience with 
> oracel and propel... 
>
> PDO_OCI doesn't support well the large objects... 
>
> On Jan 21, 6:37 pm, Manuel Alejandro Gómez Nicasio 
>  wrote: 
> > Well, the PHP version that is installed doesn't support the PDO version 
> that 
> > PDO_OCI needs. So we need to upgrade the PHP version and doing that could 
>
> > break something on the apps installed. 
> > 
> > In fact, on development we use postgreSQL but on production we must use 
> > oracle because the tables already exists on the oracle database. We can 
> use 
> > postgres or Mysql , the production machines have the drivers required, 
> but 
> > by doing that we must copy some tables from oracle database to our 
> postgres 
> > or mysql databse that means copy information that eventually will be 
> > duplicated. 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Friday, January 21, 2011 3:20:26 AM UTC-6, GarethMc wrote: 
> > 
> > > And why can't he recompile it? the PDO drivers are an addition to PHP, 
> it 
> > > doesn't affect other parts of PHP that apps my rely on. Nothing 
> should 
> > > break 
> > 
> > > It is FAR cheaper for you to look at fixing the server than trying to 
> > > rewrite the core aspects of an applications framework library just 
> because 
> > > your server admin either cannot or is to lazy to do his job! 
> > 
> > > The other alternative? Don't use Oracle. MySQL performs exceptionally 
> well, 
> > > as does PostgreSQL. And they are both a doddle to get running. 
> > 
> > > 2011/1/21 Manuel Alejandro Gómez Nicasio  
>
> > 
> > >> thanks for answer, GarethMc. 
> > 
> > >> Propel works well. As I said, the project is almost done. However, 
> these 
> > >> days while talking with the admin of the production boxes he told us 
> that 
> > >> production machines doesn't have the PDO version that the project 
> needs. So, 
> > >> he suggest to find an alternative to PDO, i.e. adoDB. 
> > 
> > >> The detailed problem is that the project uses oracle as DBMS but the 
> PDO 
> > >> version on production servers doesn't support de pdo_oci driver. It 
> simply 
> > >> doesn't compile. As the admin cannot recompile PHP with a new PDO 
> version 
> > >> because other system installed on the server could break we are 
> looking for 
> > >> some alternatives. 
> > 
> > >> So, is it possible to "switch" from PDO to adoDB while keeping Propel? 
>
> > 
> > >>  -- 
> > >> If you want to report a vulnerability issue on symfony, please send it 
> to 
> > >> security at symfony-project.com 
> > 
> > >> You received this message because you are subscribed to the Google 
> > >> Groups "symfony users" group. 
> > >> To post to this group, send email to symf...@googlegroups.com 
> > >> To unsubscribe from this group, send email to 
> > >> symfony...@googlegroups.com 
> > >> For more options, visit this group at 
> > >>http://groups.google.com/group/symfony-users?hl=en 
> > 
> > > -- 
> > > Gareth McCumskey 
> > >http://garethmccumskey.blogspot.com 
> > > twitter: @garethmcc 
> > > identi.ca: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: symfony cache doubt

2011-01-22 Thread Richtermeister
I believe you can make the cache key whatever you want... so in your
case just module/action and whatever neccessary parameter, but not
user id.
I've used this in reverse, where I had the same url for everybody, but
depending on the login status and session id I'd generate a unique
cache key, since the content chanced per user.

Daniel


On Jan 21, 5:44 am, Gabriel Petchesi  wrote:
> Symfony builds up the cache key based upon the URL in case of action or
> parameters (for partials, components).
>
> I'm not sure if you can override the cache key within the action so my
> suggestion is to create a simple action with a template and within
> that template include a component that will be cached.
>
> For that component set up the cache_key value however you want, it could be
> any of the following:
> include_component('service', 'provider', array('sf_cache_key' =>
> md5($service.$ver.$lang)))
> or a concatenated string with the important values
> include_component('service', 'provider', array('sf_cache_key' =>
> $service.$ver.$lang)))
> or by specifying exactly the elements you want to be used for caching,
> symfony caching will compute a hash based on that:
> include_component('service', 'provider', array('service' => $service, 'ver'
> => $ver, 'lang' => $lang));
>
> For improved speed you could look into something like the sfSuperCache to
> avoid loading the framework altogether, not sure if it works
> for Symfony 1.4.
>
>     gabriel

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [symfony2] User authentication and session persistence problem

2011-01-22 Thread taidehuone
It is worth mentioning that the user object IS stored into sessions by
symfony2 itself and the session IS persisted over page loads, but the
session data is not used to authenticate the user after login_check, and I
am authenticated as "anon" again. What part of symfony2 determines what data
to use for authentication? How do I tell symfony2 to use the user object I
have in sessions to be the source of authentication so that I would not be
authenticated as "anon"?

Thanks, Jaakko R

On Sat, Jan 22, 2011 at 6:20 PM, taidehuone  wrote:

> I have successfully fixed the PHP notice error, but the persistence problem
> still exists.
>
> I had a private id field in one of the associated entities. PHP's sleep
> functionality does not work on private properties and this resulted in a
> notice even though the associated entity was replaced with a proxy. I still
> have no idea what causes the persistence problem - login_check appears to
> work fine but the authentication is not persisted to next page load.
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Help with form & validators

2011-01-22 Thread Eric B.
Hi,

This is probably a basic question, and yet I can't seem to figure out the
best way to do this.

I have a registration form that has several fields, including 2 dependent
ones:
- Country
- State.

If Country == Canada, then I want the state field to have a drop down of all
provinces
If Country == US, then I want the state field to have a drop down of all
states
If Country == , then I want the state field to be a text
field

I can figure out how to do it using jQuery (and use an onchange event on the
Country drop down), however, am not sure if there isn't a better solution. 
I know there is a DoctrineChain plugin, but my list of provinces/states is 
not coming from the database.

Additionally, I'm very stumped as to how to do validation for these fields.
If Country == Canada or US, then state is required.  If Country ==  then state is optional.

I've considered using the PostValidator for the form, but am really not
quite sure how to do this properly.

Any advice or suggestions would be greatly appreciated.  I tried looking
through the manuals, but haven't found anything that has helped point me in
the right direction.

Thanks!

Eric




-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [symfony2] User authentication and session persistence problem

2011-01-22 Thread taidehuone
Hi,

That sounds logical, all the login configuration is now listed under the
main firewall and there are no other firewalls. I also created an access map
rule for anonymous users for the login page as both you and the master docs
suggest. It did not solve or change the situation and the weird php notice
about a nonexistent "id" field returned from __sleep() also still exists.

I have var_dumped the array which is serialized in
Security\Authentication\Token\Token.php on line 189. The first six fields in
the Artist entity (from first_name to gender) belong to the Artist class
which is child, and the following rows (from id to end of array) belong to
the parent Account class which is inherited using JOINED inheritance.

array
 0 =>
   object(Application\ArtistBundle\Entity\Artist)[200]
 protected 'first_name' => string 'op' (length=2)
 protected 'last_name' => string 'imago' (length=5)
 protected 'is_seeker' => boolean true
 protected 'is_student' => boolean true
 protected 'is_employed' => boolean true
 protected 'gender' => int 2
 protected 'id' => int 14
 protected 'email' => string 'artis...@taidehuone.fi' (length=22)
 protected 'password' => string 'a08354645f796101c5d3afe6d6a46c38'
(length=32)
 protected 'allow_comments' => boolean true
 protected 'allow_contacts' => boolean true
 protected 'is_active' => boolean true
 protected 'is_moderator' => boolean false
 protected 'avatar_id' => null
 protected 'category' =>
   object(Proxies\ApplicationCategoryBundleEntityCategoryProxy)[236]
 private '_entityPersister' =>
   object(Doctrine\ORM\Persisters\BasicEntityPersister)[238]
 ...
 private '_identifier' =>
   array
 ...
 public '__isInitialized__' => boolean false
 protected 'childrenRefs' =>
   array
 ...
 protected 'parentRef' => null
 private 'id' => null
 protected 'name' => null
 protected 'parent_id' => null
 protected 'location_finland' =>

 object(Proxies\ApplicationLocationBundleEntityLocationFinlandProxy)[251]
 private '_entityPersister' =>
   object(Doctrine\ORM\Persisters\BasicEntityPersister)[253]
 ...
 private '_identifier' =>
   array
 ...
 public '__isInitialized__' => boolean false
 private 'id' => null
 protected 'name' => null
 protected 'longitude' => null
 protected 'latitude' => null
 protected 'other_location' => null
 protected 'description' => string 'taivas fallinae calibu taivas
navila calibu keen dorothema trenol agas taivas meeblo was unetian lain
kolibacria cantalism milalei lord oposseratum' (length=154)
 protected 'website' => string 'www.taidehuone.fi' (length=17)
 protected 'facebook' => string 'artist13' (length=8)
 protected 'twitter' => string 'artist13' (length=8)
 protected 'created_at' =>
   object(DateTime)[177]
 public 'date' => string '2011-01-17 18:40:07' (length=19)
 public 'timezone_type' => int 3
 public 'timezone' => string 'Europe/Helsinki' (length=15)
 protected 'updated_at' =>
   object(DateTime)[202]
 public 'date' => string '2011-01-17 18:40:07' (length=19)
 public 'timezone_type' => int 3
 public 'timezone' => string 'Europe/Helsinki' (length=15)
 protected 'ip_address' => string 'deadbeef' (length=8)
 protected 'phone' => null
 protected 'street_address' => null
 protected 'zip' => null
 1 => string 'taidehuone' (length=10)
 2 => boolean true
 3 =>
   array
 0 =>
   object(Symfony\Component\Security\Role\Role)[249]
 protected 'role' => string 'IS_AUTHENTICATED_FULLY' (length=22)
 4 => boolean false

Thanks for any tips in advance,
Jaakko R


On Fri, Jan 21, 2011 at 11:08 AM, stof  wrote:
>
> The login check has to be done by the main firewall as they don't share
> the context any more. Not sure if it is the issue here but it can be.
>
> As you also use anonymous users the simpliest configuration is to use only
> the main firewall and to let anonymous users access /login with the
> access_control map.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [symfony2] User authentication and session persistence problem

2011-01-22 Thread taidehuone
I have successfully fixed the PHP notice error, but the persistence problem
still exists.

I had a private id field in one of the associated entities. PHP's sleep
functionality does not work on private properties and this resulted in a
notice even though the associated entity was replaced with a proxy. I still
have no idea what causes the persistence problem - login_check appears to
work fine but the authentication is not persisted to next page load.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Grails to Symfony2 Benchmark

2011-01-22 Thread maxarbos
I was talking to our network administrator for our grails project and
he was saying that the machines we have that run our grails projects
get faster with higher load. Something to do with the architecture of
the machines and being optimized for Java apps. Maybe this has
something to do with it as well? I know he posted hardware specs. I
will have to ask our admin how we can tell is his setup falls into
that category.


On Jan 19, 9:27 am, Tom Boutell  wrote:
> Mmm. His throughput was 3x higher with APC, and it does look like he
> enabled it correctly, but he was still pegging CPU and memory the
> whole time. I would have to study his specific code more to figure out
> if he's doing anything "wrong" for Symfony that he's doing "right" for
> Grails.
>
> On Jan 17, 4:58 am, "Nikolai K. Bochev" 
> wrote:
>
> > Well it seems he has redone the test with APC enabled.
>
> >http://cutiecode.maniacmansion.it/post/2777523715/grails-vs-symfony-2...
>
> > "Interesting" is all i can say.
>
> > Thanks for the info and the effort to email the author. I am very
> > interested in what they have to say.
> > Please let us know as soon as you do.
>
> > Thanks.
>
> > --
>
> > Nikolai K. Bochev
> > System Administrator

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [sf2] Symfony2 generic routes - automaticaly resolved controller

2011-01-22 Thread Christophe COEVOET

Le 22/01/2011 16:14, Wojciech Sznapka a écrit :

Hi,
how can I write routes to achieve something like generic route, which
redirects to dynamically resolved controller?

generic:
   pattern: /{_controller}/{_action}
   defaults: {_bundle: ExpencesBundle}

I want this route to be kind of generic catch-all. So it will do
following routings;
/operations/index =>  _controller: ExpencesBundle:Operations:index
/stats/monthly  =>  _controller: ExpencesBundle:Stats:monthly

is it possible in Symfony2?

It is not possible this way as the _controller variable is something 
like Bundle:Controller:action


A bundle adds the possibility to use a generic route but it is 
absolutely not up-to-date with Symfony2 : 
https://github.com/hidenorigoto/DefaultRouteBundle

Maybe it can help you if you update it.

--
Christophe | Stof

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] [sf2] Symfony2 generic routes - automaticaly resolved controller

2011-01-22 Thread Wojciech Sznapka
Hi,
how can I write routes to achieve something like generic route, which
redirects to dynamically resolved controller?

generic:
  pattern: /{_controller}/{_action}
  defaults: {_bundle: ExpencesBundle}

I want this route to be kind of generic catch-all. So it will do
following routings;
/operations/index => _controller: ExpencesBundle:Operations:index
/stats/monthly  => _controller: ExpencesBundle:Stats:monthly

is it possible in Symfony2?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Using adoDB with symfony

2011-01-22 Thread Vikos
with oracle better to use oci8 -> much stable than PDO_OCI

Doctrine work's well with oci8! I don't have any experience with
oracel and propel...

PDO_OCI doesn't support well the large objects...

On Jan 21, 6:37 pm, Manuel Alejandro Gómez Nicasio
 wrote:
> Well, the PHP version that is installed doesn't support the PDO version that
> PDO_OCI needs. So we need to upgrade the PHP version and doing that could
> break something on the apps installed.
>
> In fact, on development we use postgreSQL but on production we must use
> oracle because the tables already exists on the oracle database. We can use
> postgres or Mysql , the production machines have the drivers required, but
> by doing that we must copy some tables from oracle database to our postgres
> or mysql databse that means copy information that eventually will be
> duplicated.
>
>
>
>
>
>
>
> On Friday, January 21, 2011 3:20:26 AM UTC-6, GarethMc wrote:
>
> > And why can't he recompile it? the PDO drivers are an addition to PHP, it
> > doesn't affect other parts of PHP that apps my rely on. Nothing should
> > break
>
> > It is FAR cheaper for you to look at fixing the server than trying to
> > rewrite the core aspects of an applications framework library just because
> > your server admin either cannot or is to lazy to do his job!
>
> > The other alternative? Don't use Oracle. MySQL performs exceptionally well,
> > as does PostgreSQL. And they are both a doddle to get running.
>
> > 2011/1/21 Manuel Alejandro Gómez Nicasio 
>
> >> thanks for answer, GarethMc.
>
> >> Propel works well. As I said, the project is almost done. However, these
> >> days while talking with the admin of the production boxes he told us that
> >> production machines doesn't have the PDO version that the project needs. 
> >> So,
> >> he suggest to find an alternative to PDO, i.e. adoDB.
>
> >> The detailed problem is that the project uses oracle as DBMS but the PDO
> >> version on production servers doesn't support de pdo_oci driver. It simply
> >> doesn't compile. As the admin cannot recompile PHP with a new PDO version
> >> because other system installed on the server could break we are looking for
> >> some alternatives.
>
> >> So, is it possible to "switch" from PDO to adoDB while keeping Propel?
>
> >>  --
> >> If you want to report a vulnerability issue on symfony, please send it to
> >> security at symfony-project.com
>
> >> You received this message because you are subscribed to the Google
> >> Groups "symfony users" group.
> >> To post to this group, send email to symfon...@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> symfony-user...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups.google.com/group/symfony-users?hl=en
>
> > --
> > Gareth McCumskey
> >http://garethmccumskey.blogspot.com
> > twitter: @garethmcc
> > identi.ca: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Output escaper in template

2011-01-22 Thread Vikos
it's simple:

get the unescaped object/variable first... and call your function...

ver a.: $sf_user->getRawValue()->getTopics();

ver b.: sfOutputEscaper::unescape($sf_user)->getTopics();

be careful: the symfony doesn't escape nulls and integers... so the
getRawValue cause undefined function exception...

I personally  prefer the first way..

On Jan 21, 2:28 pm, HAUSa 
wrote:
> If I try to access a function in my User class (myUser.class.php), the
> results is being escaped in a template.
>
> This makes the code below a mess:
> getId(), $sf_user->getTopics())): ?>
>
> I receive this error message:
> Warning: in_array() expects parameter 2 to be array, object given in /
> home/httpd/vhosts/krantcafe.nl/httpdocs/apps/community/modules/topic/
> templates/_record.php on line 5
>
> That is because my Array is an instance of
> sfOutputEscaperArrayDecorator now.
>
> How can I get the original array, that the $sf_user->getTopics()
> returns?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] SfGuardAuth - Signin Component.

2011-01-22 Thread lmwood
Hi All,

I've included sfGuardAuth's signin form in my layout using a component
but if you get your username or password wrong it will redirect to the
signing action thus having two signin forms on one page.

How can I make sure it uses the component to display login errors and
does not redirect to the signin action?

Thanks in advance.

Cheers,
Lee.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en