This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Today's Messages (OFF)  | Unanswered Messages (ON)

Forum: Documentation
 Topic: Windows 'pake alltests' failure
Windows 'pake alltests' failure [message #499] Sun, 20 November 2005 04:55
spascoe  is currently offline spascoe
Messages: 52
Registered: November 2005
Location: Indianapolis
Member
Hi again,

I'm continuing my quest to get the symfony tests to run under windows.

I've updated my copy of pake to use windows symlinks and have gotten past the building errors.

Now, I've got the following error:

C:\dev\symfony\lib>pake alltests
Test suite in (test)

Fatal error: Cannot redeclare class sfcache in C:\Documents and Settings\spascoe\Local Settings\Temp\tmpFB.tmp\42bd09cf0ffa3a3d5024c
a9f99c4eb21\lib\symfony\symfony\cache\sfCache.class.php on line 20

C:\dev\symfony\lib>


I've tracked this down as far as I can understand what's going on and now need some help:

The test that fails is sfLiveAppTest
It gets to line 74
require_once(SF_ROOT_DIR.'/'.SF_APP.'/config/config.php');


config.php gets down to line 46
require_once 'symfony/symfony.php';


I'm guessing that line 83 in symfony.php
    require_once('symfony/cache/sfCache.class.php');


is reloading the sfCache.class.php file from a different place than it has already been loaded and that is cusing the error.

I've now reached the end of my knowledge and need the help of wiser beings Smile

Anyone have any insight into why this is happening?

Thanks,

Scott
 Topic: generating doc on linux
generating doc on linux [message #2894] Sat, 18 February 2006 05:36
spascoe  is currently offline spascoe
Messages: 52
Registered: November 2005
Location: Indianapolis
Member
Hi all, expecially francoisz...

I've built a linux box to try to do some testing of documentation generation.

I've got a few questions about the symfony doc's and generation.

1. The convert2docbook.php file in svn doesn't seem to correctly conver the markdown text to docbook xml. Is this actually the one that is used to generate the doc on a nightly basis?

2. convert2docbook.php has a incorrect requires_once for spyc.php. Instead of looking in
lib/util/Spyc.class.php
, it is looking in
lib/spyc/spyc.php


3. convert2docbook.php also mentions a file
xinclude.mod
which seems to be specific to the project, but isn't in the project.

(I'm really trying to figure out a solution to the pdf generation causing the progrma listing code that has long lines getting cut off problem.

Thanks for any insight,

Scott Pascoe
 Topic: New chapter added in the doc: Javascript Helpers
icon1.gif  New chapter added in the doc: Javascript Helpers [message #3950] Wed, 15 March 2006 13:48
francois  is currently offline francois
Messages: 1636
Registered: October 2005
Faithful Member
JavaScript helpers are already present in our tutorials (did you read the shopping cart tutorial and askeet day 8?), but the book didn't contain any detailed documentation about it yet. All those who had to dig into the source code to understand how the link_to_remote(), observe_field() or visual_effect() helpers work will probably be pleased to hear that a new chapter has just been added to the book.

The JavaScript helpers chapter will show you how to manage JavaScripts in your symfony templates, from the simple alert("foobar") to the more complex AJAX interactions.

http://www.symfony-project.com/content/book/page/javascript. html

Make sure you check it out before starting your new Web 2.0 application!
 Topic: file form validation
file form validation [message #4130] Wed, 22 March 2006 09:14
Gimler  is currently offline Gimler
Messages: 83
Registered: March 2006
Location: Germany
Member

hallo,

here under "Available validators" the "sfFileValidator" method is missing
http://www.symfony-project.com/content/book/page/validate_fo rm.html


http://www.nevalon.de
 Topic: Wiki
Wiki [message #4493] Fri, 31 March 2006 05:37
wjessup  is currently offline wjessup
Messages: 37
Registered: March 2006
Location: LA
Member

Are there any wiki's in development based on symfony?
 Topic: Pretty-printed "My first symfony project"
Pretty-printed "My first symfony project" [message #5028] Sun, 16 April 2006 00:09
cprior  is currently offline cprior
Messages: 50
Registered: December 2005
Location: #symfony
Member
I am preparing a talk about symfony for the upcoming froscon.org and went on a test-drive with my preferred presentation-generator and symfony.

As an intermediate* result I have transformed the tutorial "My first symfony project" into a pretty-printed article version.

The .pdf file is available for download.

*) I need to be able to highlight symfony-methodnames and produce a handout version.

Update: Added index and glossary "code" behind the scenes.

[Updated on: Sun, 16 April 2006 15:41]


--
Chris Prior
My docu-mirror(offline)
 Topic: searchable API?
searchable API? [message #6532] Tue, 23 May 2006 07:12
Styles722  is currently offline Styles722
Messages: 84
Registered: May 2006
Location: Miami, FL
Member
Is there are function reference somewhere that I have missed? I know there's the API docs but they are not searchable and it doesn't look like Google has them indexed... Can we make these searchable? I ran into this problem tonight - there were some methods that I was not aware of that are being used in the Snipeet application and I had no easy way to find out what they were...

Thanks,
Styles
 Topic: More Propel Code Snippets please :)
More Propel Code Snippets please :) [message #10170] Wed, 16 August 2006 00:06
marckohlbrugge  is currently offline marckohlbrugge
Messages: 164
Registered: January 2006
Senior Member
I noticed a lot of people struggle with Propel. I see a lot of questions like "I want to do this and this, how do I achieve it in Propel?".

I think it would be really helpfull if there were a lot of examples posted in the snippet library (http://www.symfony-project.com/snippets/), since Propel's documentation isn't very complete.

Using Books/Authors/Categories in your example is prefered (by me).

For anyone having Propel problems, check here first:

http://www.symfony-project.com/snippets/snippets/tagged/prop el/order_by/popularity
http://www.symfony-project.com/trac/wiki/
http://propel.phpdb.org/docs/user_guide/
 Topic: Persistent sessions with cookies page question.
Persistent sessions with cookies page question. [message #10255] Wed, 16 August 2006 19:07
akinas  is currently offline akinas
Messages: 69
Registered: April 2006
Member
Correct me if I'm wrong.
On book page http://www.symfony-project.com/book/trunk/cookie

public function signIn($user, $remember = false)
{
  $this->setAuthenticated(true);
 
  if ($remember)
  {
    // determine a random key
    if (!$user->getRememberKey())
    {
      $rememberKey = myTools::generate_random_key();
 
      // save the key to the User table
      $user->setRememberKey($rememberKey);
      $user->save();
    }
 
    // save the key to the cookie
    $value = base64_encode(serialize(array($user->getRememberKey(), $user->getLogin())));
    sfContext::getInstance()->getResponse()->setCookie('MyWebSite', $value, time()+60*60*24*15, '/');
  }
}


This part is problematic:

// determine a random key
if (!$user->getRememberKey())


The only way a user gets this far is by submitting a form which means his cookie does not exist or expired so the RememberKey needs to be generated again and set to cookie no matter what.

 Topic: AJAX tutorial is outdated
AJAX tutorial is outdated [message #10367] Thu, 17 August 2006 22:09
marckohlbrugge  is currently offline marckohlbrugge
Messages: 164
Registered: January 2006
Senior Member
Today someone at IRC had some problems running application that is built with the AJAX tutorial (http://www.symfony-project.com/tutorial/symfony_ajax.html). It turned out is outdated.. uses older version of Symfony.
 Topic: Minor fillin doc error
Minor fillin doc error [message #11383] Mon, 04 September 2006 11:25
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
fillin:
 activate: on


I believe this part, in the fillin docs, should use a double-space to indent the activate line. Could someone add the change, when they get a moment. Only a convention mistake but probably worth fixing for consistency. Thanks.


Remember Palestine
 Topic: Need to add getPresentationFor to docs
Need to add getPresentationFor to docs [message #11593] Wed, 06 September 2006 19:35
Draven  is currently offline Draven
Messages: 760
Registered: January 2006
Faithful Member
For me atleast, this is a very usefull function but I couldn't remember the exact naming for the method or even what class it was that held it.

I found after 20 mins of endlessly searching the docs that it isn't even mentioned in there, anywhere. I think it would be usefull to add this in either the Actions or Templating sections so people know it exists.

Just a suggestion, it drove me nuts knowing it existed but not remembering where and how exactly to call it.

The only thing that finally lead me to remember what the calls name was a section under the sfView::VAR in the action docs stating...

The returned value can be read with $controller->getActionStock()->getFirstEntry()->getPresentation().


As you can see this isn't even the same as the getPresentationFor() method but it was enough to jog my memory.
 Topic: Filter docs?
Filter docs? [message #14574] Tue, 24 October 2006 22:20
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Folks,

I know it has been mentioned a few times now in the fora, so I don't want point it out again too many times, but is there an ETA on docs for filters? I've mentioned filters a few times in my posts, but am somewhat stuck for official guidance on them (snippets and fora postings do help, though).

I could do with brushing up my knowledge in this area too, anyway Smile


Remember Palestine
 Topic: Error in Templating in practice : Form helpers
Error in Templating in practice : Form helpers [message #17849] Wed, 13 December 2006 19:33
akinas  is currently offline akinas
Messages: 69
Registered: April 2006
Member
Quote:

# submit button (as text):

<?php echo submit_tag('Save') ?>
// will generate in HTML
<input type="submit" name="submit" value="Save" />



name="submit" should be name="commit".



 Topic: i18n tables and REDECLARED error
i18n tables and REDECLARED error [message #18100] Mon, 18 December 2006 16:17
zekus  is currently offline zekus
Messages: 11
Registered: November 2006
Junior Member

I'd like to inform everybody that creating the schema.yml in the longest and detailed way, DONT WORK!

my_connection:
  my_product:
    _attributes: { phpName: Product, isI18N: true, i18nTable: my_product_i18n }
    id:          { type: integer, required: true, primaryKey: true, autoincrement: true }
    price:       { type: float }
  my_product_i18n:
    _attributes: { phpName: ProductI18n }
    id:          { type: integer, required: true, primaryKey: true, foreignTable: my_product, foreignReference: id }
    culture:     { isCulture: true, type: varchar, size: 7, required: true, primaryKey: true }
    name:        { type: varchar, size: 50 }


It produces lot of REDECLARED errors.

Use the fastest and shortest way only.

my_connection:
  my_product:
    _attributes: { phpName: Product}
    id:
    price:       float
  my_product_i18n:
    _attributes: { phpName: ProductI18n }
    name:        varchar(50)


Happy symfony to all!

ps. Cannot insert comment on the relative page of the manual... it produce an error.
 Topic: Validation docs amendment
Validation docs amendment [message #19909] Wed, 17 January 2007 15:58
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
The validation docs state, in relation to the repopulation filter:

Quote:

Note: This feature is only available with a symfony release higher than 1096 and is still considered Alpha, since the interface can change. Feel free to give your feedback about it.


Is this still the case for the trunk? I imagine this has probably settled down by now?


Remember Palestine
 Topic: Is Phing still necessary
Is Phing still necessary [message #20469] Sun, 28 January 2007 17:35
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
Hi,

For PEAR installation, the download/installation instruction at
http://www.symfony-project.com/content/download.html
doesn't mention Phing download/installation,

but the book says it is necessary?

comment?

xpt


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
 Topic: congratulations on the new documentation
congratulations on the new documentation [message #20601] Tue, 30 January 2007 16:55
juwiley  is currently offline juwiley
Messages: 19
Registered: November 2006
Junior Member

Hi,

I just wanted to congratulate Francois and Fabien on the fantastic new documentation. I've only had the opportunity to skim through it, but from what I see so far: it looks great. I have a physical copy on order with Amazon as we speak, can't wait to get my hands on it.

Great work guys,
Justin
 Topic: mistake in TDGTS - encoding in databases.yml
mistake in TDGTS - encoding in databases.yml [message #20964] Sun, 04 February 2007 15:22
qube  is currently offline qube
Messages: 88
Registered: August 2006
Location: Czech republic
Member
In online The Definitive Guide to symfony on this page:
http://www.symfony-project.com/book/trunk/08-Inside-the-Mode l-Layer

Presented default setting of databases.yml has incorrect value for encoding. 'utf-8' is not working on MySQL, working setting for utf is 'utf8' as follows:

      encoding: utf8 # Default charset for table creation


Does this applies also to other databases?

btw, I can't add comment to that page, is it intended?

[Updated on: Sun, 04 February 2007 17:40]

 Topic: Typo On Pg 201 of Book?
icon12.gif  Typo On Pg 201 of Book? [message #21062] Mon, 05 February 2007 22:01
slarmore  is currently offline slarmore
Messages: 35
Registered: January 2007
Member
First, I am absolutely loving symfony. Tried Ruby on Rails, love symfony. It's every programming feature you begin to think about and then don't have the time to do (in certain work environments).

Second, I am really enjoying coursing through this book I just grabbed last weekend.

Ok, now to business.

The Definitive Guide Guide to symfony
Chapter 10: Forms
Page 201
Creating a Drop-Down List Based on a Foregin Key Column
Listing 10-13

Should '__toString()' be '__toString'?

Otherwise I think symfony is looking for 'yourAwesomeModel.__toString()()'.

Peace,
S

[Updated on: Mon, 05 February 2007 22:02]


Steven Larmore
Blog: Tech Me, Tech Me Not -- Symfony Fun and Gotchas
Email: firstname dot lastname at gmail dot com

How to instantiate God
 Topic: Mistake ? OnlineBook Chapter 7, Declaring Helpers
Mistake ? OnlineBook Chapter 7, Declaring Helpers [message #22436] Sat, 24 February 2007 12:53
warzentiger  is currently offline warzentiger
Messages: 2
Registered: July 2006
Location: Austria
Junior Member
OnlineBook, Listing 7-3:

<?php echo use_helper('Text'?>

I see the reason for echoing the returned values from helpers like FormHelper or ObjectHelper.
But what is returned from the HelperHelper that has to be echoed?

The 'use_helper' function uses 'sfLoader::loadHelpers' which doesn't return anything.

Is this a mistake?

btw: it's not possible to write comments anymore, intended ?
 Topic: Unable to comment on books?
Unable to comment on books? [message #22887] Sat, 03 March 2007 18:23
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
Hi,

Is anybody still able to comment on books?

There is a typo in Listing 8-15 at
http://www.symfony-project.com/book/trunk/08-Inside-the-Mode l-Layer#Using%20Raw%20SQL%20Queries

(details at
http://www.symfony-project.com/forum/index.php?t=msg&th= 5338&
)

but this is what I got:

Please correct the following errors and resubmit:

    * The name field cannot be left blank
    * The text field cannot be left blank


It has been like this for a while.


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
 Topic: SPAM contents in form,askeet tutorial.
SPAM contents in form,askeet tutorial. [message #22913] Sun, 04 March 2007 10:08
flyfront  is currently offline flyfront
Messages: 2
Registered: March 2007
Junior Member
Hello.

See the comment form of askeet day8.
http://www.symfony-project.com/askeet/8

I find SPAM contents in form.
What's happen?

index.php/fa/260/0/

  • Attachment: spam.png
    (Size: 10.64KB, Downloaded 3204 time(s))


------------------------------------------------
flyfront
e-mail: flyfront@gmail.com
------------------------------------------------
 Topic: Big problem of understanding the implentation of MVC Pattern
Big problem of understanding the implentation of MVC Pattern [message #24482] Mon, 26 March 2007 23:31
hoschi  is currently offline hoschi
Messages: 1
Registered: March 2007
Junior Member
Hi,

I read the MVC chapter of the symfony book --> http://www.symfony-project.com/book/trunk/02-Exploring-Symfo ny-s-Code#The%20MVC%20Pattern

and don't understand why the symfony framework implents the MVC pattern as it does, because I miss this important Features of MVC:
  • if the modell changes his data, it can force a validation of the connected views (the line between model and view in figure 2-2 isn't there)
  • one controller can have more than one view
  • view and modell don't now each other, they get connected through the controller --> in symfony the view call directly a action, this isn't MVC


Hasn't symfony this features? Do I haven't seen yet?

Please help Wink

 Topic: API.pdf file
API.pdf file [message #25200] Thu, 05 April 2007 12:42
Martyp  is currently offline Martyp
Messages: 37
Registered: February 2007
Location: Prague, Czech Republic
Member
Hello,

I prefer to browse the API.pdf but I don't like these things:
- the classes in the bookmarks are not ordered alphabetically but by the API group, which is missing. I found it difficult to find the class I need so I have to use a search a lot

- the tags &apos; are not translated to ' and are shown as text. This is also on the API html pages. Can this be fixed?

- the page for the pdf file is sometimes too narrow so the text is cut at the right side of the page. Can it use a wider format?

Thanks for the API anyway, I just want to make it more readable.
 Topic: Filters: executing a filter exactly once per page request
Filters: executing a filter exactly once per page request [message #25270] Fri, 06 April 2007 08:34
strike  is currently offline strike
Messages: 6
Registered: September 2006
Location: India
Junior Member
Hi,

Here I am referring to the filters which get executed before a page is served.

From documentation in Symfony book, chapter 6:
Quote:


The Front Controller's Job in Detail
.
.
7. Activate filters (for instance, if the request needs authentication).
8. Execute the filters, first pass.
9. Execute the action and render the view.
10. Execute the filters, second pass.
11. Output the response.



From documentation, it is clear that Filter chain makes multiple passes. In my case it is making 3 passes. I want my filter to get executed exactly once every page request. No matter how many passes fiter chain makes before it is rendered.

If I use code like this:
class myFilter extends sfFilter
{
  public function execute($filterChain)
  {
    // Execute this filter only once
    if ($this->isFirstCall())
    {
      //some code here
    } 
    // Execute next filter
    $filterChain->execute();
  }
}

my filter gets executed 3 times as filter chain have to make 3 passes.

How can make sure that my filter gets executed exactly once, that too in first pass itself?

Additional info: I have two partials in my layout.

-Sam
 Topic: logo and styleguide for download
logo and styleguide for download [message #25990] Thu, 19 April 2007 12:52
redray  is currently offline redray
Messages: 2
Registered: April 2007
Junior Member
it would be really great if the symfony logo and eventually a styleguide would be releases like for typo3:

http://typo3.org/teams/design/style-guide/

 Topic: link_to_remote() bug
link_to_remote() bug [message #32061] Mon, 23 July 2007 20:38
kkragenbrink
Messages: 3
Registered: July 2007
Location: Los Angeles, CA, USA
Junior Member
The API documentation suggests that you can set the position to top, bottom, before, or after to place the return content in various places relative to the id you want to update. After looking into how it's supposed to work, I've noticed that it changes this field to Insertion.<whatever>. Oddly, though, it's always using the same Insertion parameter, no matter what I change. Has anyone else noticed that top, after and before don't work? It's always bottom. I'd be really interested in getting this to work with 'before' and 'top' especially. Thanks.
 Topic: Started dutch translation of the book - any help is welcome
Started dutch translation of the book - any help is welcome [message #32720] Wed, 01 August 2007 22:53
skoop  is currently offline skoop
Messages: 21
Registered: November 2006
Location: The Netherlands
Junior Member

Hello everyone,

I just made a start with the dutch translation of the book: http://trac.symfony-project.com/trac/wiki/Documentation/nl_N L/book/1.0

If there are any other dutchies here that feel like helping me out, feel free to help. Preferably, to not work on the same things, start with a chapter that has yet to be translated. Wink

Stefan


Ibuildings - The PHP Professionals
 Topic: Bug: documentation error not fixed
Bug: documentation error not fixed [message #34094] Fri, 24 August 2007 10:12
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
There's a bug I raised in the docs a couple of months ago, which has not been fixed:

http://trac.symfony-project.com/trac/ticket/1923

Rolling Eyes


Remember Palestine
 Topic: askeet, day six documentation
askeet, day six documentation [message #36081] Fri, 21 September 2007 14:58
agonirena  is currently offline agonirena
Messages: 2
Registered: September 2007
Location: Elgoibar, Gipuzkoa, Spain
Junior Member
I am following the askeet tutorial.
After reading day six documentation, I think there is a little error.
The paragraph below "How about a bit of refactoring?" header, is talking about myUser class. This class behaviour is a sort of magic without explaining the role it plays in session management. What about extending a bit about the myUser class?
Talking about myUser class, the same paragraph contains this sentence: the session class, not the User class corresponding to the User column. I think that 'column' should be changed by 'table'.

sorry for my bad english Smile
 Topic: askeet, day eight, documentation
askeet, day eight, documentation [message #36298] Wed, 26 September 2007 00:41
agonirena  is currently offline agonirena
Messages: 2
Registered: September 2007
Location: Elgoibar, Gipuzkoa, Spain
Junior Member
The interest box is called from question/_list.php fragmnet and question/show template. Day 8 documentation remembers to add id="block_<?php echo $question->getId() to _list.php fragment but forgets to do the same with the showSuccess.php template.

[Updated on: Wed, 26 September 2007 00:42]

 Topic: How do I show post titles related to "My First Project" tutorial?
How do I show post titles related to "My First Project" tutorial? [message #39583] Thu, 15 November 2007 17:06
foobar  is currently offline foobar
Messages: 5
Registered: June 2006
Junior Member
In the tutorial the following code is shown:

<?php if ($sf_params->has('post_id')): ?>
  <?php echo input_hidden_tag('post_id',$sf_params->get('post_id')) ?> 
<?php else: ?>
  <tr>
    <th>Post*:</th>
    <td><?php echo object_select_tag($comment, 'getPostId', array('related_class' => 'Post')) ?></td>
  </tr>
<?php endif; ?>


How can I change this, that the title of the post is also shown? How do I get this result:

 <td><select name="post_id" id="post_id"><option value="" selected="selected"></option>
<option value="1">Great first Post</option>
<option value="2">Second post</option>
</select></td>

[Updated on: Thu, 15 November 2007 17:07]

 Topic: How to handle multiple schemas
icon5.gif  How to handle multiple schemas [message #39972] Tue, 20 November 2007 23:20
jhleoh  is currently offline jhleoh
Messages: 1
Registered: November 2007
Junior Member
I'm trying to create two schema in oracle, using two different user id (core, reference).
In my databases.yml file, I defined two connections one for each user id.
Then I created two *schema.yml files, one for each connection.
I expect the propel will generate two sql files for me, one for each user id.
But I found the actual output sql file only contains tables in the first schema file.
In order to create all tables, I must use same connection in both schema files.
In the documentation, it says multiple schema is supported, is there something wrong with my setting?

Below is a sample of my files:

databases.yml
all:
  reference:      
    class:                sfPropelDatabase
    param:
      phptype:            oracle     # Database vendor
      hostspec:           localhost
      database:           mydb
      username:           reference
      password:           password
      port:               1521
      encoding:           utf8      # Default charset for table creation
      persistent:         true      # Use persistent connections
  core:
    class:                sfPropelDatabase
    param:
      phptype:            oracle     # Database vendor
      hostspec:           localhost
      database:           mydb
      username:           core
      password:           password
      port:               1521
      encoding:           utf8      # Default charset for table creation
      persistent:         true      # Use persistent connections


core-schema.yml
core:
  person:
    id: { type: integer, required: true,primaryKey: true, autoIncrement: true }    
    first_name:    { type: varchar(50), required: true, index: true }
    middle_name:   { type: varchar(50), required: true}
    last_name:     { type: varchar(50), required: true, index: true }
    gender:       integer
    nick_name:     { type: varchar(50), required: true, index: true }
    date_of_birth:  bu_date
    created_on: date
    updated_on: date


reference-schema.yml
reference:
  type:
    id: { type: integer, required: true,primaryKey: true }
    type_name: varchar(50)

[Updated on: Tue, 20 November 2007 23:23]

 Topic: Unit Testing Tutorial with Explanation on how to use it with Database
Unit Testing Tutorial with Explanation on how to use it with Database [message #39974] Wed, 21 November 2007 00:48
DrDrakken  is currently offline DrDrakken
Messages: 80
Registered: January 2007
Member
I think it would be great if there could be a tutorial that could walk us through the unit and functional testing process. More specifically with emphasis on how to use Doctrine with unit testing. Ch 15 in the book does not really go into the testing in much detail and leaves beginners completely lost with regards on how to unit test functions that use the Doctrine database objects
 Topic: right step for building a new application?
right step for building a new application? [message #40649] Fri, 30 November 2007 10:30
Onir  is currently offline Onir
Messages: 122
Registered: December 2006
Location: Italy
Senior Member
Hallo,
I have some difficult to understand well the meaning of every function to create an application.
help me to create a little tutorial for creating a new application with simfony.

Steps:
1)create directory for new application (es. MyApp)

2)at the root of MyApp:
symfony init-project NameApplication
(to create directory structure)
mydify ../config/propel.ini (for giving to symfony db password ecc...)

3)create db structure and create schema.yml
3a) create db structure with DBDesigner (http://fabforce.net/dbdesigner4/)
3b)transform the file created with DBDesigner in schema.xml using
http://blog.tooleshed.com/docs/dbd2propel/transform.php

YOU Don't need to create schema.yml (See post http://www.symfony-project.org/forum/index.php?t=rview&t h=10051)

is not userfull-> 3c)delete schema.yml and copy schema.xml created at point 3b
is not userfull-> 3d) create schema.yml running symfony propel-build-schema

NOW symfony have the schema of application
so you can build the model

4) symfony propel-build-model
for building model

5)
symfony propel-build-sql
for building sql
symfony propel-insert-sql
for creating tables in databases

Now Database contains what model represent

6)create crud module or application module

is right?


in these steps I don't understand well the difference beetween:
name of Application name of project in propel.ini, name in database.yml (usually propel)...

I thimk that in symfony documentation miss a good explanation of meaning of steps for creating application.

Thank you in advance

[Updated on: Fri, 30 November 2007 10:41]

 Topic: sfFileValidator
sfFileValidator [message #43633] Thu, 17 January 2008 23:13
ouillonn  is currently offline ouillonn
Messages: 67
Registered: July 2007
Member
Hi everybody,

I think it may be usefull to write down in the documentation of sfFileValidator that the order of the mime-types is actually VERY important, especially for the Internet Explorer.

I had an interesting experience with that little trap. I added the mime "image/gif" in the middle of the list like that:

    sfFileValidator:
      mime_types:     
        - 'image/jpeg'
        - 'image/png'
        - 'image/gif'
        - 'image/x-png'
        - 'image/pjpeg'  


and the IE didnt get it and threw the mime-error-message. But if I change the order to

    sfFileValidator:
      mime_types:     
        - 'image/jpeg'
        - 'image/png'
        - 'image/x-png'
        - 'image/pjpeg'
        - 'image/gif'  


everything works fine.

Maybe this is a stupid request, maybe I'm blind. But actually, its quiet amberrant! So I hope this will help some people out there!

Greets from Berlin
 Topic: [Solved]Created_at and updated_at fields.... please help me!"
[Solved]Created_at and updated_at fields.... please help me!" [message #44851] Tue, 05 February 2008 15:16
ice_j7  is currently offline ice_j7
Messages: 116
Registered: February 2008
Location: Arequipa - Perú
Senior Member
Hi!, i'm trying to copy the feature with the created_at and updated_at fields, I want that it works too with my fields created_by and updated_by, saving automatically the user id, but I don't know which php script has this feature, please someone tell me which is, since I look almost all the propel files and don't find it. I started with symfony last week and it's awesome, thanks anticipated.

from Arequipa, Perú...... Jonathan Nieto

[Updated on: Fri, 22 February 2008 16:42]


Search in the code, find wisdom.
 Topic: sfFilevalidator mime type and initialize problems
sfFilevalidator mime type and initialize problems [message #47644] Wed, 12 March 2008 12:16
omarjebari
Messages: 20
Registered: February 2008
Junior Member
sfFileValidator class does not check the mime type of a file thoroughly enough to prevent file extension spoofing. A user can easily save an executable with a .jpg extension and this will pass through the validator without being picked up.
A simple method to prevent this is to call @getimagesize() (with the @ to suppress errors) on the file. If its a genuine image it will return an array otherwise it wont. Easy to test for if a little inelegant.

Also the example of writing a custom validator in Chapter 10 of The Definitive Guide (Listing 10-18) doesnt work. It does not call the initialize() function explicitly. Perhaps the author intended to put the code in the initialize() function into the class constructor.
Anyhow you need to call initialize explicitly...so in the example the following lines:

$myValidator = new sfStringValidator($this->getContext(), array(
'min' => 2,
'min_error' => 'This name is too short (2 characters minimum)',
'max' => 100,
'max_error' => 'This name is too long. (100 characters maximum)',
));

Should be changed to:

$myValidator = new sfStringValidator();
$myValidator->initialize($this->getContext(), array(
'min' => 2,
'min_error' => 'This name is too short (2 characters minimum)',
'max' => 100,
'max_error' => 'This name is too long. (100 characters maximum)',
));

or you could just write your own file validator and use that instead!
 Topic: Changing template without generator.yml
Changing template without generator.yml [message #49025] Wed, 02 April 2008 15:39
thyagotc  is currently offline thyagotc
Messages: 2
Registered: April 2008
Location: Czech Republic
Junior Member
I´m new to Symfony and I´d like to know if is possible to develop an entire application just by changing YML files and making the layout.
I was trying to find a generator.yml configuration to put the fields in the format:

--
Your email:
Please privide your email
[ ____ text field _____ ]
--

But I only found examples and codes that allows only:

--
Your email: [ ____ text field ____ ]
--

If I change the template file directly, and I need to create some new fields in the future, I could not generate the CRUD automatically again.

Changing the template directly is a wrong pratice?


--
Thyago
Pages (2): [1  2  >  »]

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software