diff --git a/src/classes/api/endpoints/class-tainacan-rest-exporters-controller.php b/src/classes/api/endpoints/class-tainacan-rest-exporters-controller.php index 08a368eac..c164fd950 100644 --- a/src/classes/api/endpoints/class-tainacan-rest-exporters-controller.php +++ b/src/classes/api/endpoints/class-tainacan-rest-exporters-controller.php @@ -19,17 +19,10 @@ class REST_Exporters_Controller extends REST_Controller { */ public function __construct() { $this->rest_base = 'exporters'; - if (session_status() == PHP_SESSION_NONE) { - @session_start(); // @ avoids Warnings when running phpunit tests - } parent::__construct(); add_action('init', array(&$this, 'init_objects'), 11); } - public function __destruct() { - session_write_close(); - } - /** * Initialize objects after post_type register */ @@ -95,24 +88,24 @@ class REST_Exporters_Controller extends REST_Controller { } - /** - * - * @param \WP_REST_Request $request - * - * @return bool|\WP_Error - * @throws \Exception - */ - public function export_permissions_check($request) { - return true; - } + /** + * + * @param \WP_REST_Request $request + * + * @return bool|\WP_Error + * @throws \Exception + */ + public function export_permissions_check($request) { + return true; + } - public function get_registered_exporters() { - global $Tainacan_Exporter_Handler; - $exporters = $Tainacan_Exporter_Handler->get_registered_exporters(); - return new \WP_REST_Response( $exporters, 200 ); - } + public function get_registered_exporters() { + global $Tainacan_Exporter_Handler; + $exporters = $Tainacan_Exporter_Handler->get_registered_exporters(); + return new \WP_REST_Response( $exporters, 200 ); + } - /** + /** * Creates a new instance of the desired exporter and returns its ID * * @param \WP_REST_Request $request diff --git a/src/classes/api/endpoints/class-tainacan-rest-importers-controller.php b/src/classes/api/endpoints/class-tainacan-rest-importers-controller.php index 6a8d0afaa..dc15c3d33 100644 --- a/src/classes/api/endpoints/class-tainacan-rest-importers-controller.php +++ b/src/classes/api/endpoints/class-tainacan-rest-importers-controller.php @@ -11,8 +11,6 @@ use Tainacan\Entities; * * */ class REST_Importers_Controller extends REST_Controller { - private $collections_repository; - private $collection; /** * REST_Importers_Controller constructor. @@ -20,15 +18,9 @@ class REST_Importers_Controller extends REST_Controller { */ public function __construct(){ $this->rest_base = 'importers'; - if (session_status() == PHP_SESSION_NONE) { - @session_start(); // @ avoids Warnings when running phpunit tests - } parent::__construct(); } - public function __destruct() { - session_write_close(); - } /** * Register the collections route and their endpoints */ diff --git a/src/classes/importer/import.php b/src/classes/importer/import.php deleted file mode 100644 index 0be1f3c3b..000000000 --- a/src/classes/importer/import.php +++ /dev/null @@ -1,89 +0,0 @@ -parse_args($argv); - $this->run(); - - } - - /** - * parse args from and set the attributs - * 1 - Old Tainacan url (required) - */ - function parse_args($argv) { - - if (!is_array($argv)) - return; - - - if (isset($argv[1])) { - - if (filter_var($argv[1], FILTER_VALIDATE_URL)) { - $this->url = $argv[1]; - } - - } - - if (isset($argv[2])) { - - if (is_numeric($argv[2])) { - $this->step = $argv[2]; - } else { - $this->run = ''; - } - - } - - } - - /** - * echo message in prompt line - */ - function log($msg) { - - echo $msg . PHP_EOL; - - } - - function run() { - - $start = $partial = microtime(true); - - // Avoid warnings - $_SERVER['SERVER_PROTOCOL'] = "HTTP/1.1"; - $_SERVER['REQUEST_METHOD'] = "GET"; - - define( 'WP_USE_THEMES', false ); - define( 'SHORTINIT', false ); - // require( dirname(__FILE__) . '/../../../../wp-blog-header.php' ); - - $old_tainacan = new \Tainacan\Importer\Old_Tainacan(); - $id = $old_tainacan->get_id(); - - $_SESSION['tainacan_importer'][$id]->set_url($this->url); - - while (!$_SESSION['tainacan_importer'][$id]->is_finished()){ - $_SESSION['tainacan_importer'][$id]->run(); - } - - $scripttime = microtime(true) - $start; - - $this->log("=========================================================="); - $this->log("=========================================================="); - $this->log("=== Fim do script. Tempo de execução {$scripttime}s"); - $this->log("=========================================================="); - $this->log("=========================================================="); - - } -} - -$x = new ScriptTainacanOld($argv); \ No newline at end of file diff --git a/src/readme.txt b/src/readme.txt index 664a9d57b..a9a81733e 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -4,7 +4,7 @@ Tags: museums, libraries, archives, GLAM, collections, repository Requires at least: 5.0 Tested up to: 6.1 Requires PHP: 5.6 -Stable tag: 0.20.1 +Stable tag: 0.20.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html diff --git a/src/tainacan.php b/src/tainacan.php index fa9377845..991e51709 100644 --- a/src/tainacan.php +++ b/src/tainacan.php @@ -4,7 +4,7 @@ Plugin Name: Tainacan Plugin URI: https://tainacan.org/ Description: Open source, powerful and flexible repository platform for WordPress. Manage and publish you digital collections as easily as publishing a post to your blog, while having all the tools of a professional repository platform. Author: Tainacan.org -Version: 0.20.1 +Version: 0.20.2 Requires at least: 5.0 Tested up to: 6.1 Requires PHP: 5.6 @@ -14,7 +14,7 @@ License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html */ -const TAINACAN_VERSION = '0.20.1'; +const TAINACAN_VERSION = '0.20.2'; defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); $TAINACAN_BASE_URL = plugins_url('', __FILE__); diff --git a/src/views/admin/components/filter-types/tainacan-filter-item.vue b/src/views/admin/components/filter-types/tainacan-filter-item.vue index 4fc6c6c65..b44825cd3 100644 --- a/src/views/admin/components/filter-types/tainacan-filter-item.vue +++ b/src/views/admin/components/filter-types/tainacan-filter-item.vue @@ -86,8 +86,33 @@