@@ -359,7 +359,10 @@ class Meta:
359359 dict (help = "provide password for wordpress user" ,
360360 dest = 'wppass' )),
361361 (['--proxy' ],
362- dict (help = "create proxy for site" , nargs = '+' ))
362+ dict (help = "create proxy for site" , nargs = '+' )),
363+ (['--experimental' ],
364+ dict (help = "Enable Experimenal packages without prompt" ,
365+ action = 'store_true' )),
363366 ]
364367
365368 @expose (hide = True )
@@ -461,21 +464,56 @@ def default(self):
461464 Log .error (self , "Can not create HTML site with HHVM" )
462465
463466 if data and self .app .pargs .hhvm :
464- data ['hhvm' ] = True
465- hhvm = 1
467+ if (not self .app .pargs .experimental ):
468+ Log .info (self , "HHVM is experimental feature and it may not"
469+ "work with all plugins of your site.\n You can "
470+ "disable it by passing --hhvm=off later.\n Do you wish"
471+ " to enable HHVM now for {0}?" .format (ee_domain ))
472+
473+ # Check prompt
474+ check_prompt = input ("Type \" y\" to continue [n]:" )
475+ if check_prompt != "Y" and check_prompt != "y" :
476+ Log .info (self , "Not using HHVM for site." )
477+ data ['hhvm' ] = False
478+ hhvm = 0
479+ self .app .pargs .hhvm = False
480+ else :
481+ data ['hhvm' ] = True
482+ hhvm = 1
483+ else :
484+ data ['hhvm' ] = True
485+ hhvm = 1
486+
466487 elif data :
467488 data ['hhvm' ] = False
468489 hhvm = 0
469490
470491 if data and self .app .pargs .pagespeed :
471- data ['pagespeed' ] = True
472- pagespeed = 1
492+ if (not self .app .pargs .experimental ):
493+ Log .info (self , "PageSpeed is experimental feature and it may not"
494+ "work with all CSS/JS/Cache of your site.\n You can "
495+ "disable it by passing --pagespeed=off later.\n Do you wish"
496+ " to enable PageSpeed now for {0}?" .format (ee_domain ))
497+
498+ # Check prompt
499+ check_prompt = input ("Type \" y\" to continue [n]:" )
500+ if check_prompt != "Y" and check_prompt != "y" :
501+ Log .info (self , "Not using PageSpeed for site." )
502+ data ['pagespeed' ] = False
503+ pagespeed = 0
504+ self .app .pargs .pagespeed = False
505+ else :
506+ data ['pagespeed' ] = True
507+ pagespeed = 1
508+ else :
509+ data ['pagespeed' ] = True
510+ pagespeed = 1
473511 elif data :
474512 data ['pagespeed' ] = False
475513 pagespeed = 0
476514
477- # if not data:
478515 # self.app.args.print_help()
516+ # if not data:
479517 # self.app.close(1)
480518
481519 # Check rerequired packages are installed or not
@@ -704,7 +742,10 @@ class Meta:
704742 action = 'store' or 'store_const' ,
705743 choices = ('on' , 'off' ), const = 'on' , nargs = '?' )),
706744 (['--proxy' ],
707- dict (help = "update to prxy site" , nargs = '+' )),
745+ dict (help = "update to proxy site" , nargs = '+' )),
746+ (['--experimental' ],
747+ dict (help = "Enable Experimenal packages without prompt" ,
748+ action = 'store_true' )),
708749 (['--all' ],
709750 dict (help = "update all sites" , action = 'store_true' )),
710751 ]
@@ -939,6 +980,7 @@ def doupdatesite(self, pargs):
939980 elif pagespeed is True :
940981 Log .info (self , "Pagespeed is allready enabled for given "
941982 "site" )
983+ pargs .pagespeed = False
942984
943985 if pargs .hhvm :
944986 if hhvm is old_hhvm :
@@ -949,6 +991,8 @@ def doupdatesite(self, pargs):
949991 Log .info (self , "HHVM is allready enabled for given "
950992 "site" )
951993
994+ pargs .hhvm = False
995+
952996 if data and (not pargs .hhvm ):
953997 if old_hhvm is True :
954998 data ['hhvm' ] = True
@@ -965,10 +1009,50 @@ def doupdatesite(self, pargs):
9651009 data ['pagespeed' ] = False
9661010 pagespeed = False
9671011
968- if pargs .pagespeed or pargs .hhvm :
969- if ((hhvm is old_hhvm ) and (pagespeed is old_pagespeed ) and
970- (stype == oldsitetype and cache == oldcachetype )):
971- return 1
1012+ if pargs .pagespeed == "on" or pargs .hhvm == "on" :
1013+ if pargs .hhvm == "on" :
1014+ if (not pargs .experimental ):
1015+ Log .info (self , "HHVM is experimental feature and it may not"
1016+ " work with all plugins of your site.\n You can "
1017+ "disable it by passing --hhvm=off later.\n Do you wish"
1018+ " to enable HHVM now for {0}?" .format (ee_domain ))
1019+
1020+ # Check prompt
1021+ check_prompt = input ("Type \" y\" to continue [n]:" )
1022+ if check_prompt != "Y" and check_prompt != "y" :
1023+ Log .info (self , "Not using HHVM for site" )
1024+ data ['hhvm' ] = False
1025+ hhvm = False
1026+ else :
1027+ data ['hhvm' ] = True
1028+ hhvm = True
1029+ else :
1030+ data ['hhvm' ] = True
1031+ hhvm = True
1032+
1033+ if pargs .pagespeed == "on" :
1034+ if (not pargs .experimental ):
1035+ Log .info (self , "PageSpeed is experimental feature and it may not"
1036+ " work with all CSS/JS/Cache of your site.\n You can "
1037+ "disable it by passing --pagespeed=off later.\n Do you wish"
1038+ " to enable PageSpeed now for {0}?" .format (ee_domain ))
1039+
1040+ # Check prompt
1041+ check_prompt = input ("Type \" y\" to continue [n]:" )
1042+ if check_prompt != "Y" and check_prompt != "y" :
1043+ Log .info (self , "Not using Pagespeed for given site" )
1044+ data ['pagespeed' ] = False
1045+ pagespeed = False
1046+ else :
1047+ data ['pagespeed' ] = True
1048+ pagespeed = True
1049+ else :
1050+ data ['pagespeed' ] = True
1051+ pagespeed = True
1052+
1053+ if ((hhvm is old_hhvm ) and (pagespeed is old_pagespeed ) and
1054+ (stype == oldsitetype and cache == oldcachetype )):
1055+ return 1
9721056
9731057 if not data :
9741058 Log .error (self , "Cannot update {0}, Invalid Options"
0 commit comments