PHP5 two call symbols (-) where is the last function called?

Source: Internet
Author: User
$app = Jfactory::getapplication ();
$app->login ();

Finally, what are the characteristics of this login () function in which class can be found, how should we find the source code of this function?

Jfactory::getapplication (); The source code is probably the following: it is not clear what the login function and the Getapplication function are related to.

Abstract class Jfactory {public static function getapplication ($id = null, $config = Array (), $prefix = ' J ') {if (!self:: $a pplication) {if (! $id) {jerror::raiseerror ($, ' Application instantiation Error ');} Self:: $application = Japplication::getinstance ($id, $config, $prefix);} Return self:: $application;}}


Reply to discussion (solution)

Jfactory is an abstract class and cannot be instantiated by itself
So there must be a class to inherit him
So all class XXXXX extends jfactory are possible

Jfactory is abstract, not an example of it. $app->login ();??? Out?.

Jfactory, look, the name should be a factory.
Jfactory::getapplication returns an object pointer based on a parameter
Self:: $application = Japplication::getinstance ($id, $config, $prefix);
$app exactly which class to go to japplication::getinstance here to find it

The IDE tool CTRL + Click will track to this method ...

Jfactory is abstract, not an example of it. $app->login ();??? Out?.


There's no mistake. This is someone else's code I asked.

Jfactory, look, the name should be a factory.
Jfactory::getapplication returns an object pointer based on a parameter
Self:: $application = Japplication::getinstance ($id, $config, $prefix);
$app exactly which class to go to japplication::getinstance here to find it



There are really, too. Thank you..
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.