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 | |
use ZfcDatagrid\Library\FilterHelper; | |
use Popov\DatagridBundle\Renderer\Json\Renderer; | |
$this->abstractFactory->setDataSource(...func_get_args()); | |
$filterColumn = $this->abstractFactory->getFilterColumn(); | |
$retriever = $this->abstractFactory->getRetriever(); |
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 | |
use DateTime; | |
use Doctrine\ORM\Mapping as ORM; | |
use Gedmo\Mapping\Annotation as Gedmo; | |
/** | |
* @var DateTime | |
* | |
* @Gedmo\Timestampable(on="create") |
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
#!/usr/bin/env bash | |
echo "PHP-ECS pre commit hook start" | |
PASS=true | |
PHP_ECS="bin/ecs" | |
HAS_PHP_ECS=false | |
if [ -x $PHP_ECS ]; then | |
HAS_PHP_ECS=true |
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 | |
# Live Codding https://codeshare.io/ | |
# Task | |
Find the position of the first occurrence of a substring in a string | |
strpos ( string $haystack , string $needle [, int $offset = 0 ] ) : int | false | |
fucntion strpos(string $haystack, string $needle, int $offset = 0): int|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
<?php | |
require_once 'vendor/autoload.php'; | |
function varExport($expression, $return = false) | |
{ | |
$export = var_export($expression, true); | |
$export = preg_replace("/^([ ]*)(.*)/m", '$1$1$2', $export); | |
$array = preg_split("/\r\n|\n|\r/", $export); | |
$array = preg_replace(["/\s*array\s\($/", "/\)(,)?$/", "/\s=>\s$/"], [null, ']$1', ' => ['], $array); |
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
#!/bin/bash | |
# .git-hook/pre-commit | |
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.php') | |
if [[ "$STAGED_FILES" = "" ]]; then | |
exit 0 | |
fi |
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
protected function overrideServiceManagerConfig(ServiceManager $sm, array $appendConfig) | |
{ | |
$globalConfig = $sm->get('Config'); | |
$allConfig = \Zend\Stdlib\ArrayUtils::merge($globalConfig, $appendConfig); | |
// set Config service, service manager can't operate without it | |
$sm->setAllowOverride(true); | |
$sm->setService('Config', $allConfig); | |
$sm->setAllowOverride(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
<?php | |
namespace StagemTest\Order; | |
use Psr\Container\ContainerInterface; | |
use Zend\Mvc\Service\ServiceManagerConfig; | |
use Zend\ServiceManager\ServiceManager; | |
use Zend\Stdlib\ArrayUtils; | |
/** | |
* Test bootstrap, for setting up autoloading |
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 | |
/** | |
* config/cli-config.php | |
* For more details @see \DoctrineORMModule\Module | |
* | |
* Run next commands for Migrations work | |
* $ composer require doctrine/doctrine-orm-module | |
* $ composer require doctrine/migrations | |
*/ | |
$container = require 'container.php'; |
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
#!/bin/bash | |
# | |
# ilia/php_excel extension example install script for PHP7+ on CentOS 7+ as base interpreatator | |
# | |
# usage: | |
# > ./install_phpexcel_php7.sh | |
# > (optionally) sudo service php7.0-fpm restart) | |
# | |
# requirements: | |
# - Ubuntu 64bits (trusty/xenial) |
NewerOlder