Changeset 699
- Timestamp:
- Aug 8, 2019 10:38:24 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/init_codebase_tables.cli.php
r601 r699 172 172 // DBSessionHandler! 173 173 174 // We need to hack the app to allow sessions to run in a CLI. 175 $app->stop(); 176 $app->cli = false; 177 $app->setParam(array('enable_session' => true)); 178 $app->start(); 174 if (version_compare(PHP_VERSION, '7.0.0', '<')) { 175 // We need to hack the app to allow sessions to run in a CLI. 176 $app->stop(); 177 $app->cli = false; 178 $app->setParam(array('enable_session' => true)); 179 $app->start(); 180 } 179 181 180 182 if (!isset($opt['c'])) { -
trunk/composer.json
r516 r699 13 13 ], 14 14 "require": { 15 "php": " ^5.3.7"15 "php": ">=5.6 <=7.3" 16 16 }, 17 17 "require-dev": { -
trunk/docs/version.txt
r686 r699 1 2. 2.51 2.3.0 -
trunk/lib/App.inc.php
r693 r699 455 455 // Only create a legacy mysql_* DB object if it is explicitly requested. 456 456 if (true === $this->getParam('enable_db')) { 457 require_once dirname(__FILE__) . '/../polyfill/mysql.inc.php'; 457 458 require_once dirname(__FILE__) . '/DB.inc.php'; 458 459 $this->db =& DB::getInstance(); … … 648 649 $this->running = false; 649 650 $num_queries = 0; 650 if (is_a($this->db, 'DB') && true === $this->getParam('enable_db')) { 651 $num_queries = $this->db->numQueries(); 651 if ($this->db instanceof \DB && true === $this->getParam('enable_db')) { 652 $num_queries += $this->db->numQueries(); 653 if ($num_queries > 0 && true === $this->getParam('enable_db_pdo')) { 654 // If the app wants to use PDO, warn if any legacy db queries are made. 655 $this->logMsg(sprintf('%s queries using legacy DB functions', $num_queries), LOG_WARNING, __FILE__, __LINE__); 656 } 652 657 $this->db->close(); 658 } 659 if ($this->pdo instanceof \Strangecode\Codebase\PDO && (true === $this->getParam('enable_db') || true === $this->getParam('enable_db_pdo'))) { 660 $num_queries += $this->pdo->numQueries(); 661 $this->pdo->close(); 653 662 } 654 663 $mem_current = memory_get_usage();
Note: See TracChangeset
for help on using the changeset viewer.