Skip navigation.

My pasteblog

This is not my Zettelkasten but a durable .bash_history

Posts tagged with "symfony"

symfony, svn

me@localhost:
mkdir /home/cpr/Programming/PHP/symfony/myproject
cd ESC .
symfony generate:project myproject #uses system-wide symfony installation
rm -rf cache/* log/*

superuserbutnotroot@remote:
svnadmin create /var/svn/myproject
sudo chown myuser:users -R /var/svn/myproject

me@localhost:
svn mkdir -m "initial structure" svn+ssh://myuser@example.com/var/svn/myproject/trunk svn+ssh://myuser@example.com/var/svn/myproject/tags svn+ssh://myuser@example.com/var/svn/myproject/branches
rm -rf cache/* log/*
svn import -m "initial import" svn+ssh://myuser@example.com/var/svn/myproject/trunk
svn co svn+ssh://myuser@example.com/var/svn/myproject/trunk mediaservice

svn propedit svn:ignore cache/ # put *
svn propedit svn:ignore log/ # put *
mkdir lib/vendor
svn add lib/vendor
svn propedit svn:externals lib/vendor # put symfony http://svn.symfony-project.com/branches/1.2
svn commit
svn update

root@localhost:
vi /etc/lighttpd/vhosts.d/myproject.conf
#$HTTP["host"] =~ "dev.myproject.local" {
#server.document-root = "/home/me/Programming/PHP/symfony/myproject/trunk/web"
#alias.url = ( "/sf/" => "/user/share/php5/PEAR/data/symfony/web/sf/" )
#url.rewrite-once = (
# "^/(.*\..+(?!html))$" => "$0",
# "^/(.*)\.(.*)" => "$0",
# "^/([^.]+)$" => "/index.php/$1",
# "^/$" => "/index.php"
#)
#}
vi /etc/hosts
#127.0.0.1 localhost dev.myproject.local
#edit Opera Extras Einstellungen Erweitert Netzwerk Proxyserver "Keinen Proxyserver für folgende Adressen verwenden:" *local


symfony generate:app --escaping-strategy=on --csrf-secret=UniqueSecret frontend
#// config/ProjectConfiguration.class.php
#require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';


config/properties.ini:
[symfony]
  name=myproject
  author=Chr Prior <joe at example.com


./symfony generate:module frontend default #edit action.class.php and remove $this->forward() to disable the symfony default startpage


svn propedit svn:externals plugins
1 sfDoctrineGuardPlugin http://svn.symfony-project.com/plugins/sfDoctrineGuardPlugin/branches/1.2
2 ysfDimensionsPlugin http://svn.symfony-project.com/plugins/ysfDimensionsPlugin/branches/1.2

symfony plugin:publish-assets

symfony schon bald mit 3-Jahres-Garantie

lighttpd (cygwin), PHP5.2.0, Windows 2000, symfony

, , ,

I can only tolerate W2K with cygwin installed, and its package manager got me lighttpd.
This needed configuration:
cp /e^T/li^T/lighttpd.conf.default /etc/lighttpd/lighttpd.conf
vi ESC .
Only static HTML at first:
server.document-root = "/cygdrive/e/www/localhost/"
echo "test" > /cygdrive/e/www/localhost/index.php
echo "test" > /cygdrive/e/www/localhost/index.htm
/usr/sbin/lighttpd.exe -D -f /etc/lighttpd/lighttpd.conf #I could CTRL-C terminate it
#/usr/sbin/lighttpd.exe -f /etc/lighttpd/lighttpd.conf #goes to background mode, ps ux needed to get the PID
Big mistake: index.php takes precedence over index.htm and I got a 403 error. Removing the index.php helped.

Get PHP from http://www.php.net/downloads.php
Put it to C:\PHP and include the cgi version!
Version PHP5.2.0 did not work with yaz, pspell, nt$something and a 4th extension that I have already forgotten, so I excluded them.
The peardev.bat has some ^ characters in it, removed them by hand.
Double-clicking (*yuck*) to initialize PEAR, then I did the usual channel-discover etc. as per symfony docs. Then symfony installed without any problems.

Back to lighttpd: Un-commented cgi module, cgi.assign = (".php"=>"C:\PHP\php-cgi.exe")
Got a "no input file specified" error, added in php.ini a docroot E:\www\localhost as per http://www.php.net/manual/de/security.cgi-bin.php 1st comment.
A phpinfo(); in index.php worked then.
Changed BOTH php.ini and lighttpd.conf to point to a symfony-style $mypath/web/ directory, un-commented mod_rewrite, mod_redirect, mod_alias in lighttpd.conf and added
alias.url = ( "/sf/" => "/cygdrive/c/PHP/PEAR/data/symfony/web/sf/" )
url.rewrite-once = (
"^/(.*\..+(?!html))$" => "$0",
"^/(.*)\.(.*)" => "$0",
"^/([^.]+)$" => "/index.php/$1",
"^/$" => "/index.php"
)
I didn't bother to setup a vhost, as this installation is just for testing anyways. I got that above rewrite stuff from the symfony wiki IIRC (taken from another host).
Now c:\php\symfony init-project test && C:\PHP\symfony init-app frontend brought me the familiar symfony welcome screen.

I downloaded mysql-essential-5.0.27-win32.msi and installed ot as a service (for now). Configuration was done with the bundled "MySQL Server Instance Config Wizard". In cmd.com mysql -u root -pmyPassword and create databse symfony.

In the symfont directory I changed both config/database.yml AND propel.ini including username:password in both of them. I could then copy the schema.yml from the First Project tutorial and run propel-*-* to create the database tables.


Music to my ears!

I downloaded http://xdebug.org/link.php?url=xdebug200rc3-521-win although it said PHP5.2.1+ and put it in my C:\PHP\ext and added zend_extension_ts="C:/PHP/ext/php_xdebug-2.0.0rc3-5.2.1.dll" to my php.ini -- that's all to install xdebug. In cmd.com a C:\PHP\php-cgi.exe brought no error message, if the xdebug dll is too old it says something along the lines "Xdebug requires Zend Engine API version 220051025.
The Zend Engine API version 220060519 which is installed, is newer.
Contact Derick Rethans at http://xdebug.org for a later version of Xdebug."

I could not get xcache to work with PHP5.2.0, but on another machine with PHP-5.1.6

I am a suit, not a geek! ;)

, ,

19:38 queru * hi all another time
19:39 queru * Anyone can help me on how to internationalize an interface
using MySQL to store the _messages?
19:46 queru * ¡Aleluya!
19:46 queru * http://my.opera.com/cpr/blog/show.dml/120232
19:47 queru * A geek whos pastes the table structure for i18n
19:50 queru * Two days loss for i18n
19:50 queru * Hurra for frameworks!
20:51No new messages in awaylog
20:51[freenode] You are no longer marked as being away
20:52 cprior * heh, that's me!
[20:53] [cprior(+ei)] [3:#symfony(+n)]

symfony @froscon: The good, the bad and the ugly

It was a nice sunday brunch-time excursion to Sankt Augustin near Cologne where I presented symfony at the froscon 2006, a F/OSS conference at the University of Applied Sciences Bonn-Rhein-Sieg.

The talk was held in the web develop track.

The good

About 50 people attended the talk which makes a nice multiplication effect. I will watch out for blog posts in the next days.

I stated up front that I will give a rather high-speed talk about symfony as I didn't want to start a hands-on session. But rather present an overview of the many, many features. Starting with MVC patterns in general I highlighted the symfony implementation, adding code samples where appropriate. Although I don't think that makes someone understand YAML instantly I am positive that all components and major 3rd party libraries have been introduced. So if someone wants to try it they know "the players".
I did very well on the high-speed aspect.

As a hobbyist I had to bridge the gap to the professional developers. I judge /some/ aspects differently as a hobbyist but I prepared the audience so that they could relate the different point of views. Public speaking is not about appearing superior but suceeding in establishing a somehow working relationship with the audience. So I played the 'hobbyist' card right at the time.

I could cover all features that I had planned for in my slides. The attendees now know about the general structure of the framework as well as selected "application-ready" features such as

  • forms and validation
  • i18n (database and in the view)
  • smart URLs
  • cache
  • debugging
  • testing
  • scaffolding
  • pagination
  • security


I left out -- as planned -- the filter chain, replacing the ORMapper and coding captchas.

I also pointed out the key vocabulary of symfonys MVC pattern (such as sfFrontWebController, schema.xml, environments (prod|dev), view.yml and model/action as well as layout/component (slot)/partial etc.) Included was everything that is necessary for a in-depth test-drive with the sandbox.

All in all I found my slides to contain the relevant keywords about the subject, I felt good with working them. This should prepare for the documentation which I have praised appropriately. Sure, they contained _a lot_ of symfony-vocabulary---but well, it was a high-speed overview! I threw in some of my gotchas about ORM, MVC and i18n and I have no other reason to believe than these might have been new aspects to the one or the other member of the audience.

Very good was the fact that I could keep my humour in check -- which is a bit on the dry and relating-the-unrelated side occasionally! ;)

But the best thing was the topic itself: It is very easy to talk about symfony because it is something substantial. There are no gaps to cover, no not-working-yets to defend, no bugs screwing productivity to hide. No, it is a brand-new framework not known to many people that already has to offer such a broad set of features. I am 100% sure no one in the audience thinks a lot about re-filling form fields with Xpath...


The bad

There were a few misspellings I noticed only during the talk. And it even got worse! ;)

At one point, unfortunately when I presented the routing system, I had not properly escaped the program code for my slide-processor (beamer-latex) which made the code barely readble. Verbatim content is a bit bitchy in that setting...

That was most probably the reason why I believe that I could not bring the routing across very well. Although I think that routing.yml has to be presented in great details anyways, because the effect on the URL and the not-being-effected of the framework needs a more hands-on approach. I feel easier to talk about environments in a controller than about routing!

My madness about the pre-talk screw-up made my start into the talk a bit rough, and I talked about computer-related stuff for the first time.

The ugly

I could not get all parts of the presentation to work: Slides were fine, file browser worked despite being a resource hog BUT NOT MY VIRTUALISED WEBSERVER. Network settings with coLinux, I still have to figure out what exactly went wrong.

Somehow I managed to calm me down but I have been breaking out in swaet in the prep room. I compiled about 1.3GB of source code on that 64MB RAM virtual server in the past days (Gentoo, dual-boot but I wanted to work in Windows parallel.) I was mad about it. Secretly.

Noticeably this affected only the slide about debugging, where I could not show the promised "live example" of the debug toolbar (I did not admit that something was terribly wrong at all).

Nice-to-haves would have been a 5-minute rapid CRUD app for which I was prepared for and actually showing the symfony web page and content despite just mentioning them...

However, I finished my talk in exactly the 45 minutes I asked for. I retrospective I should have gone for 1.5 hours which hadn't made my guardian angel messing with my setup! ;)
And a talk over the time is badder than missing features or bad gramar!


Credits

The froscon is nice, if you are speak german and involved in FOSS go there next year! Nice building, many helpful staff around (the student body organizes the conference) and they make all food fresh ('fresh' like in 'cutting groceries' and so on!). Good place to present a framework from France!

Appendix

The year is 2006. Almost every hype-able web application is occupied by Ruby code. Teh whole intarnet? No, a small gaulish web agency under the rule of unbending PHP-programmers is still holding out commits against the conqueror.



(My teaser for the program entry. Cannot find where I said "basic understanding of MVC pattern required... *g*)

Frameworks und Vertrauen

,

Ich bin ein PHP-Hobbyist.

Meine erste Tat auf einem WAMP (Windows 98!) war es, ein PHPNuke aufzusetzen. Seitdem habe ich einiges dazugelernt, schliesslich sitzen mir keine Fertigstellungstermine im Nacken! *aetsch* (hehe, scnr)

Im Jahr 2005 stand an, ein Framework mit Objektorientierung, Datenbankansprache mit objektrelationaler Verknuepfung und sowieso im MVC-Entwurfsmuster zu erlernen: Ich moechte stets mit eigenem Code am Informationsaustausch im Internet teilnehmen koennen, und mindestens mit Benutzerauthentifizierung. Das ist fuer mich ein kultur- und technikgeschichtliches Beduerfnis, aber das will ich hier und jetzt nicht weiter ausfuehren.

Mit dem Anwender in einer Agentur habe ich aber eines gemeinsam: Meine Zeit ist zu limitiert, um eine Vielzahl an Frameworks zu erlernen. Ich brauch eine Codesammlung, die mich sofort produktiv sein laesst, und die mir auch in zwei Jahren noch zur Verfuegung steht.

Bei der Evaluierung blieb ich bei symfony haengen.

Obwohl zu diesem Zeitpunkt nur in Version 0.4 verfuegbar, ueberzeugte es mich
  • mit umfangreicher Dokumentation in bestem Englisch, obwohl die Verfasser Franzosen sind,
  • als nicht-englische-Muttersprachler bauten die Entwickler I18n von Grund auf ein (Hallo RoR!),
  • einer hohen Schlagzahl an Commits,
  • der pragmatischen Grundeinstellung
  • und einem niedrigen Ego-Niveau.


Zwar gibt es fuer jeden Suchenden auf dem Feld der PHP5-Frameworks noch eine Menge anderer Gruende, symfony einmal zu begutachten, aber die obigen sind fuer mich aus einem Grund bedeutsam:
Sie schaffen Vertrauen.

Meine persoenliche Zeit-Wette sieht also vollen Einsatz auf symfony gesetzt. Weil es von Anfang an produktiv einsetzbar war. Und weil ich glaube, dass es auch uebernaechstes Jahr noch existiert.

#symfony: RoVeRT: DB structure and sample info for I18N

,

http://symfony.pastebin.com/517490

Posted by RoVeRT on Sun 22nd Jan 14:51 (modification of posting from RoVeRT show diff)
diff | download | new post
# Table structure for table `catalogue`
#

CREATE TABLE `catalogue` (
`cat_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL DEFAULT '',
`source_lang` varchar(100) NOT NULL DEFAULT '',
`target_lang` varchar(100) NOT NULL DEFAULT '',
`date_created` int(11) NOT NULL DEFAULT '0',
`date_modified` int(11) NOT NULL DEFAULT '0',
`author` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`cat_id`)
) TYPE=MyISAM AUTO_INCREMENT=4 ;

#
# Dumping data for table `catalogue`
#

INSERT INTO `catalogue` VALUES (1, 'messages', '', '', 0, 0, '');
INSERT INTO `catalogue` VALUES (2, 'messages.en', '', '', 0, 0, '');
INSERT INTO `catalogue` VALUES (3, 'messages.en_AU', '', '', 0, 0, '');

# --------------------------------------------------------

#
# Table structure for table `trans_unit`
#

CREATE TABLE `trans_unit` (
`msg_id` int(11) NOT NULL AUTO_INCREMENT,
`cat_id` int(11) NOT NULL DEFAULT '1',
`id` varchar(255) NOT NULL DEFAULT '',
`source` text NOT NULL,
`target` text NOT NULL,
`comments` text NOT NULL,
`date_added` int(11) NOT NULL DEFAULT '0',
`date_modified` int(11) NOT NULL DEFAULT '0',
`author` varchar(255) NOT NULL DEFAULT '',
`translated` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`msg_id`)
) TYPE=MyISAM AUTO_INCREMENT=6 ;

#
# Dumping data for table `trans_unit`
#

INSERT INTO `trans_unit` VALUES (1, 1, '1', 'Hello', 'Hello World', '', 0, 0, '', 1);
INSERT INTO `trans_unit` VALUES (2, 2, '', 'Hello', 'Hello :smile:', '', 0, 0, '', 0);
INSERT INTO `trans_unit` VALUES (3, 1, '1', 'Welcome', 'Welcome', '', 0, 0, '', 0);
INSERT INTO `trans_unit` VALUES (4, 3, '', 'Hello', 'G\'day Mate!', '', 0, 0, '', 0);
INSERT INTO `trans_unit` VALUES (5, 3, '', 'Welcome', 'Welcome Mate!', '', 0, 0, '', 0);
November 2009
S M T W T F S
October 2009December 2009
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30