<?php
$xml = '<Catalog>
<Category>
<Name>Категория 1</Name>
<Site>...</Site>
<Site>...</Site>
<Site>...</Site>
</Category>
<Category>
<Name>Категория 2</Name>
<Site>...</Site>
<Site>...</Site>
<Site>...</Site>
</Category>
<Category>
<Name>Категория 3</Name>
<Site>...</Site>
<Site>...</Site>
<Site>...</Site>
</Category>
</Catalog>';
$doc = simplexml_load_string($xml);
$batch = [];
$i = 1;
foreach($doc->Category as $cat) {
$batch[] = [
'index' => $i,
'name' => $cat->Name->getName(),
'site' => $cat->Site[0]->getName(),
];
if ($i % 1000 == 0) {
saveBatch($batch);
}
$i++;
}
saveBatch($batch);
function saveBatch($batch) {
if (count($batch) > 0) {
echo "<pre>Saved\n";
print_r($batch);
$batch = [];
}
}
var orientation = window.screen.orientation.angle
window.addEventListener("orientationchange", function() {
alert("the orientation of the device is now " + screen.orientation.angle + ' prev ' + orientation);
orientation = screen.orientation.angle
})
location / {
proxy_intercept_errors on;
error_page 404 = @redirect;
proxy_pass http://cdn.example.tdl;
}
location @redirect {
return 301 http://example.tdl$request_uri;
}
$path = $this->processMkDir();
$fileName = Inflector::slug(pathinfo($this->str2url($this->docFile->baseName), PATHINFO_FILENAME)) . '.' . $this->docFile->extension;
$this->docFile->saveAs($path . $fileName);
return $fileName;
} else {
return false;
}