uawdijnntqw1x1x1
IP : 18.189.188.228
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
b24.axolotl.ru
/
.
/
public_html
/
bitrix
/
modules
/
landing
/
lib
/
folder.php
/
/
<?php namespace Bitrix\Landing; class Folder extends \Bitrix\Landing\Internals\BaseTable { /** * Internal class. * @var string */ public static $internalClass = 'FolderTable'; /** * Deletes all folders for site. * @param int $siteId Site id. * @return void */ public static function deleteForSite(int $siteId): void { $res = self::getList([ 'select' => [ 'ID' ], 'filter' => [ 'SITE_ID' => $siteId ] ]); while ($row = $res->fetch()) { parent::delete($row['ID']); } } /** * Returns breadcrumbs for folder of site. * @param int $folderId Folder id. * @param int|null $siteId Site id (optional, but desirable for optimisation). * @return array */ public static function getBreadCrumbs(int $folderId, ?int $siteId = null): array { static $cacheFolders = []; $crumbs = []; if (!$siteId) { $res = self::getList([ 'select' => [ 'SITE_ID' ], 'filter' => [ 'ID' => $folderId ], 'limit' => 1 ]); if ($row = $res->fetch()) { $siteId = $row['SITE_ID']; } } if (!$siteId) { return $crumbs; } // get all folder's chunks for the site if (!array_key_exists($siteId, $cacheFolders)) { $cacheFolders[$siteId] = []; $res = self::getList([ 'select' => [ 'ID', 'TITLE', 'INDEX_ID', 'CODE', 'PARENT_ID', 'ACTIVE', 'DELETED' ], 'filter' => [ 'SITE_ID' => $siteId ] ]); while ($row = $res->fetch()) { $cacheFolders[$siteId][$row['ID']] = $row; } } if (!$cacheFolders[$siteId]) { return $crumbs; } // build recursively $folders = $cacheFolders[$siteId]; do { if (!isset($folders[$folderId])) { break; } $crumbs[] = $folders[$folderId]; $folderId = $folders[$folderId]['PARENT_ID']; } while ($folderId); return array_reverse($crumbs); } /** * Returns breadcrumbs for folder of site as string. * @param int $folderId Folder id. * @param string $glue Glue for implode breadcrumbs. * @param int|null $siteId Site id (optional, but desirable for optimisation). * @return string */ public static function getBreadCrumbsString(int $folderId, string $glue, ?int $siteId = null): string { $path = []; $crumbs = self::getBreadCrumbs($folderId, $siteId); foreach ($crumbs as $crumb) { $path[] = $crumb['TITLE']; } return implode($glue, $path); } /** * Returns folder's full path with parents folders. * @param int $folderId Folder id. * @param int|null $siteId Site id (optional, but desirable for optimisation). * @param array &$lastFolder Last folder item. * @return string */ public static function getFullPath(int $folderId, ?int $siteId = null, array &$lastFolder = []): string { $codes = []; foreach (self::getBreadCrumbs($folderId, $siteId) as $folder) { $lastFolder = $folder; $codes[] = $folder['CODE']; } return '/' . implode('/', $codes) . '/'; } }
/var/www/axolotl/data/www/b24.axolotl.ru/./public_html/bitrix/modules/landing/lib/folder.php