Create $this->outputPath

@return bool
18282
function convert() {

		// Set logfile
		$this->logfile = $this->createTmpFile();

		// Set filename
		$this->outputPath = $this->timestampedFileName( '.odt' );

		// Set temp folder
		$this->tmpDir = $this->createTmpDir();

		$source = $this->tmpDir . '/source.xhtml';
		if ( defined( 'WP_TESTS_MULTISITE' ) ) {
			\Pressbooks\Utility\put_contents( $source, \Pressbooks\Utility\get_contents( $this->url ) );
		} else {
			\Pressbooks\Utility\put_contents( $source, $this->queryXhtml() );
		}

		$xslt = PB_PLUGIN_DIR . 'inc/modules/export/odt/xhtml2odt.xsl';
		$content = $this->tmpDir . '/content.xml';
		$mimetype = $this->tmpDir . '/mimetype';
		$metafolder = $this->tmpDir . '/META-INF';
		$meta = $this->tmpDir . '/meta.xml';
		$settings = $this->tmpDir . '/settings.xml';
		$styles = $this->tmpDir . '/styles.xml';
		$mediafolder = $this->tmpDir . '/media/';

		$urlcontent = \Pressbooks\Utility\get_contents( $source );
		$urlcontent = preg_replace( '/xmlns\="http\:\/\/www\.w3\.org\/1999\/xhtml"/i', '', $urlcontent );

		if ( empty( $urlcontent ) ) {
			$this->logError( 'source.xhtml is empty' );
			return false;
		}

		libxml_use_internal_errors( true );
		$old_value = libxml_disable_entity_loader( true );
		$doc = new \DOMDocument();
		$doc->recover = true; // Try to parse non-well formed documents
		$doc->loadXML( $urlcontent, LIBXML_NOBLANKS | LIBXML_NOENT | LIBXML_NONET | LIBXML_XINCLUDE | LIBXML_NOERROR | LIBXML_NOWARNING );
		libxml_disable_entity_loader( $old_value );
		$xpath = new \DOMXPath( $doc );

		$tables = $xpath->query( '//table' );

		foreach ( $tables as $table ) {
			/** @var \DOMElement $table */
			$columncount = 0;
			$columns = $xpath->query( '//tr[1]/*', $table );
			foreach ( $columns as $column ) {
				/** @var \DOMElement $column */
				if ( $column->hasAttribute( 'colspan' ) ) {
					$columncount = $columncount + (int) $column->getAttribute( 'colspan' );
				} else {
					$columncount++;
				}
			}
			$table->setAttribute( 'colcount', $columncount );
		}

		if ( ! file_exists( $metafolder ) ) {
			mkdir( $metafolder );
		}

		$images = $xpath->query( '//img' );
		$coverimages = $xpath->query( '//meta[@name="pb-cover-image"]' );
		if ( ( $images->length > 0 ) || ( $coverimages->length > 0 ) ) {
			if ( ! file_exists( $mediafolder ) ) {
				mkdir( $mediafolder );
			}
		}
		foreach ( $images as $image ) {
			/** @var \DOMElement $image */
			$src = $image->getAttribute( 'src' );
			$image_filename = $this->fetchAndSaveUniqueImage( $src, $mediafolder );
			if ( $image_filename ) {
				// Replace with new image
				$image->setAttribute( 'src', $image_filename );
			}
		}

		foreach ( $coverimages as $coverimage ) {
			/** @var \DOMElement $coverimage */
			$src = $coverimage->getAttribute( 'content' );
			$cover_filename = $this->fetchAndSaveUniqueImage( $src, $mediafolder );
			if ( $cover_filename ) {
				// Replace with new image
				$coverimage->setAttribute( 'src', $cover_filename );
			}
		}

		\Pressbooks\Utility\put_contents( $source, $doc->saveXML() );

		$errors = libxml_get_errors(); // TODO: Handle errors gracefully
		libxml_clear_errors();

		$output = [];
		$command = PB_SAXON_COMMAND . ' -xsl:' . escapeshellcmd( $xslt ) . ' -s:' . escapeshellcmd( $source ) . ' -o:' . escapeshellcmd( $content ) . ' 2>&1';
		exec( $command, $output );

		$files = [
			'content' => $content,
			'mimetype' => $mimetype,
			'meta' => $meta,
			'settings' => $settings,
			'styles' => $styles,
			'metafolder' => $metafolder,
		];
		$msg = '';
		foreach ( $files as $key => $file ) {
			if ( ! file_exists( $file ) ) {
				$msg .= ' [ ' . $key . ' ]';
			}
		}

		if ( ! empty( $msg ) ) {
			$this->logError( "Transformation failed, encountered a problem with $msg \n\n" . implode( "\n", $output ) );
			return false;
		}

		$zip = new \PclZip( $this->outputPath );

		if ( $images->length > 0 ) {
			$list = $zip->add( $mimetype . ',' . $content . ',' . $meta . ',' . $settings . ',' . $styles . ',' . $mediafolder . ',' . $metafolder, PCLZIP_OPT_NO_COMPRESSION, PCLZIP_OPT_REMOVE_PATH, $this->tmpDir . '/' );
		} else {
			$list = $zip->add( $mimetype . ',' . $content . ',' . $meta . ',' . $settings . ',' . $styles . ',' . $metafolder, PCLZIP_OPT_NO_COMPRESSION, PCLZIP_OPT_REMOVE_PATH, $this->tmpDir . '/' );
		}

		if ( 0 === absint( $list ) ) {
			$this->logError( $zip->errorInfo( true ) );
			return false;
		}

		return true;
	}
444249
public function makePath()
    {
        $path = base_path('src');

        if (!File::exists($path)) {
            File::makeDirectory($path, 0775, true);
        }
    }
1039197
public function create() {

		if(false === $this -> file -> getExists()) {
			
			fopen($this -> file -> getBasepath(), 'w+');

			$this -> refresh();
		}

		return $this;
	}
1097816
public function getOutputPath()
    {
        $base = getcwd() . DIRECTORY_SEPARATOR;

        if (isset($this->raw->output)) {
            $path = $this->raw->output;

            if (false === Path::isAbsolute($path)) {
                $path = Path::canonical($base . $path);
            }
        } else {
            $path = $base . 'default.phar';
        }

        if (false !== strpos($path, '@' . 'git-version@')) {
            $path = str_replace('@' . 'git-version@', $this->getGitVersion(), $path);
        }

        return $path;
    }
805304
public function output() {
        $parts = explode('/', $this->output_path);
        // get rid of the filename
        array_pop($parts);

        $path = implode('/', $parts);
        if ($path && !file_exists($path)) {
            if (!mkdir($path, 0777, true)) {
                throw new \Exception("could not make directory $path");
            }
        }

        if (!file_put_contents($this->output_path, $this->render())) {
            throw new \Exception("could not write $filename");
        }
    }
436229
public function createPath()
    {
        if ($this->isReference()) {
            throw $this->noChildrenAllowed();
        }

        if ($this->path === null) {
            $this->path = new Path($this->getProject());
        }
        return $this->path->createPath();
    }
908965
public function output() : Bucket\BucketOutput
    {
        if (! $this->output) {
            $this->output = new Bucket\BucketOutput($this->builder, $this);
        }

        assert($this->output instanceof Bucket\BucketOutput);
        return $this->output;
    }
1362688
public function generate($outputPath)
    {
        // do content replacement
        $this->process();

        // check if directory exist, if not create it
        $baseDir = dirname($outputPath);
        if (!is_dir($baseDir)) {
            mkdir($baseDir, 700, true);
        }

        return (bool)file_put_contents($outputPath, $this->getContent());
    }
1303452
protected function save()
    {
        $filename = Path::create([$this->outputPath(), $this->outputFile()]);

        return (bool) \file_put_contents($filename->toString(), $this->stub);
    }
60223
public function create()
    {
        if ($this->rootPath === null) {
            throw new \LogicException('Root path must be set before PathResolver can be created');
        }

        return new PathResolver($this->rootPath, $this->paths);
    }
334347
private function createPathForUpload()
    {
        return sprintf(
            '%s://%s/%s.files',
            self::$streamWrapperProtocol,
            urlencode($this->databaseName),
            urlencode($this->bucketName)
        );
    }
746869
private function createFromCommand()
    {
        $command = BranchCommand::getInstance($this->getRepository())->listBranches();
        $outputLines = $this->repository->getCaller()->execute($command)->getOutputLines(true);
        foreach ($outputLines as $outputLine) {
            $matches = static::getMatches($outputLine);

            if ($this->name === $matches[1]) {
                $this->parseOutputLine($outputLine);

                return;
            }
        }

        throw new InvalidBranchNameException(sprintf('The %s branch doesn\'t exists', $this->name));
    }
652722
public static function forOut(): OutputStream
    {
        if (null === self::$out) {
            self::$out = self::create('php://stdout');
        }

        return self::$out;
    }
829878
public function actionCreate()
    {
        $data = [
            'f1' => $this->getContext()->getInput()->post('p1'),
            'f2' => $this->getContext()->getInput()->post('p2'),
        ];

        $this->outputJson($data);
        //$this->outputJson(null, 'shibaile', 403);
    }
495780
public function execute()
    {
        $path  = $this->phpci->buildPath;
        $build = $this->build;

        if ($this->directory == $path) {
            return false;
        }

        $filename = str_replace('%build.commit%', $build->getCommitId(), $this->filename);
        $filename = str_replace('%build.id%', $build->getId(), $filename);
        $filename = str_replace('%build.branch%', $build->getBranch(), $filename);
        $filename = str_replace('%project.title%', $build->getProject()->getTitle(), $filename);
        $filename = str_replace('%date%', date('Y-m-d'), $filename);
        $filename = str_replace('%time%', date('Hi'), $filename);
        $filename = preg_replace('/([^a-zA-Z0-9_-]+)/', '', $filename);

        $curdir = getcwd();
        chdir($this->phpci->buildPath);

        if (!is_array($this->format)) {
            $this->format = array($this->format);
        }

        foreach ($this->format as $format) {
            switch ($format) {
                case 'tar':
                    $cmd = 'tar cfz "%s/%s.tar.gz" ./*';
                    break;
                default:
                case 'zip':
                    $cmd = 'zip -rq "%s/%s.zip" ./*';
                    break;
            }

            $success = $this->phpci->executeCommand($cmd, $this->directory, $filename);
        }

        chdir($curdir);

        return $success;
    }
244874
public function create()
    {
        $return = false;
        if (!$this->isExists()) {
            if (mkdir($this->getPathname(), 0777, true)) {
                $return = true;
            } else {
                throw new RuntimeException("Can't create " . $this->getPathname() . ' folder');
            }
        }

        return $return;
    }
389826
public function create() {
    $data = Ensure::Input(func_get_args());
    $data = $data->get();

    if (isset($data['domainId'])) {
      new PathResource($this, array(
         "domains" => $data['domainId'],
         "endpoints" => ""
          )
      );
    }

    return parent::create($data);
  }