On 12.10.2008, at 12:54, Mark Brown wrote:

Hi,

Hi Mark,

let me apologize right away for the relatively brief reply. Things are mad busy over here these days.


So here we go:

- Suppose that I would like to have the ability to have a notice
thrown out to syslog whenever I place something like
Syslog::logMessage('Hi there!') in my code. Be it the model, view or
controller. How would be the sane way to obtain the same effect in
Agavi?

There is a logging functionality, so you'd simply to $loggerManager- >log(). You can log directly to a certain logger, or simply log your message (with an optional message level) and have it directed to the appropriate appenders automatically. We don't ship with a SyslogAppender at the moment (only Stderr), but if you'd like to contribute one... :)


- If I'm not mistaken Agavi uses regexes for routing. Would it be easy
to simply use an array of values, say, for performance reasons?

PCRE regular expressions are extremely fast. Note that if you nest routes, only the top-level ones are matched against (and then children, if a top level route matched). The impact really is negligible.


- Is it hard to make sure that I get a "page" to show only on a single
URL, let's say for SEO sake? If I'm not mistaken in Zend Framework the
same default view is shown with /, /index/ and /index/index/. I would
like to avoid things like that.

Yes, of course. URLs do not need to map to specific controllers or anything.


- I use the following conventions for my PHP coding, what will I have
to change to work with Agavi?

  mixedCamelCase for variables and methods

  CamelCase for classes

  lower_case_with_underscores for array keys

  For filenames I use something like ClassName.class.php,
ClassName.config.php, InterfaceName.interface.php,
TemplateName.template.php and similar patterns.

Use what you like best. The convention for Actions, Views and Models is FooAction.class.php etc.

Note that the build system creates all the stuff for you, and can use your custom code templates so the files look like you want them to look right away.


- I have no experience at all with unit testing or PHPUnit which is
what Agavi supports and I think is the standard. If I write my code
following Agavi's guidelines can I be sure that it will be easy to
write tests for my code later on?

Agavi 1.0 has a dedicated testing subsystem. The build system will automatically create test stubs for you (that's not in an official 1.0.x release yet) whenever you create Actions, Views etc, but of course, creating those by hand is pretty straightforward.

Check out http://trac.agavi.org/browser/branches/1.0/samples/test/ tests to see what those look like.


These are just a few quick questions that came up on my mind.
Having these requirements met in my own "framework" would be trivial
but then again I'm afraid to commit huge mistakes being an amateur
without getting the whole picture.

Basically I'm asking you guys to sell me on Agavi :)

BTW, how would you summarize how Agavi relates to contributors?
Is it easy to get contributions accepted into the code base? Assuming
that all the necessary standards you have defined are being respected,
that is.

I guess it's fair to say that we have pretty strict standards not only regarding quality, but also regarding the actual use case for features (we never sacrifice clean design for a bit of convenience, for instance), which could be due to many of us core developers being pedantic Germans :)

But of course, we welcome useful contributions that are valuable additions to the framework core.

Mind you we're also launching an AgaviForge within the next weeks, which is an excellent place to contribute little things such as filters, database adapters, template engine drivers etc. An AgaviSyslogLoggerAppender would be quite general-purpose, though, and thus a good candidate for inclusion in Agavi itself.

Hope that helps, even though it was a bit short. Maybe others can share some thoughts and ideas, too.

Cheers,

David

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to