Start smb notify listener
Note: This is a blocking call

@param string $path
@return INotifyHandler
772757
public function notify($path) {
		// php-smbclient does not support notify (https://github.com/eduardok/libsmbclient-php/issues/29)
		// so we use the smbclient based backend for this
		if (!Server::available($this->server->getSystem())) {
			throw new DependencyException('smbclient not found in path for notify command');
		}
		$share = new Share($this->server, $this->getName(), $this->server->getSystem());
		return $share->notify($path);
	}
1026194
private function twigLoad(string $path): ?\Twig_TemplateWrapper
    {
        try {
            return $this->twigEnv->load($path);
        } catch (TwigError $exc) {
            if (defined('WP_DEBUG') && WP_DEBUG) {
                throw $exc;
            }
        }
    }
1187882
public function setStderrFile(string $path, bool $append = false): Process
    {
        $this->setOutputFile(self::STDERR, $path, $append);
        return $this;
    }
1216076
public function setRuntimePath($path)
    {
        $path = realpath($path);
        if (is_dir($path)) {
            $this->_runtimePath = $path;
        } else {
            throw new Exception("日志根目录不存在", 101200101);
        }
    }
1070792
protected function seePageIs($path)
    {
        $this->assertEquals($this->wd->getCurrentURL(), $this->baseUrl.$path);

        return $this;
    }
592385
public function setPath($path)
        {
            if (realpath($path) === false) {
                throw new Exception("Path must be absolute.");
            }

            $this->_path = realpath($path) . DS;
            return $this;
        }
1077618
public static function register($path = null)
    {
        self::$_path = $path ? $path : dirname(__FILE__);

        return spl_autoload_register([__CLASS__, 'load'], true, true);
    }
115404
public function setPath($path)
    {
        if (is_writable($path)) {
            $file = fopen($path, 'a+');
            fseek($file, -1, SEEK_END);
            if (fread($file, 1) != "\n") {
                fwrite($file, PHP_EOL);
            }
            fclose($file);
        }

        // should parse message incrementally from file
        $this->resource = mailparse_msg_parse_file($path);
        $this->stream = fopen($path, 'r');
        $this->parse();

        return $this;
    }
1046257
public static function init($path, $name = 'log', $minimumLevel = self::DEBUG)
    {
        if($path === 'php://output')
        {
            self::$active = true;
        }
        else if(is_writable($path))
        {
            self::$active = true;
        }
        else 
        {
            self::$active = false;
        }
        
        self::$backend = null;
        self::$stream = null;
        self::$name = $name;
        self::$logFilePath = $path;
        self::$minimumLevel = $minimumLevel;
    }
1262249
public function binDir(string $path): self
    {
        $this->validatePathIsRelativeToProject($path, __METHOD__);
        $this->binDir = rtrim($path, '/');

        return $this;
    }
1193805
public function put(string $path, $callback, ...$args): FrameworkHandler
    {
        return $this->route('put', $path, $callback, ...$args);
    }
1321763
function lock($path) {
        $this->_path = $this->translate_uri($path);
        $this->header_unset();
        $this->create_basic_request('LOCK');
        $this->header_add('Timeout: Infinite');
        $this->header_add('Content-type: text/xml');
        // create the xml request ...
        $xml =  "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n";
        $xml .= "<D:lockinfo xmlns:D='DAV:'\r\n>";
        $xml .= "  <D:lockscope><D:exclusive/></D:lockscope>\r\n";
        $xml .= "  <D:locktype><D:write/></D:locktype>\r\n";
        $xml .= "  <D:owner>\r\n";
        $xml .= "    <D:href>".($this->_user)."</D:href>\r\n";
        $xml .= "  </D:owner>\r\n";
        $xml .= "</D:lockinfo>\r\n";
        $this->header_add('Content-length: ' . strlen($xml));
        $this->send_request();
        // send also xml
        fputs($this->sock, $xml);
        $this->get_respond();
        $response = $this->process_respond();
        // validate the response ... (only basic validation)
        // check http-version
        if ($response['status']['http-version'] == 'HTTP/1.1' ||
            $response['status']['http-version'] == 'HTTP/1.0') {
            /* seems to be http ... proceed
            rfc 2518 says:
            200 (OK) - The lock request succeeded and the value of the lockdiscovery property is included in the body.
            412 (Precondition Failed) - The included lock token was not enforceable on this resource or the server could not satisfy the
                     request in the lockinfo XML element.
            423 (Locked) - The resource is locked, so the method has been rejected.
             */

                switch($response['status']['status-code']) {
                case 200:
                    // collection was successfully locked... see xml response to get lock token...
                    if (strcmp($response['header']['Content-Type'], 'text/xml; charset="utf-8"') == 0) {
                        // ok let's get the content of the xml stuff
                        $this->_parser = xml_parser_create_ns();
                        $this->_parserid = (int) $this->_parser;
                        // forget old data...
                        unset($this->_lock[$this->_parserid]);
                        unset($this->_xmltree[$this->_parserid]);
                        xml_parser_set_option($this->_parser,XML_OPTION_SKIP_WHITE,0);
                        xml_parser_set_option($this->_parser,XML_OPTION_CASE_FOLDING,0);
                        xml_set_object($this->_parser, $this);
                        xml_set_element_handler($this->_parser, "_lock_startElement", "_endElement");
                        xml_set_character_data_handler($this->_parser, "_lock_cdata");

                        if (!xml_parse($this->_parser, $response['body'])) {
                            die(sprintf("XML error: %s at line %d",
                                xml_error_string(xml_get_error_code($this->_parser)),
                                xml_get_current_line_number($this->_parser)));
                        }

                        // Free resources
                        xml_parser_free($this->_parser);
                        // add status code to array
                        $this->_lock[$this->_parserid]['status'] = 200;
                        return $this->_lock[$this->_parserid];

                    } else {
                        print 'Missing Content-Type: text/xml header in response.<br>';
                    }
                    return false;

                default:
                    // hmm. not what we expected. Just return what we got from webdav server
                    // someone else has to handle it.
                    $this->_lock['status'] = $response['status']['status-code'];
                    return $this->_lock;
                }
            }


    }
91659
public function watching(string $folder, string $keys, Chan $notify) : void
    {
        $path = $keys === '*' ? $folder : sprintf('%s/%s', $folder, $keys);

        $ig = function () use ($path) {
            return (new KVGetting($this->agent))->path($path);
        };

        $do = function (KVGetting $lister) use ($notify) {
            yield $notify->send($this->changed(yield $lister->result()));
        };

        $this->nwProcess($notify->closed(), $ig, $do, 'KVStore watcher interrupted', ['path' => $path]);
    }
1228075
public function startPublishing($path = '')
    {
        $body = '<propertyupdate xmlns="DAV:"><set><prop>
            <public_url xmlns="urn:yandex:disk:meta">true</public_url>
            </prop></set></propertyupdate>';

        $response = $this->sendRequest(
            'PROPPATCH',
            $path,
            [
                'headers' => [
                    'Content-Length' => strlen($body)
                ],
                'body' => $body
            ]
        );

        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        $publicUrl = $decodedResponseBody->children('DAV:')->response->propstat->prop->children()->public_url;
        return (string)$publicUrl;
    }
953670
protected function createStreamWrapper($path)
    {
        if ($this->streamWrapper === null) {
            $explodedPath = explode(':', $path, 2);
            $scheme = array_shift($explodedPath);
            $registeredStreamWrappers = self::$registeredStreamWrappers;
            $registeredStreamWrapperForScheme = $registeredStreamWrappers[$scheme];
            $this->streamWrapper = new $registeredStreamWrapperForScheme();
        }
    }
303
public function after_path($path) {
        $toprocess = false;
        // If the path being closed matches (same or parent) the first path in the stack
        // we process pending startend notifications until one matching end is found
        if ($element = reset($this->startendinfo)) {
            $elepath = $element['path'];
            $eleaction = $element['action'];
            if (strpos($elepath, $path) === 0) {
                $toprocess = true;
            }

        // Also, if the stack of startend notifications is empty, we can process current end
        // path safely
        } else {
            $toprocess = true;
        }
        if ($this->path_is_selected($path)) {
            $this->startendinfo[] = array('path' => $path, 'action' => 'end');
        }
        // Send all the pending startend notifications if decided to do so
        if ($toprocess) {
            $this->process_pending_startend_notifications($path, 'end');
        }
    }
829761
public function registerListenerNamespace($path)
    {
        if (false === isset($this->_namespaces['BackBee\Event\Listener'])) {
            $this->_namespaces['BackBee\Event\Listener'] = array();
        }

        array_unshift($this->_namespaces['BackBee\Event\Listener'], $path);

        return $this;
    }