コード例 #1
0
 /**
  * @param string $status
  * @param string $message
  * @return Result
  */
 public function createResult($status = Result::STATUS_OK, $message = '')
 {
     $result = new Result($status, $message);
     $result->setResultGroup($this->_resultGroup);
     $this->addResult($result);
     return $result;
 }
コード例 #2
0
ファイル: EnginesCheck.php プロジェクト: netz98/n98-magerun
 /**
  * @param Result $result
  * @param Varien_Db_Adapter_Interface $dbAdapter
  * @return void
  */
 protected function checkImplementation(Result $result, Varien_Db_Adapter_Interface $dbAdapter)
 {
     $innodbFound = $this->checkInnodbEngine($dbAdapter);
     if ($innodbFound) {
         $result->setStatus(Result::STATUS_OK);
         $result->setMessage("<info>Required MySQL Storage Engine <comment>InnoDB</comment> found.</info>");
     } else {
         $result->setStatus(Result::STATUS_ERROR);
         $result->setMessage("<error>Required MySQL Storage Engine <comment>InnoDB</comment> not found!</error>");
     }
 }
コード例 #3
0
 /**
  * @param Result $result
  * @param Mage_Core_Model_Store $store
  * @param string $baseUrl setting
  */
 protected function checkSettings(Result $result, Mage_Core_Model_Store $store, $baseUrl)
 {
     $errorMessage = 'Wrong hostname configured. <info>Hostname must contain a dot</info>';
     $host = parse_url($baseUrl, PHP_URL_HOST);
     $isValid = (bool) strstr($host, '.');
     $result->setStatus($isValid);
     if ($isValid) {
         $result->setMessage('<info>' . ucfirst($this->class) . ' BaseURL: <comment>' . $baseUrl . '</comment> of Store: <comment>' . $store->getCode() . '</comment> - OK');
     } else {
         $result->setMessage('<error>Invalid ' . ucfirst($this->class) . ' BaseURL: <comment>' . $baseUrl . '</comment> of Store: <comment>' . $store->getCode() . '</comment> ' . $errorMessage . '</error>');
     }
 }
コード例 #4
0
 /**
  * @param Result                 $result
  * @param \Mage_Core_Model_Store $store
  * @param string                 $baseUrl      setting
  * @param string                 $cookieDomain setting
  */
 protected function checkSettings(Result $result, \Mage_Core_Model_Store $store, $baseUrl, $cookieDomain)
 {
     $errorMessage = 'cookie-domain and ' . $this->class . ' base-URL do not match';
     if (strlen($cookieDomain)) {
         $isValid = $this->validateCookieDomainAgainstUrl($cookieDomain, $baseUrl);
         $result->setStatus($isValid);
         if ($isValid) {
             $result->setMessage('<info>Cookie Domain (' . $this->class . '): <comment>' . $cookieDomain . '</comment> of Store: <comment>' . $store->getCode() . '</comment> - OK</info>');
         } else {
             $result->setMessage('<error>Cookie Domain (' . $this->class . '): <comment>' . $cookieDomain . '</comment> of Store: <comment>' . $store->getCode() . '</comment> - ERROR: ' . $errorMessage . '</error>');
         }
     } else {
         $result->setMessage('<info>Empty cookie Domain (' . $this->class . ') of Store: <comment>' . $store->getCode() . '</comment> - OK</info>');
     }
 }
コード例 #5
0
ファイル: VersionCheck.php プロジェクト: netz98/n98-magerun
 /**
  * @param Result $result
  * @param Varien_Db_Adapter_Interface $dbAdapter
  * @return void
  */
 protected function checkImplementation(Result $result, Varien_Db_Adapter_Interface $dbAdapter)
 {
     /**
      * Check Version
      */
     $mysqlVersion = $dbAdapter->fetchOne('SELECT VERSION()');
     $minimumVersionFound = version_compare($mysqlVersion, '4.1.20', '>=');
     if ($minimumVersionFound) {
         $result->setStatus(Result::STATUS_OK);
         $result->setMessage("<info>MySQL Version <comment>{$mysqlVersion}</comment> found.</info>");
     } else {
         $result->setStatus(Result::STATUS_ERROR);
         $result->setMessage("<error>MySQL Version <comment>>{$mysqlVersion}</comment> found. Upgrade your MySQL Version.</error>");
     }
 }