public function prePathParse(Controller $controller, StaticServer $server) { $path = strtolower($server->getPath()); // Path begins with release path if (strncmp($path, $this->packaged_dir, strlen($this->packaged_dir)) !== 0) { return; } // Get package name from request path $package = preg_replace('#\\.css$#', '', substr($path, strlen($this->packaged_dir))); $filepath = $this->buildPackage($package); $server->setPath($filepath); $controller->setPath($filepath); // Prevent the path from being changed now $server->lockPath(); $this->is_package = true; }
public function prePathParse(Controller $controller, StaticServer $server) { $path = strtolower($server->getPath()); $url_path = COWL_BASE . $this->packaged_dir; // Path begins with release path, then we build it if need be if (strncmp($path, $url_path, strlen($url_path)) !== 0) { return; } // Get package name from request path $package = preg_replace('#\\.js$#', '', substr($path, strlen($url_path))); $filepath = $this->buildPackage($package); // No package here if (!$filepath) { return; } $server->setPath($filepath); $controller->setPath($filepath); $server->lockPath(); $this->is_package = true; }