Tagged: php RSS Toggle Comment Threads | Keyboard Shortcuts

  • webscriptz 00:16 on 02/11/2010 Permalink | Reply
    Tags: , , authentication, , php, , ,   

    Rijndael_256 & php & Yii frameworkstoring encrypted data 

    While programming my authentication module today, i’ve been experimenting with Rijndael 256 or AES as it is also known. This isn’t hard, at least not the code because php already includes everything as does Yii for that matter, no, the hard thing is to store an encrypted password.

    AES encodes your password but does so also by using characters that aren’t ‘printable’ at least not as signs. So I basically began looking for a way to have AES encode everything in characters in the ascii range, luckily for me php already has such functions included: base64_encode and _decode which is nice.

     
  • webscriptz 22:03 on 21/10/2010 Permalink | Reply
    Tags: , marchandiseduweb, mdw, mdw.com, , php, ,   

    MarchandiseDuWeb.com 

    Alright,

    The first real website I’ve written in Yii framework is online, just head over to http://marchandiseduweb.com (hopefully you know some French).

    I’m not telling you it’s a finished project because the database needs some items in it and you don’t see all the website (yet) online, just the ‘front website’ because the other parts have yet to be scripted, luckely the database design is complet/

     
  • webscriptz 21:37 on 19/10/2010 Permalink | Reply
    Tags: , php, ,   

    I made my decision about my project, having learned a lot with it, I think it’s time to recode the little thing. The database only counts 12 or 13 tables so it’s a not much but it’s rather that part of my application that needs some love and attention to get it to look more professional and uniform.

     
  • webscriptz 20:57 on 18/10/2010 Permalink | Reply
    Tags: application, , , fk, ik, php, pk, relational db, ,   

    Yii framework relations between models and tables 

    Now that my first application in Yii is completed, I’ve been studying up on the relations in the Yii framework to simplfy my application. These relations are the same as you find everywhere else but the things is that the tutorial, yet again, isn’t a beginner’s guide. It’s written by programmers, meaning everything the programmer already knows for himself or he thinks everybody knows is left out, which includes some essential things like primary key creation, index key creation and foreign keys.

    Nothing above is easy nor hard to accomplish but I think that I wouldn’t have hurt to explain in depth what the system does and how it works instead of just making up an exemple with eveyrthing in it, so I hope I can soon entertain you with a little more text about this.

     
  • webscriptz 15:00 on 04/09/2010 Permalink | Reply
    Tags: load, php, profile, profiling, , server   

    Profiling a php application 

    Today I’ve been talking with a friend of mine, Pieter. We share a server together for our websites,programming adventures etc.

    I’ve been talking about a project I’m writing and reminded me to go profile my application so the load of the application keeps low. So I’ve been searching the web for some easy profiling system, I came across Xdebug and others but the one that really struck my fancy was PHP quick profiler.

    It might not have every single feature other applications have in their toolbox but it’s easy to install and easy to work with. The things I’m most concerned about are shown nicely so I don’t need more

     
  • webscriptz 00:39 on 22/02/2010 Permalink | Reply
    Tags: annoyed, , , php, , ,   

    Annoyed…with coding 

    I’ve been coding away all week, that is between my other jobs at home :P

    In all my ‘wisdom’ and persistence i made a small app with Yii which stores data in an array and serializes it into a db, and a basic CRUD, a proof of concept to see if the framework was capable of doing this and in the fastest way possible.

    No problem so far, getting it is simple, but apparently you Yii doesn’t permit everything. So you need a $temp variable to store the model data in, suffice to say that it isn’t really the shortest route to take nor in my opinion the fastest bus alas I have to do with it. This little app of not more then a 60 lines of code took me four days, four damn days to figure out the error,  honestly if we have methods to ‘save space’ in your coding why not permit them?

    I’m not going to bother everybody with my nagging so, I’ll stop here.

    For those who want to see the topic on the yii forums.

     
  • webscriptz 23:47 on 20/12/2009 Permalink | Reply
    Tags: , , , , php, , , ,   

    YII framework configuration 

    I’m toying with the Yii Framework for some time now and even if i cost me a lot of anger and frustration in the beginning I’m starting to like it more and more, alas I do have to say that the documentation isn’t always that clear and for someone who begins or who’ll write some large applications the configuration file can be a hassle so here’s my solution:

    Brake down the configuration file in multiple files, this will give you some speed disadvantage and some will  saying that I’m raping Yii framework purpose for speed but at least to me it seems more clear

    This is the protected.config/main.php

    dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=>'WEBSITENAME',
    'modules'=>array(
    'users'=>array(
    //sub modules in the module users
    'modules'=>array(
    'messaging',
    'profile',
    'dashboard',
    )
    ),
    'about',
    'forums',
    ),
    // preloading 'log' component active loading
    'preload'=>array('log'),
    
    // autoloading model and component classes lazy loading
    // I make the difference between CformModel and CActiveRecord
    'import'=>array(
    'application.models.*',
    'application.models.forms.*',
    'application.models.database.*',
    ),
    
    // application components
    'components'=>array(
    // enable cookie-based authentication
    'user'=>array('allowAutoLogin'=>true),
    
    // data relinquished to database.php
    // for easy access and usability as also for the future
    // installation procedure, it's less to write to a file
    'db'=>include(dirname(__FILE__).'/database.php'),
    
    // for a better overview we exculded url routes to a seperate file
    'urlManager'=>include(dirname(__FILE__).'/routes.php'),
    
    //authentication component needs data from db for CdbConnection
    'authManager'=>array(
    'class'=>'CDbAuthManager',
    'connectionID'=>'db',
    'defaultRoles'=>array('authenticated', 'guest'),
    ),
    
    //security measures
    'request'=>array(
    'enableCsrfValidation'=>true,
    'enableCookieValidation'=>true,
    ),
    ),
    
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    // uncomment the following if you want static params in the application
    //'params'=>array(include(dirname(__FILE__).'/params.php'))
    );

    database.php

    'CDbConnection',
    'connectionString'=>'mysql:host=localhost;dbname=mysql',
    //'connectionString'=>'pgsql:host=localhost;port=5432;dbname=mysql',
    'username' => 'root',
    'password' => '',
    );
    ?>
    

    routes.php

    'path', // path or get
    'urlSuffix' => '', //.html .whateverextentionyouwant
    'showScriptName' => true,
    'rules'=>array(
    'users/recovery/perimeterSecurity/'=>'users/recovery/perimeterSecurity',
    ),
    );
    ?>
    

    param.php

    //nothing in it at the moment

     
    • Cherry 10:58 on 30/12/2009 Permalink | Reply

      Hi,I’m trying Yii now.Almost everything could be done with Yii.But all the components,those how I configure ,will run.Something ,like,DB session…
      well,my english is so poor!

    • webscriptz 03:32 on 01/01/2010 Permalink | Reply

      I’m a bit torn between speed and programming luxury and because sometimes Yii is poorly documented, nice example code but not all the options are given actually sometimes very few.

      I’m currently doing models and testing them in Yii and i can’t get my head really around it, Codeigniter was really easy to use in the model logic but now what’s the logic, Model driven or controller driven because of the AR layer and the model sql query which seems implemented in the controllers. I thought controllers were just a gateway between view and model because it’s the model that usually contains all the logic not the controller.

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel