Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the remains of kohana #1841

Merged
merged 20 commits into from
Jan 25, 2018
Merged

Remove the remains of kohana #1841

merged 20 commits into from
Jan 25, 2018

Conversation

rjmackay
Copy link
Contributor

@rjmackay rjmackay commented Jul 3, 2017

This pull request makes the following changes:

  • Stop bootstrapping Kohana
  • Remove all kohana related composer deps
  • Update Media to work without kohana media

Test checklist:

  • bin/behat

Refs #1372

Ping @ushahidi/platform

@rjmackay rjmackay force-pushed the lumen-remove-kohana branch 2 times, most recently from 02c1eaa to 844768e Compare July 3, 2017 03:41
@rjmackay rjmackay changed the title Lumen remove kohana Lumen remove kohana [WIP] Jul 4, 2017
Copy link
Contributor

@willdoran willdoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking cool


public function send($to, $type, Array $params = null)
{
$method = "send" . Str::ucfirst($type);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add a comment about available types?

}
}

protected function sendResetpassword($to, $params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end, are we going to have subclass of this for Notifications, Reset etc or will they just live as function within?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure yet. I suspect we might want to replace it entirely with something much closer to Laravel's Mailables

composer.json Outdated
"barryvdh/laravel-cors": "^0.9.2"
"barryvdh/laravel-cors": "^0.9.2",
"illuminate/mail": "5.4.*",
"mockery/mockery": "^0.9.9"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great name for a mock lib :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only it didn't break everything!

config/mail.php Outdated
|
*/

'from' => ['address' => env('MAIL_ADDRESS'), 'name' => env('MAIL_NAME')],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these derive from the email used to sign up to cloud?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in this instance, in the mailer they load from the site name + site email set in settings.

}

// Set new database config
$config = Kohana::$config->load('database')->default;
$config = Repository\OhanzeeRepository::getDefaultConfig();
Kohana::$config->load('database')->default;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line needed?

@rjmackay rjmackay force-pushed the lumen-remove-kohana branch from 844768e to 65f9040 Compare July 4, 2017 23:02
@rjmackay rjmackay mentioned this pull request Jul 5, 2017
13 tasks
@rjmackay rjmackay force-pushed the lumen-remove-kohana branch from 65f9040 to 2062e61 Compare July 5, 2017 00:13
@rjmackay rjmackay self-assigned this Oct 19, 2017
@rjmackay rjmackay force-pushed the lumen branch 2 times, most recently from 027fd2b to 05ae30f Compare October 30, 2017 08:26
@rjmackay rjmackay force-pushed the lumen-remove-kohana branch 3 times, most recently from e722992 to bbce9c1 Compare December 21, 2017 01:50
@rjmackay rjmackay force-pushed the lumen-remove-kohana branch from bbce9c1 to bbcfe13 Compare December 21, 2017 04:21
@rjmackay rjmackay changed the title Lumen remove kohana [WIP] Lumen remove kohana Dec 21, 2017
@rjmackay rjmackay requested a review from rowasc December 21, 2017 08:44
@rjmackay
Copy link
Contributor Author

@willdoran this should be ready for review now

});

// Intercom config settings
$di->set('site.intercomAppToken', function () use ($di) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willdoran I don't know that this is really used anywhere anymore?

* Media Config
*/

return array(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this could be combined with CDN config, but that all needs some rationalization now we could use Laravel Filesystem

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should generally consider how we should logically group configs

} else {
// URL::site or Media::uri already encodes the path properly, skip the path wrangling seen above
return \URL::site(\Media::uri($this->getRelativePath() . $value), \Request::current());
return url(config('cdn.local.media_upload_dir') . '/' . $path); // @todo load from config
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure theres a nicer way to do this once we use laravel filesystem

@rjmackay rjmackay force-pushed the lumen-remove-kohana branch from 51478f1 to 457f93e Compare December 21, 2017 09:01
@rjmackay rjmackay changed the title Lumen remove kohana Remove the remains of kohana Dec 21, 2017
$this->app->configure('multisite');
$this->app->configure('ohanzee-db');

$this->registerServicesFromAura();
Copy link
Contributor

@rowasc rowasc Jan 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does it matter that it is using AuraDI to register usecase and repository.message?

return $site['private']
and $features['private']['enabled'];
// Multisite db
// Move multisite enabled check to class and move to src/App
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we talk about multisite install, is that the way we have the setup for ushahidi.io clients?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's correct, yes

Copy link
Contributor

@willdoran willdoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comments are very general. I don't see any obvious issue.

My suggestion is that as part of wrapping this a doc is delivered that covers what was surfaced as important future concerns. And what next steps might be for further piece by piece upgrades of the API.

if ($type === 'jsonp') {
$response->withCallback($request->input('callback'));
// Prevent Opera and Chrome from executing the response as anything
// other than JSONP, see T455.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this be a link

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh its a reference to phabricator WAT

return $site['private']
and $features['private']['enabled'];
// Multisite db
// Move multisite enabled check to class and move to src/App
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's correct, yes

// Multisite db
// Move multisite enabled check to class and move to src/App
$di->set('site', function () use ($di) {
$site = '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a todo to make this a logical default?

@@ -15,7 +15,7 @@
realpath(__DIR__.'/../')
);

// $app->withFacades();
$app->withFacades();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you say this needs testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorta - the branch is green so its tested :)

* Media Config
*/

return array(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should generally consider how we should logically group configs


// Maximum file upload size in bytes. Remember this figure should not be larger
// than the maximum file upload size set on the server. 1Mb by default.
'max_upload_bytes' => '1048576',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a todo that setting bytes is gross and should be made more logical somehow? I imagine this is something people may want to readily configure, which means they have to either know base 10 to an even number off by heart or google it.

@rjmackay rjmackay merged commit 77e0530 into lumen Jan 25, 2018
@rjmackay rjmackay deleted the lumen-remove-kohana branch January 25, 2018 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants