• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AppFramework\App类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: __construct

 public function __construct(array $urlParams = [])
 {
     parent::__construct('updater', $urlParams);
     $container = $this->getContainer();
     /**
      * Controllers
      */
     $container->registerService('UpdateController', function ($c) {
         return new UpdateController($c->query('AppName'), $c->query('Request'), $c->query('L10N'));
     });
     $container->registerService('BackupController', function ($c) {
         return new BackupController($c->query('AppName'), $c->query('Request'), $c->query('Config'), $c->query('L10N'));
     });
     $container->registerService('AdminController', function ($c) {
         return new AdminController($c->query('AppName'), $c->query('Request'), $c->query('Config'), $c->query('L10N'));
     });
     $container->registerService('L10N', function ($c) {
         return $c->query('ServerContainer')->getL10N($c->query('AppName'));
     });
     $container->registerService('Config', function ($c) {
         return new Config($c->query('ServerContainer')->getConfig());
     });
     $container->registerService('Channel', function ($c) {
         return new Channel($c->query('L10N'));
     });
     //Startup
     if (\OC_Util::getEditionString() === '') {
         \OCP\App::registerAdmin('updater', 'admin');
         $appPath = $container->query('Config')->getBackupBase();
         if (!@file_exists($appPath)) {
             Helper::mkdir($appPath);
         }
     }
 }
开发者ID:amin-hedayati,项目名称:updater,代码行数:34,代码来源:application.php


示例17: __construct

 public function __construct(array $urlParams = array())
 {
     parent::__construct('maps', $urlParams);
     $container = $this->getContainer();
     /**
      * Controllers
      */
     $container->registerService('PageController', function ($c) {
         return new PageController($c->query('AppName'), $c->query('Request'), $c->query('UserId'), $c->query('CacheManager'), $c->query('LocationManager'));
     });
     $container->registerService('LocationController', function ($c) {
         return new LocationController($c->query('AppName'), $c->query('Request'), $c->query('LocationManager'), $c->query('UserId'));
     });
     $container->registerService('CacheManager', function ($c) {
         return new CacheManager($c->query('ServerContainer')->getDb());
     });
     $container->registerService('LocationManager', function ($c) {
         return new LocationManager($c->query('ServerContainer')->getDb());
     });
     /**
      * Core
      */
     $container->registerService('UserId', function ($c) {
         return \OCP\User::getUser();
     });
     $container->registerService('Db', function () {
         return new Db();
     });
 }
开发者ID:amin-hedayati,项目名称:maps,代码行数:29,代码来源:application.php


示例18: __construct

 /**
  * @param array $urlParams
  */
 public function __construct(array $urlParams = array())
 {
     parent::__construct('settings', $urlParams);
     $container = $this->getContainer();
     /**
      * Controllers
      */
     $container->registerService('MailSettingsController', function (SimpleContainer $c) {
         return new MailSettingsController($c->query('AppName'), $c->query('Request'), $c->query('L10N'), $c->query('Config'), $c->query('UserSession'), $c->query('Defaults'), $c->query('Mail'), $c->query('DefaultMailAddress'));
     });
     /**
      * Core class wrappers
      */
     $container->registerService('Config', function (SimpleContainer $c) {
         return $c->query('ServerContainer')->getConfig();
     });
     $container->registerService('L10N', function (SimpleContainer $c) {
         return $c->query('ServerContainer')->getL10N('settings');
     });
     $container->registerService('UserSession', function (SimpleContainer $c) {
         return $c->query('ServerContainer')->getUserSession();
     });
     $container->registerService('Mail', function (SimpleContainer $c) {
         return new \OC_Mail();
     });
     $container->registerService('Defaults', function (SimpleContainer $c) {
         return new \OC_Defaults();
     });
     $container->registerService('DefaultMailAddress', function (SimpleContainer $c) {
         return Util::getDefaultEmailAddress('no-reply');
     });
 }
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:35,代码来源:application.php


示例19: __construct

 /**
  * Creates an Application object and registers its related services,
  * user hooks, and settings 
  */
 public function __construct(array $urlParams = array())
 {
     parent::__construct(self::APP_ID, $urlParams);
     $this->registerServices();
     $this->registerHooks();
     $this->registerSettings();
 }
开发者ID:RepoHell,项目名称:agreedisclaimer,代码行数:11,代码来源:application.php


示例20: __construct

	public function __construct (array $urlParams=array()) {
		parent::__construct('ownnote', $urlParams);

		$container = $this->getContainer();

		/**
		 * Controllers
		 */
		$container->registerService('PageController', function(IContainer $c) {
			return new PageController(
				$c->query('AppName'), 
				$c->query('Request'),
				$c->query('UserId')
			);
		});

                $container->registerService('OwnnoteApiController', function($c){
                        return new OwnnoteApiController(
                                $c->query('AppName'),
                                $c->query('Request')
                        );
                });


		/**
		 * Core
		 */
		$container->registerService('UserId', function(IContainer $c) {
			return \OCP\User::getUser();
		});		
		
	}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:32,代码来源:application.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AppFramework\Controller类代码示例发布时间:2022-05-23
下一篇:
PHP App\IAppManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap