/**
  * @access private
  * @return string
  */
 private function _calculateServerInfo()
 {
     $info[] = '<a href="http://buildwithcraft.com/">Craft</a> ' . Craft::t('{version} build {build}', array('version' => CRAFT_VERSION, 'build' => CRAFT_BUILD));
     $info[] = isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '';
     $info[] = 'Yii v' . Craft::getYiiVersion();
     $info[] = \CTimestamp::formatDate(craft()->locale->getTimeFormat());
     return implode(' | ', $info);
 }
예제 #2
0
 /**
  * @param string $action
  * @param array  $params
  * @return bool
  */
 public function beforeAction($action, $params)
 {
     if ($action == 'create') {
         // If the 1nd dimension is the 1nd index, then we know it's a plugin.  No need to make them specify the path.
         if (isset($params[0][1])) {
             $plugin = $params[0][1];
             $path = craft()->path->getMigrationsPath($plugin);
             if (!IOHelper::folderExists($path)) {
                 echo 'The migration folder does not exist at ' . $path . ".  Creating...\n";
                 if (!IOHelper::createFolder($path)) {
                     echo 'Sorry... I tried to create the folder, but could not.';
                     return 1;
                 } else {
                     echo 'Successfully created.';
                 }
             }
         }
     }
     $yiiVersion = Craft::getYiiVersion();
     echo "\nCraft Migration Tool (based on Yii v{$yiiVersion})\n\n";
     return true;
 }