Skip to content

Load Classpaths of apps before appinfo/routes.php - #1214

Merged
BernhardPosselt merged 2 commits into
owncloud:masterfrom
BernhardPosselt:master
Jan 19, 2013
Merged

BernhardPosselt merged 2 commits into
owncloud:masterfrom
BernhardPosselt:master

Conversation

@BernhardPosselt

Copy link
Copy Markdown
Contributor

To be able to use the appframework in routing (you need to call the App::main method for handling the request) the classes of the appframework need to be available.

This patch loads all classpath definitions in appinfo/classpath.php before the appinfo/routes.php.

Comment thread lib/base.php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a way to sandbox this require call?
In case of e.g. syntax error the whole ownCloud instance is dead.

(Applies to other require calls as well - but it came to my mind while reading this ;-) )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From what ive heard in #php not possible. A solution would be to put the defintions into an XML file and catch XML parsing errors.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

People from ##php recommended to run a sanity check before enabling an app.

php -l

runs a syntax check for instance, but there will have to be more tests for other FATAL errors.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

php -l

is what we do within Jenkins - and come more.

Maybe we simply keep it as it as and trust in our apps and the apps review process on apps.owncloud.com

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

make it a simple file with class\tfile lines, also no misuse possible

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hehe - I knew this would pop up! ;-)

Makes sense!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And how about getting rid of that ugly version file?

    <dbversion>4</dbversion>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also we could get rid of app enabled checks by using something like this

<needs>
    <appenabled>appframework</appenabled>
</needs>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

okay - it's time to summon @arkascha ....
.... he had some ideas on dependencies as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should close this pr and start with a new issue where we collect all ideas and let implementations follow

@DeepDiver1975

Copy link
Copy Markdown
Contributor

👍

@icewind1991

Copy link
Copy Markdown
Contributor

👍

BernhardPosselt added a commit that referenced this pull request Jan 19, 2013
Load Classpaths of apps before appinfo/routes.php
@BernhardPosselt
BernhardPosselt merged commit f193986 into owncloud:master Jan 19, 2013
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants