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
symfony plugin:instal C:\wamp\www\strona.pl\sfGaleria.tgz
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin .
>> sfPearFrontendPlugin ...done: 2,671,836 bytes
Installation of "C:\wamp\www\partytime.pl\package.tgz" plugin failed: pear.sym
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
<?xml version="1.0" encoding="UTF-8"?>
<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>
<name>sfGaleria</name>
<channel>pear.symfony-project.com</channel>
<summary>galeria blab</summary>
<description>opis</description>
<lead>
<name>name</name>
<user />
<email>jsingleton@wordhuslter.com</email>
<active>yes</active>
</lead>
<date>2008-08-24</date>
<time>00:42:37</time>
<version>
<release>0.0.2</release>
<api>0.0.2</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.symfony-project.com/license">MIT license</license>
<notes>-</notes>
<contents>
<dir name="modules">
<dir name="sfGaleria">
<file role="data" name="actions/actions.class.php" />
<file role="data" name="templates/indexSuccess.php" />
</dir>
</dir>
</contents>
<dependencies>
<required>
<php>
<min>5.1.0</min>
</php>
<pearinstaller>
<min>1.4.1</min>
</pearinstaller>
<package>
<name>symfony</name>
<channel>pear.symfony-project.com</channel>
<min>1.0.0</min>
<max>1.2.0</max>
<exclude>1.2.0</exclude>
</package>
</required>
</dependencies>
<phprelease />
<changelog />
</package>
Prubowałem np. normalnie skopiować katalog z apps\frontend\modules\galeria
do plugins\sfGaleria
i w pliku settings.yml ustawiłem
<?php
all:
.settings:
enabled_modules: [sfGaleria]
?>
Oczywiście w pliku actions.class.php zmieniłem na
<?php
class sfGaleriaActions extends sfActions
?>
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-primerI 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
<?php
// In myPlugin/modules/mymodule/lib/myPluginmymoduleActions.class.php
class myPluginmymoduleActions extends sfActions
{
public function executeIndex()
{
// Some code there
}
}
?>
// In myPlugin/modules/mymodule/actions/actions.class.php
class mymoduleActions extends myPluginmymoduleActions
{
// Nothing
}
// In myapp/modules/mymodule/actions/actions.class.php //tego wlasnie nie robilem
class mymoduleActions extends myPluginmymoduleActions
{
public function executeIndex()
{
// Override the plug-in code there
}
}
Patrz
http://trac.symfony-project.org/wiki/Docum...tending-Symfony
Ten post edytował kaniagandzowski 6.12.2008, 16:07:06