Exemplo n.º 1
0
 /**
  * @throws \WPluginCore003\Diagnostics\Exception
  * @throws vfs\vfsStreamException
  * @static
  * @author Panagiotis Vagenas <*****@*****.**>
  * @since  0.0.2
  */
 public static function setUpBeforeClass()
 {
     global $WpPluginCore;
     self::$WpPluginCore = $WpPluginCore;
     vfs\vfsStreamWrapper::register();
     self::$rootDir = new vfs\vfsStreamDirectory('rootDir');
     vfs\vfsStreamWrapper::setRoot(self::$rootDir);
     self::$templateBaseName = uniqid();
     self::$templateName = self::$templateBaseName . '.php';
     self::$misTemplateBaseName = uniqid('missing');
     self::$misTemplateName = self::$misTemplateBaseName . '.php';
     self::$templateFile = new vfs\vfsStreamFile(self::$templateName);
     self::$templateFile->setContent('<?php if(isset($var)) echo $var; else echo 1;');
     self::$rootDir->addChild(self::$templateFile);
     self::$templateObj = self::$WpPluginCore->getFactory()->createOrGet('Templates\\Template');
 }
Exemplo n.º 2
0
 /**
  * @param        $name
  * @param        $searchIn
  * @param        $ext
  * @param Plugin $plugin
  *
  * @return string
  * @throws \WPluginCore003\Diagnostics\Exception
  * @author Panagiotis Vagenas <*****@*****.**>
  * @since  0.0.2
  */
 public function locate($name, $searchIn, $ext, Plugin $plugin)
 {
     if (!preg_match('/.*\\.' . $ext . '$/', $name)) {
         $name .= ".{$ext}";
     }
     foreach ((array) $searchIn as $path) {
         $filePath = Paths::truePath("{$path}/{$name}", true);
         if (!$filePath) {
             continue;
         }
         if ($plugin->getFactory()->fcrPlugin()->paths()->verifyPathIsUnder($filePath, $path) && file_exists($filePath) && is_readable($filePath)) {
             return $filePath;
         }
     }
     return '';
 }
Exemplo n.º 3
0
 /**
  * @return string
  * @author Panagiotis Vagenas <*****@*****.**>
  * @since  0.0.2
  */
 public function locate()
 {
     $fileObj = $this->plugin->getFactory()->fcrHelpers()->file();
     return $fileObj->locate($this->handle, $this->whereMayReside, $this->fileExtension, $this->plugin);
 }
Exemplo n.º 4
0
 /**
  * @param Plugin    $plugin
  * @param string    $handle
  * @param string    $wpRelPath
  * @param array     $deps
  * @param bool|true $inFooter
  */
 public function __construct(Plugin $plugin, $handle, $wpRelPath = '', array $deps = array(), $inFooter = true)
 {
     $this->inFooter = $inFooter;
     $this->whereMayReside = $plugin->getFactory()->fcrPlugin()->paths()->getWhereScriptsMayReside();
     parent::__construct($plugin, $handle, $wpRelPath, $deps);
 }
Exemplo n.º 5
0
 /**
  * @param Plugin $plugin
  * @param string $handle
  * @param string $wpRelPath
  * @param array  $deps
  * @param string $media
  */
 public function __construct(Plugin $plugin, $handle, $wpRelPath = '', array $deps = array(), $media = 'all')
 {
     $this->media = $media;
     $this->whereMayReside = $plugin->getFactory()->fcrPlugin()->paths()->getWhereStylesMayReside();
     parent::__construct($plugin, $handle, $wpRelPath, $deps);
 }