Skip to content

Commit

Permalink
Added stuff to FAQ...control panel now works with POST and not GET. I…
Browse files Browse the repository at this point in the history
…nstall wizard supports manual installs...still a little work needed for it though
  • Loading branch information
bauerjj committed Jul 29, 2012
1 parent 7da0447 commit d6262cd
Show file tree
Hide file tree
Showing 17 changed files with 904 additions and 916 deletions.
212 changes: 100 additions & 112 deletions assests/sphinx.conf.tpl

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions class.sphinxfactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,16 @@ public static function BuildInstall($Settings){
return new SphinxSearchInstall($Settings);
}

public static function BuildModel(){
return new SphinxSearchModel(); //a wrapper around the sphinx API
}

public static function BuildSettings(){
return SphinxSearchSettings::GetInstance();

}

public static function BuildService($Settings){
return new SphinxSearchService($Settings);
}

public static function BuildWizard(){
return new SphinxSearchInstallWizard();
public static function BuildWizard($Settings){
return new SphinxSearchInstallWizard($Settings);
}

public static function BuildAPI(){
Expand Down
274 changes: 201 additions & 73 deletions class.sphinxsearch.plugin.php

Large diffs are not rendered by default.

74 changes: 51 additions & 23 deletions class.sphinxsearchadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,15 @@
/**
* Create a Facade
*/

class SphinxSearchAdmin {

public $Setup;

public $Install;

public $Service;

public $Wizard;

protected $Settings;

public $Observable;



public function __construct($Sender, $View) {

$this->Setup = SphinxFactory::BuildSettings();
Expand All @@ -31,46 +23,82 @@ public function __construct($Sender, $View) {
$this->Service = SphinxFactory::BuildService($this->Settings);
$this->Service->Attach(new SphinxStatusLogger($Sender, $View));

$this->Wizard = SphinxFactory::BuildWizard();
$this->Service = SphinxFactory::BuildService($this->Settings);
$this->Service->Attach(new SphinxStatusLogger($Sender, $View));

$this->Wizard = SphinxFactory::BuildWizard($this->Settings);
$this->Wizard->Attach(new SphinxStatusLogger($Sender, $View));
}

public function ToggleWizard() {
$this->Wizard->ToggleWizard();
}

public function GetSettings(){
public function Detect() {
$this->Wizard->DetectionAction(); //attempt to find prescense of sphinx
}

public function GetSettings() {
//return $this->Settings;
$Setup = SphinxFactory::BuildSettings();
return $Setup->GetAllSettings();
}

public function ValidateInstall(){
public function ValidateInstall() {
$this->Service->ValidateInstall();
}

public function CheckSphinxRunning(){
public function SetupCron(){
$this->Install->SetupCron();
}

public function WriteConfigFile(){
$this->Install->InstallWriteConfig();
}

public function InstallConfig(){
//First check if sphinx is installed
$this->Service->ValidateInstall();
$this->Install->InstallWriteConfig();
$this->SetupCron();
}

public function InstallAction($InstallAction){
if($this->CheckSphinxRunning())
$this->Stop(); //stop if it is running before a new install is made
return $this->Wizard->InstallAction($InstallAction, $this->Service, $this->Install);
}

public function CheckSphinxRunning() {
return $this->Service->CheckSphinxRunning();
}

public function Status(){
public function Status() {
$this->Service->Status();
}
public function Start(){

public function Start() {
$this->Service->Start();
}
public function Stop(){

public function Stop() {
$this->Service->Stop();
}
public function ReIndexMain(){
$this->Service->ReIndexMain();

public function ReIndexMain($Background) {
$this->Service->ReIndexMain($Background);
}
public function ReIndexDelta(){
$this->Service->ReIndexDelta();

public function ReIndexDelta($Background) {
$this->Service->ReIndexDelta($Background);
}
public function ReIndexStats(){
$this->Service->ReIndexStats();

public function ReIndexStats($Background) {
$this->Service->ReIndexStats($Background);
}
public function CheckPort(){

public function CheckPort() {
$this->Service->CheckPort();
}


}
7 changes: 5 additions & 2 deletions class.sphinxsearchgeneral.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ public static function RunCommand($Command, $Path, $PrefixMsg = '', $Background

$status = trim(proc_close($resource));
if ($status) {
return ($stderr . '<br/><br/>' .
$Error = $stderr . '<br/><br/>' .
'<b>' . $PrefixMsg . ', try to run this command manually in Terminal: </b><br/>' .
$Command . '<br/><br/> at directory: <br/>' .
$Path .
'<br/><br/>Try running it with sudo if it doesn\'t work
<br/><b>Terminal Output:</b><br/>' .
$stdout);
$stdout;
$Error = str_replace('%', '%%', $Error);//THIS IS IMPORTANT! Must escape strings in case of percent signs since this is eventually used
//ins sprintf in gdn_form
return $Error;
}
else
return FALSE;
Expand Down
Loading

0 comments on commit d6262cd

Please sign in to comment.