Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.8] Namespace document #16367

Closed
wants to merge 13 commits into from
Closed

Conversation

fastslack
Copy link
Contributor

Namespace for document classes

Summary of Changes

Move /libraries/joomla/document to /libraries/src/Joomla/CMS/Document

Testing Instructions

Apply patch and try to create one article

Expected result

No errors

@fastslack fastslack changed the title Namespace document [3.8] Namespace document May 30, 2017
@mbabker
Copy link
Contributor

mbabker commented May 30, 2017

This has test issues.

Error displaying the error page: Application Instantiation Error: include_once(/home/travis/build/joomla/joomla-cms/libraries/joomla/document/html/renderer/component.php): failed to open stream: No such file or directory

@fastslack
Copy link
Contributor Author

@mbabker I removed that files because are duplicated and are not needed any more. Look at the files, there is only mapping to deprecated files.

https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/document/html/renderer/component.php

We can solve compatibilities issues in classmap.php file.

https://github.com/fastslack/joomla-cms/blob/namespace-document/libraries/classmap.php#L191

Maybe we should remove that tests

@mbabker
Copy link
Contributor

mbabker commented May 31, 2017

We don't need the format in the short class section for the renderers. So for example instead of Joomla\CMS\Document\Renderer\Html\RendererHtmlComponent we can do something like Joomla\CMS\Document\Renderer\Html\ComponentRenderer.

@mbabker
Copy link
Contributor

mbabker commented May 31, 2017

OK, one more pedantic change, then there's one concern we need to quickly look over. For the document classes, can you change it to <format>Document instead of Document<format>?

The concern - we have some files here that have multiple classes in them. I think this would be a good time to move them out to separate files.

}
// Default to the raw format
else
{
$ntype = $type;
$class = 'JDocumentRaw';
$class = 'DocumentRaw';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespace is missing, or?


if (!class_exists($class))
{
// "Legacy" class name structure
$class = 'JDocumentRenderer' . $type;
$class = 'DocumentRenderer' . $type;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespace is missing, or?

*
* @since 11.1
*/
class JOpenSearchUrl
class OpenSearchUrl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This classe should be moved to its own file.

@@ -264,11 +268,11 @@ class JOpenSearchUrl
}

/**
* JOpenSearchImage is an internal class that stores Images for the OpenSearch Description
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This classe should be moved to its own file.

*
* @since 11.1
*/
class JOpenSearchImage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This classe should be moved to its own file.

@@ -78,7 +81,7 @@ public function getName()
*
* @param string $name Document name
*
* @return JDocumentXml instance of $this to allow chaining
* @return JXmlDocument instance of $this to allow chaining
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J needs to be removed.

@laoneo
Copy link
Member

laoneo commented Jul 17, 2017

Thanks!

// New class name format adds the format type to the class name
$class = 'JDocumentRenderer' . ucfirst($this->getType()) . ucfirst($type);
// Determine the path and class
$class = __NAMESPACE__ . '\\Renderer\\' . ucfirst($this->getType()) . '\\Renderer' . ucfirst($this->getType()) . ucfirst($type);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm reading this line right it's not building the correct namespaced class names.

*
* @since 11.1
*/
class JFeedItem
class FeedItem
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the other classes in this file should move to separate files now.

@mbabker
Copy link
Contributor

mbabker commented Jul 28, 2017

Fixed the items I pointed out and merged to staging.

@mbabker mbabker closed this Jul 28, 2017
@mbabker mbabker added this to the Joomla 3.8.0 milestone Jul 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants