This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PSR7Connector | |
{ | |
public function fromTheOutside($prs7) | |
{ | |
$this->transformerFriendly = $psr7->getBody()->getContents(); | |
} | |
public function dataForTransformer(): array | |
{ | |
return $this->transformerFriendly; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function transform($conncetorIn, $connectorOut, AbstractTransformer $transformer, $fieldMap = '*', $resourceClass = Item::class) | |
{ | |
$resource = new $resourceClass($data, '', $fieldMap); | |
$transformed = $transformer->transform($conncetorIn->dataForTransformer()); | |
$connectorOut->dataFromTransformer($transformed); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz > autoconf.tar.gz | |
tar -xvzf autoconf.tar.gz | |
cd autoconf-2.69 | |
./configure | |
sudo make && sudo make install | |
export PHP_AUTOCONF=/usr/local/bin/autoconf | |
from browser - http://sourceforge.net/projects/icu/files/ICU4C/55.1/icu4c-55_1-src.tgz/download | |
cd ~/Downloads | |
tar xzvf icu4c-55_1-src.tgz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone (target repo url) | |
cd dir | |
git remote add added (added repo url) | |
git fetch added | |
git pull added master | |
fix conflicts | |
git add -m 'added repo' | |
git push origin master | |
git remote add additional (additional repo url) | |
git fetch additional |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use CamelSpider\Entity\LinkFilter | |
class Indexer extends AbstractSpider | |
{ | |
protected $linkFilters; | |
// these could added in a compiler pass in the DI | |
public function addLinkFilter(LinkFilter $filter) | |
{ | |
$this->linkFilters[] = $filter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* (c) 2011-2012 Vespolina Project http://www.vespolina-project.org | |
* | |
* This source file is subject to the MIT license that is bundled | |
* with this source code in the file LICENSE. | |
*/ | |
namespace Vespolina\CartBundle\Pricing; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in controller ... | |
$mgr = $this->get('sonata.media.manager.media'); | |
$pool = $this->get('sonata.media.pool'); | |
$class = $mgr->getClass(); | |
$medium = new $class(); | |
$medium->setProviderName('sonata.media.provider.image'); | |
$form = $this->createForm(new MediaFormType(), $medium); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
->arrayNode('identifiers') | |
->useAttributeAsKey('key') | |
->prototype('scalar') | |
->end() | |
->end() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is this possible | |
{"_id": {"$ne":{ObjectId('1234554321'), ObjectId('543212345')}}} | |
Substitute "$ne" for any conditional operator and find the right syntax for multiple ObjectId()s | |
I'm needing this for the doctrine mongodb-orm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/config/security.yml | |
security.config: | |
providers: | |
fos_user: | |
id: fos_user.user_manager | |
firewalls: | |
public: | |
pattern: .* | |
form_login: | |
login_path: /login |
NewerOlder