Пример #1
0
<?php

$base = __DIR__;
$composer = $base . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
if (!is_file($composer)) {
    exit("Impossible to find composer.");
}
require $composer;
$ignoreFolders = array($base . DIRECTORY_SEPARATOR . 'libraries', $base . DIRECTORY_SEPARATOR . 'vendor');
$checker = new PhpLibraryChecker($base, $ignoreFolders);
$result = $checker->scan();
$result->toConsole();
 /**
  * Builds a new PhpLibraryCheckerException object.
  * 
  * @param string $message
  * @param string[] $params
  * @param string $code
  * @param string $previous
  */
 public function __construct($message, array $params = array(), $code = null, $previous = null)
 {
     parent::__construct(PhpLibraryChecker::t($message, $params), $code, $previous);
 }
Пример #3
0
 /**
  * 
  * @param string $base_path
  * @param string[] $exclude_paths
  * @param int $recursive
  * @param string $locale
  * @throws PhpLibraryCheckerException
  */
 public function __construct($base_path, $exclude_paths = array(), $recursive = null, $locale = 'en_US')
 {
     self::$locale = $locale;
     $realpath = realpath($base_path);
     if ($realpath === false) {
         throw new PhpLibraryCheckerException('The path "{path}" does not seem to exists.', array('{path}' => $base_path));
     }
     $this->_base_path = $realpath;
     foreach ($exclude_paths as $path) {
         $realpath = realpath($path);
         if ($realpath === false) {
             throw new PhpLibraryCheckerException('The path "{path}" does not seem to exists.', array('{path}' => $path));
         }
         $this->_exclude_paths[] = $realpath;
     }
     $this->_recursive = $recursive;
 }