mirror of
https://github.com/flextype/flextype.git
synced 2025-08-10 23:24:04 +02:00
Code formating fixes
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
use Flextype\Component\{Filesystem\Filesystem, Registry\Registry};
|
||||
use Flextype\Component\Filesystem\Filesystem;
|
||||
use Flextype\Component\Registry\Registry;
|
||||
use \Doctrine\Common\Cache as DoctrineCache;
|
||||
|
||||
class Cache
|
||||
@@ -58,14 +59,18 @@ class Cache
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __clone() { }
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private wakeup method to enforce singleton behavior.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __wakeup() { }
|
||||
private function __wakeup()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private construct method to enforce singleton behavior.
|
||||
@@ -137,15 +142,19 @@ class Cache
|
||||
break;
|
||||
case 'memcache':
|
||||
$memcache = new \Memcache();
|
||||
$memcache->connect(Registry::get('system.cache.memcache.server', 'localhost'),
|
||||
Registry::get('system.cache.memcache.port', 11211));
|
||||
$memcache->connect(
|
||||
Registry::get('system.cache.memcache.server', 'localhost'),
|
||||
Registry::get('system.cache.memcache.port', 11211)
|
||||
);
|
||||
$driver = new DoctrineCache\MemcacheCache();
|
||||
$driver->setMemcache($memcache);
|
||||
break;
|
||||
case 'memcached':
|
||||
$memcached = new \Memcached();
|
||||
$memcached->addServer(Registry::get('system.cache.memcached.server', 'localhost'),
|
||||
Registry::get('system.cache.memcache.port', 11211));
|
||||
$memcached->addServer(
|
||||
Registry::get('system.cache.memcached.server', 'localhost'),
|
||||
Registry::get('system.cache.memcache.port', 11211)
|
||||
);
|
||||
$driver = new DoctrineCache\MemcachedCache();
|
||||
$driver->setMemcached($memcached);
|
||||
break;
|
||||
@@ -157,8 +166,10 @@ class Cache
|
||||
if ($socket) {
|
||||
$redis->connect($socket);
|
||||
} else {
|
||||
$redis->connect(Registry::get('system.cache.redis.server', 'localhost'),
|
||||
Registry::get('system.cache.redis.port', 6379));
|
||||
$redis->connect(
|
||||
Registry::get('system.cache.redis.server', 'localhost'),
|
||||
Registry::get('system.cache.redis.port', 6379)
|
||||
);
|
||||
}
|
||||
|
||||
// Authenticate with password if set
|
||||
@@ -306,12 +317,12 @@ class Cache
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
public static function getInstance()
|
||||
{
|
||||
if (is_null(Cache::$instance)) {
|
||||
Cache::$instance = new self;
|
||||
}
|
||||
|
||||
return Cache::$instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,11 @@
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
use Flextype\Component\{Arr\Arr, Http\Http, Filesystem\Filesystem, Event\Event, Registry\Registry};
|
||||
use Flextype\Component\Arr\Arr;
|
||||
use Flextype\Component\Http\Http;
|
||||
use Flextype\Component\Filesystem\Filesystem;
|
||||
use Flextype\Component\Event\Event;
|
||||
use Flextype\Component\Registry\Registry;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Thunder\Shortcode\ShortcodeFacade;
|
||||
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
|
||||
@@ -48,14 +52,18 @@ class Content
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __clone() { }
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private wakeup method to enforce singleton behavior.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __wakeup() { }
|
||||
private function __wakeup()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private construct method to enforce singleton behavior.
|
||||
@@ -234,7 +242,7 @@ class Content
|
||||
if ($url === '') {
|
||||
|
||||
// Get pages list
|
||||
$pages_list = Filesystem::getFilesList($file_path , 'html');
|
||||
$pages_list = Filesystem::getFilesList($file_path, 'html');
|
||||
|
||||
// Create pages cached id
|
||||
foreach ($pages_list as $key => $page) {
|
||||
@@ -251,7 +259,6 @@ class Content
|
||||
|
||||
Cache::save($pages_cache_id, $pages);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// Get pages list
|
||||
@@ -293,7 +300,6 @@ class Content
|
||||
|
||||
// Return pages array
|
||||
return $pages;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -340,7 +346,7 @@ class Content
|
||||
$_page = Yaml::parse(Content::processShortcodes($page_frontmatter));
|
||||
|
||||
// Create page url item
|
||||
$url = str_replace(PATH['pages'] , Http::getBaseUrl(), $file_path);
|
||||
$url = str_replace(PATH['pages'], Http::getBaseUrl(), $file_path);
|
||||
$url = str_replace('page.html', '', $url);
|
||||
$url = str_replace('.html', '', $url);
|
||||
$url = str_replace('\\', '/', $url);
|
||||
@@ -448,12 +454,12 @@ class Content
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
public static function getInstance()
|
||||
{
|
||||
if (is_null(Content::$instance)) {
|
||||
Content::$instance = new self;
|
||||
}
|
||||
|
||||
return Content::$instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,11 @@
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
use Flextype\Component\{Http\Http, Session\Session, ErrorHandler\ErrorHandler, Registry\Registry, Filesystem\Filesystem};
|
||||
use Flextype\Component\Http\Http;
|
||||
use Flextype\Component\Session\Session;
|
||||
use Flextype\Component\ErrorHandler\ErrorHandler;
|
||||
use Flextype\Component\Registry\Registry;
|
||||
use Flextype\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class Flextype
|
||||
@@ -37,14 +41,18 @@ class Flextype
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __clone() { }
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private wakeup method to enforce singleton behavior.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __wakeup() { }
|
||||
private function __wakeup()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private construct method to enforce singleton behavior.
|
||||
@@ -158,12 +166,12 @@ class Flextype
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
public static function getInstance()
|
||||
{
|
||||
if (is_null(Flextype::$instance)) {
|
||||
Flextype::$instance = new self;
|
||||
}
|
||||
|
||||
return Flextype::$instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,10 @@
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
use Flextype\Component\{Filesystem\Filesystem, Event\Event, I18n\I18n, Registry\Registry};
|
||||
use Flextype\Component\Filesystem\Filesystem;
|
||||
use Flextype\Component\Event\Event;
|
||||
use Flextype\Component\I18n\I18n;
|
||||
use Flextype\Component\Registry\Registry;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class Plugins
|
||||
@@ -70,14 +73,18 @@ class Plugins
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __clone() { }
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private wakeup method to enforce singleton behavior.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __wakeup() { }
|
||||
private function __wakeup()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private construct method to enforce singleton behavior.
|
||||
@@ -131,7 +138,6 @@ class Plugins
|
||||
|
||||
// Go through...
|
||||
foreach ($plugins_list as $plugin) {
|
||||
|
||||
if (Filesystem::fileExists($_plugin_settings = PATH['plugins'] . '/' . $plugin . '/settings.yaml')) {
|
||||
$plugin_settings = Yaml::parseFile($_plugin_settings);
|
||||
}
|
||||
@@ -179,10 +185,10 @@ class Plugins
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public static function getLocales()
|
||||
{
|
||||
public static function getLocales()
|
||||
{
|
||||
return Plugins::$locales;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Plugins instance.
|
||||
@@ -190,12 +196,12 @@ class Plugins
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
public static function getInstance()
|
||||
{
|
||||
if (is_null(Plugins::$instance)) {
|
||||
Plugins::$instance = new self;
|
||||
}
|
||||
|
||||
return Plugins::$instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,9 @@
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
use Flextype\Component\{Filesystem\Filesystem, View\View, Registry\Registry};
|
||||
use Flextype\Component\Filesystem\Filesystem;
|
||||
use Flextype\Component\View\View;
|
||||
use Flextype\Component\Registry\Registry;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
class Themes
|
||||
@@ -29,14 +31,18 @@ class Themes
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __clone() { }
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private wakeup method to enforce singleton behavior.
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
private function __wakeup() { }
|
||||
private function __wakeup()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Private construct method to enforce singleton behavior.
|
||||
@@ -115,12 +121,12 @@ class Themes
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
public static function getInstance()
|
||||
{
|
||||
if (is_null(Themes::$instance)) {
|
||||
Themes::$instance = new self;
|
||||
}
|
||||
|
||||
return Themes::$instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user