Lines Matching defs:prefix

179      * Registers a set of PSR-0 directories for a given prefix, either
180 * appending or prepending to the ones previously set for this prefix.
182 * @param string $prefix The prefix
188 public function add($prefix, $paths, $prepend = false)
190 if (!$prefix) {
206 $first = $prefix[0];
207 if (!isset($this->prefixesPsr0[$first][$prefix])) {
208 $this->prefixesPsr0[$first][$prefix] = (array) $paths;
213 $this->prefixesPsr0[$first][$prefix] = array_merge(
215 $this->prefixesPsr0[$first][$prefix]
218 $this->prefixesPsr0[$first][$prefix] = array_merge(
219 $this->prefixesPsr0[$first][$prefix],
229 * @param string $prefix The prefix/namespace, with trailing '\\'
237 public function addPsr4($prefix, $paths, $prepend = false)
239 if (!$prefix) {
252 } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
254 $length = strlen($prefix);
255 if ('\\' !== $prefix[$length - 1]) {
256 throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
258 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
259 $this->prefixDirsPsr4[$prefix] = (array) $paths;
262 $this->prefixDirsPsr4[$prefix] = array_merge(
264 $this->prefixDirsPsr4[$prefix]
268 $this->prefixDirsPsr4[$prefix] = array_merge(
269 $this->prefixDirsPsr4[$prefix],
276 * Registers a set of PSR-0 directories for a given prefix,
277 * replacing any others previously set for this prefix.
279 * @param string $prefix The prefix
284 public function set($prefix, $paths)
286 if (!$prefix) {
289 $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
297 * @param string $prefix The prefix/namespace, with trailing '\\'
304 public function setPsr4($prefix, $paths)
306 if (!$prefix) {
309 $length = strlen($prefix);
310 if ('\\' !== $prefix[$length - 1]) {
311 throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
313 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
314 $this->prefixDirsPsr4[$prefix] = (array) $paths;
342 * Turns off searching the prefix and fallback directories for classes
365 * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
377 * The APCu prefix in use, or null if APCu caching is not enabled.
538 foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
539 if (0 === strpos($class, $prefix)) {