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


PHP Application::getInstance方法代码示例

本文整理汇总了PHP中Eccube\Application::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::getInstance方法的具体用法?PHP Application::getInstance怎么用?PHP Application::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Eccube\Application的用法示例。


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

示例1: down

 /**
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     $app = \Eccube\Application::getInstance();
     $em = $app['orm.em'];
     $this->delete_dtb_csv($em);
     $em->flush();
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:10,代码来源:Version20160114142234.php

示例2: up

 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     // this up() migration is auto-generated, please modify it to your needs
     if (!$schema->hasTable(self::NAME)) {
         return true;
     }
     $app = \Eccube\Application::getInstance();
     $em = $app["orm.em"];
     $CsvType = new CsvType();
     $CsvType->setId(1);
     $CsvType->setName('商品CSV');
     $CsvType->setRank(3);
     $em->persist($CsvType);
     $CsvType = new CsvType();
     $CsvType->setId(2);
     $CsvType->setName('会員CSV');
     $CsvType->setRank(4);
     $em->persist($CsvType);
     $CsvType = new CsvType();
     $CsvType->setId(3);
     $CsvType->setName('受注CSV');
     $CsvType->setRank(1);
     $em->persist($CsvType);
     $CsvType = new CsvType();
     $CsvType->setId(4);
     $CsvType->setName('配送CSV');
     $CsvType->setRank(2);
     $em->persist($CsvType);
     $CsvType = new CsvType();
     $CsvType->setId(5);
     $CsvType->setName('カテゴリCSV');
     $CsvType->setRank(5);
     $em->persist($CsvType);
     $em->flush();
 }
开发者ID:haou1945,项目名称:ec-cube,代码行数:38,代码来源:Version20150716110252.php

示例3: getEvents

 public static function getEvents()
 {
     $events = array();
     // YamlでParseしてがんばる
     $basePath = __DIR__ . '/../../../app/Plugin';
     $finder = Finder::create()->in($basePath)->directories()->depth(0);
     $app = \Eccube\Application::getInstance();
     foreach ($finder as $dir) {
         $code = $dir->getBaseName();
         $path = $dir->getRealPath();
         try {
             $app['eccube.service.plugin']->checkPluginArchiveContent($path);
         } catch (\Eccube\Exception\PluginException $e) {
             $app['monolog']->warning("skip {$code} form events loading. config.yml not foud or invalid.", array('path' => $path, 'original-message' => $e->getMessage()));
             continue;
         }
         $config = $app['eccube.service.plugin']->readYml($path . '/config.yml');
         if (isset($config['form'])) {
             foreach ($config['form'] as $event => $class) {
                 $events[$event][] = '\\Plugin\\' . $config['code'] . '\\' . $class;
             }
         }
     }
     return $events;
 }
开发者ID:shhirose,项目名称:ec-cube,代码行数:25,代码来源:FormEventSubscriber.php

示例4: up

 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     $app = \Eccube\Application::getInstance();
     $PageLayout = $app['eccube.repository.page_layout']->findOneBy(array('url' => 'forgot_reset', 'name' => 'パスワード変更((完了ページ)'));
     if ($PageLayout) {
         $PageLayout->setName('パスワード変更(完了ページ)');
         $app['orm.em']->flush();
     }
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:12,代码来源:Version20160216215635.php

示例5: down

 /**
  * @param Schema $schema
  */
 public function down(Schema $schema)
 {
     $app = \Eccube\Application::getInstance();
     $em = $app["orm.em"];
     $DeliveryDate = $app['eccube.repository.delivery_date']->find(9);
     if ($DeliveryDate->getValue() === -1) {
         $DeliveryDate->setValue(0);
         $em->flush($DeliveryDate);
     }
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:13,代码来源:Version20160908161616.php

示例6: up

 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     $app = \Eccube\Application::getInstance();
     /** @var EntityManager $em */
     $em = $app["orm.em"];
     $DeviceType = $app['eccube.repository.master.device_type']->find(10);
     $PageLayout = new PageLayout();
     $PageLayout->setDeviceType($DeviceType)->setName('MYページ/お届け先編集')->setUrl('mypage_delivery_edit')->setFileName('Mypage/delivery_edit')->setEditFlg(2)->setMetaRobots('noindex');
     $em->persist($PageLayout);
     $em->flush();
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:14,代码来源:Version20160823172700.php

示例7: createCategoryContent

 /**
  * Create recommend table.
  *
  * @param Schema $schema
  *
  * @return bool
  */
 protected function createCategoryContent(Schema $schema)
 {
     if ($schema->hasTable(self::NAME)) {
         return true;
     }
     $app = Application::getInstance();
     $em = $app['orm.em'];
     $classes = array($em->getClassMetadata('Plugin\\CategoryContent\\Entity\\CategoryContent'));
     $tool = new SchemaTool($em);
     $tool->createSchema($classes);
     return true;
 }
开发者ID:EC-CUBE,项目名称:category-content-plugin,代码行数:19,代码来源:Version20150706204400.php

示例8: up

 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     // this up() migration is auto-generated, please modify it to your needs
     // pageを追加
     $app = \Eccube\Application::getInstance();
     $em = $app["orm.em"];
     $DeviceType = $app['eccube.repository.master.device_type']->find(10);
     $PageLayout = new PageLayout();
     $PageLayout->setDeviceType($DeviceType);
     $PageLayout->setName('商品購入/配送方法選択');
     $PageLayout->setUrl('shopping_delivery');
     $PageLayout->setFileName('Shopping/index');
     $PageLayout->setEditFlg(2);
     $PageLayout->setMetaRobots('noindex');
     $em->persist($PageLayout);
     $PageLayout = new PageLayout();
     $PageLayout->setDeviceType($DeviceType);
     $PageLayout->setName('商品購入/支払方法選択');
     $PageLayout->setUrl('shopping_payment');
     $PageLayout->setFileName('Shopping/index');
     $PageLayout->setEditFlg(2);
     $PageLayout->setMetaRobots('noindex');
     $em->persist($PageLayout);
     $PageLayout = new PageLayout();
     $PageLayout->setDeviceType($DeviceType);
     $PageLayout->setName('商品購入/お届け先変更');
     $PageLayout->setUrl('shopping_shipping_change');
     $PageLayout->setFileName('Shopping/index');
     $PageLayout->setEditFlg(2);
     $PageLayout->setMetaRobots('noindex');
     $em->persist($PageLayout);
     $PageLayout = new PageLayout();
     $PageLayout->setDeviceType($DeviceType);
     $PageLayout->setName('商品購入/お届け先変更');
     $PageLayout->setUrl('shopping_shipping_edit_change');
     $PageLayout->setFileName('Shopping/index');
     $PageLayout->setEditFlg(2);
     $PageLayout->setMetaRobots('noindex');
     $em->persist($PageLayout);
     $PageLayout = new PageLayout();
     $PageLayout->setDeviceType($DeviceType);
     $PageLayout->setName('商品購入/お届け先の複数指定');
     $PageLayout->setUrl('shopping_shipping_multiple_change');
     $PageLayout->setFileName('Shopping/index');
     $PageLayout->setEditFlg(2);
     $PageLayout->setMetaRobots('noindex');
     $em->persist($PageLayout);
     $em->flush();
 }
开发者ID:haou1945,项目名称:ec-cube,代码行数:52,代码来源:Version20151116142354.php

示例9: up

 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     // this up() migration is auto-generated, please modify it to your needs
     // path.ymlの更新
     $app = Application::getInstance();
     $file = $app['config']['root_dir'] . '/app/config/eccube/path.yml';
     $config = Yaml::parse(file_get_contents($file));
     if (!array_key_exists('public_path', $config)) {
         // public_pathが未定義なら作成
         $config['public_path'] = '/html';
         $config['public_path_realdir'] = $config['root_dir'] . $config['public_path'];
         $config['plugin_html_realdir'] = $config['root_dir'] . $config['public_path'] . '/plugin';
         $config['plugin_urlpath'] = $config['root_urlpath'] . '/plugin';
         file_put_contents($file, Yaml::dump($config));
     }
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:19,代码来源:Version20160413151321.php

示例10: up

 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     $app = Application::getInstance();
     $repository = $app['orm.em']->getRepository('Eccube\\Entity\\Master\\ProductListOrderBy');
     // mtb_product_list_orderbyが初期状態から変更がある場合は、マイグレーションを適用しない
     $default = array(array('id' => 1, 'name' => '価格順', 'rank' => 0), array('id' => 2, 'name' => '新着順', 'rank' => 1));
     $entities = $repository->createQueryBuilder('pl')->orderBy('pl.id', 'ASC')->getQuery()->getArrayResult();
     if ($entities !== $default) {
         return;
     }
     // 価格が高い順を追加
     $ProductListOrderBy = new ProductListOrderBy();
     $ProductListOrderBy->setId(3);
     $ProductListOrderBy->setName('価格が高い順');
     $ProductListOrderBy->setRank(2);
     $app['orm.em']->persist($ProductListOrderBy);
     $app['orm.em']->flush($ProductListOrderBy);
     // "価格順"の名称を"価格が低い順"へ変更
     $ProductListOrderBy = $repository->find(1);
     if (!is_null($ProductListOrderBy) && $ProductListOrderBy->getName() === '価格順') {
         $ProductListOrderBy->setName('価格が低い順');
         $app['orm.em']->persist($ProductListOrderBy);
         $app['orm.em']->flush($ProductListOrderBy);
     }
     // 価格が低い順->価格が高い順->新着順の順にrankを振り直す
     // 価格が低い順
     $entity = $repository->find(1);
     $entity->setRank(0);
     $app['orm.em']->flush($entity);
     // 価格が高い順
     $entity = $repository->find(3);
     $entity->setRank(1);
     $app['orm.em']->flush($entity);
     // 新着順
     $entity = $repository->find(2);
     $entity->setRank(2);
     $app['orm.em']->flush($entity);
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:41,代码来源:Version20161108095350.php

示例11: getEvents

 public static function getEvents()
 {
     $events = array();
     // YamlでParseしてがんばる
     $basePath = __DIR__ . '/../../../app/Plugin';
     $finder = Finder::create()->in($basePath)->directories()->depth(0);
     $app = \Eccube\Application::getInstance();
     foreach ($finder as $dir) {
         $config = Yaml::parse(file_get_contents($dir->getRealPath() . '/config.yml'));
         try {
             $app['eccube.service.plugin']->checkPluginArchiveContent($dir->getRealPath());
         } catch (\Eccube\Exception\PluginException $e) {
             $app['monolog']->warning($e->getMessage());
             continue;
         }
         $config = $app['eccube.service.plugin']->readYml($dir->getRealPath() . '/config.yml');
         if (isset($config['form'])) {
             foreach ($config['form'] as $event => $class) {
                 $events[$event][] = '\\Plugin\\' . $config['code'] . '\\' . $class;
             }
         }
     }
     return $events;
 }
开发者ID:cohki,项目名称:ec-cube,代码行数:24,代码来源:FormEventSubscriber.php

示例12: array

 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
use Symfony\Component\Debug\Debug;
use Symfony\Component\Yaml\Yaml;
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
$allow = array('127.0.0.1', 'fe80::1', '::1');
if (isset($_SERVER['HTTP_CLIENT_IP']) || isset($_SERVER['HTTP_X_FORWARDED_FOR']) || !in_array(@$_SERVER['REMOTE_ADDR'], $allow)) {
    header('HTTP/1.0 403 Forbidden');
    exit('You are not allowed to access this file. Check ' . basename(__FILE__) . ' for more information.');
}
require_once __DIR__ . '/../autoload.php';
Debug::enable();
// load configs.
$app = \Eccube\Application::getInstance();
// debug enable.
$app['debug'] = true;
// initialize servicies.
$app->initialize();
$app->initializePlugin();
// load config dev
$conf = $app['config'];
$app['config'] = $app->share(function () use($conf) {
    $confarray = array();
    $config_dev_file = __DIR__ . '/../app/config/eccube/config_dev.yml';
    if (file_exists($config_dev_file)) {
        $config_dev = Yaml::parse(file_get_contents($config_dev_file));
        if (isset($config_dev)) {
            $confarray = array_replace_recursive($confarray, $config_dev);
        }
开发者ID:haou1945,项目名称:ec-cube,代码行数:31,代码来源:index_dev.php

示例13: log_debug

 function log_debug($message, array $context = array())
 {
     $app = \Eccube\Application::getInstance();
     if (isset($app['eccube.logger'])) {
         $app['eccube.logger']->debug($message, $context);
     }
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:7,代码来源:log.php

示例14: createApplication

 /**
  * {@inheritdoc}
  */
 public function createApplication()
 {
     $app = Application::getInstance();
     $app['debug'] = true;
     $app->initialize();
     $app->initPluginEventDispatcher();
     $app['session.test'] = true;
     $app['exception_handler']->disable();
     $app['form.csrf_provider'] = $app->share(function () {
         return new CsrfTokenMock();
     });
     $app->boot();
     return $app;
 }
开发者ID:haou1945,项目名称:ec-cube,代码行数:17,代码来源:EccubeTestCase.php

示例15: createApplication

/**
 * @return \Eccube\Application
 */
function createApplication()
{
    $app = \Eccube\Application::getInstance();
    $app['debug'] = true;
    $app->initDoctrine();
    $app->initSecurity();
    $app->register(new \Silex\Provider\FormServiceProvider());
    $app->register(new \Eccube\ServiceProvider\EccubeServiceProvider());
    $app->boot();
    return $app;
}
开发者ID:ec-cube,项目名称:ec-cube,代码行数:14,代码来源:eccube_install.php


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