-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
3,084 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
administrator/language/en-GB/en-GB.plg_api-authentication_basic.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
; Joomla! Project | ||
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
; Note : All ini files need to be saved as UTF-8 | ||
|
||
PLG_API-AUTHENTICATION_BASIC="API Authentication - Basic Auth" | ||
PLG_AUTH_AUTHENTICATION_BASIC_XML_DESCRIPTION="Used to allow basic authentication to webservices in Joomla." |
7 changes: 7 additions & 0 deletions
7
administrator/language/en-GB/en-GB.plg_api-authentication_basic.sys.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
; Joomla! Project | ||
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
; Note : All ini files need to be saved as UTF-8 | ||
|
||
PLG_API-AUTHENTICATION_BASIC="API Authentication - Basic Auth" | ||
PLG_AUTH_AUTHENTICATION_BASIC_XML_DESCRIPTION="Used to allow basic authentication to webservices in Joomla." |
7 changes: 7 additions & 0 deletions
7
administrator/language/en-GB/en-GB.plg_webservices_content.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
; Joomla! Project | ||
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
; Note : All ini files need to be saved as UTF-8 | ||
|
||
PLG_WEBSERVICES_CONTENT="Webservices - Content" | ||
PLG_WEBSERVICES_CONTENT_XML_DESCRIPTION="Used to add articles routes to the API for your website." |
7 changes: 7 additions & 0 deletions
7
administrator/language/en-GB/en-GB.plg_webservices_content.sys.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
; Joomla! Project | ||
; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
; Note : All ini files need to be saved as UTF-8 | ||
|
||
PLG_WEBSERVICES_CONTENT="Webservices - Content" | ||
PLG_WEBSERVICES_CONTENT_XML_DESCRIPTION="Used to add articles routes to the API for your website." |
30 changes: 30 additions & 0 deletions
30
api/components/com_content/Controller/ArticleController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* @package Joomla.API | ||
* @subpackage com_content | ||
* | ||
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
namespace Joomla\Component\Content\Api\Controller; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\MVC\Controller\ApiController; | ||
|
||
/** | ||
* The article controller | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class ArticleController extends ApiController | ||
{ | ||
/** | ||
* The content type of the item. | ||
* | ||
* @var string | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
protected $contentType = 'articles'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* @package Joomla.API | ||
* @subpackage com_content | ||
* | ||
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
namespace Joomla\Component\Content\Api\View\Articles; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\MVC\View\JsonApiView as BaseApiView; | ||
|
||
/** | ||
* The article controller | ||
* | ||
* @since __DEPLOY_VERSION__ | ||
*/ | ||
class JsonapiView extends BaseApiView | ||
{ | ||
/** | ||
* The fields to render in the documents | ||
* | ||
* @var string | ||
*/ | ||
protected $fieldsToRender = ['id', 'typeAlias', 'asset_id', 'title', 'introtext', 'state', 'catid', 'created']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
/** | ||
* @package Joomla.API | ||
* | ||
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
// Saves the start time and memory usage. | ||
$startTime = microtime(1); | ||
$startMem = memory_get_usage(); | ||
|
||
if (file_exists(dirname(__DIR__) . '/defines.php')) | ||
{ | ||
include_once dirname(__DIR__) . '/defines.php'; | ||
} | ||
|
||
if (!defined('_JDEFINES')) | ||
{ | ||
define('JPATH_BASE', dirname(__DIR__)); | ||
require_once JPATH_BASE . '/includes/defines.php'; | ||
} | ||
|
||
require_once JPATH_BASE . '/includes/framework.php'; | ||
|
||
// Set profiler start time and memory usage and mark afterLoad in the profiler. | ||
JDEBUG ? JProfiler::getInstance('Application')->setStart($startTime, $startMem)->mark('afterLoad') : null; | ||
|
||
// Boot the DI container | ||
$container = \Joomla\CMS\Factory::getContainer(); | ||
|
||
/* | ||
* Alias the session service keys to the web session service as that is the primary session backend for this application | ||
* | ||
* In addition to aliasing "common" service keys, we also create aliases for the PHP classes to ensure autowiring objects | ||
* is supported. This includes aliases for aliased class names, and the keys for alised class names should be considered | ||
* deprecated to be removed when the class name alias is removed as well. | ||
*/ | ||
$container->alias('session', 'session.cli') | ||
->alias('JSession', 'session.cli') | ||
->alias(\Joomla\CMS\Session\Session::class, 'session.cli') | ||
->alias(\Joomla\Session\Session::class, 'session.cli') | ||
->alias(\Joomla\Session\SessionInterface::class, 'session.cli'); | ||
|
||
// Instantiate the application. | ||
$app = $container->get(\Joomla\CMS\Application\ApiApplication::class); | ||
|
||
// Set the application as global app | ||
\Joomla\CMS\Factory::$application = $app; | ||
|
||
// Execute the application. | ||
$app->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/** | ||
* @package Joomla.API | ||
* | ||
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
// Global definitions | ||
$parts = explode(DIRECTORY_SEPARATOR, JPATH_BASE); | ||
array_pop($parts); | ||
|
||
// Defines. | ||
define('JPATH_ROOT', implode(DIRECTORY_SEPARATOR, $parts)); | ||
define('JPATH_SITE', JPATH_ROOT); | ||
define('JPATH_CONFIGURATION', JPATH_ROOT); | ||
define('JPATH_ADMINISTRATOR', JPATH_ROOT . DIRECTORY_SEPARATOR . 'administrator'); | ||
define('JPATH_LIBRARIES', JPATH_ROOT . DIRECTORY_SEPARATOR . 'libraries'); | ||
define('JPATH_PLUGINS', JPATH_ROOT . DIRECTORY_SEPARATOR . 'plugins'); | ||
define('JPATH_INSTALLATION', JPATH_ROOT . DIRECTORY_SEPARATOR . 'installation'); | ||
define('JPATH_THEMES', JPATH_BASE . DIRECTORY_SEPARATOR . 'templates'); | ||
define('JPATH_CACHE', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'cache'); | ||
define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'manifests'); | ||
define('JPATH_API', JPATH_ROOT . DIRECTORY_SEPARATOR . 'api'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
/** | ||
* @package Joomla.API | ||
* | ||
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
// System includes | ||
require_once JPATH_LIBRARIES . '/bootstrap.php'; | ||
|
||
// Installation check, and check on removal of the install directory. | ||
if (!file_exists(JPATH_CONFIGURATION . '/configuration.php') | ||
|| (filesize(JPATH_CONFIGURATION . '/configuration.php') < 10) | ||
|| (file_exists(JPATH_INSTALLATION . '/index.php') && (false === (new JVersion)->isInDevelopmentState()))) | ||
{ | ||
if (file_exists(JPATH_INSTALLATION . '/index.php')) | ||
{ | ||
header('Location: ../installation/index.php'); | ||
|
||
exit(); | ||
} | ||
else | ||
{ | ||
echo 'No configuration file found and no installation code available. Exiting...'; | ||
|
||
exit; | ||
} | ||
} | ||
|
||
// Pre-Load configuration. Don't remove the Output Buffering due to BOM issues, see JCode 26026 | ||
ob_start(); | ||
require_once JPATH_CONFIGURATION . '/configuration.php'; | ||
ob_end_clean(); | ||
|
||
// System configuration. | ||
$config = new JConfig; | ||
|
||
// Set the error_reporting | ||
switch ($config->error_reporting) | ||
{ | ||
case 'default': | ||
case '-1': | ||
break; | ||
|
||
case 'none': | ||
case '0': | ||
error_reporting(0); | ||
|
||
break; | ||
|
||
case 'simple': | ||
error_reporting(E_ERROR | E_WARNING | E_PARSE); | ||
ini_set('display_errors', 1); | ||
|
||
break; | ||
|
||
case 'maximum': | ||
error_reporting(E_ALL); | ||
ini_set('display_errors', 1); | ||
|
||
break; | ||
|
||
case 'development': | ||
error_reporting(-1); | ||
ini_set('display_errors', 1); | ||
|
||
break; | ||
|
||
default: | ||
error_reporting($config->error_reporting); | ||
ini_set('display_errors', 1); | ||
|
||
break; | ||
} | ||
|
||
define('JDEBUG', $config->debug); | ||
|
||
unset($config); | ||
|
||
// System profiler | ||
if (JDEBUG) | ||
{ | ||
// @deprecated 4.0 - The $_PROFILER global will be removed | ||
$_PROFILER = JProfiler::getInstance('Application'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* @package Joomla.API | ||
* | ||
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
/** | ||
* NOTE: This file should remain compatible with PHP 5.2 to allow us to run our PHP minimum check and show a friendly error message | ||
*/ | ||
|
||
/** | ||
* Define the application's minimum supported PHP version as a constant so it can be referenced within the application. | ||
*/ | ||
define('JOOMLA_MINIMUM_PHP', '7.0'); | ||
|
||
if (version_compare(PHP_VERSION, JOOMLA_MINIMUM_PHP, '<')) | ||
{ | ||
die( | ||
str_replace( | ||
array('{{PHP_VERSION}}', '{{BASEPATH}}'), | ||
array(JOOMLA_MINIMUM_PHP, 'http://' . $_SERVER['SERVER_NAME'] . '/'), | ||
file_get_contents(dirname(__FILE__) . '/../templates/system/incompatible.html') | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* Constant that is checked in included files to prevent direct access. | ||
* define() is used rather than "const" to not error for PHP 5.2 and lower | ||
*/ | ||
define('_JEXEC', 1); | ||
|
||
// Run the application - All executable code should be triggered through this file | ||
require_once dirname(__FILE__) . '/includes/app.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.