Example #1
0
 /**
  * @param \Aquarium\Resources\Package $package
  */
 public function buildPhpFile(Package $package)
 {
     $className = Utils::getClassName($package->Name);
     $resource = $this->createFile($className);
     Config::instance()->directories()->truncateResourcesToPublicDir($package);
     try {
         $this->writePhpFile($resource, $package);
     } finally {
         fclose($resource);
     }
 }
Example #2
0
 /**
  * @param Package|string $packageName
  * @return string
  */
 public static function getFullClassName($packageName)
 {
     return self::COMPILED_CLASSES_NAMESPACE . '\\' . Utils::getClassName($packageName);
 }
Example #3
0
 /**
  * @param string $name
  * @return bool
  */
 public function has($name)
 {
     return isset($this->cached[$name]) || is_file(Utils::getClassPath($name));
 }
Example #4
0
 public function test_getClassPath_PackagePassed()
 {
     $sep = DIRECTORY_SEPARATOR;
     Config::instance()->directories()->PhpTargetDir = "{$sep}a{$sep}b";
     $this->assertEquals("{$sep}a{$sep}b{$sep}" . Utils::PACKAGE_CLASS_NAME_PREFIX . 'a_b.php', Utils::getClassPath(new Package('a/b')));
 }