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

PHP Application类代码示例

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

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



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

示例1: testGetFormRequestPost

 function testGetFormRequestPost()
 {
     $app = new Application();
     $_POST['post'] = "Today I learnt that you can only treat your friends so badly before they quit working for you and go and work for Halutte(sp)";
     $array = $app->getArrayFromRequest();
     $this->assertEquals("Today I learnt that you can only treat your friends so badly before they quit working for you and go and work for Halutte(sp)", $array['post']);
 }
开发者ID:BigKBear,项目名称:drive_safe,代码行数:7,代码来源:request_test.php


示例2: __construct

 public function __construct($message, $code)
 {
     Log::add($message . 'URI: ' . $_SERVER['REQUEST_URI'], $code);
     if (!DEV) {
         switch ($code) {
             case 500:
                 Fw_Request::setGet('hard_controller', 'err');
                 Fw_Request::setGet('hard_action', 'error' . $code);
                 $error_app = new Application();
                 $error_app->run();
                 die;
                 break;
             case 404:
             default:
                 Fw_Request::setGet('hard_controller', 'err');
                 Fw_Request::setGet('hard_action', 'error' . $code);
                 $error_app = new Application();
                 $error_app->run();
                 die;
                 break;
         }
     }
     $code = 0;
     parent::__construct($message);
 }
开发者ID:roket007,项目名称:bicycle,代码行数:25,代码来源:exception.php


示例3: post

 /**
  * Implementation for 'POST' method for Rest API
  *
  * @param  mixed $appUid Primary key
  *
  * @return array $result Returns array within multiple records or a single record depending if
  *                       a single selection was requested passing id(s) as param
  */
 protected function post($appUid, $appNumber, $appParent, $appStatus, $proUid, $appProcStatus, $appProcCode, $appParallel, $appInitUser, $appCurUser, $appCreateDate, $appInitDate, $appFinishDate, $appUpdateDate, $appData, $appPin)
 {
     try {
         $result = array();
         $obj = new Application();
         $obj->setAppUid($appUid);
         $obj->setAppNumber($appNumber);
         $obj->setAppParent($appParent);
         $obj->setAppStatus($appStatus);
         $obj->setProUid($proUid);
         $obj->setAppProcStatus($appProcStatus);
         $obj->setAppProcCode($appProcCode);
         $obj->setAppParallel($appParallel);
         $obj->setAppInitUser($appInitUser);
         $obj->setAppCurUser($appCurUser);
         $obj->setAppCreateDate($appCreateDate);
         $obj->setAppInitDate($appInitDate);
         $obj->setAppFinishDate($appFinishDate);
         $obj->setAppUpdateDate($appUpdateDate);
         $obj->setAppData($appData);
         $obj->setAppPin($appPin);
         $obj->save();
     } catch (Exception $e) {
         throw new RestException(412, $e->getMessage());
     }
 }
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:34,代码来源:Application.php


示例4: __construct

 /**
  * Конструктор (проверка авторизации):
  */
 public function __construct(Application $application, Template $template)
 {
     $session = Session::getInstance();
     if (!$session->isAdminSession()) {
         die($application->go('errors_error403'));
     }
 }
开发者ID:postman0,项目名称:1chan,代码行数:10,代码来源:admin.controller.php


示例5: AdminList

 public function AdminList(\Application $application)
 {
     $ret = '<h1>Manage plugins</h1>
         <div class="table-wrapper"><form action="" method="POST"><table><tr><th>Plugin Name</th><th>Active</th><th>Description</th><th>Version</th></tr>';
     $installed = $this->model->InstalledPlugins();
     foreach ($this->model->GetAvailablePlugins() as $available => $facade) {
         $data = $application->GetPluginMeta($available);
         if (!in_array($available, $application->GetConstantPlugins())) {
             $ret .= '<tr><td>' . (!empty($data->Name) ? $data->Name : $available) . '</td>
             <td>
             <div class="onoffswitch">
                 <input type="hidden" name="plugin[' . $available . '][action]" value="' . (!in_array($available, $installed) ? 'uninstalled' : '') . '"/>
                 <input type="checkbox" name="plugin[' . $available . '][value]" id="myonoffswitch_' . $available . '" class="onoffswitch-checkbox checkbox-submit" ' . (in_array($available, $installed) ? 'checked="checked"' : '') . '/>
                 <label class="onoffswitch-label" for="myonoffswitch_' . $available . '">
                     <span class="onoffswitch-inner"></span>
                     <span class="onoffswitch-switch"></span>
                 </label>
             </div>
             </td>
             <td>' . (!empty($data->Description) ? $data->Description : '<em>Unavailable</em>') . '</td>
             <td>' . (!empty($data->Version) ? $data->Version : '<em>Unavailable</em>') . '</td></tr>';
         }
     }
     return $ret . '</table></div><input type="hidden" name="placeholder" value="1"/><button type="submit" name="submit">Submit</button></form>';
 }
开发者ID:ehamrin,项目名称:cmsPlugin,代码行数:25,代码来源:PluginHandler.php


示例6: createDatabase

 private static function createDatabase()
 {
     $application = new Application(static::$kernel);
     // drop the database
     $command = new DropDatabaseDoctrineCommand();
     $application->add($command);
     $input = new ArrayInput(array('command' => 'doctrine:database:drop', '--force' => true));
     $command->run($input, new NullOutput());
     // we have to close the connection after dropping the database
     //  so we don't get "No database selected" error
     $connection = $application->getKernel()->getContainer()->get('doctrine')->getConnection();
     if ($connection->isConnected()) {
         $connection->close();
     }
     // create the database
     $command = new CreateDatabaseDoctrineCommand();
     $application->add($command);
     $input = new ArrayInput(array('command' => 'doctrine:database:create'));
     $command->run($input, new NullOutput());
     // create the database
     $command = new CreateSchemaDoctrineCommand();
     $application->add($command);
     $input = new ArrayInput(array('command' => 'doctrine:schema:create', '--em' => 'default'));
     $command->run($input, new NullOutput());
     // get the Entity Manager
     $em = static::$kernel->getContainer()->get('doctrine')->getManager();
     // load fixtures
     $client = static::createClient();
     $loader = new ContainerAwareLoader($client->getContainer());
     $loader->loadFromDirectory(static::$kernel->locateResource('@MainBundle/DataFixtures/ORM'));
     $purger = new ORMPurger($em);
     $executor = new ORMExecutor($em, $purger);
     $executor->execute($loader->getFixtures());
 }
开发者ID:donatienthorez,项目名称:sf_mobilIT_backEnd,代码行数:34,代码来源:BaseController.php


示例7: __construct

 /**
  * @param array $app
  * @param array $config
  * @throws AppException
  */
 public function __construct($app, $config = array())
 {
     parent::__construct($app, $config);
     $this->_jbrequest = $this->app->jbrequest;
     $task = $this->_jbrequest->getWord('task');
     $ctrl = $this->_jbrequest->getCtrl();
     if (!method_exists($this, $task)) {
         throw new AppException('Action method not found!  ' . $ctrl . ' :: ' . $task . '()');
     }
     // internal vars
     $this->application = $this->app->zoo->getApplication();
     $this->_params = $this->application->getParams('frontpage');
     $this->joomla = $this->app->system->application;
     $isSite = $this->app->jbenv->isSite();
     if (!$isSite) {
         $this->app->document->addStylesheet("root:administrator/templates/system/css/system.css");
         $this->app->jbassets->uikit(true, true);
         $this->_setToolbarTitle();
     } else {
         $this->params = $this->joomla->getParams();
         $this->pathway = $this->joomla->getPathway();
         $this->app->jbassets->setAppCSS();
         $this->app->jbassets->setAppJS();
     }
     $this->_config = JBModelConfig::model();
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:31,代码来源:base.php


示例8: createResponse

 /**
  * {@inheritdoc}
  */
 public function createResponse(Application $application, Request $request, Socket $socket) : Response
 {
     if (!$request->hasHeader('Sec-WebSocket-Key')) {
         $sink = new MemorySink('No WebSocket key header provided.');
         return new BasicResponse(Response::BAD_REQUEST, ['Connection' => 'close', 'Content-Length' => $sink->getLength()], $sink);
     }
     $headers = ['Connection' => 'upgrade', 'Upgrade' => 'websocket', 'Sec-WebSocket-Accept' => $this->responseKey(trim($request->getHeader('Sec-WebSocket-Key')))];
     if ($application instanceof SubProtocol) {
         $protocol = $application->selectSubProtocol(array_map('trim', explode(',', $request->getHeader('Sec-WebSocket-Protocol'))));
         if (strlen($protocol)) {
             $headers['Sec-WebSocket-Protocol'] = $protocol;
         }
     }
     /*
     $extensions = $application->selectExtensions(
         array_map('trim', explode(',', $request->getHeader('Sec-WebSocket-Extensions')))
     );
     
     if (!empty($extensions)) {
         $headers['Sec-WebSocket-Extensions'] = $extensions;
     }
     */
     $response = new BasicResponse(Response::SWITCHING_PROTOCOLS, $headers);
     $connection = $this->createConnection($response, $socket, false);
     return new WebSocketResponse($application, $connection, $response);
 }
开发者ID:icicleio,项目名称:websocket,代码行数:29,代码来源:Rfc6455Protocol.php


示例9: StartCurator

/**
 * Preps the application for running, then runs it. If this function is called more than once, an E_USER_ERROR is triggered.
 * 
 * @param string $root_dir The path to the root of the installation.
 * @return void
 */
function StartCurator()
{
    static $did_start = false;
    // set up the exit status.
    $exit_status = 0;
    // make sure this is only run once.
    if ($did_start === false) {
        $autoload = Autoload::singleton();
        // configure the autoloader.
        try {
            $autoload->setBaseDir(CURATOR_APP_DIR);
            $autoload->register();
        } catch (\Exception $e) {
            Console::stderr('** Could not register the autoloader:');
            Console::stderr('   ' . $e->getMessage());
            die;
        }
        // once the autoloader is in place, we are started up.
        $did_start = true;
        try {
            $app = new Application();
            $exit_status = $app->run();
        } catch (\Exception $e) {
            Console::stderr('** Could not run the application:');
            Console::stderr('   ' . $e->getMessage());
            die;
        }
    } else {
        // if we are called again, bail.
        trigger_error('StartCurator called after already being called.', E_USER_ERROR);
    }
    // send the status back.
    return $exit_status;
}
开发者ID:hscale,项目名称:curator,代码行数:40,代码来源:Bootstrap.php


示例10: __construct

 /**
  *
  * @param clagiordano\weblibs\mvc\Application $application
  * @return clagiordano\weblibs\mvc\Controller
  */
 public function __construct(Application $application)
 {
     $this->application = $application;
     $this->request = new Request();
     $this->application->getRegistry()->requestType = $this->request->getType();
     $this->application->getRegistry()->requestData = $this->request->getData();
 }
开发者ID:clagiordano,项目名称:weblibs-mvc,代码行数:12,代码来源:Controller.php


示例11: Application

 /**
 	Get core application class
 		@public
 	**/
 static function &getApplication()
 {
     static $app;
     // create if don't exists
     if (!is_object($app)) {
         // single app instance only
         if (isset($GLOBALS['_globalapp'])) {
             $app = $GLOBALS['_globalapp'];
         } else {
             $app = new Application();
             // config
             $config =& Factory::getConfig();
             $app->set('config', $config);
             // authentication
             $auth =& Factory::getAuth();
             $app->set('auth', $auth);
             // set our timezone
             if (isset($config->timezone)) {
                 @(list($tz_script, $tz_db) = explode('|', $config->timezone));
                 date_default_timezone_set($tz_script);
             }
             $GLOBALS['_globalapp'] = $app;
         }
     }
     return $app;
 }
开发者ID:rudenyl,项目名称:kcms,代码行数:30,代码来源:framework.php


示例12: generatePage

 public function generatePage($view, $data = array())
 {
     $app = new Application();
     $template = $app->getTemplate();
     include $template;
     //include PATH_SITE.'/templates/default_theme/index.php';
 }
开发者ID:moomot,项目名称:Simple-MVC-CMS,代码行数:7,代码来源:view.php


示例13: newApplication

 /**
  * Helper function to create a new application with a new keypair.
  * @param type $title
  * @return \IdnoPlugins\OAuth2\Application
  */
 public static function newApplication($title)
 {
     $app = new Application();
     $app->setTitle($title);
     $app->generateKeypair();
     return $app;
 }
开发者ID:kylewm,项目名称:KnownOAuth2,代码行数:12,代码来源:Application.php


示例14: addMenu

 /**
  * Add a new main menu. Sticky means that it will be shown for all applications.
  *
  * @param MenuShortcut $menu
  * @param Application $application     The application this menu is linked to, if null it is always shown
  */
 public function addMenu(MenuShortcut $menu, Application $application = null)
 {
     $context = $application ? $application->getApplicationId() : 'global';
     if (!isset($this->menus[$context])) {
         $this->menus[$context] = [];
     }
     $this->menus[$context][] = $menu;
 }
开发者ID:bedezign,项目名称:yii2-desktop,代码行数:14,代码来源:Menu.php


示例15: getAppInstallDate

 public function getAppInstallDate(Application $app, $format = null)
 {
     $install_apps = $this->getInstallApps();
     if (isset($install_apps[$app->getId()])) {
         return $install_apps[$app->getId()]->getLastInstalled();
     }
     return null;
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:8,代码来源:User.php


示例16: hasApplicationAnswers

 /**
  * Check if a page has any answers associated with it for a specific application
  * @param Page $page
  * @param Application $application
  * @return boolean
  */
 public function hasApplicationAnswers(Page $page, Application $application)
 {
     $query = $this->_em->createQuery('SELECT COUNT(answer.id) as ancnt FROM Jazzee\\Entity\\Answer answer JOIN answer.applicant applicant WHERE answer.page = :pageId AND applicant.application = :applicationId');
     $query->setParameter('pageId', $page->getId());
     $query->setParameter('applicationId', $application->getId());
     $result = $query->getResult();
     return $result[0]['ancnt'] > 0;
 }
开发者ID:Jazzee,项目名称:Jazzee,代码行数:14,代码来源:PageRepository.php


示例17: enqueueRedirect

 /**
  * Enqueue message and redirect
  *
  * @param Application $App
  * @param $type
  * @param $message
  * @param $redirect_identifier
  * @param $redirect_parameters
  */
 public static function enqueueRedirect($App, $type, $message, $redirect_identifier, $redirect_parameters = [])
 {
     if (!$App instanceof \Cyan\Framework\ApplicationWeb) {
         throw new \Cyan\Framework\ApplicationException('$App must be a instance of Cyan\\Framework\\ApplicationWeb.');
     }
     $type = strtolower($type);
     $App->enqueueMessage($App->Text->translate($message), ucfirst($type), self::$classes[$type]);
     $App->Router->redirect(strpos($redirect_identifier, '://') === false ? $App->Router->generate($redirect_identifier, $redirect_parameters) : $redirect_identifier);
 }
开发者ID:cyan-framework,项目名称:cms,代码行数:18,代码来源:message.php


示例18: test__get_installed_version

 function test__get_installed_version()
 {
     $id = 'news';
     $language = 'french';
     $app = new Application($id, $language);
     $vers = $app->_get_installed_version();
     self::assertEquals($vers, '0');
     // TODO(__FILE__, __METHOD__);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:9,代码来源:ApplicationTest.php


示例19: __construct

 /**
  * コンストラクタ
  *
  * @param Application $application
  */
 public function __construct($application)
 {
     $this->controller_name = strtolower(substr(get_class($this), 0, -10));
     $this->application = $application;
     $this->request = $application->getRequest();
     $this->response = $application->getResponse();
     $this->session = $application->getSession();
     $this->db_manager = $application->getDbManager();
 }
开发者ID:rikimarutest,项目名称:gittest,代码行数:14,代码来源:Controller.php


示例20: initLanguage

 public function initLanguage(Application $currentApp, $type)
 {
     if ($type === "default") {
         return $currentApp->config()->get(Enums\AppSettingKeys::DefaultLanguage);
     }
     if ($type === "browser") {
         return substr(strtok($_SERVER['HTTP_ACCEPT_LANGUAGE'], '?'), 0, 2);
     }
 }
开发者ID:tymiles003,项目名称:FieldWorkManager,代码行数:9,代码来源:HttpRequest.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP ApplicationBase类代码示例发布时间:2022-05-23
下一篇:
PHP AppletInstance类代码示例发布时间: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