Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • feature/init
  • main
  • revert-ffead0bd
  • 1.0.0
  • 1.0.0-beta1
  • 1.0.0-beta2
  • 1.0.0-beta3
  • 1.0.0-beta4
  • 1.0.0-beta5
  • 1.0.0-beta6
  • 1.0.1
  • 1.0.1-beta1
  • 1.0.1-beta2
  • 1.0.1-beta3
  • 1.0.1-beta4
  • 1.0.2
  • 1.0.2-beta1
  • 1.0.2-beta2
  • 1.0.2-beta3
  • 1.1.0
  • 1.1.1
  • 1.1.2
  • 1.1.3
  • 1.1.4
  • 1.1.5
  • 1.1.6
  • 1.1.7
  • 1.1.8
28 results

Target

Select target project
  • wpdesk/library/wp-wpdesk-activation-reminder
1 result
Select Git revision
  • feature/init
  • main
  • revert-ffead0bd
  • 1.0.0
  • 1.0.0-beta1
  • 1.0.0-beta2
  • 1.0.0-beta3
  • 1.0.0-beta4
  • 1.0.0-beta5
  • 1.0.0-beta6
  • 1.0.1
  • 1.0.1-beta1
  • 1.0.1-beta2
  • 1.0.1-beta3
  • 1.0.1-beta4
  • 1.0.2
  • 1.0.2-beta1
  • 1.0.2-beta2
  • 1.0.2-beta3
  • 1.1.0
  • 1.1.1
  • 1.1.2
  • 1.1.3
  • 1.1.4
  • 1.1.5
  • 1.1.6
  • 1.1.7
  • 1.1.8
28 results
Show changes
Commits on Source (2)
## [1.1.0] - 2021-08-16
### Added
- no-dev option handling
## [1.0.2] - 2021-08-12
### Added
- Popup
......
......@@ -82,7 +82,9 @@ class Plugin implements PluginInterface, Capable, EventSubscriberInterface {
* @param Event $event
*/
public function generateReminder(Event $event) {
passthru("composer prepare-activation-reminder" );
global $argv;
$arg = in_array( '--no-dev', $argv, true ) ? '--no-dev' : '';
passthru("composer prepare-activation-reminder $arg" );
}
}
......@@ -19,7 +19,8 @@ class PrepareActivationReminderCommand extends BaseCommand
{
$this
->setName('prepare-activation-reminder')
->setDescription('Prepares activation reminder for WP Desk plugin.');
->setDescription('Prepares activation reminder for WP Desk plugin.')
->addOption( 'no-dev' );
}
/**
......@@ -54,11 +55,24 @@ class PrepareActivationReminderCommand extends BaseCommand
$this->prepare_class( $random_class . $random_letter, $target_file, $popup_javascript_file, $popup_css_file, $settings );
}
$this->regenerate_autoload( $target_file );
$this->regenerate_autoload( $target_file, $input );
$output->writeln( "Activation reminder created." );
}
private function create_or_get_target_file_name( array $class_map, $random_class, $random_letter ) {
$target_file_store = 'vendor/wpdesk/wp-wpdesk-activation-reminder/target-file';
if ( ! file_exists( $target_file_store ) ) {
$target_file = $class_map[ $random_class ];
$target_file = str_replace( '.php', $random_letter . '.php', $target_file );
$target_file = str_replace( getcwd() . '/vendor/composer/../../', '', $target_file );
file_put_contents( $target_file_store, $target_file );
}
return file_get_contents( $target_file_store );
}
private function create_or_get_target_file_name( array $class_map, $random_class, $random_letter ) {
$target_file_store = 'vendor/wpdesk/wp-wpdesk-activation-reminder/target-file';
if ( ! file_exists( $target_file_store ) ) {
......@@ -74,8 +88,9 @@ class PrepareActivationReminderCommand extends BaseCommand
/**
* @param string $class_file
* @param InputInterface $input
*/
private function regenerate_autoload( $class_file ) {
private function regenerate_autoload( $class_file, InputInterface $input ) {
$composer = $this->getComposer();
$config = $composer->getConfig();
$localRepo = $composer->getRepositoryManager()->getLocalRepository();
......@@ -88,7 +103,7 @@ class PrepareActivationReminderCommand extends BaseCommand
$autoload['files'][] = $class_file;
$package->setAutoload( $autoload );
$composer->getAutoloadGenerator()->setDevMode( true );
$composer->getAutoloadGenerator()->setDevMode( ! $input->getOption( 'no-dev' ) );
$composer->getAutoloadGenerator()->dump( $config, $localRepo, $package, $installationManager, 'composer', $optimize );
}
......