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
/* {{{ proto string strstr(string haystack, string needle[, bool part]) | |
Finds first occurrence of a string within another */ | |
PHP_FUNCTION(strstr) | |
{ | |
zval *needle; | |
char *haystack; | |
int haystack_len; | |
char *found = NULL; | |
char needle_char[2]; | |
long found_offset; |
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
/* {{{ proto int strpos(string haystack, string needle [, int offset]) | |
Finds position of first occurrence of a string within another */ | |
PHP_FUNCTION(strpos) | |
{ | |
zval *needle; | |
char *haystack; | |
char *found = NULL; | |
char needle_char[2]; | |
long offset = 0; | |
int haystack_len; |
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
final public function findReadOnly($id, $fetchMode = self::FETCH_LAZY_MODE) | |
{ | |
// initialize answer | |
$res = null; | |
// calculate key | |
$cacheKey = self::getCacheKey($this->getEntityName(), $id, $fetchMode); | |
// check cache | |
if (($cacheRes = $this->fetchFromCache($cacheKey)) !== false) { |
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
ErrorException: Catchable Fatal Error: Object of class Proxies\__CG__\EB\Core\KernelBundle\Entity\Account\Account could not be converted to string in /home/www/eb/platform/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 1336 | |
/home/www/eb/platform/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1336 | |
/home/www/eb/platform/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:3007 | |
/home/www/eb/platform/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1855 | |
/home/www/eb/platform/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1710 | |
/home/www/eb/platform/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:696 | |
/home/www/eb/platform/src/EB/Core/KernelBundle/Doctrine/ORM/EntityRepository.php:158 | |
/home/www/eb/platform/src/EB/Core/BusinessBundle/Campaign/EmailBuild.php:134 | |
/home/www/eb/platform/src/EB/Core/BusinessBundle/Campaign/EmailBuild.php:114 |
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 EB\Core\KernelBundle\Entity\Publisher; | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Symfony\Component\Validator\Constraints as Assert; | |
use Gedmo\Mapping\Annotation as Gedmo; | |
use EB\Core\KernelBundle\Entity\Account\Account; | |
use EB\Core\KernelBundle\Interfaces\EntityCachableInterface; |
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 EB\Core\KernelBundle\Entity\Account; | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\Collection; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Symfony\Component\Validator\Constraints as Assert; | |
use Gedmo\Mapping\Annotation as Gedmo; | |
use EB\Core\KernelBundle\Doctrine\DBAL\Types\EnumAccountTypeType; |
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
/** | |
* Set sent at now. | |
* | |
* @return ItemSent | |
*/ | |
public function setSentAtNow() | |
{ | |
return $this->setSentAt(new \DateTime()); | |
} |
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 | |
$m = new Memcached(); | |
$m->addServer('localhost', 11211, 33); | |
$items = 500000; | |
$keysToGet = array(); | |
for ($i = 1; $i <= $items; ++$i) { | |
$key = md5(rand()); |
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 | |
$m = new Memcached(); | |
$m->addServer('localhost', 11211, 33); | |
$items = 100000; | |
$start = time(); | |
for ($i = 1; $i <= $items; ++$i) { | |
$key = md5(rand()); | |
$value = md5(rand()). md5(rand()) . md5(rand()) . md5(rand()) . md5(rand()); |