Skip to content

Commit

Permalink
Merge pull request #1034 from takeit/master
Browse files Browse the repository at this point in the history
bugfixes and improvements
  • Loading branch information
Paweł Mikołajczuk committed Mar 19, 2015
2 parents 37de5d9 + 59e37d1 commit 5b0f8a3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ before_script:
- cd newscoop/
- composer self-update
- composer install --prefer-dist
- "./application/console newscoop:install --fix --database_name newscoop --database_user root"
- "./application/console newscoop:install --fix --database_name newscoop --database_user root --no-client"
- sudo php upgrade.php
- "./application/console oauth:create-client testclient newscoop.dev newscoop.dev --test"
- "./application/console user:create test@example.org testpassword testuser 'Test Name' 'Test Surname' true 1 1"
Expand Down
2 changes: 1 addition & 1 deletion newscoop/extensions/sourcefabric/SourcefabricDevFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class SourcefabricDevFeed extends FeedWidget
{
protected $title = 'Sourcefabric.org blog reader';

protected $url = 'http://www.sourcefabric.org/en/about/rss_blogs';
protected $url = 'http://feeds.feedburner.com/sourcefabric';

/**
* @setting
Expand Down
2 changes: 1 addition & 1 deletion newscoop/extensions/sourcefabric/SourcefabricFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class SourcefabricFeed extends FeedWidget
{
protected $title = 'Sourcefabric.org News reader';

protected $url = 'http://www.sourcefabric.org/en/about/rss_news';
protected $url = 'http://feeds.feedburner.com/sourcefabric';

/**
* @setting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@
continue;
}

//create root Topic object
$topic = new Topic();
$topic->setId($topicDetails[0]['id']);
$topic->setTitle($topicDetails[0]['name']);
$language = $app['orm.em']->getReference("Newscoop\Entity\Language", $topicDetails[0]['languageId']);
$locale = $language->getCode();

try {
//create root Topic object
$topic = new Topic();
$topic->setId($topicDetails[0]['id']);
$topic->setTitle($topicDetails[0]['name']);
$language = $app['orm.em']->getReference("Newscoop\Entity\Language", $topicDetails[0]['languageId']);
$locale = $language->getCode();

$app['topics_service']->saveNewTopic($topic, $locale, true);
// loop for each translations and add not added translations
// if topic has more translations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @copyright 2014 Sourcefabric o.p.s.
* @license http://www.gnu.org/licenses/gpl-3.0.txt
*/

namespace Newscoop\Tools\Console\Command;

use Symfony\Component\Console;
Expand Down Expand Up @@ -41,6 +40,7 @@ protected function configure()
->addOption('database_password', null, InputOption::VALUE_REQUIRED, 'Database password')
->addOption('database_server_port', null, InputOption::VALUE_OPTIONAL, 'Database server port', '3306')
->addOption('database_override', null, InputOption::VALUE_NONE, 'Override existing database')
->addOption('no-client', null, InputOption::VALUE_NONE, 'Don not create OAuth default client')
->addArgument('site_title', InputArgument::OPTIONAL, 'Publication name', 'Newscoop publication')
->addArgument('user_email', InputArgument::OPTIONAL, 'Admin email', 'admin@newscoop.dev')
->addArgument('user_password', InputArgument::OPTIONAL, 'Admin user password', 'password');
Expand Down Expand Up @@ -76,7 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

return;
} elseif (count($missingReq) > 0 && $fixCommonIssues) {
$newscoopDir = realpath(__DIR__ . '/../../../../../');
$newscoopDir = realpath(__DIR__.'/../../../../../');
// set chmods for directories
exec('chmod -R 777 '.$newscoopDir.'/cache/');
exec('chmod -R 777 '.$newscoopDir.'/log/');
Expand Down Expand Up @@ -129,13 +129,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
$databaseService->loadGeoData($connection);
$databaseService->saveDatabaseConfiguration($connection);
} else {
throw new \Exception('There is already a database named ' . $connection->getDatabase() . '. If you are sure to overwrite it, use option --database_override. If not, just change the Database Name and continue.', 1);
throw new \Exception('There is already a database named '.$connection->getDatabase().'. If you are sure to overwrite it, use option --database_override. If not, just change the Database Name and continue.', 1);
}

$command = $this->getApplication()->find('cache:clear');
$arguments = array(
'command' => 'cache:clear',
'--no-warmup' => true
'--no-warmup' => true,
);

$inputCache = new ArrayInput($arguments);
Expand All @@ -155,9 +155,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
$finishService->saveInstanceConfig(array(
'site_title' => $input->getArgument('site_title'),
'user_email' => $input->getArgument('user_email'),
'recheck_user_password' => $input->getArgument('user_password')
'recheck_user_password' => $input->getArgument('user_password'),
), $connection);
$output->writeln('<info>Config have been saved successfully.<info>');
if (!$input->getOption('no-client')) {
$finishService->createDefaultOauthClient($input->getArgument('alias'));
$output->writeln('<info>Default OAuth client has been created successfully.<info>');
}

$output->writeln('<info>Newscoop is installed.<info>');
}
}

0 comments on commit 5b0f8a3

Please sign in to comment.