This file contains 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 | |
namespace Tentacode\App\Security; | |
trait ConnectedUser | |
{ | |
/** | |
* @Inject | |
* @var Symfony\Component\Security\Core\SecurityContext | |
*/ |
This file contains 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 | |
// Basically makes a SplDoublyLinkedList<T> | |
abstract class ListOf extends SplDoublyLinkedList { | |
protected $T; | |
public function __construct() { | |
list(,$this->T) = explode('\\', get_class($this), 2); | |
} |
This file contains 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 | |
namespace UFCOE\Elgg; | |
/** | |
* Implements a unique set of entities, either holding GUIDs or ElggEntity objects | |
*/ | |
class UniqueEntitySet { | |
/** | |
* @var \ElggEntity[]|int[] |
This file contains 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 | |
// Currently only @used can document consuming relationships, meaning the relationship | |
// cannot be documented from the side of the consumed resource. This limitation seems | |
// arbitrary. Consider this scenario: | |
// A framework function calls functions that were registered by plugins, but it | |
// can't know which functions it will call... | |
/** |
This file contains 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 | |
namespace UFCOE\Elgg; | |
/** | |
* Chunk the output of an iterator. | |
* | |
* <code> | |
* while ($rows = $chunker->getChunk(30)) { | |
* ... do something with up to 30 rows |
This file contains 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
ASCII : !@~%^~&*a)_+-={}|[~]\;',.~/<>?qwertyuiop | |
Base64 : IUB+JV5+JiphKV8rLT17fXxbfl1cOycsLn4vPD4/cXdlcnR5dWlvcA== | |
Base64URL: IUB-JV5-JiphKV8rLT17fXxbfl1cOycsLn4vPD4_cXdlcnR5dWlvcA |
This file contains 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 | |
/** | |
* A lazy-loading proxy for an object | |
* | |
* You supply a factory method that returns an object, and the proxy will wait to call the factory | |
* until directly before it's needed. | |
* | |
* <code> | |
* // use dynamic method callback on a service that's not yet loaded |
This file contains 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 | |
namespace UFCOE\Elgg; | |
/** | |
* Utilities for altering queries based on matching optional/required tags | |
* | |
* <code> | |
* // alter $options so it requires entities to have the tags Foo and Bar: | |
* $ids = $tag_util->tagsToMetastringIds(array('Foo', 'Bar')); |
This file contains 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 | |
namespace UFCOE\Elgg; | |
/** | |
* Populate an ACL based on users and existing ACLs (bypasses Elgg API: does not induce plugin hooks) | |
* | |
* <code> | |
* $populator = new AclPopulator(23); // target | |
* $populator->addAcls(array(123, 456)); // merge in a couple existing lists |
This file contains 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 | |
namespace UFCOE\Elgg; | |
/** | |
* Utilities for altering queries based on matching optional/required tags | |
*/ | |
class TagUtil { | |
/** |