diff --git a/Changelog b/Changelog index fb5043d0a..12b985091 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2016-04-25 DariusIII + * Upd: Update scripts 2016-04-25 DariusIII * Upd: Update composer files, remove extra not needed scripts, update Gentele and baseadminpage * Fix: Add missing files to shared folder for admin theme diff --git a/app/extensions/command/Update.php b/app/extensions/command/Update.php index d5636aa9e..0b0c0119c 100644 --- a/app/extensions/command/Update.php +++ b/app/extensions/command/Update.php @@ -29,14 +29,14 @@ use \newznab\db\DbUpdate; /** * Update various aspects of your indexer. - + * * Actions: - * * all|nntmux Fetches current git repo, composer dependencies, and update latest Db patches. + * * all|nzedb Fetches current git repo, composer dependencies, and update latest Db patches. * * db Update the Db with any patches not yet applied. * * git Performs git pull. - -* -*@package app\extensions\command + * * predb Fetch and import TSV files into the predb table. + * + *@package app\extensions\command */ class Update extends \app\extensions\console\Command { @@ -119,6 +119,14 @@ class Update extends \app\extensions\console\Command } } + /** + * Import/Update the predb table using tab separated value files. + */ + public function predb() + { + $this->error('predb not available yet!'); + } + public function run($command = null) { if (!$command || !$this->request->args()) { @@ -138,6 +146,12 @@ class Update extends \app\extensions\console\Command return false; } + /** + * Issues the command to 'install' the composer package. + * + * It first checks the current branch for stable versions. If found then the '--no-dev' + * option is added to the command to prevent development packages being also downloded. + */ protected function composer() { $this->initialiseGit(); diff --git a/app/extensions/command/Version.php b/app/extensions/command/Version.php index d97a23504..5e9d7701e 100644 --- a/app/extensions/command/Version.php +++ b/app/extensions/command/Version.php @@ -85,8 +85,9 @@ class Version extends \app\extensions\console\Command if (!$this->plain) { $this->primary('Looking up Git tag version(s)'); } - $this->out("XML version: " . $this->versions->getGitTagFromFile()); - $this->out("Git version: " . $this->versions->getGitTagFromRepo()); + $this->out('Hash: ' . $this->versions->getGitHeadHash(), 0); + $this->out('XML version: ' . $this->versions->getGitTagFromFile()); + $this->out('Git version: ' . $this->versions->getGitTagFromRepo()); } /** diff --git a/app/extensions/util/Git.php b/app/extensions/util/Git.php index fc9ee800d..99a0e1fb5 100644 --- a/app/extensions/util/Git.php +++ b/app/extensions/util/Git.php @@ -88,6 +88,11 @@ class Git extends \lithium\core\Object return $this->_config['branches']['stable']; } + public function getHeadHash() + { + return $this->run('rev-parse HEAD'); + } + /** * Determine if the supplied object is commited to the repository or not. * diff --git a/app/extensions/util/Versions.php b/app/extensions/util/Versions.php index 074986c88..922835971 100644 --- a/app/extensions/util/Versions.php +++ b/app/extensions/util/Versions.php @@ -42,6 +42,12 @@ class Versions extends \lithium\core\Object parent::__construct($config += $defaults); } + public function getGitHeadHash() + { + $this->initialiseGit(); + return $this->git->getHeadHash(); + } + public function getGitTagFromFile() { $this->loadXMLFile(); diff --git a/misc/testing/_run_once/tpg_add_collections_column_2015-02-20.php b/misc/testing/_run_once/tpg_add_collections_column_2015-02-20.php index 1739d76b7..6503e5576 100644 --- a/misc/testing/_run_once/tpg_add_collections_column_2015-02-20.php +++ b/misc/testing/_run_once/tpg_add_collections_column_2015-02-20.php @@ -18,7 +18,7 @@ * @author niel * @copyright 2014 nZEDb */ -require_once dirname(__FILE__) . '/../../../www/config.php'; +require_once dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php'; use newznab\db\Settings; diff --git a/misc/testing/_run_once/tpg_delete_triggers_2015-08-14.php b/misc/testing/_run_once/tpg_delete_triggers_2015-08-14.php index dbfdda979..10e7e3478 100644 --- a/misc/testing/_run_once/tpg_delete_triggers_2015-08-14.php +++ b/misc/testing/_run_once/tpg_delete_triggers_2015-08-14.php @@ -18,7 +18,7 @@ * @author niel * @copyright 2014 nZEDb */ -require_once dirname(__FILE__) . '/../../../www/config.php'; +require_once dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php'; use newznab\db\Settings; @@ -41,4 +41,4 @@ if ($tables instanceof \Traversable) { echo 'All done!' . PHP_EOL; } -?> \ No newline at end of file +?> diff --git a/misc/testing/_run_once/tpg_fixes.php b/misc/testing/_run_once/tpg_fixes.php index 64c21fe93..4346527d2 100644 --- a/misc/testing/_run_once/tpg_fixes.php +++ b/misc/testing/_run_once/tpg_fixes.php @@ -25,8 +25,7 @@ if (!isset($argv[1]) || !in_array($argv[1], ['1'])) { '1: 2014-07-28: Add unique key to binaryhash to be able to do multiple updates in 1 statement.' . PHP_EOL ); } - -require_once dirname(__FILE__) . '/../../../www/config.php'; +require_once dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php'; use newznab\db\Settings; diff --git a/misc/testing/_run_once/tpg_update_triggers_2014-09-25.php b/misc/testing/_run_once/tpg_update_triggers_2014-09-25.php index 3bbed9a0d..f7ea2d210 100644 --- a/misc/testing/_run_once/tpg_update_triggers_2014-09-25.php +++ b/misc/testing/_run_once/tpg_update_triggers_2014-09-25.php @@ -18,7 +18,7 @@ * @author niel * @copyright 2014 nZEDb */ -require_once dirname(__FILE__) . '/../../../www/config.php'; +require_once dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php'; use newznab\db\Settings;