예제 #1
0
 /**
  * Assert file existence
  *
  * @return bool
  * @throws \Magento\Framework\Exception\FileSystemException
  */
 protected function assertValid()
 {
     if (!$this->driver->isExists($this->path)) {
         throw new FileSystemException(new \Magento\Framework\Phrase('The file "%1" doesn\'t exist', [$this->path]));
     }
     return true;
 }
예제 #2
0
파일: Read.php 프로젝트: Mohitsahu123/mtf
 /**
  * Assert file existence
  *
  * @return bool
  * @throws \Magento\Framework\Filesystem\FilesystemException
  */
 protected function assertValid()
 {
     if (!$this->driver->isExists($this->path)) {
         throw new FilesystemException(sprintf('The file "%s" doesn\'t exist', $this->path));
     }
     return true;
 }
예제 #3
0
 /**
  * @return string
  */
 protected function getLockFile()
 {
     $lockFileDir = $this->filesystem->getDirectoryRead(DirectoryList::VAR_DIR)->getAbsolutePath();
     $lockFile = $lockFileDir . DIRECTORY_SEPARATOR . $this->lockFileName;
     if (!$this->filesystemDriver->isExists($lockFile)) {
         $this->filesystemDriver->filePutContents($lockFile, 0);
     }
     return $lockFile;
 }
예제 #4
0
파일: File.php 프로젝트: okite11/frames21
 /**
  * @return string
  */
 protected function getLockFile()
 {
     $lockFileDir = dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR . 'var';
     $lockFile = $lockFileDir . DIRECTORY_SEPARATOR . $this->lockFileName;
     if (!$this->filesystem->isExists($lockFile)) {
         $this->filesystem->filePutContents($lockFile, 0);
     }
     return $lockFile;
 }
예제 #5
0
 /**
  * Checks that application is installed and DI resources are cleared
  *
  * @return string[]
  */
 private function checkEnvironment()
 {
     $messages = [];
     if (!$this->deploymentConfig->isAvailable()) {
         $messages[] = 'You cannot run this command because the Magento application is not installed.';
     }
     /**
      * By the time the command is able to execute, the Object Management configuration is already contaminated
      * by old config info, and it's too late to just clear the files in code.
      *
      * TODO: reconfigure OM in runtime so DI resources can be cleared after command launches
      *
      */
     $path = $this->directoryList->getPath(DirectoryList::DI);
     if ($this->fileDriver->isExists($path)) {
         $messages[] = "DI configuration must be cleared before running compiler. Please delete '{$path}'.";
     }
     return $messages;
 }
예제 #6
0
 /**
  * Checks that application is installed and DI resources are cleared
  *
  * @return string[]
  */
 private function checkEnvironment()
 {
     $messages = [];
     $config = $this->deploymentConfig->get(ConfigOptionsListConstants::KEY_MODULES);
     if (!$config) {
         $messages[] = 'You cannot run this command because modules are not enabled. You can enable modules by' . ' running the \'module:enable --all\' command.';
     }
     /**
      * By the time the command is able to execute, the Object Management configuration is already contaminated
      * by old config info, and it's too late to just clear the files in code.
      *
      * TODO: reconfigure OM in runtime so DI resources can be cleared after command launches
      *
      */
     $path = $this->directoryList->getPath(DirectoryList::DI);
     if ($this->fileDriver->isExists($path)) {
         $messages[] = "DI configuration must be cleared before running compiler. Please delete '{$path}'.";
     }
     return $messages;
 }
예제 #7
0
 /**
  * Check a file or directory exists
  *
  * @param string $path [optional]
  * @return bool
  * @throws \Magento\Framework\Exception\FileSystemException
  */
 public function isExist($path = null)
 {
     return $this->driver->isExists($this->driver->getAbsolutePath($this->path, $path));
 }