Lines Matching refs:prefix

111      * Registers a set of PSR-0 directories for a given prefix, either
112 * appending or prepending to the ones previously set for this prefix.
114 * @param string $prefix The prefix
118 public function add($prefix, $paths, $prepend = false)
120 if (!$prefix) {
136 $first = $prefix[0];
137 if (!isset($this->prefixesPsr0[$first][$prefix])) {
138 $this->prefixesPsr0[$first][$prefix] = (array) $paths;
143 $this->prefixesPsr0[$first][$prefix] = array_merge(
145 $this->prefixesPsr0[$first][$prefix]
148 $this->prefixesPsr0[$first][$prefix] = array_merge(
149 $this->prefixesPsr0[$first][$prefix],
159 * @param string $prefix The prefix/namespace, with trailing '\\'
165 public function addPsr4($prefix, $paths, $prepend = false)
167 if (!$prefix) {
180 } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
182 $length = strlen($prefix);
183 if ('\\' !== $prefix[$length - 1]) {
184 throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
186 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
187 $this->prefixDirsPsr4[$prefix] = (array) $paths;
190 $this->prefixDirsPsr4[$prefix] = array_merge(
192 $this->prefixDirsPsr4[$prefix]
196 $this->prefixDirsPsr4[$prefix] = array_merge(
197 $this->prefixDirsPsr4[$prefix],
204 * Registers a set of PSR-0 directories for a given prefix,
205 * replacing any others previously set for this prefix.
207 * @param string $prefix The prefix
210 public function set($prefix, $paths)
212 if (!$prefix) {
215 $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
223 * @param string $prefix The prefix/namespace, with trailing '\\'
228 public function setPsr4($prefix, $paths)
230 if (!$prefix) {
233 $length = strlen($prefix);
234 if ('\\' !== $prefix[$length - 1]) {
235 throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
237 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
238 $this->prefixDirsPsr4[$prefix] = (array) $paths;
264 * Turns off searching the prefix and fallback directories for classes
285 * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
295 * The APCu prefix in use, or null if APCu caching is not enabled.
444 foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
445 if (0 === strpos($class, $prefix)) {