Esempio n. 1
0
 /**
  * @param $class
  * @return bool|string
  */
 public static function getClassFile($class)
 {
     $class = ltrim($class, '\\');
     if (preg_match('{^TAO\\\\CachedInfoblock\\\\([^\\\\]+)$}', $class, $m)) {
         $name = self::unchunkCap($m[1]);
         $path = self::localDir("cache/infoblock/{$name}.php");
         if (!is_file($path)) {
             $id = self::getInfoblockId($name);
             if (!$id) {
                 print "Infoblock {$name} not found!";
                 die;
             }
             $content = \TAO\InfoblockExport::run($id, true);
             $dir = dirname($path);
             if (!is_dir($dir)) {
                 mkdir($dir, 0777, true);
             }
             file_put_contents($path, $content);
         }
         return $path;
     } elseif (preg_match('{^App\\\\Forms\\\\([^\\\\]+)$}', $class, $m)) {
         $name = $m[1];
         return \TAO\Form::formClassFile($name);
     } elseif (preg_match('{^TAO\\\\Bundle\\\\([^\\\\]+)\\\\(.+)$}', $class, $m)) {
         $bundle = $m[1];
         $name = str_replace('\\', '/', $m[2]);
         $path = self::taoDir("bundles/{$bundle}/lib/{$name}.php");
         return $path;
     } elseif (preg_match('{^App\\\\Bundle\\\\([^\\\\]+)\\\\(.+)$}', $class, $m)) {
         $bundle = $m[1];
         $name = str_replace('\\', '/', $m[2]);
         $path = self::localDir("bundles/{$bundle}/lib/{$name}.php");
         return $path;
     } elseif (preg_match('{^TAO\\\\([^\\\\]+)$}', $class, $m)) {
         $name = self::unchunkCap($m[1]);
         return self::taoDir("lib/{$name}.php");
     } elseif (preg_match('{^App\\\\(.+)$}', $class, $m)) {
         $name = str_replace('\\', '/', $m[1]);
         return self::localDir("lib/{$name}.php");
     } elseif ($class == 'TAO\\CLI') {
         return self::taoDir("lib/cli.php");
     }
     return false;
 }
Esempio n. 2
0
<?php

include $_SERVER['DOCUMENT_ROOT'] . '/local/vendor/techart/bitrix.tao/include/prolog_admin.php';
$id = $_GET['id'];
$data = CIBlock::GetByID($id)->Fetch();
if ($data) {
    $code = $data['CODE'];
    $name = $data['NAME'];
    ?>
    <h2>Экспорт схемы инфоблока "<?php 
    echo $name;
    ?>
"</h2>
    <?php 
    \TAO::load('infoblock_export');
    $content = \TAO\InfoblockExport::run($id);
}
?>


<textarea wrap="off" style="width:90%; height: 400px; padding: 10px; border: 1px solid #888; background-color: white; font-family: monospace; font-size: 10px;"><?php 
echo str_replace('<', '&lt;', $content);
?>
</textarea>


<?php 
include $_SERVER['DOCUMENT_ROOT'] . '/local/vendor/techart/bitrix.tao/include/epilog_admin.php';