Lines Matching refs:prefix

175      * Registers a set of PSR-0 directories for a given prefix, either
176 * appending or prepending to the ones previously set for this prefix.
178 * @param string $prefix The prefix
184 public function add($prefix, $paths, $prepend = false)
186 if (!$prefix) {
202 $first = $prefix[0];
203 if (!isset($this->prefixesPsr0[$first][$prefix])) {
204 $this->prefixesPsr0[$first][$prefix] = (array) $paths;
209 $this->prefixesPsr0[$first][$prefix] = array_merge(
211 $this->prefixesPsr0[$first][$prefix]
214 $this->prefixesPsr0[$first][$prefix] = array_merge(
215 $this->prefixesPsr0[$first][$prefix],
225 * @param string $prefix The prefix/namespace, with trailing '\\'
233 public function addPsr4($prefix, $paths, $prepend = false)
235 if (!$prefix) {
248 } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
250 $length = strlen($prefix);
251 if ('\\' !== $prefix[$length - 1]) {
252 throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
254 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
255 $this->prefixDirsPsr4[$prefix] = (array) $paths;
258 $this->prefixDirsPsr4[$prefix] = array_merge(
260 $this->prefixDirsPsr4[$prefix]
264 $this->prefixDirsPsr4[$prefix] = array_merge(
265 $this->prefixDirsPsr4[$prefix],
272 * Registers a set of PSR-0 directories for a given prefix,
273 * replacing any others previously set for this prefix.
275 * @param string $prefix The prefix
280 public function set($prefix, $paths)
282 if (!$prefix) {
285 $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
293 * @param string $prefix The prefix/namespace, with trailing '\\'
300 public function setPsr4($prefix, $paths)
302 if (!$prefix) {
305 $length = strlen($prefix);
306 if ('\\' !== $prefix[$length - 1]) {
307 throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
309 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
310 $this->prefixDirsPsr4[$prefix] = (array) $paths;
338 * Turns off searching the prefix and fallback directories for classes
361 * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
373 * The APCu prefix in use, or null if APCu caching is not enabled.
533 foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
534 if (0 === strpos($class, $prefix)) {