Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reworked samples for new Namespaces and newer API so they actually wo…

…rk again
  • Loading branch information...
commit acd6efb9274a6a6330e2a897df1b8135739d9a3f 1 parent abc677b
@theseer authored
View
26 autoload.php
@@ -0,0 +1,26 @@
+<?php
+// @codingStandardsIgnoreFile
+// @codeCoverageIgnoreStart
+// this is an autogenerated file - do not edit
+spl_autoload_register(
+ function($class) {
+ static $classes = null;
+ if ($classes === null) {
+ $classes = array(
+ 'theseer\\autoload\\autoloadbuilder' => '/src/autoloadbuilder.php',
+ 'theseer\\autoload\\autoloadbuilderexception' => '/src/autoloadbuilder.php',
+ 'theseer\\autoload\\classdependencysorter' => '/src/dependencysorter.php',
+ 'theseer\\autoload\\classdependencysorterexception' => '/src/dependencysorter.php',
+ 'theseer\\autoload\\classfinder' => '/src/classfinder.php',
+ 'theseer\\autoload\\classfinderexception' => '/src/classfinder.php',
+ 'theseer\\autoload\\cli' => '/src/cli.php',
+ 'theseer\\autoload\\staticbuilder' => '/src/staticbuilder.php'
+ );
+ }
+ $cn = strtolower($class);
+ if (isset($classes[$cn])) {
+ require __DIR__ . $classes[$cn];
+ }
+ }
+);
+// @codeCoverageIgnoreEnd
View
6 samples/sample.php
@@ -1,8 +1,8 @@
<?php
- require '../src/classfinder.php';
+ require __DIR__ . '/../src/classfinder.php';
$finder = new \TheSeer\Autoload\ClassFinder;
- $rc = $finder->parseFile('src/classfinder.php');
- var_dump($rc);
+ $rc = $finder->parseFile(__DIR__ . '/../src/classfinder.php');
+ var_dump($rc, $finder->getClasses());
View
15 samples/sample2.php
@@ -1,17 +1,12 @@
<?php
- require '../src/classfinder.php';
- require '../src/phpfilter.php';
+ require __DIR__ . '/../autoload.php';
+ require 'TheSeer/DirectoryScanner/autoload.php';
- require '../../scanner/src/directoryscanner.php';
- require '../../scanner/src/includeexcludefilter.php';
- require '../../scanner/src/filesonlyfilter.php';
-
-
- $scanner = new \TheSeer\Autoload\DirectoryScanner;
+ $scanner = new \TheSeer\DirectoryScanner\DirectoryScanner;
$scanner->addInclude('*.php');
$finder = new \TheSeer\Autoload\ClassFinder;
- $rc = $finder->parseMulti($scanner('../'));
- var_dump($rc);
+ $rc = $finder->parseMulti($scanner('../src'));
+ var_dump($rc, $finder->getClasses());
View
15 samples/sample3.php
@@ -1,20 +1,15 @@
<?php
- require '../src/classfinder.php';
- require '../src/phpfilter.php';
- require '../src/autoloadbuilder.php';
+ require __DIR__ . '/../autoload.php';
+ require 'TheSeer/DirectoryScanner/autoload.php';
- require '../../scanner/src/directoryscanner.php';
- require '../../scanner/src/includeexcludefilter.php';
- require '../../scanner/src/filesonlyfilter.php';
-
- $scanner = new \TheSeer\Autoload\DirectoryScanner;
+ $scanner = new \TheSeer\DirectoryScanner\DirectoryScanner;
$scanner->addInclude('*.php');
$finder = new \TheSeer\Autoload\ClassFinder;
- $found = $finder->parseMulti($scanner('../'));
+ $found = $finder->parseMulti($scanner('../src'));
- $ab = new \TheSeer\Autoload\AutoloadBuilder($found);
+ $ab = new \TheSeer\Autoload\AutoloadBuilder($finder->getClasses());
echo $ab->render();
View
15 samples/sample4.php
@@ -1,21 +1,16 @@
<?php
- require '../src/classfinder.php';
- require '../src/phpfilter.php';
- require '../src/autoloadbuilder.php';
+ require __DIR__ . '/../autoload.php';
+ require 'TheSeer/DirectoryScanner/autoload.php';
- require '../../scanner/src/directoryscanner.php';
- require '../../scanner/src/includeexcludefilter.php';
- require '../../scanner/src/filesonlyfilter.php';
-
- $scanner = new \TheSeer\Autoload\DirectoryScanner;
+ $scanner = new \TheSeer\DirectoryScanner\DirectoryScanner;
$scanner->addInclude('*.php');
$finder = new \TheSeer\Autoload\ClassFinder;
- $found = $finder->parseMulti($scanner('../'));
+ $found = $finder->parseMulti($scanner('../src'));
- $ab = new \TheSeer\Autoload\AutoloadBuilder($found);
+ $ab = new \TheSeer\Autoload\AutoloadBuilder($finder->getClasses());
$ab->setIndent("\t");
$ab->setLineBreak("\r\n");
echo $ab->render();
View
15 samples/sample5.php
@@ -1,21 +1,16 @@
<?php
- require '../src/classfinder.php';
- require '../src/phpfilter.php';
- require '../src/autoloadbuilder.php';
+ require __DIR__ . '/../autoload.php';
+ require 'TheSeer/DirectoryScanner/autoload.php';
- require '../../scanner/src/directoryscanner.php';
- require '../../scanner/src/includeexcludefilter.php';
- require '../../scanner/src/filesonlyfilter.php';
-
- $scanner = new \TheSeer\Autoload\DirectoryScanner;
+ $scanner = new \TheSeer\DirectoryScanner\DirectoryScanner;
$scanner->addInclude('*.php');
$finder = new \TheSeer\Autoload\ClassFinder;
- $found = $finder->parseMulti($scanner('../'));
+ $found = $finder->parseMulti($scanner('../src'));
- $ab = new \TheSeer\Autoload\AutoloadBuilder($found);
+ $ab = new \TheSeer\Autoload\AutoloadBuilder($finder->getClasses());
$ab->setBaseDir(realpath(__DIR__.'/..'));
echo $ab->render();
Please sign in to comment.
Something went wrong with that request. Please try again.