Использованный алгоритм, стоимость и соль будут возвращены как часть хеша. Таким образом, информация необходимая для проверки хеша будет в него включена. Это позволит функции password_verify() проверять хеш без необходимости отдельного хранения информации о соли и алгоритме.
The feature explained in this article doesn't work in modern Symfony applications that have no bundles. The workaround is to temporarily create a bundle. See doctrine/doctrine#729 for details.
php bin/console doctrine:mapping:convert --from-database annotation ./src/Entity
Далее, от лица клиента, мне надо как-то подтягивать с помощью композера изменения. Как это сделать?
php composer.phar create-project --keep-vcs --stability=dev vendor/package ./localhost
vendor/package
и работать уже со своим. git clone git@github.com:Vasiliy_M/package.git ./localhost
cd ./localhost
git remote add upstream git@github.com:vendor/package.git
git fetch upstream
git merge upstream/master
create-project
- это всего лишь сахар для копирования скелета приложения и автоматического composer install. В данном случае он вам не нужен <?php
class base {
public function getParent(){
return ['base'];
}
public function getParentAlt(){
$class = static::class;
$classes = [
$class
];
while ($parent = get_parent_class($class)) {
$class = $parent;
$classes[] = $class;
}
return $classes;
}
}
class class1 extends base {
public function getParent(){
return array_merge(['class1'], parent::getParent());
}
}
class class2 extends class1 {
public function getParent(){
return array_merge(['class2'], parent::getParent());
}
}
class class3 extends class2 {
public function getParent(){
return array_merge(['class3'], parent::getParent());
}
}
$new = new class3();
print_r ($new->getParent());
print_r ($new->getParentAlt());
php bin/console cache:clear --no-warmup --env=prod
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpKernel\Kernel;
class HttpCacheClearCommand extends Command
{
/**
* @var string
*/
private $cacheDir;
public function __construct($name, $cacheDir)
{
parent::__construct($name);
$this->cacheDir = $cacheDir;
}
protected function configure()
{
$this
->setDescription('Clear http-cache')
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$exec = sprintf('rm -rf %s/*', $this->cacheDir);
exec($exec);
}
}
cache_dir: '%kernel.cache_dir%/http_cache'
bin/console cache:pool:clear
<div class="panel-body">
<?php $longString = $key['question'];
$longString = wordwrap($longString, 50, "<br/>", true);
?>
<a href="http://color-school.dev/question.php?question_id=<?php echo $key['question_id'] ?>&id=<?php echo $userid ?>">
<?php
echo $longString;
?>
</a>
</div>
"autoload": {
"files": ["src/helpers.php"]
}
interface BalanceInterface
{
public function get();
public function inc($value);
public function dec($value);
}
class Balance implements BalanceInterface
{
private $value;
public function get()
{
return $this->value;
}
public function inc($value)
{
$this->value += $value;
}
public function dec($value)
{
$this->value -= $value;
}
}
class CacheBalance implements BalanceInterface
{
/**
* @var BalanceInterface
*/
private $next;
/**
* @var \Psr\Cache\CacheItemPoolInterface
*/
private $cache;
public function __construct(BalanceInterface $next, \Psr\Cache\CacheItemPoolInterface $cache)
{
$this->next = $next;
$this->cache = $cache;
}
public function get()
{
$item = $this->cache->getItem('balance');
if ($item->isHit()) {
return $item->get();
}
$value = $this->next->get();
$item->set($value);
$this->cache->save($item);
return $value;
}
public function inc($value)
{
return $this->next->inc($value);
}
public function dec($value)
{
return $this->next->dec($value);
}
}
class LogBalance implements BalanceInterface
{
/**
* @var BalanceInterface
*/
private $next;
/**
* @var \Psr\Log\LoggerInterface
*/
private $logger;
public function __construct(BalanceInterface $next, \Psr\Log\LoggerInterface $logger)
{
$this->next = $next;
$this->logger = $logger;
}
public function get()
{
return $this->next->get();
}
public function inc($value)
{
$this->logger->info(sprintf('Increase balance by %d', $value));
return $this->next->inc($value);
}
public function dec($value)
{
$this->logger->info(sprintf('Decrease balance by %d', $value));
return $this->next->dec($value);
}
}
$initialBalance = new \Balance();
$cacheBalance = new \CacheBalance($initialBalance, $cache);
$logBalance = new \LogBalance($cacheBalance, $logger);
$balance = $logBalance;