[Owncloud] How to autoload my class?

Naruto cartment idiot 125997125 at qq.com
Wed Jun 5 13:34:32 UTC 2013


Dear owncloud team:
     Sorry for my poor english!
     I saw the source code and most PHP Files do not use 'include' and 'require' to load the class PHP File,i got confused,Maybe i am a new PHPer...
     If i create my Class file in /lib , how i can autoload it?
     I have read the document about how to develop an app.But i am interested about the core function..
     By the way,in /settings/users.php,there is a code like:
     $accessibleusers = OC_User::getDisplayNames('', 30);
     I guess OC_User::getDisplayNames is used to get the users array,it work ok in users page.
     But i create a test.php,the code is like:
    <?php
        include'lib/test.php';
        $test=new Test();
        $user=$test->getUsers();
        print_r($user);
        //exit;
    ?>
    and open the file in browser ,i got a empty array.
    What's Wrong?...
    Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/owncloud/attachments/20130605/3a775d17/attachment.html>


More information about the Owncloud mailing list