From 8d57f4199f4861badc499588ca272d6c4d1d06d3 Mon Sep 17 00:00:00 2001 From: Mac Bok Arimana Date: Sat, 22 Sep 2018 18:29:27 +0200 Subject: [PATCH 01/13] Coverity code scanner --- .travis.yml | 131 +++++------------------- .travis/configure | 103 +++++++++++++++++++ app/Config/bootstrap.php | 4 +- app/Config/database.php | 205 ++++++++++++++----------------------- app/tmp/cache/models/Empty | 0 app/tmp/empty | 0 composer.json | 2 +- composer.lock | 78 ++++++++------ 8 files changed, 256 insertions(+), 267 deletions(-) create mode 100755 .travis/configure mode change 100644 => 100755 app/tmp/cache/models/Empty mode change 100644 => 100755 app/tmp/empty diff --git a/.travis.yml b/.travis.yml index 6b822b83d..f17f64b3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,11 +13,26 @@ env: matrix: - DB=mysql global: - - PHPUNIT=3 - - PHPCS=1 - # OC_SECRET - secure: "O+HejqZgXZFf0eD3GdvUwL2dsJsW+5biztfWYKHNfzv5u9j6Nn8JSoLdIp+Bg6Kct6kCJebM7oWHCh1fhyEm3AluusmqKHN8VKwQuINEZKAxPRFGl3NKkEU/Y95tHR3JIubZbZ0oZYmnl7z+YgVvM4LvmfvAwdpXzRt4SWOzGRWiL8uRaovOwW10HUB6qcO70Rn9XIHz4gUAoAEWQgSlJ4aNftu/lpuYs4P1r0+6fI/nfRRBMOogBQLEMqw6enPP+RrWx2pLwuxaQqChtk2td5PJdLiifW7C8SiAsljSgIRiaytAOgIs5KJsLGUdAPNXIMqUYFJ776J3L+ln8/nM/H8ARGB2P3smY5HM34/NrzUat2X/B6Uqg1F0Fs/794aomhaeqgh4b2MRI5srjQ/grNK61H1AftdR6JSLVjm6AUg743GQJF7sgNfK60n28EEZApAEzDS0v1PyU7U/HAZIalqWnttO0ycQyj2rf1XC++6BuTcRdmxx4dZoqZIn7xHzBQvi99ljv4JuwUgrNYXvcSEkXu6Y5GqMl2rtjxrdaGATpePuk1ju1kfB/7fQsR3ZZOaxULOSlQRcArsyseOtmEqQ1h5BVSmOGV+yoEboNm2FDZH/gD9ZZ7kTi+bk4bvHRZSD06JiDZ12W/JGsmU77phVIIWuUcXghEZf/WRjTe4=" - + # The next declaration is the encrypted OC_SECRET, created + # via the "travis encrypt" command using the project repo's public key + - secure: "O+HejqZgXZFf0eD3GdvUwL2dsJsW+5biztfWYKHNfzv5u9j6Nn8JSoLdIp+Bg6Kct6kCJebM7oWHCh1fhyEm3AluusmqKHN8VKwQuINEZKAxPRFGl3NKkEU/Y95tHR3JIubZbZ0oZYmnl7z+YgVvM4LvmfvAwdpXzRt4SWOzGRWiL8uRaovOwW10HUB6qcO70Rn9XIHz4gUAoAEWQgSlJ4aNftu/lpuYs4P1r0+6fI/nfRRBMOogBQLEMqw6enPP+RrWx2pLwuxaQqChtk2td5PJdLiifW7C8SiAsljSgIRiaytAOgIs5KJsLGUdAPNXIMqUYFJ776J3L+ln8/nM/H8ARGB2P3smY5HM34/NrzUat2X/B6Uqg1F0Fs/794aomhaeqgh4b2MRI5srjQ/grNK61H1AftdR6JSLVjm6AUg743GQJF7sgNfK60n28EEZApAEzDS0v1PyU7U/HAZIalqWnttO0ycQyj2rf1XC++6BuTcRdmxx4dZoqZIn7xHzBQvi99ljv4JuwUgrNYXvcSEkXu6Y5GqMl2rtjxrdaGATpePuk1ju1kfB/7fQsR3ZZOaxULOSlQRcArsyseOtmEqQ1h5BVSmOGV+yoEboNm2FDZH/gD9ZZ7kTi+bk4bvHRZSD06JiDZ12W/JGsmU77phVIIWuUcXghEZf/WRjTe4=" + # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created + # via the "travis encrypt" command using the project repo's public key + - secure: "4rmDT/vKTSi8AqI3afVUylayJ+SQbxblwlz/z81No4nLYWoy0dT61R/ZXq2Y29BE/HGEwx6r8Fl5RU6DxnmD7KhLC/3swHifzed690VDWyLii7cK8QkXVfLVVo8p+ozIwUrirnYFEkAcTfmkwJbmZN6DUuHJCl4x14NolR82VlJtFOVoWs63r+2NVJ5aM+63bkljkcW2U4xTt/8aOrCU/UapwqxC1GA0xPpwte6jPhzUjKXWbiknY+noUakM13x8SOkSRs3MTEf8J2va2T6DbVY3wy3x2Ytp4/KDwVNUrn/GKgBDRysP3jefO2d6XZJlb8OktJsrHdtWIZ+oYVwoy0PRV3vmdHs1NFUmYdQEe5UpiUKKyxWMsM+31to5ZUtJtn4kIlgzyo+xZu+LCgbOusJs33uPZODOON5fHcAoMp3AdAM0ResBfJdjzYEiewlcGYAcOoMX6DtopoJCoz+JxktdzXnjz89imNKMB2tjsRXuZMdE0WL3V2TSuOS5r8BwuuXXeul5vvE2EKHoIHgrP2nehz+q7dyC71m6jNrQX7x+xVg988vh0Fg8hyghLUzt9Myv4pvtQ/zQDbabKGtsakiHSvPTeHcb8mDhs62h5aIWUar8oXNuOWlk+hnyqZLmnbUPDcg54o567NursWYSWemAnPkPvSTfX0DQF1hDvSo=" + +before_install: +# Coverity Scan certificate (global secure: COVERITY_SCAN_TOKEN) +- echo -n | openssl s_client -connect https://scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- + +addons: + coverity_scan: + project: + name: "b23prodtm/myphpcms" + description: "This PHP CMS is featuring well-known functionalities as cool as posting some web contents with pictures stored in a database." + notification_email: b23prodtm@users.sourceforge.net + build_command_prepend: sh --verbose .travis/configure + build_command: ./lib/Cake/Console/cake test core AllTests --stderr + branch_pattern: coverity_scan services: - memcached @@ -31,110 +46,10 @@ matrix: env: DB=sqlite before_script: - - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi - - composer require --prefer-dist --update-with-dependencies --dev phpunit/phpunit ^$PHPUNIT cakephp/cakephp-codesniffer ^$PHPCS - - echo "require_once 'vendors/autoload.php';" >> app/Config/bootstrap.php - - sudo locale-gen de_DE - - sudo locale-gen es_ES - - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi" - - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi" - - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test3;'; fi" - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi" - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi" - - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi" - - chmod -R 777 ./app/tmp - - if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]] ; then pecl install timezonedb ; fi - - sh -c "if [ '$PHPCS' = '1' ]; then composer require 'cakephp/cakephp-codesniffer:1.*'; fi" - - sh -c "if [ '$PHPCS' = '1' ]; then vendors/bin/phpcs --config-set installed_paths vendors/cakephp/cakephp-codesniffer; fi" - - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]] ; then echo "yes" | pecl install apcu-5.1.3 || true; fi - - if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" ]] ; then echo "yes" | pecl install apcu-4.0.11 || true; fi - - echo -e "extension = apcu.so\napc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - phpenv rehash - - set +H - - echo " array( - 'datasource' => 'Database/Mysql', - 'host' => '127.0.0.1', - 'login' => 'root' - ), - 'pgsql' => array( - 'datasource' => 'Database/Postgres', - 'host' => '127.0.0.1', - 'login' => 'postgres', - 'database' => 'cakephp_test', - 'schema' => array( - 'default' => 'public', - 'test' => 'public', - 'test2' => 'test2', - 'test_database_three' => 'test3' - ) - ), - 'sqlite' => array( - 'datasource' => 'Database/Sqlite', - 'database' => array( - 'default' => ':memory:', - 'test' => ':memory:', - 'test2' => '/tmp/cakephp_test2.db', - 'test_database_three' => '/tmp/cakephp_test3.db' - ), - ) - ); - public \$default = array( - 'persistent' => false, - 'host' => '', - 'login' => '', - 'password' => '', - 'database' => 'cakephp_test', - 'prefix' => '' - ); - public \$test = array( - 'persistent' => false, - 'host' => '', - 'login' => '', - 'password' => '', - 'database' => 'cakephp_test', - 'prefix' => '' - ); - public \$test2 = array( - 'persistent' => false, - 'host' => '', - 'login' => '', - 'password' => '', - 'database' => 'cakephp_test2', - 'prefix' => '' - ); - public \$test_database_three = array( - 'persistent' => false, - 'host' => '', - 'login' => '', - 'password' => '', - 'database' => 'cakephp_test3', - 'prefix' => '' - ); - public function __construct() { - \$db = 'mysql'; - if (!empty(\$_SERVER['DB'])) { - \$db = \$_SERVER['DB']; - } - foreach (array('default', 'test', 'test2', 'test_database_three') as \$source) { - \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]); - if (is_array(\$config['database'])) { - \$config['database'] = \$config['database'][\$source]; - } - if (!empty(\$config['schema']) && is_array(\$config['schema'])) { - \$config['schema'] = \$config['schema'][\$source]; - } - \$this->{\$source} = \$config; - } - } - }" > app/Config/database.php + - .travis/configure script: - - sh -c "if [ '$PHPCS' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; fi" - - sh -c "if [ '$PHPCS' = '1' ]; then vendors/bin/phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi;" + - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then if [ '${PHPCS}' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; else vendors/bin/phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi; fi notifications: email: false @@ -144,4 +59,4 @@ notifications: - https://webhook-proxy-e14.a3c1.starter-us-west-1.openshiftapps.com/travis-ci/api.starter-us-west-1.openshift.com:443/e14/cakephp-mysql-persistent/webhooks/$OC_SECRET/generic on_success: always on_failure: never - on_start: never# default: always \ No newline at end of file + on_start: never # default: always diff --git a/.travis/configure b/.travis/configure new file mode 100755 index 000000000..83096bb9c --- /dev/null +++ b/.travis/configure @@ -0,0 +1,103 @@ +#!/bin/sh +export PHPUNIT=3 +export PHPCS=1 +if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi +composer require --prefer-dist --update-with-dependencies --dev phpunit/phpunit ^${PHPUNIT} cakephp/cakephp-codesniffer ^${PHPCS} +echo "require_once 'vendors/autoload.php';" >> app/Config/bootstrap.php +sudo locale-gen de_DE +sudo locale-gen es_ES +sh -c "if [ '${DB}' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi" +sh -c "if [ '${DB}' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi" +sh -c "if [ '${DB}' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test3;'; fi" +sh -c "if [ '${DB}' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi" +sh -c "if [ '${DB}' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi" +sh -c "if [ '${DB}' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi" +chmod -R 777 ./app/tmp +if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]] ; then pecl install timezonedb ; fi +sh -c "if [ '${PHPCS}' = '1' ]; then composer require 'cakephp/cakephp-codesniffer:1.*'; fi" +sh -c "if [ '${PHPCS}' = '1' ]; then vendors/bin/phpcs --config-set installed_paths vendors/cakephp/cakephp-codesniffer; fi" +echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini +if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]] ; then echo "yes" | pecl install apcu-5.1.3 || true; fi +if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" ]] ; then echo "yes" | pecl install apcu-4.0.11 || true; fi +echo -e "extension = apcu.so\napc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini +phpenv rehash +set +H +echo " array( + 'datasource' => 'Database/Mysql', + 'host' => '127.0.0.1', + 'login' => 'root' + ), + 'pgsql' => array( + 'datasource' => 'Database/Postgres', + 'host' => '127.0.0.1', + 'login' => 'postgres', + 'database' => 'cakephp_test', + 'schema' => array( + 'default' => 'public', + 'test' => 'public', + 'test2' => 'test2', + 'test_database_three' => 'test3' + ) + ), + 'sqlite' => array( + 'datasource' => 'Database/Sqlite', + 'database' => array( + 'default' => ':memory:', + 'test' => ':memory:', + 'test2' => '/tmp/cakephp_test2.db', + 'test_database_three' => '/tmp/cakephp_test3.db' + ), + ) + ); + public \$default = array( + 'persistent' => false, + 'host' => '', + 'login' => '', + 'password' => '', + 'database' => 'cakephp_test', + 'prefix' => '' + ); + public \$test = array( + 'persistent' => false, + 'host' => '', + 'login' => '', + 'password' => '', + 'database' => 'cakephp_test', + 'prefix' => '' + ); + public \$test2 = array( + 'persistent' => false, + 'host' => '', + 'login' => '', + 'password' => '', + 'database' => 'cakephp_test2', + 'prefix' => '' + ); + public \$test_database_three = array( + 'persistent' => false, + 'host' => '', + 'login' => '', + 'password' => '', + 'database' => 'cakephp_test3', + 'prefix' => '' + ); + public function __construct() { + \$db = 'mysql'; + if (!empty(\$_SERVER['DB'])) { + \$db = \$_SERVER['DB']; + } + foreach (array('default', 'test', 'test2', 'test_database_three') as \$source) { + \$config = array_merge(\$this->{\$source}, \$this->identities[\$db]); + if (is_array(\$config['database'])) { + \$config['database'] = \$config['database'][\$source]; + } + if (!empty(\$config['schema']) && is_array(\$config['schema'])) { + \$config['schema'] = \$config['schema'][\$source]; + } + \$this->{\$source} = \$config; + } + } + }" > app/Config/database.php diff --git a/app/Config/bootstrap.php b/app/Config/bootstrap.php index c83a0bcf9..086db032f 100755 --- a/app/Config/bootstrap.php +++ b/app/Config/bootstrap.php @@ -118,4 +118,6 @@ /** * Load Markdown Plugin */ -CakePlugin::load(array('Markdown' => array('bootstrap' => true))); \ No newline at end of file +CakePlugin::load(array('Markdown' => array('bootstrap' => true)));require_once 'vendors/autoload.php'; +require_once 'vendors/autoload.php'; +require_once 'vendors/autoload.php'; diff --git a/app/Config/database.php b/app/Config/database.php index c9e4e3ddf..cadefe8eb 100644 --- a/app/Config/database.php +++ b/app/Config/database.php @@ -1,128 +1,79 @@ The name of a supported datasource; valid options are as follows: - * Database/Mysql - MySQL 4 & 5, - * Database/Sqlite - SQLite (PHP5 only), - * Database/Postgres - PostgreSQL 7 and higher, - * Database/Sqlserver - Microsoft SQL Server 2005 and higher - * - * You can add custom database datasources (or override existing datasources) by adding the - * appropriate file to app/Model/Datasource/Database. Datasources should be named 'MyDatasource.php', - * - * - * persistent => true / false - * Determines whether or not the database should use a persistent connection - * - * host => - * the host you connect to the database. To add a socket or port number, use 'port' => # - * - * prefix => - * Uses the given prefix for all the tables in this database. This setting can be overridden - * on a per-table basis with the Model::$tablePrefix property. - * - * schema => - * For Postgres/Sqlserver specifies which schema you would like to use the tables in. - * Postgres defaults to 'public'. For Sqlserver, it defaults to empty and use - * the connected user's default schema (typically 'dbo'). - * - * encoding => - * For MySQL, Postgres specifies the character encoding to use when connecting to the - * database. Uses database default not specified. - * - * sslmode => - * For Postgres specifies whether to 'disable', 'allow', 'prefer', or 'require' SSL for the - * connection. The default value is 'allow'. - * - * unix_socket => - * For MySQL to connect via socket specify the `unix_socket` parameter instead of `host` and `port` - * - * settings => - * Array of key/value pairs, on connection it executes SET statements for each pair - * For MySQL : http://dev.mysql.com/doc/refman/5.7/en/set-statement.html - * For Postgres : http://www.postgresql.org/docs/9.2/static/sql-set.html - * For Sql Server : http://msdn.microsoft.com/en-us/library/ms190356.aspx - * - * flags => - * A key/value array of driver specific connection options. - */ -class DATABASE_CONFIG { - - public $default = array( - 'datasource' => 'Database/Mysql', - 'persistent' => false, - 'host' => 'localhost', - 'port' => '3306', - 'login' => 'test', - 'password' => 'mypassword', - 'database' => 'phpcms', - 'prefix' => '', - 'encoding' => 'utf8', - ); - public $test = array( - 'datasource' => 'Database/Mysql', - 'persistent' => false, - 'host' => 'localhost', - 'port' => '3306', - 'login' => 'test', - 'password' => 'mypassword', - 'database' => 'phpcms', - 'prefix' => '', - 'encoding' => 'utf8', - ); - - public function __construct() { - - $datasource = getenv('DATABASE_ENGINE') ? 'Database/' . ucfirst(getenv('DATABASE_ENGINE')) : FALSE; - - - /** a different test/local configuration (shall not be the same as production)*/ - $test['host'] = getenv('TEST_' . strtoupper(getenv("DATABASE_SERVICE_NAME")) . "_SERVICE_HOST"); - $test['port'] = getenv('TEST_' . strtoupper(getenv("DATABASE_SERVICE_NAME")) . "_SERVICE_PORT"); - $test['login'] = getenv('TEST_DATABASE_USER'); - $test['password'] = getenv('TEST_DATABASE_PASSWORD'); - $test['database'] = getenv('TEST_DATABASE_NAME'); - $test['datasource'] = $datasource; - - $this->redirectIfNull($test, $this->test); - $this->test = $test; - - $default['host'] = getenv(strtoupper(getenv("DATABASE_SERVICE_NAME")) . "_SERVICE_HOST"); - $default['port'] = getenv(strtoupper(getenv("DATABASE_SERVICE_NAME")) . "_SERVICE_PORT"); - $default['login'] = getenv("DATABASE_USER"); - $default['password'] = getenv("DATABASE_PASSWORD"); - $default['database'] = getenv("DATABASE_NAME"); - $default['datasource'] = $datasource; - - $this->redirectIfNull($default, $this->default); - $this->default = $default; - } - function redirectIfNull(&$default, $test) { - foreach ($default as $key => $val) { - if (!$val || $val === "") { - $default[$key] = $test[$key]; - } - } - } - - -} + class DATABASE_CONFIG { + private $identities = array( + 'mysql' => array( + 'datasource' => 'Database/Mysql', + 'host' => '127.0.0.1', + 'login' => 'root' + ), + 'pgsql' => array( + 'datasource' => 'Database/Postgres', + 'host' => '127.0.0.1', + 'login' => 'postgres', + 'database' => 'cakephp_test', + 'schema' => array( + 'default' => 'public', + 'test' => 'public', + 'test2' => 'test2', + 'test_database_three' => 'test3' + ) + ), + 'sqlite' => array( + 'datasource' => 'Database/Sqlite', + 'database' => array( + 'default' => ':memory:', + 'test' => ':memory:', + 'test2' => '/tmp/cakephp_test2.db', + 'test_database_three' => '/tmp/cakephp_test3.db' + ), + ) + ); + public $default = array( + 'persistent' => false, + 'host' => '', + 'login' => '', + 'password' => '', + 'database' => 'cakephp_test', + 'prefix' => '' + ); + public $test = array( + 'persistent' => false, + 'host' => '', + 'login' => '', + 'password' => '', + 'database' => 'cakephp_test', + 'prefix' => '' + ); + public $test2 = array( + 'persistent' => false, + 'host' => '', + 'login' => '', + 'password' => '', + 'database' => 'cakephp_test2', + 'prefix' => '' + ); + public $test_database_three = array( + 'persistent' => false, + 'host' => '', + 'login' => '', + 'password' => '', + 'database' => 'cakephp_test3', + 'prefix' => '' + ); + public function __construct() { + $db = 'mysql'; + if (!empty($_SERVER['DB'])) { + $db = $_SERVER['DB']; + } + foreach (array('default', 'test', 'test2', 'test_database_three') as $source) { + $config = array_merge($this->{$source}, $this->identities[$db]); + if (is_array($config['database'])) { + $config['database'] = $config['database'][$source]; + } + if (!empty($config['schema']) && is_array($config['schema'])) { + $config['schema'] = $config['schema'][$source]; + } + $this->{$source} = $config; + } + } + } diff --git a/app/tmp/cache/models/Empty b/app/tmp/cache/models/Empty old mode 100644 new mode 100755 diff --git a/app/tmp/empty b/app/tmp/empty old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json index 806e072bc..bc621ad05 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ }, "require-dev": { "phpunit/phpunit": "^3", - "cakephp/cakephp-codesniffer": "*" + "cakephp/cakephp-codesniffer": "^1" }, "extra": { "installer-paths": { diff --git a/composer.lock b/composer.lock index ee483f31c..e7bed30d6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3a7762b75377e853c1b485af7be16c90", + "content-hash": "a9a23707520e84e8e32877f96bb4cb5e", "packages": [ { "name": "b23prodtm/markdown-plugin", @@ -222,31 +222,25 @@ "packages-dev": [ { "name": "cakephp/cakephp-codesniffer", - "version": "3.0.5", + "version": "1.0.4", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp-codesniffer.git", - "reference": "7f467fee00fd016b62cf8c85a57750ab2a895e81" + "reference": "0f3559af72fd9c2bba7310a7c4496fbb97502352" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/7f467fee00fd016b62cf8c85a57750ab2a895e81", - "reference": "7f467fee00fd016b62cf8c85a57750ab2a895e81", + "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/0f3559af72fd9c2bba7310a7c4496fbb97502352", + "reference": "0f3559af72fd9c2bba7310a7c4496fbb97502352", "shasum": "" }, "require": { - "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.0.0" + "squizlabs/php_codesniffer": "^1.4.0" }, "require-dev": { - "phpunit/phpunit": "<6.0" - }, - "type": "phpcodesniffer-standard", - "autoload": { - "psr-4": { - "CakePHP\\": "CakePHP" - } + "phpunit/phpunit": "^4.1.0" }, + "type": "library", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -263,7 +257,7 @@ "codesniffer", "framework" ], - "time": "2018-06-09T16:01:01+00:00" + "time": "2018-07-04T15:25:21+00:00" }, { "name": "phpunit/php-code-coverage", @@ -637,37 +631,61 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.3.1", + "version": "1.5.6", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "628a481780561150481a9ec74709092b9759b3ec" + "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/628a481780561150481a9ec74709092b9759b3ec", - "reference": "628a481780561150481a9ec74709092b9759b3ec", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6f3e42d311b882b25b4d409d23a289f4d3b803d5", + "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5", "shasum": "" }, "require": { - "ext-simplexml": "*", "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=5.1.2" }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "suggest": { + "phpunit/php-timer": "dev-master" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "scripts/phpcs" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-phpcs-fixer": "2.0.x-dev" } }, + "autoload": { + "classmap": [ + "CodeSniffer.php", + "CodeSniffer/CLI.php", + "CodeSniffer/Exception.php", + "CodeSniffer/File.php", + "CodeSniffer/Report.php", + "CodeSniffer/Reporting.php", + "CodeSniffer/Sniff.php", + "CodeSniffer/Tokens.php", + "CodeSniffer/Reports/", + "CodeSniffer/CommentParser/", + "CodeSniffer/Tokenizers/", + "CodeSniffer/DocGenerators/", + "CodeSniffer/Standards/AbstractPatternSniff.php", + "CodeSniffer/Standards/AbstractScopeSniff.php", + "CodeSniffer/Standards/AbstractVariableSniff.php", + "CodeSniffer/Standards/IncorrectPatternException.php", + "CodeSniffer/Standards/Generic/Sniffs/", + "CodeSniffer/Standards/MySource/Sniffs/", + "CodeSniffer/Standards/PEAR/Sniffs/", + "CodeSniffer/Standards/PSR1/Sniffs/", + "CodeSniffer/Standards/PSR2/Sniffs/", + "CodeSniffer/Standards/Squiz/Sniffs/", + "CodeSniffer/Standards/Zend/Sniffs/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -678,13 +696,13 @@ "role": "lead" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "homepage": "http://www.squizlabs.com/php-codesniffer", "keywords": [ "phpcs", "standards" ], - "time": "2018-07-26T23:47:18+00:00" + "time": "2014-12-04T22:32:15+00:00" }, { "name": "symfony/polyfill-ctype", @@ -746,7 +764,7 @@ }, { "name": "symfony/yaml", - "version": "v2.8.44", + "version": "v2.8.45", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", From 1a3e558e52300b8a4d2df759a328b5924c6d48ff Mon Sep 17 00:00:00 2001 From: Mac Bok Arimana Date: Sat, 22 Sep 2018 18:50:06 +0200 Subject: [PATCH 02/13] in Bash environment, String subsitutions are allowed --- .travis.yml | 2 +- .travis/configure | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f17f64b3f..15304182c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ addons: name: "b23prodtm/myphpcms" description: "This PHP CMS is featuring well-known functionalities as cool as posting some web contents with pictures stored in a database." notification_email: b23prodtm@users.sourceforge.net - build_command_prepend: sh --verbose .travis/configure + build_command_prepend: .travis/configure build_command: ./lib/Cake/Console/cake test core AllTests --stderr branch_pattern: coverity_scan services: diff --git a/.travis/configure b/.travis/configure index 83096bb9c..04cac4f43 100755 --- a/.travis/configure +++ b/.travis/configure @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash export PHPUNIT=3 export PHPCS=1 if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi From f750b7337033676bde109fc34531faac99bfd35b Mon Sep 17 00:00:00 2001 From: Mac Bok Arimana Date: Sat, 22 Sep 2018 20:10:27 +0200 Subject: [PATCH 03/13] Cache PHP Fatal error: Uncaught CacheException: Cache engine "_cake_core_" is not properly configured. Ensure required extensions are installed, and credentials/permissions are correct in /home/travis/build/b23prodtm/myphpcms/lib/Cake/Cache/Cache.php:186 --- .travis.yml | 9 ++++++--- .travis/configure | 18 ++++++++---------- app/Config/bootstrap.php | 3 +++ app/tmp/cache/models/Empty | 1 - app/tmp/cache/persistent/empty | 0 configure.sh | 32 +++++++++++++++++--------------- configure_tmp.sh | 7 +++++++ 7 files changed, 41 insertions(+), 29 deletions(-) create mode 100755 app/tmp/cache/persistent/empty create mode 100755 configure_tmp.sh diff --git a/.travis.yml b/.travis.yml index 15304182c..6906221f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,8 @@ php: - 5.6 - 7.0 +cache: + - app/tmp/cache/ env: matrix: - DB=mysql @@ -21,8 +23,9 @@ env: - secure: "4rmDT/vKTSi8AqI3afVUylayJ+SQbxblwlz/z81No4nLYWoy0dT61R/ZXq2Y29BE/HGEwx6r8Fl5RU6DxnmD7KhLC/3swHifzed690VDWyLii7cK8QkXVfLVVo8p+ozIwUrirnYFEkAcTfmkwJbmZN6DUuHJCl4x14NolR82VlJtFOVoWs63r+2NVJ5aM+63bkljkcW2U4xTt/8aOrCU/UapwqxC1GA0xPpwte6jPhzUjKXWbiknY+noUakM13x8SOkSRs3MTEf8J2va2T6DbVY3wy3x2Ytp4/KDwVNUrn/GKgBDRysP3jefO2d6XZJlb8OktJsrHdtWIZ+oYVwoy0PRV3vmdHs1NFUmYdQEe5UpiUKKyxWMsM+31to5ZUtJtn4kIlgzyo+xZu+LCgbOusJs33uPZODOON5fHcAoMp3AdAM0ResBfJdjzYEiewlcGYAcOoMX6DtopoJCoz+JxktdzXnjz89imNKMB2tjsRXuZMdE0WL3V2TSuOS5r8BwuuXXeul5vvE2EKHoIHgrP2nehz+q7dyC71m6jNrQX7x+xVg988vh0Fg8hyghLUzt9Myv4pvtQ/zQDbabKGtsakiHSvPTeHcb8mDhs62h5aIWUar8oXNuOWlk+hnyqZLmnbUPDcg54o567NursWYSWemAnPkPvSTfX0DQF1hDvSo=" before_install: -# Coverity Scan certificate (global secure: COVERITY_SCAN_TOKEN) -- echo -n | openssl s_client -connect https://scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- + # Coverity Scan certificate (global secure: COVERITY_SCAN_TOKEN) + - echo -n | openssl s_client -connect https://scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- + - ./configure_tmp.sh addons: coverity_scan: @@ -31,7 +34,7 @@ addons: description: "This PHP CMS is featuring well-known functionalities as cool as posting some web contents with pictures stored in a database." notification_email: b23prodtm@users.sourceforge.net build_command_prepend: .travis/configure - build_command: ./lib/Cake/Console/cake test core AllTests --stderr + build_command: if [ '${PHPCS}' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; else vendors/bin/phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi; branch_pattern: coverity_scan services: - memcached diff --git a/.travis/configure b/.travis/configure index 04cac4f43..49fc90990 100755 --- a/.travis/configure +++ b/.travis/configure @@ -1,21 +1,19 @@ #!/usr/bin/env bash -export PHPUNIT=3 -export PHPCS=1 if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi composer require --prefer-dist --update-with-dependencies --dev phpunit/phpunit ^${PHPUNIT} cakephp/cakephp-codesniffer ^${PHPCS} echo "require_once 'vendors/autoload.php';" >> app/Config/bootstrap.php sudo locale-gen de_DE sudo locale-gen es_ES -sh -c "if [ '${DB}' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi" -sh -c "if [ '${DB}' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi" -sh -c "if [ '${DB}' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test3;'; fi" -sh -c "if [ '${DB}' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi" -sh -c "if [ '${DB}' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi" -sh -c "if [ '${DB}' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi" +if [[ ${DB} == 'mysql' ]]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi +if [[ ${DB} == 'mysql' ]]; then mysql -e 'CREATE DATABASE cakephp_test2;'; fi +if [[ ${DB} == 'mysql' ]]; then mysql -e 'CREATE DATABASE cakephp_test3;'; fi +if [[ ${DB} == 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi +if [[ ${DB} == 'pgsql' ]]; then psql -c 'CREATE SCHEMA test2;' -U postgres -d cakephp_test; fi +if [[ ${DB} == 'pgsql' ]]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi chmod -R 777 ./app/tmp if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]] ; then pecl install timezonedb ; fi -sh -c "if [ '${PHPCS}' = '1' ]; then composer require 'cakephp/cakephp-codesniffer:1.*'; fi" -sh -c "if [ '${PHPCS}' = '1' ]; then vendors/bin/phpcs --config-set installed_paths vendors/cakephp/cakephp-codesniffer; fi" +if [[ ${PHPCS} == '1' ]]; then composer require 'cakephp/cakephp-codesniffer:1.*'; fi +if [[ ${PHPCS} == '1' ]]; then vendors/bin/phpcs --config-set installed_paths vendors/cakephp/cakephp-codesniffer; fi echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]] ; then echo "yes" | pecl install apcu-5.1.3 || true; fi if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" ]] ; then echo "yes" | pecl install apcu-4.0.11 || true; fi diff --git a/app/Config/bootstrap.php b/app/Config/bootstrap.php index 086db032f..1b800e6ea 100755 --- a/app/Config/bootstrap.php +++ b/app/Config/bootstrap.php @@ -121,3 +121,6 @@ CakePlugin::load(array('Markdown' => array('bootstrap' => true)));require_once 'vendors/autoload.php'; require_once 'vendors/autoload.php'; require_once 'vendors/autoload.php'; +require_once 'vendors/autoload.php'; +require_once 'vendors/autoload.php'; +require_once 'vendors/autoload.php'; diff --git a/app/tmp/cache/models/Empty b/app/tmp/cache/models/Empty index 8b1378917..e69de29bb 100755 --- a/app/tmp/cache/models/Empty +++ b/app/tmp/cache/models/Empty @@ -1 +0,0 @@ - diff --git a/app/tmp/cache/persistent/empty b/app/tmp/cache/persistent/empty new file mode 100755 index 000000000..e69de29bb diff --git a/configure.sh b/configure.sh index 94851e159..768657b30 100755 --- a/configure.sh +++ b/configure.sh @@ -7,7 +7,9 @@ green="\033[0;32m" orange="\033[0;33m" cyan="\033[0;36m" -#; arguments are ./configure.sh -Y|-N [-p password -s salt -f filename] +echo "${green}Fixing some file permissions...${nc}" +/bin/sh ./configure_tmp.sh +#; arguments are ./configure.sh -Y|-N [-p password -s salt -f filename] #; if the full set of the arguments exists, there won't be any prompt in the shell cd app/webroot/php-cms/e13/etc/ copies=0 @@ -19,7 +21,7 @@ do case $answer in -[yY]* ) echo "Yes.\n" answer="Y";; - + -[nN]* ) echo "No.\n" break;; @@ -32,7 +34,7 @@ do done # (2) handle the input we were given case $answer in - [yY]* ) + [yY]* ) cp -v constantes.properties constantes.properties.old-$copies cp -v constantes_template.properties constantes.properties echo "Okay, just ran the shell script. Please, review the files.\n" @@ -55,7 +57,7 @@ do case $answer in -[yY]* ) echo "Yes.\n" answer="Y";; - + -[nN]* ) echo "No.\n" break;; @@ -63,12 +65,12 @@ do read -p "Run reset password script now (Y/N) ? " answer;; esac case $answer in - [yY]* ) + [yY]* ) case $pass in -[pP]* ) pass=$3;; * ) - while true + while true do read -sp "Please enter a password :" pass echo "\n" @@ -80,19 +82,19 @@ do echo "${red}Passwords don't match.\n${nc}" fi done;; - esac + esac # read salt if not set as $5 argv case $salt in -[sS]* ) salt=$5;; * ) - while [ "$salt" == "" ] + while [ "$salt" == "" ] do - read -p "Please enter the salt word :" salt + read -p "Please enter the salt word :" salt done;; - esac + esac - hash_file="export_hash_password.sh" + hash_file="export_hash_password.sh" php -f getHashPassword.php -- -p $pass -s $salt -f $hash_file #; so that the shell can execute export file chmod 777 $hash_file @@ -106,7 +108,7 @@ done cd ../../../../../ # Know-How : In Openshift 3, configure a CakePhp-Mysql-persistent docker image. Set automatic deployment with _100%_ unavailability -# while deploying and _0_ surge pod in deployment advanced edit configuration tab. +# while deploying and _0_ surge pod in deployment advanced edit configuration tab. # If it starts a build, it automatically scales deployments down to zero, and deploys and scales up when it's finished to build. # Be sure that lib/Cake/Console/cake test app and Health checks should return gracefullly, or the pods get terminated after a short time. @@ -116,16 +118,16 @@ do answer=$1 case $answer in -[yY]* ) echo "Yes.\n" - answer="Y";; + answer="Y";; -[nN]* ) echo "No.\n" break;; * ) read -p "Run migrate database script now (Y/N) ? " answer;; esac - + case $answer in - [yY]* ) /bin/sh migrate-database.sh -y -y -y + [yY]* ) /bin/sh ./migrate-database.sh -y -y -y break;; [nN]* ) break;; * ) echo "${red}Dude, just enter Y or N, please.\n${nc}";; diff --git a/configure_tmp.sh b/configure_tmp.sh new file mode 100755 index 000000000..49c279a39 --- /dev/null +++ b/configure_tmp.sh @@ -0,0 +1,7 @@ +#!/bin/sh +mkdir -p app/tmp/cache/persistent +mkdir -p app/tmp/cache/models +mkdir -p app/tmp/tests +mkdir -p app/tmp/logs +touch app/tmp/logs/error.log +chmod -R a+rwx app/tmp From d2c97a226e3b24a43274800ab5b0ee2c964bbcc7 Mon Sep 17 00:00:00 2001 From: Mac Bok Arimana Date: Sat, 22 Sep 2018 21:33:49 +0200 Subject: [PATCH 04/13] default bootstrap --- app/Config/bootstrap.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/Config/bootstrap.php b/app/Config/bootstrap.php index 1b800e6ea..5884d0987 100755 --- a/app/Config/bootstrap.php +++ b/app/Config/bootstrap.php @@ -118,9 +118,4 @@ /** * Load Markdown Plugin */ -CakePlugin::load(array('Markdown' => array('bootstrap' => true)));require_once 'vendors/autoload.php'; -require_once 'vendors/autoload.php'; -require_once 'vendors/autoload.php'; -require_once 'vendors/autoload.php'; -require_once 'vendors/autoload.php'; -require_once 'vendors/autoload.php'; +CakePlugin::load(array('Markdown' => array('bootstrap' => true))); From 488bfd3017c4a878d7bc9d02fca26aa9ba970b41 Mon Sep 17 00:00:00 2001 From: Tiana Rakoto Arimanana <5566338+b23prodtm@users.noreply.github.com> Date: Sun, 23 Sep 2018 16:25:03 +0200 Subject: [PATCH 05/13] Update .travis.yml --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6906221f0..100dbd5a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,8 @@ env: matrix: - DB=mysql global: + - PHPUNIT=3 + - PHPCS=1 # The next declaration is the encrypted OC_SECRET, created # via the "travis encrypt" command using the project repo's public key - secure: "O+HejqZgXZFf0eD3GdvUwL2dsJsW+5biztfWYKHNfzv5u9j6Nn8JSoLdIp+Bg6Kct6kCJebM7oWHCh1fhyEm3AluusmqKHN8VKwQuINEZKAxPRFGl3NKkEU/Y95tHR3JIubZbZ0oZYmnl7z+YgVvM4LvmfvAwdpXzRt4SWOzGRWiL8uRaovOwW10HUB6qcO70Rn9XIHz4gUAoAEWQgSlJ4aNftu/lpuYs4P1r0+6fI/nfRRBMOogBQLEMqw6enPP+RrWx2pLwuxaQqChtk2td5PJdLiifW7C8SiAsljSgIRiaytAOgIs5KJsLGUdAPNXIMqUYFJ776J3L+ln8/nM/H8ARGB2P3smY5HM34/NrzUat2X/B6Uqg1F0Fs/794aomhaeqgh4b2MRI5srjQ/grNK61H1AftdR6JSLVjm6AUg743GQJF7sgNfK60n28EEZApAEzDS0v1PyU7U/HAZIalqWnttO0ycQyj2rf1XC++6BuTcRdmxx4dZoqZIn7xHzBQvi99ljv4JuwUgrNYXvcSEkXu6Y5GqMl2rtjxrdaGATpePuk1ju1kfB/7fQsR3ZZOaxULOSlQRcArsyseOtmEqQ1h5BVSmOGV+yoEboNm2FDZH/gD9ZZ7kTi+bk4bvHRZSD06JiDZ12W/JGsmU77phVIIWuUcXghEZf/WRjTe4=" From 96ebb60544b0f42d5fce86e28073710a7b52d10b Mon Sep 17 00:00:00 2001 From: Tiana Rakoto Arimanana <5566338+b23prodtm@users.noreply.github.com> Date: Sun, 23 Sep 2018 16:44:40 +0200 Subject: [PATCH 06/13] Update configure --- .travis/configure | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis/configure b/.travis/configure index 49fc90990..97c9d3a00 100755 --- a/.travis/configure +++ b/.travis/configure @@ -1,4 +1,5 @@ #!/usr/bin/env bash +./configure.sh -Y -Y -N if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi composer require --prefer-dist --update-with-dependencies --dev phpunit/phpunit ^${PHPUNIT} cakephp/cakephp-codesniffer ^${PHPCS} echo "require_once 'vendors/autoload.php';" >> app/Config/bootstrap.php From fbe1fd98a31225d1f9dcae7310180e1af5ce938c Mon Sep 17 00:00:00 2001 From: Tiana Rakoto Arimanana <5566338+b23prodtm@users.noreply.github.com> Date: Sun, 23 Sep 2018 16:48:51 +0200 Subject: [PATCH 07/13] Update configure --- .travis/configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/configure b/.travis/configure index 97c9d3a00..bbff2b02b 100755 --- a/.travis/configure +++ b/.travis/configure @@ -1,5 +1,5 @@ #!/usr/bin/env bash -./configure.sh -Y -Y -N +./configure.sh -Y -N -N if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi composer require --prefer-dist --update-with-dependencies --dev phpunit/phpunit ^${PHPUNIT} cakephp/cakephp-codesniffer ^${PHPCS} echo "require_once 'vendors/autoload.php';" >> app/Config/bootstrap.php From 97119120278e0250877485f69f1a574b2d448f53 Mon Sep 17 00:00:00 2001 From: Tiana Rakoto Arimanana <5566338+b23prodtm@users.noreply.github.com> Date: Sun, 23 Sep 2018 16:51:30 +0200 Subject: [PATCH 08/13] Update configure --- .travis/configure | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis/configure b/.travis/configure index bbff2b02b..fb9e612ef 100755 --- a/.travis/configure +++ b/.travis/configure @@ -1,5 +1,6 @@ #!/usr/bin/env bash ./configure.sh -Y -N -N +./composer.sh if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi composer require --prefer-dist --update-with-dependencies --dev phpunit/phpunit ^${PHPUNIT} cakephp/cakephp-codesniffer ^${PHPCS} echo "require_once 'vendors/autoload.php';" >> app/Config/bootstrap.php From bcbc558be05f43191a07162a1c5cfebe8fc021e3 Mon Sep 17 00:00:00 2001 From: Tiana Rakoto Arimanana <5566338+b23prodtm@users.noreply.github.com> Date: Sun, 23 Sep 2018 16:51:52 +0200 Subject: [PATCH 09/13] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 100dbd5a3..6a537987f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ env: - DB=mysql global: - PHPUNIT=3 - - PHPCS=1 + - PHPCS=3 # The next declaration is the encrypted OC_SECRET, created # via the "travis encrypt" command using the project repo's public key - secure: "O+HejqZgXZFf0eD3GdvUwL2dsJsW+5biztfWYKHNfzv5u9j6Nn8JSoLdIp+Bg6Kct6kCJebM7oWHCh1fhyEm3AluusmqKHN8VKwQuINEZKAxPRFGl3NKkEU/Y95tHR3JIubZbZ0oZYmnl7z+YgVvM4LvmfvAwdpXzRt4SWOzGRWiL8uRaovOwW10HUB6qcO70Rn9XIHz4gUAoAEWQgSlJ4aNftu/lpuYs4P1r0+6fI/nfRRBMOogBQLEMqw6enPP+RrWx2pLwuxaQqChtk2td5PJdLiifW7C8SiAsljSgIRiaytAOgIs5KJsLGUdAPNXIMqUYFJ776J3L+ln8/nM/H8ARGB2P3smY5HM34/NrzUat2X/B6Uqg1F0Fs/794aomhaeqgh4b2MRI5srjQ/grNK61H1AftdR6JSLVjm6AUg743GQJF7sgNfK60n28EEZApAEzDS0v1PyU7U/HAZIalqWnttO0ycQyj2rf1XC++6BuTcRdmxx4dZoqZIn7xHzBQvi99ljv4JuwUgrNYXvcSEkXu6Y5GqMl2rtjxrdaGATpePuk1ju1kfB/7fQsR3ZZOaxULOSlQRcArsyseOtmEqQ1h5BVSmOGV+yoEboNm2FDZH/gD9ZZ7kTi+bk4bvHRZSD06JiDZ12W/JGsmU77phVIIWuUcXghEZf/WRjTe4=" From 365824b3c3af83c6f0ecd9d43fdb8a01759d2da7 Mon Sep 17 00:00:00 2001 From: Tiana Rakoto Arimanana <5566338+b23prodtm@users.noreply.github.com> Date: Sun, 23 Sep 2018 16:56:37 +0200 Subject: [PATCH 10/13] Update configure --- .travis/configure | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis/configure b/.travis/configure index fb9e612ef..af7fed99e 100755 --- a/.travis/configure +++ b/.travis/configure @@ -1,5 +1,4 @@ #!/usr/bin/env bash -./configure.sh -Y -N -N ./composer.sh if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi composer require --prefer-dist --update-with-dependencies --dev phpunit/phpunit ^${PHPUNIT} cakephp/cakephp-codesniffer ^${PHPCS} From e96b70c2b5aa9ad8a1a1c7651750d9668a6c18f2 Mon Sep 17 00:00:00 2001 From: Tiana Rakoto Arimanana <5566338+b23prodtm@users.noreply.github.com> Date: Sun, 23 Sep 2018 18:04:45 +0200 Subject: [PATCH 11/13] Update configure --- .travis/configure | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis/configure b/.travis/configure index af7fed99e..49fc90990 100755 --- a/.travis/configure +++ b/.travis/configure @@ -1,5 +1,4 @@ #!/usr/bin/env bash -./composer.sh if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi composer require --prefer-dist --update-with-dependencies --dev phpunit/phpunit ^${PHPUNIT} cakephp/cakephp-codesniffer ^${PHPCS} echo "require_once 'vendors/autoload.php';" >> app/Config/bootstrap.php From 1c9f07c82d923eb6ca3aca2c665ce8b7100d14e1 Mon Sep 17 00:00:00 2001 From: b23production GNU Date: Sun, 23 Sep 2018 19:11:58 +0200 Subject: [PATCH 12/13] Require markdown composer markdown dev-master --- .gitignore | 1 + .travis/configure | 1 - README.md | 2 + app/Config/bootstrap.php | 2 +- app/Plugin/Markdown | 2 +- composer.json | 4 +- composer.lock | 102 +++++++++++++++++---------------------- 7 files changed, 50 insertions(+), 64 deletions(-) diff --git a/.gitignore b/.gitignore index 272c42c35..58ac88593 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /lib/Cake/Console/Templates/skel/tmp/ /plugins /vendors +!/vendors/autoload.php /build /dist /tags diff --git a/.travis/configure b/.travis/configure index 49fc90990..fa250e525 100755 --- a/.travis/configure +++ b/.travis/configure @@ -1,7 +1,6 @@ #!/usr/bin/env bash if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]] ; then pear config-set preferred_state snapshot && yes "" | pecl install mcrypt ; fi composer require --prefer-dist --update-with-dependencies --dev phpunit/phpunit ^${PHPUNIT} cakephp/cakephp-codesniffer ^${PHPCS} -echo "require_once 'vendors/autoload.php';" >> app/Config/bootstrap.php sudo locale-gen de_DE sudo locale-gen es_ES if [[ ${DB} == 'mysql' ]]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi diff --git a/README.md b/README.md index 5e54378c6..9b57a017c 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ However, if these files exist they will affect the behavior of the build process List of dependencies to be installed with `composer`. The format is documented [here](https://getcomposer.org/doc/04-schema.md). + Plugins are registered in both _git submodule_ and _composer.json_. To allow a plugin to accept ```composer update```, edit _composer.json_ according to the available released tags. In the plugin's home repository (app/Plugin//), call```git tag``` or ``git log``` for more information. + >_DEVELOPER TIP:_ To push tags : ```git tag` && git push --tags```. ### Compatibility diff --git a/app/Config/bootstrap.php b/app/Config/bootstrap.php index c83a0bcf9..5884d0987 100755 --- a/app/Config/bootstrap.php +++ b/app/Config/bootstrap.php @@ -118,4 +118,4 @@ /** * Load Markdown Plugin */ -CakePlugin::load(array('Markdown' => array('bootstrap' => true))); \ No newline at end of file +CakePlugin::load(array('Markdown' => array('bootstrap' => true))); diff --git a/app/Plugin/Markdown b/app/Plugin/Markdown index 411862a01..1bdffb902 160000 --- a/app/Plugin/Markdown +++ b/app/Plugin/Markdown @@ -1 +1 @@ -Subproject commit 411862a013c380642e7a458940fa13a6dc7d0d6e +Subproject commit 1bdffb9024bbcfbcb3e99397dedc1c7dbfa1ac26 diff --git a/composer.json b/composer.json index bc621ad05..738e1fbaf 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ }, "require": { "php": ">=5.3.0", - "b23prodtm/markdown-plugin": ">=0.9" + "b23prodtm/markdown-plugin": "master@dev" }, "suggest": { "ext-openssl": "You need to install ext-openssl or ext-mcrypt to use AES-256 encryption", @@ -26,7 +26,7 @@ }, "require-dev": { "phpunit/phpunit": "^3", - "cakephp/cakephp-codesniffer": "^1" + "cakephp/cakephp-codesniffer": "^3" }, "extra": { "installer-paths": { diff --git a/composer.lock b/composer.lock index e7bed30d6..787098879 100644 --- a/composer.lock +++ b/composer.lock @@ -1,23 +1,23 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "a9a23707520e84e8e32877f96bb4cb5e", + "content-hash": "04e9640d9cad3c92059819fc6b938ca4", "packages": [ { "name": "b23prodtm/markdown-plugin", - "version": "0.9", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/b23prodtm/markdown-plugin.git", - "reference": "411862a013c380642e7a458940fa13a6dc7d0d6e" + "reference": "1bdffb9024bbcfbcb3e99397dedc1c7dbfa1ac26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/b23prodtm/markdown-plugin/zipball/411862a013c380642e7a458940fa13a6dc7d0d6e", - "reference": "411862a013c380642e7a458940fa13a6dc7d0d6e", + "url": "https://api.github.com/repos/b23prodtm/markdown-plugin/zipball/1bdffb9024bbcfbcb3e99397dedc1c7dbfa1ac26", + "reference": "1bdffb9024bbcfbcb3e99397dedc1c7dbfa1ac26", "shasum": "" }, "require": { @@ -50,20 +50,20 @@ "markdown", "plugin" ], - "time": "2018-08-16T16:54:29+00:00" + "time": "2018-09-23T18:28:49+00:00" }, { "name": "composer/installers", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "049797d727261bf27f2690430d935067710049c2" + "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/049797d727261bf27f2690430d935067710049c2", - "reference": "049797d727261bf27f2690430d935067710049c2", + "url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b", "shasum": "" }, "require": { @@ -170,7 +170,7 @@ "zend", "zikula" ], - "time": "2017-12-29T09:13:20+00:00" + "time": "2018-08-27T06:10:37+00:00" }, { "name": "michelf/php-markdown", @@ -222,25 +222,31 @@ "packages-dev": [ { "name": "cakephp/cakephp-codesniffer", - "version": "1.0.4", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/cakephp/cakephp-codesniffer.git", - "reference": "0f3559af72fd9c2bba7310a7c4496fbb97502352" + "reference": "7f467fee00fd016b62cf8c85a57750ab2a895e81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/0f3559af72fd9c2bba7310a7c4496fbb97502352", - "reference": "0f3559af72fd9c2bba7310a7c4496fbb97502352", + "url": "https://api.github.com/repos/cakephp/cakephp-codesniffer/zipball/7f467fee00fd016b62cf8c85a57750ab2a895e81", + "reference": "7f467fee00fd016b62cf8c85a57750ab2a895e81", "shasum": "" }, "require": { - "squizlabs/php_codesniffer": "^1.4.0" + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.0.0" }, "require-dev": { - "phpunit/phpunit": "^4.1.0" + "phpunit/phpunit": "<6.0" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "CakePHP\\": "CakePHP" + } }, - "type": "library", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -257,7 +263,7 @@ "codesniffer", "framework" ], - "time": "2018-07-04T15:25:21+00:00" + "time": "2018-06-09T16:01:01+00:00" }, { "name": "phpunit/php-code-coverage", @@ -631,61 +637,37 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "1.5.6", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5" + "reference": "628a481780561150481a9ec74709092b9759b3ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6f3e42d311b882b25b4d409d23a289f4d3b803d5", - "reference": "6f3e42d311b882b25b4d409d23a289f4d3b803d5", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/628a481780561150481a9ec74709092b9759b3ec", + "reference": "628a481780561150481a9ec74709092b9759b3ec", "shasum": "" }, "require": { + "ext-simplexml": "*", "ext-tokenizer": "*", - "php": ">=5.1.2" + "ext-xmlwriter": "*", + "php": ">=5.4.0" }, - "suggest": { - "phpunit/php-timer": "dev-master" + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ - "scripts/phpcs" + "bin/phpcs", + "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { - "dev-phpcs-fixer": "2.0.x-dev" + "dev-master": "3.x-dev" } }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/CommentParser/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -696,13 +678,13 @@ "role": "lead" } ], - "description": "PHP_CodeSniffer tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "homepage": "http://www.squizlabs.com/php-codesniffer", "keywords": [ "phpcs", "standards" ], - "time": "2014-12-04T22:32:15+00:00" + "time": "2018-07-26T23:47:18+00:00" }, { "name": "symfony/polyfill-ctype", @@ -815,7 +797,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "b23prodtm/markdown-plugin": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { From 67814bf2b5882da5deb4dd869c9a37072fb1485e Mon Sep 17 00:00:00 2001 From: b23production GNU Date: Sun, 23 Sep 2018 21:30:15 +0200 Subject: [PATCH 13/13] Plug --- app/Plugin/Markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Plugin/Markdown b/app/Plugin/Markdown index 1bdffb902..d3c8cd591 160000 --- a/app/Plugin/Markdown +++ b/app/Plugin/Markdown @@ -1 +1 @@ -Subproject commit 1bdffb9024bbcfbcb3e99397dedc1c7dbfa1ac26 +Subproject commit d3c8cd5916aec390a7289feb5f9570de71ac4ea8