private function verifyPuliVersion()
 {
     $versionString = $this->puliRunner->run('-V');
     if (!preg_match('~^Puli version (\\S+)$~', $versionString, $matches)) {
         throw new RuntimeException(sprintf('Could not determine Puli version. "puli -V" returned: %s', $versionString));
     }
     // the development build of the plugin is always considered compatible
     // with the development build of the CLI
     // Split strings to prevent replacement during release
     if ('@package_' . 'version@' === self::VERSION && '@package_' . 'version@' === $matches[1]) {
         return;
     }
     if (version_compare($matches[1], self::MIN_CLI_VERSION, '<')) {
         throw new RuntimeException(sprintf('Found an unsupported version of the Puli CLI: %s. Please ' . 'upgrade to version %s or higher. You can also install the ' . 'puli/cli dependency at version %s in your project.', $matches[1], self::MIN_CLI_VERSION, self::MIN_CLI_VERSION));
     }
     if (version_compare($matches[1], self::MAX_CLI_VERSION, '>')) {
         throw new RuntimeException(sprintf('Found an unsupported version of the Puli CLI: %s. Please ' . 'downgrade to a lower version than %s. You can also install ' . 'the puli/cli dependency in your project.', $matches[1], self::MAX_CLI_VERSION));
     }
 }
Esempio n. 2
0
 private function renamePackage($name, $newName)
 {
     $this->puliRunner->run('package --rename %old_name% %new_name%', array('old_name' => $name, 'new_name' => $newName));
 }
 private function renamePackage($name, $newName)
 {
     $this->puliRunner->run(sprintf('package --rename %s %s', escapeshellarg($name), escapeshellarg($newName)));
 }