Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 29 2016 01:56
    hason opened #8
  • Oct 27 2016 09:07
    hason opened #7
  • Oct 27 2016 09:02
    hason opened #6
  • Oct 27 2016 09:02
    hason opened #5
  • Oct 27 2016 09:01
    hason opened #4
  • Aug 04 2015 14:01

    hason on master

    Přidán text o podpoře pro Symfo… (compare)

  • Aug 03 2015 07:55
    hason closed #3
  • Aug 03 2015 07:55
    hason commented #3
  • Jul 31 2015 13:16
    hason commented #3
  • Jul 31 2015 13:12
    hason labeled #3
  • Jul 31 2015 13:12
    hason labeled #3
  • Jul 31 2015 13:10
    hason assigned #3
  • Jul 31 2015 13:09
    hason opened #3
  • Jun 25 2015 13:49

    spicimedved on master

    Added Gitter badge Merge pull request #2 from gitt… (compare)

  • Jun 25 2015 13:49
    spicimedved closed #2
  • Jun 25 2015 13:48
    spicimedved closed #1
  • Jun 25 2015 13:01
    gitter-badger opened #2
darkwerewolf
@darkwerewolf
Tak už nic, dobrý :D Já měl pro ten balíček použitou routu /images :D blbec sem
panki3a
@panki3a
chcel by som sa opytat, ci sa da v config.yml v SF 3.4 nakonfirovat Cache a Array Cache Adapter alebo Chain Cache Adapter, presiel som celu dokumentaciu, ale jedine co sa da v sekcii framework.cache.pools naconfigurovat je memached, apcu, redis .. ale array alebo chain tam nieje. Dik za pomoc
smartin77
@smartin77
pozeram, ze je to tu uz dost mrtve...
ak tu zabludi nejaky zaciatocnik odporucam tento tutorial: https://github.com/smartin77/symblog3
v sekcii wiki je cely navod povodneho tutorialu na Symfony2: https://web.archive.org/web/20161120022620/http://tutorial.symblog.co.uk:80/
na verzii pre Symfony4 pracujem...
Dobyslav
@Dobyslav
Zdravím, podařilo se mi zprovoznit translation, ale narazil jsem na další problém.... potřeboval bych, aby se url při zadání (např. http://www.example.com/profile) automaticky doplnilo o locate (http://www.example.com/cs/profile), aby mi tak fungovalo routování .... v nynějším stavu, při zadání url bez locate se zobrazí chybová hláška: No route found for "GET /profile" .... ví někdo o nějakém řešení?
kor3k
@kor3k
@Dobyslav no, nejjednodušší imho je nepoužívat locale jako route attribute, ale jako parameter. jinak tedy https://symfony.com/doc/current/routing/optional_placeholders.html
Dobyslav
@Dobyslav
@kor3k Děkuji za reakci :) každopádně já osobně si nejsem jistý co je lepší využívat .... jinak bych rád dodal, že vycházím z dema https://github.com/symfony/demo
kor3k
@kor3k
@Dobyslav no, já zkoušel oba způsoby. ála attribute i ála parameter. a s tím prvním je víc problémů než užitku. když bude locale attr mandatory, musíš při každém generování url dosadit hodnotu. když bude optional, narazíš na "everything after an optional placeholder must be optional". takže jsem zůstal u toho druhého. podívej se na tenhle návod https://symfony.com/doc/current/session/locale_sticky_session.html
okyselov
@okyselov
Hi there. I have the User object and I'm trying update it but if I skip some fields in request it causes these fields goes to null. How to make the form ignore fields if it dont exist in the request?
kor3k
@kor3k
@okyselov make sure you are using PATCH http method and not PUT. according to the REST principles, PUT means "replace the resource", ie all omitted fields get nulled, while PATCH means "update the resource", ie all omitted fields are kept untouched. and symfony form / httpfoundation comply with these principles.
okyselov
@okyselov
@kor3k Thanks, I'll try it.
Dobyslav
@Dobyslav
Zdravím, dokáže mi někdo poradit jak přemístit CMS sulu.io (je to udělané v Symfony) z localu na klasický hosting? Když jsem to přemístil, upravil soubor parameters.yml, soubor admin.php, webstite.php.....soubor app.php se neupravoval protože odkazuje na soubory admin + website, tak mi to hodilo chybu 500. Předem děkuji za rady.
kor3k
@kor3k
@Dobyslav mno a co píše apache log? tail -f /var/log/apache2/error.log a zopakovat request
Dobyslav
@Dobyslav
[Fri Jun 29 15:21:22.380301 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49984] mod_fcgid: stderr: PHP Fatal error: Uncaught TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::registerLoader() must be an instance of Doctrine\Common\Annotations\void, none returned in /var/www/clients/client1/web9/web/www/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php:117
[Fri Jun 29 15:21:22.380430 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49984] mod_fcgid: stderr: Stack trace:
[Fri Jun 29 15:21:22.380442 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49984] mod_fcgid: stderr: #0 /var/www/clients/client1/web9/web/www/app/autoload.php(11): Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(Array)
[Fri Jun 29 15:21:22.380448 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49984] mod_fcgid: stderr: #1 /var/www/clients/client1/web9/web/www/public_html/web/website.php(30): require('/var/www/client...')
[Fri Jun 29 15:21:22.380453 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49984] mod_fcgid: stderr: #2 {main}
[Fri Jun 29 15:21:22.380457 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49984] mod_fcgid: stderr: thrown in /var/www/clients/client1/web9/web/www/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php on line 117
[Fri Jun 29 15:21:22.547784 2018] [fcgid:warn] [pid 12641] [client 95.80.234.150:49985] mod_fcgid: stderr: PHP Fatal error: Uncaught TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::registerLoader() must be an instance of Doctrine\Common\Annotations\void, none returned in /var/www/clients/client1/web9/web/www/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php:117
[Fri Jun 29 15:21:22.547838 2018] [fcgid:warn] [pid 12641] [client 95.80.234.150:49985] mod_fcgid: stderr: Stack trace:
[Fri Jun 29 15:21:22.547843 2018] [fcgid:warn] [pid 12641] [client 95.80.234.150:49985] mod_fcgid: stderr: #0 /var/www/clients/client1/web9/web/www/app/autoload.php(11): Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(Array)
[Fri Jun 29 15:21:22.547848 2018] [fcgid:warn] [pid 12641] [client 95.80.234.150:49985] mod_fcgid: stderr: #1 /var/www/clients/client1/web9/web/www/public_html/web/website.php(30): require('/var/www/client...')
[Fri Jun 29 15:21:22.547853 2018] [fcgid:warn] [pid 12641] [client 95.80.234.150:49985] mod_fcgid: stderr: #2 {main}
[Fri Jun 29 15:21:22.547857 2018] [fcgid:warn] [pid 12641] [client 95.80.234.150:49985] mod_fcgid: stderr: thrown in /var/www/clients/client1/web9/web/www/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php on line 117
[Fri Jun 29 15:21:22.703426 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49986] mod_fcgid: stderr: PHP Fatal error: Uncaught TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::registerLoader() must be an instance of Doctrine\Common\Annotations\void, none returned in /var/www/clients/client1/web9/web/www/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php:117
[Fri Jun 29 15:21:22.703485 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49986] mod_fcgid: stderr: Stack trace:
[Fri Jun 29 15:21:22.703494 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49986] mod_fcgid: stderr: #0 /var/www/clients/client1/web9/web/www/app/autoload.php(11): Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(Array)
[Fri Jun 29 15:21:22.703503 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49986] mod_fcgid: stderr: #1 /var/www/clients/client1/web9/web/www/public_html/web/website.php(30): require('/var/www/client...')
[Fri Jun 29 15:21:22.703512 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49986] mod_fcgid: stderr: #2 {main}
[Fri Jun 29 15:21:22.703520 2018] [fcgid:warn] [pid 27509] [client 95.80.234.150:49986] mod_fcgid: stderr: thrown in /var/www/clients/client1/web9/web/www/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotatio
kor3k
@kor3k
@Dobyslav hmm to vidím poprvé tedy... ale podle toho co píšou tady a tady tak to může souviset s verzí php.. pokud používáš 7.1 tak zkus místo toho 7.2
Dobyslav
@Dobyslav
@kor3k Ok vyzkouším a dám vědět. :) každopádně děkuji za radu a za ochotu :)
kor3k
@kor3k
@Dobyslav není zač ^_^ zkus, snad to pomůže.. jinak ještě, když jsem viděl ten log, tak doporučuji za prvé používat mod_php místo fcgi (pokud nemáš pro fcgi dobrý důvod) a za druhé instalovat apache+php z PPAček Ondřeje Surého:
ppa:ondrej/apache2
ppa:ondrej/php
jimiero
@jimiero
@jimiero
hey, anyone knows how to rewrite this sql query to work with doctrine?
SELECT FROM tablename WHERE startDate=CURDATE()
UNION ALL
(SELECT
FROM tablename WHERE startDate <> CURDATE() ORDER BY startDate DESC)
Jaroslav Kuba
@twoleds
@jimiero Is the UNION required? I think you can run two selects and merge the results in application.
jimiero
@jimiero
not required, do you have idea if can replace that query with something else compatible in doctrine?
jimiero
@jimiero

hello,

Anyone knows if is possible to add extra repository function on a 3rd party installed bundle?

scippio
@scippio
anybody have experience with loggly in symfony?
I'm getting: Invalid handler type "loggly" given for handler "loggly"
my setup is:
handlers:
        loggly:
            type:   loggly
            token:  <mytoken>
I have Symfony 2.8.44 ...
Fares tayari
@farestayari
hey guys , anyone knows what this function can do ? stats_cdf_weibull() ?
i have this error Attempted to call function "stats_cdfweibull" from namespace "App\Service".
in phpstorm it sais undefined function
and in the php manual there is no documentation on it
Dobyslav
@Dobyslav
Zdravím, jak mohu získat id aktuálně přihlášeného uživatele, abych jej mohl použít jako hodnotu idAuthor (při registraci nového uživatele)? Mám entitu User + využívám UserInterface, kterou využívám pro přihlášení i pro registraci.... našel jsem toto (https://stackoverflow.com/questions/10537879/symfony-getting-logged-in-users-id) ale furt mi to hází hodnotu null, byť jsem přihlášený.
kor3k
@kor3k
@Dobyslav ahoj, no logged user je v token_storage či v security helper, ale je tam jen v routach, které jsou za firewallem, jinak je null.
Dobyslav
@Dobyslav
@kor3k takže není možnost jej implementovat jako identifikátor autora (třeba u článku)?
kor3k
@kor3k
@Dobyslav no identifikátor ve smyslu doctrine oneToMany relation z něj udělat lze, jen musíš mít všechny routy za firewallem - https://symfony.com/doc/4.0/security.html - no pattern key means it matches all URLs. a jinak pro tohle "autorování" zkus kouknout na doctrine extensions, konkrétně Blameable - https://symfony.com/doc/master/bundles/StofDoctrineExtensionsBundle/index.html
Dobyslav
@Dobyslav

Zdravím, snažím se vypsat getEquipment(), ale dostávám chybovou hlášku (viz. níže). Předpokládám, že to musím převést na pole a z toho hodnoty vyzobávat, ale vůbec nevím, jak na to. PS: Rád pošlu autorovi funkčního řešení pár kaček na pivko. Předem děkuji za reakce.

ERROR:
Catchable Fatal Error: Object of class Doctrine\ORM\PersistentCollection could not be converted to string

CONTROLLER:
public function exportDataToCsv()
{
$em = $this->getDoctrine()->getManager();

$cars = $em->getRepository('App:Car')->findAll();

$encoder = (new CharsetConverter())
    ->inputEncoding('utf-8')
    ->outputEncoding('utf-8')
;

$csv = Writer::createFromFileObject(new \SplTempFileObject());
$csv->setDelimiter(';');
$csv->addFormatter($encoder);

foreach($cars as $car)
{

    $csv->insertOne([
        $car->getEquipment()
    ]);

}


$csv->output('vozidla.csv');

exit;

}

ENTITY EQUIPMENT:
class Equipment
{
/**

 * @ORM\Id()
 * @ORM\GeneratedValue()
 * @ORM\Column(type="integer")
 */
private $id;

/**
 * @ORM\ManyToMany(targetEntity="App\Entity\Car", mappedBy="equipments", cascade={"all"}, orphanRemoval=true)
 */
private $car_equipments;

/**
 * @ORM\Column(name="kod", type="string")
 */
private $kod;

/**
 * @ORM\Column(name="popis", type="string", nullable=true)
 * 
 */
private $popis;

/**
 * @ORM\Column(name="modelovyKlic", type="string", nullable=true)
 */
private $modelovyKlic;

public function getId(): ?int
{
    return $this->id;
}

public function getKod(): ?string
{
    return $this->kod;
}

public function getPopis(): ?string
{
    return $this->popis;
}

public function __toString()
{
    return $this->kod;
    return $this->popis;
}

public function getModelovyKlic(): ?string
{
    return $this->modelovyKlic;
}

public function setKod(string $kod): self
{
    $this->kod = $kod;

    return $this;
}

/*
* @return Equipment
*/

public function setPopis(string $popis): self
{
    $this->popis = $popis;

    return $this;
}

public function setModelovyKlic(string $modelovyKlic): self
{
    $this->modelovyKlic = $modelovyKlic;

    return $this;
}

}

ENTITY CAR:

/**
 * @var array
 * 
 * @ORM\ManyToMany(targetEntity="Equipment", cascade={"persist"}, inversedBy="car_equipments")
 * 
 */
private $equipments;

public function __construct()
{
    $this->equipments = new \Doctrine\Common\Collections\ArrayCollection();

    return $this;
}

/**
 * Get equipments
 * 
 * @return \Doctrine\Common\Collections\Collection;
 */

public function getEquipment()
{
    return $this->equipments;
}

/**
 * @param \App\Entity\Equipment $equipment
 * 
 * @return Car
 */

public function addEquipment(Equipment $equipment)
{
    $this->equipments[] = $equipment;

    return $this;
}

/**
 * Remove equipment
 * 
 * @param \App\Entity\Equipment $equipment
 */

public function removeEquipment(Equipment $equipment)
{
    $this->equipments->removeElement($equipment);
}
Dobyslav
@Dobyslav
Chlapy vážně s tím potřebuji pomoct :(
Martin Hasoň
@hason

Ahoj, problém je, že metoda $car->getEquipment() vrací kolekci, kterou musíš ještě iterovat:

foreach($cars as $car) {
    foreach ($car->getEquipment() as $equipment) {
        $equipment->getPopis();
    }
}

nebo

foreach($cars as $car) {
    $csv->insertOne([
        implode(',', $car->getEquipment()->toArray())
    ]);
}
Dobyslav
@Dobyslav
@hason Ahoj, mnohokrát děkuji za reakci, ale úplně to neřeší můj problém (protože jsem se nevyjádřil přesně a za to se omlouvám). Konkrétně potřebuji vypsat $equipment->getPopis() do exportu (takže implode(',', $car->getEquipment()->toArray())) je slibné řešení, ale nastává tu problém v tom, že to vypisuje "kódy", nikoli popisy. Vím že "kód" to vypisuje z důvodu toString(). toString nemohu změnit, protože potřebuji, aby mi to do formuláře vracelo právě "kody".
Poznámka 2019-03-21 174505.jpg
pro export využívám https://csv.thephpleague.com/
Martin Hasoň
@hason
Tak použij klasický foreach a nebo
implode(',', $car->getEquipment()->map(function($equipment) { return $equipment->getPopis();})->toArray())
Wellington Braga
@WellingtonBraga
Hi Guys
I'm facing some boring problem with doctrine proxies. I changed the folder where doctrine places proxies after created them from /tmp to an folder within the project. The problem is that doctrine still tries to grab the proxy in /tmp folder. Does anyone know how to fix it? Regards...
jimiero
@jimiero

Hello,

Any idea why I get this error:

Fatal error: Class 'Doctrine\DBAL\Migrations\AbstractMigration' not found in /app/DoctrineMigrations/Version20160414075536.php on line 11

it was working when I had symfony2 but not working anymore after upgrading to symfony3

jimiero
@jimiero
found it, had to upgrade migration files according to doctrine migrations 2.0
NesCafe62
@NesCafe62
Hello. How to make pluralization in twig template? For russian language so 1,21,31,... will be single, 2,3,4,22,23,24,.. will be multiple first word form, and 5,6,7,8,9,10-20,25-30,... will be multiple second word form? note: using just twig and twig-extensions without symfony.
NesCafe62
@NesCafe62
Nevermind, I'v made a filter to do that.
Ghost
@ghost~5e459d86d73408ce4fd99455
@fifgo Hello everybody! Does anyone of you have interest in a startup? We are looking for a CTO / a good backend developer! Just write an email with a "Yes" info@fifgo.com
Very good knowledge of PHP (Symfony) is desired.
Thanks!
Ronny Herzog
@Ronaldho80
Dear all! This is about doctrine migration. I am doing a doctrine:migrations:diff and it gives me a error, that a certain table already exists. This is true, because I have a orm mapping file for that table. But why does it complain? It would work if I delete the orm file, but this makes no sense. What to do?
I might add that I am overtaking a project from someone else. The table was there and I needed to add the orm mapping file afterwards. However, it seems that doctrine does not like it.
I would appreciate any help.
NesCafe62
@NesCafe62
Hello. I have a question. If I specify routes in php format, will it trigger loading all controller classes for any request because of use statements? And if yes, will it affect application performance?
NesCafe62
@NesCafe62
ok, I found the answer. It will trigger class loading only when code will be executed, and it is common PHP behavior.