<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    It could be that another app triggers the deprecation warning. Try
    to log the app id in <a class="moz-txt-link-freetext"
href="https://github.com/owncloud/core/blob/master/lib/private/appframework/dependencyinjection/dicontainer.php#L203">https://github.com/owncloud/core/blob/master/lib/private/appframework/dependencyinjection/dicontainer.php#L203</a>
    by using $c->query('AppName')
    <br>
    <br>
    getUserFolder has to be moved out of the container and into the
    IRootFolder interface, iirc theres an issue on github for this. For
    now you can simply request IRootFolder and go down one level further
    into a folder equal to the user id, like
    <br>
    <br>
    function __construct(OCP\Files\IRootFolder $rootFolder, $UserId) {
    <br>
        $this->rootFolder = $rootFolder;
    <br>
        $this->userId = $UserId;
    <br>
    }
    <br>
    ...
    <br>
    function someMethod () {
    <br>
    <br>
    $path = $this->userId;
    <br>
    if ($this->rootFolder->nodeExists($path)) {
    <br>
        $folder = $rootFolder->get($path);
    <br>
    } else {
    <br>
        $this->folder = $rootFolder->newFolder($path);
    <br>
    }
    <br>
    <br>
    <br>
    if you want the users files you can do
    <br>
    <br>
    $path = $userId . '/files'<br>
    <br>
    <div class="moz-cite-prefix">On 01/21/2015 02:36 PM, Tobia De
      Koninck wrote:<br>
    </div>
    <blockquote cite="mid:54BFAB76.20003@ledfan.be" type="cite">Thanks,
      I removed all occurrences of getServer and 'serverContainer'
      (search in files).
      <br>
      However I'm still getting the error.
      <br>
      <br>
      BTW the lib/private/server.php::getUserFolder is inaccessible this
      way.
      <br>
      <br>
      Cheers
      <br>
      <br>
      On 01/21/2015 10:14 AM, Bernhard Posselt wrote:
      <br>
      <blockquote type="cite">Querying the servercontainer directly was
        deprecated because you should not worry about where your classes
        come from. Either use automatic assembly or query the interface
        name like $c->query('OCP\IConfig') instead of
        $c->getServer()->getConfig().
        <br>
        <br>
        This provides the benefit that you dont have to redeclare the
        service on order to replace and test it. Before you might have
        done something like this (at least that was how the News app
        handled it):
        <br>
        <br>
        $container->registerService('CoreConfig', function ($c) {
        <br>
            return $c->query('ServerContainer')->getConfig();
        <br>
        });
        <br>
        <br>
        so that you can replace and test it in your integration tests
        like this:
        <br>
        <br>
        $app = new Application();
        <br>
        $container = $app->getContainer();
        <br>
        $this->config =
        $this->getMockBuilder('OCP\IConfig')->getMock();
        <br>
        $container->registerService('CoreConfig', function ($c) {
        <br>
            return $this->config;
        <br>
        });
        <br>
        <br>
        <br>
        <br>
        <br>
        On 01/21/2015 08:23 AM, Tobia De Koninck wrote:
        <br>
        <blockquote type="cite">Hey t
          <br>
          <br>
          I removed all query('servercontainer') and used getServer().
          However I still get some errors when accessing the Chat app
          and when accessing the files app.
          <br>
          <br>
          Is it possible that this is caused by some core functions?
          <br>
          <br>
          <br>
          Thanks!
          <br>
          <br>
          <br>
          On 01/21/2015 08:07 AM, Lukas Reschke wrote:
          <br>
          <blockquote type="cite">Either use the new automatic
            dependency assembly
            (<a class="moz-txt-link-freetext" href="http://doc.owncloud.org/server/8.0/developer_manual/app/container.html#use-automatic-dependency-assembly-recommended">http://doc.owncloud.org/server/8.0/developer_manual/app/container.html#use-automatic-dependency-assembly-recommended</a>)
            or do it like
            <a class="moz-txt-link-freetext" href="https://github.com/owncloud/core/pull/13349/files">https://github.com/owncloud/core/pull/13349/files</a>
            <br>
            <br>
            Sent from mobile device
            <br>
            <br>
            On 21 Jan 2015, at 07:47, Tobia De Koninck
            <<a class="moz-txt-link-abbreviated" href="mailto:tobia@ledfan.be">tobia@ledfan.be</a> <a class="moz-txt-link-rfc2396E" href="mailto:tobia@ledfan.be"><mailto:tobia@ledfan.be></a>>
            wrote:
            <br>
            <br>
            <blockquote type="cite">Hi
              <br>
              <br>
              I'm working on improving the dependency injection in the
              ownCloud chat app.  Before I injected the whole DI
              container, now only the classes I need. However my log is
              spammed with these errors:
              <br>
              <br>
              {"reqId":"a24609b5ab5558936d2279bb80468a29","remoteAddr":"33.33.33.1","app":"no
              app in context","message":"Accessing the server container
              is deprecated. Use type annotations to inject core
              services
instead!","level":0,"time":"2015-01-21T06:43:49+00:00","method":"POST","url":"\/index.php\/apps\/chat\/och\/api"}<br>
              <br>
              I think they are caused by calls like these:
              <a class="moz-txt-link-freetext" href="https://github.com/owncloud/chat/blob/master/app/chat.php#L221">https://github.com/owncloud/chat/blob/master/app/chat.php#L221</a>
              .
              <br>
              <br>
              PR: <a class="moz-txt-link-freetext" href="https://github.com/owncloud/chat/pull/193">https://github.com/owncloud/chat/pull/193</a>
              <br>
              <br>
              How can I solve this, without removing the DI container?
              <br>
              <br>
              Thanks!
              <br>
              <br>
              Met vriendelijke groeten / Best regards
              <br>
              <br>
              Tobia De Koninck
              <br>
              _______________________________________________
              <br>
              Devel mailing list
              <br>
              <a class="moz-txt-link-abbreviated" href="mailto:Devel@owncloud.org">Devel@owncloud.org</a> <a class="moz-txt-link-rfc2396E" href="mailto:Devel@owncloud.org"><mailto:Devel@owncloud.org></a>
              <br>
              <a class="moz-txt-link-freetext" href="http://mailman.owncloud.org/mailman/listinfo/devel">http://mailman.owncloud.org/mailman/listinfo/devel</a>
              <br>
            </blockquote>
            <br>
            <br>
            _______________________________________________
            <br>
            Devel mailing list
            <br>
            <a class="moz-txt-link-abbreviated" href="mailto:Devel@owncloud.org">Devel@owncloud.org</a>
            <br>
            <a class="moz-txt-link-freetext" href="http://mailman.owncloud.org/mailman/listinfo/devel">http://mailman.owncloud.org/mailman/listinfo/devel</a>
            <br>
          </blockquote>
          <br>
          Met vriendelijke groeten / Best regards
          <br>
          <br>
          Tobia De Koninck
          <br>
          <br>
          <br>
          <br>
          <br>
          _______________________________________________
          <br>
          Devel mailing list
          <br>
          <a class="moz-txt-link-abbreviated" href="mailto:Devel@owncloud.org">Devel@owncloud.org</a>
          <br>
          <a class="moz-txt-link-freetext" href="http://mailman.owncloud.org/mailman/listinfo/devel">http://mailman.owncloud.org/mailman/listinfo/devel</a>
          <br>
        </blockquote>
        <br>
        <br>
        <br>
        _______________________________________________
        <br>
        Devel mailing list
        <br>
        <a class="moz-txt-link-abbreviated" href="mailto:Devel@owncloud.org">Devel@owncloud.org</a>
        <br>
        <a class="moz-txt-link-freetext" href="http://mailman.owncloud.org/mailman/listinfo/devel">http://mailman.owncloud.org/mailman/listinfo/devel</a>
        <br>
      </blockquote>
      <br>
      Met vriendelijke groeten / Best regards
      <br>
      <br>
      Tobia De Koninck
      <br>
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Devel@owncloud.org">Devel@owncloud.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.owncloud.org/mailman/listinfo/devel">http://mailman.owncloud.org/mailman/listinfo/devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>