-
Notifications
You must be signed in to change notification settings - Fork 48
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
2.0 Proposal #299
Comments
I'd prefer the approach Symfony uses with it's bundles. Rather than a list of class names, you instantiate a new instance of the class and pass that. This would allow the end user a little more control over how a plugin is instantiated if necessary, but remain simple to use if not.
Any object or data references that need to be passed to the plugin can be done so via setter methods which would be defined on an interface that a plugin implements.
I'm of the opinion that the My preference would be to treat Everything else sounds good to me. Having a skeleton app which has phile as a requirement for people to use with create-project is a good idea and would resolve #298. A simplified and modular configuration would certainly be helpful for plugins. |
This sounds interesting. Seems a little more advanced than the class as a string. Is there a case where people would start passing things to constructors? If yes, the benefit of more control seems a little more noisy. Is there any case where you would need access to a constructor in the config?
Except a public folder would have things like the main |
Most likely not. The only potential use case I could come up with would be to to re-use a plugin with an alternate configuration by passing in a key name or something. 99% of the time I'd expect the constructor would be unused though. However it doesn't seem more noisy to me. From an end user perspective the only difference is using From a developer perspective their plugin would just have to extend an
I don't really see any issue with mixing those in with the content markdown files. Phile should only be concerned with requests to *.md files, anything else would be served as is. Someone potentially loading a *.md file directly doesn't strike me as an issue. With proper configuration, it shouldn't happen anyway. |
I think merging a Having server-related files in the markdown content folder just seems like a code-smell. Non For the |
And in which priority they will be loaded? So there should be smth like
or smth like that.
|
I put some work toward the ideas presented here, mainly splitting the project into a separate core and skeleton app. I'd like to ask for opinions before doing too much more work. I've created two branches to work with, core-split and skeleton-split. One of these would ultimately be converted into it's own repository. I went the route of changing the core to phile-cms/phile-core and leaving the skeleton app as the current name. I also added a composer script to handle the setup after a composer create-project call. It will ask for basic parameters and generate the config.php and also the cache directories. Any input is welcome. If the direction looks good I can continue trying to make improvements. Otherwise it could be scrapped and a new approach tried. |
While way to late for the party here are my thoughts working with the code at the moment:
Don't see an issue with that. But personally I don't mind lib/vendor, it makes manual updating the core easy: "just copy lib/".
Don't see an issue with that.
If there's a zip download which runs without composer - which I feel strongly about -
It's a PITA to develop in that setup (dev-setup, push to all those different repositories, keep versions strings in order, …). Theoretically yes, practically not a fan.
This could be done nonetheless.
The config situation could be improved, but I don't see a benefit of having half a dozen of config one-liner files. As @Frodox mentioned other questions arise: Is the file order important? Does plugin loading need to reflect the file order? Is there a naming convention so a config matches a plugin? This could be become complicated fast without providing real world benefits.
Plugins are already able to do that? I have to see a concrete implementation for an opinion.
Sounds like the right thing to do, but I'm rather sceptical again. This would mean you can't serve assets out of plugin-ins? Are additional conventions and/or moving files on plugin de-/installation required? Not a fan if true.
This sounds somewhat complicated to do if the core should stay template-engine agnostic. Need to see an implementation. Here's is my 2.0 wishlist:
Maybe:
|
Phile 2.0
Lately I have been using Laravel and Slim and have noticed some nice things we can steal. It has been a while since I used Phile, but I have been using it for the past couple of weeks and noticed some of the missing or awkward choices.
This is my pitch for 2.0. This is simply a proposal that is open for discussion, not a demand or order for a particular direction.
Use default composer dir
Right now we have a custom vendor setup as
/lib/vendor
. I think this should be removed and just use the default/vendor
.All things composer
Move the Phile core into a composer package, and use a composer create-project command to generate a skeleton app that has everything setup.
This would remove the need to manually set the encryptionKey or do a setupCheck. This could even be interactive like
composer init
.All plugins in composer
Move all the plugins onto packagist. Plugins are installed into
/vendor
usingcomposer install/require
.Then we use something like the service provider in Laravel to load plugins by their class name.
For example:
Would become something like:
To disable a plugin, simply remove it from the list or comment it out. I describe plugin config in the next section.
Remove default_config and config
Remove both config files. Add a
/config
folder and load all files inside it.Then we can have our plugin configs in that folder, but also split up by name.
Any default Phile config stuff would be in the Phile Core package.
Plugins have routes
Add the ability to set a route for the plugin to be reached at.
This means a plugin could be used almost like a controller. Useful for AJAX/Form submission stuff.
Pages as a collection
The pages array or class should instead be a Collection.
This allows easy filtering, sorting, reducing, and searching, but as part of the Pages object. This makes manipulating the pages array in a plugin (but also in Core) much easier.
Add a /public folder
Instead of having a
/protected
folder, we should just have a/public
folder. Everything else can be locked down.This can be used to store uploads or arbitrary things that don't belong in
/content
or/themes
.Helper functions in templates
These would be really simple to add in Twig.
{{ url('/some-page') }}
instead of{{ base_url }}/some-page
{{ theme('/css/style.css') }}
instead of{{ theme_url }}/css/style.css
{{ render('/hidden/file.md') }}
would render a file in the/content
directory.{{ route('pluginName.pluginRoute') }}
would be able to resolve a plugin route to a real Phile route{{ meta('a_meta_key', 'default value if missing') }}
would allow you to fetch meta, or have default metaIn the end, I think these changes would make Phile much nicer. It may be a little more advanced, but I think the benefits outweight the downsides.
Anyone have any comments on this?
The text was updated successfully, but these errors were encountered: