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


PHP ReflectionObject::getFilename方法代码示例

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


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

示例1: updateKernel

 /**
  * {@inheritDoc}
  * Add the new bundle to the BundleBundle loader infrastructure instead of main kernel
  *
  * @param QuestionHelper  $questionHelper dialog
  * @param InputInterface  $input          input
  * @param OutputInterface $output         output
  * @param KernelInterface $kernel         kernel
  * @param string          $namespace      namespace
  * @param string          $bundle         bundle
  *
  * @return string[]
  */
 protected function updateKernel(QuestionHelper $questionHelper, InputInterface $input, OutputInterface $output, KernelInterface $kernel, $namespace, $bundle)
 {
     // skip if kernel manipulation disabled by options (defaults to true)
     $doUpdate = $input->getOption('doUpdateKernel');
     if ($doUpdate == 'false') {
         return;
     }
     $auto = true;
     if ($input->isInteractive()) {
         $auto = $questionHelper->doAsk($output, $questionHelper->getQuestion('Confirm automatic update of your core bundle', 'yes', '?'));
     }
     $output->write('Enabling the bundle inside the core bundle: ');
     $coreBundle = $kernel->getBundle($input->getOption('loaderBundleName'));
     if (!is_a($coreBundle, '\\Graviton\\BundleBundle\\GravitonBundleInterface')) {
         throw new \LogicException('GravitonCoreBundle does not implement GravitonBundleInterface');
     }
     $manip = new BundleBundleManipulator($coreBundle);
     try {
         $ret = $auto ? $manip->addBundle($namespace . '\\' . $bundle) : false;
         if (!$ret) {
             $reflected = new \ReflectionObject($kernel);
             return array(sprintf('- Edit <comment>%s</comment>', $reflected->getFilename()), '  and add the following bundle in the <comment>GravitonCoreBundle::getBundles()</comment> method:', '', sprintf('    <comment>new %s(),</comment>', $namespace . '\\' . $bundle), '');
         }
     } catch (\RuntimeException $e) {
         return array(sprintf('Bundle <comment>%s</comment> is already defined in <comment>%s)</comment>.', $namespace . '\\' . $bundle, 'sGravitonCoreBundle::getBundles()'), '');
     }
 }
开发者ID:alebon,项目名称:graviton,代码行数:40,代码来源:GenerateBundleCommand.php

示例2: registersShutdownFunction

 private function registersShutdownFunction(\ReflectionObject $object)
 {
     $fp = fopen($object->getFilename(), 'rb');
     while (!feof($fp)) {
         if (false !== stripos(fread($fp, 4096), 'register_shutdown_function(')) {
             return true;
         }
     }
     fclose($fp);
 }
开发者ID:padraic,项目名称:phpunit-accelerator,代码行数:10,代码来源:TestListener.php

示例3: updateKernel

 protected function updateKernel(OutputInterface $output, KernelInterface $kernel, Bundle $bundle)
 {
     $kernelManipulator = new KernelManipulator($kernel);
     $output->write(sprintf('> Enabling the bundle inside <info>%s</info>: ', $this->makePathRelative($kernelManipulator->getFilename())));
     try {
         $ret = $kernelManipulator->addBundle($bundle->getBundleClassName());
         if (!$ret) {
             $reflected = new \ReflectionObject($kernel);
             return array(sprintf('- Edit <comment>%s</comment>', $reflected->getFilename()), '  and add the following bundle in the <comment>AppKernel::registerBundles()</comment> method:', '', sprintf('    <comment>new %s(),</comment>', $bundle->getBundleClassName()), '');
         }
     } catch (\RuntimeException $e) {
         return array(sprintf('Bundle <comment>%s</comment> is already defined in <comment>AppKernel::registerBundles()</comment>.', $bundle->getBundleClassName()), '');
     }
 }
开发者ID:franzwilding,项目名称:UnitedBundle,代码行数:14,代码来源:UnitedGenerateBundleCommand.php

示例4: ReflectionObject

 function __construct()
 {
     //check we are using php 5
     $this->check_php_version('5.0.0');
     //use reflection to get the filename of the subclass that is inheriting from WP_PluginBase
     $reflector = new ReflectionObject($this);
     $this->plugin_file = $reflector->getFilename();
     $this->plugin_dir = dirname($this->plugin_file) . '/';
     $this->plugin_dir_name = plugin_basename($this->plugin_dir);
     $this->plugin_url = trailingslashit(plugins_url('', $this->plugin_file));
     //load any plugin base deps
     $this->load_dependancies();
     //get the plugin name from the filename. we assume the name of the plugin is the same as the file
     $this->init();
 }
开发者ID:brianlayman,项目名称:fooLicensing,代码行数:15,代码来源:wp_pluginbase_v2_2.php

示例5: updateKernel

 protected function updateKernel(InputInterface $input, OutputInterface $output, KernelInterface $kernel, $bundle)
 {
     $manip = new KernelManipulator($kernel);
     try {
         $ret = $manip->addBundle($bundle);
         if (!$ret) {
             $reflected = new \ReflectionObject($kernel);
             $output->writeln(sprintf('- Edit <comment>%s</comment>', $reflected->getFilename()));
             $output->writeln("  and add the following bundle in the <comment>AppKernel::registerBundles()</comment> method:\n");
             $output->writeln(sprintf("    <comment>new %s(),</comment>\n", $bundle));
         }
     } catch (\RuntimeException $e) {
         $output->writeln(sprintf('Bundle <comment>%s</comment> is already defined in <comment>AppKernel::registerBundles()</comment>.', $bundle));
         throw $e;
     }
 }
开发者ID:bmartinezteltek,项目名称:PuMuKIT2,代码行数:16,代码来源:PumukitInstallBundleCommand.php

示例6: loadConfigurationFile

 private function loadConfigurationFile()
 {
     $object = new \ReflectionObject($this);
     $classFilename = $object->getFilename();
     $parentFolder = dirname($classFilename);
     do {
         if (file_exists($parentFolder . '/bootstrap.php')) {
             require_once $parentFolder . '/bootstrap.php';
             break;
         }
         $scannedFolder = $parentFolder;
         $parentFolder = dirname($scannedFolder);
     } while ($scannedFolder !== $parentFolder);
     if (!function_exists('get_db_params')) {
         $this->fail('You have to create the file bootstrap.php in tests/ and define the function "get_db_params"');
     }
     if (!function_exists('get_model_paths')) {
         $this->fail('You have to create the file bootstrap.php in tests/ and define the function "get_model_paths"');
     }
 }
开发者ID:mystlabs,项目名称:mistydoctrine,代码行数:20,代码来源:DoctrineTest.php

示例7: init

 /**
  * Initialize the object
  *
  * @param BaseScriptClass $pObj A reference to the parent (calling) object
  * @param array $conf The configuration set for this module - from global array TBE_MODULES_EXT
  * @throws \RuntimeException
  * @see \TYPO3\CMS\Backend\Module\BaseScriptClass::checkExtObj()
  */
 public function init(&$pObj, $conf)
 {
     $this->pObj = $pObj;
     // Path of this script:
     $reflector = new \ReflectionObject($this);
     $this->thisPath = dirname($reflector->getFilename());
     if (!@is_dir($this->thisPath)) {
         throw new \RuntimeException('TYPO3 Fatal Error: Could not find path for class ' . get_class($this), 1381164687);
     }
     // Local lang:
     $this->incLocalLang();
     // Setting MOD_MENU items as we need them for logging:
     $this->pObj->MOD_MENU = array_merge($this->pObj->MOD_MENU, $this->modMenu());
 }
开发者ID:TYPO3Incubator,项目名称:TYPO3.CMS,代码行数:22,代码来源:AbstractFunctionModule.php

示例8: cms_module_path

 /**
  * @author  go frendi
  *
  * @param   string module_name
  *
  * @return string
  * @desc    get module_path (folder name) of specified module_name (name space)
  */
 public function cms_module_path($module_name = null)
 {
     // hack module path by changing the session, don't forget to unset !!!
     $module_path = '';
     if ($module_name === null) {
         if ($this->__controller_module_path != null) {
             // no_cms_model and no_cms_autoupdate_model is called by instance controller
             // thus the position might not be represent the current module path
             // in this case we need data from controller
             $module_path = $this->__controller_module_path;
         } else {
             $reflector = new ReflectionObject($this);
             $file_name = $reflector->getFilename();
             if (strpos($file_name, FCPATH . 'modules') === 0) {
                 $file_name = trim(str_replace(FCPATH . 'modules', '', $file_name), DIRECTORY_SEPARATOR);
                 $file_name_part = explode(DIRECTORY_SEPARATOR, $file_name);
                 if (count($file_name_part) >= 2) {
                     $module_path = $file_name_part[0];
                 }
             }
         }
     } else {
         if (!self::$__cms_model_properties['is_module_path_cached']) {
             $this->cms_adjust_module();
         }
         if (array_key_exists($module_name, self::$__cms_model_properties['module_path'])) {
             $module_path = self::$__cms_model_properties['module_path'][$module_name];
         }
     }
     return $module_path;
 }
开发者ID:engirocha,项目名称:No-CMS,代码行数:39,代码来源:CMS_Model.php

示例9: updateKernel

 protected function updateKernel(QuestionHelper $questionHelper, InputInterface $input, OutputInterface $output, KernelInterface $kernel, $namespace, $bundle)
 {
     $auto = true;
     if ($input->isInteractive()) {
         $auto = $questionHelper->askConfirmation($output, $questionHelper->getQuestion('Confirm automatic update of your Kernel', 'yes', '?'), true);
     }
     $output->write('Enabling the bundle inside the Kernel: ');
     $manip = new KernelManipulator($kernel);
     try {
         $ret = $auto ? $manip->addBundle($namespace . '\\' . $bundle) : false;
         if (!$ret) {
             $reflected = new \ReflectionObject($kernel);
             return array(sprintf('- Edit <comment>%s</comment>', $reflected->getFilename()), '  and add the following bundle in the <comment>AppKernel::registerBundles()</comment> method:', '', sprintf('    <comment>new %s(),</comment>', $namespace . '\\' . $bundle), '');
         }
     } catch (\RuntimeException $e) {
         return array(sprintf('Bundle <comment>%s</comment> is already defined in <comment>AppKernel::registerBundles()</comment>.', $namespace . '\\' . $bundle), '');
     }
 }
开发者ID:blacksad12,项目名称:oliorga,代码行数:18,代码来源:GenerateBundleCommand.php

示例10: cms_module_path

 /**
  * @author  goFrendiAsgard
  * @param   string module_name
  * @return  string
  * @desc    get module_path (folder name) of specified module_name (name space)
  */
 protected function cms_module_path($module_name = NULL)
 {
     if ($module_name === NULL) {
         $module_path = '';
         $reflector = new ReflectionObject($this);
         $file_name = $reflector->getFilename();
         if (strpos($file_name, FCPATH . 'modules') === 0) {
             $file_name = trim(str_replace(FCPATH . 'modules', '', $file_name), DIRECTORY_SEPARATOR);
             $file_name_part = explode(DIRECTORY_SEPARATOR, $file_name);
             if (count($file_name_part) >= 2) {
                 $module_path = $file_name_part[0];
             }
         }
         return $module_path;
     } else {
         return $this->{$this->__cms_base_model_name}->cms_module_path($module_name);
     }
 }
开发者ID:jeremywong1992,项目名称:No-CMS,代码行数:24,代码来源:CMS_Controller.php

示例11: updateKernel

 private function updateKernel(OutputInterface $output, KernelInterface $kernel, $namespace, $bundle)
 {
     $output->write('Enabling the bundle inside the Kernel: ');
     $kernel = new KernelManipulator($kernel);
     if (!$kernel->addBundle($namespace . '\\' . $bundle)) {
         $reflected = new \ReflectionObject($kernel);
         return array(sprintf('- Edit <comment>%s</comment>', $reflected->getFilename()), '  and add the following bundle in the <comment>AppKernel::registerBundles()</comment> method:', '', sprintf('      <comment>new %s(),</comment>', $namespace . '\\' . $bundle), '');
     }
 }
开发者ID:rfc1483,项目名称:dobervich,代码行数:9,代码来源:InitBundleCommand.php

示例12: getClassViewFilePath

 /**
  * @param string $file
  * @return string string
  */
 protected function getClassViewFilePath($file)
 {
     $object = new \ReflectionObject($this);
     $file = dirname($object->getFilename()) . DIRECTORY_SEPARATOR . \Uc::app()->theme->getViewsDir() . DIRECTORY_SEPARATOR . trim($file, DIRECTORY_SEPARATOR) . \Uc::app()->theme->getTemplateExtension();
     return $file;
 }
开发者ID:ukrcms,项目名称:core,代码行数:10,代码来源:Module.php

示例13: testAddFilesMap

 public function testAddFilesMap()
 {
     $this->assertFalse(class_exists('Test_Magento_Autoload_Map', false));
     $this->_loader->addFilesMap(array('Test_Magento_Autoload_Map' => 'dev/tests/unit/testsuite/Magento/Autoload/TestMap.php'));
     $reflection = new ReflectionObject(new Test_Magento_Autoload_Map());
     $this->assertStringEndsWith('TestMap.php', $reflection->getFilename());
     $this->assertFalse(class_exists('Unit_TestClassMapClass', false));
     $this->_loader->addFilesMap(__DIR__ . '/Autoload/classmap.ser');
     $reflection = new ReflectionObject(new Unit_TestClassMapClass());
     $this->assertStringEndsWith('TestClassMapInFile.php', $reflection->getFilename());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:11,代码来源:AutoloadTest.php

示例14: updateKernel

 private function updateKernel($dialog, InputInterface $input, OutputInterface $output, KernelInterface $kernel, $namespace, $bundle)
 {
     $auto = true;
     if ($input->isInteractive()) {
         $auto = $dialog->askConfirmation($output, $this->getQuestion('Confirm automatic update of your Kernel', 'yes', '?'), true);
     }
     $output->write('Enabling the bundle inside the Kernel: ');
     $manip = new KernelManipulator($kernel);
     $ret = $auto ? $manip->addBundle($namespace . '\\' . $bundle) : false;
     if (!$ret) {
         $reflected = new \ReflectionObject($kernel);
         return array(sprintf('- Edit <comment>%s</comment>', $reflected->getFilename()), '  and add the following bundle in the <comment>AppKernel::registerBundles()</comment> method:', '', sprintf('    <comment>new %s(),</comment>', $namespace . '\\' . $bundle), '');
     }
 }
开发者ID:rfc1483,项目名称:doctrine,代码行数:14,代码来源:GenerateBundleCommand.php

示例15: updateKernel

 protected function updateKernel($dialog, InputInterface $input, OutputInterface $output, KernelInterface $kernel, $namespace, $bundle)
 {
     $output->writeln('Enabling the bundle inside the Kernel');
     $manip = new KernelManipulator($kernel);
     try {
         if (!$manip->addBundle($namespace)) {
             $reflected = new \ReflectionObject($kernel);
             return array(sprintf('- Edit <comment>%s</comment>', $reflected->getFilename()), '  and add the following bundle in the <comment>AppKernel::registerBundles()</comment> method:', '', sprintf('    <comment>new %s(),</comment>', $namespace), '');
         }
     } catch (\RuntimeException $e) {
         return array(sprintf('Bundle <comment>%s</comment> is already defined in <comment>AppKernel::registerBundles()</comment>.', $namespace), '');
     }
 }
开发者ID:kmehmety,项目名称:GeneratorBundle,代码行数:13,代码来源:SetupOrUpgradeCommand.php


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