//Отправка пакета $answer = $this->send( $this->packet($command, $body) ); if ($answer === false) { // throw new Exception("Error Code: 1. Irbis error: " . Yii::t('main', 'Ошибка авторизации1')); return false; } if ($answer[10] != 0) { // throw new Exception("Error Code: " . $answer[10] . ". Irbis error: " . Yii::t('main', 'Ошибка авторизации2')); return false; } $this->server_timeout = $answer[11]; $this->server_ver = $answer[4]; $mas = array(); $section = '';
if ($answer === false) { // throw new Exception("Error Code: 1. Irbis error: " . Yii::t('main', 'Ошибка авторизации1')); return false; } if ($answer[10] != 0) { // throw new Exception("Error Code: " . $answer[10] . ". Irbis error: " . Yii::t('main', 'Ошибка авторизации2')); return false; } $this->server_timeout = $answer[11]; $this->server_ver = $answer[4];
//$irbis->login(); //var_dump($irbis); //var_dump($irbis->login()); //die(); if(!$irbis->login()){ throw new AuthException(Yii::t('main', 'Irbis Error: Отсутсвует доступ к САБ ИРБИС64. Обратитесь к системному администратору')); } //$irbis->SetINIparam('[PRIVATE]','FIO='.Yii::$app->config->user[1]); //$irbis->SetINIparam('[PRIVATE]','LASTVISIT='.date('Ymd H:i:s'));
if (!isset($component)) { $component = Yii::createObject($class); } if ($component instanceof BootstrapInterface) { Yii::trace('Bootstrap with ' . get_class($component) . '::bootstrap()', __METHOD__); $component->bootstrap($this); } else { Yii::trace('Bootstrap with ' . get_class($component), __METHOD__); } } }
protected function bootstrap() { $request = $this->getRequest(); Yii::setAlias('@webroot', dirname($request->getScriptFile())); Yii::setAlias('@web', $request->getBaseUrl()); parent::bootstrap(); } /** * Handles the specified request. * @param Request $request the request to be handled * @return Response the resulting response
/** * @inheritdoc */ public function init() { $this->state = self::STATE_INIT; $this->bootstrap(); } /** * Initializes extensions and executes bootstrap components. * This method is called by [[init()]] after the application has been fully configured. * If you override this method, make sure you also call the parent implementation.
*/ public function __construct($config = []) { if (!empty($config)) { Yii::configure($this, $config); } $this->init(); } /** * Initializes the object. * This method is invoked at the end of the constructor after the object is initialized with the * given configuration.
$this->state = self::STATE_BEGIN; $this->preInit($config); $this->registerErrorHandler($config); Component::__construct($config); } /** * Pre-initializes the application. * This method is called at the beginning of the application constructor. * It initializes several important application properties.
require(__DIR__ . '/../vendor/autoload.php'); require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/../config/web.php'); (new yii\web\Application($config))->run();
$_GET = [ 'type' => 'preview', 'doc_id' => '1295817', 'file' => '', 'userid' => '', 'ip' => '', ]; $_SESSION = [ '__flash' => [], ];