当前位置: 首页>>代码示例>>PHP>>正文


PHP AppFramework\App类代码示例

本文整理汇总了PHP中OCP\AppFramework\App的典型用法代码示例。如果您正苦于以下问题:PHP App类的具体用法?PHP App怎么用?PHP App使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了App类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postDeleteUser

 public static function postDeleteUser($parameters)
 {
     $app = new App('sipgate');
     $container = $app->getContainer();
     $logger = $container->query('OCP\\ILogger');
     $logger->warn('hello!');
 }
开发者ID:pigulla,项目名称:owncloud-sipgate,代码行数:7,代码来源:userhooks.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $app = new App('popcornapp');
     $this->container = $app->getContainer();
     //echo var_dump($userSession);
     $this->controller = new XML('Test', array('/data/Pictures/holiday1.jpg', '/data/Pictures/holiday2.jpg', '/data/Pictures/holiday3.jpg', '/data/Pictures/holiday4.jpg'), 1);
 }
开发者ID:camilasan,项目名称:popcornapp,代码行数:8,代码来源:XmlTest.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $app = new App('popcornapp');
     $this->container = $app->getContainer();
     $this->request = $this->getMockBuilder('OCP\\IRequest')->getMock();
     //echo var_dump($userSession);
     $this->controller = new MltController('popcornapp', $this->request);
 }
开发者ID:camilasan,项目名称:popcornapp,代码行数:9,代码来源:MltControllerTest.php

示例4: setUp

 public function setUp()
 {
     $app = new App('notes');
     $container = $app->getContainer();
     $container->registerService('UserId', function ($c) {
         return $this->userId;
     });
     $this->controller = $container->query('OCA\\Notes\\Controller\\NotesApiController');
     $this->fs = $container->query('OCP\\Files\\IRootFolder');
     $this->fs->newFolder($this->notesFolder);
 }
开发者ID:cg19910712,项目名称:notes,代码行数:11,代码来源:NotesApiControllerTest.php

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     $app = new App('ownnotes');
     $container = $app->getContainer();
     // only replace the user id
     $container->registerService('UserId', function ($c) {
         return $this->userId;
     });
     $this->controller = $container->query('OCA\\OwnNotes\\Controller\\NoteController');
     $this->mapper = $container->query('OCA\\OwnNotes\\Db\\NoteMapper');
 }
开发者ID:tzkmx,项目名称:app-tutorial,代码行数:12,代码来源:NoteIntegrationTest.php

示例6: __construct

 public function __construct()
 {
     $app = new App('sipgate');
     $this->container = $app->getContainer();
     $this->appName = $this->container->query('AppName');
     $this->db = $this->container->query('OCP\\IDBConnection');
     $this->config = $this->container->query('OCP\\IConfig');
     $this->logger = $this->container->query('OCA\\Sipgate\\Service\\AppLogger');
     $this->appSettings = $this->container->query('OCA\\Sipgate\\Service\\AppSettings');
     $reflect = new \ReflectionClass($this);
     $logSuffix = mb_strtolower($reflect->getShortName());
     $this->logger->setSuffix($logSuffix);
     // Run every 15 Minutes
     $this->setInterval(15 * 60);
 }
开发者ID:pigulla,项目名称:owncloud-sipgate,代码行数:15,代码来源:base.php

示例7: __construct

 public function __construct(array $urlParams = array())
 {
     parent::__construct('bookmarks', $urlParams);
     $container = $this->getContainer();
     /**
      * Controllers
      * @param OC\AppFramework\Utility\SimpleContainer $c The Container instance
      *													 that handles the request
      */
     $container->registerService('WebViewController', function ($c) {
         return new WebViewController($c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('ServerContainer')->getURLGenerator(), $c->query('ServerContainer')->getDb());
     });
     $container->registerService('BookmarkController', function ($c) {
         return new BookmarkController($c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('ServerContainer')->getDb());
     });
     $container->registerService('TagsController', function ($c) {
         return new TagsController($c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('ServerContainer')->getDb());
     });
     $container->registerService('PublicController', function ($c) {
         return new PublicController($c->query('AppName'), $c->query('Request'), $c->query('ServerContainer')->getDb(), $c->query('ServerContainer')->getUserManager());
     });
     /**
      * Core
      */
     $container->registerService('UserId', function () {
         return \OCP\User::getUser();
     });
 }
开发者ID:woodworker,项目名称:bookmarks,代码行数:28,代码来源:application.php

示例8: __construct

 public function __construct(array $urlParams = array())
 {
     parent::__construct('tasks', $urlParams);
     $container = $this->getContainer();
     /**
      * Controllers
      */
     $container->registerService('PageController', function ($c) {
         return new PageController($c->query('AppName'), $c->query('Request'), $c->query('UserId'));
     });
     $container->registerService('CollectionsController', function ($c) {
         return new CollectionsController($c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('L10N'), $c->query('Settings'));
     });
     $container->registerService('ListsController', function ($c) {
         return new ListsController($c->query('AppName'), $c->query('Request'), $c->query('UserId'));
     });
     $container->registerService('SettingsController', function ($c) {
         return new SettingsController($c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('Settings'));
     });
     $container->registerService('TasksController', function ($c) {
         return new TasksController($c->query('AppName'), $c->query('Request'), $c->query('UserId'));
     });
     /**
      * Core
      */
     $container->registerService('UserId', function ($c) {
         return \OCP\User::getUser();
     });
     $container->registerService('L10N', function ($c) {
         return $c->query('ServerContainer')->getL10N($c->query('AppName'));
     });
     $container->registerService('Settings', function ($c) {
         return $c->query('ServerContainer')->getConfig();
     });
 }
开发者ID:msbt,项目名称:tasks,代码行数:35,代码来源:application.php

示例9: __construct

 /**
  * Define your dependencies in here
  */
 public function __construct(array $urlParams = array())
 {
     parent::__construct('user_files_restore', $urlParams);
     $container = $this->getContainer();
     /**
      * Controllers
      */
     $container->registerService('PageController', function ($c) {
         return new PageController($c->query('AppName'), $c->query('Request'), $c->query('L10N'), $c->query('RequestService'), $c->query('UserId'));
     });
     $container->registerService('RequestController', function ($c) {
         return new RequestController($c->query('AppName'), $c->query('Request'), $c->query('L10N'), $c->query('RequestMapper'), $c->query('UserId'));
     });
     /**
      * Services
      */
     $container->registerService('RequestService', function ($c) {
         return new RequestService($c->query('RequestMapper'), $c->query('UserId'), $c->query('L10N'));
     });
     /**
      * Database Layer
      */
     $container->registerService('RequestMapper', function ($c) {
         return new RequestMapper($c->query('ServerContainer')->getDb(), $c->query('L10N'));
     });
     /**
      * Core
      */
     $container->registerService('UserId', function ($c) {
         return \OCP\User::getUser();
     });
     $container->registerService('L10N', function ($c) {
         return $c->query('ServerContainer')->getL10N($c->query('AppName'));
     });
 }
开发者ID:CNRS-DSI-Dev,项目名称:user_files_restore,代码行数:38,代码来源:user_files_restore.php

示例10: __construct

 public function __construct(array $urlParams = array())
 {
     parent::__construct('weather', $urlParams);
     $container = $this->getContainer();
     /**
      * Core
      */
     $container->registerService('UserId', function (IContainer $c) {
         return \OCP\User::getUser();
     });
     /**
      * Database Layer
      */
     $container->registerService('CityMapper', function (IContainer $c) {
         return new CityMapper($c->query('ServerContainer')->getDb());
     });
     $container->registerService('SettingsMapper', function (IContainer $c) {
         return new SettingsMapper($c->query('ServerContainer')->getDb());
     });
     /**
      * Controllers
      */
     $container->registerService('CityController', function (IContainer $c) {
         return new CityController($c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('CityMapper'), $c->query('SettingsMapper'));
     });
     $container->registerService('SettingsController', function (IContainer $c) {
         return new SettingsController($c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('SettingsMapper'), $c->query('CityMapper'));
     });
     $container->registerService('WeatherController', function (IContainer $c) {
         return new WeatherController($c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('CityMapper'), $c->query('SettingsMapper'));
     });
 }
开发者ID:nerzhul,项目名称:owncloud-weather,代码行数:32,代码来源:application.php

示例11: __construct

 /**
  * Define your dependencies in here
  */
 public function __construct(array $urlParams = array())
 {
     parent::__construct('user_account_actions', $urlParams);
     $container = $this->getContainer();
     /**
      * Controllers
      */
     $container->registerService('UserHooks', function ($c) {
         return new UserHooks($c->query('ServerContainer')->getUserManager(), $c->query('MailAction'), $c->query('FileAction'));
     });
     /**
      * Lib
      */
     $container->registerService('MailAction', function ($c) {
         return new MailAction($c->query('AppName'), $c->query('L10N'), $c->query('Config'));
     });
     $container->registerService('FileAction', function ($c) {
         return new FileAction($c->query('AppName'), $c->query('L10N'), $c->query('Config'), $c->query('Logger'));
     });
     /**
      * Core
      */
     $container->registerService('Config', function ($c) {
         return $c->query('ServerContainer')->getConfig();
     });
     $container->registerService('L10N', function ($c) {
         return $c->query('ServerContainer')->getL10N($c->query('AppName'));
     });
     $container->registerService('Logger', function ($c) {
         return $c->query('ServerContainer')->getLogger();
     });
 }
开发者ID:Victor-Bordage-Gorry,项目名称:user_account_actions,代码行数:35,代码来源:user_account_actions.php

示例12: __construct

 public function __construct(array $urlParams = array())
 {
     parent::__construct('exifview', $urlParams);
     $container = $this->getContainer();
     //		$container->registerService('RootView', function ($c) {
     //			return \OC\files::getView();
     //		});
     $container->registerService('PageController', function ($c) {
         return new PageController($c->query('AppName'), $c->query('UserId'), $c->query('Request'), $c->query('ServerContainer')->getUserFolder());
     });
     $container->registerService('GpsXML', function ($c) {
         return new GpsXML($c->query('AppName'), $c->query('UserId'), $c->query('ServerContainer')->getDbConnection());
     });
     $container->registerService('UserStorage', function ($c) {
         return $c->query('ServerContainer')->getUserFolder();
     });
     $container->registerService('JsonController', function ($c) {
         return new JsonController($c->query('AppName'), $c->query('UserId'), $c->query('Request'), $c->query('GpsXML'));
     });
     //		$container->registerService('TestService', function($c) {
     //			return new TestService(
     //				$c->query('ServerContainer')->getDbConnection()
     //			);
     //		});
     //		$container->registerService('TestController', function($c){
     //			return new TestController(
     //				$c->query('AppName'),
     //				$c->query('UserId'),
     //				$c->query('Request'),
     //				$c->query('TestService')
     //			);
     //		});
 }
开发者ID:sken2,项目名称:oc_gpstracks,代码行数:33,代码来源:application.php

示例13: __construct

 public function __construct(array $urlParams = array())
 {
     parent::__construct('files_mv', $urlParams);
     $container = $this->getContainer();
     $container->registerService('UserFolder', function (IContainer $c) {
         return $c->query('ServerContainer')->getUserFolder();
     });
     $container->registerService('ActivityApplication', function ($c) {
         return new \OCA\Activity\AppInfo\Application();
     });
     $container->registerService('Hooks', function (IContainer $c) {
         /** @var \OC\Server $server */
         $server = $c->query('ServerContainer');
         return new Hook($server->getActivityManager(), $c->query('ActivityApplication')->getContainer()->query('ActivityData'), $c->query('ActivityApplication')->getContainer()->query('UserSettings'), $server->getGroupManager(), new View(''), $server->getDatabaseConnection(), $c->query('CurrentUID'));
     });
     $container->registerService('FilesHook', function ($c) {
         return new FilesHook($c->query('ServerContainer')->getRootFolder(), $c->query('Hooks'));
     });
     $container->registerService('CurrentUID', function (IContainer $c) {
         /** @var \OC\Server $server */
         $server = $c->query('ServerContainer');
         $user = $server->getUserSession()->getUser();
         return $user ? $user->getUID() : '';
     });
 }
开发者ID:yheric455042,项目名称:files_mv,代码行数:25,代码来源:application.php

示例14: __construct

 public function __construct(array $urlParams = array())
 {
     parent::__construct('files', $urlParams);
     $container = $this->getContainer();
     $server = $container->getServer();
     /**
      * Controllers
      */
     $container->registerService('APIController', function (IContainer $c) use($server) {
         return new ApiController($c->query('AppName'), $c->query('Request'), $server->getUserSession(), $c->query('TagService'), $server->getPreviewManager(), $server->getShareManager(), $server->getConfig());
     });
     $container->registerService('ViewController', function (IContainer $c) use($server) {
         return new ViewController($c->query('AppName'), $c->query('Request'), $server->getURLGenerator(), $server->getNavigationManager(), $c->query('L10N'), $server->getConfig(), $server->getEventDispatcher(), $server->getUserSession(), $server->getAppManager(), $server->getRootFolder());
     });
     /**
      * Core
      */
     $container->registerService('L10N', function (IContainer $c) {
         return $c->query('ServerContainer')->getL10N($c->query('AppName'));
     });
     /**
      * Services
      */
     $container->registerService('Tagger', function (IContainer $c) {
         return $c->query('ServerContainer')->getTagManager()->load('files');
     });
     $container->registerService('TagService', function (IContainer $c) {
         $homeFolder = $c->query('ServerContainer')->getUserFolder();
         return new TagService($c->query('ServerContainer')->getUserSession(), $c->query('Tagger'), $homeFolder);
     });
     /*
      * Register capabilities
      */
     $container->registerCapability('OCA\\Files\\Capabilities');
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:35,代码来源:Application.php

示例15: __construct

 public function __construct(array $urlParams = array())
 {
     parent::__construct('documents', $urlParams);
     $container = $this->getContainer();
     /**
      * Controllers
      */
     $container->registerService('UserController', function ($c) {
         return new UserController($c->query('AppName'), $c->query('Request'));
     });
     $container->registerService('SessionController', function ($c) {
         return new SessionController($c->query('AppName'), $c->query('Request'), $c->query('Logger'), $c->query('UserId'));
     });
     $container->registerService('DocumentController', function ($c) {
         return new DocumentController($c->query('AppName'), $c->query('Request'), $c->query('CoreConfig'), $c->query('L10N'), $c->query('UserId'));
     });
     $container->registerService('SettingsController', function ($c) {
         return new SettingsController($c->query('AppName'), $c->query('Request'), $c->query('CoreConfig'), $c->query('Logger'), $c->query('L10N'), $c->query('UserId'));
     });
     /**
      * Core
      */
     $container->registerService('Logger', function ($c) {
         return $c->query('ServerContainer')->getLogger();
     });
     $container->registerService('CoreConfig', function ($c) {
         return $c->query('ServerContainer')->getConfig();
     });
     $container->registerService('L10N', function ($c) {
         return $c->query('ServerContainer')->getL10N($c->query('AppName'));
     });
     $container->registerService('UserId', function () {
         return \OCP\User::getUser();
     });
 }
开发者ID:Ebimedia,项目名称:owncloud,代码行数:35,代码来源:application.php


注:本文中的OCP\AppFramework\App类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。