Beispiel #1
0
 public function handle(EditThemeCommand $command)
 {
     $repository = new Repository($command->repository);
     $repository->setBranch($command->branch);
     $this->themes->editTheme($command->stylesheet, array('repository' => $repository, 'branch' => $repository->getBranch(), 'status' => $command->status, 'ptd' => $command->pushToDeploy, 'subdirectory' => $command->subdirectory));
     do_action('wppusher_theme_was_edited', new ThemeWasEdited());
 }
 public function handle(EditPluginCommand $command)
 {
     $repository = new Repository($command->repository);
     $repository->setBranch($command->branch);
     $this->plugins->editPlugin($command->file, array('repository' => $repository, 'branch' => $repository->getBranch(), 'status' => $command->status, 'ptd' => $command->pushToDeploy, 'subdirectory' => $command->subdirectory));
     do_action('wppusher_plugin_was_edited', new PluginWasEdited());
 }
 public function allPusherThemes()
 {
     global $wpdb;
     $table_name = pusherTableName();
     $rows = $wpdb->get_results("SELECT * FROM {$table_name} WHERE type = 2");
     $themes = array();
     foreach ($rows as $row) {
         // This is our time to do some cleaning up
         if (!file_exists(get_theme_root() . "/" . $row->package)) {
             $this->delete($row->id);
             continue;
         }
         $object = wp_get_theme($row->package);
         $themes[$row->package] = Theme::fromWpThemeObject($object);
         $repository = new Repository($row->repository);
         $repository->setBranch($row->branch);
         $themes[$row->package]->setRepository($repository);
         $themes[$row->package]->setPushToDeploy($row->ptd);
         $themes[$row->package]->setHost($row->host);
         $themes[$row->package]->setSubdirectory($row->subdirectory);
     }
     return $themes;
 }
 public function allPusherPlugins()
 {
     include_once ABSPATH . 'wp-admin/includes/plugin.php';
     global $wpdb;
     $table_name = pusherTableName();
     $rows = $wpdb->get_results("SELECT * FROM {$table_name} WHERE type = 1");
     $plugins = array();
     foreach ($rows as $row) {
         // This is our change to do some cleaning up
         if (!file_exists(WP_PLUGIN_DIR . "/" . $row->package)) {
             $this->delete($row->id);
             continue;
         }
         $array = get_plugin_data(WP_PLUGIN_DIR . "/" . $row->package);
         $plugins[$row->package] = Plugin::fromWpArray($row->package, $array);
         $repository = new Repository($row->repository);
         $repository->setBranch($row->branch);
         $plugins[$row->package]->setRepository($repository);
         $plugins[$row->package]->setPushToDeploy($row->ptd);
         $plugins[$row->package]->setHost($row->host);
         $plugins[$row->package]->setSubdirectory($row->subdirectory);
     }
     return $plugins;
 }