Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2011-07-31 10:17:51
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
Hi jpdupont
I already have a published plugin that auto-loads other plugins but it’s pretty old (even by my standards) and needs some work.
all
I’m a little wary of turning this into a full blown theme installer and I don’t really want to get into the realm of changing existing presentation items, though I would be ok with adding scripted removal of non-default forms/pages/sections/styles.
Perhaps, as jpdupont has suggested, there is a little more headroom at the front-end of the boot-strap process for getting an initial set of plugins installed — a set which could include your theme installer of choice. If so, would others use a plugin auto-load feature if I merged it from my old plugin? Done anyway as I might find it useful myself.
Last edited by net-carver (2011-07-31 15:06:01)
— Steve
Offline
#14 2011-07-31 15:04:59
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
Ok, v0.4 is out.
Changes…
- Attempts to load plugins from the
/files
sub-directory, before any scripted cleanups are run. - Location of cleanups.php has been moved to the
/files
sub-directory to allow you clean your site without needing ftp or ssh access to the filesystem. - Your cleanups can now enable auto-loaded plugins using the ‘enableplugin’ directive.
— Steve
Offline
#15 2011-07-31 19:58:08
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: sed_cleaner
Steve,
I try the plugin (last 0.4.20) on a fresh TXP install, in a subdirectory.
I get this error messages, with debug on, below.
It seems the plugin don’t care of the table prefix here “demo_”, and dont’ care of the subdir “demo”, to remove files ….
TRUNCATE TABLE `txp_discuss`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.txp_discuss' doesn't exist
TRUNCATE TABLE `txp_discuss` on line 89
TRUNCATE TABLE `txp_link`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.txp_link' doesn't exist
TRUNCATE TABLE `txp_link` on line 89
TRUNCATE TABLE `txp_category`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.txp_category' doesn't exist
TRUNCATE TABLE `txp_category` on line 89
TRUNCATE TABLE `textpattern`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.textpattern' doesn't exist
TRUNCATE TABLE `textpattern` on line 89
TRUNCATE TABLE `txp_image`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.txp_image' doesn't exist
TRUNCATE TABLE `txp_image` on line 89
update demo_txp_prefs set `val`='' where `name`='site_slogan'
update demo_txp_prefs set `val`='' where `name`='custom_1_set'
update demo_txp_prefs set `val`='' where `name`='custom_2_set'
update demo_txp_prefs set `val`='' where `name`='spam_blacklists'
update demo_txp_prefs set `val`='0' where `name`='use_dns'
update demo_txp_prefs set `val`='1' where `name`='never_display_email'
Removing setup/en-gb.php
Erreur lors du chargement du plugin sed_cleaner -> Warning: unlink(setup/en-gb.php) [function.unlink]: Permission non accordée on line 230
Removing setup/index.php
Erreur lors du chargement du plugin sed_cleaner -> Warning: unlink(setup/index.php) [function.unlink]: Permission non accordée on line 230
Removing setup/setup-langs.php
Erreur lors du chargement du plugin sed_cleaner -> Warning: unlink(setup/setup-langs.php) [function.unlink]: Permission non accordée on line 230
Removing setup/txpsql.php
Erreur lors du chargement du plugin sed_cleaner -> Warning: unlink(setup/txpsql.php) [function.unlink]: Permission non accordée on line 230
Removing setup
Erreur lors du chargement du plugin sed_cleaner -> Warning: rmdir(setup) [function.rmdir]: Permission non accordée on line 212
Erreur lors du chargement du plugin sed_cleaner -> Notice: Undefined variable: event on line 19
Auto Install Plugins... Accessing dir(/home/www/fc1f7630122da37fd45afdf6fbcfbfdb/web/demo/files) ... no plugins found: exiting.
No installation specific cleanup file found.
TRUNCATE TABLE `txp_file`
Erreur lors du chargement du plugin sed_cleaner -> User_Warning: Table 'alysseinfo3.txp_file' doesn't exist
TRUNCATE TABLE `txp_file` on line 89
Offline
#16 2011-07-31 20:35:20
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
jpdupont wrote…
It seems the plugin don’t care of the table prefix here “demo_”, and dont’ care of the subdir “demo”, to remove files
Good catch. It doesn’t use table prefixes. I’ll fix that.
The plugin operates on the directories relative to the textpattern directory so those errors are more likely to be file system permissions on the setup directory. The script cant remove what it doesn’t have permission to remove.
Edited to add: I’ve confirmed that directory cleanup works in subdir installations as long as your filesystem permissions allow it.
Last edited by net-carver (2011-07-31 21:17:34)
— Steve
Offline
#17 2011-07-31 21:14:45
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
— Steve
Offline
Re: sed_cleaner
Hi Steve.
For plugin help file: Where can we find a complete preference entries list?
Cheers,
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
#19 2011-08-01 11:14:09
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: sed_cleaner
Patrick, possibly fewest clicks is via phpMyAdmin.
Another way would be this one.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: sed_cleaner
Ok Uli.
Good tip. Tks.
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
#21 2011-08-01 16:15:11
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
all
I updated the documentation linked in the opening post. The ‘usage & installation’ section should be clearer now.
Do let me know your success or failures with this plugin please.
Pat64
I’ll see if I can generate a list of the prefs that can be set.
— Steve
Offline
Re: sed_cleaner
Hi Steve.
Based on Uli’s advices I edit this file: Preferences List
But don’t know if it’s complete.
Patrick.
Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.
Offline
#23 2011-08-01 18:41:07
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: sed_cleaner
I wrote:
I’ll see if I can generate a list of the prefs that can be set.
Done. It’s at the end of the cleanups.php file.
But I see you’ve been busy too :)
— Steve
Offline
#24 2011-08-01 19:42:39
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: sed_cleaner
Steve,
I have a home made php reset script :
// empty tables
...
...
// delete records
safe_delete('txp_category','name<>\'root\'');
safe_delete('txp_section','name<>\'default\'');
safe_delete('txp_form','name<>\'default\'');
safe_delete('txp_page','name=\'archive\'');
// empty fields
safe_update('txp_css','css=\'\'','name=\'default\'');
safe_update('txp_form','Form=\'\'','name=\'default\'');
safe_update('txp_page','user_html=\'\'','name=\'default\'');
safe_update('txp_page','user_html=\'\'','name=\'error_default\'');
How put these lines in the cleanups.php file ?
Offline