Ejemplo n.º 1
0
 public function __construct()
 {
     if (!isset(static::$errors)) {
         if (Session::started() and Session::has('errors')) {
             static::$errors = Session::get('errors');
         } else {
             static::$errors = new Messages();
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Create a new login auth driver instance.
  *
  * @return void
  */
 public function __construct()
 {
     if (Session::started()) {
         $this->token = Session::get($this->token());
     }
     // If a token did not exist in the session for the user, we will attempt
     // to load the value of a "remember me" cookie for the driver, which
     // serves as a long-lived client side authenticator for the user.
     if (is_null($this->token)) {
         $this->token = $this->recall();
     }
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     // If a session driver has been specified, we will bind an instance of the
     // module error message container. If an error instance
     // exists in the session, we will use that instance.
     if (!isset(static::$errors)) {
         if (Session::started() and Session::has('errors')) {
             static::$errors = Session::get('errors');
         } else {
             static::$errors = new Messages();
         }
     }
 }
Ejemplo n.º 4
0
 public function __construct($view, $data = array())
 {
     parent::__construct($view, $data);
     // If a session driver has been specified, we will bind an instance of the
     // message container to every view. If a container instance
     // exists in the session, we will use that instance.
     $key = 'messages';
     if (!isset($this->data[$key])) {
         if (Session::started() and Session::has($key)) {
             $this->data[$key] = Session::get($key);
         } else {
             $this->data[$key] = new TypedMessages();
         }
     }
 }
Ejemplo n.º 5
0
 /**
  * Create a new view instance.
  *
  * <code>
  *		// Create a new view instance
  *		$view = new View('home.index');
  *
  *		// Create a new view instance of a bundle's view
  *		$view = new View('admin::home.index');
  *
  *		// Create a new view instance with bound data
  *		$view = new View('home.index', array('name' => 'Taylor'));
  * </code>
  *
  * @param  string  $view
  * @param  array   $data
  * @return void
  */
 public function __construct($view, $data = array())
 {
     $this->view = $view;
     $this->data = $data;
     $this->path = $this->path($view);
     // If a session driver has been specified, we will bind an instance of the
     // validation error message container to every view. If an errors instance
     // exists in the session, we will use that instance.
     //
     // This makes error display in the view extremely convenient, since the
     // developer can always assume they have a message container instance
     // available to them in the view's variables.
     if (!isset($this->data['errors'])) {
         if (Session::started() and Session::has('errors')) {
             $this->data['errors'] = Session::get('errors');
         } else {
             $this->data['errors'] = new Messages();
         }
     }
 }
Ejemplo n.º 6
0
 /**
  * Create a new view instance.
  *
  * <code>
  *		// Create a new view instance
  *		$view = new View('home.index');
  *
  *		// Create a new view instance of a bundle's view
  *		$view = new View('admin::home.index');
  *
  *		// Create a new view instance with bound data
  *		$view = new View('home.index', array('name' => 'Taylor'));
  * </code>
  *
  * @param  string  $view
  * @param  array   $data
  * @return void
  */
 public function __construct($view, $data = array())
 {
     $this->view = $view;
     $this->data = $data;
     // In order to allow developers to load views outside of the normal loading
     // conventions, we'll allow for a raw path to be given in place of the
     // typical view name, giving total freedom on view loading.
     if (starts_with($view, 'path: ')) {
         $this->path = substr($view, 6);
     } else {
         $this->path = $this->path($view);
     }
     // If a session driver has been specified, we will bind an instance of the
     // validation error message container to every view. If an error instance
     // exists in the session, we will use that instance.
     if (!isset($this->data['errors'])) {
         if (Session::started() and Session::has('errors')) {
             $this->data['errors'] = Session::get('errors');
         } else {
             $this->data['errors'] = new Messages();
         }
     }
 }
Ejemplo n.º 7
0
 /**
  * Test the Session::started method.
  *
  * @group laravel
  */
 public function testStartedMethodIndicatesIfSessionIsStarted()
 {
     $this->assertFalse(Session::started());
     Session::$instance = 'foo';
     $this->assertTrue(Session::started());
 }
Ejemplo n.º 8
0
 public function __construct()
 {
     if (Session::started()) {
         $this->token = Session::get($this->token());
     }
     if (is_null($this->token)) {
         $this->token = $this->recall();
     }
 }
Ejemplo n.º 9
0
 public function __construct($view, $data = array())
 {
     $this->view = $view;
     $this->data = $data;
     if (starts_with($view, 'path: ')) {
         $this->path = substr($view, 6);
     } else {
         $this->path = $this->path($view);
     }
     if (!isset($this->data['errors'])) {
         if (Session::started() and Session::has('errors')) {
             $this->data['errors'] = Session::get('errors');
         } else {
             $this->data['errors'] = new Messages();
         }
     }
 }
Ejemplo n.º 10
0
 /**
  * Create a new module instance.
  *
  * <code>
  *      // Create a new module instance
  *      $module = new Modules\Module('registration');
  *
  *      // Create a new module instance with a path
  *      $module = new Modules\Module('registration', 'registration/extended');
  *
  *      // Create a new module instance with a full path
  *      $module = new Modules\Module('registration', 'path: /var/www/project/registration');
  * </code>
  *
  * @param  string  $module
  * @param  string  $path
  * @return void
  */
 public function __construct($module_slug, $path = null)
 {
     $this->slug = $module_slug;
     $ins = \Laravel\Config::get('installed_modules.' . $module_slug);
     $this->installed = isset($ins) and !empty($ins) ? true : false;
     $this->enabled = \Laravel\Bundle::exists($this->slug);
     $this->installer = Installer::make($module_slug);
     // if path starts with "path: "
     // its a custom path
     if (!isset($path)) {
         $this->path = path('bundle') . $this->slug . DS;
     } else {
         if (starts_with($path, 'path: ')) {
             $this->path = substr($path, 6);
         } else {
             // sets the path to modules
             // folder + path
             // module with different folder name?
             $this->path = path('bundle') . $path;
         }
     }
     // If a session driver has been specified, we will bind an instance of the
     // module error message container. If an error instance
     // exists in the session, we will use that instance.
     if (!isset($this->errors)) {
         if (Session::started() and Session::has('errors')) {
             $this->errors = Session::get('errors');
         } else {
             $this->errors = new Messages();
         }
     }
 }