diff --git a/.gitignore b/.gitignore index 12df4f962..c64877870 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ bower_components/ composer.lock composer.phar -cron.yaml env/ node_modules/ site/ diff --git a/app.yaml b/app.yaml index aa2d565f1..9ec780d46 100644 --- a/app.yaml +++ b/app.yaml @@ -18,6 +18,7 @@ #============================================================================= --- +# Update with the project id. application: your-appengine-project-id version: 1 runtime: php55 @@ -25,11 +26,17 @@ api_version: 1 threadsafe: yes handlers: -- url: /(.*\.(css|gif|ico|jpeg|jpg|js|map|png))$ +- url: /favicon\.ico + static_files: favicon.ico + upload: favicon\.ico + secure: always + +- url: /(.*/(public|SwaggerUI)/.*\.(css|gif|ico|jpeg|jpg|js|map|png))$ static_files: \1 upload: .*\.(css|gif|ico|jpeg|jpg|js|map|png)$ secure: always +# Must enable the task scheduler module. The cron job is defined in cron.yaml. - url: /scheduler/run script: index.php login: admin @@ -39,6 +46,7 @@ handlers: script: index.php secure: always +# Update with the bucket name and the project id. Also update php.ini with the bucket name. env_variables: midas_data_path: gs://your-cloudstorage-bucket/data midas_email_sender: no-reply@your-appengine-project-id.appspotmail.com @@ -48,8 +56,8 @@ env_variables: skip_files: - ^(.*/)?.*/(\.DS_Store|\.htaccess|\.gitignore|CMakeLists\.txt|.*\.java)$ - ^(.*/)?.*/\.sass-cache/.* -- ^(.*/)?(\.coveralls\.yml|\.editorconfig|\.travis\.yml|AUTHORS|bower\.json|composer\.json|composer\.lock|composer\.phar|COPYRIGHT|CTestConfig\.cmake|cron-sample\.yaml|LICENSE|mkdocs\.yml|phpunit\.xml\.dist|README\.md|requirements\.txt|Vagrantfile)$ +- ^(.*/)?(\.codeclimate\.yml|\.coveralls\.yml|\.editorconfig|\.styleci\.yml|\.travis\.yml|AUTHORS|bower\.json|composer\.json|composer\.lock|composer\.phar|COPYRIGHT|CTestConfig\.cmake|LICENSE|mkdocs\.yml|phpunit\.xml\.dist|README\.md|requirements\.txt|Vagrantfile)$ - ^(.*/)?core/configs/.*\.local\.ini$ - ^(.*/)?(\.git|\.idea|\.vagrant|data|docs|env|log|provisioning|site|tests|tmp|utils)/.* - ^(.*/)?(core|modules/.*)/(database/(pgsql|sqlite)|tests)/.* -- ^(.*/)?modules/(archive|batchmake|dicom.*|example|javauploaddownload|metadataextractor|pvw|remoteprocessing|solr|statistics|visualize)/.* +- ^(.*/)?modules/(archive|batchmake|dicom.*|javauploaddownload|metadataextractor|pvw|remoteprocessing|solr|statistics|visualize)/.* diff --git a/composer.json b/composer.json index 0cb80503b..2df2d6891 100644 --- a/composer.json +++ b/composer.json @@ -20,13 +20,12 @@ "leafo/scssphp": "~0.2", "maennchen/zipstream-php": "~0.3", "moontoast/math": "~1.1", - "ramsey/uuid": "~2.8", + "ramsey/uuid": "~3.0", "reprovinci/solr-php-client": "~1.0", "sendgrid/sendgrid": "~3.2", "zendframework/zendframework1": "~1.12" }, "require-dev": { - "ext-curl": "*", "ext-xdebug": "*", "fabpot/php-cs-fixer": "~1.10", "jokkedk/zfdebug": "~1.6", @@ -34,6 +33,7 @@ "phpunit/dbunit": "~1.4", "phpunit/phpcov": "~2.0", "phpunit/phpunit": "~4.8", + "ramsey/uuid-console": "~1.0", "satooshi/php-coveralls": "~0.6", "sensiolabs/security-checker": "~3.0", "symfony/console": "~2.7" diff --git a/core/configs/core.ini b/core/configs/core.ini index 934870484..956e3e9c1 100644 --- a/core/configs/core.ini +++ b/core/configs/core.ini @@ -1,19 +1,16 @@ ; Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0. [global] -bootstrap.path = BASE_PATH "/core/Bootstrap.php" bootstrap.class = "Bootstrap" +bootstrap.path = BASE_PATH "/core/Bootstrap.php" +internationalization = "0" resources.frontController.controllerDirectory = BASE_PATH "/core/controllers" resources.frontController.moduleDirectory = BASE_PATH "/modules" resources.layout.layoutPath = BASE_PATH "/core/layouts" resources.modules[] = "" resources.view.scriptPath = BASE_PATH "/core/views" -internationalization = "0" rest.default = "json" -rest.formats[] = "xml" rest.formats[] = "json" -rest.formats[] = "html" -rest.formats[] = "php" uuid = "67a81613-074d-4c9a-afb7-4613f3144a3d" version = "3.4.1" diff --git a/core/controllers/components/UuidComponent.php b/core/controllers/components/UuidComponent.php index c45a52690..7098eaea7 100644 --- a/core/controllers/components/UuidComponent.php +++ b/core/controllers/components/UuidComponent.php @@ -28,7 +28,7 @@ class UuidComponent extends AppComponent */ public function generate() { - return str_replace('-', '', \Rhumsaa\Uuid\Uuid::uuid4()->toString()); + return str_replace('-', '', \Ramsey\Uuid\Uuid::uuid4()->toString()); } /** diff --git a/cron-sample.yaml b/cron.yaml similarity index 90% rename from cron-sample.yaml rename to cron.yaml index bc6ec899f..05ee94ce9 100644 --- a/cron-sample.yaml +++ b/cron.yaml @@ -18,8 +18,8 @@ #============================================================================= --- -# Enable the task scheduler module and rename this file "cron.yaml". +# Must enable the task scheduler module. cron: - description: task scheduler job url: /scheduler/run - schedule: every 10 minutes + schedule: every 12 minutes diff --git a/modules/example/AppController.php b/modules/example/AppController.php deleted file mode 100644 index 61d1837e8..000000000 --- a/modules/example/AppController.php +++ /dev/null @@ -1,25 +0,0 @@ -view->header = 'Example Module Sample Controller View Action'; - $this->view->sampleList = array('sample 1', 'sample 2', 'sample 3'); - $this->view->json['json_sample'] = 'my_json_sample_value'; - // get userId 1 for now - $userDao = $this->User->load(1); // use a core model - $this->view->wallet = $this->Example_Wallet->createWallet($userDao, '10'); // use a model from this module - $this->view->wallet->setCreditCardCount(3); - } - - /** - * delete Action. - */ - public function deleteAction() - { - $this->view->header = 'Example Module Sample Controller Delete Action'; - } -} diff --git a/modules/example/database/mysql/1.0.0.sql b/modules/example/database/mysql/1.0.0.sql deleted file mode 100644 index bf2531209..000000000 --- a/modules/example/database/mysql/1.0.0.sql +++ /dev/null @@ -1,10 +0,0 @@ --- Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0. - --- MySQL database for the example module, version 1.0.0 - -CREATE TABLE IF NOT EXISTS `example_wallet` ( - `example_wallet_id` bigint(20) NOT NULL AUTO_INCREMENT, - `user_id` bigint(20) NOT NULL, - `dollars` bigint(20) NOT NULL, - PRIMARY KEY (`example_wallet_id`) -) DEFAULT CHARSET=utf8; diff --git a/modules/example/database/pgsql/1.0.0.sql b/modules/example/database/pgsql/1.0.0.sql deleted file mode 100644 index d7ac61861..000000000 --- a/modules/example/database/pgsql/1.0.0.sql +++ /dev/null @@ -1,12 +0,0 @@ --- Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0. - --- PostgreSQL database for the example module, version 1.0.0 - -SET client_encoding = 'UTF8'; -SET default_with_oids = FALSE; - -CREATE TABLE IF NOT EXISTS "example_wallet" ( - "example_wallet_id" serial PRIMARY KEY, - "user_id" bigint NOT NULL, - "dollars" bigint NOT NULL -); diff --git a/modules/example/database/sqlite/1.0.0.sql b/modules/example/database/sqlite/1.0.0.sql deleted file mode 100644 index a3690adb9..000000000 --- a/modules/example/database/sqlite/1.0.0.sql +++ /dev/null @@ -1,9 +0,0 @@ --- Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0. - --- SQLite database for the example module, version 1.0.0 - -CREATE TABLE IF NOT EXISTS "example_wallet" ( - "example_wallet_id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "user_id" INTEGER NOT NULL, - "dollars" INTEGER NOT NULL -); diff --git a/modules/example/database/upgrade/1.0.1.php b/modules/example/database/upgrade/1.0.1.php deleted file mode 100644 index 320039969..000000000 --- a/modules/example/database/upgrade/1.0.1.php +++ /dev/null @@ -1,41 +0,0 @@ -db->query("ALTER TABLE `example_wallet` ADD COLUMN `credit_card_count` int(10) NOT NULL DEFAULT '0';"); - } - - /** Upgrade a PostgreSQL database. */ - public function pgsql() - { - $this->db->query('ALTER TABLE example_wallet ADD COLUMN credit_card_count integer NOT NULL DEFAULT 0;'); - } - - /** Upgrade a SQLite database. */ - public function sqlite() - { - $this->db->query('ALTER TABLE example_wallet ADD COLUMN credit_card_count INTEGER NOT NULL DEFAULT 0;'); - } -} diff --git a/modules/example/models/AppDao.php b/modules/example/models/AppDao.php deleted file mode 100644 index 1dafad1fa..000000000 --- a/modules/example/models/AppDao.php +++ /dev/null @@ -1,26 +0,0 @@ -_name = 'example_wallet'; - $this->_key = 'example_wallet_id'; - - $this->_mainData = array( - 'example_wallet_id' => array('type' => MIDAS_DATA), - 'user_id' => array('type' => MIDAS_DATA), - 'dollars' => array('type' => MIDAS_DATA), - 'credit_card_count' => array('type' => MIDAS_DATA), - 'user' => array( - 'type' => MIDAS_MANY_TO_ONE, - 'model' => 'User', - 'parent_column' => 'user_id', - 'child_column' => 'user_id', - ), - ); - $this->initialize(); // required - } - - /** Create a wallet - * @return WalletDao - */ - public function createWallet($userDao, $dollars) - { - /** @var Example_WalletDao $wallet */ - $wallet = MidasLoader::newDao('WalletDao', 'example'); - $wallet->setUserId($userDao->getKey()); - $wallet->setDollars($dollars); - $this->save($wallet); - - return $wallet; - } -} diff --git a/modules/example/models/dao/WalletDao.php b/modules/example/models/dao/WalletDao.php deleted file mode 100644 index 7cca20585..000000000 --- a/modules/example/models/dao/WalletDao.php +++ /dev/null @@ -1,42 +0,0 @@ -headScript()->appendFile($this->moduleWebroot.'/public/js/sample/example.sample.view.js'); -?> - - sampleList as $sample) { - echo ''; - } - ?> -
'.$this->escape($sample).'
-escape($this->wallet->getDollars()); -echo 'credit card count: '.$this->escape($this->wallet->getCreditCardCount()); diff --git a/php.ini b/php.ini index b20233083..67ade1e47 100644 --- a/php.ini +++ b/php.ini @@ -1,6 +1,8 @@ ; Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0. +extension = "curl.so" extension = "imagick.so" +; Update with the bucket name. Also update app.yaml with the project id and bucket name. google_app_engine.allow_include_gs_buckets = "your-cloudstorage-bucket" google_app_engine.enable_functions = "php_sapi_name, phpversion" session.cookie_httponly = On