Lines Matching defs:prefix

102      * Registers a set of PSR-0 directories for a given prefix, either
103 * appending or prepending to the ones previously set for this prefix.
105 * @param string $prefix The prefix
109 public function add($prefix, $paths, $prepend = false)
111 if (!$prefix) {
127 $first = $prefix[0];
128 if (!isset($this->prefixesPsr0[$first][$prefix])) {
129 $this->prefixesPsr0[$first][$prefix] = (array) $paths;
134 $this->prefixesPsr0[$first][$prefix] = array_merge(
136 $this->prefixesPsr0[$first][$prefix]
139 $this->prefixesPsr0[$first][$prefix] = array_merge(
140 $this->prefixesPsr0[$first][$prefix],
150 * @param string $prefix The prefix/namespace, with trailing '\\'
156 public function addPsr4($prefix, $paths, $prepend = false)
158 if (!$prefix) {
171 } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
173 $length = strlen($prefix);
174 if ('\\' !== $prefix[$length - 1]) {
175 throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
177 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178 $this->prefixDirsPsr4[$prefix] = (array) $paths;
181 $this->prefixDirsPsr4[$prefix] = array_merge(
183 $this->prefixDirsPsr4[$prefix]
187 $this->prefixDirsPsr4[$prefix] = array_merge(
188 $this->prefixDirsPsr4[$prefix],
195 * Registers a set of PSR-0 directories for a given prefix,
196 * replacing any others previously set for this prefix.
198 * @param string $prefix The prefix
201 public function set($prefix, $paths)
203 if (!$prefix) {
206 $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
214 * @param string $prefix The prefix/namespace, with trailing '\\'
219 public function setPsr4($prefix, $paths)
221 if (!$prefix) {
224 $length = strlen($prefix);
225 if ('\\' !== $prefix[$length - 1]) {
226 throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
228 $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
229 $this->prefixDirsPsr4[$prefix] = (array) $paths;
255 * Turns off searching the prefix and fallback directories for classes
276 * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
286 * The APCu prefix in use, or null if APCu caching is not enabled.
410 foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411 if (0 === strpos($class, $prefix)) {