Skip to content

Commit

Permalink
Merge branch '4.0-dev' into j4finder_termsphrases
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar authored May 23, 2018
2 parents 41faaa0 + 7b29299 commit 7a5ab32
Show file tree
Hide file tree
Showing 330 changed files with 5,999 additions and 3,293 deletions.
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@
},
// Rule overrides
"rules": {
// Disable no-params-reassign for properties
"no-param-reassign": ["error", { "props": false }],
// Allow usage of dev-dependencies in js files in build directory
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["build/**/*.js"]}],
// Allow strict mode (we are not dealing with modules)
"strict": [0]
"strict": [0],
// Disable alert rule till we have a CE in place
"no-alert": 0
}
}
6 changes: 6 additions & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ fail_on_violations: true
scss:
config_file: scss-lint.yml

eslint:
enabled: true
config_file: .eslintrc
ignore_file: .eslintignore

# Disable hound default linters
jshint:
enabled: false

Expand Down
82 changes: 63 additions & 19 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ protected function copyJoomla($dst, $exclude = array())
/**
* Executes all the Selenium System Tests in a suite on your machine
*
* @param array $opts Array of configuration options:
* @param array $opts Array of configuration options:
* - 'use-htaccess': renames and enable embedded Joomla .htaccess file
* - 'env': set a specific environment to get configuration from
*
Expand All @@ -231,24 +231,7 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
{
$this->say("Running tests");

$this->createTestingSite($opts['use-htaccess']);

$this->taskRunSelenium(self::SELENIUM_FOLDER, $this->getWebdriver())->run();

sleep(3);

// Make sure to run the build command to generate AcceptanceTester
if ($this->isWindows())
{
$this->_exec('php ' . $this->getWindowsPath($this->vendorPath . 'bin/codecept') . ' build');
$pathToCodeception = $this->getWindowsPath($this->vendorPath . 'bin/codecept');
}
else
{
$this->_exec('php ' . $this->vendorPath . 'bin/codecept build');

$pathToCodeception = $this->vendorPath . 'bin/codecept';
}
$pathToCodeception = $this->prepareRun($opts);

$suites = [
'acceptance/install/',
Expand All @@ -270,6 +253,65 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
}
}

/**
* Install only Joomla
*
* @param array $opts Additional options
*
* @since __DEPLOY_VERSION__
*
* @return void
*/
public function runInstall($opts = ['use-htaccess' => false, 'env' => 'desktop'])
{
$this->say("Running Installation");

$pathToCodeception = $this->prepareRun($opts);

$this->taskCodecept($pathToCodeception)
->arg('--fail-fast')
->arg('--steps')
->arg('--debug')
->env($opts['env'])
->arg($this->testsPath . 'acceptance/install/')
->run()
->stopOnFail();
}

/**
* Prepare the installation
*
* @param array $opts Optional Options
*
* @return string Path to codeception
*
* @since __DEPLOY_VERSION__
*/
protected function prepareRun($opts = ['use-htaccess' => false, 'env' => 'desktop'])
{
$this->createTestingSite($opts['use-htaccess']);

$this->taskRunSelenium(self::SELENIUM_FOLDER, $this->getWebdriver())->run();

// Wait until the server started
sleep(3);

// Make sure to run the build command to generate AcceptanceTester
if ($this->isWindows())
{
$this->_exec('php ' . $this->getWindowsPath($this->vendorPath . 'bin/codecept') . ' build');
$pathToCodeception = $this->getWindowsPath($this->vendorPath . 'bin/codecept');
}
else
{
$this->_exec('php ' . $this->vendorPath . 'bin/codecept build');

$pathToCodeception = $this->vendorPath . 'bin/codecept';
}

return $pathToCodeception;
}

/**
* Executes a specific Selenium System Tests in your machine
*
Expand All @@ -278,6 +320,8 @@ public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
*
* @since 3.7.3
*
* @throws Exception if test not found
*
* @return void
*/
public function runTest($pathToTestFile = null, $suite = 'acceptance')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,23 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;
namespace Joomla\Component\Admin\Administrator\Dispatcher;

use Joomla\CMS\Dispatcher\Dispatcher;
defined('_JEXEC') or die;

/**
* Dispatcher class for com_admin
*
* @since 4.0.0
*/
class AdminDispatcher extends Dispatcher
class Dispatcher extends \Joomla\CMS\Dispatcher\Dispatcher
{
/**
* The extension namespace
*
* @var string
*
* @since 4.0.0
*/
protected $namespace = 'Joomla\\Component\\Admin';

/**
* com_admin does not require check permission, so we override checkAccess method and have it empty
*
* @return void
*/
protected function checkAccess()
{

}
}
53 changes: 53 additions & 0 deletions administrator/components/com_admin/Extension/AdminComponent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Admin\Administrator\Extension;

defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Extension\BootableExtensionInterface;
use Joomla\CMS\Extension\Component;
use Joomla\CMS\HTML\HTMLRegistryAwareTrait;
use Joomla\CMS\MVC\Factory\MVCFactoryServiceTrait;
use Joomla\CMS\MVC\Factory\MVCFactoryServiceInterface;
use Joomla\Component\Admin\Administrator\Service\HTML\Directory;
use Joomla\Component\Admin\Administrator\Service\HTML\PhpSetting;
use Joomla\Component\Admin\Administrator\Service\HTML\System;
use Psr\Container\ContainerInterface;

/**
* Component class for com_admin
*
* @since 4.0.0
*/
class AdminComponent extends Component implements BootableExtensionInterface, MVCFactoryServiceInterface
{
use MVCFactoryServiceTrait;
use HTMLRegistryAwareTrait;

/**
* Booting the extension. This is the function to set up the environment of the extension like
* registering new class loaders, etc.
*
* If required, some initial set up can be done from services of the container, eg.
* registering HTML services.
*
* @param ContainerInterface $container The container
*
* @return void
*
* @since 4.0.0
*/
public function boot(ContainerInterface $container)
{
$this->getRegistry()->register('system', new System);
$this->getRegistry()->register('phpsetting', new PhpSetting);
$this->getRegistry()->register('directory', new Directory);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Admin\Administrator\Service\HTML;

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;

/**
* Utility class working with directory
*
* @since 1.6
*/
abstract class JHtmlDirectory
class Directory
{
/**
* Method to generate a (un)writable message for directory
Expand All @@ -23,14 +27,14 @@ abstract class JHtmlDirectory
*
* @return string html code
*/
public static function writable($writable)
public function writable($writable)
{
if ($writable)
{
return '<span class="badge badge-success">' . JText::_('COM_ADMIN_WRITABLE') . '</span>';
return '<span class="badge badge-success">' . Text::_('COM_ADMIN_WRITABLE') . '</span>';
}

return '<span class="badge badge-danger">' . JText::_('COM_ADMIN_UNWRITABLE') . '</span>';
return '<span class="badge badge-danger">' . Text::_('COM_ADMIN_UNWRITABLE') . '</span>';
}

/**
Expand All @@ -42,7 +46,7 @@ public static function writable($writable)
*
* @return string html code
*/
public static function message($dir, $message, $visible = true)
public function message($dir, $message, $visible = true)
{
$output = $visible ? $dir : '';

Expand All @@ -51,6 +55,6 @@ public static function message($dir, $message, $visible = true)
return $output;
}

return $output . ' <strong>' . JText::_($message) . '</strong>';
return $output . ' <strong>' . Text::_($message) . '</strong>';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Admin\Administrator\Service\HTML;

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;

/**
* Utility class working with phpsetting
*
* @since 1.6
*/
abstract class JHtmlPhpSetting
class PhpSetting
{
/**
* Method to generate a boolean message for a value
Expand All @@ -23,9 +28,9 @@ abstract class JHtmlPhpSetting
*
* @return string html code
*/
public static function boolean($val)
public function boolean($val)
{
return JText::_($val ? 'JON' : 'JOFF');
return Text::_($val ? 'JON' : 'JOFF');
}

/**
Expand All @@ -35,9 +40,9 @@ public static function boolean($val)
*
* @return string html code
*/
public static function set($val)
public function set($val)
{
return JText::_($val ? 'JYES' : 'JNO');
return Text::_($val ? 'JYES' : 'JNO');
}

/**
Expand All @@ -47,9 +52,9 @@ public static function set($val)
*
* @return string html code
*/
public static function string($val)
public function string($val)
{
return !empty($val) ? $val : JText::_('JNONE');
return !empty($val) ? $val : Text::_('JNONE');
}

/**
Expand All @@ -61,13 +66,13 @@ public static function string($val)
*
* @deprecated 4.0 Use intval() or casting instead.
*/
public static function integer($val)
public function integer($val)
{
try
{
JLog::add(sprintf('%s() is deprecated. Use intval() or casting instead.', __METHOD__), JLog::WARNING, 'deprecated');
Log::add(sprintf('%s() is deprecated. Use intval() or casting instead.', __METHOD__), Log::WARNING, 'deprecated');
}
catch (RuntimeException $exception)
catch (\RuntimeException $exception)
{
// Informational log only
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Admin\Administrator\Service\HTML;

defined('_JEXEC') or die;

use Joomla\CMS\Language\Text;

/**
* Utility class working with system
*
* @since 1.6
*/
abstract class JHtmlSystem
class System
{
/**
* Method to generate a string message for a value
Expand All @@ -23,8 +27,8 @@ abstract class JHtmlSystem
*
* @return string html code
*/
public static function server($val)
public function server($val)
{
return !empty($val) ? $val : JText::_('COM_ADMIN_NA');
return !empty($val) ? $val : Text::_('COM_ADMIN_NA');
}
}
Loading

0 comments on commit 7a5ab32

Please sign in to comment.