chdir

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Change directory
<?php chdir(string $directory): bool
<?php         $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_CREATE_PROJECT_CMD, $installDevPackages);



        chdir($oldCwd);

        $vendorComposerDir = $config->get('vendor-dir').'/composer';

        if (is_dir($vendorComposerDir) && $fs->isDirEmpty($vendorComposerDir)) {

            Silencer::call('rmdir', $vendorComposerDir);
<?php         $installedFromVcs = 'source' === $package->getInstallationSource();



        $io->writeError('<info>Created project in ' . $directory . '</info>');

        chdir($directory);



        Platform::putEnv('COMPOSER_ROOT_VERSION', $package->getPrettyVersion());
<?php         if (getcwd() !== $this->getApplication()->getInitialWorkingDirectory()) {

            try {

                chdir($this->getApplication()->getInitialWorkingDirectory());

            } catch (\Exception $e) {

                throw new \RuntimeException('Could not switch back to working directory "'.$this->getApplication()->getInitialWorkingDirectory().'"', 0, $e);

            }
<?php         }



        try {

            chdir($home);

        } catch (\Exception $e) {

            throw new \RuntimeException('Could not switch to home directory "'.$home.'"', 0, $e);

        }
<?php         if ($newWorkDir = $this->getNewWorkingDir($input)) {

            $oldWorkingDir = getcwd();

            chdir($newWorkDir);

            $this->initialWorkingDirectory = $newWorkDir;

            $io->writeError('Changed CWD to ' . getcwd(), true, IOInterface::DEBUG);

        }
<?php                             $io->writeError('<info>Always want to use the parent dir? Use "composer config --global use-parent-dir true" to change the default.</info>');

                        }

                        $oldWorkingDir = getcwd();

                        chdir($dir);

                    }

                    break;

                }
<?php         $destination = array();

        $this->changed = array();

        $currentDirectory = getcwd();

        chdir($this->source);

        $source = $this->doTree('.', $source);

        if (!is_array($source)) {

            return;
<?php         if (!is_array($source)) {

            return;

        }

        chdir($currentDirectory);

        chdir($this->update);

        $destination = $this->doTree('.', $destination);

        if (!is_array($destination)) {
<?php             return;

        }

        chdir($currentDirectory);

        chdir($this->update);

        $destination = $this->doTree('.', $destination);

        if (!is_array($destination)) {

            exit;
<?php         if (!is_array($destination)) {

            exit;

        }

        chdir($currentDirectory);

        foreach ($source as $dir => $value) {

            foreach ($value as $file => $hash) {

                if (isset($destination[$dir][$file])) {
<?php         $cwd = getcwd();



        $relativePath = $this->findShortestPath($link, $target);

        chdir(\dirname($link));

        $result = @symlink($relativePath, $link);



        chdir($cwd);
<?php         chdir(\dirname($link));

        $result = @symlink($relativePath, $link);



        chdir($cwd);



        return $result;

    }
<?php     public function syncCodeBase($sourceReference)

    {

        $prevDir = getcwd();

        chdir($this->path);

        $p4SyncCommand = $this->generateP4Command('sync -f ');

        if (null !== $sourceReference) {

            $p4SyncCommand .= '@' . $sourceReference;
<?php             $p4SyncCommand .= '@' . $sourceReference;

        }

        $this->executeCommand($p4SyncCommand);

        chdir($prevDir);

    }
<?php     {

        $this->oldcwd = getcwd();



        chdir(__DIR__.'/Fixtures/functional');

    }



    protected function tearDown(): void