Witam

chcę napisać własny plugin do stronki opartej na symfony 1.1. Plugin ma zadanie obsługiwać galerie, torzyć, wyświetlać itd.
Mógł bym normalnie dodać następny moduł w symfony. Ale pomyślałem, że lepiej było by zrobić to jako plugin ponieważ, było by to całkowicie niezależne (w pewnym sensie) no i ładnie było by zamknięte w jednym katalogu (formularze, model, module, lib itd)

Niestety mam problem z instalacją własnego pluginu.
Z tego co zrozumiałem i wyczytałem z dokumentacji (http://www.symfony-project.org/book/1_1/17-Extending-Symfony) to należy wgrać na serwer symfony.

Nie wiem ogulnie za dużo na ten temat w sumie jeste całkowicie zielony w tym temacie. Co udało mi się zrobić to
  1. symfony plugin:instal C:\wamp\www\strona.pl\sfGaleria.tgz
  2.  
  3. >> sfPearFrontendPlugin .
  4. >> sfPearFrontendPlugin .
  5. >> sfPearFrontendPlugin .
  6. >> sfPearFrontendPlugin .
  7. >> sfPearFrontendPlugin .
  8. >> sfPearFrontendPlugin .
  9. >> sfPearFrontendPlugin .
  10. >> sfPearFrontendPlugin .
  11. >> sfPearFrontendPlugin .
  12. >> sfPearFrontendPlugin .
  13. >> sfPearFrontendPlugin .
  14. >> sfPearFrontendPlugin .
  15. >> sfPearFrontendPlugin .
  16. >> sfPearFrontendPlugin .
  17. >> sfPearFrontendPlugin .
  18. >> sfPearFrontendPlugin .
  19. >> sfPearFrontendPlugin .
  20. >> sfPearFrontendPlugin .
  21. >> sfPearFrontendPlugin .
  22. >> sfPearFrontendPlugin .
  23. >> sfPearFrontendPlugin .
  24. >> sfPearFrontendPlugin .
  25. >> sfPearFrontendPlugin .
  26. >> sfPearFrontendPlugin .
  27. >> sfPearFrontendPlugin .
  28. >> sfPearFrontendPlugin .
  29. >> sfPearFrontendPlugin .
  30. >> sfPearFrontendPlugin .
  31. >> sfPearFrontendPlugin .
  32. >> sfPearFrontendPlugin .
  33. >> sfPearFrontendPlugin .
  34. >> sfPearFrontendPlugin .
  35. >> sfPearFrontendPlugin ...done: 2,671,836 bytes
  36.  
  37.  
  38. Installation of "C:\wamp\www\partytime.pl\package.tgz" plugin failed: pear.sym
  39. fony-project.com/symfony not installed


I nic się nie zainstaluje. Mój plugin zajmuje jedynie 10kb wiec nie wiem skąd ten rozmiar (done: 2,671,836 bytes).

To wszystko są pruby czy wogyle zainstaluje się więc plik package.xml byl pobrany z innej paczki i zmodyfikowałem

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <package packagerversion="1.4.9" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 <a href="http://pear.php.net/dtd/tasks-1.0.xsd" target="_blank">http://pear.php.net/dtd/tasks-1.0.xsd</a> <a href="http://pear.php.net/dtd/package-2.0" target="_blank">http://pear.php.net/dtd/package-2.0</a> <a href="http://pear.php.net/dtd/package-2.0.xsd">" target="_blank">http://pear.php.net/dtd/package-2.0.xsd"></a>
  3. <name>sfGaleria</name>
  4. <channel>pear.symfony-project.com</channel>
  5. <summary>galeria blab</summary>
  6. <description>opis</description>
  7. <lead>
  8.  <name>name</name>
  9.  <user />
  10.  <email>jsingleton@wordhuslter.com</email>
  11.  <active>yes</active>
  12. </lead>
  13. <date>2008-08-24</date>
  14. <time>00:42:37</time>
  15. <version>
  16.  <release>0.0.2</release>
  17.  <api>0.0.2</api>
  18. </version>
  19. <stability>
  20.  <release>beta</release>
  21.  <api>beta</api>
  22. </stability>
  23. <license uri="http://www.symfony-project.com/license">MIT license</license>
  24. <notes>-</notes>
  25. <contents>
  26.  <dir name="modules">
  27.    <dir name="sfGaleria">
  28.     <file role="data" name="actions/actions.class.php" />
  29.     <file role="data" name="templates/indexSuccess.php" />
  30.    </dir>
  31.   </dir>
  32. </contents>
  33. <dependencies>
  34.  <required>
  35.   <php>
  36.    <min>5.1.0</min>
  37.   </php>
  38.   <pearinstaller>
  39.    <min>1.4.1</min>
  40.   </pearinstaller>
  41.   <package>
  42.    <name>symfony</name>
  43.    <channel>pear.symfony-project.com</channel>
  44.    <min>1.0.0</min>
  45.    <max>1.2.0</max>
  46.    <exclude>1.2.0</exclude>
  47.   </package>
  48.  </required>
  49. </dependencies>
  50. <phprelease />
  51. <changelog />
  52. </package>


Prubowałem np. normalnie skopiować katalog z apps\frontend\modules\galeria do plugins\sfGaleria
i w pliku settings.yml ustawiłem
  1. <?php
  2. all:
  3.  .settings:
  4.    enabled_modules:        [sfGaleria]
  5. ?>

Oczywiście w pliku actions.class.php zmieniłem na
  1. <?php
  2. class sfGaleriaActions extends sfActions
  3. ?>


Czy ktoś wie w czym problem lub jak zrobić aby z mojego pluginu można było wywołać akcje



Znalazłem też link jak zrobić swój plugin http://www.some-kind-of-asshole-fish.com/2...e-minute-primer
I jak prubuje uruchomić akcje z tego pluginu to wyskuje

[sfError404Exception]
Action "sfgaleria/index" does not exist.

---------------------------------------------------------
rozwiązanie

błąd polegał na tym żeby można było wywoływać akcje z pluginu należy stworzyć moduł w apps


  1. <?php
  2. // In myPlugin/modules/mymodule/lib/myPluginmymoduleActions.class.php
  3. class myPluginmymoduleActions extends sfActions
  4. {
  5.  public function executeIndex()
  6.  {
  7.    // Some code there
  8.  }
  9. }
  10. ?>
  11.  
  12. // In myPlugin/modules/mymodule/actions/actions.class.php
  13. class mymoduleActions extends myPluginmymoduleActions
  14. {
  15.  // Nothing
  16. }
  17.  
  18. // In myapp/modules/mymodule/actions/actions.class.php                          //tego wlasnie nie robilem
  19. class mymoduleActions extends myPluginmymoduleActions
  20. {
  21.  public function executeIndex()
  22.  {
  23.    // Override the plug-in code there
  24.  }
  25. }


Patrz http://trac.symfony-project.org/wiki/Docum...tending-Symfony