Exemplo n.º 1
0
 /**
  * Get all table data using memory cache
  * @param array $columns
  * @return \Illuminate\Database\Eloquent\Collection|mixed|static[]
  */
 public static function all($columns = ['*'])
 {
     $cacheName = 'activerecord.profilefield.all.' . implode('.', $columns);
     $records = MemoryObject::instance()->get($cacheName);
     if ($records === null) {
         $records = parent::all($columns);
         MemoryObject::instance()->set($cacheName, $records);
     }
     return $records;
 }
Exemplo n.º 2
0
 /**
  * Get all objects with query caching
  * @param $columns array
  * @return \Illuminate\Database\Eloquent\Collection
  * @throws SyntaxException
  */
 public static function all($columns = ['*'])
 {
     $cacheName = 'activercord.app.all.' . implode('.', $columns);
     $records = MemoryObject::instance()->get($cacheName);
     if ($records === null) {
         $records = parent::all($columns);
         MemoryObject::instance()->set($cacheName, $records);
     }
     if ($records === null) {
         throw new SyntaxException('Applications is not found in table "prefix_apps"!');
     }
     return $records;
 }
Exemplo n.º 3
0
 /**
  * Prepare static symbolic links for app services
  * @throws \InvalidArgumentException
  * @throws \Ffcms\Core\Exception\NativeException
  */
 private function nativeStaticLinks()
 {
     // initialize memory and properties controllers
     self::$Memory = MemoryObject::instance();
     self::$Properties = new Properties();
     // initialize debugger
     if (isset($this->_services['Debug']) && $this->_services['Debug'] === true && Debug::isEnabled()) {
         self::$Debug = new Debug();
     }
     // prepare request data
     self::$Request = Request::createFromGlobals();
     // initialize response, securty translate and other workers
     self::$Security = new Security();
     self::$Response = new Response();
     self::$View = new View();
     self::$Translate = new Translate();
     self::$Alias = new Alias();
     self::$Event = new EventManager();
     self::$Cron = new CronManager();
 }