Development, Analysis And Research


References

Posted in General by Andrew Johnstone on the March 30th, 2005

Web Standards

Posted in General by Andrew Johnstone on the March 27th, 2005
No Tags

After pitching for the Museum of London it has brought to light the hypocritical nature of businesses and web standards. Why claim under false pretences that your site abides to web-standards? I find this fundamentally scrutinizing when it states "The Museum is not be liable for any loss, damage or inconvenience arising from your use of, or reliance on, the website". What is the purpose of a website if it inconveniences users? Three seconds later the browser is closed and the purpose of the site is detrimental to itself.

After attending the Royal National Institute For The Blind (RNIB) it has made me realise, how intricately designs ultimately hinder end-users performance. Balancing a graphically innovative site is a very tedious task and is difficult to cater every audience. Looks like I am going to have to do more research… Standards are pushing things in the right direction; however it’s down to common sense, although aspects as highlighted by RNIB, were not quite as apparent.

No Tags

Popularity: 2% [?]

PHP5 & COM (ADSI), Managing IIS

Posted in PHP by Andrew Johnstone on the March 14th, 2005
, , , ,

I have implemented a object model, which should be extensible enough to implement different providers for managing IIS.

Method Description

  • Get Retrieves a value for a named property from the object.
  • GetDataPaths Retrieves the paths to all locations of a metabase property subordinate to a specified starting path.
  • GetEx Retrieves a value or values for a named single-valued or multivalued property of the object.
  • GetInfo Reloads the object with property values that exist in the metabase.
  • GetPropertyAttribObj Retrieves an object that contains the property’s attributes. This object can then be used to etrieve individual attributes of ADSI properties.
  • Put Sets the value for a named property of an object.
  • PutEx Sets the value or values for a named single-valued or multivalued property of the object.
  • SetInfo Writes the object property values to the metabase.

This was writen quite some time ago, however I will publish it as it simple works.

edit: The size of the script was messing up the formating of the page, so a couple of versions have been attached.

IIS Management

Technorati , , , ,

Popularity: 2% [?]

PHP5 & ADSI (Active Directory Service Interfaces)

Posted in PHP by Andrew Johnstone on the March 14th, 2005
, , , , ,

Extending on Wez Furlongs article at zend on Com… Firstly lets clear up a little introduction to ADSI and its relevance to Com.

Active Directory Service Interfaces (ADSI) abstracts the capabilities of directory services from different network providers in a distributed computing environment, to present a single set of directory service interfaces for managing network resources. Administrators and developers can use ADSI services to enumerate and manage the resources in a directory service, no matter which network environment contains the resource.

The following figure shows how ADSI fits into an application environment. Whether the application is written in Visual Basic, C/C++, VBScript, Microsoft JScript, or as a Web application using Active Server Pages, Active Directory Service Interfaces provide a clean and easy-to-use access to the underlying directory services without having to use the native network APIs.
ADSI (Active Directory Service Interfaces) Model

Thats nice, but what can ADSI do?

ADSI exposes interfaces to automate common administrative tasks, such as adding users and groups, managing printers, and setting permissions on network resources. Administrators use Windows Management Instrumentation (WMI) to manage operating systems via Windows Management Instrumentation Query Language (WQL). WMI is a component of the Windows OS that is an industry initiative to develop a standard technology for accessing management information in an enterprise environment, which uses the Common Information Model (CIM) provider that represent systems, applications, networks, devices, and other managed components. Confused?

Through the use of these providers,..

  • winmgmts://
  • cim://
  • LDAP://
  • WinNT://
  • NDS://
  • NWCOMPAT://
  • More Providers

Some simple examples… (more…)

Technorati , , , , ,

Popularity: 7% [?]

@Will Fix Later…

Posted in General by Andrew Johnstone on the March 14th, 2005
No Tags

Switching servers to…
http://www.zwhosting.com/~ajohnsto/

No Tags

Popularity: 2% [?]

Parallel Instances of PHP on Windows

Posted in PHP by Andrew Johnstone on the March 14th, 2005
, , ,

Firstly, PHP has very little dependencies. It does not need any files copied to the system root as many installation instructions state (with the exception of certain PHP extensions).

PHP from the command line.

Usage: PHP [options] [-f] <file>[–][args…]
PHP [options] -r <code> [–] [args…]
PHP [options[ [-B <begin_code>] -R <code>[-E <end_code>] [–] [args…]
PHP [options] -B <begin_code>] -F <file> [-E <end_code>] [–] [args…]
PHP [options] — [args…]
      
 
-a   Run interactively
-c <path>|<file> Look for PHP.ini file in this directory
-n   No PHP.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e   Generate extended information for debugger/profiler
-f <file> Parse <file>.
-h   This help
-i   PHP information
-l   Syntax check only ( lint)
-m   Show compiled in modules
-r <code> Run PHP <code> without using script tags <?..?>
-B <begin_code> Run PHP <begin_code> before processing input lines
-R <code> Run PHP <code> for every input line
-F <file> Parse and execute <file> for every input line
-E <end_code> Run PHP <end_code> after processing all input lines
-H   Hide any passed arguments from external tools.
-s   Display colour syntax highlighted source.
-v   Version number
-w   Display source with stripped comments and whitespace.
-z   Load Zend extension <file>.
     
args…   Arguments passed to script. Use — args when first argument starts with - or script is read from stdin

As we can see a number of options can be passed to PHP that manipulates the way PHP acts. This will allow us to define the location of PHP.ini, if defined at all or other parameters that maybe injected. Apache is also configurable in a manner that will allow us to choose the PHP version to run upon apache's execution. For Example placing the following in httpd.conf will allow you to choose the version of PHP to be executed with apache.


<ifdefine PHP-5.0.0RC1>
  LoadModule PHP5_module C:\PHP\Distributions\PHP-5.0.0RC1-Win32\PHP5apache.dll
</ifdefine>

<ifdefine PHP-5.0.0RC2>
  LoadModule PHP5_module C:\PHP\Distributions\PHP-5.0.0RC2\PHP5apache.dll
</ifdefine>

<ifdefine PHP-5.0.0RC3>
  LoadModule PHP5_module C:\PHP\Distributions\PHP-5.0.0RC3-Win32\PHP5apache.dll
</ifdefine>

Using ' apache.exe -D PHP-5.0.0RC3-Win32'.

Note: IfDefine is case sensative, also ensure Capital D is used in the command line as lower case has a different function (-d directory initial value for ServerRoot & -D parameter define parameter for <ifdefine>).

If any failures occur at this point, there are two common reasons, firstly in early versions of PHP, version 4 requires PHP.ini & PHP4ts.dll. As so many installation manuals like to tell you DO NOT PLACE ANY FILES IN THE SYSTEM ROOT, the best way to encapsulate installations is by placing any required file in the root path of the PHP.exe location, if using CLI copy the (PHP4ts.dll or PHP5ts.dll) & PHP.ini to that directory.

The order for PHP is to locate required files is %system%, %system32%, %systemroot%, %apacheroot%, %phproot%; in the general order of the system variable %path%. I recommend the follow directory structure when installing PHP

cvs -d :pserver:cvsread@cvs.PHP.net:/repository checkout phpweb/distributions (extract all)

C:.
---PHP
    +---Distributions
        +---PHP-3.0.17-win32
        +—PHP-4.3.2-Win32
        +—PHP-4.3.3-Win32
        +—PHP-4.3.4-Win32
        +—PHP-4.3.5-Win32
        +—PHP-4.3.6-Win32
        +—PHP-4.3.7-Win32
        +—PHP-5.0.0RC1-Win32
        +—PHP-5.0.0RC2-Win32
        +—PHP-5.0.0RC3-Win32

For each, rename 'PHP.ini-dist' to 'PHP.ini' and if applicable copy 'PHP.ini-dist' & 'PHP4ts.dll/PHP5ts.dll' to the directory 'cli' as well as ammending 'PHP.ini' temp path to your systems temp. From each %rootphp% path you can configure that installation with its own customised 'ini'. I recommend reading PHP directives at php.net. From this you can setup VirtualHosts, such as http://PHP4/, http://php5/ etc, which will make switching between PHP 3, 4 & 5 simple :). Note: This is for development purposes and should not be used in a production enviroment.

Technorati , , ,

Popularity: 3% [?]