Create application out of hello dir:
./console init:application Foo ../foo/ ../web/
Create bundle:
./console init:bundle Application/FooBundle
Tag-Archiv für 'symfony'
Das folgende Beispiel demonstriert, wie man in symfony mit doctrine ORM die schema.yml eines Plugins überschreiben kann, um Modifikationen vor zu nehmen.
schema.yml in sfDoctrineGuardPlugin:
sfGuardUser:
actAs: [Timestampable]
columns:
...
Eigene schema.yml:
sfGuardUser: package: sfDoctrineGuardPlugin.lib.model.doctrine <Modifikationen>
Durch den -t Parameter wird die Ausgabe wie man es von früheren Version gewohnt ist erzeugt:
./symfony project:deploy -t production
Obviously the sfDoctrineFormGenerator.class extends the sfGenerator.class, but there is actually no way to set a parameter to call a custom form generator and this feature will come in the 2.0 release . So you have to set the parameter by hand in the sfDoctrineFormGenerator.class.php:
public function initialize(sfGeneratorManager $generatorManager)
{
parent::initialize($generatorManager);
$this->getPluginModels();
$this->setGeneratorClass('sfDoctrineForm');
$this->setTheme(sfConfig::get("formgenerator_theme","default"));
}
You have to set the “formgenerator_theme” setting in your ProjectConfiguration.class.php
Change in settings.yml the line(s) for error_reporting:
error_reporting: <?php echo ((E_ALL | E_STRICT) ^ E_DEPRECATED)."\n" ?>
If you develop your apps on a machine with PHP 5.3 but the production server has PHP 5.2.x you can replace the error_reporting line by this:
error_reporting: <?php echo ((version_compare(PHP_VERSION, '5.3.0', '<')) ? ((E_ALL | E_STRICT)) : ((E_ALL | E_STRICT) ^ E_DEPRECATED) )."\n" ?>
To disable the date-warning
Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead in /........../symfony/svn/1.2/lib/config/sfRootConfigHandler.class.php on line 91
add the command in ProjectConfiguration.class
date_default_timezone_set('UTC');
Die package.xml für symfony plugins per Hand zu editieren, ist etwas mühselig. Zum Glück gibt’s Hilfprogramme.
PackageFileManager installieren
sudo pear install pear/PEAR_PackageFileManager
PackageFileManager Client installieren
wget http://download.pear.php.net/package/PEAR_PackageFileManager_Cli-0.3.0.tgz
sudo pear install PEAR_PackageFileManager_Cli
Anleitung für den Client gibt’s hier.
Da ich Herausforderungen liebe, habe ich das sympal Plugin, welches auf dem symfony Day Cologne 2009 vorgestellt wurde, direkt unter symfony Version 1.3 ausprobiert, welche sich zum jetzigen Zeitpunkt noch in der Entwicklung befindet. Aufgrund der nicht standardkonformen Programmierweise, was die Einbettung von Assets angeht, musste ich einen zusätzlichen Filter implementieren, um es ans Laufen zu bekommen. Danach funktionierte es aber. Hier uns da noch ein paar Bugs, aber ansonsten macht es einen sehr guten Eindruck. Nicht desto trotz fallen mir ein paar Verbesserungsmöglichkeiten ein.
Ich habe mich mal zum symfony Day Cologne 2009 angemeldet und die Sessions besuchen. Mal schauen was das wird ^^
If you use plugins which comes with their own database tables the following error will occur at reverse engineering:
Some problems occurred when executing the task:
build-propel.xml:479:1: Duplicate table found: propel.
build-propel.xml:465:22: Execution of the target buildfile failed. Aborting.
If the exception message is not clear enough, read the output of the task for more information
So I created a plugin with a task which can be called after the command propel:build-schema. The task will remove duplicate tables and fix I18N entries in xml schema file.
http://www.symfony-project.org/plugins/sfYamlSchemaPatcherPlugin
Sometimes it’s usefull to disable the web debug toolbar in dev mode manually, e.g. in an AJAX response.
sfConfig::set(‘sf_web_debug’,false);