[2.0] Smartifying the backend

Mark threads with "[2.0]" for discussions about features in the longer-term future, "[1.6]" is for short-term. This is not the place for general discussions or plugin or template requests. Only features that are approved to happen by the core team should be listed here for better structuring.
Locked
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by garvinhicking »

Hi!
Timbalu wrote:I'm starting to get light confused... :wink:
garvinhicking wrote:1. s9y does NOT fail on a non-writable templates_c directory in NORMAL operation, so Smarty must made to be loadable
That means "disable our trigger_error(DIRECTORY_WRITE_ERROR)" in our s9y_smarty class, to not fail in general, right?
Yes, at least when IS_installed !== true.
garvinhicking wrote:2. On installation, s9y utilizes Smarty (in the way above), but installation cannot continue unless templates_c is made writable.
That means "put the s9y_smarty class trigger_error(DIRECTORY_WRITE_ERROR) into the installer, to stop installing until solved, right?[/quote]

Yes, for anyone testing s9y 2.0 branch, that would be good, I think.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Smartifying the backend

Post by Timbalu »

Code: Select all

        if (!is_dir($this->getCompileDir()) || !is_writable($this->getCompileDir())) {
            if(ini_get('display_errors') == 0 || ini_get('display_errors') == 'off') printf(DIRECTORY_WRITE_ERROR, $this->getCompileDir());
			// to avoid stopping by exception_error in general
			if( !defined(IS_installed) || IS_installed !== true) trigger_error(sprintf(DIRECTORY_WRITE_ERROR, $this->getCompileDir()), E_USER_ERROR);
        }
that one would fit both, right? (no need to double it into installer...)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by garvinhicking »

Hi!

I don't want to trigger an error or printf an error message. Smarty should work without a writable directory...that's what would be the most important thing in this. Only once that is done, the s9y INSTALLER can work without a writable directory to use our smarty templates to print the normal error output on installation...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Smartifying the backend

Post by Timbalu »

... this answer is leaving me confused even more...

in S9y Smarty2 environment, we always had

Code: Select all

            if (!is_dir($serendipity['smarty']->compile_dir) || !is_writable($serendipity['smarty']->compile_dir)) {
                printf(DIRECTORY_WRITE_ERROR, $serendipity['smarty']->compile_dir);
                return false;
            }
which - in difference - had no occurance in the installer, as the last not smartified.
Maybe you or me are talking about different interactions?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: [2.0] Smartifying the backend

Post by onli »

Code: Select all

 if (!is_dir($serendipity['smarty']->compile_dir) || !is_writable($serendipity['smarty']->compile_dir)) {
You say: This was checked on installation? I don't think so...
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Smartifying the backend

Post by Timbalu »

No! Never! I said ~was not appearing in installer, as that one not smartified.
Calm, Browny, calm! :wink:
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: [2.0] Smartifying the backend

Post by onli »

Then i don't udnerstand your confusion. Garvin said: No printf-error when templates_c is not writeable on install, only show the normal installer with it's messages regarding the rights at the bottom.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Smartifying the backend

Post by Timbalu »

Yes, understanding Garvins last post in this single way...
but - turning in a circle - as I said already, Smarty3 is gonna fail, if the essential compile dir is not writable (even if I don't know how this could ever happen, though).
How should Smarty ever work if this isn't set probably, in which usercase it ever appears?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by garvinhicking »

Hi!
Timbalu wrote:Yes, understanding Garvins last post in this single way...
but - turning in a circle - as I said already, Smarty3 is gonna fail, if the essential compile dir is not writable (even if I don't know how this could ever happen, though).
How should Smarty ever work if this isn't set probably, in which usercase it ever appears?
THIS IS WHAT NEEDS WORK! :-)

There is IMHO no reason that Smarty would need a writable compile directory, and I thought you mentioned that this is true when using 'resource' eval fetch calls.

Serendipity needs to extend the Smarty object so, that when the compile dir is not writable, it uses a Smarty-Class that uses eval fetch calls, so that smarty will properly work, thus enabling the installer smarty templates, thus enabling the installer smarty template to print out proper diagnostic messages just like before.

I basically want the same user experience for the installation process as it currently stands without the smarty templates.

Ultimately, if we cannot get Smarty3 to behave that way, we will need to NOT template the installer.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by yellowled »

garvinhicking wrote:Ultimately, if we cannot get Smarty3 to behave that way, we will need to NOT template the installer.
Remember, there is always the option to "backport" my changes to the smartified backend to some kind of hardcoded backend, be it for performance or other reasons. (Just wanted to add that before you guys start bumping heads here. :wink:)

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Smartifying the backend

Post by Timbalu »

Hi Garvin
garvinhicking wrote:There is IMHO no reason that Smarty would need a writable compile directory, and I thought you mentioned that this is true when using 'resource' eval fetch calls.
In general or in the special installer case? In general Smarty does need a compile dir and errors if not. But within a working environment you can use 'resource' eval fetch calls.
garvinhicking wrote:Ultimately, if we cannot get Smarty3 to behave that way, we will need to NOT template the installer.
I really expect some patience in this question and hope these bigletters up there don't tell me you got out of range...
Did you really read my conclusion post (p=10429857) carefully?
That is what I have said, having left these three possible options...


My remembrance failure in my remaining question was, that the installer procedure would throw nice errors, but would run through leaving an erroring frontend. The last isn't true. So my vote changes again.
So after some more testing, I would conclude finally to save the installer.tpl as a raw php template, as I did some very long post ago (p=10429739)..., since I really like the nice page step1 in the installer to be presented to the user too.

Pace! :wink:
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by garvinhicking »

Hi!
In general or in the special installer case? In general Smarty does need a compile dir and errors if not. But within a working environment you can use 'resource' eval fetch calls.
I still think this needs to work somehow. I've mailed Rodney to ask for it.
I really expect some patience in this question and hope these bigletters up there don't tell me you got out of range...


No, but I just want to state that a simple echo/sprintf errormessage is not the way I want to pursuit.

Let'S see if rodney finds a way, else we go the installer.php route.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Smartifying the backend

Post by Timbalu »

pull that back Garvin

I just found a incredible easy solution! Commit in a minute. :D Good we talked about it.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: [2.0] Smartifying the backend

Post by garvinhicking »

Hi!

Rodney posted this:

https://gist.github.com/2215060

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] Smartifying the backend

Post by Timbalu »

looks like you are good in pestering too ;-)
...mine is shorter, but that one looks very professional! Its up to you.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Locked