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 | |
if ($modx->context->key !== 'mgr' ) { | |
$parts = array_reverse(explode('/', $_SERVER['REQUEST_URI'])); | |
if ($parts[0]) { | |
$alias = str_replace('.html', '', $parts[0]); | |
} else { | |
$alias = $parts[1]; | |
} | |
if ($res = $modx->getObject('modResource', array('alias' => $alias))) { |
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 | |
$end = '<div class="clear"> </div>'; | |
$ress = $modx->getCollection('modResource', array('parent' => 43, 'content:LIKE' => '%'.$end.'%')); | |
$arIds = array(); | |
foreach ($ress as $res) { | |
$arIds[] = $res->id; | |
} | |
$ress = $modx->getCollection('modResource', array('parent' => 43, 'content:LIKE' => '%div class="slider_lynx%', 'id:IN' => $arIds)); | |
// print count($ress); | |
foreach ($ress as $res) { |
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 | |
$class = 'modResource'; | |
$pdo = $modx->getService('pdoFetch'); | |
$pdo->addTime('pdoFetch загружен'); | |
$options = array( | |
'cacheTime' => '11', | |
); | |
if (!$output = $pdo->getCache($options)) { |
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
select | |
`set_items`.`id`, | |
`set_items`.`parent_id`, | |
`set_items`.`objective`, | |
`set_items`.`origin`, | |
`phrases`.`id` as `phrase_id`, | |
`phrases`.`text`, | |
`frequencies`.`base`, | |
`frequencies`.`kei`, | |
`positions`.`position`, |
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
$xml = json_decode(json_encode(simplexml_load_file($data_file)), true); | |
$data = []; | |
foreach ($xml as $key => $many) { | |
foreach ($many as $one) { | |
foreach ($one as $item) { | |
$attributes = $item['@attributes']; | |
if (isset($attributes['id'])) { | |
$data[$key][$attributes['id']] = array_merge($attributes, $item); | |
} else { |
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
/** | |
* The first create app to link https://console.developers.google.com | |
* Later save json file of created app to own site. Path to the file transmit to GoogleHandler initialize method | |
* | |
* composer.json | |
* { | |
* "require": { | |
* "asimlqt/php-google-spreadsheet-client": "2.3.*", // https://github.com/asimlqt/php-google-spreadsheet-client | |
* "google/apiclient": "^2.0.0@RC" | |
* } |
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
[[!mFilter2? | |
&cache=`1` | |
&class=`modResource` | |
&sortby=`{ | |
"modResource.menuindex":"ASC", | |
"Parent.menuindex":"ASC" | |
}` | |
&leftJoin=`{ | |
"Parent": { | |
"class": "modResource", |
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 | |
use Illuminate\Database\Seeder; | |
use App\Role; | |
use App\Permission; | |
class RolePermissionSeeder extends Seeder | |
{ | |
protected $roles = []; | |
protected $permissions = []; |
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 | |
declare(strict_types=1); | |
namespace Game\PlanetBundle\Presentation\Hydrator; | |
use Doctrine\ORM\Internal\Hydration\ObjectHydrator; | |
use Doctrine\ORM\UnitOfWork; | |
use Game\Components\Planet\Domain\GameOverException; | |
use Game\Components\Planet\Domain\Planet; |