###前提・実現したいこと
初めてPHPを学習しています。
PHP(CakePHP)で掲示板を作る練習をしているのですが、外部から読み込んだソースに大量のエラーが出ます。
cake3appの中の「vendor」というフォルダのみ、ほぼすべてのファイルでエラーが出ています。どのように解決していけばよいでしょうか?
###発生している問題・エラーメッセージ
インポートされた Symfony\Component\DependencyInjection\Loader は見つかりません
Client を型に解決できません
CacheItemPoolInterface を型に解決できません
など
###該当のソースコード
<?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Downloader; use Composer\Config; use Composer\Cache; use Composer\EventDispatcher\EventDispatcher; use Composer\Util\IniHelper; use Composer\Util\Platform; use Composer\Util\ProcessExecutor; use Composer\Util\RemoteFilesystem; use Composer\IO\IOInterface; use RarArchive; /** * RAR archive downloader. * * Based on previous work by Jordi Boggiano ({@see ZipDownloader}). * * @author Derrick Nelson <drrcknlsn@gmail.com> */ class RarDownloader extends ArchiveDownloader { protected $process; public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, ProcessExecutor $process = null, RemoteFilesystem $rfs = null) { $this->process = $process ?: new ProcessExecutor($io); parent::__construct($io, $config, $eventDispatcher, $cache, $rfs); } protected function extract($file, $path) { $processError = null; // Try to use unrar on *nix if (!Platform::isWindows()) { $command = 'unrar x ' . ProcessExecutor::escape($file) . ' ' . ProcessExecutor::escape($path) . ' >/dev/null && chmod -R u+w ' . ProcessExecutor::escape($path); if (0 === $this->process->execute($command, $ignoredOutput)) { return; } $processError = 'Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput(); } if (!class_exists('RarArchive')) { // php.ini path is added to the error message to help users find the correct file $iniMessage = IniHelper::getMessage(); $error = "Could not decompress the archive, enable the PHP rar extension or install unrar.\n" . $iniMessage . "\n" . $processError; if (!Platform::isWindows()) { $error = "Could not decompress the archive, enable the PHP rar extension.\n" . $iniMessage; } throw new \RuntimeException($error); } $rarArchive = RarArchive::open($file); if (false === $rarArchive) { throw new \UnexpectedValueException('Could not open RAR archive: ' . $file); } $entries = $rarArchive->getEntries(); if (false === $entries) { throw new \RuntimeException('Could not retrieve RAR archive entries'); } foreach ($entries as $entry) { if (false === $entry->extract($path)) { throw new \RuntimeException('Could not extract entry'); } } $rarArchive->close(); } } 上記は一部ですがメッセージは「インポートされた RarArchive は見つかりません」と2か所出ます(line23・71) ###試したこと 環境再構築 eclipseのバージョンを下げる 複数ブラウザで確認 プロジェクトのクリーン、ビルド ###補足情報(言語/FW/ツール等のバージョンなど) ソースコードに入力したものは、「vendor-composer-src-Downloader-RarDownloader.php」です。 参考にしている書籍:PHPフレームワークCakePHP3入門(著:掌田 津耶乃) windows10 eclipse(oxygen) php(最新) composer(最新) cakePHP xampp