Opens a tool.

@EXT\Route("/tool/open/{toolName}", name="claro_desktop_open_tool")

@param string $toolName

@return Response
550947
public function openToolAction($toolName)
    {
        /** @var DisplayToolEvent $event */
        $event = $this->eventDispatcher->dispatch('open_tool_desktop_'.$toolName, new DisplayToolEvent());

        $this->eventDispatcher->dispatch('log', new LogDesktopToolReadEvent($toolName));

        if ('resource_manager' === $toolName) {
            $this->session->set('isDesktop', true);
        }

        return new Response($event->getContent());
    }
1165311
public function rm($name) {
        $this->open();
        $name   =   $this->options['prefix'].$name;         
        $s      =   'D' . pack('N', strlen($name)) . $name;
        fwrite($this->handler, $s);
        $ret    = fgets($this->handler);
        $this->close();
        return $ret === "OK\n";
     }
321287
public function open($options = [])
    {
        if (is_string($options)) {
            $options = ['class' => $options];
        }

        $open = new Open($this->expression('open'), $options, $this->csrf, $this);
        return $open;
    }
628202
public function setToolpath($path)
    {
        if (!file_exists($path)) {
            $fs = FileSystem::getFileSystem();
            $fullpath = $fs->which($path);
            if ($fullpath === false) {
                throw new BuildException(
                    'Tool does not exist. Path: ' . $path
                );
            }
            $path = $fullpath;
        }
        if (!is_executable($path)) {
            throw new BuildException(
                'Tool not executable. Path: ' . $path
            );
        }
        $this->toolPath = $path;
    }
607001
public function onDisplayTool(OpenAdministrationToolEvent $event)
    {
        $content = $this->templating->render(
            'ClarolineCoreBundle:administration:technical.html.twig', [
                'context' => [
                    'type' => Tool::ADMINISTRATION,
                ],
                'parameters' => $this->serializer->serialize(),
                'adminTools' => array_map(function (AdminTool $tool) {
                    return $tool->getName();
                }, $this->om->getRepository(AdminTool::class)->findAll()),
            ]
        );

        $event->setResponse(new Response($content));
        $event->stopPropagation();
    }
1326610
public static function getInstance($name = self::DEFAULT_NAME)
    {
        if (empty(self::$_instances[$name])) {
            self::$_instances[$name] = new Toolbar($name);
        }

        return self::$_instances[$name];
    }
1176763
public function open(OpenResourceEvent $event)
    {
        $resource = $event->getResource();
        $workspace = $resource->getResourceNode()->getWorkspace();

        $options = [];
        if (!$this->checkPermission('EDIT', $resource->getResourceNode())) {
            // filter returned posts
            $options[] = AnnouncementAggregateSerializer::VISIBLE_POSTS_ONLY;
        }

        $content = $this->templating->render(
            'ClarolineAnnouncementBundle:announcement:open.html.twig', [
                '_resource' => $resource,
                'announcement' => $this->serializer->serialize($resource, $options),
                'roles' => array_map(function (Role $role) {
                    return $this->serializer->serialize($role, [Options::SERIALIZE_MINIMAL]);
                }, $workspace->getRoles()->toArray()),
            ]
        );

        $event->setResponse(new Response($content));
        $event->stopPropagation();
    }
1335681
public function open($filename, $mode = self::modeRead) {
    if (!in_array($mode, array(self::modeRead, self::modeWrite, self::modeReadWrite))) {
      throw new \Exception("Unkown file open mode");
    }

    $this->f = fopen($filename, $mode);

    return $this->f != false;
  }
630725
public function openDesktopToolConfig(Tool $tool)
    {
        $event = $this->ed->dispatch(
            strtolower('configure_desktop_tool_'.$tool->getName()),
            'ConfigureDesktopTool',
            [$tool]
        );

        return new Response($event->getContent());
    }
70025
public function open(OpenResourceEvent $event)
    {
        $text = $event->getResource();
        $content = $this->templating->render(
            'ClarolineCoreBundle:text:index.html.twig',
            [
                'text' => $text,
                '_resource' => $text,
            ]
        );

        $event->setResponse(new Response($content));
        $event->stopPropagation();
    }
1344118
public function open( $fileName )
	{
		if( !file_exists( $fileName ) )																		// If the tar file doesn't exist...
			throw new Exception( 'TAR File "'.$fileName.'" is not existing' );
		$this->content		= "";
		$this->files		= array();
		$this->folders		= array();
		$this->numFiles		= 0;
		$this->numFolders	= 0;
		$this->fileName		= $fileName;
		return $this->readTar( $fileName );
	}
246660
public function open($filename)
    {
        $pathInfo = pathinfo($filename);
        if (!key_exists('extension', $pathInfo) || !in_array($pathInfo['extension'], $this->settings->getExtraFiletypes())) {
            parent::open($filename);
        }
    }
1155673
protected function _openMboxFile($filename)
    {
        if ($this->_fh) {
            $this->close();
        }

        $this->_fh = @fopen($filename, 'r');
        if (!$this->_fh) {
            /**
             * @see Zend_Mail_Storage_Exception
             */
            // require_once 'Zend/Mail/Storage/Exception.php';
            throw new Zend_Mail_Storage_Exception('cannot open mbox file');
        }
        $this->_filename = $filename;
        $this->_filemtime = filemtime($this->_filename);

        if (!$this->_isMboxFile($this->_fh, false)) {
            @fclose($this->_fh);
            /**
             * @see Zend_Mail_Storage_Exception
             */
            // require_once 'Zend/Mail/Storage/Exception.php';
            throw new Zend_Mail_Storage_Exception('file is not a valid mbox format');
        }

        $messagePos = array('start' => ftell($this->_fh), 'separator' => 0, 'end' => 0);
        while (($line = fgets($this->_fh)) !== false) {
            if (strpos($line, 'From ') === 0) {
                $messagePos['end'] = ftell($this->_fh) - strlen($line) - 2; // + newline
                if (!$messagePos['separator']) {
                    $messagePos['separator'] = $messagePos['end'];
                }
                $this->_positions[] = $messagePos;
                $messagePos = array('start' => ftell($this->_fh), 'separator' => 0, 'end' => 0);
            }
            if (!$messagePos['separator'] && !trim($line)) {
                $messagePos['separator'] = ftell($this->_fh);
            }
        }

        $messagePos['end'] = ftell($this->_fh);
        if (!$messagePos['separator']) {
            $messagePos['separator'] = $messagePos['end'];
        }
        $this->_positions[] = $messagePos;
    }
530577
public function canOpenAdminTool($toolName)
    {
        $tool = $this->em->getRepository('ClarolineCoreBundle:Tool\AdminTool')
            ->findOneBy(['name' => $toolName]);

        if (!$tool) {
            throw new \LogicException(
                "Annotation error: cannot found admin tool '{$toolName}'"
            );
        }

        return $this->securityContext->isGranted('OPEN', $tool);
    }
1337166
protected function open($filename, $flags)
    {
        if (is_file($filename) === false || ($this->file = fopen($filename, $flags)) === false) {
            throw new Exception('Unable to open the target file.');
        }
    }
937484
public function open($filename)
    {

        if (!is_file($filename)) return false;

        $this->file       = @(string)$filename;
        $this->group      = @(int)filegroup($filename);
        $this->owner      = @(int)fileowner($filename);
        $this->size       = @(int)filesize($filename);
        $this->type       = @(string)filetype($filename);
        $this->accessed   = @(int)fileatime($filename);
        $this->changed    = @(int)filectime($filename);
        $this->modified   = @(int)filemtime($filename);
        $this->permission = @(int)fileperms($filename);
        $this->f_inode    = @ fileinode($filename);
        $this->writeable  = @(bool)is_writable($filename);
        $this->readable   = @(bool)is_readable($filename);
        $this->mime_type  = @(string)mime_content_type($filename);
        $this->_get_path();
        $this->_extract_filename();
        $this->_extract_file_extension();

        return true;
    }
218496
final protected function fopen($filename = 'php://temp', $use_include_path = false)
	{

		$this->_fhandle = $filename;
		$this->use_include_path = $use_include_path;
		return $this;
	}