Created
December 13, 2017 21:28
-
-
Save ig0r74/98d270642df391acf6c46a91c22e5dfc to your computer and use it in GitHub Desktop.
MODX пересохраняем все категории MiniShop2
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 | |
| ini_set('max_execution_time', 0); | |
| ignore_user_abort(true); | |
| $c = 'modResource'; | |
| $q = $modx->newQuery($c); | |
| $q->where(array('class_key' => 'msCategory')); | |
| $q->sortby('id'); | |
| $q->select(array( | |
| "{$c}.*", | |
| )); | |
| $s = $q->prepare(); | |
| $s->execute(); | |
| while ($row = $s->fetch(2)) { | |
| $response = $modx->runProcessor('resource/update', $row); | |
| if($response->isError()){ | |
| print_r($response->getResponse()); | |
| return; | |
| } | |
| $modx->error->reset(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment