//Отправка пакета $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];
$gpntb->login = $login; $gpntb->pass = $password; $gpntb->A_login = \Yii::$app->params['A_login']; $gpntb->A_password = \Yii::$app->params['A_password']; $gpntb->log_file = \Yii::$app->params['log_file']; $gpntb->config = \Yii::$app->config->config['1'][0]; if(!$gpntb->login()){ throw new AuthException(Yii::t('main', 'Irbis Error: Отсутсвует доступ к САБ ИРБИС64. Обратитесь к системному администратору')); } $this->gpntb = $gpntb; } public static function Logout() {
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' => '9507726', 'file' => '', 'userid' => '', 'ip' => '', ]; $_SESSION = [ '__flash' => [], ];