Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Makes directory
<?php mkdir(    string $directory,    int $permissions = 0777,    bool $recursive = false,    ?resource $context = null): bool
<?php         if (function_exists('pcntl_async_signals') && function_exists('pcntl_signal')) {

            @mkdir($directory, 0777, true);

            if ($realDir = realpath($directory)) {

                pcntl_async_signals(true);

                pcntl_signal(SIGINT, function () use ($realDir) {
<?php         }


        if (function_exists('sapi_windows_set_ctrl_handler') && PHP_SAPI === 'cli') {

            @mkdir($directory, 0777, true);

            if ($realDir = realpath($directory)) {

                sapi_windows_set_ctrl_handler(function () use ($realDir) {

                    $fs = new Filesystem();
<?php             throw new \InvalidArgumentException("Project directory $installPath is not empty.");

        }

        if (!is_dir($installPath)) {

            mkdir($installPath, 0777, true);

        }



        return $this->downloadManager->download($package, $installPath, $prevPackage);
<?php                     realpath($dir).' exists and is not a directory.'

                );

            }

            if (!@mkdir($dir, 0777, true)) {

                throw new \UnexpectedValueException(

                    $dir.' does not exist and could not be created.'

                );
<?php                     $directory.' exists and is not a directory.'

                );

            }

            if (!@mkdir($directory, 0777, true)) {

                throw new \RuntimeException(

                    $directory.' does not exist and could not be created.'

                );
<?php             ->method("getCanonicalPackages")

            ->will($this->returnValue($packages));



        mkdir($this->vendorDir."/composer", 0777, true);



        $this->generator->dump($this->config, $this->repository, $package, $this->im, "composer", false, '_11');
<?php             ->method("getCanonicalPackages")

            ->will($this->returnValue($packages));



        mkdir($this->vendorDir."/composer", 0777, true);



        $this->generator->dump($this->config, $this->repository, $package, $this->im, "composer", false, '_12');
<?php             ->method("getCanonicalPackages")

            ->will($this->returnValue($packages));



        mkdir($this->vendorDir."/composer", 0777, true);



        $this->generator->dump($this->config, $this->repository, $package, $this->im, "composer", false, '_12');
<?php     public function testUpLevelRelativePaths()

    {

        $workingDir = $this->workingDir.'/working-dir';

        mkdir($workingDir, 0777, true);

        chdir($workingDir);



        $package = new RootPackage('root/a', '1.0', '1.0');
<?php         foreach (array('test', 'fixture', 'example') as $keyword) {

            if (!is_dir($tempDir . '/' . $keyword)) {

                mkdir($tempDir . '/' . $keyword, 0777, true);

            }

            file_put_contents($tempDir . '/' . $keyword . '/A.php', "<?php\nclass A {}");

        }
<?php         $method = new \ReflectionMethod($downloader, 'getFileName');

        $method->setAccessible(true);

        $dlFile = $method->invoke($downloader, $packageMock, $path);

        mkdir(dirname($dlFile), 0777, true);

        touch($dlFile);



        try {
<?php         $method = new \ReflectionMethod($downloader, 'getFileName');

        $method->setAccessible(true);

        $dlFile = $method->invoke($downloader, $newPackage, $path);

        mkdir(dirname($dlFile), 0777, true);

        touch($dlFile);



        $loop = new Loop($this->httpDownloader);
<?php         $process = $this->getProcessExecutorMock();

        $process->expects(array(

            array('cmd' => $this->winCompat(sprintf("git clone --mirror -- 'https://example.com/composer/composer' '%s'", $cachePath)), 'callback' => function () use ($cachePath) {

                @mkdir($cachePath, 0777, true);

            }),

            array('cmd' => 'git rev-parse --git-dir', 'stdout' => '.'),

            $this->winCompat('git rev-parse --quiet --verify \'1234567890123456789012345678901234567890^{commit}\''),
<?php     public static function createsVendorBinFolderChecksEnvDoesNotContainsBin()

    {

        mkdir(__DIR__ . '/vendor/bin', 0700, true);

        $val = getenv('PATH');



        if (!$val) {
<?php     protected function writeFile($path, $content, $currentWorkDir)

    {

        if (!file_exists(dirname($path))) {

            mkdir(dirname($path), 0777, true);

        }



        $result = file_put_contents($path, $content);