Example #1
0
 /**
  * Perform command.
  */
 public function perform()
 {
     foreach ($this->files->getFiles(directory('config'), Core::EXTENSION) as $filename) {
         $this->files->touch($filename);
     }
     $this->writeln("All config files touched.");
 }
Example #2
0
function staticCache($file, $line, $key, $callback = null)
{
    if (!isset($callback)) {
        $callback = $key;
        $key = null;
    }
    static $map;
    if (!isset($map)) {
        $map = (object) array();
    }
    if (isset($map->{"{$file}:{$line}-{$key}"})) {
        return $map->{"{$file}:{$line}-{$key}"};
    }
    $cacheFile = $_SERVER['cachePath'] . '/' . substr(pathinfo($file, PATHINFO_FILENAME), 0, 10) . '__' . substr(preg_replace('/(?i)[^a-z0-9]+/', '', $key), 0, 10) . '__' . sha1("{$file}:{$line}-{$key}") . '.cache';
    $cacheCorrelationFile = "{$cacheFile}.correlation";
    if (version_development && is_file($cacheCorrelationFile)) {
        foreach (array_diff(unserialize(file_get_contents($cacheCorrelationFile)), includedFile()) as $file) {
            if (is_file($file)) {
                includedFile($file);
            }
        }
    }
    if (!is_file($cacheFile) || version_development && filemtime($cacheFile) < lastCodeChangeTimestamp()) {
        directory(dirname($cacheFile));
        file_put_contents($cacheFile, serialize($callback()));
        file_put_contents($cacheCorrelationFile, serialize(includedFile()));
    }
    $map->{"{$file}:{$line}-{$key}"} = unserialize(file_get_contents($cacheFile));
    return $map->{"{$file}:{$line}-{$key}"};
}
Example #3
0
 /**
  * Perform command.
  */
 public function perform()
 {
     $this->isVerbosing() && $this->writeln("<info>Clearing application runtime cache:</info>");
     foreach ($this->files->getFiles(directory('cache')) as $filename) {
         !$this->option('emulate') && $this->files->delete($filename);
         $this->isVerbosing() && $this->writeln($this->files->relativePath($filename, directory('cache')));
     }
     $this->writeln("<info>Runtime cache has been cleared.</info>");
 }
 public static function init(&$db, &$err, &$typehead)
 {
     $db = new r0mdauDb(_DIR_Database_);
     $err = new Error();
     form($err);
     $typehead['directory'] = directory();
     $typehead['lists'] = lists();
     $typehead['send'] = receiver();
 }
Example #5
0
 /**
  * Perform command.
  */
 public function perform()
 {
     $this->isVerbosing() && $this->writeln("<info>Clearing view cache:</info>");
     $cachedViews = $this->files->getFiles($this->views->config()['cache']['directory']);
     foreach ($cachedViews as $filename) {
         !$this->option('emulate') && $this->files->delete($filename);
         $this->isVerbosing() && $this->writeln($this->files->relativePath($filename, directory('cache')));
     }
     empty($filename) && $this->isVerbosing() && $this->writeln("No cached views were found.");
     $this->writeln("<info>Cache is cleared.</info>");
 }
Example #6
0
 /**
  * Perform command.
  *
  * @param TokenizerInterface $tokenizer
  */
 public function perform(TokenizerInterface $tokenizer)
 {
     if (empty($modules = $this->modules->findModules($tokenizer))) {
         $this->writeln('<fg=red>' . 'No modules were found in any project file or library. Check Tokenizer config.' . '</fg=red>');
         return;
     }
     $table = $this->tableHelper(['Module:', 'Version:', 'Status:', 'Size:', 'Location:', 'Description:']);
     foreach ($modules as $module) {
         $table->addRow([$module->getName(), $this->fetchVersion($module->getName()), $module->isInstalled() ? self::INSTALLED : self::NOT_INSTALLED, StringHelper::bytes($module->getSize()), $this->files->relativePath($module->getLocation(), directory('root')), wordwrap($module->getDescription())]);
     }
     $table->render();
 }
Example #7
0
 /**
  * Realtime string highlighter.
  *
  * @return \Closure
  */
 private function stringListener()
 {
     return function (ObjectEvent $event) {
         $this->writeln("<fg=magenta>{$event->context()['string']}</fg=magenta>");
         if ($event->context()['class']) {
             $this->writeln("In class <comment>{$event->context()['class']}</comment>");
             return;
         }
         $filename = $this->files->relativePath($event->context()['filename'], directory('root'));
         $this->writeln("In <comment>{$filename}</comment> at line <comment>{$event->context()['line']}</comment>");
     };
 }
Example #8
0
 /**
  * Perform command.
  */
 public function perform()
 {
     $host = $this->argument('host') . ':' . $this->option('port');
     $this->writeln("<info>Spiral Development server started at <comment>{$host}</comment></info>");
     $this->writeln("Press <comment>Ctrl-C</comment> to quit.");
     $process = new Process('"' . PHP_BINARY . '" -S ' . $host . ' "' . directory('framework') . '/../server.php"', directory('public'), null, null, $this->option('timeout'));
     $process->run(function ($type, $data) {
         if ($type != Process::ERR) {
             //First character contains request type, second is space
             ($data[0] == 'S' || $this->isVerbosing()) && $this->writeln(substr($data, 2));
         }
     });
 }
Example #9
0
 /**
  * Perform command.
  */
 public function perform()
 {
     /**
      * We are going to manipulate with encrypter configuration.
      *
      * @var ConfigWriter $write
      */
     $configWriter = $this->container->get(ConfigWriter::class, ['name' => 'encrypter', 'method' => ConfigWriter::MERGE_REPLACE]);
     $key = StringHelper::random(32);
     //Exporting to environment specific configuration file
     $configWriter->setConfig(compact('key'))->writeConfig(directory('config') . '/' . $this->core->environment());
     $this->writeln("<info>Encryption key <comment>{$key}</comment> was set for environment " . "<comment>{$this->core->environment()}</comment>.</info>");
 }
Example #10
0
 /**
  * List of configs affected by environment change.
  *
  * @param string $environment
  * @return array
  */
 protected function getAlteredConfigs($environment)
 {
     //We have to touch every config to ensure that cache is OK
     $configDirectory = $this->files->normalizePath(directory('config'));
     $environmentDirectory = $configDirectory . "/{$environment}/";
     $altered = [];
     foreach ($this->files->getFiles($configDirectory, Core::EXTENSION) as $filename) {
         $environmentConfig = $environmentDirectory . basename($filename);
         if (dirname($filename) == $configDirectory && $this->files->exists($environmentConfig)) {
             $altered[] = $this->files->relativePath($filename, $configDirectory);
         }
     }
     return $altered;
 }
Example #11
0
 /**
  * @param DirectoriesInterface $directories
  * @param FilesInterface       $files
  */
 protected function ensurePermissions(DirectoriesInterface $directories, FilesInterface $files)
 {
     $this->writeln("<info>Verifying runtime directory existence and file permissions...</info>");
     $runtime = $directories->directory('runtime');
     if (!$files->exists(directory('runtime'))) {
         $files->ensureDirectory(directory('runtime'));
         $this->writeln("Runtime data directory was created.");
         return;
     }
     foreach ($files->getFiles(directory('runtime')) as $filename) {
         //Both file and it's directory must be writable
         $files->setPermissions($filename, FilesInterface::RUNTIME);
         $files->setPermissions(dirname($filename), FilesInterface::RUNTIME);
     }
     $this->writeln("Runtime directory permissions were updated.");
 }
Example #12
0
function codeChanged()
{
    static $includedFiles = array();
    static $result = true;
    $newIncludedFiles = includedFile();
    if (count($includedFiles) != count($newIncludedFiles)) {
        $fingerprintFile = $_SERVER['cachePath'] . '/codeBase_' . sha1(serialize($newIncludedFiles)) . '.timestamp';
        $result = !is_file($fingerprintFile) || codeTimestamp() > filemtime($fingerprintFile);
        if ($result) {
            directory(dirname($fingerprintFile));
            $touchResult = touch($fingerprintFile);
            enforce($touchResult, "Could not touch '{$fingerprintFile}'");
        }
        $includedFiles = $newIncludedFiles;
    }
    return $result;
}
Example #13
0
 /**
  * Ensure existence and permissions of runtime directory.
  */
 protected function ensureRuntimeDirectory()
 {
     $this->writeln("<info>Verifying runtime directory existence and file permissions...</info>");
     if (!$this->files->exists(directory('runtime'))) {
         $this->files->ensureLocation(directory('runtime'));
         $this->writeln("Runtime data directory was created.");
         return;
     }
     foreach ($this->files->getFiles(directory('runtime')) as $filename) {
         //Both file and it's directory must be writable
         $this->files->setPermissions($filename, FilesInterface::RUNTIME);
         $this->files->setPermissions(dirname($filename), FilesInterface::RUNTIME);
         if ($this->isVerbosing()) {
             $filename = $this->files->relativePath($filename, directory('runtime'));
             $this->writeln("Permissions were updated for '<comment>{$filename}</comment>'.");
         }
     }
     $this->writeln("Runtime directory permissions updated.");
 }
function displayThumbs($imagefolder, $thumbsfolder, $maxthumbnailsize, $imagesperrow, $rowsperpage)
{
    if (!isset($_GET['page'])) {
        $page = "1";
    } else {
        $page = $_GET['page'];
    }
    if ($page == "all") {
        $lastpic = 9999999999999;
        $pictostartat = 0;
    } else {
        $lastpic = $rowsperpage * $imagesperrow * $page;
        $pictostartat = $lastpic - $rowsperpage * $imagesperrow;
    }
    $pics = directory($imagefolder, "jpg,JPG,JPEG,jpeg,png,PNG");
    $maxsize = $maxthumbnailsize;
    if (isset($pics[0]) && $pics[0] != "") {
        echo "<table><tr>";
        $COUNT = 0;
        foreach ($pics as $p) {
            if ($COUNT < $pictostartat) {
                $COUNT = $COUNT + 1;
                continue;
            } else {
                if ($COUNT >= $lastpic) {
                    $COUNT = $COUNT + 1;
                    continue;
                } else {
                    $COUNT = $COUNT + 1;
                }
            }
            displayImage($imagefolder, $p, $thumbsfolder, $maxsize, FALSE);
            if ($COUNT % $imagesperrow == 0) {
                echo "</tr><tr>";
            }
        }
        echo "</tr></table>";
    }
}
Example #15
0
<?php

/**
 * Configuration of ViewManager component and view engines:
 * - compiled view cache state and location
 * - view namespaces associated with list of source directories
 * - list of view dependencies, used by default compiler to create unique cache name
 * - list of view engines associated with their extension, compiler and default view class
 */
return ['cache' => ['enabled' => true, 'directory' => directory("cache") . 'views/'], 'namespaces' => ['default' => [directory("application") . 'views/'], 'spiral' => [directory("application") . 'views/spiral/', directory("libraries") . 'spiral/framework/source/views/', directory("libraries") . 'spiral/toolkit/source/views/'], 'profiler' => [directory("libraries") . 'spiral/profiler/source/views/']], 'dependencies' => ['language' => ['i18n', 'getLanguage'], 'basePath' => ['http', 'basePath']], 'engines' => ['default' => ['extensions' => ['php'], 'compiler' => 'Spiral\\Views\\Compiler', 'view' => 'Spiral\\Views\\View', 'processors' => ['Spiral\\Views\\Processors\\ExpressionsProcessor' => [], 'Spiral\\Views\\Processors\\TranslateProcessor' => [], 'Spiral\\Views\\Processors\\TemplateProcessor' => [], 'Spiral\\Views\\Processors\\EvaluateProcessor' => [], 'Spiral\\Views\\Processors\\PrettifyProcessor' => [], 'Spiral\\Toolkit\\ResourceManager' => []]]]];
Example #16
0
<?php

/**
 * Configuration of Migrator component (located in Database component), includes:
 * - directory to store migrations in
 * - database to store information about executed migrations
 * - table to store information about executed migrations
 * - list of environments where migration commands allowed to run without user confirmation
 */
return ['directory' => directory('application') . 'migrations/', 'database' => 'default', 'table' => 'migrations', 'environments' => ['development', 'testing', 'staging']];
Example #17
0
function directoryLink($link, $dir)
{
    remove($link);
    directory(dirname($link));
    directory($dir);
    symbolicLink($link, $dir);
}
Example #18
0
<?php

/**
 * Documenters configuration includes header and virtual namespace for virtual documentation
 * generated by spiral to help IDE understand runtime schemas.
 */
return ['header' => ["This file was generated automatically by Spiral Framework as set of shortcuts to help IDE.", "Never include this file into your project.", "", "@ignore"], 'namespace' => 'VirtualClasses', 'phpstorm' => ['orm' => directory('runtime') . 'virtual-orm.php', 'odm' => directory('runtime') . 'virtual-odm.php']];
Example #19
0
<?php

/**
 * Configuration of StorageManager components with it's servers and containers.
 * - list of servers with their adapter class and options to associated with buckets
 * - list of buckets with their server id, prefix value and adapter specific options
 */
use Spiral\Storage\Servers;
return ['servers' => ['local' => ['class' => Servers\LocalServer::class, 'options' => ['home' => directory('root')]], 'amazon' => ['class' => Servers\AmazonServer::class, 'options' => ['verify' => false, 'accessKey' => '', 'secretKey' => '']], 'rackspace' => ['class' => Servers\RackspaceServer::class, 'options' => ['verify' => false, 'username' => '', 'apiKey' => '']], 'ftp' => ['class' => Servers\FtpServer::class, 'options' => ['host' => '127.0.0.1', 'login' => 'Wolfy-J', 'password' => '', 'home' => '/']], 'sftp' => ['class' => Servers\SftpServer::class, 'options' => ['host' => 'hostname.com', 'home' => '/home/', 'authMethod' => 'pubkey', 'username' => '', 'password' => '', 'publicKey' => '', 'privateKey' => '']], 'gridfs' => ['class' => Servers\GridfsServer::class, 'options' => ['database' => 'default']]], 'buckets' => ['local' => ['server' => 'local', 'prefix' => 'local:', 'options' => ['directory' => '/application/runtime/storage/']], 'amazon' => ['server' => 'amazon', 'prefix' => 'https://s3.amazonaws.com/my-bucket/', 'options' => ['public' => true, 'bucket' => 'my-bucket']], 'rackspace' => ['server' => 'rackspace', 'prefix' => 'rackspace:', 'options' => ['container' => 'container-name', 'region' => 'DFW']], 'ftp' => ['server' => 'ftp', 'prefix' => 'ftp:', 'options' => ['directory' => '/', 'mode' => \Spiral\Files\FilesInterface::RUNTIME]], 'sftp' => ['server' => 'sftp', 'prefix' => 'sftp:', 'options' => ['directory' => 'uploads', 'mode' => \Spiral\Files\FilesInterface::RUNTIME]], 'gridfs' => ['server' => 'gridfs', 'prefix' => 'gridfs:', 'options' => ['collection' => 'files']]]];
Example #20
0
<?php

/**
 * Configuration of reactor generators including class postfix, namespaces and output location.
 * Request mapping includes set of default mutators and validation rules for known types.
 */
return ['header' => ['System Monitoring thing', '', '@author    jwdeitch'], 'generators' => ['controller' => ['namespace' => 'Controllers', 'postfix' => 'Controller', 'directory' => directory('application') . 'classes/Controllers/'], 'service' => ['namespace' => 'Services', 'postfix' => 'Service', 'directory' => directory('application') . 'classes/Services/'], 'entity' => ['namespace' => 'Database', 'postfix' => '', 'directory' => directory('application') . 'classes/Database/'], 'command' => ['namespace' => 'Commands', 'postfix' => 'Command', 'directory' => directory('application') . 'classes/Commands/'], 'middleware' => ['namespace' => 'Middlewares', 'postfix' => 'Middleware', 'directory' => directory('application') . 'classes/Middlewares/'], 'migration' => ['namespace' => 'Migrations', 'postfix' => 'Migration', 'directory' => directory('runtime')], 'request' => ['namespace' => 'Requests', 'postfix' => 'Request', 'directory' => directory('application') . 'classes/Requests/', 'mapping' => ['int' => ['source' => 'data', 'setter' => 'intval', 'validates' => ['notEmpty', 'integer']], 'float' => ['source' => 'data', 'setter' => 'floatval', 'validates' => ['notEmpty', 'float']], 'string' => ['source' => 'data', 'setter' => 'strval', 'validates' => ['notEmpty', 'string']], 'bool' => ['source' => 'data', 'setter' => 'boolval', 'validates' => ['notEmpty', 'boolean']], 'email' => ['source' => 'data', 'type' => 'string', 'setter' => 'strval', 'validates' => ['notEmpty', 'string', 'email']], 'file' => ['source' => 'file', 'type' => '\\Zend\\Diactoros\\UploadedFile', 'validates' => ['file::uploaded']], 'image' => ['source' => 'file', 'type' => '\\Zend\\Diactoros\\UploadedFile', 'validates' => ["image::uploaded", "image::valid"]]]]]];
Example #21
0
function cleanupftp()
{
    global $maxbackups, $conn_id;
    $contents = ftp_nlist($conn_id, ".");
    rsort($contents);
    $currentbackups = count($contents);
    if ($currentbackups > $maxbackups) {
        // delete overspill items
        for ($i = $maxbackups; $i < $currentbackups; $i++) {
            deletebackup($contents[$i]);
        }
    }
    // list directory
    $contents = ftp_nlist($conn_id, ".");
    directory($contents);
}
<?php

if ($_GET["folder"] && (substr($_GET["folder"], 0, 1) == "." || preg_match("/.+\\.\\..+/", $_GET["folder"]))) {
    echo "no no no.";
    return;
}
$imagefolder = $_SERVER["DOCUMENT_ROOT"] . "/images/" . $_GET["folder"];
$thumbsfolder = $_SERVER["DOCUMENT_ROOT"] . "/thumbs/" . $_GET["folder"];
$pics = directory($imagefolder, "jpg,JPG,JPEG,jpeg,png,PNG,gif,GIF");
$pics = ditchtn($pics, "tn_");
if (!file_exists($thumbsfolder)) {
    mkdir($thumbsfolder);
}
if ($pics[0] != "") {
    foreach ($pics as $p) {
        createthumb($p, "tn_" . $p, 150, 150);
    }
}
/*
	Function ditchtn($arr,$thumbname)
	filters out thumbnails
*/
function ditchtn($arr, $thumbname)
{
    foreach ($arr as $item) {
        if (!preg_match("/^" . $thumbname . "/", $item)) {
            $tmparr[] = $item;
        }
    }
    return $tmparr;
}
Example #23
0
<?php

/**
 * CacheManager configuration:
 * - default cache store
 * - list of cache stored associated with their name, store class and set of custom options
 */
use Spiral\Cache\Stores;
return ['store' => 'memcache', 'stores' => ['file' => ['class' => Stores\FileStore::class, 'directory' => directory('cache'), 'extension' => 'cache'], 'xcache' => ['class' => Stores\XCacheStore::class, 'prefix' => 'spiral:'], 'apc' => ['class' => Stores\APCStore::class, 'prefix' => 'spiral:'], 'memcache' => ['class' => Stores\MemcacheStore::class, 'prefix' => 'spiral:', 'options' => [], 'servers' => [['host' => 'localhost', 'port' => 11211, 'persistent' => true]]]]];
Example #24
0
<?php

/**
 * Configuration of debug component and related classes:
 * - global log populated by every instance of spiral Logger and used in exception snapshots or
 *   profiler
 * - list of logger channels associated with their message handlers
 * - configuration for default debug snapshot implementation, including reporting directory and view
 *   to be used for exceptions
 */
use Spiral\Debug\Debugger;
use Spiral\Debug\Logger;
use Spiral\Debug\Logger\Handlers\FileHandler;
use Spiral\Http\HttpDispatcher;
return ['globalLogging' => ['enabled' => true, 'maxSize' => 1000], 'loggers' => [Debugger::class => [Logger::ERROR => ['class' => FileHandler::class, 'filename' => directory('runtime') . '/logging/errors.log'], Logger::ALL => ['class' => FileHandler::class, 'filename' => directory('runtime') . '/logging/debug.log']], HttpDispatcher::class => [Logger::WARNING => ['class' => FileHandler::class, 'filename' => directory('runtime') . '/logging/httpErrors.log']]], 'snapshots' => ['view' => 'spiral:exception', 'dumps' => false, 'reporting' => ['enabled' => false, 'maxSnapshots' => 20, 'directory' => directory('runtime') . '/logging/snapshots', 'filename' => '{date}-{exception}.html', 'dateFormat' => 'd.m.Y-Hi.s']]];
Example #25
0
function chk_dir($dir)
{
    if (!is_dir($dir)) {
        //@mkdir($dir,0777);
        directory($dir);
    }
    return $dir;
}
Example #26
0
<?php

/**
 * Configuration of debug component and related classes:
 * - list of logger channels associated with their message handlers
 * - configuration for default debug snapshot implementation, including reporting directory and view
 *   to be used for exceptions
 */
return ['snapshots' => ['view' => 'spiral:exception', 'dumps' => true, 'reporting' => ['enabled' => true, 'maxSnapshots' => 200, 'directory' => directory('runtime') . 'logging/snapshots/', 'filename' => '{date}-{exception}.html', 'dateFormat' => 'd.m.Y-Hi.s']]];
Example #27
0
        $output = '';
        foreach ($pics as $p) {
            //Don't make the thumbnails again!!
            if (file_exists($THUMBS_FOLDER . "tn_" . $p . '.' . $THUMB_FORMAT) == false) {
                createthumb($IMAGE_FOLDER . $p, $THUMBS_FOLDER . "tn_" . $p . '.' . $THUMB_FORMAT, $thumbw, $thumbh);
            }
            $output .= '			<div class="frame"><div class="imgcont"><div class="img"><p class="img"><a href="index.php?img=' . $p . '"><img src="' . $THUMBS_FOLDER . 'tn_' . $p . '.' . $THUMB_FORMAT . '" alt="' . $p . '" title="' . $p . ' | Last modified on ' . date("F d Y H:i:s.", filemtime($IMAGE_FOLDER . $p)) . '"/></a></p></div></div><div class="caption"><a href="index.php?img=' . $p . '"><b>' . $p . '</b></a></div></div>' . "\n";
        }
        echo '		<table border="0" width="100%" cellspacing="0" align="center"><tr><td>' . "\n";
        echo $output;
        echo '		</td></tr></table>' . "\n";
    } else {
        echo '			No images to display<br/>This makes me sad :(' . "\n";
    }
    //kill unused thumbs
    $thumbs = directory($THUMBS_FOLDER, "jpg,jpeg,png,gif");
    foreach ($thumbs as $t) {
        $tp = substr($t, 3, -4);
        if (!in_array($tp, $pics)) {
            unlink($THUMBS_FOLDER . $t);
        }
    }
}
echo '	</div>
</div>
</body></html>';
### ## #
## Functions
### ## #
function createthumb($name, $filename, $new_w, $new_h)
{
Example #28
0
<?php

/**
 * Scaffolding module component configuration file. Attention, configs might include runtime code
 * which depended on environment values only.
 *
 * @see ScaffolderConfig
 */
use Spiral\Scaffolder\Declarations;
return ['header' => ['{project-name}', '', '@author {author-name}'], 'directory' => directory('application') . 'classes/', 'namespace' => '', 'elements' => ['controller' => ['namespace' => 'Controllers', 'postfix' => 'Controller', 'class' => Declarations\ControllerDeclaration::class], 'middleware' => ['namespace' => 'Middlewares', 'postfix' => '', 'class' => Declarations\MiddlewareDeclaration::class], 'command' => ['namespace' => 'Commands', 'postfix' => 'Command', 'class' => Declarations\CommandDeclaration::class], 'service' => ['namespace' => 'Models', 'postfix' => 'Service', 'class' => Declarations\ServiceDeclaration::class], 'request' => ['namespace' => 'Requests', 'postfix' => 'Request', 'class' => Declarations\RequestDeclaration::class, 'mapping' => ['int' => ['source' => 'data', 'setter' => 'intval', 'validates' => ['notEmpty', 'integer']], 'float' => ['source' => 'data', 'setter' => 'floatval', 'validates' => ['notEmpty', 'float']], 'string' => ['source' => 'data', 'setter' => 'strval', 'validates' => ['notEmpty', 'string']], 'bool' => ['source' => 'data', 'setter' => 'boolval', 'validates' => ['notEmpty', 'boolean']], 'email' => ['source' => 'data', 'type' => 'string', 'setter' => 'strval', 'validates' => ['notEmpty', 'string', 'email']], 'file' => ['source' => 'file', 'type' => '\\Psr\\Http\\Message\\UploadedFileInterface', 'validates' => ['file::uploaded']], 'image' => ['source' => 'file', 'type' => '\\Psr\\Http\\Message\\UploadedFileInterface', 'validates' => ["image::uploaded", "image::valid"]]]], 'record' => ['namespace' => 'Database', 'postfix' => '', 'class' => Declarations\Database\RecordDeclaration::class], 'document' => ['namespace' => 'Database', 'postfix' => '', 'class' => Declarations\Database\DocumentDeclaration::class], 'documentEntity' => ['namespace' => 'Database', 'postfix' => '', 'class' => Declarations\Database\DocumentEntityDeclaration::class]]];
Example #29
0
<?php

/**
 * ViewManager component configuration file. Attention, configs might include runtime code which
 * depended on environment values only.
 *
 * @see ViewsConfig
 */
use Spiral\Stempler;
use Spiral\Views\Engines;
use Spiral\Views\Modifiers;
use Spiral\Views\Processors;
return ['cache' => ['enabled' => env('VIEW_CACHE'), 'directory' => directory("cache") . 'views/'], 'namespaces' => ['default' => [directory("application") . 'views/'], 'spiral' => [directory("libraries") . 'spiral/framework/source/views/', directory('libraries') . 'spiral/toolkit/source/views/'], 'profiler' => [directory('libraries') . 'spiral/profiler/source/views/']], 'environment' => ['language' => ['translator', 'getLocale'], 'basePath' => ['http', 'basePath']], 'engines' => ['twig' => ['class' => Engines\TwigEngine::class, 'extension' => 'twig', 'options' => ['auto_reload' => true], 'modifiers' => [Modifiers\TranslateModifier::class, Modifiers\EnvironmentModifier::class], 'extensions' => [Engines\Twig\Extensions\SpiralExtension::class]], 'dark' => ['class' => Engines\StemplerEngine::class, 'syntax' => Stempler\Syntaxes\DarkSyntax::class, 'extension' => 'dark.php', 'modifiers' => [Modifiers\TranslateModifier::class, Modifiers\EnvironmentModifier::class, Modifiers\EvaluatorExpressions::class], 'processors' => [Processors\EvaluateProcessor::class, Spiral\Toolkit\AssetManager::class, Processors\PrettifyProcessor::class]], 'native' => ['class' => Engines\NativeEngine::class, 'extension' => 'php']]];
Example #30
0
<?php

/**
 * Translator component configuration. Attention, configs might include runtime code which depended
 * on environment values only.
 *
 * @see TranslatorConfig
 */
use Symfony\Component\Translation;
return ['locale' => 'en', 'fallbackLocale' => 'en', 'domains' => ['validation' => ['spiral-validation-*'], 'spiral' => ['spiral-*', 'view-spiral-*'], 'profiler' => ['view-profiler-*'], 'views' => ['view-*'], 'messages' => ['*']], 'localesDirectory' => directory('locales'), 'loaders' => ['php' => Translation\Loader\PhpFileLoader::class, 'csv' => Translation\Loader\CsvFileLoader::class, 'po' => Translation\Loader\PoFileLoader::class], 'dumpers' => ['xliff' => Translation\Dumper\XliffFileDumper::class, 'php' => Translation\Dumper\PhpFileDumper::class, 'po' => Translation\Dumper\PoFileDumper::class], 'autoReload' => !env('TRANSLATOR_CACHE'), 'autoRegister' => true];